[Top][All Lists]

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

Re: ratio implementation

From: Kevin Ryde
Subject: Re: ratio implementation
Date: Tue, 29 Jul 2003 10:41:20 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

Bill Schottstaedt <address@hidden> writes:
> I use longs for the numerator and denominator, so if bignums are
> encountered, I fallback on the old method using scm_divide.

It'd be nice to allow bignum numerators and denominators.  It's rather
easy to make a calculation where the denominator starts to blow up.

The gmp mpq functions might help, but there's no particular need to
use them, most of the same things could be done directly just with a
pair of scheme integers.

> I notice that r5rs seems to
> imply that (inexact->exact .3) should return 3/10 (see the rationalize
> example which is assuming this)

Isn't that the effect of the rationalize function, rather than

reply via email to

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