Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-26121: Revert to using the own implementations of lgamma and gamma on all platforms. (#637) | 4125e5c60e24ffcff8031817dc60984335917f59 | Serhiy Storchaka | 2017-03-12 12:08:06 |
bpo-8256: Fixed possible failing or crashing input() (#517) | c2cf12857187aa147c268651f10acd6da2c9cb74 | Serhiy Storchaka | 2017-03-12 11:50:36 |
bpo-26121: Use C library implementation for math functions erf() and erfc() on Windows. (#632) | 4dadcd4ed7824c7904add78577e6a05864cfe493 | Serhiy Storchaka | 2017-03-12 11:39:22 |
bpo-29723: Add missing NEWS entry (#638) | 27abb0e533a6f7ad195bd56b064c32164296a56e | Nick Coghlan | 2017-03-12 11:34:32 |
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507) | f6595983e08fe20cf06a2535d74d912c6dbb044f | Serhiy Storchaka | 2017-03-12 11:15:01 |
bpo-20185: Convert the resource moduel to Argument Clinic. (#545) | 1989763f0d0858ce6274f5e1d725b5b8da91a780 | Serhiy Storchaka | 2017-03-12 11:08:30 |
bpo-29723: Consistently configure sys.path[0] (#575) | d2977a3ae2cc6802921b1e3b6e9d13fcfbda872d | Nick Coghlan | 2017-03-12 10:38:32 |
bpo-29798: Handle git worktree in `make patchcheck` (#629) | 6a6d090612dd7deaac2bc0399fad743e5e2db606 | Nick Coghlan | 2017-03-12 09:37:09 |
bpo-15695: Implemented StgDict.__sizeof__(). (#509) | 8999caeb003ed292011e98b8a30746cce787a125 | Serhiy Storchaka | 2017-03-12 09:12:30 |
bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485) | 202fda55c2dffe27125703225e5af92254602dc6 | Serhiy Storchaka | 2017-03-12 08:10:47 |
bpo-20185: Convert the marshal module to Argument Clinic. (#541) | 0767ad40bfe83525d2ba290cc6eb7c97ce01cdd6 | Serhiy Storchaka | 2017-03-12 07:20:15 |
bpo-29746: Update marshal docs to Python 3. (#547) | c611a5b1d4fab0123bf622f06c3bfa510221dc32 | Serhiy Storchaka | 2017-03-12 06:53:22 |
bpo-29763: Use support.unlink instead of os.unlink (GH-624) | 93710c152e6bcfffdf2f1f15bb5f75b013aef422 | Zachary Ware | 2017-03-12 04:10:07 |
bpo-29656: Handle PR branches in 'make patchcheck' (#302) | 482f7a274fa52b7ba34ff308cd9acdcac9f41ba5 | Nick Coghlan | 2017-03-12 03:19:08 |
bpo-26121: Use C library implementation for math functions: (#515) | 97553fdf9daa8231eb05a1ca9933a2b03b0bdad0 | Serhiy Storchaka | 2017-03-11 21:37:16 |
Only trigger AppVeyor on code or config changes (GH-611) | c5d3bfea0b0bba34bc3cd517a12153e189c80556 | Zachary Ware | 2017-03-11 20:55:35 |
tempfile.rst: Fix some typos (GH-610) | d3b8f98696b905367da3975f73b482bac380b51c | Jelle Zijlstra | 2017-03-11 17:34:55 |
bpo-20185: Convert float object implementation to Argument Clinic. (#543) | b5c51d3dd95bbfde533655fb86ac0f96f771ba7b | Serhiy Storchaka | 2017-03-11 07:21:05 |
bpo-20185: Convert list object implementation to Argument Clinic. (#542) | fdd42c481edba4261f861fc1dfe24bbd79b5a17a | Serhiy Storchaka | 2017-03-11 07:19:20 |
bpo-29770: remove outdated PYO related info (GH-590) | 0710d754255e731e6fcc3f206b51db6156da17c8 | Xiang Zhang | 2017-03-11 05:02:52 |
File | Lines added | Lines deleted |
---|---|---|
Misc/NEWS | 1 | 2 |
Modules/mathmodule.c | 0 | 31 |
File Misc/NEWS changed (mode: 100644) (index 2872aa1fe7..d4f0f25a29) | |||
... | ... | Library | |
284 | 284 | - bpo-28692: Using non-integer value for selecting a plural form in gettext is | - bpo-28692: Using non-integer value for selecting a plural form in gettext is |
285 | 285 | now deprecated. | now deprecated. |
286 | 286 | ||
287 | - bpo-26121: Use C library implementation for math functions: | ||
288 | tgamma(), lgamma(), erf() and erfc(). | ||
287 | - bpo-26121: Use C library implementation for math functions erf() and erfc(). | ||
289 | 288 | ||
290 | 289 | - bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino) using | - bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino) using |
291 | 290 | unsigned integers. | unsigned integers. |
File Modules/mathmodule.c changed (mode: 100644) (index bfc028eddd..d5a8ca1ebe) | |||
... | ... | static const double pi = 3.141592653589793238462643383279502884197; | |
74 | 74 | static const double sqrtpi = 1.772453850905516027298167483341145182798; | static const double sqrtpi = 1.772453850905516027298167483341145182798; |
75 | 75 | static const double logpi = 1.144729885849400174143427351353058711647; | static const double logpi = 1.144729885849400174143427351353058711647; |
76 | 76 | ||
77 | #ifndef __APPLE__ | ||
78 | # ifdef HAVE_TGAMMA | ||
79 | # define USE_TGAMMA | ||
80 | # endif | ||
81 | # ifdef HAVE_LGAMMA | ||
82 | # define USE_LGAMMA | ||
83 | # endif | ||
84 | #endif | ||
85 | |||
86 | #if !defined(USE_TGAMMA) || !defined(USE_LGAMMA) | ||
87 | |||
88 | 77 | static double | static double |
89 | 78 | sinpi(double x) | sinpi(double x) |
90 | 79 | { | { |
... | ... | lanczos_sum(double x) | |
241 | 230 | } | } |
242 | 231 | return num/den; | return num/den; |
243 | 232 | } | } |
244 | #endif /* !defined(USE_TGAMMA) || !defined(USE_LGAMMA) */ | ||
245 | 233 | ||
246 | 234 | /* Constant for +infinity, generated in the same way as float('inf'). */ | /* Constant for +infinity, generated in the same way as float('inf'). */ |
247 | 235 | ||
... | ... | m_nan(void) | |
275 | 263 | static double | static double |
276 | 264 | m_tgamma(double x) | m_tgamma(double x) |
277 | 265 | { | { |
278 | #ifdef USE_TGAMMA | ||
279 | if (x == 0.0) { | ||
280 | errno = EDOM; | ||
281 | /* tgamma(+-0.0) = +-inf, divide-by-zero */ | ||
282 | return copysign(Py_HUGE_VAL, x); | ||
283 | } | ||
284 | return tgamma(x); | ||
285 | #else | ||
286 | 266 | double absx, r, y, z, sqrtpow; | double absx, r, y, z, sqrtpow; |
287 | 267 | ||
288 | 268 | /* special cases */ | /* special cases */ |
... | ... | m_tgamma(double x) | |
374 | 354 | if (Py_IS_INFINITY(r)) | if (Py_IS_INFINITY(r)) |
375 | 355 | errno = ERANGE; | errno = ERANGE; |
376 | 356 | return r; | return r; |
377 | #endif | ||
378 | 357 | } | } |
379 | 358 | ||
380 | 359 | /* | /* |
... | ... | static double | |
386 | 365 | m_lgamma(double x) | m_lgamma(double x) |
387 | 366 | { | { |
388 | 367 | double r; | double r; |
389 | |||
390 | #ifdef USE_LGAMMA | ||
391 | r = lgamma(x); | ||
392 | if (errno == ERANGE && x == floor(x) && x <= 0.0) { | ||
393 | errno = EDOM; /* lgamma(n) = inf, divide-by-zero for */ | ||
394 | return Py_HUGE_VAL; /* integers n <= 0 */ | ||
395 | } | ||
396 | return r; | ||
397 | #else | ||
398 | 368 | double absx; | double absx; |
399 | 369 | ||
400 | 370 | /* special cases */ | /* special cases */ |
... | ... | m_lgamma(double x) | |
433 | 403 | if (Py_IS_INFINITY(r)) | if (Py_IS_INFINITY(r)) |
434 | 404 | errno = ERANGE; | errno = ERANGE; |
435 | 405 | return r; | return r; |
436 | #endif | ||
437 | 406 | } | } |
438 | 407 | ||
439 | 408 | #if !defined(HAVE_ERF) || !defined(HAVE_ERFC) | #if !defined(HAVE_ERF) || !defined(HAVE_ERFC) |