Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

RE: [AVR-Chat] some C string conversion functions?

RE: [AVR-Chat] some C string conversion functions?

2005-04-22 by Robert Adsett

At 03:36 PM 4/22/05 +0100, Paul Curtis wrote:

>Robert et al,
>
> > At 02:18 PM 4/22/05 +0000, arhodes19044 wrote:
> > >I see the modulo function for floats, but is there an
> > integer version
> > >of modulo?  I did not see that.
> >
> > %
>
>% is indeed the integer modulus (remainder after division) operator, but
>implementations are allowed to implement this using either symmertic or
>floored division.  This is only a problem if you use '%' with integer
>operands which could possibly be negative.  In that case, two C
>implementations could produce different results on the SAME processor.

Point taken, although I haven't had an issue with it.  OTOH I've never had 
a need to take the modulus of a negative number.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.