The following code is part of a larger class that I am trying to debug.
int val_a = 'a'; // 'a' == 97 (ASCII code)
int answer = 1 << val_a;
The value of answer is 2 when I ran the code through my Java compiler.
So if I'm doing left shifting correctly (which I looked at several online tutorials), it will be 1 * 2^97 which is 1.5845632.... I tried 'b' (ascii code is 98) 1 * 2^98 which is 3.16912650... and the value of the answer is 4 and so forth with 'c', 'd' ...
I'm not sure how to arrive at those answers.
Thanks in advance!