On Sunday 16 July 2006 06:48, Andrius Aštrauskas wrote: > On Fri, 14 Jul 2006 13:32:45 +0200 > > Jurgen Stigter <[EMAIL PROTECTED]> wrote: > > /I am using version 2.0 of OpenOffice.org. My problem is :/ > > > > The MOD function is returning -512 instead of 0 (though each of the > > factors is divisable by 23): > > MOD (9951585559 *370469809;23) results in -512, but when I copy the > > formula and put it in another cell, the result is -320 > > while > > MOD (9951585559;23) results in 0 > > MOD (370469809;23) results 0
This is almost certainly due to an integer overflow. There will be a limit to the size of exact integer values. I don't know how big they can be; perhaps someone else can say. In this particular case, you can rewrite the formula because: a*b (mod p) = a (mod p) * b (mod p) > > > > [inconsistency pattern: MOD(Ap;p) = 0, MOD(Bp;p) = 0 but MOD(Ap * > > Bp;p), for Ap, Bp "large" multiples of prime number p] > > The same problem occurs already when dividing both factors by 23 and > > multiplying by a prime factor like 3, and calculating MOD 3. > > > > Maybe this problem is already soved in the latest version; > > unfortunately, at the moment, I'm not able to update, due to my slow > > connection. > > Calculating greetings, > > Jurgen > > I've tested your examples on 2.0.3 - the result was always 0. > > Andrius > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Andy Pepperdine On this mailing list help is provided by volunteers. Please subscribe to the mailing list to see all the replies to a query, and reply only to the mailing list at [EMAIL PROTECTED] For FAQ, userguide, see: http://documentation.openoffice.org/ For more information about the OOo licence here: http://www.openoffice.org/license.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
