grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / mathieeesingbas / ieeesptst.c
blobabb7d867d30916d2c7d9f087d7ac44b0bb5fad9f
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathieeesingbas_intern.h"
8 /*****************************************************************************
10 NAME */
12 AROS_LH1(LONG, IEEESPTst,
14 /* SYNOPSIS */
15 AROS_LHA(float, y, D0),
17 /* LOCATION */
18 struct LibHeader *, MathIeeeSingBasBase, 8, Mathieeesingbas)
20 /* FUNCTION
21 Compare a ieeesp-number against zero.
23 INPUTS
25 RESULT
26 +1 : y > 0.0
27 0 : y = 0.0
28 -1 : y < 0.0
30 Flags:
31 zero : result is zero
32 negative : result is negative
33 overflow : 0
35 BUGS
37 INTERNALS
38 ALGORITHM:
39 Sign is negative: return -1
40 y == 0 : return 0
41 Otherwise : return 1
43 *****************************************************************************/
45 AROS_LIBFUNC_INIT
47 /* y is negative */
48 if (y < 0)
50 SetSR(Negative_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
51 return -1;
54 /* fnum1 is zero */
55 if (0 == y)
57 SetSR(Zero_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
58 return 0;
61 /* fnum1 is positive */
62 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
64 return 1;
66 AROS_LIBFUNC_EXIT