Unfortunitly I have a tendency to make things more complecated than they need to be!
As you say the binary division is probably unneccesary. I had a go at using the binary shift operator (the bitwise >> and << operators) but I got relly confused about operating on integers types and dividing by any integer. I also attempted to use a higher level 'mod' construct, ('%' in C++ or 'mod' object pascal). I had similar problems.
I saw an extreamly complecated looking piece of code that didn't use divsion at all, but some kind of logical sequence. Many algorithms are suited to long frames and 64 bit or 32 bit codes, when I'm after something that will to for simple numbers
Thanks for your suggestions! I'll look at the 'repeated addition' method and see what I get
Unfortunitly I have a tendency to make things more complecated than they need to be!
As you say the binary division is probably unneccesary. I had a go at using the binary shift operator (the bitwise >> and << operators) but I got relly confused about operating on integers types and dividing by any integer. I also attempted to use a higher level 'mod' construct, ('%' in C++ or 'mod' object pascal). I had similar problems.
I saw an extreamly complecated looking piece of code that didn't use divsion at all, but some kind of logical sequence. Many algorithms are suited to long frames and 64 bit or 32 bit codes, when I'm after something that will to for simple numbers
Thanks for your suggestions! I'll look at the 'repeated addition' method and see what I get