fix: support large min/max values without precision loss#152
Draft
trnila wants to merge 2 commits intooxibus:mainfrom
Draft
fix: support large min/max values without precision loss#152trnila wants to merge 2 commits intooxibus:mainfrom
trnila wants to merge 2 commits intooxibus:mainfrom
Conversation
Min/max values are no longer represented as f64 internally that caused precision loss or value that couldnt fit in u64. For example 2**64 was represented as 18446744073709552000 instead of 18446744073709551615.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nyurik
reviewed
Mar 18, 2026
Comment on lines
+212
to
+213
| min: can_dbc::NumericValue::Double(0.0), | ||
| max: can_dbc::NumericValue::Double(0.0), |
Member
There was a problem hiding this comment.
shorter paths look easier to read (need a use at the top).
Suggested change
| min: can_dbc::NumericValue::Double(0.0), | |
| max: can_dbc::NumericValue::Double(0.0), | |
| min: NumericValue::Double(0.0), | |
| max: NumericValue::Double(0.0), |
More strategically - should this be NumericValue::default() instead? And I wonder if min/max = 0 is the right value -- if there was no min/max, perhaps we should use Option::None ?
| features = ["std"] | ||
|
|
||
| [patch.crates-io] | ||
| can-dbc = { git = "https://github.com/trnila/can-dbc", rev = "3a074924789c59954905186261133825907ed678" } |
| let sig = signal.field_name().to_uppercase(); | ||
| let min = signal.min; | ||
| let max = signal.max; | ||
| let min = &signal.min; |
Member
There was a problem hiding this comment.
min/max should be copyable types
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.
Min/max values are no longer represented as
f64internally that caused precision loss or value that couldnt fit inu64.For example
2**64was represented as18446744073709552000instead of18446744073709551615.