unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Greg Troxel <gdt@ir.bbn.com>
Subject: Re: inum/double = on 64-bits
Date: 06 Jan 2005 10:06:11 -0500	[thread overview]
Message-ID: <rmiekgysil8.fsf@fnord.ir.bbn.com> (raw)
In-Reply-To: <87brc3mmcl.fsf@zip.com.au>

  On a debian alpha, a comparison like

          (= #x111111111111111 (exact->inexact #x111111111111110))

  gives #t, where on a 32-bit system it's #f.

Is the language clear on what the right answer is?  Are you saying
that the behavior is suboptimal, or a violation of R5RS?

On my system, I get #t.  A perhaps related suboptimality is in
printing large inexact values.

On NetBSD/i386 2.0ish, guile 1.6.5:

guile> (= #x111111111111111 (exact->inexact #x111111111111110))
#t
guile> #x111111111111110
76861433640456464
guile> (exact->inexact #x111111111111110)
76861433640456500.0
guile> (inexact->exact (exact->inexact #x111111111111110))
76861433640456464


NetBSD/sparc64 (LP64) 2.0ish, guile 1.6.4:

guile> (= #x111111111111111 (exact->inexact #x111111111111110))
#t
guile> #x111111111111110
76861433640456464
guile> (exact->inexact #x111111111111110)
76861433640456500.0
guile> (inexact->exact (exact->inexact #x111111111111110))
76861433640456464

It seems odd to me (from a user viewpoint, but also from thinking
about the implementation) that inexact->exact can restore information
that had appeared missing.
I wonder if I am seeing the effects of the extra floating point bits
beyond IEEE754 on i386, but I see the same behavior on sparc64.



-- 
        Greg Troxel <gdt@ir.bbn.com>


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


  reply	other threads:[~2005-01-06 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06  0:29 inum/double = on 64-bits Kevin Ryde
2005-01-06 15:06 ` Greg Troxel [this message]
2005-01-06 23:15   ` Kevin Ryde

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=rmiekgysil8.fsf@fnord.ir.bbn.com \
    --to=gdt@ir.bbn.com \
    /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).