Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73816
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.szaf.org!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail |
|---|---|
| From | pecore@pascolo.net |
| Newsgroups | comp.lang.python |
| Subject | Re: 1-0.95 |
| Date | Wed, 02 Jul 2014 01:13:14 +0200 |
| Organization | The Sun and the Rain. |
| Lines | 16 |
| Message-ID | <87zjgsy8ol.fsf@pascolo.net> (permalink) |
| References | <mailman.11388.1404254753.18130.python-list@python.org> |
| NNTP-Posting-Host | ppp-22-11.21-151.libero.it |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | virtdiesel.mng.cu.mi.it 1404256394 19732 151.21.11.22 (1 Jul 2014 23:13:14 GMT) |
| X-Complaints-To | abuse@diesel.cu.mi.it |
| NNTP-Posting-Date | Tue, 1 Jul 2014 23:13:14 +0000 (UTC) |
| User-Agent | Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b34 (linux) |
| Cancel-Lock | sha1:FsQBrfHxdPhPq9XR/avRXWAKnag= |
| Xref | csiph.com comp.lang.python:73816 |
Show key headers only | View raw
Pedro Izecksohn <izecksohn@yahoo.com> writes:
> pedro@microboard:~$ /usr/bin/python3
> Python 3.3.2+ (default, Feb 28 2014, 00:52:16)
> [GCC 4.8.1] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> 1-0.95
> 0.050000000000000044
>>>>
>
> How to get 0.05 as result?
print("%4.2f"%(1-0.95))
i.e., you can change how a result is displayed, not its internal
representation
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
1-0.95 Pedro Izecksohn <izecksohn@yahoo.com> - 2014-07-01 14:17 -0700
Re: 1-0.95 pecore@pascolo.net - 2014-07-02 01:13 +0200
Re: 1-0.95 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-02 15:27 +0000
Re: 1-0.95 Marko Rauhamaa <marko@pacujo.net> - 2014-07-02 19:59 +0300
Re: 1-0.95 Skip Montanaro <skip@pobox.com> - 2014-07-02 12:34 -0500
Re: 1-0.95 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-02 18:34 +0000
Re: 1-0.95 Marko Rauhamaa <marko@pacujo.net> - 2014-07-02 23:00 +0300
Re: 1-0.95 Chris Angelico <rosuav@gmail.com> - 2014-07-03 10:16 +1000
Re: 1-0.95 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-03 02:19 +0000
Re: 1-0.95 Rustom Mody <rustompmody@gmail.com> - 2014-07-02 21:06 -0700
Re: 1-0.95 Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-07-03 16:55 +1200
Re: 1-0.95 Rustom Mody <rustompmody@gmail.com> - 2014-07-02 22:21 -0700
Re: 1-0.95 Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-02 23:50 -0600
OT: speeds (physical, not computing) [was Re: 1-0.95] Steven D'Aprano <steve@pearwood.info> - 2014-07-03 09:15 +0000
Re: 1-0.95 Marko Rauhamaa <marko@pacujo.net> - 2014-07-03 09:51 +0300
Re: 1-0.95 Steven D'Aprano <steve@pearwood.info> - 2014-07-03 09:36 +0000
Re: 1-0.95 Marko Rauhamaa <marko@pacujo.net> - 2014-07-03 14:17 +0300
csiph-web