# Bc (programming language)

**bcbc programming languagethe programming language bc**

bc, for basic calculator (often referred to as bench calculator), is "an arbitrary-precision calculator language" with syntax similar to the C programming language.wikipedia

68 Related Articles

### Dc (computer program)

**dcdc calculator**

bc was preceded by dc, an earlier arbitrary-precision calculator written by the same authors.

Traditionally, the bc calculator program (with infix notation) was implemented on top of dc.

### Lorinda Cherry

bc first appeared in Version 6 Unix in 1975 and was written by Robert Morris and Lorinda Cherry of Bell Labs.

Cherry has worked on mathematical tools, such as bc and dc, and co-authored eqn with Brian Kernighan.

### Robert Morris (cryptographer)

**Robert MorrisBob MorrisRobert Morris Sr.**

bc first appeared in Version 6 Unix in 1975 and was written by Robert Morris and Lorinda Cherry of Bell Labs.

Morris's contributions to early versions of Unix include the math library, the bc programming language, the program, and the password encryption scheme used for user authentication.

### Modulo operation

**modulomodmodulus**

The modulus operators, and behave exactly like their C counterparts only when the global variable is set to 0, i.e. all calculations are integer-only.

### Hoc (programming language)

**hochoc programming language**

Instead, the earlier calculator languages dc and bc have become widespread on those systems.

### C (programming language)

**CC programming languageC language**

bc, for basic calculator (often referred to as bench calculator), is "an arbitrary-precision calculator language" with syntax similar to the C programming language.

### Unix

**UNIX operating systemAT&T UnixUnix-like**

A typical interactive usage is typing the command on a Unix command prompt and entering a mathematical expression, such as (1 + 3) * 2, whereupon 8 will be output.

### Command-line interface

**command linecommand-linecommand line interface**

A typical interactive usage is typing the command on a Unix command prompt and entering a mathematical expression, such as (1 + 3) * 2, whereupon 8 will be output.

### Version 6 Unix

**Sixth Edition Unix6th EditionSixth Edition**

bc first appeared in Version 6 Unix in 1975 and was written by Robert Morris and Lorinda Cherry of Bell Labs.

### Bell Labs

**Bell LaboratoriesBell Telephone LaboratoriesAT&T Bell Laboratories**

### Compiler

**compiledcompilerscompile**

bc was a very simple compiler (a single yacc source file with a few hundred lines), which converted the new, C-like, bc syntax into dc's postfix notation and piped the results through dc.

### Yacc

bc was a very simple compiler (a single yacc source file with a few hundred lines), which converted the new, C-like, bc syntax into dc's postfix notation and piped the results through dc.

### Reverse Polish notation

**RPNpostfix notationpostfix**

bc was a very simple compiler (a single yacc source file with a few hundred lines), which converted the new, C-like, bc syntax into dc's postfix notation and piped the results through dc. dc could do arbitrary-precision calculations, but its reverse Polish notation (RPN) syntax was inconvenient for users, and therefore bc was written as a front-end to dc.

### POSIX

**POSIX.1POSIX.2POSIX compatible**

In 1991, POSIX rigorously defined and standardized bc.

### Plan 9 from Bell Labs

**Plan 9Glenda, the Plan 9 BunnyPlan9**

Two implementations of this standard survive today: The first is the traditional Unix implementation, a front-end to dc, which survives in Unix and Plan 9 systems.

### Free software

**freefree-softwarefreely**

The second is the free software GNU bc, first released in 1991 by Philip A. Nelson.

### GNU

**GNU operating systemGNU ProjectThe GNU Project**

The second is the free software GNU bc, first released in 1991 by Philip A. Nelson.

### Variable (computer science)

**variablevariablesscalar**

In this form, the bc language contains single-letter variable, array and function names and most standard arithmetic operators, as well as the familiar control-flow constructs (, and ) from C. Unlike C, an clause may not be followed by an .

### Array data structure

**arrayarraysvector**

In this form, the bc language contains single-letter variable, array and function names and most standard arithmetic operators, as well as the familiar control-flow constructs (, and ) from C. Unlike C, an clause may not be followed by an .

### Subroutine

**functionfunctionssubroutines**

In this form, the bc language contains single-letter variable, array and function names and most standard arithmetic operators, as well as the familiar control-flow constructs (, and ) from C. Unlike C, an clause may not be followed by an .

### Control flow

**looploopscontrol structure**

### Arbitrary-precision arithmetic

**arbitrary-precisionarbitrary precisionbignum**

bc, for basic calculator (often referred to as bench calculator), is "an arbitrary-precision calculator language" with syntax similar to the C programming language.

### Base (exponentiation)

**basebase (mathematics)base 17**

The numeric base of input (in interactive mode), output and program constants may be specified by setting the reserved (input base) and (output base) variables.

### Operator (computer programming)

**operatoroperatorsOperator (programming)**

The following POSIX bc operators behave exactly like their C counterparts: