Sum of two “np.longdouble”s yields big numerical error
问题 Good morning, I'm reading two numbers from a FITS file (representing the integer and floating point parts of a single number), converting them to long doubles (128 bit in my machine), and then summing them up. The result is not as precise as I would expect from using 128-bit floats. Here is the code: a_int = np.longdouble(read_header_key(fits_file, 'I')) print "I %.25f" % a_int, type(a_int) a_float = np.longdouble(read_header_key(fits_file, 'F')) print "F %.25f" % a_float, a_float.dtype a = a