aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/math.in
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-02 20:53:48 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-03 19:29:04 -0700
commitd97c22df2daaeca6c2cec7f513babb667618f1f0 (patch)
tree736ca60214fe8745b4cb01e23921b1cc5e542479 /tests/math.in
parent3ad5c7c2890dca8e75bd116c17d7d9fe5c9ec608 (diff)
add floating point output to `math` command
This makes it easy for the user to request floating point output with the desired number of digits after the decimal point (not to be confused with significant digits). Note that this is just a thin wrapper so someone can say `math -s3 10 / 3` rather than `math "scale=3; 10 /3"`. Resolves #1643
Diffstat (limited to 'tests/math.in')
-rw-r--r--tests/math.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/math.in b/tests/math.in
new file mode 100644
index 00000000..d8cb5092
--- /dev/null
+++ b/tests/math.in
@@ -0,0 +1,9 @@
+math 3 / 2
+math 10/6
+math -s0 10 / 6
+math -s3 10/6
+math '10 % 6'
+math -s0 '10 % 6'
+math '23 % 7'
+math -s6 '5 / 3 * 0.3'
+true