You are here

function _location_floats_are_equal in Location 5

Same name and namespace in other branches
  1. 5.3 location.module \_location_floats_are_equal()
  2. 6.3 location.module \_location_floats_are_equal()
  3. 7.5 location.module \_location_floats_are_equal()
  4. 7.3 location.module \_location_floats_are_equal()
  5. 7.4 location.module \_location_floats_are_equal()

Helper function for seeing if two floats are equal. We could use other functions, but all of them belong to libraries that do not come standard with PHP out of the box.

2 calls to _location_floats_are_equal()
location_extra_form_submit in ./location.module
location_nodeapi in ./location.module
Implementation of hook_nodeapi().

File

./location.module, line 1569

Code

function _location_floats_are_equal($x, $y) {
  $x = floatval($x);
  $y = floatval($y);
  return abs(max($x, $y) - min($x, $y)) < pow(10, -6);
}