Skip to content

fix(cpp): write doubles with full precision - #730

Open
bhuvan-somisetty wants to merge 1 commit into
ControlCore-Project:devfrom
bhuvan-somisetty:fix/cpp-write-precision
Open

bhuvan-somisetty wants to merge 1 commit into
ControlCore-Project:devfrom
bhuvan-somisetty:fix/cpp-write-precision

Conversation

@bhuvan-somisetty

Copy link
Copy Markdown

Fixes #729

c++ writes used a plain << on doubles, so everything got rounded to 6 digits (3.141592653589793 -> 3.14159). added a small format_double() in concore_base.hpp that writes the shortest form that reads back the same, like python does, and used it in the file, shm and zmq writes of concore.hpp and concoredocker.hpp. added tests for the file and zmq writes.

C++ writes used a plain << on doubles, so the stream's default precision of 6 rounded every value (3.141592653589793 -> 3.14159). Format them with the shortest form that reads back as the same double, like Python's repr, in the file, SHM and ZMQ writes of concore.hpp and concoredocker.hpp.

Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant