Name
Float — Floating-point number class
Synopsis
Float
objects represent floating-point numbers.
They use double precision floating-point numbers as internel
representation of the platform architecture.
Inherited Class
Numeric
Included Module
Precision
Class Method
Float::induced_from(
num
)
Returns the result of converting
num
to a floating-point number.
Instance Methods
f
.finite?
Returns
true
iff
isn’t infinite andf
.nan
isfalse
.f
.infinite?
Returns
1
iff
is positive infinity,-1
if negative infinity, ornil
if anything else.f
.nan?
Returns
true
iff
isn’t a valid IEEE floating point number.
Get Ruby in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.