Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101163

Re: Trailing zeros of 100!

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Bernardo Sulzbach <mafagafogigante@gmail.com>
Newsgroups comp.lang.python
Subject Re: Trailing zeros of 100!
Date Sat, 2 Jan 2016 15:24:24 -0200
Lines 17
Message-ID <mailman.174.1451755511.11925.python-list@python.org> (permalink)
References <52ccbc4b-616b-4186-8802-97aaa5b0d9af@googlegroups.com> <CAHzaPEOzP+DZDHOV7s1tDA0AUNhFdBUJKZWCJ5W9F8ec6aH-JA@mail.gmail.com> <mailman.162.1451745109.11925.python-list@python.org> <n68s1t$ke9$1@news.albasani.net> <mailman.172.1451753180.11925.python-list@python.org> <n68vgc$qi6$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 0hAbW8rj2XQBqPH77dkInAsPRD2WnaHAL41/nNFa1yyw==
Return-Path <mafagafogigante@gmail.com>
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 <n68vgc$qi6$1@news.albasani.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:101163

Show key headers only | View raw


On Sat, Jan 2, 2016 at 2:56 PM, Robin Koch <robin.koch@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Trailing zeros of 100! katye2007@gmail.com - 2016-01-02 03:49 -0800
  Re: Trailing zeros of 100! David <bouncingcats@gmail.com> - 2016-01-02 23:19 +1100
  Re: Trailing zeros of 100! katye2007@gmail.com - 2016-01-02 04:34 -0800
  Re: Trailing zeros of 100! Vlastimil Brom <vlastimil.brom@gmail.com> - 2016-01-02 13:44 +0100
  Re: Trailing zeros of 100! "yehudak ." <katye2007@gmail.com> - 2016-01-02 15:14 +0200
    Re: Trailing zeros of 100! Robin Koch <robin.koch@t-online.de> - 2016-01-02 16:57 +0100
      Re: Trailing zeros of 100! Tony van der Hoff <tony@vanderhoff.org> - 2016-01-02 17:09 +0100
        Re: Trailing zeros of 100! Robin Koch <robin.koch@t-online.de> - 2016-01-02 17:56 +0100
          Re: Trailing zeros of 100! Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-01-02 15:24 -0200
          Re: Trailing zeros of 100! Chris Angelico <rosuav@gmail.com> - 2016-01-03 08:57 +1100
            Re: Trailing zeros of 100! Robin Koch <robin.koch@t-online.de> - 2016-01-03 01:02 +0100
              Re: Trailing zeros of 100! Ben Finney <ben+python@benfinney.id.au> - 2016-01-03 11:20 +1100
              Re: Trailing zeros of 100! srinivas devaki <mr.eightnoteight@gmail.com> - 2016-01-03 07:16 +0530
          Re: Trailing zeros of 100! Tony van der Hoff <tony@vanderhoff.org> - 2016-01-03 11:53 +0100
  Re: Trailing zeros of 100! Joel Goldstick <joel.goldstick@gmail.com> - 2016-01-02 09:57 -0500
  Re: Trailing zeros of 100! Vlastimil Brom <vlastimil.brom@gmail.com> - 2016-01-02 16:24 +0100
  Re: Trailing zeros of 100! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-01-02 15:30 +0000
  Re: Trailing zeros of 100! Robin Koch <robin.koch@t-online.de> - 2016-01-02 16:54 +0100
    Re: Trailing zeros of 100! Peter Otten <__peter__@web.de> - 2016-01-02 18:18 +0100
  Re: Trailing zeros of 100! Tim Chase <python.list@tim.thechases.com> - 2016-01-02 10:33 -0600
  Re: Trailing zeros of 100! "yehudak ." <katye2007@gmail.com> - 2016-01-02 19:34 +0200
  Re: Trailing zeros of 100! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-01-02 17:44 +0000
    Re: Trailing zeros of 100! Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-03 00:36 +0100
  Re: Trailing zeros of 100! Serhiy Storchaka <storchaka@gmail.com> - 2016-01-02 20:28 +0200
  Re: Trailing zeros of 100! Vlastimil Brom <vlastimil.brom@gmail.com> - 2016-01-02 19:29 +0100
  Re: Trailing zeros of 100! "yehudak ." <katye2007@gmail.com> - 2016-01-02 22:02 +0200
  Re: Trailing zeros of 100! "yehudak ." <katye2007@gmail.com> - 2016-01-02 22:09 +0200
  Re: Trailing zeros of 100! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-01-02 21:25 +0000
  Re: Trailing zeros of 100! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-01-02 21:26 +0000

csiph-web