Skip to content

Instantly share code, notes, and snippets.

@oscardelben
Created March 17, 2009 11:33
Show Gist options
  • Save oscardelben/80479 to your computer and use it in GitHub Desktop.
Save oscardelben/80479 to your computer and use it in GitHub Desktop.
number = 2**1000
sum = 0
number.to_s.each_char { |n| sum += n.to_i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment