Igor Schein on Tue, 21 Jul 1998 16:00:57 -0400 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
ispseudoprime behavior |
Hi, consider the following function f(n)=while(1,print(ispseudoprime(n))) Now let n be a negative integer whose absolute value is an odd composite integer. For example let n=-9. In a few iterations you'll see the following: *** impossible inverse modulo: Mod(3, 9). I was trying to figure out what's going on in the code, I noticed that negative sign gets stripped out by the time millerrabin() is called, but couldn't figure out where. I looked at the manual, and didn't see any mentioning of having to restrict arguments to ispseudoprime() to positive integers. So, if ispseudoprime() is supposed to work on negative integers, than the behavior described above is a bug. If it's not supposed to work on negative integers, then I'd like that to be mentioned in the manual on in online help. Thanks Igor