Skip to main content
Version: 20 R10 BETA

Square root

Square root ( number ) : Real

ParameterTypeDescription
numberRealNumber whose square root is calculated
Function resultRealSquare root of the number

Description

Square root returns the square root of number.

Example 1

The line:

 $vrSquareRootOfTwo :=Square root(2)

assigns the value 1.414213562373 to the variable $vrSquareRootOfTwo.

Example 2

The following method returns the hypotenuse of the right triangle whose two legs are passed as parameters:

 // Hypotenuse method
// Hypotenuse ( real ; real ) -> real
// Hypotenuse ( legA ; legB ) -> Hypotenuse
var 0ドル;1ドル;2ドル : Real
0ドル:=Square root((1ドル^2)+(2ドル^2))

For instance, Hypotenuse (4;3) returns 5.

Properties

Command number539
Thread safe

AltStyle によって変換されたページ (->オリジナル) /