Skip to content

Instantly share code, notes, and snippets.

@daschl
Created March 3, 2014 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daschl/9322210 to your computer and use it in GitHub Desktop.
Save daschl/9322210 to your computer and use it in GitHub Desktop.
ohne das array zu touchen
int start = 8192;
int toFind = 32768;
int data[] = new int[] {start, 16384, toFind, 65536}; // 2^13, ^14, ^15, ^16
for (int i = 0; i < 4; i++) {
if (start << i == toFind) {
System.out.println(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment