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
This commit is contained in:
Kurtis Rader
2016-05-02 20:53:48 -07:00
parent 3ad5c7c289
commit d97c22df2d
6 changed files with 74 additions and 21 deletions

8
tests/math.out Normal file
View File

@@ -0,0 +1,8 @@
1
1
1
1.666
4
4
2
.499999