1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef PHP_MATH_H
23 #define PHP_MATH_H
24
25 PHPAPI zend_string *_php_math_number_format(double, int, char, char);
26 PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
27 PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);
28 PHPAPI zend_long _php_math_basetolong(zval *arg, int base);
29 PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret);
30 PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base);
31
32 PHP_FUNCTION(sin);
33 PHP_FUNCTION(cos);
34 PHP_FUNCTION(tan);
35 PHP_FUNCTION(asin);
36 PHP_FUNCTION(acos);
37 PHP_FUNCTION(atan);
38 PHP_FUNCTION(atan2);
39 PHP_FUNCTION(pi);
40 PHP_FUNCTION(exp);
41 PHP_FUNCTION(log);
42 PHP_FUNCTION(log10);
43 PHP_FUNCTION(is_finite);
44 PHP_FUNCTION(is_infinite);
45 PHP_FUNCTION(is_nan);
46 PHP_FUNCTION(pow);
47 PHP_FUNCTION(sqrt);
48 PHP_FUNCTION(srand);
49 PHP_FUNCTION(rand);
50 PHP_FUNCTION(getrandmax);
51 PHP_FUNCTION(mt_srand);
52 PHP_FUNCTION(mt_rand);
53 PHP_FUNCTION(mt_getrandmax);
54 PHP_FUNCTION(abs);
55 PHP_FUNCTION(ceil);
56 PHP_FUNCTION(floor);
57 PHP_FUNCTION(round);
58 PHP_FUNCTION(decbin);
59 PHP_FUNCTION(dechex);
60 PHP_FUNCTION(decoct);
61 PHP_FUNCTION(bindec);
62 PHP_FUNCTION(hexdec);
63 PHP_FUNCTION(octdec);
64 PHP_FUNCTION(base_convert);
65 PHP_FUNCTION(number_format);
66 PHP_FUNCTION(fmod);
67 PHP_FUNCTION(deg2rad);
68 PHP_FUNCTION(rad2deg);
69 PHP_FUNCTION(intdiv);
70
71
72
73
74
75 PHP_FUNCTION(hypot);
76 PHP_FUNCTION(expm1);
77 PHP_FUNCTION(log1p);
78
79 PHP_FUNCTION(sinh);
80 PHP_FUNCTION(cosh);
81 PHP_FUNCTION(tanh);
82
83 PHP_FUNCTION(asinh);
84 PHP_FUNCTION(acosh);
85 PHP_FUNCTION(atanh);
86
87 #include <math.h>
88
89 #ifndef M_E
90 #define M_E 2.7182818284590452354
91 #endif
92
93 #ifndef M_LOG2E
94 #define M_LOG2E 1.4426950408889634074
95 #endif
96
97 #ifndef M_LOG10E
98 #define M_LOG10E 0.43429448190325182765
99 #endif
100
101 #ifndef M_LN2
102 #define M_LN2 0.69314718055994530942
103 #endif
104
105 #ifndef M_LN10
106 #define M_LN10 2.30258509299404568402
107 #endif
108
109 #ifndef M_PI
110 #define M_PI 3.14159265358979323846
111 #endif
112
113 #ifndef M_PI_2
114 #define M_PI_2 1.57079632679489661923
115 #endif
116
117 #ifndef M_PI_4
118 #define M_PI_4 0.78539816339744830962
119 #endif
120
121 #ifndef M_1_PI
122 #define M_1_PI 0.31830988618379067154
123 #endif
124
125 #ifndef M_2_PI
126 #define M_2_PI 0.63661977236758134308
127 #endif
128
129 #ifndef M_SQRTPI
130 #define M_SQRTPI 1.77245385090551602729
131 #endif
132
133 #ifndef M_2_SQRTPI
134 #define M_2_SQRTPI 1.12837916709551257390
135 #endif
136
137 #ifndef M_LNPI
138 #define M_LNPI 1.14472988584940017414
139 #endif
140
141 #ifndef M_EULER
142 #define M_EULER 0.57721566490153286061
143 #endif
144
145 #ifndef M_SQRT2
146 #define M_SQRT2 1.41421356237309504880
147 #endif
148
149 #ifndef M_SQRT1_2
150 #define M_SQRT1_2 0.70710678118654752440
151 #endif
152
153 #ifndef M_SQRT3
154 #define M_SQRT3 1.73205080756887729352
155 #endif
156
157
158 #ifndef PHP_ROUND_HALF_UP
159 #define PHP_ROUND_HALF_UP 0x01
160 #endif
161
162 #ifndef PHP_ROUND_HALF_DOWN
163 #define PHP_ROUND_HALF_DOWN 0x02
164 #endif
165
166 #ifndef PHP_ROUND_HALF_EVEN
167 #define PHP_ROUND_HALF_EVEN 0x03
168 #endif
169
170 #ifndef PHP_ROUND_HALF_ODD
171 #define PHP_ROUND_HALF_ODD 0x04
172 #endif
173
174 #endif