From: Mark H Weaver <mhw@netris.org>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Handle products with exact 0 differently, etc
Date: Tue, 01 Feb 2011 19:59:41 -0500 [thread overview]
Message-ID: <87k4hjuu82.fsf@yeeloong.netris.org> (raw)
In-Reply-To: <87mxmf1gi3.fsf@ossau.uklinux.net> (Neil Jerram's message of "Tue, 01 Feb 2011 23:28:52 +0000")
Neil Jerram <neil@ossau.uklinux.net> writes:
>> * libguile/numbers.c (scm_product): Handle exact 0 differently. A
>> product containing an exact 0 now returns an exact 0 if and only if
>> the other arguments are all exact.
>
> I don't get this one. I would expect "... are all finite".
I almost wrote "... are all finite and exact", but exact implies finite,
so I simplified it.
> Why would an exact 0 times a finite number be inexact?
The point of the exact/inexact distinction is to ensure that if you see
an exact number, you can trust that it is provably the correct answer,
and that no inaccuracies associated with inexact arithmetic along the
way could possibly have corrupted that answer.
In this case, the inaccuracies associated with inexact arithmetic could
result in an infinity being misrepresented as a finite number, or vice
versa. For example, if X is inexact, then we cannot claim that the
result of (* 0 (/ X)) is an exact 0, because a small change in X could
affect the final answer.
Best,
Mark
next prev parent reply other threads:[~2011-02-02 0:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 12:09 [PATCH] Handle products with exact 0 differently, etc Mark H Weaver
2011-02-01 20:13 ` Andy Wingo
2011-02-02 0:30 ` Mark H Weaver
2011-02-01 20:15 ` Andy Wingo
2011-02-01 23:28 ` Neil Jerram
2011-02-02 0:59 ` Mark H Weaver [this message]
2011-02-02 1:38 ` Neil Jerram
2011-02-02 3:20 ` Mark H Weaver
2011-02-02 4:22 ` Mark H Weaver
2011-02-02 4:28 ` Noah Lavine
2011-02-02 4:57 ` Mark H Weaver
2011-02-06 12:08 ` Neil Jerram
2011-02-06 14:15 ` Neil Jerram
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=87k4hjuu82.fsf@yeeloong.netris.org \
--to=mhw@netris.org \
--cc=guile-devel@gnu.org \
--cc=neil@ossau.uklinux.net \
/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).