You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I noticed a critical bug:
when trying to save values close to 10^n for some n (e.g. 1000.0, 1000000.0), the leading decimal is missing in the exported .csv file (e.g. the string is saved as "000.0" or "000000.0", respectively).
I traced this behaviour back to the way the digits are serialized in csv_writer.hpp.
The problem comes from the fact that the log(x)/log(10) is an imprecise method to estimate the number of digits of x, as speculated e.g. in this question on stackoverflow.
To verify that this is indeed the problem, I tested the following minimal (non-)working example (I'm compiling with g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 on WSL, but the behaviour should be the same regardless of compiler):
I believe this is a breaking error, because right now it may invalidate data in a way that is very hard to spot (at least it took me a long time to find). If the fix means taking a slower algorithm for serialization, I'd be fine with that, because correctness > speed (for me at least).
Best regards and thanks for your work on this library!
The text was updated successfully, but these errors were encountered:
Hi, I noticed a critical bug:
when trying to save values close to 10^n for some n (e.g. 1000.0, 1000000.0), the leading decimal is missing in the exported .csv file (e.g. the string is saved as "000.0" or "000000.0", respectively).
I traced this behaviour back to the way the digits are serialized in csv_writer.hpp.
The problem comes from the fact that the log(x)/log(10) is an imprecise method to estimate the number of digits of x, as speculated e.g. in this question on stackoverflow.
To verify that this is indeed the problem, I tested the following minimal (non-)working example (I'm compiling with g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 on WSL, but the behaviour should be the same regardless of compiler):
I believe this is a breaking error, because right now it may invalidate data in a way that is very hard to spot (at least it took me a long time to find). If the fix means taking a slower algorithm for serialization, I'd be fine with that, because correctness > speed (for me at least).
Best regards and thanks for your work on this library!
The text was updated successfully, but these errors were encountered: