Mauricio FernáÏdez <batsman.geo / yahoo.com> writes: > On Thu, Nov 14, 2002 at 02:43:30AM +0900, Paul Brannan wrote: > > [pbrannan@zaphod uilib]$ irb > > Rirb(main):001:0> RUBY_VERSION > > "1.6.7" > > irb(main):002:0> Math.log(0); 1.2345 > > 1.2345 > > irb(main):003:0> Math.log(0); 1.2345 > > (irb):3: warning: Float 1.2345 out of range > > 1.2345 > > ???? > [Mauricio FernáÏdez code shows that it works ok in his 1.6.7 and > 1.7] In #ruby-lang we discussed this. We couldn't zero in on the problem but what's happening is this: Math.log(0) calls log(0) which set errno to ERANGE And then 1.2345 invokes rb_float("1.2345") which calls strtod on "1.2345". Afterwards, there is a code that check for errno: if (errno != 0) { ... raise ("Float: ... out of range") } Apparently the errno from calling log(0) in his 1.6.7 still lingers and causes the exception. We couldn't explain this since it only happens in his code. It seems in everyone else's 1.6.7, errno is implicitly reset before the errno check. In 1.7.2, he observed that the errno is explicitly reset within rb_strtod which encapsulate strtod call. So, we suspect that his glibc (2.2.4) is somehow different than my glibc (2.2.5). But doing a diff on strtod.c between 2.2.4 and 2.2.5 yields no clue. So, we have no idea what's happening. YS.