sine function

You're viewing an older version of this page (#3277). View the current version.

View versions (4)

NAME

sin csin

INTERFACE

#include <math.h>

double sin ( double x ) long sinl ( long double x ) float sinf ( float x )

#include <complex.h> complex sin(complex x) double complex csin(double complex x) float complex csinf(float complex x) long double complex csinl(long double complex x)

DESCRIPTION

The sin functions compute the sine of x (measured in radians). The complex sine is define by

\sin(x) = \frac{exp(i x)-exp(-i x)}{2 i}
(1)

Example 1

#include <stdio.h>
#include <math.h>

int main(void)
{
  double x=0.5;
  double result = sin(x);
  printf("The sin() of %lf is %lf\n", x, result);
  return 0;
}

SPECIAL VALUES

sin ( &plusmn;0 ) returns &plusmn;0.
sin ( &plusmn;&infin; ) returns a NaN and raises the invalid floating-point exception.

SEE ALSO

acos (3) , asin (3) , atan (3) , atan2 (3) , cos (3) , cosh (3) , sinh (3) , tan (3) , tanh (3)

STANDARDS

The sin function conforms to ISO/IEC 9899:1999(E).

Compatibility

<table class="compat"> <tr><th></th><th>DOS</th><th>UNIX</th><th>Windows</th><th>ANSI C</th><th>C++</th></tr> <tr><td>sinl</td><td>&bull;</td><td></td><td>&bull;</td><td></td><td></td></tr> <tr><td>Real sin</td><td>&bull;</td><td></td><td>&bull;</td><td>&bull;</td><td></td></tr> <tr><td>Complex sin</td><td>&bull;</td><td></td><td>&bull;</td><td></td><td>&bull;</td></tr> <tr><td>Complex csin</td><td></td><td>&bull;</td><td></td><td></td><td>&bull;</td></tr> </table>