2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubbas_intern.h"
8 /*****************************************************************************
12 AROS_LHQUAD2(LONG
, IEEEDPCmp
,
15 AROS_LHAQUAD(double, y
, D0
, D1
),
16 AROS_LHAQUAD(double, z
, D2
, D3
),
19 struct MathIeeeDoubBasBase
*, MathIeeeDoubBasBase
, 7, MathIeeeDoubBas
)
22 Compares two IEEE double precision numbers.
25 y - IEEE double precision floating point number.
26 z - IEEE double precision floating point number.
50 *****************************************************************************/
54 QUAD
* Qy
= (QUAD
*)&y
;
55 QUAD
* Qz
= (QUAD
*)&z
;
59 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
63 if (is_lessSC(*Qy
,0,0) /* y < 0 */ && is_lessSC(z
,0,0) /* z < 0 */)
67 if (is_greater(*Qy
,*Qz
) /* -y > -z */ )
69 SetSR(0, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
74 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
79 if ( is_less(*Qy
,*Qz
) /* (QUAD)y < (QUAD)z */ )
81 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
86 SetSR(0, Zero_Bit
| Negative_Bit
| Overflow_Bit
);