mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
10 lines
248 B
Python
10 lines
248 B
Python
|
|
import math
|
||
|
|
from unittest import TestCase
|
||
|
|
|
||
|
|
import json
|
||
|
|
|
||
|
|
class TestFloat(TestCase):
|
||
|
|
def test_floats(self):
|
||
|
|
for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]:
|
||
|
|
self.assertEquals(float(json.dumps(num)), num)
|