unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics
Date: Sun, 30 Jan 2011 23:24:29 +0100	[thread overview]
Message-ID: <m38vy2yqqq.fsf@unquote.localdomain> (raw)
In-Reply-To: <87lj221hn7.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Sun, 30 Jan 2011 11:27:24 -0500")

On Sun 30 Jan 2011 17:27, Mark H Weaver <mhw@netris.org> 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	other threads:[~2011-01-30 22:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30 16:27 [PATCH] Fast R6RS div/mod; improved extensibility of numerics Mark H Weaver
2011-01-30 22:24 ` Andy Wingo [this message]
2011-01-30 22:55   ` Ludovic Courtès
2011-01-31  6:19     ` [PATCH] Rework the testing framework for number-theoretic division operators Mark H Weaver
2011-01-31  8:52       ` Andy Wingo
2011-01-31 17:14   ` [PATCH] Fast R6RS div/mod; improved extensibility of numerics Mark H Weaver
2011-01-31 17:35   ` Mark H Weaver
2011-01-31 19:26     ` Andy Wingo
2011-01-31 20:16     ` Andy Wingo
2011-01-31 20:30       ` Mark H Weaver
2011-01-31 20:46         ` Andy Wingo
2011-01-31 20:46       ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38vy2yqqq.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).