VS:Sqrt

From Vectorworks Developer
Revision as of 14:39, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function Sqrt returns the square root of the specified value.

FUNCTION Sqrt(
v :REAL) : REAL;
def vs.Sqrt(v):
    return REAL

Parameters

v REAL Value for which to find the square root.

Remarks

Be aware that in VS, a number can be less than zero, even if it is equal to zero. The following script generates a "square root of a negative number" error...

PROCEDURE GenerateError;
VAR
temp_r :REAL;
BEGIN
temp_r := -.00000000000000000000000000000000000001;
IF temp_r = 0 THEN Message(sqrt(temp_r));
END;
RUN(GenerateError);

Version

Availability: from All Versions