March 2000
Intermediate to advanced
576 pages
18h 13m
English
Sqr Function
function Sqr(X: Floating-point type): Extended;
function Sqr(X: Integer): Integer;
function Sqr(X: Int64): Int64;The Sqr function returns the square of its
argument. It is not a real function, but is expanded inline by the
compiler.
If Number is negative or positive infinity, the
result is positive infinity.
If Number is negative zero, the result is positive
zero.
If a floating-point result is too large, Delphi raises runtime error
8 (EOverflow).
If an integer result is too large, Delphi 5 truncates the answer without checking for integer overflow.
If Number is a signaling NaN, Delphi raises
runtime error 6 (EInvalidOp).
If Number is a quiet NaN, the result is
Number.
function Hypotenuse(X, Y: Double): Double; begin Result := Sqrt(Sqr(X) + Sqr(Y)); end;
| Extended Type, Integer Type, Sqrt Function |
Read now
Unlock full access