Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: UNSURE 0.261 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.65; '*S*': 0.17; 'cc:addr:python-list': 0.11; 'cc:name:python list': 0.16; 'hexadecimal': 0.16; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'subject:what': 0.31; 'subject:with': 0.35; 'received:google.com': 0.35; 'skip:p 20': 0.39; 'subject:get': 0.81; 'subject:interesting': 0.84; 'subject:you': 0.87; 'subject:results': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qsBMpPMpcMEXjfwK8LdXQZW9T4nXl2u2uYTwLsQ3HCU=; b=fQjGdLnunQe4ITP55kE62TsDadWPnOGCt7CdFS3MLCORDt22eOURt4sMGK9C/5fCBw jVaSgWjJcU1sXwY7PZoa7KB4JI0nRCFGlkWWhKpiCg4goBT9SCAJguEiI2OR4AKuPnvh fq9MQ1xZeb+nJEAlpr18PqhIxcpl/cffKca43EfnbA59Vn7snIjHE13H32+MQeAqJwRw w9mjsSBo0bWVqM3Ymibf+pD8QypQcuK6jM3dl3zIOB6eVFB5aUNvG7g8e09g/7I6HbN1 mfa6z+KsvupBeRHy8NBy7yQEfsBQ2Y2BmgT/MHzwkkunsyn2PMI+61yD8A31hS4NkFpy VLyw== MIME-Version: 1.0 X-Received: by 10.112.242.162 with SMTP id wr2mr1161970lbc.10.1408659332553; Thu, 21 Aug 2014 15:15:32 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Aug 2014 15:15:32 -0700 Subject: Re: what do you get with 1 divide by 998001, interesting results From: Dan Stromberg To: Everything You Need To Know Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Fri, 22 Aug 2014 03:10:44 +0200 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 7 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408669845 news.xs4all.nl 2907 [2001:888:2000:d::a6]:55128 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76759 Amusing. It works in hexadecimal too: numerator = 1 denominator = 0xffe001 shift = int(16 ** 30) print(hex(int(numerator * shift / denominator)))