alsa.audio: limit the supported frequencies to common set
[AROS.git] / workbench / libs / mathffp / spabs.c
blobfc7b829cd040c6a6f386fbeff2124a01194c86c1
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathffp_intern.h"
8 /*****************************************************************************
10 NAME */
12 AROS_LH1(float, SPAbs,
14 /* SYNOPSIS */
15 AROS_LHA(float, fnum1, D0),
17 /* LOCATION */
18 struct LibHeader *, MathBase, 9, Mathffp)
20 /* FUNCTION
21 Calculate the absolute value of a given floating point number
23 INPUTS
25 RESULT
26 absolute value of fnum1
28 Flags:
29 zero : result is zero
30 negative : result is negative
31 overflow : 0
32 BUGS
34 INTERNALS
35 Set the sign-bit to zero
37 *****************************************************************************/
39 AROS_LIBFUNC_INIT
40 D(kprintf("SPAbs(%08x)\n", fnum1));
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