Why does the following code fail for 64-bit builds (but works for 32-bit builds)?
var
TruncTmp: Extended;
begin
TruncTmp := 9223372036854775296;
TruncTmp := Trunc(TruncTmp); // this fails on 64-bit
Assert(TruncTmp = 9223372036854775296);
end;
The first random exception is $ 0000000000405D70. The exception class is $ C0000090 with the message 'c0000090 FLOAT_INVALID_OPERATION'.
Is this a mistake or am I missing something?
Notes:
- I am using Delphi 10.2
- Numbers <
9223372036854775296
working fine
source
share