Clarify math documentation

The words "rounded down" here get us into some trouble.
This commit is contained in:
Fabian Boehm 2022-08-06 10:58:16 +02:00
parent f9786673e3
commit 39fbc27d8d

View file

@ -36,7 +36,7 @@ The following options are available:
**-s** *N* or **--scale** *N*
Sets the scale of the result.
``N`` must be an integer or the word "max" for the maximum scale.
A scale of zero causes results to be rounded down to the nearest integer.
A scale of zero causes results to be truncated, not rounded. Any non-integer component is thrown away.
So ``3/2`` returns ``1`` rather than ``2`` which ``1.5`` would normally round to.
This is for compatibility with ``bc`` which was the basis for this command prior to fish 3.0.0.
Scale values greater than zero causes the result to be rounded using the usual rules to the specified number of decimal places.