Skip to content

Commit b64e057

Browse files
committed
tests/float/string_format: Add testcase for incorrect rounding for %f.
1 parent 9aaccd4 commit b64e057

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/float/string_format.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def test(fmt, *args):
3232
# The following fails right now
3333
#test("{:10.1}", 0.0)
3434

35+
print("%.0f" % (1.750000 % 0.08333333333))
36+
# Below isn't compatible with single-precision float
37+
#print("%.1f" % (1.750000 % 0.08333333333))
38+
#print("%.2f" % (1.750000 % 0.08333333333))
39+
#print("%.12f" % (1.750000 % 0.08333333333))
40+
3541
def test_fmt(conv, fill, alignment, sign, prefix, width, precision, type, arg):
3642
fmt = '{'
3743
if conv:

0 commit comments

Comments
 (0)