Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / mathieeesingbas / ieeespabs.c
blob4d90d634193fcead411d1c8d350ea366fb3f1a69
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(float, IEEESPAbs,
14 /* SYNOPSIS */
15 AROS_LHA(float, y, D0),
17 /* LOCATION */
18 struct LibHeader *, MathIeeeSingBasBase, 9, Mathieeesingbas)
20 /* FUNCTION
21 Calculate the absolute value of a given floating point number
23 INPUTS
25 RESULT
26 absolute value of y
28 Flags:
29 zero : result is zero
30 negative : result is negative
31 overflow : 0
33 BUGS
35 INTERNALS
37 *****************************************************************************/
39 AROS_LIBFUNC_INIT
41 if (0 == y)
43 /* value is 0 -> set the Zero Flag */
44 SetSR( Zero_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
46 else
48 /* set the sign-bit to zero */
49 y &= (IEEESPMantisse_Mask | IEEESPExponent_Mask);
50 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
53 return y;
55 AROS_LIBFUNC_EXIT