piclist 2001\04\04\052147a >
Thread: Any clever implementations of rounding out there ?
www.piclist.com/techref/microchip/devices.htm?key=pic
flavicon
face BY : Roman Black email (remove spam text)



Kübek Tony wrote:

{Quote hidden}

Tony, the best way is if you can keep rounding
to a binary mulitple.
Just add half of the rounding total,
then clear the low bits.

Example, to round to the nearest 256;
add 128 to the number,
clear the bottom 8 bits.
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


<3ACAE700.26C3@ezy.net.au> quoted-printable

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Any clever implementations of rounding out there ?

month overview.

new search...