Change many %g format specifiers to %.*g with precision DBL_DIG + 1.
[pspp] / src / language / stats / binomial.c
index 94d0d9721e0b7f4c543d44a975ec8b8b9b7cbed0..8439a71b93919749c551f0abf75209a8d5f28452 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 
 #include "language/stats/binomial.h"
 
+#include <float.h>
 #include <gsl/gsl_cdf.h>
 #include <gsl/gsl_randist.h>
 
@@ -202,7 +203,8 @@ binomial_execute (const struct dataset *ds,
 
          if ( bst->cutpoint != SYSMIS)
            {
-             ds_put_format (&catstr[0], "<= %g", bst->cutpoint);
+             ds_put_format (&catstr[0], "<= %.*g",
+                             DBL_DIG + 1, bst->cutpoint);
            }
           else
             {