The floating-point number class. The implementation of Float is double in C.
Arithmetic operators that compute the sum, difference, product, quotient, remainder, and exponent, respectively.
Compares self with other and returns a positive integer if self is larger, 0 if the two are equal, and a negative integer if self is smaller.
Relational operators.
Returns TRUE if the value is neither infinite nor NaN.
Returns 1 when a value is positive and infinite; returns -1 when a value is negative and infinite. Otherwise, returns nil. The floating-point zero ensures infinite division.
inf = 1.0/0 p inf p inf.infinite? => Infinity 1 inf = -1.0/0 p inf p inf.infinite? => -Infinity -1
Returns true if a value is NaN (not a number). The floating-point zero ensures the result of division by 0 is NaN.
nan = 0.0/0.0 p nan p nan.nan? => NaN true