Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ trig(3M) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

matherr(3M)






       trig(3M)                                                    trig(3M)


       NAME
             trig: sin, sinf, cos, cosf, tan, tanf, asin, asinf, acos,
             acosf, atan, atanf, atan2, atan2f - trigonometric functions

       SYNOPSIS
             cc [flag ...] file ...  -lm [library ...]
             #include <math.h>
             double sin(double x);
             float sinf(float x);
             double cos(double x);
             float cosf(float x);
             double tan(double x);
             float tanf(float x);
             double asin(double x);
             float asinf(float x);
             double acos(double x);
             float acosf(float x);
             double atan(double x);
             float atanf(float x);
             double atan2(double y, double x);
             float atan2f(float y, float x);

       DESCRIPTION
             sin, cos, and tan and the single-precision versions sinf,
             cosf, and tanf return, respectively, the sine, cosine, and
             tangent of their argument, x, measured in radians.

             asin and asinf return the arcsine of x, in the range
             [-n/2,+n/2].

             acos and acosf return the arccosine of x, in the range [0,+n].

             atan and atanf return the arctangent of x, in the range
             (-n/2,+n/2).

             atan2 and atan2f return the arctangent of y/x, in the range
             (-n,+n], using the signs of both arguments to determine the
             quadrant of the return value.

          Errors
             If the magnitude of the argument to asin, asinf, acos, or
             acosf is greater than 1, they return IEEE NaN on systems that
             support it and raise the invalid operation exception.
             Otherwise, they return zero.  In either case, errno is set to
             EDOM.



                           Copyright 1994 Novell, Inc.               Page 1













      trig(3M)                                                    trig(3M)


            On systems that support signed zeroes, if the second argument
            to atan2 and atan2f is +0 and the first argument is _0, these
            functions return _0, depending on the sign of the first
            argument.  When the second argument to atan2 or atan2f is -0
            and the first argument is _0, these functions return _n,
            depending on the sign of the first argument.  On systems that
            do not support signed zeroes, if both arguments to atan2 and
            atan2f are zero, the return value is zero.  In each of these
            cases, errno is set to EDOM.

            On systems that support IEEE infinity, if the argument to sin,
            sinf, cos, cosf, tan or tanf is _oo, they return IEEE NaN,
            raise the invalid operation exception and set errno to EDOM.

            On systems that support IEEE NaN, if any of the arguments to
            any of these functions is a quiet NaN, that value is returned.
            If any of the arguments is a signaling NaN, a quiet NaN is
            returned and the invalid operation exception is raised.  In
            either case, errno is set to EDOM.

            If the program was compiled with the -Xt compilation mode, if
            the magnitude of the argument to asin, asinf, acos, or acosf
            is greater than 1 or when both arguments to atan2 or atan2f
            are zero, they return zero and set errno to EDOM.  In
            addition, a message indicating DOMAIN error is printed on the
            standard error output.  These error handling procedures may be
            changed with the function matherr.

      REFERENCES
            cc(1), matherr(3M)


















                          Copyright 1994 Novell, Inc.               Page 2








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026