summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-05 22:36:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-05 22:36:56 (GMT)
commita40c793d06ee2b42a5013015352616b4ca6b288b (patch)
tree5e056aac66ded03b3a6cae9118c7e109c861bfc6 /Misc
parent75ed167527e688ab6160af3b387532ea3e1c6a74 (diff)
downloadcpython-a40c793d06ee2b42a5013015352616b4ca6b288b.zip
cpython-a40c793d06ee2b42a5013015352616b4ca6b288b.tar.gz
cpython-a40c793d06ee2b42a5013015352616b4ca6b288b.tar.bz2
Rework the way we try to check for libm overflow, given that C99 no longer
requires that errno ever get set, and it looks like glibc is already playing that game. New rules: + Never use HUGE_VAL. Use the new Py_HUGE_VAL instead. + Never believe errno. If overflow is the only thing you're interested in, use the new Py_OVERFLOWED(x) macro. If you're interested in any libm errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts to set errno the way C89 said it worked. Unfortunately, none of these are reliable, but they work on Windows and I *expect* under glibc too.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 02d4968..50ec64f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -81,6 +81,13 @@ Core
Library
+- The new C standard no longer requires that math libraries set errno to
+ ERANGE on overflow. For platform libraries that exploit this new
+ freedom, Python's overflow-checking was wholly broken. A new overflow-
+ checking scheme attempts to repair that, but may not be reliable on all
+ platforms (C doesn't seem to provide anything both useful and portable
+ in this area anymore).
+
- Asynchronous timeout actions are available through the new class
threading.Timer.