Bus reset timeouts are now implemented with more coarse-grained sleeps
[tangerine.git] / rom / mathffp / spneg.c
blob3c6bbffb13b3dd70b832691625cec8ca61a6e1b1
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 fnum1*(-1)
12 RESULT
13 -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
29 INTERNALS
30 ALGORITHM:
31 Return zero if fnum == 0.
32 Otherwise flip the sign-bit.
34 HISTORY
37 AROS_LH1(float, SPNeg,
38 AROS_LHA(float, fnum1, D0),
39 struct LibHeader *, MathBase, 10, Mathffp
42 AROS_LIBFUNC_INIT
44 if (0 == fnum1)
46 SetSR( Zero_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
47 return 0;
50 /* flip sign-bit */
51 fnum1 ^= FFPSign_Mask;
53 if((char) fnum1 < 0)
55 /* result is negative */
56 SetSR(Negative_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
58 else
60 /* result is positive */
61 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
64 return fnum1;
66 AROS_LIBFUNC_EXIT