📄 bc.1
字号:
%!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 defsystemdict /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 addcurrentpoint pop Xm}bind def/H{//res div0 transform X round X itransform popcurrentpoint X popmoveto}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 fillgr}bind def1 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} ifend/BP{save mark devps begin m0/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecapcurrentlinejoin 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 1BP/slant 0 def/height 0 def480 V10 R720(bc)S823(\()S865(1)S923(\))S2696(Eighth)S(Edition)296 2989 A5024(bc)S5127(\()S5169(1)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(bc)S1200(-)S1259(An)S1407(arbitrary)S1780(precision)S2174(calculator)S(language)363 2597 A1248 V9 R720(S)S722(SY)S774(YN)S842(NT)S910(TA)S968(AX)S1036(X)S1368 V10 B1080(bc)S10 R1206([)S10 B1265(-lws)S10 R1464(])S1523([)S10 I1607(\256le)S(...)75 1755 A10 R1855(])S1536 V9 R720(V)S722(VE)S790(ER)S848(RS)S910(SI)S962(IO)S995(ON)S1063(N)S1656 V10 R1080(This)S1284(man)S1482(page)S1697(documents)S(GNU)219 2157 A2401(bc)S2521(version)S2842(1.02.)S1824 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S1944 V10 B1080(bc)S10 R1221(is)S1328(a)S(language)363 1413 A1816(that)S(supports)340 2007 A2387(arbitrary)S2775(precision)S3184(numbers)S3570(with)S3789(interactive)S4255(execution)S4686(of)S4811(statements.)S2064 V1080(There)S1350(are)S1508(some)S(similarities)448 1754 A2236(in)S2348(the)S2505(syntax)S2801(to)S2913(the)S3070(C)S3171(programming)S(language.)388 3752 A4174(A)S4281(standard)S4656(math)S4891(library)S5194(is)S2184 V1080(available)S1470(by)S1596(command)S2019(line)S2197(option.)S2530(If)S2625(requested,)S3063(the)S3213(math)S3441(library)S3737(is)S3831(de\256ned)S4154(before)S4439(processing)S4896(any)S5068(\256les.)S2304 V10 B1080(bc)S10 R1212(starts)S1456(by)S1587(processing)S2048(code)S2268(from)S2494(all)S2625(the)S2778(\256les)S2976(listed)S3224(on)S3354(the)S3507(command)S3933(line)S4114(in)S4222(the)S4375(order)S4618(listed.)S4916(After)S5160(all)S2424 V1080(\256les)S1274(have)S1490(been)S1706(processed,)S10 B2154(bc)S10 R2281(reads)S2520(from)S2742(the)S2891(standard)S(input.)231 3258 A3540(All)S3696(code)S3913(is)S4007(executed)S4392(as)S4503(it)S4586(is)S4680(read.)S(\(If)102 4931 A5060(a)S5132(\256le)S2544 V1080(contains)S1440(a)S1510(command)S1931(to)S2034(halt)S2210(the)S2358(processor,)S10 B2794(bc)S10 R(will)157 2920 A3102(never)S3351(read)S3550(from)S3771(the)S3919(standard)S(input.\))265 4285 A2712 V1080(This)S1292(version)S1621(of)S10 B1738(bc)S10 R1872(contains)S2240(several)S2559(extensions)S(beyond)295 3017 A(traditional)414 3346 A10 B3794(bc)S10 R3929(implementations)S4633(and)S4812(the)S4969(POSIX)S2832 V1080(draft)S1302(standard.)S1724(Command)S2173(line)S2355(options)S2681(can)S2852(cause)S3107(these)S3345(extensions)S3800(to)S3909(print)S4130(a)S4206(warning)S4567(or)S4682(to)S4791(be)S4916(rejected.)S2952 V1080(This)S1301(document)S1739(describes)S2156(the)S(language)363 2321 A(accepted)353 2726 A3122(by)S3265(this)S3453(processor.)S3932(Extensions)S(will)157 4416 A4616(be)S4754(identi\256ed)S5177(as)S3072 V1080(such.)S3240 V870(O)S872(OP)S947(PT)S1005(TI)S1069(IO)S1105(ON)S1180(NS)S1255(S)S3360 V1080(-l)S1440(De\256ne)S1734(the)S1882(standard)S2248(math)S2474(library.)S3528 V1080(-w)S1440(Give)S1661(warnings)S2055(for)S2198(extensions)S2647(to)S2750(POSIX)S10 B3067(bc)S10 R3168(.)S3696 V1080(-s)S1440(Process)S1773(exactly)S2089(the)S2237(POSIX)S10 B2554(bc)S10 R(language.)388 2680 A3864 V870(N)S872(NU)S947(UM)S1022(MB)S1113(BE)S1182(ER)S1246(RS)S1315(S)S3984 V1080(The)S1265(most)S1488(basic)S1723(element)S2070(in)S10 B2176(bc)S10 R2305(is)S2400(the)S2551(number.)S2936(Numbers)S3333(are)S3485(arbitrary)S3861(precision)S4259(numbers.)S4684(This)S4892(precision)S4104 V1080(is)S1174(both)S1379(in)S1483(the)S1632(integer)S1938(part)S2121(and)S2292(the)S2441(fractional)S2854(part.)S3087(All)S3242(numbers)S3614(are)S3764(represented)S4255(internally)S4667(in)S4771(decimal)S5116(and)S4224 V1080(all)S1219(computation)S1759(is)S(done)195 1864 A2098(in)S2215(decimal.)S2623(\(This)S2875(version)S3210(truncates)S3613(results)S3915(from)S4150(divide)S4440(and)S(multiply)340 4624 A5003(opera-)S4344 V1080(tions.\))S1387(There)S1651(are)S1803(two)S1982(attributes)S2385(of)S2497(numbers,)S2896(the)S3047(length)S3326(and)S3499(the)S3650(scale.)S3930(The)S4115(length)S4393(is)S4487(the)S4637(total)S4843(number)S5177(of)S4464 V1080(signi\256cant)S1540(decimal)S1900(digits)S2164(in)S2283(a)S2369(number)S2718(and)S2905(the)S3070(scale)S3314(is)S3423(the)S3588(total)S3809(number)S4158(of)S4284(decimal)S4645(digits)S4910(after)S5138(the)S4584 V1080(decimal)S1424(point.)S1705(For)S1870(example:)S4704 V(.000001)325 1465 A1815(has)S1974(a)S2044(length)S2320(of)S2429(6)S2504(and)S2674(scale)S2901(of)S3010(6.)S4824 V(1935.000)375 1465 A1865(has)S2024(a)S2094(length)S2370(of)S2479(7)S2554(and)S2724(a)S2794(scale)S3021(of)S3130(3.)S4992 V870(V)S872(VA)S947(AR)S1022(RI)S1091(IA)S1127(AB)S1202(BL)S1271(LE)S1335(ES)S1399(S)S5112 V1080(Numbers)S1481(are)S1637(stored)S1915(in)S2025(two)S2208(types)S2452(of)S2568(variables,)S2989(simple)S3289(variables)S3685(and)S3862(arrays.)S4191(Both)S4418(simple)S4719(variables)S5116(and)S5232 V1080(array)S1326(variables)S1728(are)S1890(named.)S2246(Names)S2564(begin)S2825(with)S3041(a)S3123(letter)S3368(followed)S3763(by)S3900(any)S4082(number)S4426(of)S4547(letters,)S4856(digits)S5116(and)S5352 V(underscores.)506 1080 A1636(All)S1791(letters)S2064(must)S2285(be)S2406(lower)S2662(case.)S2912(\(Full)S3134(alpha-numeric)S3742(names)S4025(are)S4175(an)S4296(extension.)S4732(In)S4842(POSIX)S10 B5160(bc)S5472 V10 R1080(all)S1211(names)S1498(are)S1652(a)S1727(single)S1997(lower)S2257(case)S2461(letter.\))S2783(The)S2970(type)S3173(of)S3287(variable)S3642(is)S3739(clear)S3966(by)S4096(the)S4249(context)S(because)319 4575 A4923(all)S5053(array)S5592 V1080(variable)S1430(names)S(will)157 1712 A1894(be)S2014(followed)S2397(by)S2522(brackets)S(\([]\).)161 2883 A5760 V1080(There)S1347(are)S1502(four)S1701(special)S2012(variables,)S10 B2432(scale,)S2695(ibase,)S2969(obase,)S10 R3265(and)S10 B3441(last)S10 R3592(.)S10 B3673(scale)S10 R3911(de\256nes)S4227(how)S4432(some)S4676(operations)S5127(use)S5880 V1080(digits)S1337(after)S1557(the)S1714(decimal)S2067(point.)S2357(The)S2548(default)S2862(value)S3114(of)S10 B3232(scale)S10 R3473(is)S3574(0.)S10 B3683(ibase)S10 R3934(and)S10 B4112(obase)S10 R4385(de\256ne)S4664(the)S(conversion)441 4820 A6000 V1080(base)S1293(for)S(input)206 1445 A1685(and)S1864(output)S2154(numbers.)S2584(The)S2775(default)S3089(for)S3241(both)S(input)206 3453 A3693(and)S3872(output)S4162(is)S4263(base)S4476(10.)S10 B4660(last)S10 R4845(\(an)S5009(exten-)S6120 V1080(sion\))S1320(is)S1426(a)S1510(variable)S1874(that)S2064(has)S2237(the)S2399(value)S2656(of)S2779(the)S2941(last)S3120(printed)S3444(number.)S3840(These)S(will)157 4119 A4314(be)S4447(discussed)S4870(in)S4986(further)S6240 V1080(detail)S1337(where)S1617(appropriate.)S2159(All)S2321(of)S2438(these)S2678(variables)S3075(may)S3281(have)S3504(values)S3794(assigned)S4174(to)S4286(them)S4521(as)S4639(well)S4847(as)S4965(used)S5183(in)S6360 V1080(expressions.)S6528 V870(C)S872(CO)S941(OM)S1016(MM)S1107(ME)S1198(EN)S1262(NT)S1337(TS)S1401(S)S6648 V1080(Comments)S1545(in)S10 B1653(bc)S10 R1784(start)S1988(with)S2197(the)S2350(characters)S10 B2790(/*)S10 R2898(and)S3073(end)S3248(with)S3457(the)S3610(characters)S10 B4050(*/)S10 R4128(.)S4208(Comments)S4673(may)S4877(start)S5082(any-)S6768 V1080(where)S1361(and)S1539(appear)S1841(as)S1958(a)S2036(single)S(space)224 2309 A2566(in)S2677(the)S(input.)231 2833 A3122(\(This)S3368(causes)S3664(comments)S4110(to)S4221(delimit)S4539(other)S(input)206 4779 A5018(items.)S6888 V1080(For)S1252(example,)S1650(a)S1727(comment)S2133(can)S2305(not)S2465(be)S(found)234 2592 A2858(in)S2968(the)S3123(middle)S3434(of)S3550(a)S3627(variable)S3984(name.\))S4319(Comments)S4787(include)S5116(any)S7008 V1080(newlines)S1463(\(end)S1667(of)S1776(line\))S1986(between)S2347(the)S2495(start)S2694(and)S2864(the)S3012(end)S3182(of)S3291(the)S3439(comment.)S7176 V870(E)S872(EX)S936(XP)S1011(PR)S1069(RE)S1138(ES)S1202(SS)S1260(SI)S1318(IO)S1354(ON)S1429(NS)S1504(S)S7296 V1080(The)S1270(numbers)S1649(are)S1806(manipulated)S2336(by)S2469(expressions)S2972(and)S3151(statements.)S3660(Since)S3918(the)S(language)363 4075 A4472(was)S4663(designed)S5054(to)S5166(be)S7416 V1080(interactive,)S1562(statements)S2017(and)S2192(expressions)S2691(are)S2845(executed)S3233(as)S(soon)189 3347 A3566(as)S3680(possible.)S4089(There)S4355(is)S4452(no)S4582("main")S4895(program.)S7536 V1080(Instead,)S1430(code)S1654(is)S1755(executed)S2147(as)S2265(it)S2355(is)S(encountered.)517 2456 A3032(\(Functions,)S3521(discussed)S3941(in)S4054(detail)S4313(later,)S4553(are)S4712(de\256ned)S5043(when)S7903 V720(Page)S941(1)S2936(\()S2978(.)S3011(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Page: 2 2BP/slant 0 def/height 0 def480 V10 R720(bc)S823(\()S865(1)S923(\))S2696(Eighth)S(Edition)296 2989 A5024(bc)S5127(\()S5169(1)S5227(\))S960 V(encountered.\))551 1080 A1128 V1080(A)S1186(simple)S1487(expression)S1951(is)S2052(just)S2231(a)S2310(constant.)S10 B2704(bc)S10 R(converts)341 2839 A3214(constants)S3622(into)S3812(internal)S4154(decimal)S4507(numbers)S4887(using)S5138(the)S1248 V1080(current)S(input)206 1408 A1656(base,)S1902(speci\256ed)S2302(by)S2444(the)S2609(variable)S10 B2976(ibase)S10 R3194(.)S3261(\(There)S3573(is)S3681(an)S3817(exception)S4249(in)S4368(functions.\))S4867(The)S5065(legal)S1368 V1080(values)S1362(of)S10 B1471(ibase)S10 R1714(are)S1863(2)S(through)312 1938 A2276(16)S2402(\(F\).)S2602(Assigning)S3035(a)S3106(value)S3350(outside)S3666(this)S3837(range)S4087(to)S10 B4191(ibase)S10 R(will)157 4435 A4618(result)S4868(in)S4972(a)S5043(value)S1488 V1080(of)S1206(2)S1297(or)S1422(16.)S(Input)212 1613 A1866(numbers)S2253(may)S2467(contain)S2804(the)S2968(characters)S3419(0-9)S3594(and)S3780(A-F.)S4009(\(Note:)S4308(They)S4556(must)S4792(be)S4928(capitals.)S1608 V1080(Lower)S1370(case)S1570(letters)S1843(are)S1993(variable)S2344(names.\))S2711(Single)S2994(digit)S3205(numbers)S3578(always)S3885(have)S4102(the)S4252(value)S4497(of)S4608(the)S4758(digit)S4969(regard-)S
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -