Skip to content

SQR

Square Root

This numeric function returns the square root of a positive number.

SQR (numeric-value [,ERR=line-ref|,ERC=error-code])
numeric-value
is any positive number.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

If an attempt is made to use a negative numeric-value, an ERR=40 results.

SQR (25)

The result is 5.

LET Y = SQR (A*3+B)

If A=2 and B=7, Y is assigned the value 3.61.

SQR (.40)

The result is 0.63.

These examples assume PRECISION 2.

From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF