Splitter Test written. Doesn't pass.
[order_line_extra.git] / hincludes / lib / Math.class.php
1 <?php
2
3 class Math {
4         public function __construct(){}
5         static $PI;
6         static $NaN;
7         static $POSITIVE_INFINITY;
8         static $NEGATIVE_INFINITY;
9         static function abs($v) {
10                 return abs($v);
11         }
12         static function min($a, $b) {
13                 return min($a, $b);
14         }
15         static function max($a, $b) {
16                 return max($a, $b);
17         }
18         static function sin($v) {
19                 return sin($v);
20         }
21         static function cos($v) {
22                 return cos($v);
23         }
24         static function atan2($y, $x) {
25                 return atan2($y, $x);
26         }
27         static function tan($v) {
28                 return tan($v);
29         }
30         static function exp($v) {
31                 return exp($v);
32         }
33         static function log($v) {
34                 return log($v);
35         }
36         static function sqrt($v) {
37                 return sqrt($v);
38         }
39         static function round($v) {
40                 return (int) floor($v + 0.5);
41         }
42         static function floor($v) {
43                 return (int) floor($v);
44         }
45         static function ceil($v) {
46                 return (int) ceil($v);
47         }
48         static function atan($v) {
49                 return atan($v);
50         }
51         static function asin($v) {
52                 return asin($v);
53         }
54         static function acos($v) {
55                 return acos($v);
56         }
57         static function pow($v, $exp) {
58                 return pow($v, $exp);
59         }
60         static function random() {
61                 return mt_rand() / mt_getrandmax();
62         }
63         static function isNaN($f) {
64                 return is_nan($f);
65         }
66         static function isFinite($f) {
67                 return is_finite($f);
68         }
69         function __toString() { return 'Math'; }
70 }
71 {
72         Math::$PI = M_PI;
73         Math::$NaN = acos(1.01);
74         Math::$NEGATIVE_INFINITY = log(0);
75         Math::$POSITIVE_INFINITY = -Math::$NEGATIVE_INFINITY;
76 }