2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
7 #include <libraries/mathffp.h>
8 #include <aros/libcall.h>
9 #include <proto/mathffp.h>
10 #include <proto/mathtrans.h>
11 #include <exec/types.h>
12 #include "mathtrans_intern.h"
14 LONG
intern_SPLd(ULONG fnum
)
16 ULONG i
= 0, Res
= 0, c
;
17 ULONG Mask
= 0x80000000;
19 if (onehalf
== fnum
) return minusone
;
21 while (Res
== 0 && i
<= 23)
23 if ( sqrtonehalf
< fnum
)
26 fnum
= SPMul(fnum
, fnum
);
32 fnum
= SPMul(fnum
, fnum
);
39 while ((char) Mask
!= 0x40 && c
< 24 )
41 if ( sqrtonehalf
< fnum
)
43 fnum
= SPMul(fnum
, fnum
);
48 fnum
= SPMul(fnum
, fnum
);
59 Res
&= FFPMantisse_Mask
;
62 return (Res
| (0x40-i
) | FFPSign_Mask
);