* Bug 13 (expt 0 0) -> 0, release-critical or not?
@ 2002-03-21 16:49 Rob Browning
2002-04-24 21:23 ` Marius Vollmer
0 siblings, 1 reply; 6+ messages in thread
From: Rob Browning @ 2002-03-21 16:49 UTC (permalink / raw)
The bug:
bug 13 -- (expt 0 0) -> 0
reported-by: rlb / 2001-03-21
fixed: not-yet
According to R5RS (expt 0 0) -> 1
Also filed as bug 15 in HEAD.
I already have a fix for this, but as-per my earlier suggestions I'd
like to start discussing non-trivial freeze changes before making
them.
In frozen I'd just change boot-9.scm to check for the zero? case.
That way we're guaranteed not to affect any other intenal code that
might depends on the particular quirks of integer-expt in numbers.c
For unstable, I'd go ahead and fix integer-expt directly, but not
immediately. I've been working on the issues involved in using gmp
with guile, and I'd probably just handle it during that process.
Thoughts?
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
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
0 siblings, 1 reply; 6+ messages in thread
From: Marius Vollmer @ 2002-04-24 21:23 UTC (permalink / raw)
Cc: guile-devel
Rob Browning <rlb@defaultvalue.org> writes:
> The bug:
>
> bug 13 -- (expt 0 0) -> 0
> reported-by: rlb / 2001-03-21
> fixed: not-yet
>
> According to R5RS (expt 0 0) -> 1
Yes, should be release critical. I have tagged it as such.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
2002-04-24 21:23 ` Marius Vollmer
@ 2002-05-15 5:01 ` Rob Browning
2002-05-15 19:19 ` Marius Vollmer
0 siblings, 1 reply; 6+ messages in thread
From: Rob Browning @ 2002-05-15 5:01 UTC (permalink / raw)
Cc: guile-devel
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?
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
2002-05-15 5:01 ` Rob Browning
@ 2002-05-15 19:19 ` Marius Vollmer
2002-05-16 16:19 ` Rob Browning
0 siblings, 1 reply; 6+ messages in thread
From: Marius Vollmer @ 2002-05-15 19:19 UTC (permalink / raw)
Cc: guile-devel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
2002-05-15 19:19 ` Marius Vollmer
@ 2002-05-16 16:19 ` Rob Browning
2002-05-16 17:06 ` Rob Browning
0 siblings, 1 reply; 6+ messages in thread
From: Rob Browning @ 2002-05-16 16:19 UTC (permalink / raw)
Cc: guile-devel
Marius Vollmer <mvo@zagadka.ping.de> writes:
>> OK?
>
> I would say "yes".
OK. Thanks.
I'll need to change the implementation of expt in boot-9.scm because
right now that's what it calls to implement (expt 0 0.0), and so
doesn't return 1, but rather 0. I'm adding at least a few make check
tests as well to make sure we don't regress.
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug 13 (expt 0 0) -> 0, release-critical or not?
2002-05-16 16:19 ` Rob Browning
@ 2002-05-16 17:06 ` Rob Browning
0 siblings, 0 replies; 6+ messages in thread
From: Rob Browning @ 2002-05-16 17:06 UTC (permalink / raw)
Cc: guile-devel
Rob Browning <rlb@defaultvalue.org> writes:
> I'll need to change the implementation of expt in boot-9.scm because
> right now that's what it calls to implement (expt 0 0.0), and so
> doesn't return 1, but rather 0. I'm adding at least a few make check
> tests as well to make sure we don't regress.
Ignore that -- I briefly forgot that (integer? 0.0) -> #t, so all I
needed to to was fix integer-expt.
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-16 17:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2002-05-16 16:19 ` Rob Browning
2002-05-16 17:06 ` Rob Browning
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).