[New-bugs-announce] [issue7048] decimal.py: logb: round the result if it is greater than prec

Stefan Krah report at bugs.python.org
Sat Oct 3 15:53:17 CEST 2009


New submission from Stefan Krah <stefan-usenet at bytereef.org>:

>>> from decimal import *
>>> c = getcontext()
>>> c.prec = 2
>>> c.logb(Decimal("1E123456"))
Decimal('123456')
>>> 

This result agrees with the result of decNumber, but the spec says:
"All results are exact unless an integer result does not fit in the
available precision."

My interpretation is that the result should be 1.2E+5.

----------
messages: 93492
nosy: mark.dickinson, skrah
severity: normal
status: open
title: decimal.py: logb: round the result if it is greater than prec

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7048>
_______________________________________


More information about the New-bugs-announce mailing list