Advertisement
Guest User

Untitled

a guest
Apr 8th, 2014
2,447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1.     public static boolean isMSBSet(int value) {
  2.         boolean ret = false;
  3.         String v = String.format("%x", value);
  4.        
  5.         switch (v.charAt(0)) {
  6.         case 'F':
  7.         case 'f':
  8.         case 'E':
  9.         case 'e':
  10.         case 'C':
  11.         case 'c':
  12.         case 'B':
  13.         case 'b':
  14.         case 'A':
  15.         case 'a':
  16.         case '9':
  17.         case '8':
  18.             ret = true;
  19.         }
  20.  
  21.         ret = (v.length() == 8) && ret;
  22.         return ret;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement