Two Implementations of bc ========================= Long ago I discovered the scripting language known as "bc" while looking for a way to make floating point calculations in "bash". I also remember using it for trolling the homework on Quora. But, the implementation in use on FreeBSD is not the one used on Linux. So, someone tried it and got error messages. The one used on Linux is GNU bc, while the one used on FreeBSD is Gavin Howard's bc. In Gavin Howard's implementation there are more functions in the math library. In both, you can add the flag "-s" to process the script exactly by the POSIX standard, where functions and variables name are of one letter only. In both implementation you have to add the math library to add the math function. Use flag "-l" or "--mathlib" to include it. In both implementation the arctangent function is defined, but in Gavin Howard when not using the flag "-s", the arctangent function is called "atan" while in GNU bc, it is called "a". Another difference is that the function "abs" is not defined in GNU bc, but is defined in Gavin Howard's bc. You can also use the exponential notation in Gavine Howard's bc, but not in GNU bc. Arcsines and arccosines are not define. Here's an example of how to calculate an arcsine: #!/usr/bin/bc --mathlib halfpi=2*atan(1) define asin(x){ if (x==1){ return halfpi } if (x==-1){ return -halfpi } return atan(x/sqrt(1-x^2)) } It works in Gavin Howard's bc, but for GNU bc, you will have to change "atan" to "a". Anyways, you can also install "gnubc" on FreeBSD if you want to write scripts that work on Linux. I sonetimes use it for simple calculations when I'm too lazy to open the Python CLI and import "numpy".