Hacker News new | ask | show | jobs
by vitaut 175 days ago
It converts 1.0 to "1.e-01" which reminds me to remove the trailing decimal point =). dtoa-benchmark tests that the algorithm produces valid results on its dataset.
2 comments

So if I use:

    #include "zmij.h"
    #include <stdio.h>

    int main() {
        char buf[zmij::buffer_size];
        zmij::dtoa(1.0, buf);
        puts(buf);
    }
I get `g++ zmij.cc test.c -o test && ./test` => `0.000000000000001e+15`
My bad, you are right. The small integer optimization should be switched to a different output method (or disabled since it doesn't provide much value). Thanks for catching this!
Should be fixed now.
"1.e-01" is for 0.1, not 1.0.
I assume they meant 1.e+00

That is what Schubfach does

Yeah, that's what I meant.