I am talking about JSON conversion, for example:
>>> a = {'asas': 1/7.0} >>> b = json.dumps(a) >>> c = json.loads(b) >>> c {u'asas': 0.14285714285714285} >>> c['asas'] == 1.0/7 True
Is JSON encoding a guarantee not to round a number?
In my How to save a floating point number as text without loss of precision? Mark Dickinson says that repr
does not result in a loss of accuracy. Does json.dumps
repr
?
source share