[fpc-pascal] Division by Zero - not raised exception

Marco van de Voort marcov at stack.nl
Mon Apr 17 15:00:24 CEST 2006


> 
> Definition in documentation (RTL.pdf):
> "
> 29.20 EDivByZero
> 29.20.1 Description
> EDivByZero is used when the operating system or CPU signals a division by
> zero error.
> "

... and since these are handled by the compiler for constants, when running
the user program, the CPU will never see it. So it should either not
compile, or have the current behaviour, but a EDivByZero will never happen,
since this is not calculated runtime.

> Far I can see, the core of the problem is in definiton of Infinity constant
> as 1.0/0.0 and NaN with ln(-1.0) or 0.0/0.0 Perhaps this is necessary to
> avoid problem with probably difference between different CPU/FPUs. 

It is done for Delphi compat as florian already said



More information about the fpc-pascal mailing list