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
9a5beece
Commit
9a5beece
authored
May 31, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments.
parent
1ef17954
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
Modules/_decimal/libmpdec/mpdecimal.c
Modules/_decimal/libmpdec/mpdecimal.c
+14
-4
No files found.
Modules/_decimal/libmpdec/mpdecimal.c
View file @
9a5beece
...
...
@@ -3953,8 +3953,18 @@ _mpd_get_exp_iterations(const mpd_t *r, mpd_ssize_t p)
}
/*
* Internal function, specials have been dealt with. The result has a
* relative error of less than 0.5 * 10**(-ctx->prec).
* Internal function, specials have been dealt with. Apart from Overflow
* and Underflow, two cases must be considered for the error of the result:
*
* 1) abs(a) <= 9 * 10**(-prec-1) ==> result == 1
*
* Absolute error: abs(1 - e**x) < 10**(-prec)
* -------------------------------------------
*
* 2) abs(a) > 9 * 10**(-prec-1)
*
* Relative error: abs(result - e**x) < 0.5 * 10**(-prec) * e**x
* -------------------------------------------------------------
*
* The algorithm is from Hull&Abrham, Variable Precision Exponential Function,
* ACM Transactions on Mathematical Software, Vol. 12, No. 2, June 1986.
...
...
@@ -3998,9 +4008,9 @@ _mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
*
* MAX-EMAX+1 < log10(e^(0.1*10*t)) <= log10(e^(r*10^t)) < adjexp(e^(r*10^t))+1
*
* (2) -1 < r <= -0.1, so e^r <= e^-0.1. I
t
t > MAX_T, underflow occurs:
* (2) -1 < r <= -0.1, so e^r <= e^-0.1. I
f
t > MAX_T, underflow occurs:
*
* adjexp(e^(r*10^t)) <= log10(e^(r*10^t)) <= log10(e^(-0.1*10^t) < MIN-ETINY
* adjexp(e^(r*10^t)) <= log10(e^(r*10^t)) <= log10(e^(-0.1*10^t)
)
< MIN-ETINY
*/
#if defined(CONFIG_64)
#define MPD_EXP_MAX_T 19
...
...
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