morganstanley / binlog

A high performance C++ log library, producing structured binary logs
http://opensource.morganstanley.com/binlog/
Apache License 2.0
608 stars 72 forks source link

Precision on floating point members in struct #175

Closed lawrence-koh closed 3 months ago

lawrence-koh commented 3 months ago

Hi, I have a struct that has a long double member.

After using BINLOG_ADAPT_STRUCT and logging the struct member, when the output file is read using bread, there is some loss of precision.

e.g. 1234234.0234242 becomes 1.23423e+06.

Is there a way to control the precision that is being printed by bread?

erenon commented 3 months ago

Thanks for the report, the situation is being improved in: https://github.com/morganstanley/binlog/pull/176/files

lawrence-koh commented 3 months ago

@erenon thank you for your help on this!