-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
When I create a unsigned 64-bit signal in the DBC (full range, no offset/scaling) the generated code fails to compile because the MAX constant has a value that exceeds u64 limits.
The issue seems to be:
minandmaxsignal bounds are both stored asf64f64has only 52 mantissa bits so generally fails to store values above2^52-1with full accuracy- rounding occurs and the value stored in
max(f64) is effectively larger than2^64-1
This seems like a flaw in the design. Here are a few workarounds I can think of:
- If min / max are not interesting anyway and you can tweak the DBC, you can do that.
dbc-codegencould add#[cfg(feature = "range_checked")]to theMINandMAXconstants so with range checking disabled at least there is no compilation error.
Has anyone else faced this issue before? Do you see a better way to work around the issue?
I'm willing to spend time on this but need some guidance.
Metadata
Metadata
Assignees
Labels
No labels