On Tue, 1 May 2001, Adrian Chadd wrote:
> On Mon, Apr 30, 2001, Andres Kroonmaa wrote:
> >
> > Can anyone shed some light on why do we use some strange
> > type gb_t that consists of 4byte counters with special
> > handling of overflow for "bytes" counter, instead of just
> > simply using double type for counters?
> >
> > Seems to be used only in memMeters, and is somewhat on
> > the way...
> >
> > I'd like to convert memMeter to use doubles where large
> > values are expected. Is there any reason not to do that?
>
> Use a quad_t. That avoids an FPU operation.
IIRC, the original reason for gb_t was the precision. Double counters
might miss a few bytes as they become large. Whether the precision is
important for current applications of gb_t is a separate question.
If you end up using doubles or quad_t (how portable is that?) instead,
please make sure that we never convert your counter or its derivative
to an "int" using a C cast because such a conversion may cause an
arithmetic exception.
Thanks,
Alex.
Received on Mon Apr 30 2001 - 10:20:19 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:51 MST