#include <stdlib.h> #include <stdio.h> #include <assert.h> int main(int argc, char **argv) { char s[32]; char *format = argc > 2 ? argv[2] : "%.17g"; double d = finish / 2.0; double f = d; int i; for (i = 0; i < 54; i++) { if (d == finish) break; f /= 2; d += f; } }
Standard input is empty
1 = 0x1p+0 1.5 = 0x1.8p+0 1.75 = 0x1.cp+0 1.875 = 0x1.ep+0 1.9375 = 0x1.fp+0 1.96875 = 0x1.f8p+0 1.984375 = 0x1.fcp+0 1.9921875 = 0x1.fep+0 1.99609375 = 0x1.ffp+0 1.998046875 = 0x1.ff8p+0 1.9990234375 = 0x1.ffcp+0 1.99951171875 = 0x1.ffep+0 1.999755859375 = 0x1.fffp+0 1.9998779296875 = 0x1.fff8p+0 1.99993896484375 = 0x1.fffcp+0 1.999969482421875 = 0x1.fffep+0 1.9999847412109375 = 0x1.ffffp+0 1.99999237060546875 = 0x1.ffff8p+0 1.99999618530273438 = 0x1.ffffcp+0 1.99999809265136719 = 0x1.ffffep+0 1.99999904632568359 = 0x1.fffffp+0 1.9999995231628418 = 0x1.fffff8p+0 1.9999997615814209 = 0x1.fffffcp+0 1.99999988079071045 = 0x1.fffffep+0 1.99999994039535522 = 0x1.ffffffp+0 1.99999997019767761 = 0x1.ffffff8p+0 1.99999998509883881 = 0x1.ffffffcp+0 1.9999999925494194 = 0x1.ffffffep+0 1.9999999962747097 = 0x1.fffffffp+0 1.99999999813735485 = 0x1.fffffff8p+0 1.99999999906867743 = 0x1.fffffffcp+0 1.99999999953433871 = 0x1.fffffffep+0 1.99999999976716936 = 0x1.ffffffffp+0 1.99999999988358468 = 0x1.ffffffff8p+0 1.99999999994179234 = 0x1.ffffffffcp+0 1.99999999997089617 = 0x1.ffffffffep+0 1.99999999998544808 = 0x1.fffffffffp+0 1.99999999999272404 = 0x1.fffffffff8p+0 1.99999999999636202 = 0x1.fffffffffcp+0 1.99999999999818101 = 0x1.fffffffffep+0 1.99999999999909051 = 0x1.ffffffffffp+0 1.99999999999954525 = 0x1.ffffffffff8p+0 1.99999999999977263 = 0x1.ffffffffffcp+0 1.99999999999988631 = 0x1.ffffffffffep+0 1.99999999999994316 = 0x1.fffffffffffp+0 1.99999999999997158 = 0x1.fffffffffff8p+0 1.99999999999998579 = 0x1.fffffffffffcp+0 1.99999999999999289 = 0x1.fffffffffffep+0 1.99999999999999645 = 0x1.ffffffffffffp+0 1.99999999999999822 = 0x1.ffffffffffff8p+0 1.99999999999999911 = 0x1.ffffffffffffcp+0 1.99999999999999956 = 0x1.ffffffffffffep+0 1.99999999999999978 = 0x1.fffffffffffffp+0 2 = 0x1p+1