function _location_floats_are_equal in Location 5
Same name and namespace in other branches
- 5.3 location.module \_location_floats_are_equal()
- 6.3 location.module \_location_floats_are_equal()
- 7.5 location.module \_location_floats_are_equal()
- 7.3 location.module \_location_floats_are_equal()
- 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);
}