1. Re: Encrypting (and bit-shifting)
- Posted by William Eiten <atompunk at ROF.NET>
Jul 12, 1997
-
Last edited Jul 13, 1997
> I found that there *is* a big difference in speed
> between
> (a) - dividing by 2 (or by a constant variable declared and set to 2)
> (b) - dividing by some other integer than 2, or dividing by
> an integer variable that was set to 2 on an earlier statement
>
> (a) was almost 5x faster than (b) on my Pentium because a right-shift is
used,
> rather than an integer divide, and because a couple of other
> minor short-cuts are taken.
I was just wondering, would it be faster to divide a number by 2 twice than
to divide by 4?
William