Created
November 26, 2011 03:18
-
-
Save iamjarvo/1394907 to your computer and use it in GitHub Desktop.
Learn to Program - Chapter 2 - Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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