%!PS-Adobe-1.0 %%Creator: devps (Pipeline Associates, Inc.) %%CreationDate: Fri Sep 13 13:03:16 1996 %%Pages: (atend) %%DocumentFonts: (atend) /devps 180 dict def devps begin /res 10.000000 def /y_offset 843 def /X{exch}bind def /mm {transform round X round X itransform} bind def /r{rmoveto}bind def /m{moveto}bind def /l{lineto}bind def /rl{rlineto}bind def /st{stroke}bind def /gs{gsave}bind def /gr{grestore}bind def /cp{currentpoint}bind def /np{newpath}bind def /ct{curveto}bind def systemdict /setpacking known { /savepacking currentpacking def true setpacking } if /m0{0 0 moveto}bind def /xc{//res div}bind def /yc{//res neg div //y_offset add}bind def /lc{yc X xc X l st}bind def /mc{yc X xc X m}bind def /el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def /ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def /sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def /V{//res neg div //y_offset add currentpoint pop X m}bind def /H{//res div 0 transform X round X itransform pop currentpoint X pop moveto}bind def /h{//res div 0 r}bind def /v{//res neg div 0 X r}bind def /S{X H show}bind def /A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def /psize 10 def /height 0 def /cheight { height 0 ne { height } { psize } ifelse } bind def /slant 0 def /FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def /shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fill gr}bind def 1 setlinecap /resolution res 72 mul def /startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def }bind def /clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto }bind def /doclip { llx lly urx ury clipFig } def /endFig { end SavedState restore }bind def /globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def /globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def }bind def /fontnum 1 def systemdict /setpacking known { savepacking setpacking} if end /BP{ save mark devps begin m0 /DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap currentlinejoin currentdash currentgray currentmiterlimit ] cvx def }bind def /EP{ end cleartomark restore showpage}def /R{/Times-Roman FF}def /B{/Times-Bold FF}def /I{/Times-Italic FF}def %%EndProlog %%Page: 1 1 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 9 R 720(N)S 722(NA)S 790(AM)S 858(ME)S 940(E)S 1080 V 10 R 1080(bc)S 1200(-)S 1259(An)S 1407(arbitrary)S 1780(precision)S 2174(calculator)S (language)363 2597 A 1248 V 9 R 720(S)S 722(SY)S 774(YN)S 842(NT)S 910(TA)S 968(AX)S 1036(X)S 1368 V 10 B 1080(bc)S 10 R 1206([)S 10 B 1265(-lws)S 10 R 1464(])S 1523([)S 10 I 1607(\256le)S (...)75 1755 A 10 R 1855(])S 1536 V 9 R 720(V)S 722(VE)S 790(ER)S 848(RS)S 910(SI)S 962(IO)S 995(ON)S 1063(N)S 1656 V 10 R 1080(This)S 1284(man)S 1482(page)S 1697(documents)S (GNU)219 2157 A 2401(bc)S 2521(version)S 2842(1.02.)S 1824 V 9 R 720(D)S 722(DE)S 790(ES)S 848(SC)S 900(CR)S 962(RI)S 1024(IP)S 1057(PT)S 1109(TI)S 1167(IO)S 1200(ON)S 1268(N)S 1944 V 10 B 1080(bc)S 10 R 1221(is)S 1328(a)S (language)363 1413 A 1816(that)S (supports)340 2007 A 2387(arbitrary)S 2775(precision)S 3184(numbers)S 3570(with)S 3789(interactive)S 4255(execution)S 4686(of)S 4811(statements.)S 2064 V 1080(There)S 1350(are)S 1508(some)S (similarities)448 1754 A 2236(in)S 2348(the)S 2505(syntax)S 2801(to)S 2913(the)S 3070(C)S 3171(programming)S (language.)388 3752 A 4174(A)S 4281(standard)S 4656(math)S 4891(library)S 5194(is)S 2184 V 1080(available)S 1470(by)S 1596(command)S 2019(line)S 2197(option.)S 2530(If)S 2625(requested,)S 3063(the)S 3213(math)S 3441(library)S 3737(is)S 3831(de\256ned)S 4154(before)S 4439(processing)S 4896(any)S 5068(\256les.)S 2304 V 10 B 1080(bc)S 10 R 1212(starts)S 1456(by)S 1587(processing)S 2048(code)S 2268(from)S 2494(all)S 2625(the)S 2778(\256les)S 2976(listed)S 3224(on)S 3354(the)S 3507(command)S 3933(line)S 4114(in)S 4222(the)S 4375(order)S 4618(listed.)S 4916(After)S 5160(all)S 2424 V 1080(\256les)S 1274(have)S 1490(been)S 1706(processed,)S 10 B 2154(bc)S 10 R 2281(reads)S 2520(from)S 2742(the)S 2891(standard)S (input.)231 3258 A 3540(All)S 3696(code)S 3913(is)S 4007(executed)S 4392(as)S 4503(it)S 4586(is)S 4680(read.)S (\(If)102 4931 A 5060(a)S 5132(\256le)S 2544 V 1080(contains)S 1440(a)S 1510(command)S 1931(to)S 2034(halt)S 2210(the)S 2358(processor,)S 10 B 2794(bc)S 10 R (will)157 2920 A 3102(never)S 3351(read)S 3550(from)S 3771(the)S 3919(standard)S (input.\))265 4285 A 2712 V 1080(This)S 1292(version)S 1621(of)S 10 B 1738(bc)S 10 R 1872(contains)S 2240(several)S 2559(extensions)S (beyond)295 3017 A (traditional)414 3346 A 10 B 3794(bc)S 10 R 3929(implementations)S 4633(and)S 4812(the)S 4969(POSIX)S 2832 V 1080(draft)S 1302(standard.)S 1724(Command)S 2173(line)S 2355(options)S 2681(can)S 2852(cause)S 3107(these)S 3345(extensions)S 3800(to)S 3909(print)S 4130(a)S 4206(warning)S 4567(or)S 4682(to)S 4791(be)S 4916(rejected.)S 2952 V 1080(This)S 1301(document)S 1739(describes)S 2156(the)S (language)363 2321 A (accepted)353 2726 A 3122(by)S 3265(this)S 3453(processor.)S 3932(Extensions)S (will)157 4416 A 4616(be)S 4754(identi\256ed)S 5177(as)S 3072 V 1080(such.)S 3240 V 870(O)S 872(OP)S 947(PT)S 1005(TI)S 1069(IO)S 1105(ON)S 1180(NS)S 1255(S)S 3360 V 1080(-l)S 1440(De\256ne)S 1734(the)S 1882(standard)S 2248(math)S 2474(library.)S 3528 V 1080(-w)S 1440(Give)S 1661(warnings)S 2055(for)S 2198(extensions)S 2647(to)S 2750(POSIX)S 10 B 3067(bc)S 10 R 3168(.)S 3696 V 1080(-s)S 1440(Process)S 1773(exactly)S 2089(the)S 2237(POSIX)S 10 B 2554(bc)S 10 R (language.)388 2680 A 3864 V 870(N)S 872(NU)S 947(UM)S 1022(MB)S 1113(BE)S 1182(ER)S 1246(RS)S 1315(S)S 3984 V 1080(The)S 1265(most)S 1488(basic)S 1723(element)S 2070(in)S 10 B 2176(bc)S 10 R 2305(is)S 2400(the)S 2551(number.)S 2936(Numbers)S 3333(are)S 3485(arbitrary)S 3861(precision)S 4259(numbers.)S 4684(This)S 4892(precision)S 4104 V 1080(is)S 1174(both)S 1379(in)S 1483(the)S 1632(integer)S 1938(part)S 2121(and)S 2292(the)S 2441(fractional)S 2854(part.)S 3087(All)S 3242(numbers)S 3614(are)S 3764(represented)S 4255(internally)S 4667(in)S 4771(decimal)S 5116(and)S 4224 V 1080(all)S 1219(computation)S 1759(is)S (done)195 1864 A 2098(in)S 2215(decimal.)S 2623(\(This)S 2875(version)S 3210(truncates)S 3613(results)S 3915(from)S 4150(divide)S 4440(and)S (multiply)340 4624 A 5003(opera-)S 4344 V 1080(tions.\))S 1387(There)S 1651(are)S 1803(two)S 1982(attributes)S 2385(of)S 2497(numbers,)S 2896(the)S 3047(length)S 3326(and)S 3499(the)S 3650(scale.)S 3930(The)S 4115(length)S 4393(is)S 4487(the)S 4637(total)S 4843(number)S 5177(of)S 4464 V 1080(signi\256cant)S 1540(decimal)S 1900(digits)S 2164(in)S 2283(a)S 2369(number)S 2718(and)S 2905(the)S 3070(scale)S 3314(is)S 3423(the)S 3588(total)S 3809(number)S 4158(of)S 4284(decimal)S 4645(digits)S 4910(after)S 5138(the)S 4584 V 1080(decimal)S 1424(point.)S 1705(For)S 1870(example:)S 4704 V (.000001)325 1465 A 1815(has)S 1974(a)S 2044(length)S 2320(of)S 2429(6)S 2504(and)S 2674(scale)S 2901(of)S 3010(6.)S 4824 V (1935.000)375 1465 A 1865(has)S 2024(a)S 2094(length)S 2370(of)S 2479(7)S 2554(and)S 2724(a)S 2794(scale)S 3021(of)S 3130(3.)S 4992 V 870(V)S 872(VA)S 947(AR)S 1022(RI)S 1091(IA)S 1127(AB)S 1202(BL)S 1271(LE)S 1335(ES)S 1399(S)S 5112 V 1080(Numbers)S 1481(are)S 1637(stored)S 1915(in)S 2025(two)S 2208(types)S 2452(of)S 2568(variables,)S 2989(simple)S 3289(variables)S 3685(and)S 3862(arrays.)S 4191(Both)S 4418(simple)S 4719(variables)S 5116(and)S 5232 V 1080(array)S 1326(variables)S 1728(are)S 1890(named.)S 2246(Names)S 2564(begin)S 2825(with)S 3041(a)S 3123(letter)S 3368(followed)S 3763(by)S 3900(any)S 4082(number)S 4426(of)S 4547(letters,)S 4856(digits)S 5116(and)S 5352 V (underscores.)506 1080 A 1636(All)S 1791(letters)S 2064(must)S 2285(be)S 2406(lower)S 2662(case.)S 2912(\(Full)S 3134(alpha-numeric)S 3742(names)S 4025(are)S 4175(an)S 4296(extension.)S 4732(In)S 4842(POSIX)S 10 B 5160(bc)S 5472 V 10 R 1080(all)S 1211(names)S 1498(are)S 1652(a)S 1727(single)S 1997(lower)S 2257(case)S 2461(letter.\))S 2783(The)S 2970(type)S 3173(of)S 3287(variable)S 3642(is)S 3739(clear)S 3966(by)S 4096(the)S 4249(context)S (because)319 4575 A 4923(all)S 5053(array)S 5592 V 1080(variable)S 1430(names)S (will)157 1712 A 1894(be)S 2014(followed)S 2397(by)S 2522(brackets)S (\([]\).)161 2883 A 5760 V 1080(There)S 1347(are)S 1502(four)S 1701(special)S 2012(variables,)S 10 B 2432(scale,)S 2695(ibase,)S 2969(obase,)S 10 R 3265(and)S 10 B 3441(last)S 10 R 3592(.)S 10 B 3673(scale)S 10 R 3911(de\256nes)S 4227(how)S 4432(some)S 4676(operations)S 5127(use)S 5880 V 1080(digits)S 1337(after)S 1557(the)S 1714(decimal)S 2067(point.)S 2357(The)S 2548(default)S 2862(value)S 3114(of)S 10 B 3232(scale)S 10 R 3473(is)S 3574(0.)S 10 B 3683(ibase)S 10 R 3934(and)S 10 B 4112(obase)S 10 R 4385(de\256ne)S 4664(the)S (conversion)441 4820 A 6000 V 1080(base)S 1293(for)S (input)206 1445 A 1685(and)S 1864(output)S 2154(numbers.)S 2584(The)S 2775(default)S 3089(for)S 3241(both)S (input)206 3453 A 3693(and)S 3872(output)S 4162(is)S 4263(base)S 4476(10.)S 10 B 4660(last)S 10 R 4845(\(an)S 5009(exten-)S 6120 V 1080(sion\))S 1320(is)S 1426(a)S 1510(variable)S 1874(that)S 2064(has)S 2237(the)S 2399(value)S 2656(of)S 2779(the)S 2941(last)S 3120(printed)S 3444(number.)S 3840(These)S (will)157 4119 A 4314(be)S 4447(discussed)S 4870(in)S 4986(further)S 6240 V 1080(detail)S 1337(where)S 1617(appropriate.)S 2159(All)S 2321(of)S 2438(these)S 2678(variables)S 3075(may)S 3281(have)S 3504(values)S 3794(assigned)S 4174(to)S 4286(them)S 4521(as)S 4639(well)S 4847(as)S 4965(used)S 5183(in)S 6360 V 1080(expressions.)S 6528 V 870(C)S 872(CO)S 941(OM)S 1016(MM)S 1107(ME)S 1198(EN)S 1262(NT)S 1337(TS)S 1401(S)S 6648 V 1080(Comments)S 1545(in)S 10 B 1653(bc)S 10 R 1784(start)S 1988(with)S 2197(the)S 2350(characters)S 10 B 2790(/*)S 10 R 2898(and)S 3073(end)S 3248(with)S 3457(the)S 3610(characters)S 10 B 4050(*/)S 10 R 4128(.)S 4208(Comments)S 4673(may)S 4877(start)S 5082(any-)S 6768 V 1080(where)S 1361(and)S 1539(appear)S 1841(as)S 1958(a)S 2036(single)S (space)224 2309 A 2566(in)S 2677(the)S (input.)231 2833 A 3122(\(This)S 3368(causes)S 3664(comments)S 4110(to)S 4221(delimit)S 4539(other)S (input)206 4779 A 5018(items.)S 6888 V 1080(For)S 1252(example,)S 1650(a)S 1727(comment)S 2133(can)S 2305(not)S 2465(be)S (found)234 2592 A 2858(in)S 2968(the)S 3123(middle)S 3434(of)S 3550(a)S 3627(variable)S 3984(name.\))S 4319(Comments)S 4787(include)S 5116(any)S 7008 V 1080(newlines)S 1463(\(end)S 1667(of)S 1776(line\))S 1986(between)S 2347(the)S 2495(start)S 2694(and)S 2864(the)S 3012(end)S 3182(of)S 3291(the)S 3439(comment.)S 7176 V 870(E)S 872(EX)S 936(XP)S 1011(PR)S 1069(RE)S 1138(ES)S 1202(SS)S 1260(SI)S 1318(IO)S 1354(ON)S 1429(NS)S 1504(S)S 7296 V 1080(The)S 1270(numbers)S 1649(are)S 1806(manipulated)S 2336(by)S 2469(expressions)S 2972(and)S 3151(statements.)S 3660(Since)S 3918(the)S (language)363 4075 A 4472(was)S 4663(designed)S 5054(to)S 5166(be)S 7416 V 1080(interactive,)S 1562(statements)S 2017(and)S 2192(expressions)S 2691(are)S 2845(executed)S 3233(as)S (soon)189 3347 A 3566(as)S 3680(possible.)S 4089(There)S 4355(is)S 4452(no)S 4582("main")S 4895(program.)S 7536 V 1080(Instead,)S 1430(code)S 1654(is)S 1755(executed)S 2147(as)S 2265(it)S 2355(is)S (encountered.)517 2456 A 3032(\(Functions,)S 3521(discussed)S 3941(in)S 4054(detail)S 4313(later,)S 4553(are)S 4712(de\256ned)S 5043(when)S 7903 V 720(Page)S 941(1)S 2936(\()S 2978(.)S 3011(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 2 2 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V (encountered.\))551 1080 A 1128 V 1080(A)S 1186(simple)S 1487(expression)S 1951(is)S 2052(just)S 2231(a)S 2310(constant.)S 10 B 2704(bc)S 10 R (converts)341 2839 A 3214(constants)S 3622(into)S 3812(internal)S 4154(decimal)S 4507(numbers)S 4887(using)S 5138(the)S 1248 V 1080(current)S (input)206 1408 A 1656(base,)S 1902(speci\256ed)S 2302(by)S 2444(the)S 2609(variable)S 10 B 2976(ibase)S 10 R 3194(.)S 3261(\(There)S 3573(is)S 3681(an)S 3817(exception)S 4249(in)S 4368(functions.\))S 4867(The)S 5065(legal)S 1368 V 1080(values)S 1362(of)S 10 B 1471(ibase)S 10 R 1714(are)S 1863(2)S (through)312 1938 A 2276(16)S 2402(\(F\).)S 2602(Assigning)S 3035(a)S 3106(value)S 3350(outside)S 3666(this)S 3837(range)S 4087(to)S 10 B 4191(ibase)S 10 R (will)157 4435 A 4618(result)S 4868(in)S 4972(a)S 5043(value)S 1488 V 1080(of)S 1206(2)S 1297(or)S 1422(16.)S (Input)212 1613 A 1866(numbers)S 2253(may)S 2467(contain)S 2804(the)S 2968(characters)S 3419(0-9)S 3594(and)S 3780(A-F.)S 4009(\(Note:)S 4308(They)S 4556(must)S 4792(be)S 4928(capitals.)S 1608 V 1080(Lower)S 1370(case)S 1570(letters)S 1843(are)S 1993(variable)S 2344(names.\))S 2711(Single)S 2994(digit)S 3205(numbers)S 3578(always)S 3885(have)S 4102(the)S 4252(value)S 4497(of)S 4608(the)S 4758(digit)S 4969(regard-)S 1728 V 1080(less)S 1260(of)S 1373(the)S 1525(value)S 1772(of)S 10 B 1885(ibase)S 10 R 2103(.)S 2157(\(i.e.)S 2343(A)S 2445(=)S 2531(10.\))S 2744(For)S (multi-digit)430 2913 A 3372(numbers,)S 10 B 3772(bc)S 10 R 3902(changes)S 4254(all)S (input)206 4383 A 4617(digits)S 4868(greater)S 5177(or)S 1848 V 1080(equal)S 1340(to)S 1460(ibase)S 1709(to)S 1829(the)S 1995(value)S 2256(of)S 10 B 2383(ibase)S 10 R 2601(-1.)S 2778(This)S 3000(makes)S 3300(the)S 3466(number)S 10 B (FFF)186 3816 A 10 R 4045(always)S 4368(be)S 4506(the)S 4672(largest)S 4984(3)S 5077(digit)S 1968 V 1080(number)S 1412(of)S 1521(the)S (input)206 1669 A 1900(base.)S 2136 V 1080(Full)S 1287(expressions)S 1801(are)S 1971(similar)S 2297(to)S 2421(many)S 2690(other)S 2943(high)S 3167(level)S (languages.)427 3409 A 3907(Since)S 4177(there)S 4425(is)S 4538(only)S 4762(one)S 4953(kind)S 5177(of)S 2256 V 1080(number,)S 1439(there)S 1668(are)S 1819(no)S 1946(rules)S 2169(for)S 2314(mixing)S 2625(types.)S 2914(Instead,)S 3257(there)S 3486(are)S 3637(rules)S 3860(on)S 3987(the)S 4137(scale)S 4365(of)S 4475(expressions.)S 5020(Every)S 2376 V 1080(expression)S 1535(has)S 1695(a)S 1766(scale.)S 2044(This)S 2249(is)S 2342(derived)S 2670(from)S 2892(the)S 3041(scale)S 3269(of)S 3379(original)S 3718(numbers,)S 4115(the)S 4264(operation)S 4670(performed)S 5116(and)S 2496 V 1080(in)S 1186(many)S 1437(cases,)S 1703(the)S 1854(value)S 2100(of)S 2212(the)S 2363(variable)S 10 B 2716(scale)S 10 R 2923(.)S 2976(Legal)S 3234(values)S 3519(of)S 3631(the)S 3782(variable)S 10 B 4135(scale)S 10 R 4370(are)S 4522(0)S 4599(to)S 4704(the)S 4854(maximum)S 2616 V 1080(number)S 1412(representable)S 1975(by)S 2100(a)S 2170(C)S 2262(integer.)S 2784 V 1080(In)S 1203(the)S 1365(following)S 1795(descriptions)S 2320(of)S 2443(legal)S 2678(expressions,)S 3211("expr")S 3512(refers)S 3783(to)S 3901(a)S 3986(complete)S 4395(expression)S 4865(and)S 5050("var")S 2904 V 1080(refers)S 1336(to)S 1439(a)S 1509(simple)S 1802(or)S 1911(an)S 2031(array)S 2264(variable.)S 2664(A)S 2762(simple)S 3055(variable)S 3405(is)S 3497(just)S 3667(a)S 3024 V 10 I 1440(name)S 3144 V 10 R 1080(and)S 1250(an)S 1370(array)S 1603(variable)S 1953(is)S 2045(speci\256ed)S 2428(as)S 3264 V 10 I 1440(name)S 10 R 1658([)S 10 I 1692(expr)S 10 R 1871(])S 3384 V 1080(Unless)S 1379(speci\256cally)S 1863(mentioned)S 2312(the)S 2460(scale)S 2687(of)S 2796(the)S 2944(result)S 3193(is)S 3285(the)S 3433(maximum)S 3865(scale)S 4092(of)S 4201(the)S 4349(expressions)S (involved.)376 4843 A 3552 V 1080(-)S 1139(expr)S 1440(The)S 1622(result)S 1871(is)S 1963(the)S 2111(negation)S 2482(of)S 2591(the)S 2739(expression.)S 3720 V 1080(++)S 1219(var)S 1440(The)S 1622(variable)S 1972(is)S 2064(incremented)S 2587(by)S 2712(one)S 2882(and)S 3052(the)S 3200(new)S 3393(value)S 3636(is)S 3728(the)S 3876(result)S 4125(of)S 4234(the)S 4382(expression.)S 3888 V 1080(--)S 1173(var)S 1440(The)S 1622(variable)S 1972(is)S 2064(decremented)S 2604(by)S 2729(one)S 2899(and)S 3069(the)S 3217(new)S 3410(value)S 3653(is)S 3745(the)S 3893(result)S 4142(of)S 4251(the)S 4399(expression.)S 4056 V 1080(var)S 1234(++)S 1471(The)S 1659(result)S 1914(of)S 2029(the)S 2183(expression)S 2644(is)S 2742(the)S 2896(value)S 3145(of)S 3260(the)S 3414(variable)S 3770(and)S 3947(then)S 4152(the)S 4307(variable)S 4664(is)S 4763(incremented)S 4176 V 1440(by)S 1565(one.)S 4344 V 1080(var)S 1234(--)S 1440(The)S 1629(result)S 1885(of)S 2001(the)S 2156(expression)S 2618(is)S 2717(the)S 2872(value)S 3122(of)S 3238(the)S 3393(variable)S 3750(and)S 3927(then)S 4132(the)S 4288(variable)S 4646(is)S 4746(decremented)S 4464 V 1440(by)S 1565(one.)S 4632 V 1080(expr)S 1284(+)S 1366(expr)S 4752 V 1440(The)S 1622(result)S 1871(of)S 1980(the)S 2128(expression)S 2583(is)S 2675(the)S 2823(sum)S 3015(of)S 3124(the)S 3272(two)S 3448(expressions.)S 4920 V 1080(expr)S 1284(-)S 1343(expr)S 5040 V 1440(The)S 1622(result)S 1871(of)S 1980(the)S 2128(expression)S 2583(is)S 2675(the)S 2823(difference)S 3258(of)S 3367(the)S 3515(two)S 3691(expressions.)S 5208 V 1080(expr)S 1284(*)S 1359(expr)S 5328 V 1440(The)S 1622(result)S 1871(of)S 1980(the)S 2128(expression)S 2583(is)S 2675(the)S (product)307 2823 A 3155(of)S 3264(the)S 3412(two)S 3588(expressions.)S 5496 V 1080(expr)S 1284(/)S 1337(expr)S 5616 V 1440(The)S 1629(result)S 1885(of)S 2001(the)S 2156(expression)S 2618(is)S 2717(the)S (quotient)329 2872 A 3233(of)S 3349(the)S 3504(two)S 3687(expressions.)S 4239(The)S 4429(scale)S 4664(of)S 4781(the)S 4937(result)S 5194(is)S 5736 V 1440(the)S 1588(value)S 1831(of)S 1940(the)S 2088(variable)S 10 B 2438(scale)S 10 R 2645(.)S 5904 V 1080(expr)S 1284(%)S 1393(expr)S 6024 V 1440(The)S 1630(result)S 1887(of)S 2004(the)S 2160(expression)S 2623(is)S 2723(the)S 2879("remainder")S 3403(and)S 3582(it)S 3672(is)S 3773(computed)S 4203(in)S 4315(the)S 4472(following)S 4897(way.)S 5149(To)S 6144 V 1440(compute)S 1814(a%b,)S 2046(\256rst)S 2231(a/b)S 2382(is)S 2477(computed)S 2901(to)S 10 B 3006(scale)S 10 R 3240(digits.)S 3540(That)S 3752(result)S 4003(is)S 4097(used)S 4308(to)S 4413(compute)S 4786(a-\(a/b\)*b)S 5183(to)S 6264 V 1440(the)S 1605(scale)S 1849(of)S 1975(the)S 2140(maximum)S 2589(of)S 10 B 2715(scale)S 10 R 2922(+scale\(b\))S 3341(and)S 3528(scale\(a\).)S 3935(If)S 10 B 4045(scale)S 10 R 4294(is)S 4403(set)S 4557(to)S 4678(zero)S 4895(and)S 5083(both)S 6384 V 1440(expressions)S 1934(are)S 2083(integers)S 2427(this)S 2597(expression)S 3052(is)S 3144(the)S 3292(integer)S 3597(remainder)S 4031(function.)S 6552 V 1080(expr)S 1284(\303)S 1343(expr)S 6672 V 1440(The)S 1629(result)S 1885(of)S 2001(the)S 2156(expression)S 2618(is)S 2717(the)S 2872(value)S 3122(of)S 3238(the)S 3394(\256rst)S 3584(raised)S 3858(to)S 3969(the)S (second.)304 4125 A 4462(The)S (second)279 4652 A 4964(expres-)S 6792 V 1440(sion)S 1633(must)S 1854(be)S 1975(an)S 2096(integer.)S (\(If)102 2452 A 2580(the)S (second)279 2728 A 3032(expression)S 3487(is)S 3579(not)S 3732(an)S 3852(integer,)S 4182(a)S 4252(warning)S 4607(is)S 4699(generated)S 5116(and)S 6912 V 1440(the)S 1604(expression)S 2075(is)S 2183(truncated)S 2599(to)S 2718(get)S 2882(an)S 3018(integer)S 3339(value.\))S 3682(The)S 3880(scale)S 4123(of)S 4248(the)S 4412(result)S 4677(is)S 10 B 4785(scale)S 10 R 5034(if)S 5138(the)S 7032 V (exponent)368 1440 A 1838(is)S 1935(negative.)S 2356(If)S 2454(the)S (exponent)368 2607 A 3005(is)S (positive)318 3102 A 3450(the)S 3603(scale)S 3835(of)S 3949(the)S 4102(result)S 4356(is)S 4453(the)S 4606(minimum)S 5025(of)S 5138(the)S 7152 V 1440(scale)S 1668(of)S 1778(the)S 1928(\256rst)S 2112(expression)S 2569(times)S 2814(the)S 2964(value)S 3209(of)S 3320(the)S (exponent)368 3470 A 3865(and)S 4037(the)S 4187(maximum)S 4621(of)S 10 B 4732(scale)S 10 R 4966(and)S 5138(the)S 7272 V 1440(scale)S 1688(of)S 1818(the)S 1986(\256rst)S 2188(expression.)S 2713(\(e.g.)S 2937(scale\(a\303b\))S 3381(=)S 3483(min\(scale\(a\)*b,)S 4158(max\()S 10 B 4410(scale,)S 10 R (scale\(a\)\)\).\))442 4687 A 5199(It)S 7392 V (should)267 1440 A 1732(be)S 1852(noted)S 2100(that)S 2276(expr\3030)S (will)157 2564 A 2746(always)S 3051(return)S 3317(the)S 3465(value)S 3708(of)S 3817(1.)S 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 2936(\()S 2978(.)S 3011(\))S 4990(Page)S 5211(2)S 8143 V EP %%Page: 3 3 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1080(\()S 1139(expr)S 1343(\))S 1440(This)S 1644(alters)S 1888(the)S 2036(standard)S (precedence)454 2402 A 2881(to)S 2984(force)S 3217(the)S 3365(evaluation)S 3809(of)S 3918(the)S 4066(expression.)S 1128 V 1080(var)S 1234(=)S 1316(expr)S 1248 V 1440(The)S 1622(variable)S 1972(is)S 2064(assigned)S 2435(the)S 2583(value)S 2826(of)S 2935(the)S 3083(expression.)S 1416 V 1080(var)S 1234(=)S 1530(expr)S 1536 V 1440(This)S 1648(is)S 1744(equivalent)S 2192(to)S 2299("var)S 2498(=)S 2584(var)S 2742()S 2985(expr")S 3234(with)S 3442(the)S 3595(exception)S 4016(that)S 4197(the)S 4350("var")S 4591(part)S 4778(is)S 4875(evaluated)S 1656 V 1440(only)S 1643(once.)S 1908(This)S 2112(can)S 2277(make)S 2520(a)S 2590(difference)S 3025(if)S 3112("var")S 3348(is)S 3440(an)S 3560(array.)S 1824 V 1105(Relational)S 1548(expressions)S 2046(are)S 2199(a)S 2273(special)S 2582(kind)S 2790(of)S 2904(expression)S 3364(that)S 3545(always)S 3855(evaluate)S 4221(to)S 4329(0)S 4409(or)S 4523(1,)S 4628(0)S 4708(if)S 4800(the)S 4953(relation)S 1944 V 1080(is)S 1173(false)S 1390(and)S 1561(1)S 1637(if)S 1725(the)S 1874(relation)S 2208(is)S 2300(true.)S 2532(These)S 2798(may)S 2996(appear)S 3290(in)S 3393(any)S 3563(legal)S 3784(expression.)S 4289(\(POSIX)S 4640(bc)S 4760(requires)S 5110(that)S 2064 V 1080(relational)S 1486(expressions)S 1980(are)S 2129(used)S 2338(only)S 2541(in)S 2644(if,)S 2756(while,)S 3030(and)S 3200(for)S 3343(statements)S 3793(and)S 3963(that)S 4140(only)S 4344(one)S 4515(relational)S 4922(test)S 5088(may)S 2184 V 1080(be)S (done)195 1200 A 1420(in)S 1523(them.\))S 1833(The)S 2015(relational)S 2421(operators)S 2821(are)S 2352 V 1080(expr1)S 1334(<)S 1416(expr2)S 2472 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(strictly)S 2776(less)S 2952(than)S 3150(expr2.)S 2640 V 1080(expr1)S 1334(<=)S 1473(expr2)S 2760 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(less)S 2647(than)S 2845(or)S 2954(equal)S 3197(to)S 3300(expr2.)S 2928 V 1080(expr1)S 1334(>)S 1416(expr2)S 3048 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(strictly)S 2776(greater)S 3082(than)S 3280(expr2.)S 3216 V 1080(expr1)S 1334(>=)S 1473(expr2)S 3336 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(greater)S 2777(than)S 2975(or)S 3084(equal)S 3327(to)S 3430(expr2.)S 3504 V 1080(expr1)S 1334(==)S 1473(expr2)S 3624 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(equal)S 2714(to)S 2817(expr2.)S 3792 V 1080(expr1)S 1334(!=)S 1450(expr2)S 3912 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr1)S 2379(is)S 2471(not)S 2624(equal)S 2867(to)S 2970(expr2.)S 4080 V 1080(Boolean)S 1449(operations)S 1903(are)S 2062(also)S 2259(legal.)S 2540(\(POSIX)S 10 B 2901(bc)S 10 R 3037(does)S 3256(NOT)S 3499(have)S (boolean)318 3724 A 4077(operations\).)S 4590(The)S 4782(result)S 5041(of)S 5160(all)S 4200 V (boolean)318 1080 A 1429(operations)S 1879(are)S 2034(0)S 2115(and)S 2290(1)S 2370(\(for)S 2552(false)S 2773(and)S 2948(true\))S 3169(as)S 3283(in)S 3391(relational)S 3802(expressions.)S 4351(The)S (boolean)318 4538 A 4886(operators)S 4320 V 1080(are:)S 4488 V 1080(!expr)S 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(expr)S 2329(is)S 2421(0.)S 4656 V 1080(expr)S 1284(&&)S 1465(expr)S 4776 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(both)S 2328(expressions)S 2822(are)S (non-zero.)383 2971 A 4944 V 1080(expr)S 1284(||)S 1349(expr)S 5064 V 1440(The)S 1622(result)S 1871(is)S 1963(1)S 2038(if)S 2125(either)S 2380(expression)S 2835(is)S (non-zero.)383 2927 A 5232 V 1080(The)S 1262(expression)S (precedence)454 1717 A 2196(is)S 2288(as)S 2397(follows:)S 2752(\(lowest)S 3074(to)S 3177(highest\))S 5352 V 1440(||)S 1505(operator,)S 1891(left)S 2051(associative)S 5472 V 1440(&&)S 1621(operator,)S 2007(left)S 2167(associative)S 5592 V 1440(!)S 1499(operator,)S (nonassociative)592 1885 A 5712 V 1440(Relational)S 1879(operators,)S 2304(left)S 2464(associative)S 5832 V 1440(Assignment)S 1945(operator,)S 2331(right)S 2546(associative)S 5952 V 1440(+)S 1522(and)S 1692(-)S 1751(operators,)S 2176(left)S 2336(associative)S 6072 V 1440(*,)S 1540(/)S 1593(and)S 1763(%)S 1872(operators,)S 2297(left)S 2457(associative)S 6192 V 1440(\303)S 1499(operator,)S 1885(right)S 2100(associative)S 6312 V 1440(unary)S 1694(-)S 1753(operator,)S (nonassociative)592 2139 A 6432 V 1440(++)S 1579(and)S 1749(--)S 1842(operators,)S (nonassociative)592 2267 A 6600 V 1080(This)S (precedence)454 1289 A 1773(was)S 1960(chosen)S 2270(so)S 2390(that)S 2572(POSIX)S 2895(compliant)S 10 B 3328(bc)S 10 R 3460(programs)S (will)157 3871 A 4059(run)S 4224(correctly.)S 4639(This)S (will)157 4849 A 5037(cause)S 6720 V 1080(the)S 1237(use)S 1405(of)S 1523(the)S 1680(relational)S 2094(and)S 2272(logical)S 2579(operators)S 2987(to)S 3098(have)S 3321(some)S (unusual)312 3566 A 3911(behavior)S 4296(when)S 4547(used)S 4764(with)S 4976(assign-)S 6840 V 1080(ment)S 1306(expressions.)S 1850(Consider)S 2238(the)S 2386(expression:)S 6960 V 1440(a)S 1510(=)S 1592(3)S 1667(<)S 1749(5)S 7128 V 1080(Most)S 1313(C)S 1407(programmers)S 1971(would)S 2249(assume)S 2572(this)S 2744(would)S 3022(assign)S 3300(the)S 3450(result)S 3701(of)S 3813("3)S 3932(<)S 4017(5")S 4136(\(the)S 4321(value)S 4567(1\))S 4679(to)S 4785(the)S 4936(variable)S 7248 V 1080("a".)S 1285(What)S 1531(this)S 1704(does)S 1916(in)S 10 B 2022(bc)S 10 R 2151(is)S 2245(assign)S 2523(the)S 2673(value)S 2918(3)S 2995(to)S 3100(the)S 3250(variable)S 3602("a")S 3756(and)S 3928(then)S 4128(compare)S 4502(3)S 4579(to)S 4684(5.)S 4811(It)S 4900(is)S 4994(best)S 5183(to)S 7368 V 1080(use)S 1239(parenthesis)S 1717(when)S 1960(using)S 2202(relational)S 2608(and)S 2778(logical)S 3077(operators)S 3477(with)S 3681(the)S 3829(assignment)S 4306(operators.)S 7903 V 720(Page)S 941(3)S 2936(\()S 2978(.)S 3011(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 4 4 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1080(There)S 1346(are)S 1500(a)S 1575(few)S 1758(more)S 1996(special)S 2307(expressions)S 2807(that)S 2989(are)S 3144(provided)S 3532(in)S 10 B 3641(bc)S 10 R 3742(.)S 3823(These)S 4095(have)S 4316(to)S 4425(do)S 4556(with)S 4766(user)S 4965(de\256ned)S 1080 V 1080(functions)S 1480(and)S 1651(standard)S 2018(functions.)S 2468(They)S 2701(all)S 2828(appear)S 3123(as)S 3232(")S 10 I 3273(name)S 10 B 3491(\()S 10 I 3525(parameters)S 10 B 3983(\))S 10 R 4017(".)S 4133(See)S 4304(the)S 4452(section)S 4762(on)S 4887(functions)S 1200 V 1080(for)S 1223(user)S 1416(de\256ned)S 1737(functions.)S 2186(The)S 2368(standard)S 2734(functions)S 3133(are:)S 1368 V 1080(length)S 1356(\()S 1415(expression)S 1870(\))S 1488 V 1440(The)S 1622(value)S 1865(of)S 1974(the)S 2122(length)S 2398(function)S 2758(is)S 2850(the)S 2998(number)S 3330(of)S 3439(signi\256cant)S 3883(digits)S 4131(in)S 4234(the)S 4382(expression.)S 1656 V 1080(read)S 1279(\()S 1338(\))S 1440(The)S 1635(read)S 1847(function)S 2220(\(an)S 2387(extension\))S (will)157 2844 A 3039(read)S 3252(a)S 3336(number)S 3682(from)S 3917(the)S 4079(standard)S (input,)231 4459 A 4729(regardless)S 5177(of)S 1776 V 1440(where)S 1715(the)S 1866(function)S 2229(occurs.)S 2595(Beware,)S 2957(this)S 3129(can)S 3296(cause)S 3547(problems)S 3948(with)S 4154(the)S 4304(mixing)S 4615(of)S 4726(data)S 4921(and)S 5093(pro-)S 1896 V 1440(gram)S 1679(in)S 1789(the)S 1944(standard)S (input.)231 2317 A 2606(The)S 2796(best)S 2991(use)S 3158(for)S 3309(this)S 3487(function)S 3855(is)S 3955(in)S 4066(a)S 4144(previously)S (written)286 4601 A 4920(program)S 2016 V 1440(that)S 1621(needs)S (input)206 1880 A 2116(from)S 2342(the)S 2495(user,)S 2718(but)S 2876(never)S 3130(allows)S 3423(program)S 3794(code)S 4014(to)S 4121(be)S (input)206 4245 A 4480(from)S 4705(the)S 4857(user.)S 5104(The)S 2136 V 1440(value)S 1689(of)S 1804(the)S 1958(read)S 2163(function)S 2529(is)S 2627(the)S 2782(number)S 3121(read)S 3327(from)S 3555(the)S 3710(standard)S (input)206 4083 A 4321(using)S 4570(the)S 4725(current)S 5043(value)S 2256 V 1440(of)S 1549(the)S 1697(variable)S 10 B 2047(ibase)S 10 R 2290(for)S 2433(the)S (conversion)441 2581 A 3047(base.)S 2424 V 1080(scale)S 1307(\()S 1366(expression)S 1821(\))S 2544 V 1440(The)S 1630(value)S 1881(of)S 1998(the)S 2154(scale)S 2389(function)S 2757(is)S 2857(the)S 3013(number)S 3353(of)S 3470(digits)S 3726(after)S 3945(the)S 4102(decimal)S 4455(point)S 4695(in)S 4807(the)S 4964(expres-)S 2664 V 1440(sion.)S 2832 V 1080(sqrt)S 1256(\()S 1315(expression)S 1770(\))S 2952 V 1440(The)S 1628(value)S 1877(of)S 1992(the)S 2146(sqrt)S 2328(function)S 2695(is)S 2794(the)S 2949(square)S 3244(root)S 3438(of)S 3554(the)S 3709(expression.)S 4221(If)S 4321(the)S 4476(expression)S 4938(is)S 5037(nega-)S 3072 V 1440(tive,)S 1641(a)S 1711(run)S 1870(time)S 2074(error)S 2296(is)S 2388(generated.)S 3240 V 870(S)S 872(ST)S 930(TA)S 994(AT)S 1069(TE)S 1133(EM)S 1197(ME)S 1288(EN)S 1352(NT)S 1427(TS)S 1491(S)S 3360 V 1080(Statements)S 1559(\(as)S 1714(in)S 1830(most)S 2063(algebraic)S (languages\))436 2471 A 2945(provide)S 3290(the)S 3451(sequencing)S 3941(of)S 4063(expression)S 4531(evaluation.)S 5038(In)S 10 B 5160(bc)S 3480 V 10 R 1080(statements)S 1536(are)S 1691(executed)S 2079("as)S (soon)189 2234 A 2453(as)S 2567(possible.")S 3017(Execution)S 3455(happens)S 3814(when)S 4062(a)S 4137(newline)S 4486(in)S (encountered)492 4594 A 5116(and)S 3600 V 1080(there)S 1313(is)S 1411(one)S 1587(or)S 1702(more)S 1940(complete)S 2340(statements.)S 2846(Due)S 3045(to)S 3154(this)S 3330(immediate)S 3786(execution,)S 4233(newlines)S 4622(are)S 4777(very)S 4987(impor-)S 3720 V 1080(tant)S 1268(in)S 10 B 1382(bc)S 10 R 1483(.)S 1544(In)S 1664(fact,)S 1877(both)S 2091(a)S 2172(semicolon)S 2621(and)S 2802(a)S 2883(newline)S 3238(are)S 3398(used)S 3618(as)S 3738(statement)S 4160(separators.)S 4655(An)S 4814(improperly)S 3840 V (placed)263 1080 A 1376(newline)S (will)157 1728 A 1918(cause)S 2175(a)S 2253(syntax)S 2548(error.)S (Because)336 2828 A 3197(newlines)S 3588(are)S 3745(statement)S 4164(separators,)S 4631(it)S 4720(is)S 4820(possible)S 5183(to)S 3960 V 1080(hide)S 1293(a)S 1378(newline)S 1737(by)S 1877(using)S 2134(the)S 2297(backslash)S 2727(character.)S 3187(The)S 3383(sequence)S 3791("\\",)S 4157(where)S 4443()S 4674(is)S 4780(the)S 4942(newline)S 4080 V 1080(appears)S 1413(to)S 10 B 1516(bc)S 10 R 1642(as)S (whitespace)448 1752 A 2226(instead)S 2537(of)S 2647(a)S 2718(newline.)S 3113(A)S 3212(statement)S 3624(list)S 3773(is)S 3866(a)S 3937(series)S 4193(of)S 4303(statements)S 4754(separated)S 5161(by)S 4200 V 1080(semicolons)S 1562(and)S 1737(newlines.)S 2175(The)S 2362(following)S 2783(is)S 2880(a)S 2955(list)S 3108(of)S 10 B 3222(bc)S 10 R 3353(statements)S 3808(and)S 3983(what)S 4208(they)S 4410(do:)S 4567(\(Things)S 4909(enclosed)S 4320 V 1080(in)S 1183(brackets)S (\([]\))136 1544 A 1705(are)S 1854(optional)S 2208(parts)S 2429(of)S 2538(the)S 2686(statement.\))S 4488 V 1080(expression)S 4608 V 1440(This)S 1645(statement)S 2057(does)S 2267(one)S 2438(of)S 2548(two)S 2725(things.)S 3046(If)S 3140(the)S 3289(expression)S 3745(starts)S 3984(with)S 4189(")S 4695()S 4728 V (...",)141 1440 A 1622(it)S 1719(is)S 1826(considered)S 2302(to)S 2420(be)S 2555(an)S 2690(assignment)S 3182(statement.)S 3658(If)S 3766(the)S 3929(expression)S 4399(is)S 4506(not)S 4674(an)S 4809(assignment)S 4848 V 1440(statement,)S 1877(the)S 2026(expression)S 2482(is)S 2575(evaluated)S 2988(and)S 3160(printed)S 3472(to)S 3577(the)S 3727(output.)S 4060(After)S 4301(the)S 4451(number)S 4785(is)S 4879(printed,)S 5216(a)S 4968 V 1440(newline)S 1792(is)S 1892(printed.)S 2260(For)S 2433(example,)S 2832("a=1")S 3099(is)S 3198(an)S 3325(assignment)S 3809(statement)S 4227(and)S 4404("\(a=1\)")S 4738(is)S 4837(an)S 4964(expres-)S 5088 V 1440(sion)S 1642(that)S 1828(has)S 1997(an)S 2127(embedded)S 2575(assignment.)S 3113(All)S 3278(numbers)S 3660(that)S 3847(are)S 4007(printed)S 4328(are)S 4488(printed)S 4809(in)S 4923(the)S 5082(base)S 5208 V 1440(speci\256ed)S 1833(by)S 1968(the)S 2125(variable)S 10 B 2484(obase)S 10 R 2724(.)S 2783(The)S 2974(legal)S 3204(values)S 3495(for)S 10 B 3647(obase)S 10 R 3921(are)S 4079(2)S (through)312 4163 A 4509(BC_BASE_MAX.)S 5328 V 1440(\(See)S 1656(the)S 1815(section)S 2136(LIMITS.\))S 2593(For)S 2769(bases)S 3023(2)S (through)312 3109 A 3457(16,)S 3618(the)S 3777(usual)S (method)301 4025 A 4362(of)S (writing)291 4483 A 4811(numbers)S 5194(is)S 5448 V 1440(used.)S 1725(For)S 1916(bases)S 2185(greater)S 2517(than)S 2740(16,)S 10 B 2915(bc)S 10 R 3066(uses)S 3289(a)S (multi-character)617 3384 A 4051(digit)S (method)301 4285 A 4636(of)S 4770(printing)S 5138(the)S 5568 V 1440(numbers)S 1824(where)S (each)185 2109 A 2332(higher)S 2627(base)S 2844(digit)S 3066(is)S 3171(printed)S 3494(as)S 3616(a)S 3699(base)S 3916(10)S 4054(number.)S 4449(The)S (multi-character)617 4644 A 5688 V 1440(digits)S 1711(are)S 1883(separated)S 2312(by)S (spaces.)288 2460 A 2821(Each)S 3071(digit)S 3303(contains)S 3686(the)S 3857(number)S 4212(of)S 4343(characters)S 4800(required)S 5183(to)S 5808 V 1440(represent)S 1852(the)S 2017(base)S 2238(ten)S 2403(value)S 2663(of)S 2789("obase-1".)S 3276(Since)S 3542(numbers)S 3930(are)S 4096(of)S 4222(arbitrary)S 4612(precision,)S 5049(some)S 5928 V 1440(numbers)S 1814(may)S 2015(not)S 2171(be)S 2294(printable)S 2680(on)S 2807(a)S 2879(single)S 3146(output)S 3429(line.)S 3657(These)S (long)178 3925 A 4130(numbers)S (will)157 4503 A 4687(be)S (split)173 4809 A 5009(across)S 6048 V 1440(lines)S 1659(using)S 1905(the)S 2057("\\")S 2196(as)S 2309(the)S 2461(last)S 2630(character)S 3030(on)S 3159(a)S 3233(line.)S 3463(The)S 3649(maximum)S 4085(number)S 4422(of)S 4536(characters)S 4976(printed)S 6168 V 1440(per)S 1603(line)S 1788(is)S 1889(70.)S 2073(Due)S 2274(to)S 2385(the)S 2541(interactive)S 3000(nature)S 3285(of)S 10 B 3402(bc)S 10 R 3536(printing)S 3887(a)S 3965(number)S 4305(cause)S 4562(the)S 4718(side)S 4913(effect)S 5177(of)S 6288 V 1440(assigning)S 1844(the)S 1992(printed)S 2302(value)S 2545(the)S 2694(the)S 2843(special)S 3149(variable)S 10 B 3500(last)S 10 R 3651(.)S 3702(This)S 3907(allows)S 4196(the)S 4345(user)S 4539(to)S 4643(recover)S 4972(the)S 5121(last)S 6408 V 1440(value)S 1693(printed)S (without)307 2013 A 2355(having)S 2663(to)S 2776(retype)S 3063(the)S 3221(expression)S 3686(that)S 3872(printed)S 4192(the)S 4350(number.)S 4742(Assigning)S 5183(to)S 6528 V 10 B 1440(last)S 10 R 1633(is)S 1742(legal)S 1980(and)S (will)157 2167 A 2366(overwrite)S 2795(the)S 2960(last)S 3142(printed)S 3469(value)S 3729(with)S 3950(the)S 4115(assigned)S 4504(value.)S 4815(The)S 5015(newly)S 6648 V 1440(assigned)S 1811(value)S (will)157 2054 A 2236(remain)S (until)184 2541 A 2750(the)S 2898(next)S 3096(number)S 3428(is)S 3520(printed)S 3830(or)S 3939(another)S 4266(value)S 4509(is)S 4601(assigned)S 4972(to)S 10 B 5075(last)S 10 R 5226(.)S 6816 V 1080(string)S 1440(The)S 1627(string)S 1886(is)S 1983(printed)S 2298(to)S 2406(the)S 2559(output.)S 2895(Strings)S 3210(start)S 3414(with)S 3623(a)S (double)273 3698 A (quote)223 4001 A 4255(character)S 4657(and)S 4833(contain)S 5160(all)S 6936 V 1440(characters)S (until)184 1889 A 2112(the)S 2274(next)S (double)273 2486 A (quote)223 2798 A 3060(character.)S 3520(All)S 3688(characters)S 4137(are)S 4299(take)S (literally,)339 4505 A 4882(including)S 7056 V 1440(any)S 1610(newline.)S 2004(No)S 2152(newline)S 2496(character)S 2892(is)S 2984(printed)S 3294(after)S 3505(the)S 3653(string.)S 7224 V 10 B 1080(print)S 10 R 1324(list)S 7344 V 1440(The)S 1631(print)S 1855(statement)S 2275(\(an)S 2438(extension\))S 2891(provides)S 3272(another)S (method)301 3609 A 3945(of)S 4064(output.)S 4405(The)S 4597("list")S 4837(is)S 4939(a)S 5019(list)S 5177(of)S 7464 V 1440(strings)S 1734(and)S 1905(expressions)S 2400(separated)S 2807(by)S 2933(commas.)S 3344(Each)S 3572(string)S 3827(or)S 3937(expression)S 4393(is)S 4486(printed)S 4797(in)S 4900(the)S 5048(order)S 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 2936(\()S 2978(.)S 3011(\))S 4990(Page)S 5211(4)S 8143 V EP %%Page: 5 5 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1440(of)S 1561(the)S 1721(list.)S 1931(No)S 2091(terminating)S 2592(newline)S 2948(is)S 3052(printed.)S 3424(Expressions)S 3947(are)S 4108(evaluated)S 4532(and)S 4715(their)S 4938(value)S 5194(is)S 1080 V 1440(printed)S 1754(and)S 1928(assigned)S 2303(the)S 2455(the)S 2607(variable)S 10 B 2961(last)S 10 R 3112(.)S 3166(Strings)S 3480(in)S 3587(the)S 3739(print)S 3958(statement)S 4373(are)S 4526(printed)S 4840(to)S 4947(the)S 5099(out-)S 1200 V 1440(put)S 1600(and)S 1777(may)S 1983(contain)S 2312(special)S 2625(characters.)S 3118(Special)S 3448(characters)S 3891(start)S 4098(with)S 4310(the)S 4466(backslash)S 4890(character)S 1320 V 1440(\(\\\).)S 1616(The)S 1803(special)S 2113(characters)S (recognized)442 2553 A 3025(by)S 10 B 3155(bc)S 10 R 3286(are)S 3440("b")S 3602(\(bell\),)S 3876("f")S 4022(\(form)S 4281(feed\),)S 4543("n")S 4704(\(newline\),)S 5145("r")S 1440 V 1440(\(carriage)S 1834(return\),)S 2168("t")S 2312(\(tab\),)S 2562(and)S 2741("\\")S 2886(\(backslash\).)S 3430(Any)S 3638(other)S 3880(character)S 4286(following)S 4712(the)S 4870(backslash)S 1560 V (will)157 1440 A 1622(be)S (ignored.)332 1742 A 2124(This)S (still)151 2328 A 2504(does)S 2713(not)S 2866(allow)S 3115(the)S (double)273 3263 A (quote)223 3561 A 3809(character)S 4205(to)S 4308(be)S 4428(part)S 4610(of)S 4719(any)S 4889(string.)S 1728 V 1080({)S 1153(statement_list)S 1737(})S 1848 V 1440(This)S 1646(is)S 1740(the)S (compound)423 1890 A 2340(statement.)S 2803(It)S 2892(allows)S (multiple)335 3182 A 3544(statements)S 3997(to)S 4103(be)S (grouped)329 4226 A 4583(together)S 4941(for)S 5087(exe-)S 1968 V 1440(cution.)S 2136 V 10 B 1080(if)S 10 R 1167(\()S 1226(expression)S 1681(\))S 10 B 1740(then)S 10 R 1956(statement1)S 2417([)S 10 B 2451(else)S 10 R 2633(statement2])S 2256 V 1440(The)S 1623(if)S 1711(statement)S 2124(evaluates)S 2526(the)S 2676(expression)S 3133(and)S 3305(executes)S 3679(statement1)S 4142(or)S 4253(statement2)S 4716(depending)S 5161(on)S 2376 V 1440(the)S 1601(value)S 1857(of)S 1979(the)S 2140(expression.)S 2658(If)S 2764(the)S 2924(expression)S 3391(is)S (non-zero,)383 3495 A 3915(statement1)S 4388(is)S 4492(executed.)S 4937(If)S 5042(state-)S 2496 V 1440(ment2)S 1723(is)S 1822(present)S 2145(and)S 2322(the)S 2477(value)S 2727(of)S 2843(the)S 2998(expression)S 3460(is)S 3559(0,)S 3666(then)S 3871(statement2)S 4339(is)S 4439(executed.)S 4880(\(The)S 5104(else)S 2616 V 1440(clause)S 1717(is)S 1809(an)S 1929(extension.\))S 2784 V 10 B 1080(while)S 10 R 1335(\()S 1394(expression)S 1849(\))S 1908(statement)S 2904 V 1440(The)S 1627(while)S 1881(statement)S (will)157 2297 A 2484(execute)S 2822(the)S 2975(statement)S 3391(while)S 3645(the)S 3798(expression)S 4258(is)S (non-zero.)383 4355 A 4793(It)S 4886(evaluates)S 3024 V 1440(the)S 1590(expression)S 2047(before)S (each)185 2332 A 2544(execution)S 2962(of)S 3073(the)S 3223(statement.)S 3710(Termination)S 4234(of)S 4344(the)S (loop)178 4493 A 4697(is)S 4790(caused)S 5090(by)S 5216(a)S 3144 V 1440(zero)S 1639(expression)S 2094(value)S 2337(or)S 2446(the)S 2594(execution)S 3010(of)S 3119(a)S 3189(break)S 3438(statement.)S 3312 V 10 B 1080(for)S 10 R 1234(\()S ([expression1])548 1293 A 1866(;)S ([expression2])548 1919 A 2492(;)S ([expression3])548 2545 A 3118(\))S 3177(statement)S 3432 V 1440(The)S 1645(for)S 1811(statement)S 2245(controls)S 2617(repeated)S 3008(execution)S 3448(of)S 3581(the)S 3753(statement.)S (Expression1)497 4213 A 4759(is)S 4875(evaluated)S 3552 V 1440(before)S 1726(the)S (loop.)203 1877 A (Expression2)497 2133 A 2658(is)S 2753(evaluated)S 3166(before)S (each)185 3451 A 3663(execution)S 4081(of)S 4192(the)S 4342(statement.)S 4805(If)S 4900(it)S 4983(is)S (non-)184 5077 A 3672 V 1440(zero,)S 1670(the)S 1824(statement)S 2241(is)S 2339(evaluated.)S 2806(If)S 2905(it)S 2992(is)S 3090(zero,)S 3320(the)S (loop)178 3474 A 3683(is)S 3781(terminated.)S 4293(After)S (each)185 4538 A 4754(execution)S 5177(of)S 3792 V 1440(the)S 1592(statement,)S (expression3)480 2032 A 2541(is)S 2637(evaluated)S 3052(before)S 3338(the)S 3489(reevaluation)S 4015(of)S (expression2.)505 4127 A 4685(If)S (expression1)480 4781 A 3912 V 1440(or)S (expression3)480 1567 A 2090(are)S 2257(missing,)S 2637(nothing)S 2987(is)S 3098(evaluated)S 3528(at)S 3645(the)S 3812(point)S 4062(they)S 4279(would)S 4574(be)S 4713(evaluated.)S 5193(If)S 4032 V (expression2)480 1440 A 1971(is)S 2089(missing,)S 2476(it)S 2582(is)S 2699(the)S 2872(same)S 3129(as)S (substituting)468 3263 A 3781(the)S 3954(value)S 4222(1)S 4322(for)S (expression2.)505 4490 A 5070(\(The)S 4152 V 1440(optional)S 1799(expressions)S 2298(are)S 2452(an)S 2577(extension.)S 3017(POSIX)S 10 B 3339(bc)S 10 R 3471(requires)S 3827(all)S 3959(three)S 4192(expressions.\))S 4776(The)S 4964(follow-)S 4272 V 1440(ing)S 1593(is)S 1685(equivalent)S 2129(code)S 2344(for)S 2487(the)S 2635(for)S 2778(statement:)S 4392 V (expression1;)508 1440 A 4512 V 1440(while)S (\(expression2\))548 1689 A 2262({)S 4632 V 1515(statement;)S 4752 V (expression3;)508 1515 A 4872 V 1440(})S 5040 V 10 B 1080(break)S 10 R 1440(This)S 1650(statement)S 2067(causes)S 2361(a)S 2437(forced)S 2726(exit)S 2908(of)S 3024(the)S 3179(most)S (recent)247 3406 A 3685(enclosing)S 4102(while)S 4358(statement)S 4776(or)S 4892(for)S 5042(state-)S 5160 V 1440(ment.)S 5328 V 10 B 1080(continue)S 5448 V 10 R 1440(The)S 1627(continue)S 2003(statement)S 2419(\(an)S 2578(extension\))S 3052(causes)S 3345(the)S 3498(most)S (recent)247 3723 A 4000(enclosing)S 4415(for)S 4563(statement)S 4979(to)S 5087(start)S 5568 V 1440(the)S 1588(next)S 1786(iteration.)S 5736 V 10 B 1080(halt)S 10 R 1440(The)S 1624(halt)S 1802(statement)S 2215(\(an)S 2371(extension\))S 2817(is)S 2912(an)S 3035(executed)S 3421(statement)S 3835(that)S 4014(causes)S 4305(the)S 10 B 4456(bc)S 10 R 4585(processor)S 4999(to)S 5105(quit)S 5856 V 1440(only)S 1662(when)S 1924(it)S 2024(is)S 2135(executed.)S 2587(For)S 2771(example,)S 3181("if)S 3328(\(0)S 3456(==)S 3614(1\))S 3742(halt")S (will)157 3977 A 4177(not)S 4348(cause)S 10 B 4615(bc)S 10 R 4759(to)S 4880(terminate)S 5976 V (because)319 1440 A 1784(the)S 1932(halt)S 2108(is)S 2200(not)S 2353(executed.)S 6144 V 10 B 1080(return)S 10 R 1440(Return)S 1739(the)S 1887(value)S 2130(0)S 2205(from)S 2426(a)S 2496(function.)S 2906(\(See)S 3111(the)S 3259(section)S 3569(on)S 3694(functions.\))S 6312 V 10 B 1080(return)S 10 R 1386(\()S 1445(expression)S 1900(\))S 6432 V 1440(Return)S 1739(the)S 1887(value)S 2130(of)S 2239(the)S 2387(expression)S 2842(from)S 3063(a)S 3133(function.)S 3543(\(See)S 3748(the)S 3896(section)S 4206(on)S 4331(functions.\))S 6600 V 870(P)S 872(PS)S 930(SE)S 988(EU)S 1052(UD)S 1127(DO)S 1202(O)S 1318(S)S 1320(ST)S 1378(TA)S 1442(AT)S 1517(TE)S 1581(EM)S 1645(ME)S 1736(EN)S 1800(NT)S 1875(TS)S 1939(S)S 6720 V 1080(These)S 1352(statements)S 1808(are)S 1963(not)S 2122(statements)S 2579(in)S 2689(the)S (traditional)414 2844 A 3290(sense.)S 3590(They)S 3829(are)S 3985(not)S 4145(executed)S 4535(statements.)S 5042(Their)S 6840 V 1080(function)S 1440(is)S 1532(performed)S 1977(at)S 2075("compile")S 2506(time.)S 7008 V 10 B 1080(limits)S 10 R 1440(Print)S 1661(the)S 1809(local)S 2030(limits)S 2284(enforced)S 2662(by)S 2787(the)S 2935(local)S 3156(version)S 3477(of)S 10 B 3586(bc)S 10 R 3687(.)S 3762(This)S 3966(is)S 4058(an)S 4178(extension.)S 7176 V 10 B 1080(quit)S 10 R 1440(When)S 1713(the)S 1869(quit)S 2058(statement)S 2477(is)S 2577(read,)S 2809(the)S 10 B 2965(bc)S 10 R 3099(processor)S 3518(is)S 3618(terminated,)S 4107(regardless)S 4549(of)S 4667(where)S 4948(the)S 5105(quit)S 7296 V 1440(statement)S 1851(is)S (found.)259 1943 A 2252(For)S 2417(example,)S 2808("if)S 2936(\(0)S 3045(==)S 3184(1\))S 3293(quit")S (will)157 3515 A 3697(cause)S 10 B 3946(bc)S 10 R 4072(to)S 4175(terminate.)S 7903 V 720(Page)S 941(5)S 2936(\()S 2978(.)S 3011(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 6 6 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 10 B 1080(warranty)S 1080 V 10 R 1440(Print)S 1661(a)S (longer)257 1731 A 2013(warranty)S 2397(notice.)S 2718(This)S 2922(is)S 3014(an)S 3134(extension.)S 1248 V 870(F)S 872(FU)S 930(UN)S 1005(NC)S 1080(CT)S 1149(TI)S 1213(IO)S 1249(ON)S 1324(NS)S 1399(S)S 1368 V 1080(Functions)S 1517(provide)S 1865(a)S (method)301 1951 A 2293(of)S 2418(de\256ning)S 2788(a)S 2874(computation)S 3418(that)S 3611(can)S 3793(be)S 3930(executed)S 4330(later.)S 4602(Functions)S 5040(in)S 10 B 5160(bc)S 1488 V 10 R 1080(always)S 1388(compute)S 1762(a)S 1835(value)S 2081(and)S 2254(return)S 2523(it)S 2607(to)S 2713(the)S 2864(caller.)S 3167(Function)S (de\256nitions)424 3552 A 4004(are)S ("dynamic")428 4155 A 4610(in)S 4715(the)S 4865(sense)S 5110(that)S 1608 V 1080(a)S 1156(function)S 1522(is)S (unde\256ned)396 1620 A (until)184 2047 A 2262(a)S (de\256nition)385 2338 A 2754(is)S (encountered)492 2852 A 3375(in)S 3484(the)S (input.)231 3638 A 3925(That)S (de\256nition)385 4141 A 4557(is)S 4656(then)S 4861(used)S (until)184 5077 A 1728 V 1080(another)S (de\256nition)385 1422 A 1846(function)S 2220(for)S 2377(the)S 2539(same)S 2785(name)S 3042(is)S (encountered.)517 3148 A 3729(The)S 3925(new)S (de\256nition)385 4132 A 4556(then)S (replaces)331 4768 A 5138(the)S 1848 V 1080(older)S (de\256nition.)410 1312 A 1772(A)S 1870(function)S 2230(is)S 2322(de\256ned)S 2643(as)S 2752(follows:)S 1968 V 10 B 1440(de\256ne)S 10 I 1723(name)S 10 B 1966(\()S 10 I 2025(parameters)S 10 B 2508(\))S 2567({)S 10 I 2632(newline)S 2088 V 1540(auto_list)S 1966(statement_list)S 10 B 2550(})S 2208 V 10 R 1080(A)S 1178(function)S 1538(call)S 1709(is)S 1801(just)S 1971(an)S 2091(expression)S 2546(of)S 2655(the)S 2803(form)S 3024(")S 10 I 3065(name)S 10 B 3283(\()S 10 I 3317(parameters)S 10 B 3775(\))S 10 R 3809(".)S 2376 V 1080(Parameters)S 1562(are)S 1719(numbers)S 2098(or)S 2216(arrays)S 2497(\(an)S 2660(extension\).)S 3163(In)S 3281(the)S 3438(function)S (de\256nition,)410 3807 A 4251(zero)S 4459(or)S 4577(more)S 4818(parameters)S 2496 V 1080(are)S 1238(de\256ned)S 1568(by)S 1702(listing)S 1987(their)S 2205(names)S 2495(separated)S 2909(by)S 3042(commas.)S 3460(Numbers)S 3862(are)S 4019(only)S 4230(call)S 4409(by)S 4542(value)S 4793(parameters.)S 2616 V 1080(Arrays)S 1400(are)S 1569(only)S 1792(call)S 1983(by)S 2128(variable.)S 2548(Arrays)S 2869(are)S 3039(speci\256ed)S 3443(in)S 3567(the)S 3736(parameter)S (de\256nition)385 4186 A 4617(by)S 4763(the)S 4932(notation)S 2736 V 1080(")S 10 I 1121(name)S 10 B 1339([])S 10 R 1407(".)S 1564(In)S 1689(the)S 1853(function)S 2229(call,)S 2441(actual)S 2723(parameters)S 3207(are)S 3372(full)S 3553(expressions)S 4063(for)S 4222(number)S 4570(parameters.)S 5104(The)S 2856 V 1080(same)S 1312(notation)S 1666(is)S 1758(used)S 1967(for)S 2110(passing)S 2436(arrays)S 2708(as)S 2817(for)S 2960(de\256ning)S 3314(array)S 3547(parameters.)S 4065(The)S 4247(named)S 4540(array)S 4774(is)S 4867(passed)S 5161(by)S 2976 V 1080(variable)S 1449(to)S 1571(the)S 1737(function.)S 2165(Since)S 2432(function)S (de\256nitions)424 2810 A 3277(are)S (dynamic,)371 3444 A 3858(parameter)S 4305(numbers)S 4694(and)S 4882(types)S 5137(are)S 3096 V 1080(checked)S 1441(when)S 1690(a)S 1766(function)S 2132(is)S 2230(called.)S 2552(Any)S 2756(mismatch)S 3178(in)S 3287(number)S 3625(or)S 3740(types)S 3983(of)S 4098(parameters)S (will)157 4572 A 4760(cause)S 5016(a)S 5093(run-)S 3216 V 1080(time)S 1284(error.)S 1556(A)S 1654(runtime)S 1992(error)S (will)157 2214 A 2396(also)S 2583(occur)S 2832(for)S 2975(the)S 3123(call)S 3294(to)S 3397(an)S (unde\256ned)396 3517 A 3938(function.)S 3384 V 1080(The)S 10 I 1275(auto_list)S 10 R 1664(is)S 1769(an)S 1903(optional)S 2271(list)S 2433(of)S 2556(variables)S 2959(that)S 3149(are)S 3312(for)S 3469("local")S 3786(use.)S 4009(The)S 4205(syntax)S 4506(of)S 4629(the)S 4791(auto)S 5003(list)S 5165(\(if)S 3504 V 1080(present\))S 1434(is)S 1530(")S 10 B 1571(auto)S 10 I 1790(name)S 10 R 2008(,)S (...)75 2061 A 2164(;".)S 2311(\(The)S 2530(semicolon)S 2971(is)S 3066(optional.\))S 3507(Each)S 10 I 3737(name)S 10 R 3983(is)S 4078(the)S 4229(name)S 4475(of)S 4587(an)S 4710(auto)S 4911(variable.)S 3624 V 1080(Arrays)S 1385(may)S 1588(be)S 1713(speci\256ed)S 2101(by)S 2231(using)S 2478(the)S 2631(same)S 2868(notation)S 3227(as)S 3341(used)S 3555(in)S 3664(parameters.)S 4188(These)S 4460(variables)S 4855(have)S 5076(their)S 3744 V 1080(values)S 1372(pushed)S 1691(onto)S 1904(a)S 1984(stack)S 2226(at)S 2334(the)S 2492(start)S 2701(of)S 2820(the)S 2978(function.)S 3398(The)S 3590(variables)S 3989(are)S 4148(then)S (initialized)403 4356 A 4794(to)S 4907(zero)S 5116(and)S 3864 V 1080(used)S (throughout)440 1294 A 1764(the)S 1917(execution)S 2338(of)S 2452(the)S 2605(function.)S 3020(At)S 3151(function)S 3516(exit,)S 3722(these)S 3960(variables)S 4355(are)S (popped)295 4510 A 4836(so)S 4956(that)S 5138(the)S 3984 V 1080(original)S 1434(value)S 1692(\(at)S 1839(the)S 2002(time)S 2221(of)S 2345(the)S 2508(function)S 2883(call\))S 3103(of)S 3227(these)S 3474(variables)S 3878(are)S 4042(restored.)S 4457(The)S 4654(parameters)S 5137(are)S 4104 V 1080(really)S 1337(auto)S 1537(variables)S 1928(that)S 2106(are)S (initialized)403 2257 A 2688(to)S 2794(a)S 2867(value)S 3113(provided)S 3498(in)S 3604(the)S 3755(function)S 4118(call.)S 4342(Auto)S 4571(variables)S 4963(are)S 5115(dif-)S 4224 V 1080(ferent)S 1344(than)S (traditional)414 1545 A 1987(local)S 2211(variables)S 2603(in)S 2709(the)S 2860(fact)S 3040(that)S 3219(if)S 3309(function)S 3672(A)S 3773(calls)S 3986(function)S 4349(B,)S 4469(B)S 4563(may)S (access)258 4763 A 5048(func-)S 4344 V 1080(tion)S 1266(A's)S 1442(auto)S 1645(variables)S 2039(by)S 2169(just)S 2344(using)S 2591(the)S 2744(same)S 2981(name,)S 3254(unless)S 3535(function)S 3901(B)S 3999(has)S 4164(called)S 4436(them)S 4668(auto)S 4872(variables.)S 4464 V 1080(Due)S 1278(to)S 1386(the)S 1539(fact)S 1721(that)S 1901(auto)S 2103(variables)S 2496(and)S 2670(parameters)S 3142(are)S 3295(pushed)S 3608(onto)S 3815(a)S 3889(stack,)S 10 B 4150(bc)S 10 R (supports)340 4280 A 4649(recursive)S 5048(func-)S 4584 V 1080(tions.)S 4752 V 1080(The)S 1271(function)S (body)200 1640 A 1874(is)S 1975(a)S 2054(list)S 2212(of)S 10 B 2331(bc)S 10 R 2467(statements.)S 2977(Again,)S 3283(statements)S 3743(are)S 3902(separated)S 4318(by)S 4453(semicolons)S 4940(or)S 5059(new-)S 4872 V 1080(lines.)S 1353(Return)S 1660(statements)S 2118(cause)S 2375(the)S 2531(termination)S 3028(of)S 3144(a)S 3221(function)S 3588(and)S 3765(the)S 3920(return)S 4193(of)S 4309(a)S 4386(value.)S 4686(There)S 4954(are)S 5110(two)S 4992 V 1080(versions)S 1442(of)S 1553(the)S 1703(return)S 1971(statement.)S 2434(The)S 2618(\256rst)S 2802(form,)S 3050(")S 10 B 3091(return)S 10 R 3372(",)S 3465(returns)S 3772(the)S 3923(value)S 4169(0)S 4247(to)S 4353(the)S (calling)274 4504 A 4806(expression.)S 5112 V 1080(The)S (second)279 1268 A 1577(form,)S 1828(")S 10 B 1869(return)S 2180(\()S 10 I 2244(expression)S 10 B 2704(\))S 10 R 2738(",)S 2834(computes)S 3249(the)S 3402(value)S 3650(of)S 3764(the)S 3917(expression)S 4377(and)S 4552(returns)S 4862(that)S 5043(value)S 5232 V 1080(to)S 1186(the)S (calling)274 1337 A 1639(expression.)S 2148(There)S 2413(is)S 2509(an)S 2633(implied)S 2969(")S 10 B 3010(return)S 3320(\(0\))S 10 R 3438(")S 3508(at)S 3610(the)S 3762(end)S 3936(of)S 4049(every)S 4302(function.)S 4716(This)S 4924(allows)S 5216(a)S 5352 V 1080(function)S 1440(to)S 1543(terminate)S 1949(and)S 2119(return)S 2385(0)S (without)307 2460 A 2792(an)S 2912(explicit)S 3239(return)S 3505(statement.)S 5520 V 1080(Functions)S 1506(also)S 1698(change)S 2013(the)S 2166(usage)S 2425(of)S 2539(the)S 2692(variable)S 10 B 3047(ibase)S 10 R 3265(.)S 3345(All)S 3504(constants)S 3908(in)S 4017(the)S 4171(function)S (body)200 4537 A (will)157 4768 A 4956(be)S 5082(con-)S 5640 V 1080(verted)S 1358(using)S 1601(the)S 1750(value)S 1994(of)S 10 B 2104(ibase)S 10 R 2348(at)S 2447(the)S 2596(time)S 2801(of)S 2911(the)S 3060(function)S 3421(call.)S 3642(Changes)S 4013(of)S 10 B 4122(ibase)S 10 R (will)157 4365 A 4547(be)S (ignored)307 4667 A 4999(during)S 5760 V 1080(the)S 1234(execution)S 1656(of)S 1771(the)S 1925(function)S 2291(except)S 2585(for)S 2734(the)S 2888(standard)S 3260(function)S 10 B 3626(read)S 10 R 3822(,)S 3878(which)S (will)157 4155 A 4343(always)S 4654(use)S 4820(the)S 4975(current)S 5880 V 1080(value)S 1323(of)S 10 B 1432(ibase)S 10 R 1675(for)S (conversion)441 1818 A 2284(of)S 2393(numbers.)S 6048 V 870(M)S 872(MA)S 963(AT)S 1038(TH)S 1102(H)S 1218(L)S 1220(LI)S 1284(IB)S 1320(BR)S 1389(RA)S 1458(AR)S 1533(RY)S 1602(Y)S 6168 V 1080(If)S 10 B 1179(bc)S 10 R 1311(is)S (invoked)323 1409 A 1763(with)S 1973(the)S 10 B 2127(-l)S 10 R 2220(option,)S 2532(a)S 2608(math)S 2840(library)S 3140(is)S 3238(preloaded)S 3666(and)S 3843(the)S 3998(default)S 4310(scale)S 4544(is)S 4643(set)S 4787(to)S 4897(20.)S 5104(The)S 6288 V 1080(math)S 1320(functions)S (will)157 1732 A 1927(calculate)S 2324(their)S 2547(results)S 2848(to)S 2964(the)S 3125(scale)S 3365(set)S 3515(at)S 3626(the)S 3787(time)S 4004(of)S 4126(their)S 4349(call.)S 4558(The)S 4753(math)S 4992(library)S 6408 V 1080(de\256nes)S 1390(the)S 1538(following)S 1954(functions:)S 6576 V 1080(s)S 1144(\()S 10 I 1178(x)S 10 R 1223(\))S 1440(The)S 1622(sine)S 1809(of)S 1918(x)S 1993(in)S 2096(radians.)S 6744 V 1080(c)S 1150(\()S 10 I 1184(x)S 10 R 1229(\))S 1440(The)S 1622(cosine)S 1904(of)S 2013(x)S 2088(in)S 2191(radians.)S 6912 V 1080(a)S 1150(\()S 10 I 1184(x)S 10 R 1229(\))S 1440(The)S 1622(arctangent)S 2067(of)S 2176(x.)S 7080 V 1080(l)S 1133(\()S 10 I 1167(x)S 10 R 1212(\))S 1440(The)S 1622(natural)S 1927(logarithm)S 2343(of)S 2452(x.)S 7248 V 1080(e)S 1150(\()S 10 I 1184(x)S 10 R 1229(\))S 1440(The)S (exponential)469 1622 A 2116(function)S 2476(of)S 2585(raising)S 2884(e)S 2954(to)S 3057(the)S 3205(value)S 3448(x.)S 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 2936(\()S 2978(.)S 3011(\))S 4990(Page)S 5211(6)S 8143 V EP %%Page: 7 7 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1080(j)S 1133(\()S 10 I 1167(n,x)S 10 R 1287(\))S 1440(The)S 1622(bessel)S 1893(function)S 2253(of)S 2362(integer)S 2667(order)S 2905(n)S 2980(of)S 3089(x.)S 1128 V 870(E)S 872(EX)S 936(XA)S 1011(AM)S 1086(MP)S 1177(PL)S 1235(LE)S 1299(ES)S 1363(S)S 1248 V 1080(In)S 1189(/bin/sh,)S 1537(the)S 1685(following)S (will)157 2101 A 2283(assign)S 2559(the)S 2707(value)S 2950(of)S 3059("pi")S 3244(to)S 3347(the)S 3495(shell)S 3710(variable)S 10 B 4060(pi)S 10 R 4144(.)S 1488 V 10 B 1440(pi=$\(echo)S 1886("scale=10;)S (4*a\(1\)")324 2365 A 2714(|)S 2761(bc)S 2887(-l\))S 1776 V 10 R 1080(The)S 1272(following)S 1698(is)S 1800(the)S (de\256nition)385 1958 A 2378(of)S 2497(the)S (exponential)469 2655 A 3159(function)S 3529(used)S 3748(in)S 3861(the)S 4019(math)S 4255(library.)S 4609(This)S 4823(function)S 5194(is)S 1896 V (written)286 1080 A 1391(in)S 1494(POSIX)S 10 B 1811(bc)S 10 R 1912(.)S 2136 V 10 B 1440(scale)S 1672(=)S 1754(20)S 2376 V 1440(/*)S 1543(Uses)S 1764(the)S 1924(fact)S 2112(that)S 2311(e\303x)S 2465(=)S (\(e\303\(x/2\)\)\3032)427 2547 A 2496 V 1515(When)S 1797(x)S 1872(is)S 1964(small)S 2218(enough,)S 2581(we)S 2724(use)S 2889(the)S 3049(series:)S 2616 V 1565(e\303x)S 1719(=)S 1801(1)S 1876(+)S 1958(x)S 2033(+)S 2115(x\3032/2!)S 2386(+)S 2468(x\3033/3!)S 2739(+)S (...)75 2821 A 2736 V 1440(*/)S 2976 V 1440(de\256ne)S 1723(e\(x\))S 1911({)S 3096 V 1490(auto)S 1730(a,)S 1830(d,)S 1936(e,)S 2031(f,)S 2115(i,)S 2193(m,)S 2327(v,)S 2427(z)S 3336 V 1490(/*)S 1593(Check)S 1893(the)S 2053(sign)S 2251(of)S 2360(x.)S 2460(*/)S 3456 V 1490(if)S 1577(\(x<0\))S 1827({)S 3576 V 1540(m)S 1649(=)S 1731(1)S 3696 V 1540(x)S 1615(=)S 1697(-x)S 3816 V 1490(})S 4056 V 1490(/*)S (Precondition)555 1593 A 2173(x.)S 2273(*/)S 4176 V 1490(z)S 1560(=)S 1642(scale;)S 4296 V 1490(scale)S 1722(=)S 1804(4)S 1879(+)S 1961(z)S 2031(+)S (.44*x;)259 2113 A 4416 V 1490(while)S 1745(\(x)S 1854(>)S 1936(1\))S 2045({)S 4536 V 1540(f)S 1599(+=)S 1738(1;)S 4656 V 1540(x)S 1615(/=)S 1725(2;)S 4776 V 1490(})S 5016 V 1490(/*)S 1593(Initialize)S 1999(the)S 2159(variables.)S 2600(*/)S 5136 V 1490(v)S 1565(=)S 1647(1+x)S 5256 V 1490(a)S 1565(=)S 1647(x)S 5376 V 1490(d)S 1571(=)S 1653(1)S 5616 V 1490(for)S 1644(\(i=2;)S 1872(1;)S 1981(i++\))S 2182({)S 5736 V 1540(e)S 1610(=)S 1692(\(a)S 1801(*=)S 1933(x\))S 2042(/)S 2095(\(d)S 2210(*=)S 2342(i\))S 5856 V 1540(if)S 1627(\(e)S 1731(==)S 1870(0\))S 1979({)S 5976 V 1590(if)S 1677(\(f>0\))S 1911(while)S (\(f--\))170 2166 A 2386(v)S 2461(=)S (v*v;)184 2543 A 6096 V 1590(scale)S 1822(=)S 1904(z)S 6216 V 1590(if)S 1677(\(m\))S 1854(return)S 2160(\(1/v\);)S 6336 V 1590(return)S 1896(\(v/1\);)S 6456 V 1540(})S 6576 V 1540(v)S 1615(+=)S 1754(e)S 6696 V 1490(})S 6816 V 1440(})S 7104 V 10 R 1080(The)S 1262(following)S 1678(is)S 1770(code)S 1985(that)S 2161(uses)S 2359(the)S 2507(extended)S 2895(features)S 3240(of)S 10 B 3350(bc)S 10 R 3477(to)S 3581(implement)S 4037(a)S 4108(simple)S 4402(program)S 4769(for)S 4913(calculat-)S 7224 V 1080(ing)S (checkbook)435 1239 A 1705(balances.)S 2133(This)S 2343(program)S 2715(is)S 2813(best)S 3006(kept)S 3210(in)S 3319(a)S 3395(\256le)S 3555(so)S 3675(that)S 3857(it)S 3944(can)S 4114(be)S 4239(used)S 4453(many)S 4706(times)S (without)307 4954 A 7344 V 1080(having)S 1378(to)S 1481(retype)S 1758(it)S 1839(at)S 1937(every)S 2186(use.)S 7903 V 720(Page)S 941(7)S 2936(\()S 2978(.)S 3011(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 8 8 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 10 B 1440(scale=2)S 1080 V 1440(print)S 1684("\\nCheck)S 2124(book)S 2361(program!\\n")S 1200 V 1440(print)S 1684(")S 1790(Remember,)S 2317(deposits)S 2689(are)S 2854(negative)S 3237(transactions.\\n")S 1320 V 1440(print)S 1684(")S 1790(Exit)S 1994(by)S 2125(a)S 2200(0)S 2275(transaction.\\n\\n")S 1560 V 1440(print)S 1684("Initial)S 2028(balance?)S 2433(";)S 2548(bal)S 2707(=)S 2789(read\(\))S 1680 V 1440(bal)S 1599(/=)S 1709(1)S 1800 V 1440(print)S 1684("\\n")S 1920 V 1440(while)S 1695(\(1\))S 1838({)S 2040 V ("current)382 1490 A 1897(balance)S 2252(=)S 2334(";)S 2449(bal)S 2160 V 1490("transaction?)S 2108(";)S 2223(trans)S 2472(=)S 2554(read\(\))S 2280 V 1490(if)S 1577(\(trans)S 1860(==)S 1999(0\))S 2108(break;)S 2400 V 1490(bal)S 1649(-=)S 1765(trans)S 2520 V 1490(bal)S 1649(/=)S 1759(1)S 2640 V 1440(})S 2760 V 1440(quit)S 3048 V 10 R 1080(The)S 1262(following)S 1678(is)S 1770(the)S (de\256nition)385 1918 A 2328(of)S 2437(the)S 2585(recursive)S 2980(factorial)S 3342(function.)S 3288 V 10 B 1440(de\256ne)S 1723(f)S 1782(\(x\))S 1925({)S 3408 V 1490(if)S 1577(\(x)S 1686(<=)S 1825(1\))S 1934(return)S 2240(\(1\);)S 3528 V 1490(return)S (\(f\(x-1\))270 1796 A 2091(*)S 2166(x\);)S 3648 V 1440(})S 3936 V 10 R 870(D)S 872(DI)S 947(IF)S 983(FF)S 1041(FE)S 1099(ER)S 1163(RE)S 1232(EN)S 1296(NC)S 1371(CE)S 1440(ES)S 1504(S)S 4056 V 1080(This)S 1293(version)S 1623(of)S 10 B 1741(bc)S 10 R 1876(was)S 2067(implemented)S 2626(from)S 2856(the)S 3013(POSIX)S (P1003.2/D11)532 3339 A 3905(draft)S 4131(and)S 4311(contains)S 4681(several)S 5002(differ-)S 4176 V 1080(ences)S 1333(and)S 1507(extensions)S 1960(relative)S 2292(to)S 2399(the)S 2551(draft)S 2771(and)S (traditional)414 2945 A 3388(implementations.)S 4137(It)S 4228(is)S 4323(not)S 4479(implemented)S 5032(in)S 5138(the)S 4296 V (traditional)414 1080 A 1522(way)S 1718(using)S 10 I 1963(dc\(1\).)S 10 R 2229(This)S 2436(version)S 2761(is)S 2857(a)S 2931(single)S 3200(process)S 3531(which)S 3806(parses)S 4087(and)S 4261(runs)S 4463(a)S 4537(byte)S 4739(code)S 4958(transla-)S 4416 V 1080(tion)S 1263(of)S 1374(the)S 1524(program.)S 1941(There)S 2203(is)S 2296(an)S ("undocumented")673 2417 A 3116(option)S 3398(\(-c\))S 3571(that)S 3748(causes)S 4037(the)S 4186(program)S 4553(to)S 4657(output)S 4939(the)S 5088(byte)S 4536 V 1080(code)S 1309(to)S 1426(the)S 1588(standard)S 1968(output)S 2263(instead)S 2587(of)S (running)312 2710 A 3061(it.)S 3206(It)S 3307(was)S 3503(mainly)S 3821(used)S 4045(for)S (debugging)423 4203 A 4666(the)S 4829(parser)S 5116(and)S 4656 V 1080(preparing)S 1491(the)S 1639(math)S 1865(library.)S 4824 V 1080(A)S 1182(major)S 1446(source)S 1738(of)S 1851(differences)S 2329(is)S 2425(extensions,)S 2903(where)S 3179(a)S 3253(feature)S 3563(is)S 3659(extended)S 4052(to)S 4160(add)S 4335(more)S (functionality)514 4572 A 5116(and)S 4944 V (additions,)393 1080 A 1498(where)S 1770(new)S 1963(features)S 2308(are)S 2457(added.)S 2747(The)S 2929(following)S 3345(is)S 3437(the)S 3585(list)S 3733(of)S 3842(differences)S 4316(and)S 4486(extensions.)S 5112 V (LANG)281 1080 A 1630(This)S 1848(version)S 2183(does)S 2406(not)S 2573(conform)S 2953(to)S 3070(the)S 3232(POSIX)S 3563(standard)S 3943(in)S 4060(the)S 4223(processing)S 4693(of)S 4817(the)S (LANG)281 4980 A 5232 V 1630(environment)S 2163(variable)S 2513(and)S 2683(all)S 2809(environment)S 3342(variables)S 3731(starting)S 4058(with)S 4262(LC_.)S 5400 V 1080(names)S (Traditional)448 1630 A 2115(and)S 2297(POSIX)S 10 B 2626(bc)S 10 R 2764(have)S 2992(single)S 3270(letter)S 3516(names)S 3811(for)S 3967(functions,)S 4404(variables)S 4806(and)S 4989(arrays.)S 5520 V 1630(They)S 1863(have)S 2079(been)S 2295(extended)S 2684(to)S 2788(be)S (multi-character)617 2908 A 3550(names)S 3832(that)S 4008(start)S 4207(with)S 4411(a)S 4481(letter)S 4714(and)S 4884(may)S 5082(con-)S 5640 V 1630(tain)S 1806(letters,)S 2103(numbers)S 2474(and)S 2644(the)S (underscore)442 2792 A 3259(character.)S 5808 V 1080(Strings)S 1630(Strings)S 1950(are)S 2110(not)S 2274(allowed)S 2629(to)S 2743(contain)S 3075(NUL)S 3319(characters.)S 3815(POSIX)S 4143(says)S 4352(all)S 4489(characters)S 4935(must)S 5166(be)S 5928 V 1630(included)S 2001(in)S 2104(strings.)S 6096 V 1080(last)S 1630(POSIX)S 10 B 1953(bc)S 10 R 2085(does)S 2300(not)S 2459(have)S 2680(a)S 10 B 2756(last)S 10 R 2939(variable.)S 3346(Some)S 3607(implementations)S 4309(of)S 10 B 4425(bc)S 10 R 4558(use)S 4724(the)S 4879(period)S 5168(\(.\))S 6216 V 1630(in)S 1733(a)S 1803(similar)S 2108(way.)S 6384 V 1080(comparisons)S 1630(POSIX)S 10 B 1967(bc)S 10 R 2113(allows)S 2421(comparisons)S 2974(only)S 3197(in)S 3320(the)S 3488(if)S 3595(statement,)S 4051(the)S 4220(while)S 4490(statement,)S 4947(and)S 5138(the)S 6504 V (second)279 1630 A 1940(expression)S 2401(of)S 2516(the)S 2670(for)S 2819(statement.)S 3286(Also,)S 3532(only)S 3741(one)S 3916(relational)S 4327(operation)S 4737(is)S 4834(allowed)S 5183(in)S 6624 V (each)185 1630 A 1840(of)S 1949(those)S 2186(statements.)S 6792 V 1080(if)S 1167(statement,)S 1603(else)S 1785(clause)S 6912 V 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(does)S 2282(not)S 2435(have)S 2650(an)S 2770(else)S 2952(clause.)S 7080 V 1080(for)S 1223(statement)S 7200 V 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(requires)S 2423(all)S 2549(expressions)S 3043(to)S 3146(be)S 3266(present)S 3582(in)S 3685(the)S 3833(for)S 3976(statement.)S 7368 V 1080(&&,)S 1286(||,)S 1376(!)S 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(does)S 2282(not)S 2435(have)S 2650(the)S 2798(logical)S 3097(operators.)S 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 2936(\()S 2978(.)S 3011(\))S 4990(Page)S 5211(8)S 8143 V EP %%Page: 9 9 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1080(read)S 1279(function)S 1080 V 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(does)S 2282(not)S 2435(have)S 2650(a)S 2720(read)S 2919(function.)S 1248 V 1080(print)S 1295(statement)S 1368 V 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(does)S 2282(not)S 2435(have)S 2650(a)S 2720(print)S 2935(statement)S 3346(.)S 1536 V 1080(continue)S 1451(statement)S 1656 V 1630(POSIX)S 10 B 1947(bc)S 10 R 2073(does)S 2282(not)S 2435(have)S 2650(a)S 2720(continue)S 3091(statement.)S 1824 V 1080(array)S 1313(parameters)S 1944 V 1630(POSIX)S 10 B 1955(bc)S 10 R 2090(does)S 2308(not)S 2470(have)S 2694(array)S 2936(parameters.)S 3463(Other)S 3727(implementations)S 4431(of)S 10 B 4549(bc)S 10 R 4684(may)S 4891(have)S 5115(call)S 2064 V 1630(by)S 1755(value)S 1998(array)S 2231(parameters.)S 2232 V 1080(=+,)S 1244(=-,)S 1385(=*,)S 1542(=/,)S 1677(=%,)S 1868(=\303)S 2352 V 1630(POSIX)S 10 B 1961(bc)S 10 R 2101(does)S 2324(not)S 2491(require)S 2816(these)S 3062("old)S 3270(style")S 3540(assignment)S 4031(operators)S 4445(to)S 4562(be)S 4696(de\256ned.)S 5082(This)S 2472 V 1630(version)S 1962(may)S 2171(allow)S 2431(these)S 2674("old)S 2879(style")S 3146(assignments.)S 3723(Use)S 3916(the)S 4075(limits)S 4340(statement)S 4762(to)S 4876(see)S 5041(if)S 5138(the)S 2592 V 1630(installed)S 2005(version)S (supports)340 2336 A 2711(them.)S 2997(If)S 3100(it)S 3191(does)S (support)301 3410 A 3746(the)S 3904("old)S 4108(style")S 4374(assignment)S 4861(operators,)S 2712 V 1630(the)S 1778(statement)S 2189("a)S 2300(=-)S 2416(1")S (will)157 2532 A 2714(decrement)S 10 B 3159(a)S 10 R 3234(by)S 3359(1)S 3434(instead)S 3744(of)S (setting)268 3853 A 10 B 4146(a)S 10 R 4221(to)S 4324(the)S 4472(value)S 4715(-1.)S 2880 V (spaces)263 1080 A 1368(in)S 1471(numbers)S 3000 V 1630(Other)S 1904(implementations)S 2619(of)S 10 B 2748(bc)S 10 R 2894(allow)S (spaces)263 3163 A 3471(in)S 3594(numbers.)S 4035(For)S 4220(example,)S 4631("x=1)S 4874(3")S 5010(would)S 3120 V 1630(assign)S 1913(the)S 2068(value)S 2318(13)S 2450(to)S 2560(the)S 2715(variable)S 3072(x.)S 3204(The)S 3393(same)S 3632(statement)S 4049(would)S 4331(cause)S 4586(a)S 4662(syntax)S 4955(error)S 5183(in)S 3240 V 1630(this)S 1800(version)S 2121(of)S 10 B 2230(bc)S 10 R 2331(.)S 3408 V 1080(errors)S 1341(and)S 1511(execution)S 3528 V 1630(This)S 1849(implementation)S 2520(varies)S 2801(from)S 3037(other)S 3284(implementations)S 3994(in)S 4112(terms)S 4376(of)S 4500(what)S 4737(code)S (will)157 4968 A 5166(be)S 3648 V 1630(executed)S 2030(when)S 2289(syntax)S 2592(and)S 2778(other)S 3026(errors)S 3303(are)S (found)234 3468 A 3743(in)S 3862(the)S 4026(program.)S 4458(If)S 4567(a)S 4653(syntax)S 4956(error)S 5194(is)S 3768 V (found)234 1630 A 1889(in)S 1992(a)S 2062(function)S (de\256nition,)410 2423 A 2859(error)S 3082(recovery)S 3461(tries)S 3661(to)S 3765(\256nd)S 3947(the)S 4096(beginning)S 4523(of)S 4633(a)S 4704(statement)S 5116(and)S 3888 V 1630(continue)S 2006(to)S 2114(parse)S 2357(the)S 2510(function.)S 2925(Once)S 3168(a)S 3243(syntax)S 3535(error)S 3762(is)S (found)234 3859 A 4123(in)S 4231(the)S 4384(function,)S 4774(the)S 4926(function)S 4008 V (will)157 1630 A 1825(not)S 1991(be)S 2124(callable)S 2476(and)S 2659(becomes)S (unde\256ned.)421 3049 A 3533(Syntax)S 3851(errors)S 4126(in)S 4243(the)S 4405(interactive)S 4870(execution)S 4128 V 1630(code)S (will)157 1847 A 2031(invalidate)S 2455(the)S 2605(current)S 2918(execution)S 3336(block.)S 3636(The)S 3820(execution)S 4238(block)S 4488(is)S 4582(terminated)S 5040(by)S 5166(an)S 4248 V 1630(end)S 1800(of)S 1909(line)S 2085(that)S 2261(appears)S 2594(after)S 2805(a)S 2875(complete)S 3269(sequence)S 3663(of)S 3772(statements.)S 4272(For)S 4437(example,)S 4368 V 1630(a)S 1700(=)S 1782(1)S 4488 V 1630(b)S 1705(=)S 1787(2)S 4608 V 1080(has)S 1239(two)S 1415(execution)S 1831(blocks)S 2118(and)S 4728 V 1630({)S 1703(a)S 1773(=)S 1855(1)S 4848 V 1680(b)S 1755(=)S 1837(2)S 1912(})S 4968 V 1080(has)S 1258(one)S 1447(execution)S 1882(block.)S 2199(Any)S 2416(runtime)S 2773(error)S (will)157 3014 A 3215(terminate)S 3640(the)S 3807(execution)S 4242(of)S 4371(the)S 4539(current)S 4870(execution)S 5088 V 1080(block.)S 1378(A)S 1476(runtime)S 1814(warning)S (will)157 2169 A 2351(not)S 2504(terminate)S 2910(the)S 3058(current)S 3369(execution)S 3785(block.)S 5256 V 1080(Interrupts)S 1630(During)S 1959(an)S 2098(interactive)S 2568(session,)S 2927(the)S 3094(SIGINT)S 3471(signal)S 3756(\(usually)S 4125(generated)S 4562(by)S 4707(the)S 4875(control-C)S 5376 V 1630(character)S 2041(from)S 2277(the)S 2440(terminal\))S (will)157 2850 A 3047(cause)S 3311(execution)S 3742(of)S 3866(the)S 4029(current)S 4355(execution)S 4786(block)S 5049(to)S 5166(be)S 5496 V 1630(interrupted.)S 2157(It)S (will)157 2254 A 2446(display)S 2771(a)S 2851("runtime")S 3281(error)S 3513(indicating)S 3950(which)S 4231(function)S 4601(was)S 4794(interrupted.)S 5616 V 1630(After)S 1873(all)S 2003(runtime)S 2345(structures)S 2766(have)S 2985(been)S 3204(cleaned)S 3541(up,)S 3695(a)S 3769(message)S (will)157 4139 A 4325(be)S 4449(printed)S 4763(to)S 4870(notify)S 5138(the)S 5736 V 1630(user)S 1826(that)S 10 B 2005(bc)S 10 R 2134(is)S 2229(ready)S 2481(for)S 2627(more)S (input.)231 2862 A 3146(All)S 3303(previously)S 3755(de\256ned)S 4079(functions)S 4482(remain)S 4791(de\256ned)S 5116(and)S 5856 V 1630(the)S 1779(value)S 2023(of)S 2133(all)S (non-auto)357 2260 A 2643(variables)S 3033(are)S 3183(the)S 3332(value)S 3576(at)S 3675(the)S 3824(point)S 4056(of)S 4166(interruption.)S 4717(All)S 4872(auto)S 5070(vari-)S 5976 V 1630(ables)S 1872(and)S 2052(function)S 2422(parameters)S 2900(are)S 3059(removed)S 3446(during)S 3743(the)S 3902(clean)S 4151(up)S 4287(process.)S 4675(During)S 4996(a)S (non-)184 5077 A 6096 V 1630(interactive)S 2081(session,)S 2421(the)S 2569(SIGINT)S 2926(signal)S (will)157 3191 A 3373(terminate)S 3779(the)S 3927(entire)S 4182(run)S 4341(of)S 10 B 4450(bc)S 10 R 4551(.)S 6264 V 870(L)S 872(LI)S 936(IM)S 972(MI)S 1063(IT)S 1099(TS)S 1163(S)S 6384 V 1080(The)S 1274(following)S 1702(are)S 1863(the)S 2023(limits)S 2289(currently)S 2690(in)S (place)213 2805 A 3055(for)S 3210(this)S 10 B 3392(bc)S 10 R 3530(processor.)S 4004(Some)S 4271(of)S 4393(them)S 4632(may)S 4843(have)S 5071(been)S 6504 V 1080(changed)S 1440(by)S 1565(an)S 1685(installation.)S 2207(Use)S 2389(the)S 2537(limits)S 2791(statement)S 3202(to)S 3305(see)S 3459(the)S 3607(actual)S 3873(values.)S 6672 V 1080(BC_BASE_MAX)S 6792 V 1440(The)S 1622(maximum)S 2054(output)S 2335(base)S 2539(is)S 2631(currently)S 3020(set)S 3157(at)S (999.)175 3255 A 3480(The)S 3662(maximum)S (input)206 4094 A 4325(base)S 4529(is)S 4621(16.)S 6960 V 1080(BC_DIM_MAX)S 7080 V 1440(This)S 1644(is)S 1736(currently)S 2125(an)S 2245(arbitrary)S 2618(limit)S 2833(of)S (65535)250 2942 A 3217(as)S 3326(distributed.)S 3831(Your)S 4063(installation)S 4535(may)S 4733(be)S 4853(different.)S 7248 V 1080(BC_SCALE_MAX)S 7368 V 1440(The)S 1624(number)S 1958(of)S 2069(digits)S 2319(after)S 2532(the)S 2682(decimal)S 3029(point)S 3263(is)S 3358(limited)S 3671(to)S 3777(INT_MAX)S 4259(digits.)S 4560(Also,)S 4803(the)S 4954(number)S 7488 V 1440(of)S 1549(digits)S 1797(before)S 2080(the)S 2228(decimal)S 2572(point)S 2803(is)S 2895(limited)S 3205(to)S 3308(INT_MAX)S 3787(digits.)S 7903 V 720(Page)S 941(9)S 2936(\()S 2978(.)S 3011(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 10 10 BP /slant 0 def /height 0 def 480 V 10 R 720(bc)S 823(\()S 865(1)S 923(\))S 2696(Eighth)S (Edition)296 2989 A 5024(bc)S 5127(\()S 5169(1)S 5227(\))S 960 V 1080(BC_STRING_MAX)S 1080 V 1440(The)S 1622(limit)S 1837(on)S 1962(the)S 2110(number)S 2442(of)S 2551(characters)S 2986(in)S 3089(a)S 3159(string)S 3413(is)S 3505(INT_MAX)S 3984(characters.)S 1248 V (exponent)368 1080 A 1368 V 1440(The)S 1622(value)S 1865(of)S 1974(the)S (exponent)368 2122 A 2515(in)S 2618(the)S 2766(raise)S 2982(operation)S (\(\303\))102 3387 A 3514(is)S 3606(limited)S 3916(to)S (LONG_MAX.)591 4019 A 1536 V (multiply)340 1080 A 1656 V 1440(The)S (multiply)340 1625 A 1993(routine)S 2306(may)S 2507(yield)S 2736(incorrect)S 3123(results)S 3414(if)S 3504(a)S 3577(number)S 3912(has)S 4074(more)S 4309(than)S (LONG_MAX)566 4510 A 5104(/)S 5161(90)S 1776 V 1440(total)S 1644(digits.)S 1942(For)S 2107(32)S 2232(bit)S (longs,)242 2363 A 2630(this)S 2800(number)S 3132(is)S (23,860,929)450 3224 A 3699(digits.)S 1944 V 1080(code)S 1295(size)S 2064 V 1440(Each)S 1669(function)S 2031(and)S 2203(the)S 2353("main")S 2663(program)S 3031(are)S 3182(limited)S 3494(to)S (10240)250 3600 A 3878(bytes)S 4118(of)S 4230(compiled)S 4632(byte)S 4833(code)S (each.)210 5051 A 2184 V 1440(This)S 1652(limit)S 1875(\(BC_MAX_SEGS\))S 2692(can)S 2865(be)S 2993(easily)S 3261(changed)S 3629(to)S 3740(have)S 3963(more)S 4202(than)S 4407(10)S 4539(segments)S 4945(of)S (1024)200 5061 A 2304 V 1440(bytes.)S 2472 V 1080(variable)S 1430(names)S 2592 V 1440(The)S 1624(current)S 1937(limit)S 2154(on)S 2281(the)S 2431(number)S 2765(of)S 2876(unique)S 3176(names)S 3460(is)S (32767)250 3554 A 3831(for)S (each)185 3976 A 4189(of)S 4301(simple)S 4597(variables,)S 5014(arrays)S 2712 V 1440(and)S 1610(functions.)S 2880 V 9 R 720(F)S 722(FI)S 774(IL)S 807(LE)S 865(ES)S 923(S)S 3000 V 10 R 1080(In)S 1192(most)S 1415(installations,)S 10 B 1954(bc)S 10 R 2083(is)S 2178(completely)S 2653(self-contained.)S 3302(Where)S 3599(executable)S 4058(size)S 4243(is)S 4338(of)S 4450(importance)S 4931(or)S 5043(the)S 5194(C)S 3120 V 1080(compiler)S 1480(does)S 1706(not)S 1876(deal)S 2085(with)S 2305(very)S (long)178 2525 A 2744(strings,)S 10 B 3078(bc)S 10 R (will)157 3220 A 3418(read)S 3633(the)S 3797(standard)S 4179(math)S 4421(library)S 4731(from)S 4968(the)S 5132(\256le)S 3240 V (/usr/local/lib/libmath.b.)944 1080 A 2074(\(The)S 2290(actual)S 2556(location)S 2905(may)S 3103(vary.)S 3357(It)S 3444(may)S 3642(be)S (/lib/libmath.b.\))603 3762 A 3408 V 9 R 720(D)S 722(DI)S 790(IA)S 823(AG)S 891(GN)S 959(NO)S 1027(OS)S 1095(ST)S 1147(TI)S 1205(IC)S 1238(CS)S 1300(S)S 3528 V 10 R 1080(If)S 1181(any)S 1359(\256le)S 1521(on)S 1654(the)S 1810(command)S 2239(line)S 2423(can)S 2596(not)S 2758(be)S 2887(opened,)S 10 B 3236(bc)S 10 R (will)157 3371 A 3562(report)S 3837(that)S 4022(the)S 4179(\256le)S 4342(is)S 4443(unavailable)S 4941(and)S 5120(ter-)S 3648 V 1080(minate.)S 1429(Also,)S 1669(there)S 1896(are)S 2045(compile)S 2394(and)S 2564(run)S 2723(time)S (diagnostics)452 2927 A 3404(that)S (should)267 3580 A 3872(be)S 3992(self-explanatory.)S 3816 V 9 R 720(B)S 722(BU)S 784(UG)S 852(GS)S 920(S)S 3936 V 10 R 1080(Error)S 1319(recovery)S 1697(is)S 1789(not)S 1942(very)S (good)200 2146 A 2371(yet.)S 4104 V 9 R 720(A)S 722(AU)S 790(UT)S 858(TH)S 916(HO)S 984(OR)S 1052(R)S 4224 V 10 R (Philip)240 1080 A 1345(A.)S 1468(Nelson)S 4344 V 1080(phil@cs.wwu.edu)S 4512 V 9 R 720(A)S 722(AC)S 790(CK)S 852(KN)S 920(NO)S 988(OW)S 1056(WL)S 1144(LE)S 1202(ED)S 1260(DG)S 1328(GE)S 1396(EM)S 1454(ME)S 1536(EN)S 1594(NT)S 1662(TS)S 1720(S)S 4632 V 10 R 1080(The)S 1270(author)S 1560(would)S 1844(like)S 2028(to)S 2139(thank)S 2395(Steve)S 2652(Sommars)S 3065(\(sesv@iwtsf.att.com\))S 3958(for)S 4109(his)S 4260(extensive)S 4674(help)S 4881(in)S 4993(testing)S 4752 V 1080(the)S 1244(implementation.)S 1966(Many)S 2241(great)S (suggestions)468 2484 A 2993(were)S 3231(given.)S 3545(This)S 3765(is)S 3873(a)S 3959(much)S 4223(better)S (product)307 4494 A 4841(due)S 5026(to)S 5144(his)S 4872 V (involvement.)527 1080 A 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 2936(\()S 2978(.)S 3011(\))S 4940(Page)S 5161(10)S 8143 V EP %%Trailer %%DocumentFonts: Times-Roman Times-Bold Times-Italic %%Pages: 10