Errors#
ExactRef raises an error rather than return an answer it cannot guarantee, and when it is given arguments it cannot use.
A result could not be established with the promised guarantee.
This is raised instead of returning an unverified answer, for example when an exact value may lie exactly on a rounding boundary that the certified algorithm cannot resolve.
- exception UnsupportedFormatError#
Raised for an unknown format name or a format this library cannot hold.
ReferenceUnavailableError is a subclass of ArithmeticError.
Guarantees and limits lists when it is
raised. UnsupportedFormatError is a subclass of ValueError:
import exactref as er
try:
# er.get_format looks the name up in er.FORMATS, which has no float128
er.get_format("float128")
except er.UnsupportedFormatError as error:
# The error's class name and message
print(f"{type(error).__name__}: {error}")
UnsupportedFormatError: unsupported format 'float128'; supported: ...
Other errors you may meet come from Python's own classes:
Error |
When |
|---|---|
|
inputs of different dtypes to |
|
an output for |
|
an integer that does not fit its format, when converting Python values or with |
|
|