Skip to content

Instantly share code, notes, and snippets.

@stauntonknight
Created April 20, 2012 21:06
Show Gist options
  • Save stauntonknight/2431910 to your computer and use it in GitHub Desktop.
Save stauntonknight/2431910 to your computer and use it in GitHub Desktop.
Error saying "Can't assign double to variable of type int" on line 7
def num_zeroes_in_fact(n:int):int
count = 0
pow = 1
while (Math.pow(5,pow) <= n)
den = Math.pow(5,pow)
add = n/den
count = count + add
pow += 1
end
count
end
puts num_zeroes_in_fact 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment