Class | InfinityClass |
In: |
lib/facets/more/infinity.rb
|
Parent: | Numeric |
A full featured Infinity class, supporting signed direction. Inifinty is a multiton based on direction The constant INFINITY is provided as the common case with direction=+1 (positive).
NaN Inf PosInf NegInf
These four constants a built from two other basic constants:
UNDEFINED INFINITY
In physical memory there are actually only three objects, namely three instances of InfinityClass, one for NaN, PosInf and NegInf, respectively.
UNDEFINED | = | InfinityClass.instance(0) | Set constant to positive infinity. | |
INFINITY | = | InfinityClass.instance(1) | ||
NaN | = | UNDEFINED | ||
Inf | = | INFINITY | ||
PosInf | = | +INFINITY | ||
NegInf | = | -INFINITY |
direction | [R] |