DataBasic Reference > Statements and Intrinsic Functions > S > SQRT Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

SQRT Function (DataBasic) (m618703+sqrt_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

SQRT Function

Calculates the square root of an expression.

Syntax

SQRT(expression)

Syntax Elements

expression is any DataBasic expression that evaluates to a numeric value greater than or equal to zero.

If expression evaluates to a negative number, SQRT returns zero and a warning message is displayed.

Operation

If there is no PRECISION statement in the program, the value is returned rounded to the nearest four decimal places. Otherwise, the number of decimal places returned is as specified by the PRECISION statement.

In each case, the significant decimal places returned are the result of rounding. However, only up to five places are significant: if the PRECISION statement specifies a precision greater than five, trailing zeroes are appended to the five significant places so as to return the numbers of places specified.

Examples

X = "64"
Y = SQRT(X)

Assigns the value 8 (the square root of 64) to variable Y.

C = SQRT(A*A + B*B)

Finds the hypotenuse of a right-angled triangle and assigns the value to variable C.

RealityV15.1 (MoTW) Revision 7Comment on this topic