Am I missing something embarrassingly obvious?  What's wrong with "x
% y"?  In my C reference manual, the "%" operator is even called the
"remainder operator".

-- Keith


>In mathematical terms, I believe the value of "x mod y" can be represented
>as "x - (x / y) * y", just make sure x and y are both integers.
>
>Regards,
>
>Alan Ingleby
>Systems Developer
>ProfitLink Consulting Pty Ltd
>309 Burwood Road
>Hawthorn
>Victoria 3122
>Australia
>"Nicol·s Zeitlin" <[EMAIL PROTECTED]> wrote in message
>news:43717@palm-dev-forum...
>>
>>  The "subject" speaks for itself. I need to know the value of the remainder
>>  of a division. If you know this, then I believe my problem is solved. The
>>  function is called Mod() in Visual Basic, and fmod() in MSL_C.
>>
>>  If you have some spare time, then please keep on reading, because I might
>be
>>  already making some mistakes which need for help.. ;-)
>>
>>  I need the value of the remainder for the following reason:
>>
>>  I have a table control, with a few columns, with a few rows. I need to set
>>  the TblSetItemInt() value, in each single cell, so that I can write its
>>  value through the CustomDraw Function. If I didn't do this, the CustomDraw
>>  Function wouldn't know what each cell's value should be, right?
>>
>>  So far so good. I set the ItemInt's the following way.
>>  Row 1, Column 1:: 1
>>  Row 1, Column 2:: 2
>>  Row 1, Column 3:: 3
>>  Row 2, Column 1:: 4
>>  .... and so on .....
>>
>>  I can draw the contents of the table. But I need it to do some tasks when
>I
>>  tap on the cells of the last (and third) column. To find out whether the
>>  user just tapped on ANY cell, or one of the last column, I am checking
>>  wheter the ItemInt is divisable by three. To do this I need to know the
>  > remainder of the division, and that's the reason for this e-mail.
--

-- Keith Rollin
-- Palm OS Emulator engineer

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to