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


Groups > comp.lang.python > #70285 > unrolled thread

Re: Simple question

Started byPhil Dobbin <phildobbin@gmail.com>
First post2014-04-15 19:38 +0100
Last post2014-04-15 19:38 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Simple question Phil Dobbin <phildobbin@gmail.com> - 2014-04-15 19:38 +0100

#70285 — Re: Simple question

FromPhil Dobbin <phildobbin@gmail.com>
Date2014-04-15 19:38 +0100
SubjectRe: Simple question
Message-ID<mailman.9290.1397587127.18130.python-list@python.org>
On 15/04/2014 19:30, Robert Kern wrote:

> On 2014-04-15 19:18, Phil Dobbin wrote:
>> Hi, all.
>>
>> I've just started to learn Python (I'm reading Mark Lutz's 'Learning
>> Python' from O'Reilly) & I'm confused as to this part:
>>
>> '>>> 0.1 + 0.1 + 0.1 - 0.3
>> 5.55111.....'
>>
>> Using 'import Decimal' you can get a much closer result i.e.
>> 'Decimal('0.0')'
>>
>> What I'm wondering is why the first calculation that arrives at
>> '5.55111...' is so far out?
> 
> The `...` elides the exponent:
> 
>   >>> 0.1 + 0.1 + 0.1 - 0.3
>   5.551115123125783e-17
> 
> If you copied that verbatim directly out of a book, that's just sloppy
> editing.
> 

No, the ellipses are sloppy editing on my part done purely for brevity.
Unfortunately they elided the relevant part, the meaning of which was,
prior to these conversations, lost on me.

Thanks to all who replied.

Cheers,

  Phil...

-- 
currently (ab)using
CentOS 6.5, Debian Squeeze & Wheezy, Fedora 19 & 20, OS X Snow Leopard,
RHEL 7, Ubuntu Precise & Saucy
GnuGPG Key : http://phildobbin.org/publickey.asc
Based in London, UK

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web