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
40360f2a
Commit
40360f2a
authored
May 03, 2008
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove broken __round__, __ceil__ and __floor__ from Decimal
parent
227e7f5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
9 deletions
+0
-9
Lib/decimal.py
Lib/decimal.py
+0
-9
No files found.
Lib/decimal.py
View file @
40360f2a
...
...
@@ -1649,9 +1649,6 @@ class Decimal(_numbers.Real):
else
:
return
-
1
def
__round__
(
self
):
return
self
.
_round_down
(
0
)
def
_round_up
(
self
,
prec
):
"""Rounds away from 0."""
return
-
self
.
_round_down
(
prec
)
...
...
@@ -1687,9 +1684,6 @@ class Decimal(_numbers.Real):
else
:
return
-
self
.
_round_down
(
prec
)
def
__ceil__
(
self
):
return
self
.
_round_ceiling
(
0
)
def
_round_floor
(
self
,
prec
):
"""Rounds down (not towards 0 if negative)"""
if
not
self
.
_sign
:
...
...
@@ -1697,9 +1691,6 @@ class Decimal(_numbers.Real):
else
:
return
-
self
.
_round_down
(
prec
)
def
__floor__
(
self
):
return
self
.
_round_floor
(
0
)
def
_round_05up
(
self
,
prec
):
"""Round down unless digit prec-1 is 0 or 5."""
if
prec
and
self
.
_int
[
prec
-
1
]
not
in
'05'
:
...
...
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