On Mon, Oct 02, 2000 at 12:47:18PM +0100, David Mitchell wrote:
> Jarkko Hietaniemi <[EMAIL PROTECTED]> wrote:
>
> > [some quick very high-level comments]
> >
> > Don't forget bigrats.
>
> I'm not too familiar with the concept of rational numbers in a computing
> complex. What's your definition of a (big)rat? Fixed point??
bigint1 / bigint2. Possibly represented as a triad of bigints,
bigint1 + bigint2 / bigint3.
Remember also abnormalities like NaN.
> IE should bigint_subtract(bigint1,bigint2)
>
> 1) always return a new bigint SV
> 2) a bigint normally, but an int if it happens to know that its result
> will fit in a standard int, or
> 3) a bigint or an int depending on some as yet undefined external context?
>
> My own feeling is that it should just stick with (1) - if someone has some
> code that uses bigints, the chances are that the results of bigint expressions
> are most likely to fed into further bigint expressions, so demoting
> to int then promoting again would probably less efficient; also if
> you're working with bigints in the first place, then I'd expect cases
> where the result of an op fits in an IV would be the minority.
> But never having worked with bigints myself, I could be speaking from
> my derierre ;-)
Likewise. But having such a reduction/collapsion code is very natural
because we need to have the 'inverse' of that logic to know when to stop
using ints and start using bigints; 2**1000.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen