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
, D0
),
66 AROS_LHA(float, fnum2
, D1
),
67 struct LibHeader
*, MathBase
, 7, Mathffp
72 /* fnum1 is negative and fnum2 is positive
74 ** exponent of fnum1 is less than the exponent of fnum2
77 if ( (char)fnum1
< (char)fnum2
)
79 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
83 /* fnum1 is positive and fnum2 is negative
85 ** exponent of fnum1 is greater tban the exponent if fnum2
88 if ((char) fnum1
> (char) fnum2
)
90 SetSR(0, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
94 /*the signs and exponents of fnum1 and fnum2 must now be equal
99 SetSR(Zero_Bit
, Zero_Bit
| Overflow_Bit
| Negative_Bit
);
103 /* mantisse(fnum1) < mantisse(fnum2) */
106 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
110 /* Mantisse(fnum1) > mantisse(fnum2) */
111 SetSR(0, Zero_Bit
| Negative_Bit
| Overflow_Bit
);