On 5/19/09 2:44 PM, "Igor Tandetnik" <itandet...@mvps.org> wrote:
> 
> Well then, for the equality to hold, (-1)/7 should be -1. Would you be
> happy with such an outcome?
> 

Yep

> Wikipedia gives a definition different from yours, for what it's worth:
> 
> http://en.wikipedia.org/wiki/Remainder#The_case_of_general_integers
> http://en.wikipedia.org/wiki/Modulo_operation

Well, I contend it doesn't. It says:

"−42 = 9×(−5) + 3 as is usual for mathematicians"

Which was my point.

But as was pointed out, there are two choices, both equally valid.

> 
> Once you decide that division truncates towards zero (as is the
> long-standing tradition in C and many other languages, for better or
> worse), you have no choice but to let the remainder take the sign of the
> dividend.

True enough.  It seems Computer Science has most of the time made the
opposite choice than mathematicians. I can live with that too.

> 
> Igor Tandetnik
> 

Jean-Denis Muys

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to