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

Time Representation Error #71

Open
Giles314 opened this issue Aug 4, 2024 · 0 comments
Open

Time Representation Error #71

Giles314 opened this issue Aug 4, 2024 · 0 comments

Comments

@Giles314
Copy link

Giles314 commented Aug 4, 2024

Cross-compiling pulseview on fresh install of Linux Mint 6.8.0-38-generic the tests integrated in make raise two errors at lines 220 and 221 of test/util.cpp.
the erroneous produced time representations were:
...:19:60 instead of ...:20:00 (line 220)
...:09:60 instead of ...:10:00 (line 221)

Checking the code it appears that it should work for these test lines if the type used to represent the numbers in the computation fulfills the following properties:

  • an integer value (in the used range) has a mathematically perfect representation in memory,
  • a division of 2 integer value which gives an integer result (mathematically speaking) will obtain the mathematically exact representation
  • a multiplication of 2 integer values will also give a mathematically exact result.

Usually integer and floats (with enough bit in mantis) are compliant. But the procedure works on Timestamp derived from boost::multiprecision::number. And apparently this type does not fulfill the property requirement. Though it increases the float representation precision, the integer representation are not mathematically perfect. The error is probably only 10^-24 of the target value but it is sufficient to trigger a decrement in floor function.

Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 4, 2024
Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 4, 2024
Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 4, 2024
Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 5, 2024
Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 5, 2024
Giles314 added a commit to Giles314/pulseview that referenced this issue Aug 5, 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

No branches or pull requests

1 participant