New submission from Stefan Krah <stefan-use...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7048>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to