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
64dc925c
Commit
64dc925c
authored
Jan 05, 2017
by
Rami Ali
Committed by
Damien George
Jan 05, 2017
Browse files
tests/float: Improve formatfloat.c test coverage using Python.
parent
ec72db8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
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
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