guile-devel
[Top][All Lists]
Advanced

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

Re: ratio implementation


From: Marius Vollmer
Subject: Re: ratio implementation
Date: Tue, 14 Oct 2003 14:39:51 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Bill Schottstaedt <address@hidden> writes:

> I notice that Guile doesn't support "exact complex", but
> it appears that some other Schemes do -- is this a desired
> extension?
>
> guile> (exact? 2/3+i)
> #f

Yes, it would be welcome.

> Under scm_ash, the doc string:
>
>           "Formally, the function returns an integer equivalent to\n"
>           "@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.\n"
>
> is incorrect:
> [...]
> The scm_quotient function assumes its arguments are ints/bignums,
> so it can't be used directly in ash.

Right!  Do you have a patch? :-) I will record this in our bug
database nevertheless.

> Also: (sqrt 9/49) -> 3/7?  Seems like it should parallel:
> guile> (expt 2 -2)
> 1/4

Hmm.  We would then also need

  (sqrt 4) => 2 (exact)

I'm not sure whether exact square roots are imortant: they will only
be useful when both the numerator and denominator are squares of
integers and those pairs will be rare, I'd say.  We could use GMP for
computing bignum square roots...




reply via email to

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