Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / mathieeesingbas / ieeespcmp.c
blob7ddec3ac090c469c9346b51922f29fe174a5a532
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathieeesingbas_intern.h"
8 /*
9 FUNCTION
10 Compares two ieeesp numbers
12 RESULT
13 <code>
14 +1 : y > z
15 0 : y = z
16 -1 : y < z
19 Flags:
20 zero : y = z
21 negative : y < z
22 overflow : 0
23 </code>
25 NOTES
27 EXAMPLE
29 BUGS
31 SEE ALSO
34 INTERNALS
36 HISTORY
39 AROS_LH2(LONG, IEEESPCmp,
40 AROS_LHA(LONG, y, D0),
41 AROS_LHA(LONG, z, D1),
42 struct LibHeader *, MathIeeeSingBasBase, 7, Mathieeesingbas
45 AROS_LIBFUNC_INIT
47 if (y == z)
49 SetSR(Zero_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
50 return 0;
53 if (y < 0 && z < 0)
55 if (-y > -z)
57 SetSR(0, Zero_Bit | Negative_Bit | Overflow_Bit);
58 return 1;
60 else
62 SetSR(Negative_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
63 return -1;
67 if ((LONG)y < (LONG)z)
69 SetSR(Negative_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
70 return -1;
72 else
74 SetSR(0, Zero_Bit | Negative_Bit | Overflow_Bit);
75 return 1;
78 AROS_LIBFUNC_EXIT