Skip to content

Commit 3d0af3f

Browse files
committed
Adding a lot of math constants from math.h.
1 parent 244188c commit 3d0af3f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pixie/math.pxi

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,19 @@
2323
(i/defcfn ceil)
2424
(i/defcfn fabs)
2525
(i/defcfn floor)
26-
(i/defcfn fmod))
26+
(i/defcfn fmod)
27+
28+
(i/defconst M_E) ; base of natural logarithm, e
29+
(i/defconst M_LOG2E) ; log2(e)
30+
(i/defconst M_LOG10E) ; log10(e)
31+
(i/defconst M_LN2) ; ln(2)
32+
(i/defconst M_LN10) ; ln(10)
33+
(i/defconst M_PI) ; pi
34+
(i/defconst M_PI_2) ; pi / 2
35+
(i/defconst M_PI_4) ; pi / 4
36+
(i/defconst M_1_PI) ; 1 / pi
37+
(i/defconst M_2_PI) ; 2 / pi
38+
(i/defconst M_2_SQRTPI) ; 2 / sqrt(pi)
39+
(i/defconst M_SQRT2) ; sqrt(2)
40+
(i/defconst M_SQRT1_2)) ; sqrt(1/2)
41+

0 commit comments

Comments
 (0)