1. Re: Encrypting (and bit-shifting)

> 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

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu