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;
First chance exception at $0000000000405D70. Exception class $C0000090 with message 'c0000090 FLOAT_INVALID_OPERATION'.
Is this a bug or am I missing something?
Notes:
9223372036854775296
work fineThere is no "extended" (80-bit FP) type under Win64 - it is just an alias to "double" (64-bit FP). So you only have 53-bit of resolution in double.
So my guess it is that is as expected in your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With