Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

SQRT()

This function computes the square root of a number. It can operate on numeric, currency, integer and double values, but always returns a numeric value.

Usage

nResult = SQRT(nValue)

Since square roots aren’t defined for negative numbers, VFP returns an error if you pass it a negative number.

Example

?SQRT(49)   && returns 7
?SQRT($81)  && returns 9