macOS
brew install bclocal Homebrew formula metadata
安装
brew install bclocal Homebrew formula metadata
sudo apk add bcAlpine Linux edge package indexes · bc · 来源: dl-cdn.alpinelinux.org
sudo dnf install bcFedora Rawhide package metadata · bc · 来源: dl.fedoraproject.org
nix profile install nixpkgs#bcnixpkgs package indexes · pkgs/by-name/bc/bc/package.nix · 来源: api.github.com
sudo pacman -S bcArch Linux sync databases · bc · 来源: geo.mirror.pkgbuild.com
sudo zypper install bcopenSUSE Tumbleweed package metadata · bc · 来源: download.opensuse.org
scoop install main/bcScoop official bucket manifest trees · bucket/bc.json · 来源: api.github.com
概览
Arbitrary precision numeric processing language
历史
bc is the Unix arbitrary-precision calculator language: small enough to be a command-line calculator, but old and standard enough to appear in scripts, POSIX systems, and package-manager bootstrap sets. GNU bc packages both bc and dc, preserving the classic infix calculator and reverse-polish desk-calculator pairing.
The bc language predates GNU bc as a Unix utility for arbitrary-precision arithmetic. POSIX standardizes bc as an arbitrary-precision arithmetic language with an interactive mode, file operands, and the -l math-library option.
GNU bc is the GNU implementation of that utility family. Its documentation describes bc as an arbitrary-precision numeric processing language and ships dc alongside it, keeping the historical relationship between the higher-level bc language and the lower-level desk calculator.
bc became a portable denominator for shell arithmetic that exceeded the shell's integer facilities or needed decimal scale control. Because POSIX specifies it, distribution packages for bc are common across Unix-like systems, and Homebrew, Debian, Fedora, Arch, Nix, MacPorts, Alpine, and others all carry it.
The GNU package matters especially on systems where the base OS does not include GNU userland behavior by default, such as macOS, and in minimal containers where explicit installation keeps scripts reproducible.
Typical command-line use pipes expressions into bc, invokes bc -l for math functions and a nonzero default scale, or runs bc interactively as a tiny programmable calculator. Scripts use it for decimal arithmetic, base conversion, and calculations where shell integer arithmetic is not enough.
The paired dc executable serves users who prefer reverse-polish notation or need the older stack-calculator language.
bc is a package-nerd fossil with live production value: it is tiny, standardized, scriptable, and still frequently pulled into build images because some old configure script, packaging helper, or shell one-liner expects it.
It sits at an interesting boundary between core utility and optional package. On one machine it is part of the assumed Unix furniture; on another it is the missing dependency that breaks a build with a calculator-shaped hole.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
bc | cli | 全局可执行文件 | |
dc | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://www.gnu.org/software/bc/
安装元数据
| 软件包键 | brew:bc |
|---|---|
| 版本 | 1.08.2 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/bc |
| 主页 | https://www.gnu.org/software/bc/ |
| 上游文档 | https://www.gnu.org/software/bc |
| 许可证 | GPL-3.0-or-later |
| 源码归档 | https://ftpmirror.gnu.org/gnu/bc/bc-1.08.2.tar.gz |
| 构建依赖 | texinfo |
| macOS 提供的库 | flex, libedit |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | bc |
| Version Scheme | 0 |
| Revision | 0 |
| Conflicts With |
|
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | yes |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
bc 1.07.1-4
GNU bc arbitrary precision calculator language
https://www.gnu.org/software/bc/
sudo apt install bcdc 1.07.1-4
GNU dc arbitrary precision reverse-polish calculator
https://www.gnu.org/software/bc/
sudo apt install dcbc
nix profile install nixpkgs#bcbc 1.07.1-3ubuntu4
GNU bc arbitrary precision calculator language
https://www.gnu.org/software/bc/
sudo apt install bcdc 1.07.1-3ubuntu4
GNU dc arbitrary precision reverse-polish calculator
https://www.gnu.org/software/bc/
sudo apt install dcbc 1.08.2-r1
Arbitrary precision numeric processing language (calculator)
https://www.gnu.org/software/bc/bc.html
sudo apk add bcbc-doc 1.08.2-r1
Arbitrary precision numeric processing language (calculator) (documentation)
https://www.gnu.org/software/bc/bc.html
sudo apk add bc-docbc 1.08.2-4.fc44
GNU's bc (a numeric processing language) and dc (a calculator)
https://www.gnu.org/software/bc/
sudo dnf install bcbc 1.08.2-1
An arbitrary precision calculator language
https://www.gnu.org/software/bc/
sudo pacman -S bcbc 1.08.2-1.4
GNU Command Line Calculator
https://www.gnu.org/software/bc/
sudo zypper install bcbc
sudo port install bcmain/bc
scoop install main/bc来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.