Difference between revisions of "Hypot"

From SCAR Divi Manual
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function Hypot(X, Y: Extended): Extended;
+
function Hypot(const X, Y: Extended): Extended;
 
</source>
 
</source>
  
Line 14: Line 14:
 
==Example==
 
==Example==
 
<source lang="scar">
 
<source lang="scar">
uses
 
  Math;
 
 
 
begin
 
begin
   Print(Hypot(3, 4));
+
   WriteLn(Hypot(3, 4));
 
end.
 
end.
 
</source>
 
</source>
  
 
Output:
 
Output:
  5.00000000000000E+0000
+
  5
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Math Functions]]
 
[[Category:Math Functions]]

Latest revision as of 19:42, 30 August 2011

Definition

function Hypot(const X, Y: Extended): Extended;

Availability

SCAR Divi 3.00 > Current

Description

Returns the length of the hypotenuse of a right triangle. The lengths of the sides adjacent to the right angle are given by X and Y.

Sqrt(X^2 + Y^2)

Example

begin
  WriteLn(Hypot(3, 4));
end.

Output:

5