micropython/tests/float/float2int.py
Paul Sokolovsky 12033df511 py: Partially fix float to int conversion.
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.
2014-12-30 00:22:50 +02:00

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))