From 12033df511a5a5f0237a764379aacfbceb6c45dd Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 30 Dec 2014 00:22:10 +0200 Subject: 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. --- tests/float/float2int.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/float/float2int.py (limited to 'tests/float') diff --git a/tests/float/float2int.py b/tests/float/float2int.py new file mode 100644 index 000000000..59d904e58 --- /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)) -- cgit v1.2.3