Re: LZ: manipulations
[Prev][Next][Index][Thread]
> > Also, would the shifting method be able to work for #'s that aren't powers of
> > 2 (odd #'s)
>
> Nope. Only 2,4,8,16,32,64,128.
>
well one trick is to combine shifts and adds/subs
e.g. to multiply by seve,
store teh origional no ina nother register,
shift teh oriogional register left 3 times
subtract the copy you made
hey presto, times by seven (simple algebra a*8-a =a*7)
you can do this for pretty much any number..
Rob Taylor MAIL - mailto:rtaylor@ticalc.org
WEB - http://www.u-net.com/~rtaylor/
References: