Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Methods of Int32

  • abs

  • round

  • even

  • gcd

  • Int32

answer = -42
p! answer.abs   # 42
p! answer.even? # true
p! answer.round # -42

puts 42.gcd(35) # 7  ( Greatest common divisor )