floating binary to decimal converter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

floating binary to decimal converter

I made this program for converting integer type binary to decimal like 1011.For that the power of multiplying 2 is increasing as 1*2^3+0*2^2+1*2^1+1*2^0. But for floating type binaries the power of multiplying 2 will gradually decrease as, for 10.11 it will 1*2^1+0*2^0+1*2^-1+1*2^-2. Please suggest me the idea...... https://code.sololearn.com/cgS6LV1KRt7C/?ref=app

1st Jul 2017, 8:15 PM
Arkojit Das
Arkojit Das - avatar
1 Answer
+ 1
The floating point coding is a bit more complex than integer (you code a sign, a coefficient and a significant). The most popular coding is define by the IEEE 754 standard. See https://en.m.wikipedia.org/wiki/Decimal_floating_point for more information.
1st Jul 2017, 8:36 PM
samuel delepoulle
samuel delepoulle - avatar