some fixes to accented characters
[tangerine.git] / rom / mathffp / spabs.c
blob26960243a9196c07877efd4337667ac4e6a00108
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathffp_intern.h"
8 /*
9 FUNCTION
10 Calculate the absolute value of a given floating point number
12 RESULT
13 absolute value of fnum1
15 Flags:
16 zero : result is zero
17 negative : result is negative
18 overflow : 0
20 NOTES
22 EXAMPLE
24 BUGS
26 SEE ALSO
28 INTERNALS
29 Set the sign-bit to zero
31 HISTORY
34 AROS_LH1(float, SPAbs,
35 AROS_LHA(float, fnum1, D0),
36 struct LibHeader *, MathBase, 9, Mathffp
39 AROS_LIBFUNC_INIT
41 if (0 == fnum1)
43 /* value is 0 -> set the Zero Flag */
44 SetSR( Zero_Bit, Zero_Bit | Overflow_Bit | Negative_Bit);
46 else
48 fnum1 &= (FFPMantisse_Mask | FFPExponent_Mask);
49 /* set the sign-bit to zero */
50 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
52 return fnum1;
54 AROS_LIBFUNC_EXIT