Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ps Do not check pcpu value against 100.0 but rather 99.9...



details:   https://anonhg.NetBSD.org/src/rev/c5ee190ef19f
branches:  trunk
changeset: 756685:c5ee190ef19f
user:      njoly <njoly%NetBSD.org@localhost>
date:      Wed Jul 28 17:39:54 2010 +0000

description:
Do not check pcpu value against 100.0 but rather 99.95, to properly
deal with value rounding. From apb@.

diffstat:

 bin/ps/print.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 10839047a40f -r c5ee190ef19f bin/ps/print.c
--- a/bin/ps/print.c    Wed Jul 28 17:05:51 2010 +0000
+++ b/bin/ps/print.c    Wed Jul 28 17:39:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.114 2010/07/27 12:40:48 njoly Exp $        */
+/*     $NetBSD: print.c,v 1.115 2010/07/28 17:39:54 njoly Exp $        */
 
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)print.c    8.6 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.114 2010/07/27 12:40:48 njoly Exp $");
+__RCSID("$NetBSD: print.c,v 1.115 2010/07/28 17:39:54 njoly Exp $");
 #endif
 #endif /* not lint */
 
@@ -1092,7 +1092,7 @@
        k = arg;
        v = ve->var;
        dbl = getpcpu(k);
-       doubleprintorsetwidth(v, dbl, (dbl >= 100.0) ? 0 : 1, mode);
+       doubleprintorsetwidth(v, dbl, (dbl >= 99.95) ? 0 : 1, mode);
 }
 
 double



Home | Main Index | Thread Index | Old Index