From: Dossy Date: 2002-05-30T23:55:25+09:00 Subject: Re: Infinity (?!) On 2002.05.30, Paul Brannan wrote: > On Thu, May 30, 2002 at 10:05:24PM +0900, Dossy wrote: > > Float allowing division by zero is certainly not of least surprise > > to me. ;-) > > A Float is implemented by a C double. A Fixnum is a C long. In C, a > long can be only a number, but a double has many special values > (particularly NaN, inifinity, and positive/negative zero). > > For Ruby to work any other way would surprise me. Considering that Ruby is an OO language, the fact that the implementation is so tightly coupled to the underlying architecture surprises me. Just as true, false and nil are instances of TrueClass, FalseClass and NilClass, I would have assumed infinity to be an instance of Number, along with NaN being an instance of Number as well. Or, something like that. Thanks for the clarification, -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)