| 1 | <?php |
||
| 7 | class Math |
||
| 8 | { |
||
| 9 | const EPSILON = 0.0000000001; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Returns the greatest common divisor of two floats. |
||
| 13 | * |
||
| 14 | * @param float $a |
||
| 15 | * @param float $b |
||
| 16 | * |
||
| 17 | * @return float |
||
| 18 | */ |
||
| 19 | public static function gcd(float $a, float $b): float |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Tests whether a float is zero. |
||
| 26 | * |
||
| 27 | * @param float $x |
||
| 28 | * |
||
| 29 | * @return bool |
||
| 30 | */ |
||
| 31 | public static function isZero(float $x): bool |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Tests whether a number is greater than another. |
||
| 38 | * |
||
| 39 | * @param float $a |
||
| 40 | * @param float $b |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public static function isGreaterThan(float $a, float $b): bool |
||
| 48 | } |
||
| 49 |