Search notes:

Shell command: bc

An arbitrary precision calculator language.

Floating point

Use the -l flag (bc -l) or the scale special variable:
$ bc -q
100/1420000*44200
scale=4
100/1420000*44200
scale=5
3.09400

Using bc in a one-liner for calculations

With a here string, it is possible to calculate the result of an arithmetic expression in a one-liner:
bc <<< "7.3 * 8.2"

See also

Shell commands (such as dc and expr)

Index