bc 任意精度的计算器语言
语法格式:bc【option】 bc [选项] 
注意:bc 命令及后面的选项中,每个元素之间都要至少要有一个空格
选项说明:
| 参数选项 | 解释说明 | 
|---|---|
| -l | 定义标准数学库,如:正切函数 | 
| -c | 仅通过编译。 bc命令的输出被发送到标准输出 | 
| -i | 强制交互模式 | 
案例一:
bc 运算符
加法:+
减法:-
乘法:*
除法:/
指数:^
余数:%
案例二:
保留小数与退出
案例三:
文本行计算圆周率保留100位小数
附加:函数相关内容
MATH LIBRARY
The math library defines the following functions:
   s (x)  The sine of x, x is in radians.
   c (x)  The cosine of x, x is in radians.
   a (x)  The arctangent of x, arctangent returns radians.
   l (x)  The natural logarithm of x.
   e (x)  The exponential function of raising e to the value x.
   j (n,x)The Bessel function of integer order n of x.案例四:
计算文件中的式子并返回结果
原文:http://blog.51cto.com/12384628/2159919