Hi i want to convert a long integer to binary but the problem is i want a fixed 16 bit binary result after conversion like if i convert 2 to 16 bit binary it should give me
I had to do it for a 32 bit number and ended up with:
String stringWord = Long.toBinaryString(word); while (stringWord.length() < 32) // ensure that length of word is 32 stringWord = "0" + stringWord;