Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cos

Returns the cosine of its argument (in radians).

Returns the cosine of EXPR (interpreted as an angle in radians), or $_ if omitted. The argument is coerced to Nv (f64). Always returns an Nv.

Synopsis

my $c = cos(0);        # 1
my $c = cos($radians);
my $c = cos;           # cos($_)

See Also

sin, atan2