This is how to convert int to Binary:
public class Class1 {
public static void main(String[] args) {
int myInt = 1;
System.out.println(Integer.toBinaryString(myInt));
Type: Posts; User: JavaPF
This is how to convert int to Binary:
public class Class1 {
public static void main(String[] args) {
int myInt = 1;
System.out.println(Integer.toBinaryString(myInt));
The above code is what you need to convert a float to binary. I'm not sure why this is not working for you?
Also, take a look at:
Float.parseFloat]Float (Java 2 Platform SE v1.4.2)()