At 12:16 PM 2/21/02 -0500, I wrote: >There's also an issue if the number is negative. OK, I see that you're using C. In that case you should use /2 if the number is signed. Shifting (>>1) should be avoided because the results are officially "implementation defined", thus it is non-portable code. See: ISO/IEC 9899:1999 (E) 6.5.4 (the current C standard) Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com 9/11 United we Stand -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads