summaryrefslogtreecommitdiffstats
path: root/Python/pymath.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45440: Remove pymath.c fallbacks (GH-28977)Victor Stinner2021-10-151-48/+0
| | | | | | | | Remove fallbacks for missing round(), copysign() and hypot() in Python/pymath.c. Python now requires these functions to build. These fallbacks were needed on Visual Studio 2012 and older. They are no longer needed since Visual Stuido 2013. Python is now built with Visual Studio 2017 or newer since Python 3.6.
* bpo-45440: Require math.h isinf() to build (GH-28894)Victor Stinner2021-10-131-13/+0
| | | | | | | | | | | | | | | Building Python now requires a C99 <math.h> header file providing isinf(), isnan() and isfinite() functions. Remove the Py_FORCE_DOUBLE() macro. It was used by the Py_IS_INFINITY() macro. Changes: * Remove Py_IS_NAN(), Py_IS_INFINITY() and Py_IS_FINITE() in PC/pyconfig.h. * Remove the _Py_force_double() function. * configure no longer checks if math.h defines isinf(), isnan() and isfinite().
* bpo-45412: Move _Py_SET_53BIT_PRECISION_START to pycore_pymath.h (GH-28882)Victor Stinner2021-10-111-5/+4
| | | | | | | | | | | | | | | Move the following macros , to pycore_pymath.h (internal C API): * _Py_SET_53BIT_PRECISION_HEADER * _Py_SET_53BIT_PRECISION_START * _Py_SET_53BIT_PRECISION_END PEP 7: add braces to if and "do { ... } while (0)" in these macros. Move also _Py_get_387controlword() and _Py_set_387controlword() definitions to pycore_pymath.h. These functions are no longer exported. pystrtod.c now includes pycore_pymath.h.
* bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)Niklas Fiekas2020-06-151-15/+0
| | | | | | | | | | In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This allows reconsidering bpo-29782. * Move the function to the new header. * Changed return type to match __builtin_clzl() and reviewed usage. * Use intrinsics where available. * Pick a fallback implementation suitable for inlining.
* bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)Niklas Fiekas2020-01-161-0/+15
| | | Add _Py_bit_length() to unify duplicate bits_in_digit() and bit_length().
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Gregory P. Smith2018-11-131-1/+1
| | | | Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER. Project based C Preprocessor namespacing at its finest. :P
* bpo-35214: Initial clang MemorySanitizer support (GH-10479)Gregory P. Smith2018-11-121-1/+3
| | | | | | | | | | Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this.
* Issue 24366: Indent code (thanks to li4ick for reporting).Yury Selivanov2015-06-021-1/+1
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-24/+24
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 76978 via svnmerge fromMark Dickinson2009-12-211-199/+0
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76978 | mark.dickinson | 2009-12-21 15:22:00 +0000 (Mon, 21 Dec 2009) | 3 lines Issue #7518: Move substitute definitions of C99 math functions from pymath.c to Modules/_math.c. ........
* The SSE2 detection and enabling could potentially causeMark Dickinson2009-04-181-5/+1
| | | | | | | | problems for binary distributions of Python in situations where the build machine has SSE2 but the target machine does not. Therefore, don't enable SSE2 instructions automatically on x86.
* Merged revisions 71705 via svnmerge fromMark Dickinson2009-04-181-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r71705 | mark.dickinson | 2009-04-18 15:13:43 +0100 (Sat, 18 Apr 2009) | 2 lines copysign shouldn't be declared as static in pymath.c ........
* Add check for C99 round function to configure, and defineMark Dickinson2009-04-181-0/+13
| | | | a fallback function if round doesn't exist.
* Issue #1580: use short float repr where possible.Mark Dickinson2009-04-161-0/+22
| | | | | | | | | | | | | | | - incorporate and adapt David Gay's dtoa and strtod into the Python core - on platforms where we can use Gay's code (almost all!), repr(float) is based on the shortest sequence of decimal digits that rounds correctly. - add sys.float_repr_style attribute to indicate whether we're using Gay's code or not - add autoconf magic to detect and enable SSE2 instructions on x86/gcc - slight change to repr and str: repr switches to exponential notation at 1e16 instead of 1e17, str switches at 1e11 instead of 1e12
* Merged revisions 69459 via svnmerge fromMark Dickinson2009-02-091-0/+13
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r69459 | mark.dickinson | 2009-02-09 14:18:43 +0000 (Mon, 09 Feb 2009) | 3 lines Issue #4575: fix Py_IS_INFINITY macro to work correctly on x87 FPUs. It now forces its argument to double before testing for infinity. ........
* Merged revisions 66552-66553 via svnmerge fromAndrew MacIntyre2008-09-221-0/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66552 | andrew.macintyre | 2008-09-23 00:10:54 +1000 (Tue, 23 Sep 2008) | 5 lines should use macro'ed symbols not direct Part of source_os2emx.patch in issue 3868 Reviewed by Amaury Forgeot d'Arc ........ r66553 | andrew.macintyre | 2008-09-23 00:11:41 +1000 (Tue, 23 Sep 2008) | 5 lines any platform without HAVE_LOG1P should have DBL_EPSILON in <float.h> Part of source_os2emx.patch in issue 3868 Reviewed by Amaury Forgeot d'Arc ........
* Merged revisions 62380,62382-62383 via svnmerge fromChristian Heimes2008-04-191-0/+232
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62380 | christian.heimes | 2008-04-19 01:13:07 +0200 (Sat, 19 Apr 2008) | 3 lines I finally got the time to update and merge Mark's and my trunk-math branch. The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :) ........ r62382 | christian.heimes | 2008-04-19 01:40:40 +0200 (Sat, 19 Apr 2008) | 2 lines Added new files to Windows project files More Windows related fixes are coming soon ........ r62383 | christian.heimes | 2008-04-19 01:49:11 +0200 (Sat, 19 Apr 2008) | 1 line Stupid me. Py_RETURN_NAN should actually return something ... ........