>
> I was thinking, that as computers are binary machines, you could
> probably speed up your algorithm by thinking in binary rather than
> decimal. This will mean doing a lot of modification to your algorithm.
> Just thinking out loud again.
Even better would be to think it terms of how many opcodes it takes to
get the job done. Compare:
void swap (int x, int y) { int tmp; tmp=x; x=y; y=tmp }
#define swap(a,b) { a^=b;b^=a;a^=b }
The second is from the book 'Applied Cryptography', which has some very
tight code in it. It avoids the funtion call altogether, it doesn't
create any tempory variables, and should become 3 XOR commands in total
once compiled.
- Doug
--
_____________________________________________________________
Network Operations Engineer - Big Pond Advance Satellite
Ericsson Australia - Level 5, 184 The Broadway, Sydney 2000
Ph: +61-416-085-390 Email: [EMAIL PROTECTED]
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug