On this page
decimal.IEEEContext
Prev: decimal.getcontext | Up: decimal | Next: decimal.Inexact
Rel: decimal.Clamped, decimal.Context, decimal.ConversionSyntax, decimal.Decimal
Ref: docs.python.org — decimal.IEEEContext
Tags: #public #python3 #stdlib #decimal
Import
import decimal
from decimal import IEEEContext
Signature & Overview
decimal.IEEEContext(bits, /)
Return a context object initialized to the proper values for one of the IEEE interchange formats. The argument must be a multiple of 32 and less than IEEE_CONTEXT_MAX_BITS.
Usage
import decimal
ctx = decimal.IEEEContext(64) # IEEE 754 decimal64 (16 digits)
assert ctx.prec == 16
Gotchas
- Bit width must be a multiple of 32 (commonly
32,64, or128).
REPL Inspect
from decimal import IEEEContext
help(IEEEContext)
Linked from
Related notes
- tuts/python3/stdlib_module/decimal/getcontext Linked here; links to this page; shared tags: #decimal, #stdlib
- tuts/python3/stdlib_module/decimal/Inexact 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