i will give you an example in converting an integer to binary:

the number 245 = 11110101 in binary notation.

i got the answer by algorithm that translate 245 to binary.

i want to write an algorithm for float numbers.

as i will put 12.34 and get its binary notation.

that's it.

But ints and floats are 2 completely different kettle of fish. Your int (value 245) is actually held in memory in the binary notation you give 11110101.

However the binary notation of the float 12.34 is

1100.010101110000101000111101011100001010001111010 111

But 12.34 in a double variable is held in memory as

10101110 01000111 11100001 01111010

00010100 10101110 00101000 01000000

and 12.34 in a float variable is held in memory as

10100100 01110000 01000101 01000001

So the question is which one are you trying to calculate?