added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / mathieeesingbas / ieeesptst.c
blobae32ea7b06b718675a9793dc037520b5fc0bbf7d
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathieeesingbas_intern.h"
8 /*
9 FUNCTION
10 Compare a ieeesp-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
33 INTERNALS
34 ALGORITHM:
35 <code>
36 Sign is negative: return -1
37 y == 0 : return 0
38 Otherwise : return 1
39 </code>
41 HISTORY
44 AROS_LH1(LONG, IEEESPTst,
45 AROS_LHA(float, y, D0),
46 struct LibHeader *, MathIeeeSingBasBase, 8, Mathieeesingbas
49 AROS_LIBFUNC_INIT
51 /* y is negative */
52 if (y < 0)
54 SetSR(Negative_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
55 return -1;
58 /* fnum1 is zero */
59 if (0 == y)
61 SetSR(Zero_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
62 return 0;
65 /* fnum1 is positive */
66 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
68 return 1;
70 AROS_LIBFUNC_EXIT