This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in Arithmetic (kawa/gnu.math)


Hi,

there seems to be a bug in kawa. Trying to calculate

(/ 6666666668 3) results in 2222222222

I traced the error back to the gcd method of gnu.math.IntNum
which behaves buggy when used with one arg larger than 
(expt 2 32) and the other being odd like 3,5,7,9,11,13,15,...
(I didn't test any further)

For example (4294967296 = (expt 2 32)):
(gcd 4294967295 3) results in 3 which is true, but
(gcd 4294967298 3) results in 1 which is obviously false

I guess, there is something mixed up with the 2-complement
and 32-Bit word-wise representation of IntNum.

Is this bug already known?
Is there a fix or workaround?

regards,

M. Otto



-------------------------------------------------------
Marcus Otto
Institut fuer Mathematik und Informatik
Paedagogische Hochschule Ludwigsburg
Reuteallee 46
71634 Ludwigsburg
Telefon: ++49 (0)7141/140-420
e-mail: otto_marcus@ph-ludwigsburg.de
-------------------------------------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]