This is based on a discussion in SymPy
I think round should return an mpf rather then a float. Consider:
>>> mp.dps = 64
>>> x = mpmath.mpf('0.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666')
>>> round(x, 48) # is not going to give 48 digits
0.6666666666666666
>>> repr(_) # its a float
'0.6666666666666666'
The current implementation of __round__ just converts to float and rounds there. I think we can do better---and are allowed to in Python 3.
This is based on a discussion in SymPy
I think
roundshould return an mpf rather then afloat. Consider:The current implementation of
__round__just converts tofloatand rounds there. I think we can do better---and are allowed to in Python 3.