From b64e0575fd5c30900c4576185edee26f5e2c54f0 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Sun, 22 Nov 2015 18:08:49 +0200
Subject: [PATCH] tests/float/string_format: Add testcase for incorrect
 rounding for %f.

---
 tests/float/string_format.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/float/string_format.py b/tests/float/string_format.py
index b605f2097..a964cfee7 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:
-- 
GitLab