On May 19, 2009, at 10:05 AM, Jean-Denis Muys wrote: > On 5/19/09 2:44 PM, "Igor Tandetnik" <itandet...@mvps.org> wrote: >> >> Wikipedia gives a definition different from yours, for what it's >> worth: >> >> http://en.wikipedia.org/wiki/Remainder#The_case_of_general_integers > > Also to support my version, the same article says a bit later: > > " Usually, in number theory, we always choose the positive remainder". > > While programming languages seems to make rather different choices: > > "C99 and Pascal choose the remainder with the same sign as the > dividend a. > (Before C99, the C language allowed either choice.) Perl and Python > choose > the remainder with the same sign as the divisor d."
For those with ACM digital library access, the three options are defined and analyzed in some detail in the paper "The Euclidean definition of the functions div and mod" by Raymond T. Boute, University of Nijmegen, ACM Transactions on Programming Languages and Systems (TOPLAS) Volume 14, Issue 2 (April 1992), Pages: 127 - 144, Year of Publication: 1992, ISSN:0164-0925 http://portal.acm.org/citation.cfm?doid=128861.128862 e _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users