fix #2378
This commit is contained in:
parent
34ebdb7702
commit
ea848d7907
|
|
@ -5,4 +5,16 @@
|
|||
var w: word := 65535;
|
||||
Assert(Sqr(w)=w*w);
|
||||
Assert(Abs(w)=w);
|
||||
var sm: smallint := smallint.MaxValue;
|
||||
Assert(Sqr(sm) = sm*sm);
|
||||
var sh: shortint := shortint.MaxValue;
|
||||
Assert(Sqr(sh) = sh*sh);
|
||||
var lw: longword := longword.MaxValue;
|
||||
Assert(Sqr(lw) = uint64(lw)*uint64(lw));
|
||||
var i: integer := integer.MaxValue;
|
||||
Assert(Sqr(i) = int64(i)*int64(i));
|
||||
var i64: int64 := integer.MaxValue;
|
||||
Assert(Sqr(i64) = i64*i64);
|
||||
var ui64: uint64 := integer.MaxValue;
|
||||
Assert(Sqr(ui64) = ui64*ui64);
|
||||
end.
|
||||
|
|
@ -8212,7 +8212,7 @@ function LogN(base, x: real) := Math.Log(x) / Math.Log(base);
|
|||
|
||||
function Sqrt(x: real) := Math.Sqrt(x);
|
||||
|
||||
function Sqr(x: integer): int64 := x * x;
|
||||
function Sqr(x: integer): int64 := int64(x) * int64(x);
|
||||
|
||||
function Sqr(x: shortint): integer := x * x;
|
||||
|
||||
|
|
@ -8222,11 +8222,11 @@ function Sqr(x: BigInteger): BigInteger := x * x;
|
|||
|
||||
function Sqr(x: byte): integer := x * x;
|
||||
|
||||
function Sqr(x: word): uint64 := x * x;
|
||||
function Sqr(x: word): uint64 := uint64(x) * uint64(x);
|
||||
|
||||
function Sqr(x: longword): uint64 := x * x;
|
||||
function Sqr(x: longword): uint64 := uint64(x) * uint64(x);
|
||||
|
||||
function Sqr(x: int64): int64 := x * x;
|
||||
function Sqr(x: int64): int64 := int64(x) * int64(x);
|
||||
|
||||
function Sqr(x: uint64): uint64 := x * x;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue