]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
printf,seq: improve long double accuracy
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Jan 2019 07:11:22 +0000 (23:11 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Jan 2019 07:19:47 +0000 (23:19 -0800)
This fixes a thinko in the previous patch.
* gl/lib/cl-strtod.c (STRTOD): New macro.
(CL_STRTOD): Use it.

gl/lib/cl-strtod.c

index fa77235ba8c0568c55730be7f5acd387aca72df7..dd6eef82560597606853b27bd7703d07a2db88b3 100644 (file)
 #if LONG
 # define CL_STRTOD cl_strtold
 # define DOUBLE long double
+# define STRTOD strtold
 # define C_STRTOD c_strtold
 #else
 # define CL_STRTOD cl_strtod
 # define DOUBLE double
+# define STRTOD strtod
 # define C_STRTOD c_strtod
 #endif
 
@@ -57,7 +59,7 @@ DOUBLE
 CL_STRTOD (char const *nptr, char **restrict endptr)
 {
   char *end;
-  DOUBLE d = strtod (nptr, &end);
+  DOUBLE d = STRTOD (nptr, &end);
   if (*end)
     {
       int strtod_errno = errno;