function _location_floats_are_equal in Location 7.4
Same name and namespace in other branches
- 5.3 location.module \_location_floats_are_equal()
- 5 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()
Epsilon test. 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_has_coordinates in ./
location.module - Check whether a location has coordinates or not.
- location_locationapi in ./
location.module - Implementation of hook_locationapi().
File
- ./
location.module, line 1038 - Location module main routines. An implementation of a universal API for location manipulation. Provides functions for postal_code proximity searching, deep-linking into online mapping services. Currently, some options are configured through an…
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);
}