Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idealvin/bc
some useful math functions for linux calculator bc
https://github.com/idealvin/bc
bc calculator cos sin
Last synced: about 2 months ago
JSON representation
some useful math functions for linux calculator bc
- Host: GitHub
- URL: https://github.com/idealvin/bc
- Owner: idealvin
- Created: 2017-08-28T08:10:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-06T10:01:51.000Z (over 3 years ago)
- Last Synced: 2024-05-02T03:14:08.218Z (8 months ago)
- Topics: bc, calculator, cos, sin
- Size: 7.81 KB
- Stars: 22
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# some useful math functions for linux calculator bc
## usage
Put `bcrc` somewhere such as ~/.bcrc, then start bc as follows:
```sh
# you may add an alias to your bashrc file:
# alias bc='bc ~/.bcrc -l -q'
bc ~/.bcrc -l
```## supported functions
### trigonometric functions
```sh
sin(x), cos(x), tan(x), cot(x), sec(x), csc(x)
```### inverse trigonometric functions
```sh
arcsin(x), arccos(x), arctan(x), arccot(x), arcsec(x), arccsc(x)or asin(x), acos(x), atan(x), acot(x), asec(x), acsc(x)
```### logarithmic function
```sh
log(a, b)
ln(x) # log(e, x)
lg(x), log10(x) # log(10, x)
log2(x) # log(2, x)
```### others
```sh
e(x), exp(x) # exponentiation of e
pow(a, b) # a ^ b
sqrt(x) # x ^ 1/2
cbrt(x) # x ^ 1/3
abs(x) # absolute value of x
fac(n) # factorial of n
c(n, k) # n choose k, unordered
a(n, k) # n choose k, ordered
deg(rad) # Radians to degrees
rad(deg) # Degrees to radians
```