P is for Practical | |
PerlMonks |
Re: Re: Re: help with algorithmby larsen (Parson) |
on Nov 17, 2002 at 02:03 UTC ( [id://213493]=note: print w/replies, xml ) | Need Help?? |
The first example is 1010, that is (I'm considering the binary digits from right to left): 0 * 20 + 1 * 21 + 0 * 22 + 1 * 23 Your second example is 100. As usual, from right to left... 0 * 20 + 0 * 21 + 1 * 22 Got the pattern? Now I'm going to check what powers of 2 are on (i.e. multiplied by 1). In the first example they are 21 (Monday) and 23 (Wednesday). In the second example only 22, Tuesday. I hope this will clarify my node.
In Section
Seekers of Perl Wisdom
|
|