Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2020-07-31 02:41:05 +0300
committerCorinna Vinschen <corinna@vinschen.de>2020-08-03 14:29:27 +0300
commit12ad9a46dff86b7750aa9c8f8fca7349a0925114 (patch)
treea674b94bec0fcc5d14a561941e1329fef6728a04 /newlib/libm/common
parent5717262b8ecfed0f7fab63e2c09c78991e36f9dd (diff)
libm/math: Use __math_xflow in obsolete math code [v2]
C compilers may fold const values at compile time, so expressions which try to elicit underflow/overflow by performing simple arithemetic on suitable values will not generate the required exceptions. Work around this by replacing code which does these arithmetic operations with calls to the existing __math_xflow functions that are designed to do this correctly. Signed-off-by: Keith Packard <keithp@keithp.com> ---- v2: libm/math: Pass sign to __math_xflow instead of muliplying result
Diffstat (limited to 'newlib/libm/common')
-rw-r--r--newlib/libm/common/math_errf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libm/common/math_errf.c b/newlib/libm/common/math_errf.c
index 53c68b1cf..bb8273b8d 100644
--- a/newlib/libm/common/math_errf.c
+++ b/newlib/libm/common/math_errf.c
@@ -51,13 +51,13 @@ xflowf (uint32_t sign, float y)
return with_errnof (y, ERANGE);
}
-#if !__OBSOLETE_MATH
HIDDEN float
__math_uflowf (uint32_t sign)
{
return xflowf (sign, 0x1p-95f);
}
+#if !__OBSOLETE_MATH
#if WANT_ERRNO_UFLOW
/* Underflows to zero in some non-nearest rounding mode, setting errno
is valid even if the result is non-zero, but in the subnormal range. */