From 40aeb9316d13065284e61b192c6f93a1f999e558 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 5 Apr 2024 16:45:25 +0200 Subject: [PATCH] exp2l: Work around a NetBSD 10.0/i386 bug. * m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1). --- ChangeLog | 5 +++++ m4/exp2l.m4 | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c7debb387..56562d8b34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-04-05 Bruno Haible + + exp2l: Work around a NetBSD 10.0/i386 bug. + * m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1). + 2024-04-05 Bruno Haible roundl: Fix a link error on Linux/powerpc64le. diff --git a/m4/exp2l.m4 b/m4/exp2l.m4 index de657bcae8..802f1f6709 100644 --- a/m4/exp2l.m4 +++ b/m4/exp2l.m4 @@ -1,4 +1,4 @@ -# exp2l.m4 serial 12 +# exp2l.m4 serial 12.1 dnl Copyright (C) 2010-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -80,7 +80,7 @@ int main (int argc, char *argv[]) { long double (* volatile my_exp2l) (long double) = argc ? exp2l : dummy; int result = 0; - /* This test fails on NetBSD 9.0. */ + /* This test fails on NetBSD NetBSD 10.0/x86_64. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) @@ -93,6 +93,13 @@ int main (int argc, char *argv[]) if (!(err >= -100.0L && err <= 100.0L)) result |= 1; } + /* This test fails on NetBSD 10.0/i386. */ + { + long double x = LDBL_MAX_EXP - 1; + long double z = my_exp2l (x); + if (z + z == z) /* isinf (z) */ + result |= 2; + } return result; } ]])], -- 2.39.5