K
Kenneth Brody
Gaurav said:Hi,
I want to convert a floating point number (or a decimal number say
123.456) into binary notation using a C program. Can somebody help me
out with it?
float MyNum = 123.456;
Gaurav said:Hi,
I want to convert a floating point number (or a decimal number say
123.456) into binary notation using a C program. Can somebody help me
out with it?
Gaurav Verma said:I want to convert a floating point number (or a decimal number say
123.456) into binary notation using a C program. Can somebody help me
out with it?
Gaurav said:Hi,
I want to convert a floating point number (or a decimal number say
123.456) into binary notation using a C program. Can somebody help me
out with it?
Thanks
Gaurav
Nicolas said:unsigned char comp_mask = 0x1 << ((sizeof(char) * 8) -1);
char* bin_rep = malloc(sizeof(char) * sizeof(char) * 8 + 1);
pete said:Those statements won't do what you want, unless CHAR_BIT equals 8.
sizeof(char) always equals 1, so it's a little strange to use
sizeof(char) as a multiplicand in an expression.
If 8 is replaced by CHAR_BIT, then the 0x1 expression, would
also have to be replaced by one with an unsigned type, like 1u.
Hi,
I want to convert a floating point number (or a decimal number say
123.456) into binary notation using a C program. Can somebody help me
out with it?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.