Skip to content

A bunch of floating point errors

j2labs.tumblr.com
2 pointsj2d2j2d22 comments
On HN

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.