Skip to content

Cannot print Value when uncertainty is 0 #2

Description

@labay11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions