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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [newlib-1.18.0/] [newlib/] [libm/] [math/] [w_atan2.c] - Diff between revs 816 and 829

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

Rev 816 Rev 829
 
 
/* @(#)w_atan2.c 5.1 93/09/24 */
/* @(#)w_atan2.c 5.1 93/09/24 */
/*
/*
 * ====================================================
 * ====================================================
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 *
 *
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * software is freely granted, provided that this notice
 * is preserved.
 * is preserved.
 * ====================================================
 * ====================================================
 *
 *
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
        <<atan2>>, <<atan2f>>---arc tangent of y/x
        <<atan2>>, <<atan2f>>---arc tangent of y/x
 
 
INDEX
INDEX
   atan2
   atan2
INDEX
INDEX
   atan2f
   atan2f
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double atan2(double <[y]>,double <[x]>);
        double atan2(double <[y]>,double <[x]>);
        float atan2f(float <[y]>,float <[x]>);
        float atan2f(float <[y]>,float <[x]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <math.h>
        #include <math.h>
        double atan2(<[y]>,<[x]>);
        double atan2(<[y]>,<[x]>);
        double <[y]>;
        double <[y]>;
        double <[x]>;
        double <[x]>;
 
 
        float atan2f(<[y]>,<[x]>);
        float atan2f(<[y]>,<[x]>);
        float <[y]>;
        float <[y]>;
        float <[x]>;
        float <[x]>;
 
 
DESCRIPTION
DESCRIPTION
 
 
<<atan2>> computes the inverse tangent (arc tangent) of <[y]>/<[x]>.
<<atan2>> computes the inverse tangent (arc tangent) of <[y]>/<[x]>.
<<atan2>> produces the correct result even for angles near
<<atan2>> produces the correct result even for angles near
@ifnottex
@ifnottex
pi/2 or -pi/2
pi/2 or -pi/2
@end ifnottex
@end ifnottex
@tex
@tex
$\pi/2$ or $-\pi/2$
$\pi/2$ or $-\pi/2$
@end tex
@end tex
(that is, when <[x]> is near 0).
(that is, when <[x]> is near 0).
 
 
<<atan2f>> is identical to <<atan2>>, save that it takes and returns
<<atan2f>> is identical to <<atan2>>, save that it takes and returns
<<float>>.
<<float>>.
 
 
RETURNS
RETURNS
<<atan2>> and <<atan2f>> return a value in radians, in the range of
<<atan2>> and <<atan2f>> return a value in radians, in the range of
@ifnottex
@ifnottex
-pi to pi.
-pi to pi.
@end ifnottex
@end ifnottex
@tex
@tex
$-\pi$ to $\pi$.
$-\pi$ to $\pi$.
@end tex
@end tex
 
 
You can modify error handling for these functions using <<matherr>>.
You can modify error handling for these functions using <<matherr>>.
 
 
PORTABILITY
PORTABILITY
<<atan2>> is ANSI C.  <<atan2f>> is an extension.
<<atan2>> is ANSI C.  <<atan2f>> is an extension.
 
 
 
 
*/
*/
 
 
/*
/*
 * wrapper atan2(y,x)
 * wrapper atan2(y,x)
 */
 */
 
 
#include "fdlibm.h"
#include "fdlibm.h"
#include <errno.h>
#include <errno.h>
 
 
#ifndef _DOUBLE_IS_32BITS
#ifndef _DOUBLE_IS_32BITS
 
 
#ifdef __STDC__
#ifdef __STDC__
        double atan2(double y, double x)        /* wrapper atan2 */
        double atan2(double y, double x)        /* wrapper atan2 */
#else
#else
        double atan2(y,x)                       /* wrapper atan2 */
        double atan2(y,x)                       /* wrapper atan2 */
        double y,x;
        double y,x;
#endif
#endif
{
{
        return __ieee754_atan2(y,x);
        return __ieee754_atan2(y,x);
}
}
 
 
#endif /* defined(_DOUBLE_IS_32BITS) */
#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.