Conversation
e307458 to
b9de0c0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #964 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 2352 2353 +1
=========================================
+ Hits 2352 2353 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f5b6516 to
bd56883
Compare
learn_rounding_digitslearn_rounding_digits precision
Contributor
R-Palazzo
reviewed
Mar 28, 2025
R-Palazzo
reviewed
Mar 28, 2025
R-Palazzo
approved these changes
Mar 28, 2025
Contributor
R-Palazzo
left a comment
There was a problem hiding this comment.
LGTM!
Great test to understand and double check everything 👍
Member
Author
Added a notebook showing it fixes the original problem here. |
learn_rounding_digits precisionlearn_rounding_digits precision
frances-h
reviewed
Mar 28, 2025
frances-h
approved these changes
Mar 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CU-86b455jpu, Resolve https://github.com/datacebo/SDV-Enterprise/issues/1107.
A float64 has 15-17 digits of precision. Anything after that should be disconsidered. For example:
These 15-17 digits include the integer part of the number, for example:
The previous implementation always attempted to round to
MAX_DECIMALS - 1digits, ie 14 decimal places, which could fail for cases like above where there's an integer component to the number:This PR fixes this issue by rounding to
MAX_DECIMALS - num_integer_digitsinstead, ensuring the situation above never happens.