bug-mit-scheme
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-mit-scheme] floating-point read/print bug


From: Gerald Jay Sussman
Subject: [Bug-mit-scheme] floating-point read/print bug
Date: Sun, 2 May 2010 12:05:29 -0400
User-agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/9.0.1

Violation of the read/print invariance.  This bug appears only in 
the native 64-bit version.  The 32-bit version has no problem.


Image saved on Tuesday March 23, 2010 at 1:02:20 PM
  Release 9.0.1 || Microcode 15.2 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 
4.118
  Edwin 3.116   || SOS 1.8        || IMAIL 1.21


(define (heron-step x g)
  (let* ((x/g (/ x g))
         (g+x/g (+ g x/g)))
    (/ g+x/g 2)))
;Value: heron-step

(heron-step 2 1.4)
;Value: 1.4142857142857141

(string->number (number->string (heron-step 2 1.4)))
;Value: 1.414285714285714

(let ((x (heron-step 2 1.4)))
  (= x (string->number (number->string x))))
;Value: #f





reply via email to

[Prev in Thread] Current Thread [Next in Thread]