On this page
  1. decimal.IEEEContext
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from decimal import IEEEContext
help(IEEEContext)

Linked from

Related notes