summaryrefslogtreecommitdiff
path: root/src/numfmt.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-07-01 00:10:23 +0100
committerPádraig Brady <P@draigBrady.com>2015-07-01 12:29:59 +0100
commit81c7fc4081df7cb59b55c5fde486687afd0c87d7 (patch)
treee6b010d117714b355e60e9eb1425c2558aef6568 /src/numfmt.c
parent491f54fb5a9d52b5f42f4a946094f7919da2966f (diff)
downloadcoreutils-81c7fc4081df7cb59b55c5fde486687afd0c87d7.tar.xz
numfmt: increase precision on 32 bit FreeBSD
* m4/jm-macros.m4 (HAVE_FPSETPREC): Define if needed. * src/numfmt.c (main): Call fpsetprec() if needed. Fixes large-15 and large-16 test failures on 32 bit FreeBSD.
Diffstat (limited to 'src/numfmt.c')
-rw-r--r--src/numfmt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/numfmt.c b/src/numfmt.c
index e58972bce..35c5c5b97 100644
--- a/src/numfmt.c
+++ b/src/numfmt.c
@@ -32,6 +32,10 @@
#include "gl_linked_list.h"
#include "gl_xlist.h"
+#if HAVE_FPSETPREC
+# include <ieeefp.h>
+#endif
+
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "numfmt"
@@ -1574,6 +1578,11 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#if HAVE_FPSETPREC
+ /* Enabled extended precision if needed. */
+ fpsetprec (FP_PE);
+#endif
+
decimal_point = nl_langinfo (RADIXCHAR);
if (decimal_point == NULL || strlen (decimal_point) == 0)
decimal_point = ".";