Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created November 17, 2011 22:47
Show Gist options
  • Save havenwood/1374815 to your computer and use it in GitHub Desktop.
Save havenwood/1374815 to your computer and use it in GitHub Desktop.
Find smallest common multiple
∞ = 1.0 / 0
(1..∞).each do |check_eet|
break check_eet if (1..20).all? do |against_this|
check_eet % against_this == 0
end
end
#=> 232792560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment