2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
6 #include "mathieeesingbas_intern.h"
10 Calculate the largest integer ieeesp-number less than or equal to
14 IEEE single precision floating point
18 negative : result is negative
39 AROS_LH1(float, IEEESPFloor
,
40 AROS_LHA(float, y
, D0
),
41 struct LibHeader
*, MathIeeeSingBasBase
, 15, Mathieeesingbas
46 LONG Mask
= 0x80000000;
48 if (0x7f880000 == y
) return y
;
50 if ((y
& IEEESPExponent_Mask
) < 0x3f800000)
52 if (y
< 0) /* negative sign? */
54 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
55 return 0xbf800000; /* -1 */
59 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
65 Mask
>>= ((y
& IEEESPExponent_Mask
) >> 23) - 0x77;
70 /* is there anything behind the decimal dot? */
71 if (0 != (y
& (~Mask
)) )
73 y
= IEEESPAdd(y
, 0xbf800000 ); /* fnum = fnum -1; */
75 Mask
>>= ((y
& IEEESPExponent_Mask
) >> 23) - 0x77;
79 if(y
< 0) SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);