Friday, October 19, 2012

BC - An arbitrary precision calculator language



bc is a language (and compiler) whose syntax resembles that of C, but with unlimited-precision arithmetic. bc consists of identifiers, keywords, and symbols, which are briefly described in the following entries. Examples are given at the end.
Interactively perform arbitrary-precision arithmetic or convert numbers from one base to another. Input can be taken from files or read from the standard input. To exit, type quit or EOF.

An identifier is a series of one or more characters. It must begin with a lowercase letter but may also contain digits and underscores. No uppercase letters are allowed. Identifiers are used as names for variables, arrays, and functions. Variables normally store arbitrary-precision numbers. Within the same program you may name a variable, an array, and a function using the same letter. The following identifiers would not conflict:
x : Variable x
x[i] : Element i of array x.i can range from 0 to 2047 can also be an expression.
x[y,z] : Call function x with parameter y and z.
 
 

No comments:

Post a Comment

 
IS2C © 2012 Blog's Student | is2c