This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexey.radkov
Recipients alexey.radkov
Date 2010-11-07.10:40:17
SpamBayes Score 1.6711466e-11
Marked as misclassified No
Message-id <1289126419.86.0.576404326217.issue10346@psf.upfronthosting.co.za>
In-reply-to
Content
The following excerpt will show the issue:

$ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 8 * 4 / ( 2 - 7 ) * 6 / 3
-14
>>>

Why it is evaluated to -14 ?? In floating point arithmetic it should be -12.8, in integer arithmetic i believe it should be -12 (at least bc and a small dedicated C program evaluate it to -12). Perhaps i do not understand some specific python arithmetic priority or associativity rules, anyway i cannot find a specific combinations of them to yield -14 in this expression.
History
Date User Action Args
2010-11-07 10:40:20alexey.radkovsetrecipients: + alexey.radkov
2010-11-07 10:40:19alexey.radkovsetmessageid: <1289126419.86.0.576404326217.issue10346@psf.upfronthosting.co.za>
2010-11-07 10:40:18alexey.radkovlinkissue10346 messages
2010-11-07 10:40:17alexey.radkovcreate