0Pricing
Ruby Academy · Lesson

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.class

Integers Have No Limit

Ruby integers grow as large as your memory allows. No overflow surprises.

big = 2 ** 100
puts big

All lessons in this course

  1. Integers and Floats
  2. Arithmetic and Operators
  3. The Math Module
  4. Rational and BigDecimal
← Back to Ruby Academy