2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathtrans_intern.h"
10 Convert single precision ieee number to FFP number
13 Motorola fast floating point number
17 negative : result is negative
18 overflow : exponent of the ieee-number was out of range for
34 AROS_LH1(float, SPFieee
,
35 AROS_LHA(float, ieeenum
, D0
),
36 struct Library
*, MathTransBase
, 18, MathTrans
43 /* check for ieeenum == 0 */
46 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
50 /* calculate the exponent */
51 Res
= (ieeenum
& IEEESPExponent_Mask
) >> 23;
52 Res
= Res
- 126 + 0x40;
54 /* exponent too big / small */
57 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
61 Res
|= (ieeenum
<< 8) | 0x80000000;
63 /* check ieeenum-number for a sign */
67 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);