On this page
decimal.DivisionUndefined
Prev: decimal.DivisionImpossible | Up: decimal | Next: decimal.FloatOperation
Rel: decimal.Clamped, decimal.Context, decimal.ConversionSyntax, decimal.Decimal
Ref: docs.python.org โ decimal.DivisionUndefined
Tags: #public #python3 #stdlib #decimal
Import
import decimal
from decimal import DivisionUndefined
Signature & Overview
decimal.DivisionUndefined(...)
decimal.DivisionUndefined class.
Methods & Attributes
DivisionUndefined.add_note(self, note, /)โ Add a note to the exceptionDivisionUndefined.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
from decimal import Decimal, InvalidOperation
try:
Decimal("0") / Decimal("0")
except InvalidOperation:
assert True
Gotchas
- Raised for
Decimal(0) / Decimal(0)(0/0 is undefined, distinct fromDivisionByZero).
REPL Inspect
from decimal import DivisionUndefined
help(DivisionUndefined)
Linked from
Related notes
- tuts/python3/stdlib_module/decimal/DivisionImpossible Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/FloatOperation Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Clamped Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Context Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/ConversionSyntax Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Decimal Linked here; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/decimal/DecimalException shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/DecimalTuple shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/DivisionByZero shared tags: #decimal, #stdlib