终端下开启计算器
$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
设置精度
通过scale=2
可以设置为2位小数
介绍
bc - An arbitrary precision calculator language
- 支持脚本输入
- 支持文件脚本,如
bc calc.txt
- 退出,
quit