Closed tstenner closed 5 years ago
Paging @sheinke and @maltesen
Hi together, thx so much for fixing this :) I owe you guys, would have never suspected locales. Keep up the good work !
to_string(float) and to_string(double) should remain separate, so that the precision can be set correctly: 8 for float, and 16 for double. You should also use showpoint: http://www.cplusplus.com/reference/ios/showpoint/. This gives output in significant figures (left and right side of the decimal) rather than precision (right side of the decimal).
Done.
template <> double from_string should remain separate from template <> float from_string for a slight performance improvement (less casting).
In a loop the version with casts was about 2% slower. The only case where LSL calls from_string<float>
with multiple values is in push_chunk_str
with float streams and pull_chunk_f
with string streams, both of which will so slow enough already that it doesn't matter.
Fixes at least https://github.com/sccn/liblsl/issues/24 and https://github.com/sccn/lsl_archived/issues/119.