summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/float2int.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-12-30 00:22:10 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-12-30 00:22:50 +0200
commit12033df511a5a5f0237a764379aacfbceb6c45dd (patch)
tree226ec32b42cfa23f51ce55e3b82a03b08e46714b /tests/float/float2int.py
parente3fa8278b45447b9e099e896bb24a84bb79e4cf0 (diff)
downloadmicropython-12033df511a5a5f0237a764379aacfbceb6c45dd.tar.gz
micropython-12033df511a5a5f0237a764379aacfbceb6c45dd.zip
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.
Diffstat (limited to 'tests/float/float2int.py')
-rw-r--r--tests/float/float2int.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/float/float2int.py b/tests/float/float2int.py
new file mode 100644
index 0000000000..59d904e58a
--- /dev/null
+++ b/tests/float/float2int.py
@@ -0,0 +1,5 @@
+# This case occurs with time.time() values
+print(int(1418774543.))
+
+# TODO: General case with large exponent
+#print(int(2.**100))