Sto parlando di una conversione JSON come:json.dumps è garantito per non perdere la precisione in virgola mobile?
>>> a = {'asas': 1/7.0}
>>> b = json.dumps(a)
>>> c = json.loads(b)
>>> c
{u'asas': 0.14285714285714285}
>>> c['asas'] == 1.0/7
True
è la codifica JSON garantito di non roundoff il numero?
Nel mio How to store a floating point number as text without losing precision?, Mark Dickinson afferma che repr
non causa una perdita di precisione. json.dumps
utilizza repr
?