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
e42f1bb3
Commit
e42f1bb3
authored
Jul 08, 2010
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix misplaced exactness check that was causing unnecessary work in Decimal.__pow__.
parent
a123631a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Lib/decimal.py
Lib/decimal.py
+4
-3
No files found.
Lib/decimal.py
View file @
e42f1bb3
...
...
@@ -2327,9 +2327,10 @@ class Decimal(object):
# try for an exact result with precision +1
if
ans
is
None
:
ans
=
self
.
_power_exact
(
other
,
context
.
prec
+
1
)
if
ans
is
not
None
and
result_sign
==
1
:
ans
=
_dec_from_triple
(
1
,
ans
.
_int
,
ans
.
_exp
)
exact
=
True
if
ans
is
not
None
:
if
result_sign
==
1
:
ans
=
_dec_from_triple
(
1
,
ans
.
_int
,
ans
.
_exp
)
exact
=
True
# usual case: inexact result, x**y computed directly as exp(y*log(x))
if
ans
is
None
:
...
...
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