Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
b64e0575
Commit
b64e0575
authored
Nov 22, 2015
by
Paul Sokolovsky
Browse files
tests/float/string_format: Add testcase for incorrect rounding for %f.
parent
9aaccd47
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/float/string_format.py
View file @
b64e0575
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment