1. About BC
BC is a discretionary precision calculator language, usually under Linux as a calculator, easy to use. Equivalent to a calculator under Windows.
2. Supported operators
Main Mathematical Operations: + addition-Subtraction * Multiplication/division ^ exponent% remainder
expressions, logical operations, and mathematical functions are also supported.
3. Use
Enter BC under Linux
Then enter the operation, press ENTER to output the result of the operation
2+573*4127-252^386%513/40
In the example above, 3/4 is 0.BC the default output is an integer, to display the decimal point, set by Scale=number, number is the digit after the decimal point.
scale=33/4.750
Ability to enter multiple operations at once, according to semicolons, to separate, press ENTER to return once.
2+5;3*4;3*100712300
Numerical comparison
3 > 403 > 21
Logical Expressions
(3> 2) | | (1 < 2) 1 (3> 2) && (1 > 2) 0
Enter quit to exit
3. Through the pipeline
BC supports incoming parameters. Use the pipeline below to try it out.
$ echo "3+4" | Bc7
semicolon; separate input multiple
$ echo "3/4;SCALE=3;3/4" | BC 0.750
Address: http://blog.csdn.net/yonggang7/article/details/37317571
Easy-to-use calculator under Linux BC