[Numpy-discussion] Large numbers into float128
Sat Oct 29 17:55:21 CDT 2011
Can anyone think of a good way to set a float128 value to an
arbitrarily large number?
v = int_to_float128(some_value)
I'm trying things like
v = np.float128(2**64+2)
but, because (in other threads) the float128 seems to be going through
float64 on assignment, this loses precision, so although 2**64+2 is
representable in float128, in fact I get:
In : np.float128(2**64+2)
In : 2**64+2
So - can anyone think of another way to assign values to float128 that
will keep the precision?
Thanks a lot,
More information about the NumPy-Discussion