Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / platform / float-math.c
1 #define unaryReal(func) \
2 float func##f (float x) { \
3 return (float)(func((double)x)); \
4 }
5 unaryReal(acos)
6 unaryReal(asin)
7 unaryReal(atan)
8 unaryReal(cos)
9 unaryReal(cosh)
10 unaryReal(exp)
11 unaryReal(fabs)
12 unaryReal(log)
13 unaryReal(log10)
14 unaryReal(rint)
15 unaryReal(sin)
16 unaryReal(sinh)
17 unaryReal(sqrt)
18 unaryReal(tan)
19 unaryReal(tanh)
20 #undef unaryReal
21
22 #define binaryReal(func) \
23 float func##f (float x, float y) { \
24 return (float)(func((double)x, (double)y)); \
25 }
26 binaryReal(atan2)
27 binaryReal(pow)
28 #undef binaryReal
29
30 float frexpf(float x, int *e) {
31 return (float)frexp((double)x, e);
32 }
33
34 float ldexpf (float x, int i) {
35 return (float)ldexp((double)x, i);
36 }