1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2015 Free Software Foundation, Inc.
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.
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.
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/>. */
20 #include "math/chart-geometry.h"
21 #include "libpspp/compiler.h"
32 { 100000.0, 10.0, 10},
33 { 1000000.0, 10.0, 10},
34 { 10000000.0, 10.0, 10},
35 { 100000000.0, 10.0, 10},
39 { 0.0001, 0.00001, 10},
40 { 0.00001, 0.0000001, 10},
41 { 0.0000001, 0.00000001, 10},
47 { 0.975E9
, 0.005E9
, 9},
48 { 0.970E9
, 0.01E9
, 9},
51 { 1.001E-95, 0.0002E-95, 10},
52 { 1.001E98
, 0.0002E98
, 10},
61 main (int argc UNUSED
, char **argv UNUSED
)
66 double lower
, interval
;
69 for(i
=0;tv
[i
].nticks
> 0;i
++)
72 interval
= tv
[i
].interval
;
73 nticks
= tv
[i
].nticks
;
74 fs
= chart_get_ticks_format (lower
, interval
, nticks
, &scale
);
75 printf("lower: %lg, interval: %lg, nticks: %d, fs: %s, scale: %lg, ex: ",
76 lower
, interval
, nticks
, fs
, scale
);
77 printf(fs
,(lower
+ 3 * interval
)*scale
);
79 printf(fs
,(lower
+ 4 * interval
)*scale
);