Closed sigvaldm closed 6 years ago
I have now increased the accuracy of history-file without using hexadecimal representation. If it is still necessary to use hexadecimal representation, I can implement it as an option in the History class.
I have implemented the option to write data to history.dat using hexadecimal representation. I'm using std::hexfloat which dumps exact representation of a floating point value. However, it does not work with GCC 4.8.5. We need GCC 5.1.0 or above. Unfortunately, I'm stuck with GCC 4.8.5. My implementation is still there in diagnostics.h, but it has been commented out. Once we have CGG 5.1.0 or above, it can be uncommented.
But I think we have already improved the precision using decimal representation, and this issue has been solved. What do you think?
Right! I agree it's not worthwhile changing GCC at this point (although GCC 4.8.5 is quite old). I think we can close this.
Consider this excerpt from a history file:
When the simulation time (second column) becomes large enough, the
%g
specifier (or stream in C++) prefers to not use scientific notation (e.g.1.234e-4
). However, in this case the time-step is still very small, so it takes many steps before the time increments. I do not know how much an EMA-filter likes this. In any case, round-off errors are un-avoidable in base 10 representations. Perhaps we could have an option to use hexadecimal representation like the one used by%a
? This would be exact. Metaplot may have to be updated to support this (I'm not sure).