Subject: Re: bin/19381: netstat shows negative percentage
To: Martin Husemann <email@example.com>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 12/14/2002 14:24:39
[ On Saturday, December 14, 2002 at 12:17:13 (+0100), Martin Husemann wrote: ]
> Subject: Re: bin/19381: netstat shows negative percentage
> On Sat, Dec 14, 2002 at 10:59:44AM +0000, David Laight wrote:
> > + totpct = (totmem < 100) ? 0 : totused/(totmem/100));
> > to avoid nasty FP arithmetic.
> I keep forgetting what the consensus was on the final C 99 standard: does
> this force evaluation order? ISTR only assigning to temporaries did the
> trick, while this allows the optimizer to rearange things.
If ?: doesn't evaluate the test expression first then the language is not C
Besides, in the above there are no worries anyway!
Greg A. Woods
+1 416 218-0098; <email@example.com>; <firstname.lastname@example.org>
Planix, Inc. <email@example.com>; VE3TCP; Secrets of the Weird <firstname.lastname@example.org>