Bug #9363
closedAdd a workaround for Boost Spirit issue #688
100%
Description
Since Boost 1.76.0 there is a regression in the outputting of numbers: https://github.com/boostorg/spirit/issues/688
Wt depends on this to serialize doubles to JavaScript.
Updated by Roel Standaert almost 3 years ago
- Status changed from InProgress to Review
Updated by Roel Standaert almost 3 years ago
- Status changed from Review to Implemented @Emweb
Updated by Roel Standaert almost 3 years ago
- Status changed from Implemented @Emweb to Resolved
Updated by Bruce Toll almost 3 years ago
Thanks for all of the work with upstream on this. I was wondering if the issue could also impact double_to_s and real_to_s in src/Wt/Dbo/backend/Postgres.C. I haven't had the opportunity to test with Boost 1.76+ yet.
Updated by Roel Standaert almost 3 years ago
It may affect those functions as well, indeed.
Updated by Roel Standaert almost 3 years ago
The bug occurs when it has to round the input up in order to fit into the given precision, so in our round_js_str
we get a double
as input, but ask it to output it with at most 7 decimals.
Our real_to_s
function on the other hand gets a float
as input, and thus already has less precision, so at the very least I can't reproduce the issue with the numbers I used to test round_js_str
. That suggests we may also be able to work around the issue by sacrificing precision beforehand, or increasing precision where we use round_js_str
.
If the bug affects Postgres.C
as well, we're a lot less likely to trigger it. I will look further to see if there is any number that will trigger the bug.
Updated by Roel Standaert almost 3 years ago
I tried to start from 9.999f
and using nextafterf
to near 10.f
, and didn't notice the bug.
I did encounter another issue where stof
would throw an exception, though.
Updated by Roel Standaert almost 3 years ago
- Related to Bug #9572: Some JSON serializer tests fail with recent Boost versions added
Updated by Roel Standaert almost 3 years ago
- Status changed from Resolved to Closed
Updated by Roel Standaert over 2 years ago
- Related to Bug #10320: Disable workarounds for issue #9363 and #9572 when using Boost 1.79.0 or higher added