Copyright © tutorialspoint.com

PERL sqrt Function


Syntax

sqrt EXPR

sqrt


Definition and Usage

Returns the square root of EXPR, or $_ if omitted. Most of the time, this function returns a floating point number.

Return Value

  • Floating point number

Example

Try out following example:

#!/usr/bin/perl -w

$result = sqrt(4);
print " sqrt(4) is $result\n";

It will produce following result:

sqrt(4) is 2

Copyright © tutorialspoint.com