smplx email (remove spam text)
part 1 994 bytes content-type:text/plain; charset="utf-8" (decoded base64)<alpine.LNX.email@example.com>
On Wed, 6 Sep 2017, Walter Banks wrote:
> I depends how much you know about the numbers. This works as long as the
> MSbit of x is 0.
> No magic in this and not particularly fast.
> // divide x/y and return a fraction
> // x < y always
> // reference in 16 bits
> uint16_t div_fract (uint16_t x,y)
> char count = 16 ; // size of result in bits
> x <<= 1;
> if (x >= y)
> x -= y;
> x |= 1;
> return x;
Hi Walter, I don't understand how the above is supposed to work.
Surely the "x |= 1" is wrong? Don't you need a seperate variable build the
On a mid range PIC the "(x >= y)" would need to be performed as
"(x - y >= 0)" so why not compute "x = x - y" and compare with 0?
part 2 197 bytes content-type:text/plain; name="ATT00001.txt"
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
In reply to: <firstname.lastname@example.org>
See also: www.piclist.com/techref/microchip/math/index.htm?key=division
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the