System Grab Bag

View all TLDR pages from Mac OS X (or from all pages)

bc

An arbitrary precision calculator language. See also: dc. More information: https://manned.org/man/freebsd-13.0/bc.1.
  • Start an interactive session:
    bc
  • Start an interactive session with the standard math library enabled:
    bc --mathlib
  • Calculate an expression:
    bc --expression='{{5 / 3}}'
  • Execute a script:
    bc {{path/to/script.bc}}
  • Calculate an expression with the specified scale:
    bc --expression='scale = {{10}}; {{5 / 3}}'
  • Calculate a sine/cosine/arctangent/natural logarithm/exponential function using mathlib:
    bc --mathlib --expression='{{s|c|a|l|e}}({{1}})'

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.

Other Projects

This TLDR page is also found in other projects: