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},
42 { 0.0000100001, 0.00001, 10},
43 { 100000010.0, 100000000.0, 10},
44 { 100000.0, -500000.0, 10},
50 { 1.001E-95, 1.0E-95, 10},
51 { 1.001E98, 1.0E98, 10},
52 { 1.001E33, 1.0E-22, 10},
57 main (int argc UNUSED, char **argv UNUSED)
65 for(i=0;tv[i].nticks > 0;i++)
69 nticks = tv[i].nticks;
70 fs = chart_get_ticks_format (max, min, nticks, &scale);
71 printf("max: %lg, min: %lg, nticks: %d, fs: %s, scale: %lg, example: ",
72 max, min, nticks, fs, scale);
73 printf(fs,((max-min)/2.0+min)*scale);