It's interesting that most of the answers argue that the compiler will optimise a multiply by a power of 2 into a bitshift. It's obvious that none of the responders have actually tried compiling a bitshift versus a multiply to see what the compiler actually produces.
This is purely an academic exercise; as just about everyone has pointed out, the multiply is easier to read (though quite why the "*200L / 100L" part is in there is anyone's guess - that just serves to obfuscate things). It's also pretty obvious that replacing a multiply with a bitshift in C# isn't going to have any significant performance increase, even in tight loops. If you need that kind of optimisation, you're using the wrong platform and language to start with.
Let's see what happens when we compile a simple program with CSC (the C# compiler) included with Visual Studio 2010 with optimisations enabled. Here's the first program:
static void Main(string[] args)
{
int j = 1;
for (int i = 0; i < 100000; ++i)
{
j *= 2;
}
}
Using ildasm to decompile the resultant executable gives us the following CIL listing:
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 23 (0x17)
.maxstack 2
.locals init ([0] int32 j,
[1] int32 i)
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldc.i4.0
IL_0003: stloc.1
IL_0004: br.s IL_000e
IL_0006: ldloc.0
IL_0007: ldc.i4.2
IL_0008: mul
IL_0009: stloc.0
IL_000a: ldloc.1
IL_000b: ldc.i4.1
IL_000c: add
IL_000d: stloc.1
IL_000e: ldloc.1
IL_000f: ldc.i4 0x186a0
IL_0014: blt.s IL_0006
IL_0016: ret
} // end of method Program::Main
Here's the second program:
static void Main(string[] args)
{
int j = 1;
for (int i = 0; i < 100000; ++i)
{
j <<= 1;
}
}
Decompiling this gives us the following CIL listing:
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 23 (0x17)
.maxstack 2
.locals init ([0] int32 j,
[1] int32 i)
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldc.i4.0
IL_0003: stloc.1
IL_0004: br.s IL_000e
IL_0006: ldloc.0
IL_0007: ldc.i4.2
IL_0008: shl
IL_0009: stloc.0
IL_000a: ldloc.1
IL_000b: ldc.i4.1
IL_000c: add
IL_000d: stloc.1
IL_000e: ldloc.1
IL_000f: ldc.i4 0x186a0
IL_0014: blt.s IL_0006
IL_0016: ret
} // end of method Program::Main
Note the difference at line 8. The first version of the program uses a multiply (mul), whilst the second version uses a left-shift (shl).
Quite what the JIT does to it when the code is executed I'm not sure, but the C# compiler itself demonstrably does not optimise multiplies by powers of two into bitshifts.