I need to divide by 2 the short word, for example 0x40 (in dec: 64 ) to 0x20 (in dec: 32). I cannot use int (java card) - only short.
Someone have any idea?
If all you want to do is divide a short by 2 then I'd use a bit shift operator. as in
short a = 8;
a >>= 1; // Shift by one bit is the same as divide by 2
System.out.println(a);