Numbers are classes : Number class « Number « Ruby

Numbers are classes

2.class # => Fixnum
2.0.class # => Float
2_000_000_000.class # => Bignum


Related examples in the same category

1.Number Introduction
2.Ruby has a number of classes and modules related to numbers.
3.Math class and module hierarchy
4.floor Returns the largest integer less than or equal.
5.infinite? Returns nil,1,or +1 depending on whether flt is finite.
6.modulo(numeric): Synonym for Float#%.