Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 736 Bytes

097_sin.asciidoc

File metadata and controls

49 lines (31 loc) · 736 Bytes

sin

NAME

sin - sine function.

SYNOPSIS
#include <math.h>

double sin(double x);
DESCRIPTION

The sin() function returns the sine of x, where x is given in radians.

Warning
You’ll also need to link the program against the math library (see example below) using the -lm compile/link option.
RETURN VALUE

The sin() function returns a value between -1 and 1.

SEE ALSO

cos, tan

EXAMPLE
link:src/sin.c[role=include]
OUTPUT
$ gcc -Wall -lm sin.c
$ ./a.out
Sine of 45.000000 degrees is 0.707107