
This fixes conversion when float type has more mantissa bits than small int, and float value has small exponent. This is for example the case of 32-bit platform using doubles, and converting value of time.time(). Conversion of floats with larg exponnet is still not handled correctly.
6 lines
130 B
Python
6 lines
130 B
Python
# This case occurs with time.time() values
|
|
print(int(1418774543.))
|
|
|
|
# TODO: General case with large exponent
|
|
#print(int(2.**100))
|