Ruby Float Functions
EditRocket provides the following information on Float functions in the Ruby source code builder.
abs - Returns the absolute value of flt.
ceil - Returns the smallest Integer greater than or equal to flt.
coerce(p1) - "MISSING: documentation"
dclone() -
divmod(numeric) - See Numeric#divmod.
eql?(obj) - Returns true only if obj is a Float with the same value as flt. Contrast this with Float#==, which performs type conversions.
finite? - Returns true if flt is a valid IEEE floating point number (it is not infinite, and nan? is false).
floor - Returns the largest integer less than or equal to flt.
hash - Returns a hash code for this float.
induced_from(obj) - Convert obj to a float.
infinite? - Returns nil, -1, or +1 depending on whether flt is finite, -infinity, or +infinity.
modulo(other) - Return the modulo after division of flt by other.
nan? - Returns true if flt is an invalid IEEE floating point number.
new -
round - "Rounds flt to the nearest integer. Equivalent to:"
to_f - As flt is already a float, returns self.
to_i - Returns flt truncated to an Integer.
to_int - Returns flt truncated to an Integer.
to_s - Returns a string containing a representation of self. As well as a fixed or exponential form of the number, the call may return ``NaN'', ``Infinity'', and ``-Infinity''.
to_yaml( opts = {} ) -
truncate - Returns flt truncated to an Integer.
zero? - Returns true if flt is 0.0.