MOD returns the remainder of the division, assuming we use integer arithmetic. I.e.: 234 / 10 = 23 Then 4 remains (234 - (10 * 23)) Or: 23 / 6: (23 - (6 * 3)) = 5
Best ragards Anders Karlsson Thomas Nyman wrote:
Hi All
I'm a bit perplexed..perhaps its a language thing,,but
the MYSQL reference manual says that
MOD ..Returns the remainder of N divided by M... and gives an example SELECT MOD(234,10) --> 4
This I do not understand. remainder of N divided by M - isn't that simply division?
I mean 234 divided by 10 does not equal 4
On my own machine..if I do SELECT MOD(23,6) I would expect 3,8333 as the result and not 5.
SInce MOD is returning something other than I expect there must be something I am missing....in other words...what is MOD returning??
Thomas
-- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Anders Karlsson ([EMAIL PROTECTED]) / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Sales Engineer /_/ /_/\_, /___/\___\_\___/ Stockholm <___/ www.mysql.com Cellphone: +46 708 608121
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
