[fpc-pascal] Two "double" related question

Xiangrong Fang xrfang at gmail.com
Tue Mar 25 07:13:30 CET 2014


Hi All,

I am trying to convert an R program to pascal. Having 2 problems:

1. In R, ln(0) is -Inf (negative infinity) and ln(-1) is NaN, while in FPC
(2.6.2), ln(0) is NaN, and ln(-1) is -Inf, why? Mathematically, I think R's
rationale is better because ln(x) approaches -Inf while X approaches 0.

2. How can I tell the compiler NOT to generate EDivideByZero or any similar
stuff, but just return the IEEE Infinity NegInfinity or Nan accordingly? I
know that they are defined in the math unit.

Thanks!

Xiangrong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140325/90c88449/attachment.html>


More information about the fpc-pascal mailing list