1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/bc.md

21 lines
464 B
Markdown
Raw Normal View History

2015-12-12 22:37:45 +02:00
# bc
2021-03-31 12:16:18 +02:00
> An arbitrary precision calculator language.
> More information: <https://manned.org/bc>.
2015-12-12 22:37:45 +02:00
2021-03-31 12:16:18 +02:00
- Start `bc` in interactive mode using the standard math library:
`bc -l`
- Calculate the result of an expression:
2015-12-12 22:37:45 +02:00
`bc <<< "(1 + 2) * 2 ^ 2"`
2021-03-31 12:16:18 +02:00
- Calculate the result of an expression and force the number of decimal places to 10:
2015-12-12 22:37:45 +02:00
`bc <<< "scale=10; 5 / 3"`
2021-03-31 12:16:18 +02:00
- Calculate the result of an expression with sine and cosine using `mathlib`:
2015-12-12 22:37:45 +02:00
`bc -l <<< "s(1) + c(1)"`