bc(1)bc(1)
NAME
bc -
SYNOPSIS
bc
DESCRIPTION
bc is an interactive processor for a language that resembles C but provides
Options:
bc recognizes the following
Program Syntax:
La single letter in the range a through z; E expression;
S statement;
R relational expression.
Comments:
Comments are enclosed in /* and */.
Names:
Names include:
simple variables: L
array elements: L [ E ]
The words ibase,obase, and scale stacks: L
Other Operands
Other operands include:
Arbitrarily long numbers with optional sign and decimal point.
( E ) |
|
sqrt ( E ) |
|
length ( E ) | number of signi®cant decimal digits |
scale ( E ) | number of digits right of decimal point |
L ( E , ... , E ) |
|
Strings of ASCII characters enclosed in quotes ( " ).
Arithmetic Operators:
Arithmetic operators yield an E as a result and include:
+ | - * / % Ã | ( % is remainder (not mod, see below); Ã is power). |
++ | - - | (pre®x and append; apply to names) |
=+=
Relational Operators
Relational operators yield an R when used as E op E:
== <= >= != < >
b
− 1 − | Section 1−41 |