summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/string_format_modulo3.py
diff options
context:
space:
mode:
authorRami Ali <flowergrass@users.noreply.github.com>2017-01-05 11:06:12 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-05 12:31:05 +1100
commit64dc925c4afad63bc5c8a6017d969abbab1d2ac5 (patch)
tree599d4861c4878ea150bce964b2a7c94f53d4e919 /tests/float/string_format_modulo3.py
parentec72db8a398f82fb694dc01c7081232286e72c3f (diff)
downloadmicropython-64dc925c4afad63bc5c8a6017d969abbab1d2ac5.tar.gz
micropython-64dc925c4afad63bc5c8a6017d969abbab1d2ac5.zip
tests/float: Improve formatfloat.c test coverage using Python.
Diffstat (limited to 'tests/float/string_format_modulo3.py')
-rw-r--r--tests/float/string_format_modulo3.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/float/string_format_modulo3.py b/tests/float/string_format_modulo3.py
new file mode 100644
index 0000000000..5639647865
--- /dev/null
+++ b/tests/float/string_format_modulo3.py
@@ -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