This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/3] Add new pow implementation
On 17/09/18 23:19, Joseph Myers wrote:
On Tue, 11 Sep 2018, Szabolcs Nagy wrote:
+/* Returns 0 if not int, 1 if odd int, 2 if even int. */
+static inline int
+checkint (uint64_t iy)
The comment needs to explain that this function is not called with an
argument representing floating-point 0, Inf or NaN (since it wouldn't be
correct for 0 at least).
OK with that change.
Thanks for the reviews, i committed the patch and
separately fixed the comment in powf too in the
same way with the attached obvious patch.
>From d734727837b5135c4c4c540d8c53e5a06aa7556a Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed, 19 Sep 2018 10:09:41 +0100
Subject: [PATCH] Fix the documentation comment of checkint in powf
checkint in powf is not supposed to be used with 0, inf or nan inputs.
* sysdeps/ieee754/flt-32/e_powf.c (checkint): Fix documentation.
---
ChangeLog | 4 ++++
sysdeps/ieee754/flt-32/e_powf.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 57ba532bd6..cecbdf4985 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * sysdeps/ieee754/flt-32/e_powf.c (checkint): Fix documentation.
+
2018-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
* NEWS: Mention pow improvements.
diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c
index ece83f0dd2..d0c912188f 100644
--- a/sysdeps/ieee754/flt-32/e_powf.c
+++ b/sysdeps/ieee754/flt-32/e_powf.c
@@ -118,7 +118,8 @@ exp2_inline (double_t xd, uint32_t sign_bias)
return y;
}
-/* Returns 0 if not int, 1 if odd int, 2 if even int. */
+/* Returns 0 if not int, 1 if odd int, 2 if even int. The argument is
+ the bit representation of a non-zero finite floating-point value. */
static inline int
checkint (uint32_t iy)
{
--
2.14.1