Sort a byte if selection in highest-lowest value, tested on both python & java
# Java(TM) SE Runtime Environment (build 13.0.2+8)
javac bytesorter.java
java bytesorter
byte byteVar = 0b0101;
if (( byteVar & 0b0001 ) == 0b0001 ) {}
else if (( byteVar & 0b0010 ) == 0b0010 ) {}
else if (( byteVar & 0b0011 ) == 0b0011 ) {}
else if (( byteVar & 0b0100 ) == 0b0100 ) {}
else if (( byteVar & 0b0111 ) == 0b0111 ) {} // This returns true even though
else if (( byteVar & 0b0101 ) == 0b0101 ) {} // This one is more accurate
else if (( byteVar & 0b0110 ) == 0b0110 ) {}
else if (( byteVar & 0b1000 ) == 0b1000 ) {}
if (( byteVar & 0b0001 ) == 0b0001 ) {}
else if (( byteVar & 0b0010 ) == 0b0010 ) {}
else if (( byteVar & 0b0011 ) == 0b0011 ) {}
else if (( byteVar & 0b0100 ) == 0b0100 ) {}
else if (( byteVar & 0b0101 ) == 0b0101 ) {}
else if (( byteVar & 0b0110 ) == 0b0110 ) {}
else if (( byteVar & 0b0111 ) == 0b0111 ) {}
else if (( byteVar & 0b1000 ) == 0b1000 ) {}