Bc Programming Language
bc, for basic calculator, is "an arbitrary precision calculator language" with syntax similar to the C programming language. bc is typically used as either a mathematical scripting language or as an interactive mathematical shell.
A typical interactive usage is typing the command bc
on a Unix command prompt and entering a mathematical expression, such as (1 + 3) * 2, whereupon 8 will be output. While bc can work with arbitrary precision, it actually defaults to zero digits after the decimal point - so the expression 2/3 yields 0. This can surprise new bc users unaware of this fact. The "-l" option to bc sets the default scale (digits after the decimal point) to 20, and adds several additional mathematical functions to the language.
Bc first appeared in Version 6 Unix in 1975, and was written by Robert Morris and Lorinda Cherry of Bell Labs. Bc was preceded by dc, an earlier arbitrary precision calculator written by the same authors. Dc could do arbitrary-precision calculations, but its reverse polish notation syntax was inconvenient for users, and therefore Bc was written as a front-end to Dc. 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 reverse polish notation, and piped the results through dc.
In 1991, POSIX rigorously defined and standardized bc. 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. The second is the free software GNU bc, first released in 1991 by Philip A. Nelson. The GNU implementation has numerous extensions beyond the POSIX standard, and is no longer a front-end to dc (it is a bytecode interpreter).
Read more about Bc Programming Language: POSIX Bc, Plan 9 Bc, GNU Bc, Example Code, Calculating Pi To 10000 Places, A Translated C Function, Using Bc in Shell Scripts
Famous quotes containing the words programming and/or language:
“If there is a price to pay for the privilege of spending the early years of child rearing in the drivers seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.”
—Melinda M. Marshall (20th century)
“I suggested to them also the great desirability of a general knowledge on the Island of the English language. They are under an English speaking government and are a part of the territory of an English speaking nation.... While I appreciated the desirability of maintaining their grasp on the Spanish language, the beauty of that language and the richness of its literature, that as a practical matter for them it was quite necessary to have a good comprehension of English.”
—Calvin Coolidge (18721933)