Skip to content

Instantly share code, notes, and snippets.

@iamjarvo
Created November 26, 2011 03:18
Show Gist options
  • Save iamjarvo/1394907 to your computer and use it in GitHub Desktop.
Save iamjarvo/1394907 to your computer and use it in GitHub Desktop.
Learn to Program - Chapter 2 - Numbers
# How many hours in a year?
puts 24 * 365 # 8760
# How many minutes in a decade?
puts 660 * 24 *(365*10 + 2) # 5258880
# My age in seconds
puts (365 * 22 + 5) * 3600 * 22 # 636372000
# Author is 1,025mil seconds old. How old in years is he?
puts 1025000000 / (365 * 24 * 3600) # 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment