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

TimeType comparisons fail on inf #536

Closed
2 tasks
shumpohl opened this issue Jul 1, 2020 · 0 comments · Fixed by #537
Closed
2 tasks

TimeType comparisons fail on inf #536

shumpohl opened this issue Jul 1, 2020 · 0 comments · Fixed by #537

Comments

@shumpohl
Copy link
Member

shumpohl commented Jul 1, 2020

Currently TimeType casts float to TimeType for comparisons. This leads to crashes when doing something like TimeType.from_float(1.1) < float('inf') because infinity cannot be represented as an integer fraction. The error message is not clear because it only says ValueError: invalid digits.

Should we have a max time? somewhing like 1e30ns which is a few orders of magnitude larger than the age of the universe. If one creates a TimeType with a larger absolute value qupulse does no longer garantuee corectness.

  • Better error message if a non-finite float(NaN, inf, -inf) is encountered.
  • Do not convert other value to TimeType by default for comparisons.
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 a pull request may close this issue.

1 participant