2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubbas_intern.h"
8 /*****************************************************************************
12 AROS_LHQUAD1(double, IEEEDPCeil
,
15 AROS_LHAQUAD(double, y
, D0
, D1
),
18 struct MathIeeeDoubBasBase
*, MathIeeeDoubBasBase
, 16, MathIeeeDoubBas
)
21 Calculates the ceiling value of an IEEE double precision number.
24 y - IEEE double precision floating point number.
31 negative : result is negative
41 IEEEDPFloor(), IEEEDPFix()
47 *****************************************************************************/
51 QUAD
* Qy
= (QUAD
*)&y
;
53 if (is_eqC((*Qy
),0,0))
55 SetSR(Zero_Bit
, Negative_Bit
|Overflow_Bit
|Zero_Bit
);
59 XOR64QC((*Qy
), IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
60 /* Ceil(y) = -Floor(-y); */
62 if (is_eqC((*Qy
), 0x0, 0x0))
64 Set_Value64C((*Qy
), 0, 0);
69 XOR64QC((*Qy
), IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);