A bunch of floating point errorsj2labs.tumblr.com 2 pointsj2d2j2d215 years ago2 commentsSaveHideCopy link On HNComments−pascal_cuoq15ydouble x0 = 0x1.0000000000001p0; double y = 0x1p-53 * (1. - 0x1p-11); double z1 = x0 + y;or other examples taken from http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floatin... would have been more interesting than 0.1 + 0.2, for which every tested language seem to compute the proper IEEE 754 double precision result.−bluedanieru15yAu contraire, there are no errors here.
Comments
double x0 = 0x1.0000000000001p0; double y = 0x1p-53 * (1. - 0x1p-11); double z1 = x0 + y;
or other examples taken from http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floatin... would have been more interesting than 0.1 + 0.2, for which every tested language seem to compute the proper IEEE 754 double precision result.
Au contraire, there are no errors here.