Files
tldr/pages.zh/common/bc.md
Jin 67166ff0e7 common/a~g*:fix outdated Chinese pages (#14690)
* common/a~g*:fix outdated Chinese pages

* Update airmon-ng.md

* Update aria2c.md

* update chown

* Update ansible-playbook.md

---------

Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2024-11-27 03:20:32 -08:00

34 lines
694 B
Markdown
Raw 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.

# bc
> 任意精度的计算器语言。
> 请参阅:`dc``qalc`。
> 更多信息:<https://manned.org/bc>.
- 启动交互式会话:
`bc`
- 启动交互式会话并启用标准数学库:
`bc --interactive --mathlib`
- 计算表达式:
`echo '{{5 / 3}}' | bc`
- 执行脚本:
`bc {{路径/到/脚本.bc}}`
- 使用指定的小数位数计算一个表达式:
`echo 'scale = {{10}}; {{5 / 3}}' | bc`
- 使用 `mathlib` 计算正弦/余弦/反正切/自然对数/指数函数:
`echo '{{s|c|a|l|e}}({{1}})' | bc --mathlib`
- 执行一个内联的阶乘脚本:
`echo "define factorial(n) { if (n <= 1) return 1; return n*factorial(n-1); }; factorial({{10}})" | bc`