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

sqrt

Returns the square root of its argument.

Returns the positive square root of EXPR, or $_ if omitted. The argument is coerced to Nv (f64) before the operation. Returns NaN for negative arguments.

Synopsis

my $r = sqrt(144);     # 12
my $r = sqrt($x);
my $r = sqrt;          # sqrt($_)

See Also

abs, exp, log