summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/string_format.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-22 18:08:49 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-22 18:08:49 +0200
commitb64e0575fd5c30900c4576185edee26f5e2c54f0 (patch)
treeda6ecc947a6f0ccb987ab037b01894f1b2154c34 /tests/float/string_format.py
parent9aaccd4735d60798963212d72989a9b9d852fc6d (diff)
downloadmicropython-b64e0575fd5c30900c4576185edee26f5e2c54f0.tar.gz
micropython-b64e0575fd5c30900c4576185edee26f5e2c54f0.zip
tests/float/string_format: Add testcase for incorrect rounding for %f.
Diffstat (limited to 'tests/float/string_format.py')
-rw-r--r--tests/float/string_format.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/float/string_format.py b/tests/float/string_format.py
index b605f20978..a964cfee72 100644
--- a/tests/float/string_format.py
+++ b/tests/float/string_format.py
@@ -32,6 +32,12 @@ test("{:06e}", float("nan"))
# The following fails right now
#test("{:10.1}", 0.0)
+print("%.0f" % (1.750000 % 0.08333333333))
+# Below isn't compatible with single-precision float
+#print("%.1f" % (1.750000 % 0.08333333333))
+#print("%.2f" % (1.750000 % 0.08333333333))
+#print("%.12f" % (1.750000 % 0.08333333333))
+
def test_fmt(conv, fill, alignment, sign, prefix, width, precision, type, arg):
fmt = '{'
if conv: