[CLN-list] Bug in F_2[X] comparisson

Richard B. Kreckel kreckel at ginac.de
Fri Nov 2 00:52:44 CET 2007


Hi!

Remco Bloemen wrote:
> Lately i have been implementing a few algorithms from "Modern Computer 
> Algebra". In the process of implementing Z[x] factorization i noticed the 
> following strange behavior:
> 
>   cl_modint_ring basering = find_modint_ring(2);
>   cl_univpoly_modint_ring ring = find_univpoly_ring(basering);
>   cl_UP_MI x= ring->zero();
> 
>   (x != ring->zero()) returns false (correct)
>   (x == ring->zero()) returns false (incorrect)
> 
> If i first compare  x == x the behavior changes:
> 
>   (x == x) returns true (correct)
>   (x != ring->zero()) returns true (incorrect)
>   (x == ring->zero()) returns false (incorrect)
> 
> Attached is a demonstrational program. I'm using cln version 1.1.13 compiled 
> with gcc-4.2.2 on x86 (prescott).
> 
> Could someone please tell me if this is fixed in cvs or being worked on?

The bug is still there. I think it can only happen when x is the ring's 
zero, and only in Z/2Z and only on x86: The culprit seems to be the 
assembler function compare_loop_up in src/base/digitseq/cl_asm_i386_.cc. 
It doesn't work properly if the loop is empty.

I just found that out, but it is too late to work on a patch now and I 
won't have time the next two weeks. Can you, please, try to fix this 
yourself and send a patch?

Regards
    -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the CLN-list mailing list