Bug report
Bug description:
import decimal
Decimal = decimal.Decimal
Decimal('0.000005').quantize(Decimal('1.111111')) # Decimal('0.000005') correct
Decimal('0.0000005').quantize(Decimal('1.1111111')) # Decimal('5E-7') wrong
According to the documentation, https://docs.python.org/3/library/decimal.html#decimal.Decimal.quantize
quantize() should "Return a value equal to the first operand after rounding and having the exponent of the second operand."
Clearly, it is not respecting the exponent of the second operand, even if that exponent is given explicitly:
Decimal('0.0000005').quantize(Decimal('1.1111111e0')) # Decimal('5E-7') wrong
CPython versions tested on:
3.13
Operating systems tested on:
Linux