bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strtod, strtold: various fixes


From: Bruno Haible
Subject: strtod, strtold: various fixes
Date: Fri, 01 Feb 2019 03:16:42 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

I've pushed these fixes and improvements for the strtod, strtold modules.


2019-01-31  Bruno Haible  <address@hidden>

        strtod, strtold: Work around HP-UX 11.31/ia64 bug.
        * lib/strtod.c (STRTOD): When there is an extra character after the
        exponent marker 'p', reparse the number.
        * doc/posix-functions/strtod.texi: Document the HP-UX 11.31 bug.
        * doc/posix-functions/strtold.texi: Likewise.

2019-01-31  Bruno Haible  <address@hidden>

        strtod, strtold: Avoid unnecessary rounding errors.
        * lib/strtod.c (parse_number): Drop trailing zeroes before doing the
        decimal to DOUBLE conversion.

2019-01-31  Bruno Haible  <address@hidden>

        strtod, strtold tests: Simplify tests.
        * tests/test-strtod.c (main): Assume no rounding errors for 0.5.
        * tests/test-strtold.c (main): Likewise.

2019-01-31  Bruno Haible  <address@hidden>

        strtod, strtold: Use the locale's decimal point.
        * lib/strtod.c: Include <locale.h>, <stdio.h>, <langinfo.h>.
        (decimal_point_char): New function, copied from lib/vasnprintf.c.
        (parse_number): Add a radixchar argument. Use it instead of '.'.
        (STRTOD): Invoke decimal_point_char and pass the result to parse_number.
        * m4/strtod.m4 (gl_PREREQ_STRTOD): Test whether nl_langinfo exists.
        * m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise.
        * tests/test-strtod1.c: New file.
        * tests/test-strtod1.sh: New file.
        * modules/strtod-tests (Files): Add test-strtod1.{sh,c}. Add
        locale-fr.m4 and its dependencies.
        (configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
        (Makefile.am): Arrange to compile test-strtod1.c and run
        test-strtod1.sh.
        * tests/test-strtold1.c: New file.
        * tests/test-strtold1.sh: New file.
        * modules/strtold-tests (Files): Add test-strtold1.{sh,c}. Add
        locale-fr.m4 and its dependencies.
        (configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
        (Makefile.am): Arrange to compile test-strtold1.c and run
        test-strtold1.sh.

Attachment: 0001-strtod-strtold-Work-around-HP-UX-11.31-ia64-bug.patch
Description: Text Data

Attachment: 0002-strtod-strtold-Avoid-unnecessary-rounding-errors.patch
Description: Text Data

Attachment: 0003-strtod-strtold-tests-Simplify-tests.patch
Description: Text Data

Attachment: 0004-strtod-strtold-Use-the-locale-s-decimal-point.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]