URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 207 |
Rev 345 |
|
|
/* @(#)z_atanf.c 1.0 98/08/13 */
|
/* @(#)z_atanf.c 1.0 98/08/13 */
|
/******************************************************************
|
/******************************************************************
|
* 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"
|
|
|
float
|
float
|
_DEFUN (atanf, (float),
|
_DEFUN (atanf, (float),
|
float x)
|
float x)
|
{
|
{
|
switch (numtestf (x))
|
switch (numtestf (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 (atangentf (x, 0, 0, 0));
|
return (atangentf (x, 0, 0, 0));
|
}
|
}
|
}
|
}
|
|
|
#ifdef _DOUBLE_IS_32BITS
|
#ifdef _DOUBLE_IS_32BITS
|
double atan (double x)
|
double atan (double x)
|
{
|
{
|
return (double) atangentf ((float) x, 0, 0, 0);
|
return (double) atangentf ((float) x, 0, 0, 0);
|
}
|
}
|
|
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.