Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loss of precision encoding some double values to JSON (#206) #207

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

snej
Copy link
Contributor

@snej snej commented Jan 31, 2024

Some double numbers stored in Fleece would be improperly rounded (too few digits of precision) when written to JSON or otherwise converted to strings.

The fix makes a slight change to the Fleece binary format, using a previously unused bit in a float value, but it's backwards compatible.

Fixes #206

Some `double` numbers stored in Fleece would be improperly rounded
(too few digits of precision) when written to JSON or otherwise
converted to strings.

The fix makes a slight change to the Fleece binary format, using a
previously unused bit in a float value, but it's backwards compatible.

Fixes #206
@snej snej requested a review from borrrden January 31, 2024 01:29
@borrrden borrrden merged commit b915faf into master Jan 31, 2024
3 checks passed
@borrrden borrrden deleted the fix/double-precision-206 branch January 31, 2024 02:24
Dushistov pushed a commit to Dushistov/fleece that referenced this pull request May 8, 2024
) (couchbase#207)

Some `double` numbers stored in Fleece would be improperly rounded
(too few digits of precision) when written to JSON or otherwise
converted to strings.

The fix makes a slight change to the Fleece binary format, using a
previously unused bit in a float value, but it's backwards compatible.

Fixes couchbase#206
Dushistov pushed a commit to Dushistov/fleece that referenced this pull request Jun 2, 2024
Dushistov added a commit to Dushistov/fleece that referenced this pull request Jun 3, 2024
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.

Decimal precision can be lost converting double -> Fleece -> string
2 participants