Re: Testing the reference implementation Bradley Lucier 20 Nov 2005 19:32 UTC

There are more serious problems.  In Gambit-C I get (after the first
four lines)

(+ +0+0i +0+1i)        =>         +0+1i
(- +0+0i +0+1i)        =>         +0-1i
(* +0+0i +0+1i)        =>         +0+0i
(/ +0+0i +0+1i)        =>         +0+0i
(+ +0+0i +0-1i)        =>         +0-1i

while in Scheme-48+will I get (with the same arguments)

(+ +0+0i +0+0i)        =>         +0+0i
(- +0+0i +0+0i)        =>         +0+0i
(* +0+0i +0+0i)        =>         +0+0i
(/ +0+0i +0+0i)        =>         +0+0i
(+ +0+0i +0+0i)        =>         +0+0i

Perhaps it's just a problem with number->string; the arguments look OK:

r6rs/will> arguments
'(#{Fx 0} #{Fx 1} #{Fx -1} #{Flonum 0.0} #{Flonum -0.0} #{Flonum 1.0}
#{Flonum -1.0} #{Flonum #{Inf}} #{Flonum #{-Inf}} #{Flonum #{NaN}})

I guess not; when I get change (display (number->string x)) to
(display x) I get (with the same arguments)

(+ +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i)        =>         +#{Fx 0}+#
{Fx 0}i   <<<<<
(- +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i)        =>         +#{Fx 0}+#
{Fx 0}i
(* +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i)        =>         +#{Fx 0}+#
{Fx 0}i
(/ +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i)        =>         +#{Fx 0}+#
{Fx 0}i
(+ +#{Fx 0}+#{Fx 0}i +#{Fx 0}+#{Fx 0}i)        =>         +#{Fx 0}+#
{Fx 0}i

So maybe there are more bugs, or maybe I just don't understand this
arithmetic at all

Brad