Permalink
Browse files

tests/float: Improve formatfloat.c test coverage using Python.

  • Loading branch information...
1 parent ec72db8 commit 64dc925c4afad63bc5c8a6017d969abbab1d2ac5 @flowergrass flowergrass committed with dpgeorge Jan 5, 2017
@@ -42,3 +42,5 @@
print(('%.40g' % 1e-2)[:2])
print(('%.40g' % 1e-3)[:2])
print(('%.40g' % 1e-4)[:2])
+
+print("%.0g" % 1) # 0 precision 'g'
@@ -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
@@ -0,0 +1,3 @@
+-10
+1.00e+01
+1.00e-00

0 comments on commit 64dc925

Please sign in to comment.