Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e5a0a960
Commit
e5a0a960
authored
Jun 20, 2005
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply the _is_special guard.
parent
a7daba68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
Lib/decimal.py
Lib/decimal.py
+13
-12
No files found.
Lib/decimal.py
View file @
e5a0a960
...
...
@@ -760,18 +760,19 @@ class Decimal(object):
Captures all of the information in the underlying representation.
"""
if
self
.
_isnan
():
minus
=
'-'
*
self
.
_sign
if
self
.
_int
==
(
0
,):
info
=
''
else
:
info
=
''
.
join
(
map
(
str
,
self
.
_int
))
if
self
.
_isnan
()
==
2
:
return
minus
+
'sNaN'
+
info
return
minus
+
'NaN'
+
info
if
self
.
_isinfinity
():
minus
=
'-'
*
self
.
_sign
return
minus
+
'Infinity'
if
self
.
_is_special
:
if
self
.
_isnan
():
minus
=
'-'
*
self
.
_sign
if
self
.
_int
==
(
0
,):
info
=
''
else
:
info
=
''
.
join
(
map
(
str
,
self
.
_int
))
if
self
.
_isnan
()
==
2
:
return
minus
+
'sNaN'
+
info
return
minus
+
'NaN'
+
info
if
self
.
_isinfinity
():
minus
=
'-'
*
self
.
_sign
return
minus
+
'Infinity'
if
context
is
None
:
context
=
getcontext
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment