unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: guile-devel@gnu.org
Subject: Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
Date: 15 May 2002 21:19:47 +0200	[thread overview]
Message-ID: <87lmalp6b0.fsf@zagadka.ping.de> (raw)
In-Reply-To: <87661qrolk.fsf@raven.i.defaultvalue.org>

Rob Browning <rlb@defaultvalue.org> writes:

> Marius Vollmer <mvo@zagadka.ping.de> writes:
> 
> >>   According to R5RS (expt 0 0) -> 1
> >
> > Yes, should be release critical.  I have tagged it as such.
> 
> On a related note, how about this?
> 
>   $ guile
>   guile> (exp (* 0.0 (log 0.0)))
>   #.#
>   guile> (exp (* 0 (log 0.0)))  
>   1.0
> 
> OK?

I would say "yes".

The first case uses floating point only and should conform to IEEE
754.  The "#.#" really is a NaN (and 1.7 will print it as +nan.0).
This is sensible since (* 0.0 (log 0.0)) is zero times -infinity.

The second case computes exact zero times inexact infinity.  Should
the result be exact or inexact?  I can't say.  To me, it makes both
sense for the product to result in exact zero, as to result in inexact
Nan.  R5RS allows both.

But the latter option would conflict 'more' with R5RS, I guess, since
it specifies (expt 0 0) to return 1.  But it explicitely only defers
(expt x y) to (exp (* y (log x)) for x != 0.

In my view, (expt 0 0) should be undefined, and any program that needs
a definite value for it should special case it.  But that's not what
R5RS specifies...

In absence of any good advice from numericans, the best we can do is
not gratuitously change what we are doing.

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-05-15 19:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-21 16:49 Bug 13 (expt 0 0) -> 0, release-critical or not? Rob Browning
2002-04-24 21:23 ` Marius Vollmer
2002-05-15  5:01   ` Rob Browning
2002-05-15 19:19     ` Marius Vollmer [this message]
2002-05-16 16:19       ` Rob Browning
2002-05-16 17:06         ` Rob Browning

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=87lmalp6b0.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=guile-devel@gnu.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).