Trailing zeros of 100!
Bernardo Sulzbach
mafagafogigante at gmail.com
Sat Jan 2 12:24:24 EST 2016
On Sat, Jan 2, 2016 at 2:56 PM, Robin Koch <robin.koch at t-online.de> wrote:
>
> Yes, should work for n >= 1.
>
The first power of 10 for which it fails in my machine is 10 ^ 17,
which is not that much for modern computers. Discrete math should not
meet floating points.
I would post the "canonical" solution here if Peter Otten hadn't just
posted it. You can use Wolfram Alpha - or Otten's solution - to see
that your solution fails for inputs equal to and larger than 10^17
(there likely is a lower bound, but I won't do binary search to find
it).
--
Bernardo Sulzbach
More information about the Python-list
mailing list