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 amaury.forgeotdarc
Recipients Ramchandra Apte, amaury.forgeotdarc, andrea.bergamini, ezio.melotti, mark.dickinson, pitrou, r.david.murray, rhettinger, serhiy.storchaka, skrah
Date 2012-07-26.16:48:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343321316.88.0.0411400412205.issue15438@psf.upfronthosting.co.za>
In-reply-to
Content
C comparison rules are different from Python's.
In the program below (which outputs 1), the mixed comparison will first convert the literal to a double, and lost some precision.
Python does the opposite: the (imprecise) float is converted to a long, so all digits are compared.


#include <math.h>
#include <stdio.h>
int main()
{
    printf("result: %d\n", (pow(43,10) == 21611482313284249));
}
History
Date User Action Args
2012-07-26 16:48:36amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, rhettinger, mark.dickinson, pitrou, ezio.melotti, r.david.murray, skrah, Ramchandra Apte, serhiy.storchaka, andrea.bergamini
2012-07-26 16:48:36amaury.forgeotdarcsetmessageid: <1343321316.88.0.0411400412205.issue15438@psf.upfronthosting.co.za>
2012-07-26 16:48:36amaury.forgeotdarclinkissue15438 messages
2012-07-26 16:48:36amaury.forgeotdarccreate