Am 19.06.2018 um 23:50 schrieb James Richters:
I’ve been updating my old programs to use the MATH unit in freepascal and while testing things I came across a runtime
error 217 Invalid floating point operation. Here is my test program
Uses math;
var
variable1:double;
variable2:double;
Begin
variable1:= Infinity;
variable2:= -1*Infinity;
Writeln(variable1,' ',Variable2,' ',Variable1+Variable2);
End.
My output is:
Running "i:\programming\test\testmath.exe "
An unhandled exception occurred at $004015F6:
EInvalidOp: Invalid floating point operation
$004015F6 main, line 8 of i:/programming/test/testmath.pas
+Inf -Inf
According to the link here: https://en.wikipedia.org/wiki/NaN
NaN should be produced:
No. The invalid operation is not masked by default. If you do so, FPC just
write Nan.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal