guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics


From: Andy Wingo
Subject: Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics
Date: Sun, 30 Jan 2011 23:24:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Sun 30 Jan 2011 17:27, Mark H Weaver <address@hidden> writes:

> Here are another four patches of numerics improvements.

Applied all up to the last.  Sweet!  And thank you!

> The other three I named `centered/', `centered-quotient', and
> `centered-remainder', because the range of their remainder operation is
> centered on 0 in a twos-complement sort of way.  They are almost the
> same as Taylor's `round/' et al, but in my opinion they have superior
> properties, as I explained in a recent commentary on this list.

I agree they do have some good properties, and am happy to see them in
the core, and with non-privileged names (allowing for round_quotient et
al to be added, possibly, in the future).

If you have time though, I wonder would scm_centered_divide be a better
name than scm_centered_quo_and_rem?  "Divide" is the pronunciation of
the "/" procedure, I think.

> The last two patches improve the extensibility of numeric operations,
> and as a side effect add documentation strings to many of them.

Much appreciated.

> The last patch might be slightly controversial.  Although it does not
> make `integer-expt' a generic function, nonetheless it can now
> exponentiate _any_ scheme object that can be multiplied using `*'.

To me this is fine, in principle; but I wonder about causing `(expt #t
0)' to produce 1.  It seems that in any case the range of the output
should be continuous -- i.e. if (expt <my-matrix> 1) produces a matrix,
and (expt <my-matrix> n) for n > 1 makes a matrix, then (expt
<my-matrix> 0) should also produce a matrix.  Or no?

Cheers,

Andy
-- 
http://wingolog.org/



reply via email to

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