[Lazarus] Why Ln(0) and 1/0 does not trigger Exception?

Sven Barth pascaldragon at googlemail.com
Mon Mar 4 22:01:35 CET 2013


Am 04.03.2013 16:05, schrieb Xiangrong Fang:
> As title.  My question is not just "it is a language construct", but 
> "WHY".  What's the benefit of doing so?
I already wrote this in the other thread: if you write "ln(0)" then the 
compiler will hardcode this as "NaN". I don't know what will happen with 
"ln(x)" with "x := 0" though. Maybe you'll need to set the exception 
mask correctly (see here: 
http://www.freepascal.org/docs-html/rtl/math/setexceptionmask.html ) to 
get an exception.

Regards,
Sven




More information about the Lazarus mailing list