[New-bugs-announce] [issue7099] Decimal.is_normal should return True even for numbers with exponent > Emax

Mark Dickinson report at bugs.python.org
Sat Oct 10 20:45:23 CEST 2009


New submission from Mark Dickinson <dickinsm at gmail.com>:

Noticed by Stefan Krah:

Python 2.7a0 (trunk:75309, Oct 10 2009, 13:44:18) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import *
>>> x = Decimal('9.99999999e+1000')
>>> c = getcontext()
>>> c.prec = 9
>>> c.Emax = 999
>>> c.Emin = -999
>>> 
>>> x.is_normal()
False
>>> x.is_subnormal()
False
>>> x.is_infinite()
False
>>> x.is_nan()
False
>>> x.is_zero()
False

So if x isn't normal, subnormal, zero, nan or infinity, what the ****
is it?!

x.is_normal() should probably be returning True here.

----------
assignee: mark.dickinson
components: Library (Lib)
messages: 93838
nosy: mark.dickinson, skrah
priority: normal
severity: normal
status: open
title: Decimal.is_normal should return True even for numbers with exponent > Emax
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

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


More information about the New-bugs-announce mailing list