I am trying to do something like as below
#include <stdio.h>
int main() {
float a = 0b00000100;
float b = 0b0.0110; // this line is not working
printf("The value of first float is = %f\n", a * 15);
printf("The value of second float is = %f\n", b);
return 0;
}
My only goal here is to assign b with the fractional binary number which is 0.0110 and should result in 0.375. Anyone any idea?
I quickly made this code:
Prints:
As you may notice, it isn't really robust, but it does the job for it's expected parameters.