From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <43A33F85.4060602@comtv.ru> Date: Sat, 17 Dec 2005 01:28:21 +0300 From: Victor Nazarov User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] More Microsoft bashing References: <6e35c0620512152004n37c06ff5wd250424db50d874d@mail.gmail.com> <20051216045306.126521B12F3@dexter-peak.quanstro.net> <200512161047.aa99386@salmon.maths.tcd.ie> In-Reply-To: <200512161047.aa99386@salmon.maths.tcd.ie> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: c96ca5b4-ead0-11e9-9d60-3106f5b1d025 John Stalker wrote: >>| >>| So, what *is* -5 MOD 3? >>| >> >>-2 >> >> > >I hope not. If you are really serious about using modular arithmetic >then you probably want to use something like PARI GP where -5 mod 3 >is -5 mod 3, belonging to the data type of integers mod 3. -2 mod 3 >and 1 mod 3 are alternate representations of the same value. If you >aren't serious about modular arithmetic and want the result to be an >integer then I think you are shooting yourself in the foot if you >implement it as anything other than -5 mod 3 == 1. I want to be able >to test whether n is odd with `if ( n % 2 == 1 ) ...' Of course, I'm >a mathematician rather than a CS person, but I think the other >convention has nothing to recommend it. > > > Agreed on this. At least most (all I know) cryptography protocols require -5 mod 3 to be 1 for their implementations. At least lots of algorithms require ... == -5 mod 3 == -2 mod 3 == 1 mod 3 == 4 mod 3 == .... -- Victor Nazarov http://vir.comtv.ru/