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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libm/] [mathfp/] [s_atan.c] - Diff between revs 148 and 158

Only display areas with differences | Details | Blame | View Log

Rev 148 Rev 158
 
 
/* @(#)z_atan.c 1.0 98/08/13 */
/* @(#)z_atan.c 1.0 98/08/13 */
 
 
/*
/*
FUNCTION
FUNCTION
        <<atan>>, <<atanf>>---arc tangent
        <<atan>>, <<atanf>>---arc tangent
 
 
INDEX
INDEX
   atan
   atan
INDEX
INDEX
   atanf
   atanf
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double atan(double <[x]>);
        double atan(double <[x]>);
        float atanf(float <[x]>);
        float atanf(float <[x]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double atan(<[x]>);
        double atan(<[x]>);
        double <[x]>;
        double <[x]>;
 
 
        float atanf(<[x]>);
        float atanf(<[x]>);
        float <[x]>;
        float <[x]>;
 
 
DESCRIPTION
DESCRIPTION
 
 
<<atan>> computes the inverse tangent (arc tangent) of the input value.
<<atan>> computes the inverse tangent (arc tangent) of the input value.
 
 
<<atanf>> is identical to <<atan>>, save that it operates on <<floats>>.
<<atanf>> is identical to <<atan>>, save that it operates on <<floats>>.
 
 
RETURNS
RETURNS
@ifnottex
@ifnottex
<<atan>> returns a value in radians, in the range of -pi/2 to pi/2.
<<atan>> returns a value in radians, in the range of -pi/2 to pi/2.
@end ifnottex
@end ifnottex
@tex
@tex
<<atan>> returns a value in radians, in the range of $-\pi/2$ to $\pi/2$.
<<atan>> returns a value in radians, in the range of $-\pi/2$ to $\pi/2$.
@end tex
@end tex
 
 
PORTABILITY
PORTABILITY
<<atan>> is ANSI C.  <<atanf>> is an extension.
<<atan>> is ANSI C.  <<atanf>> is an extension.
 
 
*/
*/
 
 
/******************************************************************
/******************************************************************
 * Arctangent
 * Arctangent
 *
 *
 * Input:
 * Input:
 *   x - floating point value
 *   x - floating point value
 *
 *
 * Output:
 * Output:
 *   arctan of x
 *   arctan of x
 *
 *
 * Description:
 * Description:
 *   This routine returns the arctan of x.
 *   This routine returns the arctan of x.
 *
 *
 *****************************************************************/
 *****************************************************************/
 
 
#include "fdlibm.h"
#include "fdlibm.h"
#include "zmath.h"
#include "zmath.h"
 
 
#ifndef _DOUBLE_IS_32BITS
#ifndef _DOUBLE_IS_32BITS
 
 
double
double
_DEFUN (atan, (double),
_DEFUN (atan, (double),
        double x)
        double x)
{
{
  switch (numtest (x))
  switch (numtest (x))
    {
    {
      case NAN:
      case NAN:
        errno = EDOM;
        errno = EDOM;
        return (x);
        return (x);
      case INF:
      case INF:
        /* this should check to see if neg NaN or pos NaN... */
        /* this should check to see if neg NaN or pos NaN... */
        return (__PI_OVER_TWO);
        return (__PI_OVER_TWO);
      case 0:
      case 0:
        return (0.0);
        return (0.0);
      default:
      default:
        return (atangent (x, 0, 0, 0));
        return (atangent (x, 0, 0, 0));
    }
    }
}
}
 
 
#endif /* _DOUBLE_IS_32BITS */
#endif /* _DOUBLE_IS_32BITS */
 
 

powered by: WebSVN 2.1.0

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