Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / mathieeedoubbas / ieeedptst.c
blobb69d6c3abc46104653c8d10060e84856e20fedd2
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathieeedoubbas_intern.h"
8 /*
9 FUNCTION
10 Compare a IEEE double precision floting point number against zero.
12 RESULT
13 <code>
14 +1 : y > 0.0
15 0 : y = 0.0
16 -1 : y < 0.0
18 Flags:
19 zero : result is zero
20 negative : result is negative
21 overflow : 0
22 </code>
24 NOTES
26 EXAMPLE
28 BUGS
30 SEE ALSO
32 INTERNALS
33 ALGORITHM:
34 Sign is negative: return -1
35 y == 0 : return 0
36 Otherwise : return 1
39 AROS_LHQUAD1(LONG, IEEEDPTst,
40 AROS_LHAQUAD(double, y, D0, D1),
41 struct MathIeeeDoubBasBase *, MathIeeeDoubBasBase, 8, MathIeeeDoubBas
44 AROS_LIBFUNC_INIT
46 QUAD * Qy = (QUAD *)&y;
48 /* y is negative */
49 if (is_lessSC(*Qy, 0x0, 0x0) /* y < 0 */)
51 SetSR(Negative_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
52 return -1;
55 /* fnum1 is zero */
56 if (is_eqC(*Qy, 0x0, 0x0) /* y == 0 */)
58 SetSR(Zero_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
59 return 0;
62 /* fnum1 is positive */
63 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
65 return 1;
67 AROS_LIBFUNC_EXIT