Perl Programming/Keywords/sqrt

Previous: sprintf Keywords Next: srand

The sqrt keyword

edit

sqrt returns the positive square root of EXPRESSION. If EXPRESSION is omitted, $_ is used instead. Works for non-negative operands, if the Math::Complex module has not be loaded.

Syntax

edit
  sqrt EXPRESSION

Examples

edit
 
print sqrt(1) . "\n";
print sqrt(2) . "\n";
1
1.4142135623731


Previous: sprintf Keywords Next: srand