Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit 311a733

Browse files
committed
Arithmetic: Add more constants.
2 parents b88b213 + 92a7644 commit 311a733

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

Diff for: Context.php

+18-8
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,24 @@ protected function initializeConstants()
245245

246246
if (null === $_constants) {
247247
$_constants = new \ArrayObject([
248-
'PI' => M_PI,
249-
'PI_2' => M_PI_2,
250-
'PI_4' => M_PI_4,
251-
'E' => M_E,
252-
'SQRT_PI' => M_SQRTPI,
253-
'SQRT_2' => M_SQRT2,
254-
'SQRT_3' => M_SQRT3,
255-
'LN_PI' => M_LNPI
248+
'PI' => M_PI,
249+
'PI_2' => M_PI_2,
250+
'PI_4' => M_PI_4,
251+
'E' => M_E,
252+
'SQRT_PI' => M_SQRTPI,
253+
'SQRT_2' => M_SQRT2,
254+
'SQRT_3' => M_SQRT3,
255+
'LN_PI' => M_LNPI,
256+
'LOG_2E' => M_LOG2E,
257+
'LOG_10E' => M_LOG10E,
258+
'LN_2' => M_LN2,
259+
'LN_10' => M_LN10,
260+
'ONE_OVER_PI' => M_1_PI,
261+
'TWO_OVER_PI' => M_2_PI,
262+
'TWO_OVER_SQRT_PI' => M_2_SQRTPI,
263+
'ONE_OVER_SQRT_2' => M_SQRT1_2,
264+
'EULER' => M_EULER,
265+
'INFINITE' => INF
256266
]);
257267
}
258268

Diff for: Test/Unit/Context.php

+18-8
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,24 @@ public function case_context_has_predefined_constants()
101101
->isInstanceOf('ArrayObject')
102102
->array(iterator_to_array($result))
103103
->isEqualTo([
104-
'PI' => M_PI,
105-
'PI_2' => M_PI_2,
106-
'PI_4' => M_PI_4,
107-
'E' => M_E,
108-
'SQRT_PI' => M_SQRTPI,
109-
'SQRT_2' => M_SQRT2,
110-
'SQRT_3' => M_SQRT3,
111-
'LN_PI' => M_LNPI
104+
'PI' => M_PI,
105+
'PI_2' => M_PI_2,
106+
'PI_4' => M_PI_4,
107+
'E' => M_E,
108+
'SQRT_PI' => M_SQRTPI,
109+
'SQRT_2' => M_SQRT2,
110+
'SQRT_3' => M_SQRT3,
111+
'LN_PI' => M_LNPI,
112+
'LOG_2E' => M_LOG2E,
113+
'LOG_10E' => M_LOG10E,
114+
'LN_2' => M_LN2,
115+
'LN_10' => M_LN10,
116+
'ONE_OVER_PI' => M_1_PI,
117+
'TWO_OVER_PI' => M_2_PI,
118+
'TWO_OVER_SQRT_PI' => M_2_SQRTPI,
119+
'ONE_OVER_SQRT_2' => M_SQRT1_2,
120+
'EULER' => M_EULER,
121+
'INFINITE' => INF
112122
]);
113123
}
114124

0 commit comments

Comments
 (0)