sin, sinl
raw OCR
Calculates sine.
Defined in header <math.h>
Syntax
Real versions: Complex version:
#include <math.h> #include <complex.h>
double sin(double x); complex sin(complex x);
long double sinldong double x);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only | |
|---|---|---|---|---|---|
| sini | ■ | ■ | |||
| Real sin | ■ | ■ | ■ | ■ | |
| Complex sin | ■ | ■ | ■ |
Remarks
sin computes the sine of the input value. Angles are specified in radians.
sini is the long double version; it takes a long double argument and returns a long double result.
Error handling for these functions can be modified through the functions matherr and _matherrl.
Return value
sin and sinl return the sine of the input value.
The complex sine is defined by
sin(z) = (exp(/ * z) - exp(-/ * 2))/(2i)
See also
Example
*include <stdio.h>
#include <math.h>
int main(void)
double result, x
result = sin(x);
printfC'The sin{) of %lf is %lf\n", X, result);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/math.h/sin/
· short form /3.1/sin/