mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Apply the _is_special guard.
This commit is contained in:
parent
a7daba6866
commit
e5a0a9609f
1 changed files with 13 additions and 12 deletions
|
@ -760,18 +760,19 @@ class Decimal(object):
|
||||||
Captures all of the information in the underlying representation.
|
Captures all of the information in the underlying representation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self._isnan():
|
if self._is_special:
|
||||||
minus = '-'*self._sign
|
if self._isnan():
|
||||||
if self._int == (0,):
|
minus = '-'*self._sign
|
||||||
info = ''
|
if self._int == (0,):
|
||||||
else:
|
info = ''
|
||||||
info = ''.join(map(str, self._int))
|
else:
|
||||||
if self._isnan() == 2:
|
info = ''.join(map(str, self._int))
|
||||||
return minus + 'sNaN' + info
|
if self._isnan() == 2:
|
||||||
return minus + 'NaN' + info
|
return minus + 'sNaN' + info
|
||||||
if self._isinfinity():
|
return minus + 'NaN' + info
|
||||||
minus = '-'*self._sign
|
if self._isinfinity():
|
||||||
return minus + 'Infinity'
|
minus = '-'*self._sign
|
||||||
|
return minus + 'Infinity'
|
||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
context = getcontext()
|
context = getcontext()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue