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
4125e5c6
Commit
4125e5c6
authored
Mar 12, 2017
by
Serhiy Storchaka
Committed by
GitHub
Mar 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-26121: Revert to using the own implementations of lgamma and gamma on all platforms. (#637)
parent
c2cf1285
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
33 deletions
+1
-33
Misc/NEWS
Misc/NEWS
+1
-2
Modules/mathmodule.c
Modules/mathmodule.c
+0
-31
No files found.
Misc/NEWS
View file @
4125e5c6
...
...
@@ -284,8 +284,7 @@ Library
-
bpo
-
28692
:
Using
non
-
integer
value
for
selecting
a
plural
form
in
gettext
is
now
deprecated
.
-
bpo
-
26121
:
Use
C
library
implementation
for
math
functions
:
tgamma
(),
lgamma
(),
erf
()
and
erfc
().
-
bpo
-
26121
:
Use
C
library
implementation
for
math
functions
erf
()
and
erfc
().
-
bpo
-
29619
:
os
.
stat
()
and
os
.
DirEntry
.
inode
()
now
convert
inode
(
st_ino
)
using
unsigned
integers
.
...
...
Modules/mathmodule.c
View file @
4125e5c6
...
...
@@ -74,17 +74,6 @@ static const double pi = 3.141592653589793238462643383279502884197;
static
const
double
sqrtpi
=
1
.
772453850905516027298167483341145182798
;
static
const
double
logpi
=
1
.
144729885849400174143427351353058711647
;
#ifndef __APPLE__
# ifdef HAVE_TGAMMA
# define USE_TGAMMA
# endif
# ifdef HAVE_LGAMMA
# define USE_LGAMMA
# endif
#endif
#if !defined(USE_TGAMMA) || !defined(USE_LGAMMA)
static
double
sinpi
(
double
x
)
{
...
...
@@ -241,7 +230,6 @@ lanczos_sum(double x)
}
return
num
/
den
;
}
#endif
/* !defined(USE_TGAMMA) || !defined(USE_LGAMMA) */
/* Constant for +infinity, generated in the same way as float('inf'). */
...
...
@@ -275,14 +263,6 @@ m_nan(void)
static
double
m_tgamma
(
double
x
)
{
#ifdef USE_TGAMMA
if
(
x
==
0
.
0
)
{
errno
=
EDOM
;
/* tgamma(+-0.0) = +-inf, divide-by-zero */
return
copysign
(
Py_HUGE_VAL
,
x
);
}
return
tgamma
(
x
);
#else
double
absx
,
r
,
y
,
z
,
sqrtpow
;
/* special cases */
...
...
@@ -374,7 +354,6 @@ m_tgamma(double x)
if
(
Py_IS_INFINITY
(
r
))
errno
=
ERANGE
;
return
r
;
#endif
}
/*
...
...
@@ -386,15 +365,6 @@ static double
m_lgamma
(
double
x
)
{
double
r
;
#ifdef USE_LGAMMA
r
=
lgamma
(
x
);
if
(
errno
==
ERANGE
&&
x
==
floor
(
x
)
&&
x
<=
0
.
0
)
{
errno
=
EDOM
;
/* lgamma(n) = inf, divide-by-zero for */
return
Py_HUGE_VAL
;
/* integers n <= 0 */
}
return
r
;
#else
double
absx
;
/* special cases */
...
...
@@ -433,7 +403,6 @@ m_lgamma(double x)
if
(
Py_IS_INFINITY
(
r
))
errno
=
ERANGE
;
return
r
;
#endif
}
#if !defined(HAVE_ERF) || !defined(HAVE_ERFC)
...
...
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