unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: IEEE Inf and NaN support for numbers.c
Date: Thu, 21 Mar 2002 15:16:53 -0600	[thread overview]
Message-ID: <15514.19909.408835.204209@segfault.bogus.domain> (raw)
In-Reply-To: <87lmcuyifu.fsf@zagadka.ping.de>

On 14-Mar-2002, Marius Vollmer <mvo@zagadka.ping.de> wrote:

| "John W. Eaton" <jwe@bevo.che.wisc.edu> writes:
| 
| > The following patch adds basic IEEE Inf and NaN support for guile.  This
| > introduces two new predicates (inf? and nan?) and two new functions
| > (inf and nan, which return IEEE Infinity and NaN values,
| > respectively).
| 
| Nice, thanks.
| 
| >   guile> (/ 0)
| >   Inf
| 
| This is not a good print syntax for the new "inf" value.  It looks
| like a symbol, while it really is a number.  Likewise for "NaN".
| 
| What about using "1/0" for inf and "0/0" for NaN.  Does this fit with
| the IEEE rules?

I suppose it would work, but it is a bit misleading, because Inf and
NaN can be generated in ways other than just 1/0 and 0/0.

| When this works, we don't need the 'inf' and 'nan' procedures.

Sure, but perhaps it is nice to have a way to request a NaN or Inf
value without having to perform additional arithmetic operations?

Eventually, I'd like to be able to make it possible to control what
happens when Inf and NaN are generated.  For example, generate an
exception instead of simply continuing.  In that case, it might be
good to have another way to get at Inf and NaN without generating the
exception.

I'd also be happy to have these procedures only available if some
package/module/whatever is loaded, but I don't know how to do that
(yet).

| Do we want to care about signalling versus quiet NaNs, and the extra
| information in the mantissa of NaNs?  (I don't think so.)

Perhaps not yet, but it might be useful to have these things later.

| Also, somewhat unrelated to your patch, Guile can not read the
| (illegal) notation "#.#" that is produces for funny numbers.  It's
| probably best to avoid outputting this notation altogether and just
| find a way to cope with funny numbers more sanely.  (Like you just did
| for infinity.)

Right, I wasn't sure what to do with the #.# thing, so I tried to
leave it alone as much as possible.

BTW, would people object to reformatting numbers.c to follow the GNU
coding standards?

Thanks,

jwe

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-03-21 21:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15494.39950.119995.223196@segfault.bogus.domain>
2002-03-14 20:59 ` IEEE Inf and NaN support for numbers.c Marius Vollmer
2002-03-21 21:16   ` John W. Eaton [this message]
2002-03-22  0:59     ` Rob Browning
2002-03-22  9:18       ` Neil Jerram
2002-04-24 19:11     ` Marius Vollmer
2002-04-24 21:07       ` John W. Eaton
2002-04-24 22:31         ` Marius Vollmer
2002-05-06 22:39           ` Marius Vollmer
2002-05-15  5:36             ` John W. Eaton
2002-05-15 19:27               ` Marius Vollmer
2002-04-24 22:51         ` Rob Browning

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=15514.19909.408835.204209@segfault.bogus.domain \
    --to=jwe@bevo.che.wisc.edu \
    --cc=guile-devel@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).