This already supported by to_str(), but probably could be done more efficiently:
>>> f'{gmpy2.mpfr(1.1):.15b}'
'1.000110011001101p+0'
>>> mpmath.libmp.to_str(x._mpf_, 16, base=2, show_zero_exponent=True, binary_exp=True)[2:]
'1.000110011001101p+0'
For compatibility with gmpy2/MPFR we could utilize same "b" format type.
This already supported by
to_str(), but probably could be done more efficiently:For compatibility with gmpy2/MPFR we could utilize same "b" format type.