Created
April 20, 2012 21:06
-
-
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
This file contains hidden or 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
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