tests/float: Improve formatfloat.c test coverage using Python.
This commit is contained in:
parent
ec72db8a39
commit
64dc925c4a
@ -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'
|
||||
|
4
tests/float/string_format_modulo3.py
Normal file
4
tests/float/string_format_modulo3.py
Normal file
@ -0,0 +1,4 @@
|
||||
# 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
|
3
tests/float/string_format_modulo3.py.exp
Normal file
3
tests/float/string_format_modulo3.py.exp
Normal file
@ -0,0 +1,3 @@
|
||||
-10
|
||||
1.00e+01
|
||||
1.00e-00
|
Loading…
x
Reference in New Issue
Block a user