0

How to convert float to hex ?

No library please, i want to understand how can i do it from scratch.

30th Jun 2021, 11:33 AM
Abhay
Abhay - avatar
3 Answers
+ 2
Something like this..? first cast float to int and do the normal steps for converting from decimal to hex. https://code.sololearn.com/cUE84UX89cNY/?ref=app
30th Jun 2021, 12:05 PM
RKK
RKK - avatar
+ 2
https://code.sololearn.com/c74ARwKbl0Wn/?ref=app
30th Jun 2021, 12:06 PM
Slick
Slick - avatar
+ 1
Slick rkk ty both , dec to hex isn't a problem for me . I really mean how can i do it for a float type number . Articles that i went through look much complicated to me like taking into account mantissa and exponent , so i thought maybe i should ask here . Anyway tyvm!
30th Jun 2021, 9:19 PM
Abhay
Abhay - avatar