Integers and Floats
Numeric types in Ruby.
Two Numeric Types
Ruby has two everyday number types: Integer for whole numbers and Float for decimals.
puts 42.class
puts 3.14.classIntegers Have No Limit
Ruby integers grow as large as your memory allows. No overflow surprises.
big = 2 ** 100
puts bigAll lessons in this course
- Integers and Floats
- Arithmetic and Operators
- The Math Module
- Rational and BigDecimal