[amd64] Fix mingw-w64 build. (#4519)
[mono-project.git] / mono / utils / mono-math.c
blobf75064ba3c17b6fc02bb5a0a958bdd1d835404b0
2 #include "mono-math.h"
4 #ifndef HAVE_SIGNBIT
6 int
7 mono_signbit_float (float x)
9 union { float f; int i; } u;
11 u.f = x;
13 return u.i < 0;
16 int
17 mono_signbit_double (double x)
19 union { double d; int i[2]; } u;
21 u.d = x;
23 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
24 return u.i [1] < 0;
25 #else
26 return u.i [0] < 0;
27 #endif
30 #endif