Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-03

Two "double" related question

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Xiangrong Fang

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