01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BC ( l ) BC ( l )<br />

NAME<br />

be - arbitrary-precision arithmetic language<br />

SYNOPSIS<br />

be [ -c ] [ - 1 ] [ file ... ]<br />

DESCRIPTION<br />

Be is an interactive processor for a language that resembles C but<br />

provides unlimited precision arithmetic. It takes input from any<br />

files given, then reads the standard input. The -1 argument<br />

stands for the name of an arbitrary precision math library. The<br />

syntax for be programs is as follows; L means Jetter a-z, E means<br />

expression, S means statement.<br />

Comments<br />

Names<br />

are enclosed in I • and • f.<br />

simple variables: L<br />

array elements: L [ E ]<br />

The words "ibase", "obase", and "scale"<br />

Other operands<br />

arbitrarily long numbers with optional sign and decimal<br />

point.<br />

(E)<br />

sqrt (E)<br />

length ( E)<br />

scale ( E)<br />

L(E, ... ,E)<br />

number of significant decimal digits<br />

number of digits right of decimal point<br />

Operators<br />

+ - • I % A (% is remainder; A is power)<br />

++ -- (prefix and postfix; apply to names)<br />

== < = > = I= <br />

==+ =- =• =I =% =<br />

Statements<br />

E<br />

{ s ; ... ; s }<br />

if ( E) S<br />

while (E) S<br />

for ( E ; E ; E ) S<br />

null statement<br />

break<br />

quit<br />

Function definitions<br />

define L ( L , ... , L ) {<br />

auto L, ... , L<br />

S; ... S<br />

return ( E)<br />

}<br />

Functions in -1 math library<br />

s(x) sine<br />

c(x) cosine<br />

e(x) exponential<br />

- 1-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!