Added the /BARCHART option to CROSSTABS
[pspp] / tests / math / chart-geometry-test.c
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2015 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #include <config.h>
18 #include <stdlib.h>
19 #include "math/chart-geometry.h"
20 #include "math/decimal.h"
21 #include "libpspp/compiler.h"
22
23 const double in[20] =
24   {
25     0.00648687,
26     728815,
27     8.14431e-07,
28     77611.4,
29     3.33497,
30     180.426,
31     0.676168,
32     2.00744e+08,
33     14099.3,
34     19.5186,
35     1.17473e-07,
36     166337,
37     0.00163644,
38     1.94724e-09,
39     2.31564e-06,
40     3.10674e+06,
41     5.10314e-05,
42     1.95101,
43     1.40884e+09,
44     78217.6
45   };
46
47 int 
48 main (int argc UNUSED, char **argv UNUSED)
49 {
50   int i;
51   for (i = 0; i < 20; ++i)
52     {
53       struct decimal dout;
54       chart_rounded_tick (in[i], &dout);
55       
56       printf ("%g %s\n", in[i], decimal_to_string (&dout));
57     }
58
59   return 0;
60 }
61