Bug report
Bug description:
from decimal import Decimal, getcontext
EMIN = getcontext().Emin
EMAX = getcontext().Emax
exprs = (
"Decimal(f'1E+{EMAX}')",
"Decimal(f'1E+{EMAX+10}')",
# "Decimal(f'{10 ** (EMAX+10)}')",
"Decimal(f'1E+{EMAX+10}') / 10",
"Decimal(f'1E{EMIN}')",
"Decimal(f'1E{EMIN-10}')",
"Decimal(f'1E{EMIN-10}') * 10",
)
for expr in exprs:
print(expr)
try:
print(eval(expr))
except Exception as e:
print(e)
print()
Output:
Decimal(f'1E+{EMAX}')
1E+999999
Decimal(f'1E+{EMAX+10}')
1E+1000009
Decimal(f'1E+{EMAX+10}') / 10
[<class 'decimal.Overflow'>]
Decimal(f'1E{EMIN}')
1E-999999
Decimal(f'1E{EMIN-10}')
1E-1000009
Decimal(f'1E{EMIN-10}') * 10
1.0E-1000008
CPython versions tested on:
3.15, 3.14, 3.13, 3.12, 3.11, 3.10, 3.9
Operating systems tested on:
Windows
Bug report
Bug description:
Output:
CPython versions tested on:
3.15, 3.14, 3.13, 3.12, 3.11, 3.10, 3.9
Operating systems tested on:
Windows