jk-jeon / dragonbox

Reference implementation of Dragonbox in C++
Apache License 2.0
588 stars 37 forks source link

`to_decimal` regressed since last November #48

Closed DanShaders closed 10 months ago

DanShaders commented 10 months ago
double x = 1.234;
auto v = jkj::dragonbox::to_decimal(x);
std::cout << v.significand << std::endl;

outputs 1234000000000000 instead of 1234. I am not sure if this is intended or not, but it is an example from readme, so either readme should be fixed or something is wrong with the code.

I noticed this when tried to update Dragonbox from 33a9e021290d529bcb41773be2c7c3c91726a9cb to the current master in the stress of SerenityOS's Ryu implementation.

jk-jeon commented 10 months ago

Thanks for catching this! I didn't notice this as to_chars was not affected.