2015-12-12 23:37:45 +03:00
|
|
|
# bc
|
|
|
|
|
|
|
|
> Calculator.
|
|
|
|
|
2016-11-21 19:33:08 +03:00
|
|
|
- Run calculator in interactive mode using the standard math library:
|
2016-11-01 02:37:05 +03:00
|
|
|
|
|
|
|
`bc -l`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Calculate the result of an expression:
|
2015-12-12 23:37:45 +03:00
|
|
|
|
|
|
|
`bc <<< "(1 + 2) * 2 ^ 2"`
|
|
|
|
|
2017-02-26 02:48:24 +03:00
|
|
|
- Calculate expression and force number of decimal places to 10:
|
2015-12-12 23:37:45 +03:00
|
|
|
|
|
|
|
`bc <<< "scale=10; 5 / 3"`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Calculate expression with sine and cosine using mathlib:
|
2015-12-12 23:37:45 +03:00
|
|
|
|
|
|
|
`bc -l <<< "s(1) + c(1)"`
|