unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Zefram <zefram@fysh.org>
To: 16356@debbugs.gnu.org
Subject: bug#16356: doc out of date about (integer? +inf.0)
Date: Sun, 5 Jan 2014 22:54:35 +0000	[thread overview]
Message-ID: <20140105225435.GA30283@fysh.org> (raw)

The "Integers" node of the guile info document contains this gem (source
in doc/ref/api-data.texi):

          (integer? +inf.0)
          => #t

Actual guile-2.0.9 behaviour:

scheme@(guile-user)> (integer? +inf.0)
$16 = #f

The doc example matches the behaviour of guile-1.8, which classifies
+inf.0 and -inf.0 as integers, and +nan.0 as rational but not integer.
guile-2.0 follows R6RS in treating all three of these values as real
but not rational, and the "Reals and Rationals" node describes this
accurately.

Debian incarnation of this bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734323

Mathematically, infinities are not real, and NaN is, as the acronym says,
not a number.  The documentation could perhaps do with a note about
the difference between mathematical terminology and Scheme terminology.
I was rather surprised to find any discrepancy, as Scheme's numerical
tower stands out among programming languages as being uniquely accurate
in its use of mathematical terms.  Scheme's concept of "real" more
closely corresponds to the mathematical concept of "hyperreal", which
includes infinities, although NaN doesn't fit.  Scheme's "complex" is
similarly extended relative to the mathematical complex numbers, but
the mathematical term "hypercomplex" unfortunately refers to something
quite different (quaternions and the like).

-zefram





             reply	other threads:[~2014-01-05 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-05 22:54 Zefram [this message]
2014-01-09  3:56 ` bug#16356: doc out of date about (integer? +inf.0) Mark H Weaver

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=20140105225435.GA30283@fysh.org \
    --to=zefram@fysh.org \
    --cc=16356@debbugs.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).