Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / mathieeedoubtrans / ieeedptan.c
blob069be82c721981e222d885de95869346413c5329
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id: $
4 */
6 #include "mathieeedoubtrans_intern.h"
8 /*
9 FUNCTION
10 Calculate the tangens of the given IEEE double precision number
11 where y represents an angle in radians.
13 RESULT
14 result - IEEE double precision floating point number
16 NOTES
18 EXAMPLE
20 BUGS
22 SEE ALSO
24 INTERNALS
26 HISTORY
29 AROS_LH1(double, IEEEDPTan,
30 AROS_LHA(double, y, D0),
31 struct MathIeeeDoubTransBase *, MathIeeeDoubTransBase, 8, MathIeeeDoubTrans
34 AROS_LIBFUNC_INIT
35 double sn, cs;
37 cs = IEEEDPCos(y);
38 sn = IEEEDPSin(y);
39 if (cs == 0)
41 if (sn > 0)
43 return IEEEDPPInfty_Hi;
45 else
47 return IEEEDPPInfty_Lo;
50 else
52 return sn/cs;
55 AROS_LIBFUNC_EXIT