Files
tldr/pages.zh/common/dc.md

29 lines
777 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# dc
> 一个任意精度计算器。使用逆波兰表示法RPN
> 另请参见:`bc``qalc`。
> 更多信息:<https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html>。
- 开始一个交互会话:
`dc`
- 执行一个脚本:
`dc {{path/to/script.dc}}`
- 以指定的精度计算一个表达式:
`dc --expression='{{10}} k {{5 3 /}} p'`
- 计算4乘54 5 *减去1717 -),并[p]rint输出
`dc --expression='4 5 * 17 - p'`
- 将小数位数指定为77 k计算5除以-35 _3 /)并[p]rint
`dc --expression='7 k 5 _3 / p'`
- 计算黄金比例phi将小数位数设为100100 k5的平方根5 v加11 +除以22 /),并[p]rint结果
`dc --expression='100 k 5 v 1 + 2 / p'`