Hi Jonas,

On Fri, 2 Mar 2007 03:10:44 +0900
Jonas Kongslund <jonas / kongslund.dk> wrote:

> I'm playing around with Ruby and noticed the following behavior on the 
> float 0.0/0.0 which is NaN:
> 
> (0.0/0.0).zero? evaluates to true. I would expect false.
> (0.0/0.0).nonzero? evaluates to nil. I would expect NaN.
> 
> Is it a bug?

I guess so, btw, what's your ruby's version and environment?
`ruby -v` will help.

Here is my case:

$ ./ruby-1.8.6/bin/ruby-1.8.6  -ve 'p [(0.0/0.0).zero?,
(0.0/0.0).nonzero?]'
ruby 1.8.6 (2007-02-28 patchlevel 0) [i686-linux]
[false, NaN]
$ ruby-trunk -ve 'p [(0.0/0.0).zero?, (0.0/0.0).nonzero?]'
ruby 1.9.0 (2007-03-01 patchlevel 0) [i686-linux]
[false, NaN]

--
Tadashi Saito