multiprocessing.Value doesn't store float correctly
问题 I try to asign a float to the multiprocessing.Value shared ctype as follows: import multiprocessing import random test_float = multiprocessing.Value('f', 0) i = random.randint(1,10000)/(random.randint(1,10000)) test_float.value = i print("i: type = {}, value = {}".format(type(i), i)) print("test_float: type = {}, value = {}".format(type(test_float.value), test_float.value)) print("i == test_float: {}".format(i == test_float.value)) However, the float stored in multiprocessing.Value is != the