I have the number 20 (0x14) stored in a 32-bit register. The register is allocated to a C float variable representing the value 2.8e-44. Now I want to get the hexadecimal re
You can directly cast it to integer as;
float a = 7.4; int b = a; // this will be rounded to 7 and you will lose information
Or you can use some built-int functions like round, ceil, floor etc.
For reference: http://www.cplusplus.com/reference/cmath/round/?kw=round