This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Bug in Arithmetic (kawa/gnu.math)
- To: kawa at sourceware dot cygnus dot com
- Subject: Bug in Arithmetic (kawa/gnu.math)
- From: "Otto, Marcus" <Otto_Marcus at ph-ludwigsburg dot de>
- Date: Sat, 29 Apr 2000 18:45:05 +0100
- Organization: Paed. Hochschule Ludwigsburg
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
-------------------------------------------------------