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

Cannot print Value when uncertainty is 0 #2

Open
labay11 opened this issue Oct 9, 2020 · 0 comments
Open

Cannot print Value when uncertainty is 0 #2

labay11 opened this issue Oct 9, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@labay11
Copy link
Member

labay11 commented Oct 9, 2020

We should add a test when calculating the precision as an uncertainty of 0 yields a precision of infinity.

  File "/home/adria/miniconda3/envs/netsquid/lib/python3.8/site-packages/uncvalue/uncvalue.py", line 294, in __str__
    p = self.precision() - 1
  File "/home/adria/miniconda3/envs/netsquid/lib/python3.8/site-packages/uncvalue/uncvalue.py", line 341, in precision
    return int(np.floor(np.log10(self.ux)))
OverflowError: cannot convert float infinity to integer

@labay11 labay11 added the bug Something isn't working label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant