projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
20a3432ca6ebb1c7d2ca6746dd41bcdac74e4af0
[mono.git]
/
mono
/
utils
/
mono-math.c
1
/**
2
* \file
3
*/
4
5
#include "mono-math.h"
6
7
#ifndef HAVE_SIGNBIT
8
9
int
10
mono_signbit_float (float x)
11
{
12
union { float f; int i; } u;
13
14
u.f = x;
15
16
return u.i < 0;
17
}
18
19
int
20
mono_signbit_double (double x)
21
{
22
union { double d; int i[2]; } u;
23
24
u.d = x;
25
26
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
27
return u.i [1] < 0;
28
#else
29
return u.i [0] < 0;
30
#endif
31
}
32
33
#endif