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

Mark Dickinson report at bugs.python.org
Sat Nov 28 15:43:53 CET 2009

Mark Dickinson <dickinsm at gmail.com> added the comment:

There's a restriction on the second argument to scaleb in the spec, 
namely that scaleb should be in the range -2*(Emax + precision) to 
2*(Emax + precision) inclusive.

This restriction seems entirely arbitrary and unnecessary to me.  My
guess is that it's there to ease implementation in low-level languages, 
but it makes little sense for the Python implementation.

Here's a patch that removes this restriction on scaleb in the Python 
implementation, and skips the corresponding tests.

Added file: http://bugs.python.org/file15411/scaleb.patch

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list