Skip to content

Instantly share code, notes, and snippets.

@trev
Last active August 29, 2015 14:06
Show Gist options
  • Save trev/e32a4bd9e8bdb266b669 to your computer and use it in GitHub Desktop.
Save trev/e32a4bd9e8bdb266b669 to your computer and use it in GitHub Desktop.
sum = 0
[106.90, 106.90, 106.90, 106.90, 106.90, 106.90].each do |l|
sum += l
p sum
end
# Output
# 106.9
# 213.8
# 320.70000000000005
# 427.6
# 534.5
# 641.4
# => [106.9, 106.9, 106.9, 106.9, 106.9, 106.9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment