[Python] Somma da linea di comando

Daniele Palmese palmux a gmail.com
Lun 12 Nov 2012 22:10:16 CET


Il giorno 12 novembre 2012 21:47, Massimo Capanni <massimo.capanni a gmail.com
> ha scritto:

> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> a = 12.20
> >>> b = 9.20
> >>> c = 4.20
> >>> print a + b + c
> 25.6
> >>>
> >>> 12.20 + 9.20 + 4.20
> 25.59999999999999
>


A dire il vero da me si comporta esattamente al contrario:

Python 2.7.1
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 12.20
>>> b = 9.20
>>> c = 4.20
>>> a + b + c
25.599999999999998
>>> print 12.20 + 9.20 + 4.20
25.6

Ciao..
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20121112/3cd6c112/attachment.html>


Maggiori informazioni sulla lista Python