1 | <?php |
||
14 | final class DecimalConstants |
||
15 | { |
||
16 | private static $ZERO = null; |
||
17 | private static $ONE = null; |
||
18 | private static $NEGATIVE_ONE = null; |
||
19 | |||
20 | private static $PI = null; |
||
21 | private static $EulerMascheroni = null; |
||
22 | |||
23 | private static $GoldenRatio = null; |
||
24 | |||
25 | private static $SilverRatio = null; |
||
26 | |||
27 | private static $LightSpeed = null; |
||
28 | |||
29 | /** |
||
30 | * Private constructor |
||
31 | */ |
||
32 | private function __construct() |
||
36 | |||
37 | /** |
||
38 | * Private clone method |
||
39 | */ |
||
40 | private function __clone() |
||
44 | |||
45 | 42 | public static function zero() |
|
52 | |||
53 | 61 | public static function one() |
|
60 | |||
61 | 40 | public static function negativeOne() |
|
68 | |||
69 | /** |
||
70 | * Returns the Pi number. |
||
71 | * @return Decimal |
||
72 | */ |
||
73 | 38 | public static function pi() |
|
82 | |||
83 | /** |
||
84 | * Returns the Euler's E number. |
||
85 | * @param integer $scale |
||
86 | * @return Decimal |
||
87 | */ |
||
88 | 3 | public static function e($scale = 32) |
|
99 | |||
100 | /** |
||
101 | * Returns the Euler-Mascheroni constant. |
||
102 | * @return Decimal |
||
103 | */ |
||
104 | 1 | public static function eulerMascheroni() |
|
113 | |||
114 | /** |
||
115 | * Returns the Golden Ration, also named Phi. |
||
116 | * @return Decimal |
||
117 | */ |
||
118 | 1 | public static function goldenRatio() |
|
127 | |||
128 | /** |
||
129 | * Returns the Silver Ratio. |
||
130 | * @return Decimal |
||
131 | */ |
||
132 | 1 | public static function silverRatio() |
|
141 | |||
142 | /** |
||
143 | * Returns the Light of Speed measured in meters / second. |
||
144 | * @return Decimal |
||
145 | */ |
||
146 | 1 | public static function lightSpeed() |
|
153 | } |
||
154 |