On Sat, 20 Oct 2001, Dan Sugalski wrote:

> On Sat, 20 Oct 2001, Steven N. Hirsch wrote:
>
> > On Sat, 20 Oct 2001, Derrik Pates wrote:
> >
> > > Subject says it all. Can it be done? I need some way to push a packet
> > > count value into a Perl scalar, but there doesn't seem to be any way to
> > > push a long long (which is typedef'd as a Quad/UQuad) into a scalar at
> > > all. I know this has been discussed before, but I never really saw any
> > > real solution to the problem. Should I just sprintf/asprintf it and push
> > > it in as a string? Since it will get converted on the fly into an
> > > integer...
> >
> > I would store it as an 'NV' (double).  Since it starts off as an integer
> > value there won't be any loss of precision for the round-trip.
>
> That, alas, just isn't true. If your NV is 64 bits, as most are if you
> have 32 bit ints, then you've only got about 53 bits of integer, give or
> take a bit. (Literally :) They just aren't big enough.

Ugh.  Yes, of course you are correct.  Not sure what I was smoking when I
posted that suggestion.  32-bit unsigned, yes.  64-bit unsigned, no.

I suppose that stringifying it is as sound an approach as any.

Steve

(Think twice, post once.. Think twice, post once..)


Reply via email to