unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Cc: bug-guile@gnu.org
Subject: Re: division by 0
Date: Sun, 21 Mar 2004 01:34:27 +0100	[thread overview]
Message-ID: <87r7vnm418.fsf@zagadka.ping.de> (raw)
In-Reply-To: <877jy22d62.fsf@merceron.meteo.fr> (Bernard Urban's message of "03 Mar 2004 15:55:17 +0100")

Bernard Urban <Bernard.Urban@meteo.fr> writes:

> Debian woody on i386.
>
> $ guile
> guile> (version)
> "1.6.4"
> guile> (/ 0)
> +#.#
> guile> (/ 1.0 0)
> +#.#
> guile> (/ 1 0.0)
> +#.#
> guile>(/ 1 0)
> standard input:3:1: In procedure / in expression (/ 1 0):
> standard input:3:1: Numerical overflow
> ABORT: (numerical-overflow)
>
> Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
> guile>
>
> Problem happens in numbers.c, function scm_divide(), where the test 
> #line 3274 should not be made.

The 1.7 series should be handling this more correctly.  From NEWS:

    ** There is support for Infinity and NaNs.

    Following PLT Scheme, Guile can now work with infinite numbers, and
    'not-a-numbers'.

    There is new syntax for numbers: "+inf.0" (infinity), "-inf.0"
    (negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as
    "+nan.0").  These numbers are inexact and have no exact counterpart.

    Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the
    sign of the dividend.  The infinities are integers, and they answer #t
    for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is
    not '=' to itself, but '+nan.0' is 'eqv?' to itself.

    For example

        (/ 1 0.0)
        => +inf.0

        (/ 0 0.0)
        => +nan.0

        (/ 0)
        ERROR: Numerical overflow

    Two new predicates 'inf?' and 'nan?' can be used to test for the
    special values.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


  reply	other threads:[~2004-03-21  0:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03 14:55 division by 0 Bernard Urban
2004-03-21  0:34 ` Marius Vollmer [this message]
2004-03-29  9:09   ` Bernard Urban
2004-04-20  1:21     ` Kevin Ryde
2004-04-20 13:21       ` Bernard Urban
2004-04-20 15:18       ` Bernard Urban
2004-05-10 21:36     ` Marius Vollmer

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