Bc (programming language): Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Altered title. Added title. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by Grimes2 | #UCB_webform 629/1800
there is a language, but's primarily a program, a tool, software
 
(4 intermediate revisions by 4 users not shown)
Line 1:
{{Short description|UNIXArbitrary-precision utilitycalculator whichsupporting implementsinteractive an arbitrary-precisionand arithmeticscripted languageuse}}{{Not to be confused with|B programming language|C programming language}}{{more footnotes|date=June 2013}}
{{lowercase|title=bc programming language}}
{{Infobox software
Line 17:
| website =
}}
'''bc''', for ''basic calculator'', is "an [[Arbitrary-precision arithmetic|arbitrary-precision]] [[math]]ematical [[calculator]] language"[[computer program|program]] with syntaxan input language similar to the [[C (programming language)|C programming language]]. bcIt issupports typicallyboth usedinteractive, as[[command-line eitherinterface|command-line]] a mathematical scripting language[[user-interface]] or as an interactiveand mathematicalscript shellprocessing.
 
==Overview==
Line 37:
All numbers and variable contents are [[arbitrary-precision]] numbers whose precision (in decimal places) is determined by the global '''<code>scale</code>''' variable.
 
The [[base (exponentiation)radix|numeric base]] of input (in interactive mode), output and program constants may be specified by setting the reserved '''<code>ibase</code>''' (input base) and '''<code>obase</code>''' (output base) variables.
 
Output is generated by deliberately not assigning the result of a calculation to a variable.
Line 134:
 
===GNU bc===
GNU bc derives from the POSIX standard and includes many enhancementsextensions. It is entirely separate from dc-based implementations of the POSIX standard and is instead written in C. Nevertheless, it is fully backwards compatible as all POSIX bc programs will run unmodified as GNU bc programs.
 
GNU bc variables, arrays and function names may contain more than one character, some more operators have been included from C, and notably, an '''<code>if</code>''' clause may be followed by an '''<code>else</code>'''.
Line 258:
* [https://www.gnu.org/software/bc/ GNU bc] (and an [http://alpha.gnu.org/gnu/bc/ alpha version]) from the Free Software Foundation
* [https://web.archive.org/web/20160222234922/http://gnuwin32.sourceforge.net/packages/bc.htm bc for Windows] from [[GnuWin32]]
* [https://git.yzenagithub.com/gavingavinhoward/bc Gavin Howard bc] - another open source implementation of bc by Gavin Howard with GNU and BSD extensions
* [https://web.archive.org/web/20160304084708/http://x-bc.sourceforge.net/ X-bc] - A Graphical User Interface to bc
** [https://web.archive.org/web/20160304092132/http://x-bc.sourceforge.net/extensions_bc.html extensions.bc] - contains functions of trigonometry, exponential functions, functions of number theory and some mathematical constants