I am writing a program to implement this without using any built in function from C++. I am having some trouble figuring out how to find the decimal value and exponent for very small numbers like 0.25 0.15 0.0 etc. I need to convert my float to binary and then to hexadecimal because of my program spec.

From what I can understand to find out my exponent and decimal value for 32-bits hexadecimal, I convert the integer part of my float to binary, and its exponent is the number of digit - 1. Then my decimal value would be the offset 127 + the exponent. My decimal value in binary will be my exponent field and part of my 32 bits string.

This works only for large number, but for small numbers that requires negative exponent, I have no clue on how that works. Is there an easy systematic way that I can find this out?