2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubbas_intern.h"
8 /*****************************************************************************
12 AROS_LH1(double, IEEEDPFlt
,
15 AROS_LHA(LONG
, y
, D0
),
18 struct MathIeeeDoubBasBase
*, MathIeeeDoubBasBase
, 6, MathIeeeDoubBas
)
25 IEEE double precision number
29 negative : result is negative
36 *****************************************************************************/
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
);