bc: Variables
1
1 2.2 Variables
1 =============
1
1 Numbers are stored in two types of variables, simple variables and
1 arrays. Both simple variables and array variables are named. Names
1 begin with a letter followed by any number of letters, digits and
1 underscores. All letters must be lower case. (Full alphanumeric names
1 are an extension. In POSIX 'bc' all names are a single lower case
1 letter.) The type of variable is clear by the context because all array
1 variable names will be followed by brackets ( [ ] ).
1
1 There are four special variables, SCALE, IBASE, OBASE, and LAST.
1 SCALE defines how some operations use digits after the decimal point.
1 The default value of SCALE is 0. IBASE and OBASE define the conversion
1 base for input and output numbers. The default for both input and
1 output is base 10. LAST (an extension) is a variable that has the value
1 of the last printed number. These will be discussed in further detail
1 where appropriate. All of these variables may have values assigned to
1 them as well as used in expressions.
1