[Numpy-discussion] Re: savetxt() has fmt='%.18e' as default, but fmt='%.16e' is always sufficient

2023-11-27 Thread Jeppe Dakin
Thanks for the explanation, Robert Kern. It seems then that indeed, these days the optimal default would be `fmt='%.16e'`. The test on StackOverflow was just a quick demonstration. See also the description for `DBL_DECIMAL_DIG` here: https://en.cppreference.com/w/cpp/header/cfloat > But if your

[Numpy-discussion] savetxt() has fmt='%.18e' as default, but fmt='%.16e' is always sufficient

2023-11-25 Thread Jeppe Dakin
Double-precision numbers need at most 17 significant decimal digits to be serialised losslessly. Yet, savetxt() uses 19 by default, meaning that most files produced with savetxt() takes up about 9% more disk space than they need to, without any benefit. I have described the problem more detailed