1# test builtin hash function with float args 2 3# these should hash to an integer with a specific value 4for val in ( 5 "0.0", 6 "-0.0", 7 "1.0", 8 "2.0", 9 "-12.0", 10 "12345.0", 11): 12 print(val, hash(float(val))) 13 14# just check that these values are hashable 15for val in ( 16 "0.1", 17 "-0.1", 18 "10.3", 19 "0.4e3", 20 "1e16", 21 "inf", 22 "-inf", 23 "nan", 24): 25 print(val, type(hash(float(val)))) 26