Returns the square root of a number.

Syntax

SQRT(<expN>)

<expN>

A positive number whose square root you want to return. If <expN> is a negative number, dBASE Plus generates an error.

Description

SQRT( ) returns the positive square root of a non-negative number. For example SQRT(36) returns 6 because 6^2 = 36. The square root of 0 is 0.

An alternate way to find the square root is to raise the value to the power of 0.5. For example, the following two statements display the same value:

? sqrt(36) ) // displays 6.00

? 36^.5 // displays 6.00

Use SET DECIMALS to set the number of decimal places SQRT( ) displays.