bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: GAWK adding big numbers wrong


From: Miles Bader
Subject: Re: GAWK adding big numbers wrong
Date: 13 May 2002 21:21:09 +0900

Aharon Robbins <address@hidden> writes:
> The surgery required is significant.  In particular memory management
> is a major issue, and I am concerned that a switch to infinite precision
> for the _default_ behavior would be a big performance loss.

Sorry to poke my uninformed nose in, but ...

It already has to pay the price for type-dispatching on arith args
because they can possibly be strings, so why are bignums any harder?
The only wrinkle would be testing for overflow and making the result a
bignum in that case (I'm assuming you're gonna keep the existing number
representation, and only use bignums for overflow).

In fact, since gawk already has all the infrastructure to deal with
strings, why not represent bignums as strings-with-a-bit-set-in-the-header?
[I don't mean represent them as ASCII, just as strings containing the
binary representation.]

I'll go away now...

-Miles
-- 
I have seen the enemy, and he is us.  -- Pogo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]