Duh, calculate the compression ration correctly. (fixed point artithmatic

with 8 "fractional" bits needs to be divided (not multiplied) by 256.0
to get a floating point representation)
This commit is contained in:
peter 1997-09-10 08:43:17 +00:00
parent bd79753a5b
commit e032db2bc7

View File

@ -32,7 +32,7 @@
*/
#ifndef lint
static char rcsid[] = "$Id: pppstats.c,v 1.9 1997/02/22 16:12:12 peter Exp $";
static char rcsid[] = "$Id: pppstats.c,v 1.10 1997/08/22 15:39:04 peter Exp $";
#endif
#include <stdio.h>
@ -310,26 +310,26 @@ intpr()
W(d.comp_packets),
KBPS(W(d.inc_bytes)),
W(d.inc_packets),
ccs.d.ratio * 256.0);
ccs.d.ratio / 256.0);
printf(" | %8.3f %6u %8.3f %6u %6.2f",
KBPS(W(c.comp_bytes)),
W(c.comp_packets),
KBPS(W(c.inc_bytes)),
W(c.inc_packets),
ccs.c.ratio * 256.0);
ccs.c.ratio / 256.0);
} else {
printf("%8u %6u %8u %6u %6.2f",
W(d.comp_bytes),
W(d.comp_packets),
W(d.inc_bytes),
W(d.inc_packets),
ccs.d.ratio * 256.0);
ccs.d.ratio / 256.0);
printf(" | %8u %6u %8u %6u %6.2f",
W(c.comp_bytes),
W(c.comp_packets),
W(c.inc_bytes),
W(c.inc_packets),
ccs.c.ratio * 256.0);
ccs.c.ratio / 256.0);
}
} else {