fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / config / gen / platform / cygwin / math.c
blob74883be0087554c999380bb63b79e16046829d7b
1 /*
2 * Copyright (C) 2006-2009, Parrot Foundation.
3 * $Id$
4 */
6 /*
8 =head1 NAME
10 math.c
12 =head1 DESCRIPTION
14 math stuff
16 =head2 Functions
18 =over 4
20 =cut
25 * force atan2() to use fast IEEE behavior
28 #include <math.h>
30 #ifndef __STRICT_ANSI__
31 _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
32 #else
33 _LIB_VERSION_TYPE _LIB_VERSION = _POSIX_;
34 #endif
36 #if DOUBLE_SIZE == 2 * INT_SIZE
39 =item C<extern int Parrot_signbit(double x)>
41 return true if the Numval has a negative sign.
42 This is mostly for handling the -0.0 case.
44 =cut
48 extern int
49 Parrot_signbit(double x)
51 union {
52 double d;
53 int i[2];
54 } u;
55 u.d = x;
56 # if PARROT_BIGENDIAN
57 return u.i[0] < 0;
58 # else
59 return u.i[1] < 0;
60 # endif
62 #endif
64 #if NUMVAL_SIZE == 12 && DOUBLE_SIZE == 3 * INT_SIZE && PARROT_LITTLE_ENDIAN
67 =item C<int Parrot_signbit_l(long double x)>
69 Same as Parrot_signbit for long double.
71 Return true if the Numval has a negative sign.
72 This is mostly for handling the -0.0 case.
74 =cut
78 int
79 Parrot_signbit_l(long double x)
81 union {
82 long double d;
83 int i[3];
84 } u;
85 u.d = x;
86 return u.i[2] < 0;
88 #endif
92 =back
94 =cut
99 * Local variables:
100 * c-file-style: "parrot"
101 * End:
102 * vim: expandtab shiftwidth=4: