unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Handle products with exact 0 differently, etc
Date: Wed, 02 Feb 2011 01:38:46 +0000	[thread overview]
Message-ID: <87bp2vtduh.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87k4hjuu82.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Tue, 01 Feb 2011 19:59:41 -0500")

Mark H Weaver <mhw@netris.org> writes:

> 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.

Yes, I think I understand that.

> 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.

In other words, the argument is that any inexact number might actually
be infinite.  (Right?)

That strikes me as stretching the idea of inexactness too far; and also
as not useful, because I'm sure there are many practical ways of
producing inexact numbers that are provably finite (e.g. sqrt(5)).  My
guess is that for the majority of programming situations where I have an
inexact number X, that number is provably finite, and so I'd want (* 0
X) to be an exact 0.

But I'm not an expert, and I'm not actually writing those programs
now...

Are you following specific references here?  FWIW, for cases like this,
the last para of R6RS 11.7.1 allows "either 0 (exact) or 0.0 (inexact)".

        Neil



  reply	other threads:[~2011-02-02  1:38 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
2011-02-02  1:38     ` Neil Jerram [this message]
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=87bp2vtduh.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --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).