Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Bernardo Sulzbach Newsgroups: comp.lang.python Subject: Re: Trailing zeros of 100! Date: Sat, 2 Jan 2016 15:24:24 -0200 Lines: 17 Message-ID: References: <52ccbc4b-616b-4186-8802-97aaa5b0d9af@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 0hAbW8rj2XQBqPH77dkInAsPRD2WnaHAL41/nNFa1yyw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'binary': 0.05; 'jan': 0.11; 'alpha': 0.15; '(there': 0.16; '2016': 0.16; 'bound,': 0.16; 'inputs': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'math': 0.20; 'machine': 0.21; 'posted': 0.21; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'post': 0.31; 'equal': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; "won't": 0.38; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'your': 0.60; 'here': 0.66; 'power': 0.72; 'bernardo': 0.84; 'computers.': 0.84; 'discrete': 0.84; 'otten': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=TUE/R1FBwBiQW1NA6sdVFGyNwVIxCjC0v7nvmzY1t0I=; b=WJ8ElrTywj7mB6NqbSoEbAWkHAsyZe2MAT0uVJ7mfMaMQQUElRSICr/gXhTzuTl2Ot 2TkUe1J/+ga7lYOEuYFo32FM1ITVBKUIYEmi3OaEwMNQk6d5VLYnCoJA6Cy8PVMyNoX3 i+nVd3OwrrYx/PNU8ValE5Y8Yi4cJblmSxt1krVIvWiOVrHydOcjEmQbfmBjfpKQ3nvc FOZs3UwE0IdMday6b2rnfUvcKuveDD10eSKQ1pfmI4yo8PcH1rqv04AcwLrKdwN1O82o iwqoPo83eOdmFtoWHLJvvLemKEWO8xgQ5r/YxpBiYifKh5b/5KajoKtTZu+hS4FtLoos AniA== X-Received: by 10.112.242.167 with SMTP id wr7mr23414345lbc.69.1451755503670; Sat, 02 Jan 2016 09:25:03 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101163 On Sat, Jan 2, 2016 at 2:56 PM, Robin Koch 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