Hi,

2009/11/9 Yugui <yugui / yugui.jp>:
>> Could we have Math::INFINITY which would make code using it cleaner?
>
> As my understand, Ruby has not had Math::INFINITY because C does not have it.
> Introducing infinity might decrease portability of Ruby. But I think
> actually it is not a problem.

I proposed Float::INFINITY in [ruby-list:7023], and it was discussed
in the thread
and a thread from [ruby-dev:1657].  1.0 / 0.0 now produces an
infinity, but it raised
ZeroDivisionError at that time.

I don't remember the reason why Float::INFINITY was rejected, but we
have already
Float#infinite?, so Math::INFINITY or Float::INFINITY which are
provided only on the
platform supportng IEEE 754 may not be so bad.

Apart from portability issues, someone proposed a class whose instance
represents
a mathematical infinity at that time, not a IEEE 754 infinity.  It may
be worth considering.

-- 
Shugo Maeda