OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libm/] [mathfp/] [sf_atan.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 joel
 
2
/* @(#)z_atanf.c 1.0 98/08/13 */
3
/******************************************************************
4
 * Arctangent
5
 *
6
 * Input:
7
 *   x - floating point value
8
 *
9
 * Output:
10
 *   arctan of x
11
 *
12
 * Description:
13
 *   This routine returns the arctan of x.
14
 *
15
 *****************************************************************/
16
 
17
#include "fdlibm.h"
18
#include "zmath.h"
19
 
20
float
21
_DEFUN (atanf, (float),
22
        float x)
23
{
24
  switch (numtestf (x))
25
    {
26
      case NAN:
27
        errno = EDOM;
28
        return (x);
29
      case INF:
30
        /* this should check to see if neg NaN or pos NaN... */
31
        return (__PI_OVER_TWO);
32
      case 0:
33
        return (0.0);
34
      default:
35
        return (atangentf (x, 0, 0, 0));
36
    }
37
}
38
 
39
#ifdef _DOUBLE_IS_32BITS
40
double atan (double x)
41
{
42
  return (double) atangentf ((float) x, 0);
43
}
44
 
45
#endif /* defined(_DOUBLE_IS_32BITS) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.