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

Peter Haefeli peter.haefeli at mac.com
Sat Nov 3 18:55:58 CET 2007


Hi,

I comiled bug.cpp on my iMac (G5) and got this output:

[Session started at 2007-11-03 18:50:19 +0100.]
(x != ring->zero()) = false (correct)
(x == ring->zero()) = true (correct)

cln_test has exited with status 0.

Greetings
Peter



Am 03.11.2007 um 18:01 schrieb Remco Bloemen:

> Hi Richard,
>
> On Friday 02 November 2007 00:52:44 Richard B. Kreckel wrote:
>> 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.
>
> I have looked at the code, but i could only conclude the following: my
> assembler is even worse than my german. I'm afraid fixing assembler  
> code is
> way over my head, otherwise i would have loved to send you a patch.
>
> PS: I am moving to a new 64-bits laptop and i can confirm that the  
> bug does
> not exist there.
>
> Kind regards,
> Remco
> _______________________________________________
> CLN-list mailing list
> CLN-list at ginac.de
> https://www.cebix.net/mailman/listinfo/cln-list



More information about the CLN-list mailing list