2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
6 #include "mathffp_intern.h"
10 Compares two ffp numbers
21 negative : fnum2 < fnum1
38 fnum1 is negative and fnum2 is positive
40 ( exponent(fnum1) < exponent(fnum2) and signs are equal )
44 fnum1 is positive and fnum2 is negative
46 ( exponent(fnum1) > exponent(fnum2) and signs are equal )
49 now the signs and exponents must be equal
55 mantisse(fnum1) < mantisse(fnum2)
65 AROS_LHA(float, fnum1
, D1
),
66 AROS_LHA(float, fnum2
, D0
),
67 struct LibHeader
*, MathBase
, 7, Mathffp
72 D(kprintf("SPCmp(%08x,%08x)=", fnum1
, fnum2
));
74 /* fnum1 is negative and fnum2 is positive
76 ** exponent of fnum1 is less than the exponent of fnum2
79 if ( (char)fnum1
< (char)fnum2
)
82 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
86 /* fnum1 is positive and fnum2 is negative
88 ** exponent of fnum1 is greater tban the exponent if fnum2
91 if ((char) fnum1
> (char) fnum2
)
94 SetSR(0, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
98 /*the signs and exponents of fnum1 and fnum2 must now be equal
104 SetSR(Zero_Bit
, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
108 /* mantisse(fnum1) < mantisse(fnum2) */
112 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
116 /* Mantisse(fnum1) > mantisse(fnum2) */
118 SetSR(0, Zero_Bit
| Negative_Bit
| Overflow_Bit
);