# Requires floatx lib from exams installed 
from floatX import IEEEHelper
from floatX import float2hexr

val = float("2.625")
e = 4
m = 4
x = float2hexr(val,e,m)
hex_width = (e+m+1)//4 if (e+m+1)%4 == 0 else ((e+m+1)//4)+1
ans = "{0:#0{1}x}".format(x,hex_width)
print(ans)
ans = "{0:0{1}b}".format(x,e+m+1)
print(ans)
