Changeset 46077 for trunk/src/wp-includes/functions.php
- Timestamp:
- 09/07/2019 01:33:16 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r45932 r46077 7317 7317 return empty( $required ) || version_compare( phpversion(), $required, '>=' ); 7318 7318 } 7319 7320 /** 7321 * Check if two numbers are nearly the same. 7322 * 7323 * This is similar to using `round()` but the precision is more fine-grained. 7324 * 7325 * @since 5.3.0 7326 * 7327 * @param int|float $expected The expected value. 7328 * @param int|float $actual The actual number. 7329 * @param int|float $precision The allowed variation. 7330 * @return bool Whether the numbers match whithin the specified precision. 7331 */ 7332 function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { 7333 return abs( (float) $expected - (float) $actual ) <= $precision; 7334 }
Note: See TracChangeset
for help on using the changeset viewer.