ProvideX V8.20 > Language Reference > 3. System Functions
516
SQR( ) Function
      Square Root
Format
SQR(num[,ERR=stmtref])
Where:
num
Value whose square root is to be returned. It must be a positive
number. Numeric expression.
stmtref
Program line number or label to transfer control to.
Returns
Numeric, square root of given value.
Description
The SQR( ) function returns the square root of the number provided, rounded to
current PRECISION. If you use an invalid value (e.g., a negative value such as
SQR(-2.345)), ProvideX returns an Error #40: Divide check or numeric
overflow.
Example
0010 INPUT "Length of one side: ",A
0020 IF A<=0 THEN GOTO 0010
0030 INPUT "Length of other : ",B
0040 IF B<=0 THEN GOTO 0030
0050 PRINT "Hypotenuse is : ",SQR(A*A+B*B,ERR=*NEXT)
0060 PRINT "DONE"; STOP
-:run
Length of one side: 2.3
Length of other
: 1.65
Hypotenuse is
: 2.83