NetBSD has intentionally buggy implementations for <math.h> 'long double' functions: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libm/src/ldbl_dummy.c?only_with_tag=MAIN
This patch documents it in Gnulib. 2024-01-18 Bruno Haible <br...@clisp.org> doc: Update regarding <math.h> *l functions on NetBSD 9.3. * doc/posix-functions/acoshl.texi: Mention the buggy implementation on NetBSD. * doc/posix-functions/acosl.texi: Likewise. * doc/posix-functions/asinhl.texi: Likewise. * doc/posix-functions/asinl.texi: Likewise. * doc/posix-functions/atan2l.texi: Likewise. * doc/posix-functions/atanhl.texi: Likewise. * doc/posix-functions/atanl.texi: Likewise. * doc/posix-functions/coshl.texi: Likewise. * doc/posix-functions/cosl.texi: Likewise. * doc/posix-functions/erfcl.texi: Likewise. * doc/posix-functions/erfl.texi: Likewise. * doc/posix-functions/powl.texi: Likewise. * doc/posix-functions/sinhl.texi: Likewise. * doc/posix-functions/sinl.texi: Likewise. * doc/posix-functions/tanhl.texi: Likewise. * doc/posix-functions/tanl.texi: Likewise. * doc/posix-functions/expl.texi: Update NetBSD version info. * doc/posix-functions/exp2l.texi: Likewise. * doc/posix-functions/hypotl.texi: Likewise. * doc/posix-functions/logl.texi: Likewise. * doc/posix-functions/log10l.texi: Likewise. * m4/expl.m4 (gl_FUNC_EXPL): Update comments. * m4/exp2l.m4 (gl_FUNC_EXP2L): Likewise. * m4/hypotl.m4 (gl_FUNC_HYPOTL_WORKS): Likewise. * m4/logl.m4 (gl_FUNC_LOGL_WORKS): Likewise. * m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Likewise. diff --git a/doc/posix-functions/acoshl.texi b/doc/posix-functions/acoshl.texi index fea836748a..e28845218c 100644 --- a/doc/posix-functions/acoshl.texi +++ b/doc/posix-functions/acoshl.texi @@ -15,4 +15,8 @@ @item This function is missing on some platforms: FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 9, Android 4.4. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/acosl.texi b/doc/posix-functions/acosl.texi index 8d6edd6649..2743bc8654 100644 --- a/doc/posix-functions/acosl.texi +++ b/doc/posix-functions/acosl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/asinhl.texi b/doc/posix-functions/asinhl.texi index 2064224a45..06dbcd6f60 100644 --- a/doc/posix-functions/asinhl.texi +++ b/doc/posix-functions/asinhl.texi @@ -15,4 +15,8 @@ @item This function is missing on some platforms: FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 9, Android 4.4. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/asinl.texi b/doc/posix-functions/asinl.texi index a105faa603..4caf46db51 100644 --- a/doc/posix-functions/asinl.texi +++ b/doc/posix-functions/asinl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/atan2l.texi b/doc/posix-functions/atan2l.texi index b9f93b5c63..170e5088cc 100644 --- a/doc/posix-functions/atan2l.texi +++ b/doc/posix-functions/atan2l.texi @@ -18,4 +18,8 @@ @item This function is only defined as a macro with arguments on some platforms: MSVC 14. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/atanhl.texi b/doc/posix-functions/atanhl.texi index f0c51d221a..5d66dc7f1a 100644 --- a/doc/posix-functions/atanhl.texi +++ b/doc/posix-functions/atanhl.texi @@ -15,4 +15,8 @@ @item This function is missing on some platforms: FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 9, Android 4.4. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/atanl.texi b/doc/posix-functions/atanl.texi index 3cf3b8864a..4cf373462a 100644 --- a/doc/posix-functions/atanl.texi +++ b/doc/posix-functions/atanl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/coshl.texi b/doc/posix-functions/coshl.texi index 11eedd2514..9b9ba55466 100644 --- a/doc/posix-functions/coshl.texi +++ b/doc/posix-functions/coshl.texi @@ -18,4 +18,8 @@ @item This function is only defined as a macro with arguments on some platforms: MSVC 14. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/cosl.texi b/doc/posix-functions/cosl.texi index fe1382a98c..4263fc13b5 100644 --- a/doc/posix-functions/cosl.texi +++ b/doc/posix-functions/cosl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/erfcl.texi b/doc/posix-functions/erfcl.texi index df7541ca03..f8f3f603bb 100644 --- a/doc/posix-functions/erfcl.texi +++ b/doc/posix-functions/erfcl.texi @@ -15,4 +15,8 @@ @item This function is missing on some platforms: FreeBSD 6.0, NetBSD 7.1, OpenBSD 3.8, Minix 3.1.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 9, Android 4.4. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/erfl.texi b/doc/posix-functions/erfl.texi index a41910c183..6362a7a2ee 100644 --- a/doc/posix-functions/erfl.texi +++ b/doc/posix-functions/erfl.texi @@ -15,4 +15,8 @@ @item This function is missing on some platforms: FreeBSD 6.0, NetBSD 7.1, OpenBSD 3.8, Minix 3.1.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 9, Android 4.4. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/exp2l.texi b/doc/posix-functions/exp2l.texi index 37729a6301..66257d0870 100644 --- a/doc/posix-functions/exp2l.texi +++ b/doc/posix-functions/exp2l.texi @@ -17,7 +17,7 @@ @item This function produces results which are accurate to only 16 digits on some platforms: -NetBSD 9.0. +NetBSD 9.3. @end itemize Portability problems fixed by Gnulib module @code{exp2l-ieee}: diff --git a/doc/posix-functions/expl.texi b/doc/posix-functions/expl.texi index f70589f29e..5dfb045960 100644 --- a/doc/posix-functions/expl.texi +++ b/doc/posix-functions/expl.texi @@ -23,7 +23,7 @@ @item This function produces results which are accurate to only 16 digits on some platforms: -musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.0. +musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.3. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/hypotl.texi b/doc/posix-functions/hypotl.texi index 4b91a48828..9a74d2668e 100644 --- a/doc/posix-functions/hypotl.texi +++ b/doc/posix-functions/hypotl.texi @@ -13,7 +13,7 @@ FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, MSVC 14, Android 4.4. @item This function produces very imprecise results on some platforms: -NetBSD 9.0, OpenBSD 5.1/SPARC. +NetBSD 9.3, OpenBSD 5.1/SPARC. @end itemize Portability problems fixed by Gnulib module @code{hypotl-ieee}: diff --git a/doc/posix-functions/log10l.texi b/doc/posix-functions/log10l.texi index ffddbcb442..d3b71e3014 100644 --- a/doc/posix-functions/log10l.texi +++ b/doc/posix-functions/log10l.texi @@ -26,7 +26,7 @@ @item This function produces results which are accurate to only 16 digits on some platforms: -musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.0. +musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.3. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/logl.texi b/doc/posix-functions/logl.texi index e0d04b5ec0..679bcae137 100644 --- a/doc/posix-functions/logl.texi +++ b/doc/posix-functions/logl.texi @@ -20,7 +20,7 @@ @item This function produces results which are accurate to only 16 digits on some platforms: -musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.0. +musl libc 1.2.2/arm64, musl libc 1.2.2/s390x, NetBSD 9.3. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/powl.texi b/doc/posix-functions/powl.texi index c7c2482d86..05a18cfd7e 100644 --- a/doc/posix-functions/powl.texi +++ b/doc/posix-functions/powl.texi @@ -18,4 +18,8 @@ @item This function is only defined as a macro with arguments on some platforms: MSVC 14. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/sinhl.texi b/doc/posix-functions/sinhl.texi index 614f549ee3..b4e8d2d4af 100644 --- a/doc/posix-functions/sinhl.texi +++ b/doc/posix-functions/sinhl.texi @@ -18,4 +18,8 @@ @item This function is only defined as a macro with arguments on some platforms: MSVC 14. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/sinl.texi b/doc/posix-functions/sinl.texi index d19cca7115..bd8b9bd450 100644 --- a/doc/posix-functions/sinl.texi +++ b/doc/posix-functions/sinl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/tanhl.texi b/doc/posix-functions/tanhl.texi index 01937473a6..a8a5c6a967 100644 --- a/doc/posix-functions/tanhl.texi +++ b/doc/posix-functions/tanhl.texi @@ -18,4 +18,8 @@ @item This function is only defined as a macro with arguments on some platforms: MSVC 14. +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/doc/posix-functions/tanl.texi b/doc/posix-functions/tanl.texi index be32de02a1..3da2a71d65 100644 --- a/doc/posix-functions/tanl.texi +++ b/doc/posix-functions/tanl.texi @@ -18,4 +18,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function produces results which are accurate to only 16 digits on some +platforms: +NetBSD 9.3. @end itemize diff --git a/m4/exp2l.m4 b/m4/exp2l.m4 index e3f476c1f7..582576e09f 100644 --- a/m4/exp2l.m4 +++ b/m4/exp2l.m4 @@ -1,4 +1,4 @@ -# exp2l.m4 serial 13 +# exp2l.m4 serial 14 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 @@ AC_DEFUN([gl_FUNC_EXP2L] { 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 9.3. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) diff --git a/m4/expl.m4 b/m4/expl.m4 index 32497fcf17..5cc77778ad 100644 --- a/m4/expl.m4 +++ b/m4/expl.m4 @@ -1,4 +1,4 @@ -# expl.m4 serial 21 +# expl.m4 serial 22 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, @@ -129,7 +129,7 @@ AC_DEFUN([gl_FUNC_EXPL] if (isnan (expl (x1)) || isnan (expl (x2)) || isnan (expl (x3))) result |= 2; } - /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.0. */ + /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.3. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) diff --git a/m4/hypotl.m4 b/m4/hypotl.m4 index f722ad9316..dbfec7ea08 100644 --- a/m4/hypotl.m4 +++ b/m4/hypotl.m4 @@ -1,4 +1,4 @@ -# hypotl.m4 serial 14 +# hypotl.m4 serial 15 dnl Copyright (C) 2012-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, @@ -135,6 +135,7 @@ AC_DEFUN([gl_FUNC_HYPOTL] dnl On OpenBSD 5.1/SPARC, dnl hypotl (2.5541394760659556563446062497337725156L, 7.7893454113437840832487794525518765265L) dnl has rounding errors that eat up the last 8 to 9 decimal digits. +dnl On NetBSD 9.3, the result is accurate to only 16 digits. AC_DEFUN([gl_FUNC_HYPOTL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) diff --git a/m4/log10l.m4 b/m4/log10l.m4 index 19d6145961..aefa2df029 100644 --- a/m4/log10l.m4 +++ b/m4/log10l.m4 @@ -1,4 +1,4 @@ -# log10l.m4 serial 13 +# log10l.m4 serial 14 dnl Copyright (C) 2011-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, @@ -60,7 +60,7 @@ AC_DEFUN([gl_FUNC_LOG10L] dnl 0xFFF00000000000000000000000000000. dnl On AIX 5.1, log10l(-0.0L) is finite if it's not the first log10l call dnl in the program. -dnl On NetBSD 9.0, the result is accurate to only 16 digits. +dnl On NetBSD 9.3, the result is accurate to only 16 digits. AC_DEFUN([gl_FUNC_LOG10L_WORKS], [ AC_REQUIRE([AC_PROG_CC]) @@ -126,7 +126,7 @@ AC_DEFUN([gl_FUNC_LOG10L_WORKS] if (!(gy + gy == gy)) result |= 1; } - /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.0. */ + /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.3. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) diff --git a/m4/logl.m4 b/m4/logl.m4 index 5e1bb3f1a9..c75f4c50ee 100644 --- a/m4/logl.m4 +++ b/m4/logl.m4 @@ -103,7 +103,7 @@ AC_DEFUN([gl_FUNC_LOGL] dnl Test whether logl() works. dnl On OSF/1 5.1, logl(-0.0L) is NaN. -dnl On NetBSD 9.0, the result is accurate to only 16 digits. +dnl On NetBSD 9.3, the result is accurate to only 16 digits. AC_DEFUN([gl_FUNC_LOGL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) @@ -166,7 +166,7 @@ AC_DEFUN([gl_FUNC_LOGL_WORKS] if (!(gy + gy == gy)) result |= 1; } - /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.0. */ + /* This test fails on musl 1.2.2/arm64, musl 1.2.2/s390x, NetBSD 9.3. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5))