mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-09-24 18:30:25 +03:00
262561ca78
* 'decimal places' used instead of 'precision' * Implicit example of using scale
20 lines
351 B
Markdown
20 lines
351 B
Markdown
# bc
|
|
|
|
> Calculator.
|
|
|
|
- Run calculator in interactive mode using the standard math library:
|
|
|
|
`bc -l`
|
|
|
|
- Calculate the result of an expression:
|
|
|
|
`bc <<< "(1 + 2) * 2 ^ 2"`
|
|
|
|
- Calculate expression and force number of decimal places to 10:
|
|
|
|
`bc <<< "scale=10; 5 / 3"`
|
|
|
|
- Calculate expression with sine and cosine using mathlib:
|
|
|
|
`bc -l <<< "s(1) + c(1)"`
|