bc

.bcBC - Arbitrary Precision Calculator Language

AT&T Bell Laboratories · 1970s

Developer
AT&T Bell Laboratories
Category
Programming
MIME Type
text/plain
First Released
1970s
Open Format
Yes
File Signature
N/A
At a Glance
.bc
BC - Arbitrary Precision Calculator Language

.bc files contain scripts for the bc arbitrary-precision calculator, primarily used for command-line mathematical computations.

Reviewed on July 29, 2026
Compression
Plain text
Transparency
N/A
Editability
High
Best for
Mathematical scripting

Key Features

  • Supports arbitrary precision arithmetic.
  • Includes basic control flow and functions.
  • Designed for command-line execution.
  • Plain text format, easily editable.

Best For

  • Precise mathematical calculations beyond standard floating-point limits.
  • Scripting mathematical operations for automation.
  • Command-line users needing a powerful calculator.
  • Environments where shell scripting is common.

Less Ideal For

  • Storing general text documents or notes.
  • Creating user-friendly graphical interfaces.
  • Sharing complex mathematical models visually.
  • Executable programs intended for direct user interaction.

Common Use Cases

  • Performing complex mathematical calculations on the command line.
  • Writing scripts for scientific or engineering computations.
  • Automating repetitive mathematical tasks.
  • Teaching or demonstrating programming concepts with a calculator interface.

How to Open It

  1. Open a terminal or command prompt.
  2. Use the command `bc <your_script.bc>` to execute the script.
  3. Alternatively, type `bc` to enter interactive mode, then use `load "your_script.bc"` to load commands.

What is a .bc file?

The .bc file extension typically refers to scripts written for the 'bc' (basic calculator) utility. This is an arbitrary-precision calculator language that can be used for complex mathematical computations, often from the command line. Scripts saved with the .bc extension contain the commands and expressions that the bc interpreter will execute. While it's a powerful tool for mathematical tasks, it's not a widely used format outside of scientific, engineering, or programming contexts due to its command-line nature and specialized syntax.

Programs That Open .bc Files

PlatformProgram
WindowsGit BashFree
WSL (Windows Subsystem for Linux)Free
macOSTerminal (comes with macOS, bc is usually pre-installed)FreeOfficial
LinuxTerminal (most distributions include bc)FreeOfficial

Common Problems with .bc Files

⚠️ Cannot open .bc file directly in a text editor.
BC files are meant to be executed by the 'bc' interpreter, not opened as standard documents. Use a text editor to view or modify the script content.
⚠️ Syntax errors during execution.
Ensure the script adheres to BC's syntax rules. Check for typos, missing semicolons, or incorrect control flow structures.

Frequently Asked Questions

Is .bc a programming language?

Yes, 'bc' is an arbitrary-precision calculator language with scripting capabilities, not a general-purpose programming language like C or Python.

Can I use .bc files for everyday calculations?

While possible, it's generally not practical for simple calculations due to its command-line nature. It's best suited for complex, repetitive, or scriptable mathematical tasks.

What's the difference between `bc` and `dc`?

Both are calculator utilities. `bc` is an algebraic calculator with a more readable syntax, while `dc` (desk calculator) is a reverse-polish notation (RPN) calculator which is more compact and stack-based.

Technical Details

BC scripts are plain text files containing mathematical expressions, control flow statements (like if, for, while), and function definitions. The 'bc' language supports arbitrary precision, meaning it can handle calculations with a virtually unlimited number of digits. The interpreter reads the .bc file and evaluates the expressions sequentially.

Did You Know?

The 'bc' utility is part of the POSIX standard and is available on virtually all Unix-like systems.
It was originally developed as a command-line interface to a more sophisticated calculator program.

Security Information

As .bc files are plain text scripts meant for execution by the 'bc' interpreter, they do not inherently contain malicious code like executables. However, any script can potentially perform unintended actions if not carefully written. Always review scripts from untrusted sources before execution.

Related Extensions