Deleted Added
sdiff udiff text old ( 161692 ) new ( 176106 )
full compact
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 */
10
11#include <sys/cdefs.h>
12__FBSDID("$FreeBSD: head/usr.bin/ministat/ministat.c 161692 2006-08-28 08:27:02Z phk $");
13
14#include <stdio.h>
15#include <math.h>
16#include <err.h>
17#include <string.h>
18#include <stdlib.h>
19#include <unistd.h>
20#include <sys/ioctl.h>

--- 223 unchanged lines hidden (view full) ---

244{
245
246 printf(" N Min Max Median Avg Stddev\n");
247}
248
249static void
250Vitals(struct dataset *ds, int flag)
251{
252 double a;
253
254 printf("%c %3d %13.8g %13.8g %13.8g %13.8g %13.8g", symbol[flag],
255 ds->n, Min(ds), Max(ds), Median(ds), Avg(ds), Stddev(ds));
256 printf("\n");
257}
258
259static void
260Relative(struct dataset *ds, struct dataset *rs, int confidx)
261{
262 double spool, s, d, e, t;
263 int i, c;
264
265 i = ds->n + rs->n - 2;
266 if (i > NSTUDENT)
267 t = student[0][confidx];
268 else
269 t = student[i][confidx];
270 spool = (ds->n - 1) * Var(ds) + (rs->n - 1) * Var(rs);
271 spool /= ds->n + rs->n - 2;

--- 189 unchanged lines hidden (view full) ---

461 for (i = 0; i < pl->width; i++)
462 putchar('-');
463 putchar('+');
464 putchar('\n');
465}
466
467
468static struct dataset *
469ReadSet(char *n, int column, char *delim)
470{
471 FILE *f;
472 char buf[BUFSIZ], *p, *t;
473 struct dataset *s;
474 double d;
475 int line;
476 int i;
477

--- 65 unchanged lines hidden (view full) ---

543}
544
545int
546main(int argc, char **argv)
547{
548 struct dataset *ds[7];
549 int nds;
550 double a;
551 char *delim = " \t";
552 char *p;
553 int c, i, ci;
554 int column = 1;
555 int flag_s = 0;
556 int flag_n = 0;
557 int termwidth = 74;
558
559 if (isatty(STDOUT_FILENO)) {

--- 87 unchanged lines hidden ---