Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
64dc925c
Commit
64dc925c
authored
Jan 05, 2017
by
Rami Ali
Committed by
Damien George
Jan 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/float: Improve formatfloat.c test coverage using Python.
parent
ec72db8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
tests/float/string_format_modulo.py
tests/float/string_format_modulo.py
+2
-0
tests/float/string_format_modulo3.py
tests/float/string_format_modulo3.py
+4
-0
tests/float/string_format_modulo3.py.exp
tests/float/string_format_modulo3.py.exp
+3
-0
No files found.
tests/float/string_format_modulo.py
View file @
64dc925c
...
...
@@ -42,3 +42,5 @@ print(('%.40g' % 1e-1)[:2])
print
((
'%.40g'
%
1e-2
)[:
2
])
print
((
'%.40g'
%
1e-3
)[:
2
])
print
((
'%.40g'
%
1e-4
)[:
2
])
print
(
"%.0g"
%
1
)
# 0 precision 'g'
tests/float/string_format_modulo3.py
0 → 100644
View file @
64dc925c
# uPy and CPython outputs differ for the following
print
(
"%.1g"
%
-
9.9
)
# round up 'g' with '-' sign
print
(
"%.1e"
%
9.99
)
# round up with positive exponent
print
(
"%.1e"
%
0.999
)
# round up with negative exponent
tests/float/string_format_modulo3.py.exp
0 → 100644
View file @
64dc925c
-10
1.00e+01
1.00e-00
Write
Preview
Markdown
is supported
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