[racket] weird results with gcd in r6rs mode?

From: Marco Maggi (marco.maggi-ipsu at poste.it)
Date: Fri Jun 28 03:28:21 EDT 2013

Ciao,

  when running this program with plt-r6rs:

   #!r6rs
   (import (rnrs))

   (define GREATEST-FX-64-bit +1152921504606846975)
   (define LEAST-FX-64-bit -1152921504606846976)

   (define IFL5 +2.0)
   (define IFL6 -2.0)

   (define VBN2 (+ GREATEST-FX-64-bit +100))
   (define VBN3 (+ LEAST-FX-64-bit -1))

   (display VBN2)(newline)
   (display VBN3)(newline)
   (display IFL5)(newline)
   (display IFL6)(newline)
   (newline)
   (display (gcd VBN2 IFL5))(newline)
   (display (gcd VBN3 IFL5))(newline)
   (display (gcd VBN2 IFL6))(newline)
   (display (gcd VBN3 IFL6))(newline)
   (display (gcd IFL5 VBN2))(newline)
   (display (gcd IFL5 VBN3))(newline)
   (display (gcd IFL6 VBN2))(newline)
   (display (gcd IFL6 VBN3))(newline)

   (flush-output-port (current-output-port))

I get:

   1152921504606847075
   -1152921504606846977
   2.0
   -2.0

   2.0
   2.0
   2.0
   2.0
   2.0
   2.0
   2.0
   2.0

but I think the GCD results should be 1.0?

TIA
-- 
"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"

Posted on the users mailing list.