unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: No Itisnt <theseaisinhere@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Exposing more math functionality
Date: Thu, 19 Aug 2010 09:04:22 -0700	[thread overview]
Message-ID: <m3d3tetwqh.fsf@unquote.localdomain> (raw)
In-Reply-To: <AANLkTikTaX7fmiYnbC4ncwQLPeTmdqz_gDxqRx9b=rzG@mail.gmail.com> (No Itisnt's message of "Fri, 23 Jul 2010 22:46:03 -0500")

Heya,

On Fri 23 Jul 2010 20:46, No Itisnt <theseaisinhere@gmail.com> writes:

> I'd like to patch Guile's math functionality to expose M_PI, modf, and
> probably other things as well. Before I started I thought I'd ask --
> would such a patch be accepted? And is there any policy on where they
> should go? It seems a little crass to clutter up the (guile) namespace
> any more, but I don't see anywhere else those could go.

Hum, I think the right thing is to talk about these one by one.

For pi, I think I'd like to avoid adding it to the namespace, partly
because I can't think of a good name. M_PI is ugly :) You can always
define it as (define pi (* 4 (atan 1))) or something.

Actually my schooling was in engineering, so I'd say (define pi 3). ;-)

Regarding modf -- it seems that the R6RS extends the definition of
`modulo' (called `mod') to be defined over the real numbers.

  (mod 10 3) => 1
  (mod 10 3.0) => 1.0
  (mod 10 3.1) => 0.7

This appears to be a compatible extension of the R5RS' `modulo', so we
should just extend our definition. That way we can avoid adding another
symbol.

Let me know if you're interested in doing this, otherwise I'll get
around to it eventually. But perhaps someone who is less fast-and-loose
with accuracy should do it ;-)

Cheers,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2010-08-19 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24  3:46 Exposing more math functionality No Itisnt
2010-08-19 16:04 ` Andy Wingo [this message]
2010-08-19 20:37   ` Phil
2010-08-27 15:44   ` Andy Wingo
2010-08-28  4:02     ` Andy Wingo

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=m3d3tetwqh.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=theseaisinhere@gmail.com \
    /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).