Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12813 > unrolled thread
| Started by | Chris Rebert <clp2@rebertia.com> |
|---|---|
| First post | 2011-09-05 23:18 -0700 |
| Last post | 2011-09-05 23:18 -0700 |
| 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.
Re: Floating point multiplication in python Chris Rebert <clp2@rebertia.com> - 2011-09-05 23:18 -0700
| From | Chris Rebert <clp2@rebertia.com> |
|---|---|
| Date | 2011-09-05 23:18 -0700 |
| Subject | Re: Floating point multiplication in python |
| Message-ID | <mailman.791.1315289913.27778.python-list@python.org> |
On Mon, Sep 5, 2011 at 10:57 PM, xyz <xyzhtml@163.com> wrote: > hi all: > > As we know , 1.1 * 1.1 is 1.21 . > But in python ,I got following : > >>>> 1.1 * 1.1 > 1.2100000000000002 > > why python get wrong result? It's not Python's fault per se, rather it's the inherent nature of binary floating-point arithmetic. Try the equivalent in most other languages and you'll get the same "error". Please read http://docs.python.org/tutorial/floatingpoint.html Cheers, Chris
Back to top | Article view | comp.lang.python
csiph-web