That could work.  However you got to be very careful on the declaration of the
variables.

It might fail.  For example:

UInt16 num = 254;
UInt8 div = 129;

num + div << 1 = 254 + 2 = 256
result = 256/129 = 1;

Max

--- Philip Sheard <[EMAIL PROTECTED]> wrote:
> > >
> > result = (num/div) + ((num % div)*2 < div)?0:1);
> 
> or result = (num + div << 1) / div;
> 
> >
> > Max
> >
> > --- Johnathan Smith <[EMAIL PROTECTED]> wrote:
> > > if I do 212 / 20 I would like my out come to be 11.  I
> > > am getting 10.6.
> > >
> > >  How can I make all number greater then .5 round up
> > > and all numbers less then .5 round down??
> > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Send your FREE holiday greetings online!
> > > http://greetings.yahoo.com
> > >
> > > --
> > > For information on using the Palm Developer Forums, or to unsubscribe,
> please
> > > see http://www.palmos.com/dev/tech/support/forums/
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send your FREE holiday greetings online!
> > http://greetings.yahoo.com
> >
> >
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe, please
> see http://www.palmos.com/dev/tech/support/forums/


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
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