


The first line of input contains the ‘T’ number of test cases.
The first line of each test case contains a real number ‘N’ between 0 and 1 (e.g., 0.72) as a double.
For each test case, print the binary representation in form of a string in case the number cannot be represented accurately in binary with at most 32 characters, return string as “ERROR”.
You don’t have to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 100000
0 <= N < 1
Time Limit: 1 sec
We multiply our number until it is less than 1 or the length is smaller than 32 bits.
Repeat until our number is greater than 0 and in case of string length exceeding
‘32’
Characters return string as “ERROR”.
We instead of multiplying the number by ‘2’ and comparing it to ‘1’, we can compare our number to ‘0.5’, then ’0.25’, and so on.
Repeat until our number ‘num’ is greater than 0 and in the case of a string, length exceeds
‘32’
characters return string as “ERROR”.