From: gotoken@... (GOTO Kentaro) Date: 2001-03-07T17:40:24+09:00 Subject: [ruby-talk:12220] Re: NaN, Infinity (Bug?) In message "[ruby-talk:12217] Re: NaN, Infinity (Bug?)" on 01/03/07, Tammo Freese writes: >Perhaps this bug is only based on a misconfiguration of my system? >I use the windows installer from RubyCentral, version 1.6.2 (-03) >on Windows NT4. Anybody out there with the same configuration? >Which results do you get? This problem is caused by Cygwin's C library libc (newlib). The behavior of Cygwin's log() is commented as follows: newlib/libm/math/w_log.c: >RETURNS >Normally, returns the calculated value. When <[x]> is zero, the >returned value is <<-HUGE_VAL>> and <> is set to <>. >When <[x]> is negative, the returned value is <<-HUGE_VAL>> and ><> is set to <>. You can control the error behavior via ><>. # Based on eban's report [ruby-dev:12385] For Cygwin, eban added a macro to the current version of Ruby: #if defined __CYGWIN__ #define log(x) ((x) < 0.0 ? ((x) - (x)) / 0.0 : log(x)) #endif -- Gotoken