how do I convert float and double data types to binary. For float, ive used the function
Code :Integer.toBinaryString(Float.floatToRawIntBits(value));
But the answer doesnt seem to be right.
Please suggest.
Printable View
how do I convert float and double data types to binary. For float, ive used the function
Code :Integer.toBinaryString(Float.floatToRawIntBits(value));
But the answer doesnt seem to be right.
Please suggest.
Your question is not clear. What do you try to achieve? What do you mean by converting to binary? The data is already in binary format in memory. All the data inside a computer is binary.
Do you want to display it as binary? In this case how do you know what you get is not right? Give us an example.