1 /* math.c - these are based on bob smith's csharp routines */
\r
5 #include <mono/metadata/sysmath.h>
\r
8 # if G_BYTE_ORDER == G_BIG_ENDIAN
\r
9 # define __nan_bytes { 0x7f, 0xc0, 0, 0 }
\r
11 # if G_BYTE_ORDER == G_LITTLE_ENDIAN
\r
12 # define __nan_bytes { 0, 0, 0xc0, 0x7f }
\r
15 static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes };
\r
16 # define NAN (__nan_union.__d)
\r
20 #define __huge_val_t union { unsigned char __c[8]; double __d; }
\r
21 # if G_BYTE_ORDER == G_BIG_ENDIAN
\r
22 # define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
\r
24 # if G_BYTE_ORDER == G_LITTLE_ENDIAN
\r
25 # define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
\r
27 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
\r
28 # define HUGE_VAL (__huge_val.__d)
\r
32 ves_icall_System_Math_Sin (gdouble x)
\r
38 ves_icall_System_Math_Cos (gdouble x)
\r
44 ves_icall_System_Math_Tan (gdouble x)
\r
50 ves_icall_System_Math_Sinh (gdouble x)
\r
56 ves_icall_System_Math_Cosh (gdouble x)
\r
62 ves_icall_System_Math_Tanh (gdouble x)
\r
68 ves_icall_System_Math_Acos (gdouble x)
\r
70 if (x < -1 || x > 1)
\r
77 ves_icall_System_Math_Asin (gdouble x)
\r
79 if (x < -1 || x > 1)
\r
86 ves_icall_System_Math_Atan (gdouble x)
\r
92 ves_icall_System_Math_Atan2 (gdouble y, gdouble x)
\r
94 return atan2 (y, x);
\r
98 ves_icall_System_Math_Exp (gdouble x)
\r
104 ves_icall_System_Math_Log (gdouble x)
\r
115 ves_icall_System_Math_Log10 (gdouble x)
\r
126 ves_icall_System_Math_Pow (gdouble x, gdouble y)
\r
132 ves_icall_System_Math_Sqrt (gdouble x)
\r