2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubbas_intern.h"
13 IEEE double precision number
17 negative : result is negative
33 AROS_LHQUAD1(double, IEEEDPFlt
,
34 AROS_LHAQUAD(LONG
, y
, D0
, D1
),
35 struct MathIeeeDoubBasBase
*, MathIeeeDoubBasBase
, 6, MathIeeeDoubBas
41 LONG TestMask
= 0xFFFFFFFF;
42 QUAD Res
, yQuad
, ExponentQuad
;
43 double * DRes
= (double *)&Res
;
45 Set_Value64C(Res
,0,0);
49 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
50 return *DRes
; /* return 0 */
55 Set_Value64C(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
58 /* find out which is the number of the highest set bit */
65 SHL32(yQuad
, y
, (53 - Exponent
) );
67 AND64QC(yQuad
, IEEEDPMantisse_Mask_Hi
, IEEEDPMantisse_Mask_Lo
);
71 /* adapt Exponent to IEEEDP-Format */
72 SHL32(ExponentQuad
, Exponent
, 52);
74 OR64Q(Res
, ExponentQuad
);
75 if ( is_lessSC(Res
,0,0) ) /* Res < 0 */
77 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);