Bc (programming language): Difference between revisions

Content deleted Content added
Mdmi (talk | contribs)
Identify Cherry as sole author of bc. Remove editorial comment about RPN. Rearrange text for stylistic reasons.
Overview: Added: results are truncated, not rounded.
Line 20:
 
==Overview==
A typical interactive usage is typing the command <code>bc</code> on a [[Unix]] [[Command-line interface#Command prompt|command prompt]] and entering a mathematical expression, such as {{code|(1 + 3) * 2}}, whereupon {{samp|8}} will be output. While bc can work with arbitrary precision, it actually defaults to zero digits after the decimal point, so the expression {{code|2/3}} yields {{samp|0}} (results are truncated, not rounded). This can surprise new bc users unaware of this fact. The {{code|-l}} option to bc sets the default ''scale'' (digits after the decimal point) to 20 and adds several additional mathematical functions to the language.
 
==History==