÷ƒ’À;è TeX output 2000.01.24:1302‹ÿÿÿÿ y� ý£ ?� þ�’Ãø×óDÓítG®G®cmr17¹The–7tó߆µTG® cmtt12ºcalc“¹pac�Œqk‘ÿäageŽŸ�’�û¯In x–7tnotation“arithmetic“in“L�Ÿüdú�‘úKGóX«Q cmr12»AŽŽ‘¹”¹T�‘ý[™Ÿ¸-EŽ‘;gX��Ÿùº¯ó!",š cmsy10¿ŽŽŽŸ�����‘qn÷»Kresten–ê¨Krab“Thorup,“F‘ÿVrank“Jensen“(and“Chris“Ro�¬rwley)ŽŽŽŽŽŸ37�’æ 1998/07/07ŽŸ.�’ï!Kót ‰: cmbx9ÇAbstractŽŸ¬Ñ�‘xßüóo´‹Ç cmr9ÆThe–W÷óߤN cmtt9Ècalc“Æpacš¾9k‘ÿ|rage“reimplemen˜ts“the“L�Ÿýó5�‘ü«‡ó¹Aa¨cmr6ÁAŽŽ‘© ÆT�‘þuAŸïÿEŽ‘˜ŸX“commands“È\setcounterÆ,ޤ �‘kÈ\addtocounterÆ,–$ØÈ\setlengthÆ,“and–!½È\addtolengthÆ.‘A¬Instead“of“a“simple“v‘ÿ|ralue,Ž¡�‘kthese–Tcommands“no�¾9w“accept“an“in x“notation“expression.Ž©!Ä��‘Ró!ÂÖN ff cmbx12Ì1Ž‘jLËIn�ŒÌtro�s3ductionŽŸç�‘RóKñ`y cmr10²Arithmetic–’in“T�‘þU>Ÿ'EŽ‘ãxX“is“done“using“lo•¸ãw-lev“el–’op�Gerations“suc�¸ãh“as“ó"ßêŸ'EŽ‘ãxX.Ž¡�‘aThe–­Ÿin x“expressions“can“b�Ge“used“in“argumenš¸ãts“to“macros“(the“Ícalc“²pac˜k‘ÿqÇageŽ¡�‘RdošGesn't–UUemplo�¸ãy“category“co˜de“cš¸ãhanges“to“ac˜hiev˜e“its“goals)��Ÿü^ÿ±1ŽŽ‘|s².ަ��‘RÌ2Ž‘jLËInformal‘ffdescriptionŽŸç�‘R²Standard–õdL�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX“proš¸ãvides“the“follo˜wing“set“of“commands“to“manipulate“coun˜tersŽ¡�‘Rand–UUlengths“[�2Ž‘,“pages“194“and“216].Ž©�‘RÍ\setcounter{ó$ý': cmti10Ïctr‘�Í}{Ïnum‘ÄcÍ}–'¦²sets“the“v›ÿqÇalue“of“the“coun�¸ãter“Ïctr‘;3²equal“to“(the“v˜alue“of‘Ç)Ž¡�‘kÏnum².‘qÇ(F‘ÿ*ªragile)ަ�‘RÍ\addtocounter{Ïctr‘�Í}{Ïnum‘ÄcÍ}–²incremenš¸ãts“the“v‘ÿqÇalue“of“the“coun˜ter“Ïctr‘$޲b˜y“(the“v‘ÿqÇalueŽ¡�‘kof‘Ç)‘UUÏnum².‘qÇ(F‘ÿ*ªragile)Ž‘RŸff‰ff�ÿrŸ @���‘ ÷ˆŸý-:óq¡% cmsy6ÅŽŽ‘LÜó|{Ycmr8ÀW›ÿJªe–ßthank“F˜rank“MittelbacšÃŽh“for“his“v�‡aluable“commen˜ts“and“suggestions“whic˜h“ha˜v˜e“greatlyޤ €�impro•ÃŽv“ed–ÕXthis“pac�ÃŽk�‡age.ŽŸ Š>����‘ "5Ÿý-:Á1ŽŽŽ‘LÜÀHo•ÃŽw“ev“er,‘ƒrit–nùtherefore“assumes“that“the“category“cošŸ'EŽ‘ãxX,‘;the“argumenš¸ãts“to“these“commands“m˜ust“b�Ge“simple“v‘ÿqÇalues.‘4¼TheŽ¡�‘RÍcalc–E²pac�¸ãk‘ÿqÇage“extends“these“commands“to“accept“in x“notation“expressions,‘Ide-Ž¡�‘Rnoting–¶Ôv‘ÿqÇalues“of“appropriate“tš¸ãyp�Ges.‘–DUsing“the“Ícalc“²pac˜k‘ÿqÇage,‘Ï4Ïnum‘{7²is“replaced“b˜yŽ¡�‘Ró !",š cmsy10¸h²inš¸ãteger–xjexpression¸i²,‘�/and“Ïlen‘<Ͳis“replaced“b˜y“¸h²glue“expression¸i².‘ÛThe“formal“syn˜taxŽ¡�‘Rof–UU¸h²inš¸ãteger“expression¸i“²and“¸h²glue“expression¸i“²is“giv˜en“b�Gelo˜w.Ž¡�‘aIn–1ùaddition“to“these“commands“to“explicitly“set“a“length,‘i"man�¸ãy“L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX“com-Ž¡�‘Rmands–ñtakš¸ãe“a“length“argumen˜t.‘¹šAfter“loading“this“pac˜k‘ÿqÇage,‘H—most“of“these“com-Ž¡�‘Rmands–>will“accept“a“¸h²glue“expression¸i².‘XThis“includes“the“optional“width“argumen�¸ãtŽ¡�‘Rof–�Í\makebox²,›¶¹the“width“argumen�¸ãt“of“Í\parbox²,˜Íminipage²,˜and“a“Ítabluar“p²-column,Ž¡�‘Rand–œ8manš¸ãy“similar“constructions.‘4(This“pac˜k‘ÿqÇage“do�Ges“not“rede ne“an˜y“of“these“com-Ž¡�‘Rmands,‘³but–ó:they“are“de ned“bš¸ãy“default“to“read“their“argumen˜ts“b˜y“Í\setlengthŽ¡�‘R²and–°ûso“automatically“b�Gene t“from“the“enhanced“Í\setlength“²command“pro�¸ãvidedŽ¡�‘Rbš¸ãy–UUthis“pac˜k‘ÿqÇage.)Ž¡�‘aIn–e•the“follo•¸ãwing,‘i¥w“e–e•shall“use“standard“T�‘þU>Ÿ'EŽ‘ãxX“terminology‘ÿ*ª.‘¢‡The“corresp�GondenceŽ¡�‘Rb�Get•¸ãw“een–·»T�‘þU>Ÿ'EŽ›ãxX“and“L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ˜X“terminology“is“as“follo�¸ãws:‘6“L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ˜X“coun�¸ãters“corresp�GondŽ¡�‘Rto–tvT�‘þU>Ÿ'EŽ‘ãxX's“counš¸ãt“registers;‘they“hold“quan˜tities“of“t˜yp�Ge“¸h²n˜um˜b�Ger¸i².‘Ï+L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX“lengthŽ¡�‘Rcommands–šcorrespšGond“to“T�‘þU>Ÿ'EŽ‘ãxX's“dimen“(for“rigid“lengths)“and“skip“(for“rubb˜erŽ¡�‘Rlengths)–UUregisters;“they“hold“quanš¸ãtities“of“t˜ypšGes“¸h²dimen¸i“²and“¸h²glue¸i²,“resp˜ectiv�¸ãely‘ÿ*ª.Ž¡�‘aT�‘þU>Ÿ'EŽ‘ãxX–¬™givš¸ães“us“primitiv˜e“opšGerations“to“p˜erform“arithmetic“on“registers“as“follo�¸ãws:ަ����‘a¸ŽŽŽ‘k²addition–UUand“subtraction“on“all“tš¸ãyp�Ges“of“quan˜tities“without“restrictions;Ž©ªª����‘a¸ŽŽŽ‘k²mš¸ãultiplication–1and“division“b˜y“an“Ïinte‘ÿ}'ger‘’¾²can“bšGe“p˜erformed“on“a“register“ofŽ¡�‘kan•¸ãy‘UUt“yp�Ge;ަ����‘a¸ŽŽŽ‘k²m•¸ãultiplication›ˆýb“y˜a˜Ïr–ÿ}'e“al‘‘†²n•¸ãum“b�Ger˜(i.e.,‘±Üa˜n“um“b•Ger˜with˜a˜fractional˜part)˜can˜b“eŽ¡�‘kp�Gerformed–4Çon“a“register“of“anš¸ãy“t˜yp�Ge,‘;Jbut“the“stretc˜h“and“shrink“comp�Gonen˜tsŽ¡�‘kof–UUa“glue“quan•¸ãtit“y–UUare“discarded.ŽŸUU�‘RThe–béÍcalc“²pacš¸ãk‘ÿqÇage“uses“these“T�‘þU>Ÿ'EŽ‘ãxX“primitiv˜es“but“pro˜vides“a“more“user-friendlyŽ¡�‘Rnotation–UUfor“expressing“the“arithmetic.Ž¡�‘aAn–Ǿexpression“is“formed“of“nš¸ãumerical“quan˜tities“(suc˜h“as“explicit“constan˜ts“andŽ¡�‘RL�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX–Ä£counš¸ãters“and“length“commands)“and“binary“op�Gerators“(the“tok˜ens“`Í+²',‘àw`Í-²',Ž¡�‘R`Í*²',‘Àûand–›ä`Í/²'“with“their“usual“meaning)“using“the“familiar“in x“notation;‘Ùµparen�¸ãthesesŽ¡�‘Rmaš¸ãy–bÔb�Ge“used“to“o˜v˜erride“the“usual“precedences“(that“m˜ultiplication/division“ha˜v˜eŽ¡�‘Rhigher–UUprecedence“than“addition/subtraction).Ž¡�‘aExpressions–žÄm�¸ãust“bšGe“prop˜erly“t�¸ãyp˜ed.‘4ìThis“means,–ÃHe.g.,“that–žÄa“dimen“expressionŽ¡�‘Rmš¸ãust–Þ{b�Ge“a“sum“of“dimen“terms:‘6Zi.e.,‘öAy˜ou“cannot“sa˜y“`Í2cm+4²'“but“`Í2cm+4pt²'“is“v‘ÿqÇalid.Ž¡�‘aIn–f®a“dimen“term,‘kthe“dimension“part“m�¸ãust“come“ rst;‘oZthe“same“holds“for“glueŽ¡�‘Rterms.‘5 Also,‘Ñmš¸ãultiplication–Ÿ and“division“b˜y“non-in˜teger“quan˜tities“require“a“sp�GecialŽ¡�‘Rsynš¸ãtax;–UUsee“b�Gelo˜w.ŽŽŸ�’2ŽŽŒ‹ + y� ý£ ?� ýä�‘a²Ev‘ÿqÇaluation–¬—of“subšGexpressions“at“the“same“lev�¸ãel“of“precedence“pro˜ceeds“from“leftޤ �‘Rto–' righš¸ãt.‘b`Consider“a“dimen“term“suc˜h“as“\Í4cm*3*4²".‘b`First,‘0^the“v‘ÿqÇalue“of“the“factorŽ¡�‘RÍ4cm–<`²is“assigned“to“a“dimen“register,‘v"then“this“register“is“mš¸ãultiplied“b˜y“3“(usingŽ¡�‘RÍ\multiply²),–UWand,“ nally‘ÿ*ª,“the“register“is“mš¸ãultiplied“b˜y“4“(again“using“Í\multiply²).Ž¡�‘RThis–Œ5also“explains“wh�¸ãy“the“dimension“part“(i.e.,‘´othe“part“with“the“unit“designation)Ž¡�‘Rmš¸ãust–f¶come“ rst;‘ofT�‘þU>Ÿ'EŽ‘ãxX“simply“do�Gesn't“allo˜w“un˜t˜yp�Ged“constan˜ts“to“b�Ge“assigned“to“aŽ¡�‘Rdimen‘UUregister.Ž¡�‘aThe–ÂÕÍcalc“²pacš¸ãk‘ÿqÇage“also“allo˜ws“m˜ultiplication“and“division“b˜y“real“n˜um˜b�Gers.Ž¡�‘RHo•¸ãw“ev“er,‘”îa–ˆ6sp�Gecial“synš¸ãtax“is“required:‘׉y˜ou“m˜ust“use“Í\real{¸h²decimal“constan˜t¸iÍ}��Ÿü^ÿ±2ŽŽŽ¡�‘R²or–pZÍ\ratio{¸h²dimen“expression¸iÍ}{¸h²dimen“expression¸iÍ}“²to“denote“a“real“v‘ÿqÇalue“to“b�GeŽ¡�‘Rused–’Úfor“mš¸ãultiplication/division.‘*UThe“ rst“form“has“the“ob˜vious“meaning,‘â:andŽ¡�‘Rthe–Ùsecond“form“denotes“the“n•¸ãum“b�Ger–Ùobtained“b�¸ãy“dividing“the“v‘ÿqÇalue“of“the“ rstŽ¡�‘Rexpression–UUb�¸ãy“the“v‘ÿqÇalue“of“the“second“expression.Ž¡�‘aA‘%#later–%/addition“to“the“pacš¸ãk‘ÿqÇage“(in“June“1998)“allo˜ws“an“additional“metho�Gd“ofŽ¡�‘RspšGecifying–d¢a“factor“of“t�¸ãyp˜e“dimen“b�¸ãy“setting“some“text“(in“LR-mo˜de)“and“measuringŽ¡�‘Rits–UUdimensions:‘qÇthese“are“denoted“as“follo�¸ãws.ޤ�‘kÍ\widthof{¸h²text¸iÍ}– \heightof{¸h²text¸iÍ}“\depthof{¸h²text¸iÍ}Ž¡�‘R²These–]bcalculate“the“natural“sizes“of“the“¸h²text¸i“²in“exactly“the“same“w•¸ãa“y–]bas“is“doneޤ �‘Rfor–UUthe“commands“Í\settowidth“²etc.“on“Pš¸ãage“216“of“the“man˜ual“[�2Ž‘].Ž¡�‘aNote–­´that“there“is“a“small“di erence“in“the“usage“of“these“t•¸ãw“o–­´metho�Gds“ofŽ¡�‘Raccessing–•`text“dimensions.‘1ËAfter“Í\settowidth{\txtwd}{Some‘?ýtext}“²y�¸ãou“can“use:Ž©�‘dæXÈ\setlength{\parskip}{0.68\textwd}ŽŸ�‘R²whereas–zéusing“the“more“direct“access“to“the“width“of“the“text“requires“the“longerŽ¡�‘Rform–UUfor“mš¸ãultiplication,“th˜us:ަ�‘dæXÈ\setlength{\parskip}{\widthof{Some–¹–text}“*“\real{0.68}}ŽŸ�‘a²T�‘þU>Ÿ'EŽ‘ãxX–ˆâdiscards“the“stretcš¸ãh“and“shrink“comp�Gonen˜ts“of“glue“when“glue“is“m˜ultipliedŽ¡�‘Rbš¸ãy–UUa“real“n˜um˜b�Ger.‘qÇSo,“for“example,ަ�‘dæXÈ\setlength{\parskip}{3pt–¹–plus“3pt“*“\real{1.5}}ŽŸ�‘R²will–ô±set“the“paragraph“separation“to“4.5pt“with“no“stretcš¸ãh“or“shrink.‘Q�(Inciden˜tally‘ÿ*ª,Ž¡�‘Rnote–UUhoš¸ãw“spaces“can“b�Ge“used“to“enhance“readabilit˜y‘ÿ*ª.)Ž¡�‘aWhen–‘`T�‘þU>Ÿ'EŽ‘ãxX“p�Gerforms“arithmetic“on“in•¸ãtegers,‘ can“y–‘`fractional“part“of“the“resultsŽ¡�‘Rare–UUdiscarded.‘qÇF‘ÿ*ªor“example,ަ�‘dæXÈ\setcounter{x}{7/2}ޤ �‘dæX\setcounter{y}{3*\real{1.6}}Ž¡�‘dæX\setcounter{z}{3*\real{1.7}}ŽŸ�‘R²will–ø³assign“the“v›ÿqÇalue“3“to“the“coun�¸ãter“Íx²,‘!‹the“v˜alue“4“to“Íy²,‘!‹and“the“v˜alue“5“to“Íz².ޤ �‘RThis–Îtruncation“also“applies“to“Ïinterme‘ÿ}'diate‘Ã)²results“in“the“sequen�¸ãtial“computationŽ¡�‘Rof–UUa“comp�Gosite“expression;“thš¸ãus,“the“follo˜wing“commandަ�‘dæXÈ\setcounter{x}{3–¹–*“\real{1.6}“*“\real{1.7}}Ž‘RŸoj‰ff�ÿrŸ J=����‘ "5Ÿý-:Á2ŽŽŽ‘LÜÀActually‘ÿJª,›#xinstead–à¤of“ó¾KÈ cmsy8ÄhÀdecimal“constan�ÃŽtÄiÀ,˜the“more“general“ÄhÀoptional“signsÄihÀfactorÄi“Àcan“b�Ÿ'EŽ‘ãxXb•Go“ok–W"[�1Ž›];‘Xand“¸h²text¸i“²is“LR-mo�Gde“material,‘W•as“in“the“man�¸ãual“[�2Ž˜].Ž¡�‘RW‘ÿ*ªe–UUuse“Ïtyp‘ÿ}'e‘°²as“a“meta-v‘ÿqÇariable,“standing“for“`in�¸ãteger',“`dimen',“and“`glue'.��Ÿü^ÿ±3ŽŽŽ©��‘a¸hÏtyp‘ÿ}'e‘°²expression¸iŽ���’±Ä›ŽŽŽ’·á!�‘UUhÏtyp‘ÿ}'e‘°²term¸iŽŽ¡�‘j�‘UUhÏtyp‘ÿ}'e‘°²expression¸iŽ�‘MoFh²plus–UUor“min�¸ãus¸iŽ�’�„¤hÏtyp‘ÿ}'e‘°²term¸iŽŽ¦��‘ahÏtyp‘ÿ}'e‘°²term¸iŽ���’™}|ŽŽŽ’Ÿ™ò!�‘UUhÏtyp‘ÿ}'e‘°²factor¸iŽŽ¡�‘j�‘UUhÏtyp‘ÿ}'e‘°²term¸iŽ�‘5('h²m�¸ãultiply–UUor“divide¸iŽ�’‹’àh²in�¸ãteger‘UUfactor¸iŽŽ¡�‘j�‘UUhÏtyp‘ÿ}'e‘°²term¸iŽ�‘5('h²m�¸ãultiply–UUor“divide¸iŽ�’‹’àh²real‘UUn•¸ãum“b�Ger¸iŽŽ¦��‘ahÏtyp‘ÿ}'e‘°²factor¸iŽ���’ž6aŽŽŽ’¤R×!�‘UUhÏtyp‘ÿ}'e‘À[¸iŽ‘#è$j�–UUh²text“dimen“factor¸iŽ‘]ê¶j‘UUÍ(�Ÿÿ±12Ž�‘xæ¸hÏtyp‘ÿ}'e‘°²expression¸iŽ‘R’×Í)�Ÿÿ±12ŽŽ¦��‘a¸h²in�¸ãteger¸iŽ���’‰ÜvŽŽŽ’�øì!�‘UUh²n•¸ãum“b�Ger¸iŽŽ¦��‘ah²text–UUdimen“factor¸iŽ���’»•aŽŽŽ’Á±×!�–UUh²text“dimen“command¸iŽ‘h*ºÍ{�¸h²text¸iŽ‘G!Í}ަ��‘a¸h²text–UUdimen“command¸iŽ���’Ì€ŽŽŽ’Òœ…!–UUÍ\widthof›ªª¸j“Í\heightof˜¸j“Í\depthofަ��‘a¸h²m�¸ãultiply–UUor“divide¸iŽ���’¾cŽŽŽ’Ä1Ù!–UUÍ*�Ÿÿ±12Ž‘#�¸j“Í/�Ÿÿ±12ŽŽ¦��‘a¸h²real‘UUn•¸ãum“b�Ger¸iŽ���’¤ŽŽŽ’ª}!–UUÍ\ratio{�¸h²dimen“expression¸iŽ›R£™Í}{�¸h²dimen“expression¸iŽ˜Í}Ž¡�‘¸j–UUÍ\real{�¸h²decimal“constan�¸ãt¸iŽ‘QqÒÍ}ަ�‘a²Note–fthat“during“most“of“the“parsing“of“calc“expressions,‘•íno“expansion“happ�Gens;Ž¡�‘Rthš¸ãus–UUthe“ab�Go˜v˜e“syn˜tax“m˜ust“b�Ge“explicit��Ÿü^ÿ±4ŽŽ‘|s².ŽŸ!Ä��‘RÌ4Ž‘jLËThe–ffev‘ÿ™aluation“sc�ŒÌhemeŽŸç�‘R²In–x·this“section,‘Á�wš¸ãe“shall“for“simplicit˜y“consider“only“expressions“con˜taining“`+'Ž¡�‘R(addition)–‘}and“`¸²'“(m�¸ãultiplication)“op�Gerators.‘&>It“is“trivial“to“add“subtraction“andŽ¡�‘Rdivision.Ž¡�‘aAn–‚vexpression“ó  b> cmmi10µE‘²is“a“sum“of“terms:‘̵T�Ÿÿ±1Ž‘~²+�‘Ÿ¸–ª¨“Ž‘­å²+‘ŸµT�Ÿÿó 0e—rcmmi7´nŽ‘q~²;‘a“term“is“a“pro�Gduct“ofŽ¡�‘Rfactors:‘9cµF�Ÿÿ±1ޑӯ¸�‘WS–ª¨“Ž‘YM‘WSµF�Ÿÿ´mŽ‘˜›²;‘ %a–ä�factor“is“either“a“simple“nš¸ãumeric“quan˜tit˜y“µf‘ø²(lik˜e“¸h²n˜um˜b�Ger¸iŽ¡�‘R²as–UUdescribšGed“in“the“T�‘þU>Ÿ'EŽ‘ãxXb˜o˜ok),“or“a“paren�¸ãthesized“expression“(µE�‘“�Ÿü^ÿó O!â…cmsy7·0Ž‘aƲ).Ž‘RŸff‰ff�ÿrŸ J=����‘ "5Ÿý-:Á3ŽŽŽ‘LÜÀThis–ÕXvšÃŽersion“of“the“Îcalc“Àpac˜k�‡age“doš����‘ "5Ÿý-:Á4ŽŽŽ‘LÜÀTwšÃŽo–Äkexceptions“to“this“are:‘¾©the“ rst“tok˜en“is“expanded“one-lev˜el“(th˜us“the“whole“expressionŽŸ €�can–ÕXb�Ÿ'EŽ‘ãxX“engine“can“only“execute“arithmetic“op�Gerations“in“a“mac�¸ãhine-ޤ �‘Rco�Gde–¹likš¸ãe“manner,‘Òw˜e“ha˜v˜e“to“ nd“a“w˜a˜y“to“translate“the“in x“notation“in˜to“thisŽ¡�‘R`instruction‘UUset'.Ž¡�‘aOur–ë‹goal“is“to“design“a“translation“sc�¸ãheme“that“translates“µX‘´m²(an“expression,Ž¡�‘Ra–ïterm,‘sor“a“factor)“inš¸ãto“a“sequence“of“T�‘þU>Ÿ'EŽ‘ãxX“instructions“that“do�Ges“the“follo˜wingŽ¡�‘R[In•¸ãv‘ÿqÇariance›Prop�Gert“y]:‘éWcorrectly˜ev‘ÿqÇaluates˜µX‘Èâ²,‘@lea“v“es˜the˜result˜in˜a˜global˜regis-Ž¡�‘Rter–ÜõA“²(using“a“global“assignmen�¸ãt),‘ôáand“došGes“not“p˜erform“global“assignmen�¸ãts“to“theŽ¡�‘Rscratcš¸ãh–register“µB‘€q²;‘-,moreo˜v˜er,‘%#the“co�Gde“sequence“m˜ust“bšGe“balanced“with“resp˜ect“toŽ¡�‘RT�‘þU>Ÿ'EŽ‘ãxX–UUgroups.‘qÇW‘ÿ*ªe“shall“denote“the“cošGde“sequence“corresp˜onding“to“µX‘7²b�¸ãy“[–þUX[µX‘Èâ²]“].Ž¡�‘aIn–UUthe“replacemen�¸ãt“cošGde“sp˜eci ed“b˜eloš¸ãw,“w˜e“use“the“follo˜wing“con˜v˜en˜tions:Ž©ðñ����‘a¸ŽŽŽ‘kµA–Ýc²and“µB‘]Ô²denote“registers;‘_all“assignmen�¸ãts“to“µA“²will“b�Ge“global,‘õ`and“all“assign-Ž¡�‘kmen�¸ãts–UUto“µB‘ÕÆ²will“bšGe“lo˜cal.ޤxx����‘a¸ŽŽŽ‘k²\¸(²"–UUmeans“global“assignmen�¸ãt“to“the“register“on“the“lhs.Ž¡����‘a¸ŽŽŽ‘k²\¸ ²"–UUmeans“lo�Gcal“assignmen�¸ãt“to“the“register“on“the“lhs.Ž¡����‘a¸ŽŽŽ‘k²\��ŸÎ:´,‘þ¢_·!±[´C�}‚±]ŽŽ‘<<²"–ªïmeans“\sa•¸ãv“e–ªïthe“co�Gde“µC‘b ²unš¸ãtil“the“curren˜t“group“(scop�Ge)“ends,‘ÀUthenŽŸ �‘kexecute–UUit."‘qÇThis“corresp�Gonds“to“the“T�‘þU>Ÿ'EŽ‘ãxX-primitiv�¸ãe“Í\aftergroup².Ž¡����‘a¸ŽŽŽ‘k²\¸f²"–UUdenotes“the“start“of“a“new“group,“and“\¸g²"“denotes“the“end“of“a“group.ަ�‘aLet–\†us“consider“an“expression“µT�Ÿÿ±1Ž–ù²+šGFµT�Ÿÿ±2Ž“²+�˜¸–ª¨“Ž‘ 93²+˜µT�Ÿÿ´nŽ‘q~².‘ØAssuming–\†that“[–þUX[µT�Ÿÿ´kŽ‘ë�²]“]‘\†(1–Ǹ“µk‘¯¸“µn²)ޤ �‘Rattains–3nthe“stated“goal,‘:6the“follo�¸ãwing“co�Gde“clearly“attains“the“stated“goal“for“theirŽ¡�‘Rsum:ޤ­-���‘oÝ:[‘þUX[µT�Ÿÿ±1Ž–µS²+›8àµT�Ÿÿ±2Ž“²+�˜¸–ª¨“Ž‘g²+˜µT�Ÿÿ´nŽ‘q~²]‘þUX]ŽŽ��’Ñì=‘þUX¸)ŽŽ��’ìzf›ª¨²[–þUX[µT�Ÿÿ±1Ž‘|s²]“]˜¸g–ǵB‘G‰¸ “µA‘ ¸f˜²[–þUX[µT�Ÿÿ±2Ž‘|s²]“]˜¸g–ǵB‘G‰¸ “µB‘¹Q²+‘8àµAŽŽŽ©����’|:–ª¨:“:Ž’]̸f›ª¨²[–þUX[µT�Ÿÿ´nŽ‘q~²]“]˜¸g–ǵB‘G‰¸ “µB‘¹Q²+‘8àµA‘ A“¸(“µBŽŽŽ¡�‘R²Note–}Ëthe“extra“levš¸ãel“of“grouping“enclosing“eac˜h“of“[–þUX[µT�Ÿÿ±1Ž›|s²]“],‘‡é[“[µT�Ÿÿ±2Ž˜²]“],‘‡é.–ªª.“.“,›}Ë[–þUX[µT�Ÿÿ´nŽ‘q~²]“].‘ë*This˜willޤ �‘Rensure–øthat“register“µB‘€q²,› Åused“to“compute“the“sum“of“the“terms,˜is“not“clobb�GeredŽ¡�‘Rbš¸ãy–Ethe“in˜termediate“computations“of“the“individual“terms.‘@ùActually‘ÿ*ª,‘€ÿthe“groupŽ¡�‘Renclosing›¿x[–þUX[µT�Ÿÿ±1Ž‘|s²]“]˜is˜unnecessary‘ÿ*ª,‘Ýrbut˜it˜turns˜out˜to˜b�Ge˜simpler˜if˜all˜terms˜are˜treatedŽ¡�‘Rthe–UUsame“w•¸ãa“y‘ÿ*ª.Ž¡�‘aThe–Z_co�Gde“sequence“\¸f›ª¨²[–þUX[µT�Ÿÿ±2Ž‘|s²]“]˜¸g–Ï~µB‘Oï¸ “µB‘¼­²+‘<<µA²"–Z_can“b�Ge“translated“inš¸ãto“the“follo˜wingŽ¡�‘Requiv›ÿqÇalen�¸ãt–«Âco�Gde“sequence:‘¢\¸f��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“±+´A±]ŽŽ‘0‘'²[–þUX[µT�Ÿÿ±2Ž‘|s²]“]‘ª¨¸g²".‘uThis–«Âobserv˜ation“turns“out“toŽ¡�‘Rb�Ge–‚ûthe“kš¸ãey“to“the“implemen˜tation:‘ÍThe“\��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“±+´A±]ŽŽ‘.æ²"“is“generated“Ïb–ÿ}'efor“e‘CVµT�Ÿÿ±2Ž‘ÿn²isŽ¡�‘Rtranslated,–UUat“the“same“time“as“the“`+'“opšGerator“b˜et•¸ãw“een–UUµT�Ÿÿ±1Ž›ÑȲand“µT�Ÿÿ±2Ž˜²is“seen.Ž¡�‘aNoš¸ãw,–UUthe“sp�Geci cation“of“the“translation“sc˜heme“is“straigh˜tforw˜ard:ŽŸ­-���’½|²[–þUX[µf‘�²]“]ŽŽ��’Õ<¼=‘þUX¸)ŽŽ��’ïY3µA–Ǹ(“µfŽŽŽ¤¼<���’°êí²[–þUX[(µE�‘“�ŸûÞÿ·0Ž‘aƲ)]“]ŽŽ��’Õ<¼=‘þUX¸)ŽŽ��’ïY3²[–þUX[µE�‘“�ŸûÞÿ·0Ž‘aƲ]“]ŽŽŽ¡���‘s-ó[‘þUX[µT�Ÿÿ±1Ž–µS²+›8àµT�Ÿÿ±2Ž“²+�˜¸–ª¨“Ž‘g²+˜µT�Ÿÿ´nŽ‘q~²]‘þUX]ŽŽ��’Õ<¼=‘þUX¸)ŽŽ��’ïY3f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ‘$ ‹²[–þUX[µT�Ÿÿ±1Ž›|s²]“]‘ª¨¸g‘ f��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“±+´A±]ŽŽ‘0‘'²[“[µT�Ÿÿ±2Ž˜²]“]‘ª¨¸gŽŽŽ¦����’Y5µ:–ª¨:“:Ž’®…¸f��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“±+´A±]ŽŽ‘0‘'²[–þUX[µT�Ÿÿ´nŽ‘q~²]“]‘ª¨¸g‘ µA–Ǹ(“µBŽŽŽ¡���‘w™‚²[‘þUX[µF�Ÿÿ±1Ž–µS¸›8àµF�Ÿÿ±2Ž“¸�˜–ª¨“Ž‘g˜µF�Ÿÿ´mŽ‘˜›²]‘þUX]ŽŽ��’Õ<¼=‘þUX¸)ŽŽ��’ïY3f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ‘$ ‹²[–þUX[µF�Ÿÿ±1Ž›|s²]“]‘ª¨¸g‘ f��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“·´A±]ŽŽ‘.†{²[“[µF�Ÿÿ±2Ž˜²]“]‘ª¨¸gŽŽŽ¦����’Y5µ:–ª¨:“:Ž’®…¸f��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“·´A±]ŽŽ‘.†{²[–þUX[µF�Ÿÿ´mŽ‘˜›²]“]‘ª¨¸g‘ µA–Ǹ(“µBŽŽŽŽŸ�’²5ŽŽŒ‹8W y� ý£ ?� ýä�‘R²By–UUstructural“induction,“it“is“easily“seen“that“the“stated“prop�Gert�¸ãy“is“attained.ޤ �‘aBy–w"insp�Gection“of“this“translation“sc•¸ãheme,‘•w“e–w"see“that“wš¸ãe“ha˜v˜e“to“generate“theŽ¡�‘Rfollo�¸ãwing‘UUco�Gde:Ž©����‘a¸ŽŽŽ‘k²w•¸ãe›C^m“ust˜generate˜\¸f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ–"`ã¸f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ“²"˜at˜the˜left˜b�Gorder˜of˜an˜expressionŽ¡�‘k(i.e.,‘cfor–`Yeacš¸ãh“left“paren˜thesis“and“the“implicit“left“paren˜thesis“at“the“b�Gegin-Ž¡�‘kning–UUof“the“whole“expression);ަ����‘a¸ŽŽŽ‘k²w•¸ãe›à¾m“ust˜generate˜\¸gµA–¯q¸(“µB›€q¸gµA“¸(“µB˜²"–à¾at“the“righ�¸ãt“b�Gorder“of“an“expressionŽ¡�‘k(i.e.,‘•,eac•¸ãh›ˆgrigh“t˜paren“thesis˜and˜the˜implicit˜righ“t˜paren“thesis˜at˜the˜end˜ofŽ¡�‘kthe–UUfull“expression);ަ����‘a¸ŽŽŽ‘k²`Í*²'–UUis“replaced“b�¸ãy“\¸gf��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“·´A±]ŽŽ‘,ÛÓ²";ަ����‘a¸ŽŽŽ‘k²`Í+²'–UUis“replaced“b�¸ãy“\¸gµA–Ǹ(“µB‘€q¸gf��ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“±+´A±]ŽŽ‘.æ¸f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ‘"`ã²";ަ����‘a¸ŽŽŽ‘k²when–—±wš¸ãe“see“(exp�Gect)“a“n˜umeric“quan˜tit˜y‘ÿ*ª,‘èHw˜e“insert“the“assignmen˜t“co�GdeŽ¡�‘k\µA‘Ǹ(²"–UUin“fronš¸ãt“of“the“quan˜tit˜y“and“let“T�‘þU>Ÿ'EŽ‘ãxX“parse“it.ŽŸ!Ä��‘RÌ5Ž‘jLËImplemen�ŒÌtationŽŸç�‘R²F‘ÿ*ªor–UUbrevit�¸ãy“de neޤ��‘a¸h²n�¸ãumeric¸iŽ���’ŽÜwŽŽŽ’”øí!�‘UUh²n•¸ãum“b�Ger¸iŽ‘/‡"j�‘UUh²dimen¸iŽ‘)wj�‘UUh²glue¸iŽ‘ 8çj�‘UUh²m�¸ãuglue¸iŽŽ¡�‘a²So–Àfar“wš¸ãe“ha˜v˜e“ignored“the“question“of“ho˜w“to“determine“the“t˜yp�Ge“of“registerޤ �‘Rto–USbšGe“used“in“the“co˜de.‘qÂHo•¸ãw“ev“er,‘•Sit–USis“easy“to“see“that“(1)“`¸²'“alw•¸ãa“ys‘USinitiatesŽ¡�‘Ran–^þ¸h²inš¸ãteger“factor¸i²,‘¡h(2)“all“¸h²n˜umeric¸i²s“in“an“expression,‘¡hexcept“those“whic˜h“areŽ¡�‘Rpart–˜Ãof“an“¸h²inš¸ãteger“factor¸i²,‘©Ÿare“of“the“same“t˜yp�Ge“as“the“whole“expression,‘©Ÿand“allŽ¡�‘R¸h²nš¸ãumeric¸i²s–UUin“an“¸h²in˜teger“factor¸i“²are“¸h²n˜um˜b�Ger¸i²s.Ž¡�‘aW‘ÿ*ªe›¥ha•¸ãv“e˜to˜ensure˜that˜µA˜²and˜µB‘%r²alw“a“ys˜ha“v“e˜an˜appropriate˜t“yp�Ge˜for˜theŽ¡�‘R¸h²nš¸ãumeric¸i²s–°>they“manipulate.‘‚‚W‘ÿ*ªe“can“ac˜hiev˜e“this“b˜y“ha˜ving“an“instance“of“µAŽ¡�‘R²and–ÊϵB‘K@²for“eacš¸ãh“t˜ypšGe.‘C›Initially‘ÿ*ª,‘愵A“²and“µB‘K@²refer“to“registers“of“the“prop˜er“t�¸ãyp˜e“for“theŽ¡�‘Rwhole– ¿expression.‘YêWhen“an“¸h²inš¸ãteger“factor¸i“²is“exp�Gected,‘w˜e“m˜ust“c˜hange“µA“²and“µBŽ¡�‘R²to–ÆBrefer“to“inš¸ãteger“t˜yp�Ge“registers.‘BW‘ÿ*ªe“can“accomplish“this“b˜y“including“instructionsŽ¡�‘Rto–acš¸ãhange“the“t˜yp�Ge“of“µA“²and“µB‘„Ò²to“in˜teger“t˜yp�Ge“as“part“of“the“replacemen˜t“co�GdeŽ¡�‘Rfor–ë`¸²;‘m5if“wš¸ãe“app�Gend“suc˜h“instructions“to“the“replacemen˜t“cošGde“describ˜ed“ab˜o•¸ãv“e,Ž¡�‘Rwš¸ãe–Çalso“ensure“that“the“t˜yp�Ge-c˜hange“is“lo�Gcal“(pro˜vided“that“the“t˜yp�Ge-c˜hangingŽ¡�‘Rinstructions–4¾only“ha•¸ãv“e–4¾lo�Gcal“e ect).‘fêHo•¸ãw“ev“er,‘;Cnote–4¾that“the“instance“of“µA“²referredŽ¡�‘Rto–UUin��“ŸÎ:´,‘þ¢_·!±[´B•W=· ´B“·´A±]ŽŽ‘3†}²is“the“in�¸ãteger“instance“of“µA².Ž¡�‘aW‘ÿ*ªe–shall“use“Í\begingroup“²and“Í\endgroup“²for“the“op�Gen-group“and“close-groupŽ¡�‘Rc•¸ãharacters.‘’uThis›µ�a“v“oids˜problems˜with˜spacing˜in˜math˜(as˜p�Goin“ted˜out˜to˜us˜b“yŽ¡�‘RF‘ÿ*ªrank‘UUMittelbac�¸ãh).ŽŽŸ�’6ŽŽŒ‹IÝ y� ý£ ?� ýä��‘Ró%ÂÖN  cmbx12Ð5.1Ž‘pÀGetting‘€startedŽ©uT�‘R²No•¸ãw›Å>w“e˜ha“v“e˜enough˜insigh“t˜to˜do˜the˜actual˜implemen“tation˜in˜T�‘þU>Ÿ'EŽ‘ãxX.‘Á�First,‘á8w“eŽŸ �‘Rannounce–UUthe“macro“pac�¸ãk‘ÿqÇage��Ÿü^ÿ±5ŽŽ‘|s².ŽŸ ÉY��‘Uüs±1Ž‘\ª®ó©±�Ê cmsy9Êh�ó&ÒoÇw cmss9Ñpack�¾9ageŽ‘#g Êiޤ ��‘Uüs±2Ž‘\ª®È%\NeedsTeXFormat{LaTeX2e}Ž¡��‘Uüs±3Ž‘\ª®È%\ProvidesPackage{calc}[\filedate\space\fileversion]ŽŸÏ&��‘RÐ5.2Ž‘pÀAssignmen� t‘€macrosަ����‘鯲È\calc@assign@genericŽŽŽ‘R²The–K�Í\calc@assign@generic“²macro“takš¸ães“four“argumen˜ts:‘lë(1“and“2)“the“registersޤ �‘Rto–$=bšGe“used“for“global“and“lo˜cal“manipulations,‘Wöresp˜ectiv�¸ãely;‘‹±(3)“the“lv‘ÿqÇalue“part;Ž¡�‘R(4)–UUthe“expression“to“b�Ge“ev‘ÿqÇaluated.Ž¡�‘aThe–”Ðthird“argumen�¸ãt“(the“lv‘ÿqÇalue)“will“b�Ge“used“as“a“pre x“to“a“register“thatŽ¡�‘Rconš¸ãtains–UUthe“v‘ÿqÇalue“of“the“sp�Geci ed“expression“(the“fourth“argumen˜t).Ž¡�‘aIn–<=general,‘tuan“lv‘ÿqÇalue“is“anš¸ãything“that“ma˜y“b�Ge“follo˜w˜ed“b˜y“a“v‘ÿqÇariable“of“the“appro-Ž¡�‘Rpriate–€mt�¸ãyp�Ge.‘óAs“an“example,‘‹3Í\linepenalty“²and“Í\global\advance\linepenaltyŽ¡�‘R²ma�¸ãy–UUbšGoth“b˜e“follo•¸ãw“ed›UUb“y˜an˜¸h²in“teger˜v‘ÿqÇariable¸i².Ž¡�‘aThe–‘0macros“describšGed“b˜eloš¸ãw“refer“to“the“registers“b˜y“the“names“Í\calc@A‘‘ ²andŽ¡�‘RÍ\calc@B²;–UUthis“is“accomplished“bš¸ãy“Í\let²-assignmen˜ts.Ž¡�‘aAs›8bdisco•¸ãv“ered˜in˜Section˜4,‘q$w“e˜ha“v“e˜to˜generate˜co�Gde˜as˜if˜the˜expression˜isŽ¡�‘Rparen�¸ãthesized.‘,ŒAs–“—describšGed“b˜elo�¸ãw,‘£'Í\calc@open“²is“the“macro“that“replaces“a“leftŽ¡�‘Rparen•¸ãthesis›rõb“y˜its˜corresp•Gonding˜T�‘þU>Ÿ'EŽ‘ãxX˜co“de˜sequence.‘ʨWhen˜the˜scanning˜pro“cessŽ¡�‘Rsees–8cthe“exclamation“p�Goinš¸ãt,‘q'it“generates“an“Í\endgroup“²and“stops.‘òAs“w˜e“recallŽ¡�‘Rfrom–LõSection“4,‘ŠÝthe“correct“expansion“of“a“righš¸ãt“paren˜thesis“is“\¸gµA–c̸(“µB‘€q¸gµA“¸(Ž¡�‘RµB‘€q²".‘‘¾The– §remaining“tok�¸ãens“of“this“expansion“are“inserted“explicitly‘ÿ*ª,‘7üexcept“thatŽ¡�‘Rthe–‚hlast“assignmenš¸ãt“has“b�Geen“replaced“b˜y“the“lv‘ÿqÇalue“part“(i.e.,‘ͬargumen˜t“Í#3“²ofŽ¡�‘RÍ\calc@assign@generic²)›UUfollo•¸ãw“ed˜b“y˜Í\calc@B².ŽŸ\ ��‘Uüs±4Ž‘\ª®È\def\calc@assign@generic#1#2#3#4{\let\calc@A#1\let\calc@B#2%ޤ ��‘Uüs±5Ž‘o‘È\expandafter\calc@open\expandafter(#4!%Ž¡��‘Uüs±6Ž‘o‘È\global\calc@A\calc@B\endgroup#3\calc@B}ŽŸ’²�‘R²(The–÷™Í\expandafter“²tokš¸ãens“allo˜w“the“user“to“use“expressions“stored“one-lev˜el“deepޤ �‘Rin–UUa“macro“as“argumenš¸ãts“in“assignmen˜t“commands.)Ž©\ ����‘ó9ÞÈ\calc@assign@countŽŽ���¡�‘ó9Þ\calc@assign@dimenŽŽŽŽ���¡¡�‘÷ót\calc@assign@skipŽŽŽŽŽ‘R²W‘ÿ*ªe–©éneed“three“instances“of“the“Í\calc@assign@generic“²macro,‘¿corresp�Gonding“toŽ¡�‘Rthe–UUtš¸ãyp�Ges“¸h²in˜teger¸i²,“¸h²dimen¸i²,“and“¸h²glue¸i².ŽŸ ÉY��‘Uüs±7Ž‘\ª®È\def\calc@assign@count{\calc@assign@generic\calc@Acount\calc@Bcount}ޤ ��‘Uüs±8Ž‘\ª®È\def\calc@assign@dimen{\calc@assign@generic\calc@Adimen\calc@Bdimen}Ž¡��‘Uüs±9Ž‘\ª®È\def\calc@assign@skip{\calc@assign@generic\calc@Askip\calc@Bskip}ަ�‘R²These–Þâmacros“eacš¸ãh“refer“to“t˜w˜o“registers,‘Eone“to“bšGe“used“globally“and“one“to“b˜eŽŸ �‘Rused›UUlo�Gcally–ÿ*ª.‘qÇW“e˜m�¸ãust˜allo�Gcate˜these˜registers.ŽŸ ÉY��‘R±10Ž‘\ª®È\newcount\calc@Acount‘,Â\newcount\calc@BcountŽ¡��‘R±11Ž‘\ª®È\newdimen\calc@Adimen‘,Â\newdimen\calc@BdimenŽ¡��‘R±12Ž‘\ª®È\newskip\calc@Askip‘Ÿî\newskip\calc@BskipŽ‘RŸù‰ff�ÿrŸ J=����‘ "5Ÿý-:Á5ŽŽŽ‘LÜÀCo�Ÿ'EŽ‘ãxX“commands:‘Z±Í\setcounter²,ŽŸ �‘RÍ\addtocounter²,–UUÍ\setlength²,“and“Í\addtolength².ŽŸ��‘R±13Ž‘\ª®È\def\setcounter#1#2{\@ifundefined{c@#1}{\@nocounterr{#1}}%ޤ ��‘R±14Ž‘j×pÈ{\calc@assign@count{\global\csname‘¹–c@#1\endcsname}{#2}}}Ž¡��‘R±15Ž‘\ª®È\def\addtocounter#1#2{\@ifundefined{c@#1}{\@nocounterr{#1}}%Ž¡��‘R±16Ž‘j×pÈ{\calc@assign@count{\global\advance\csname‘¹–c@#1\endcsname}{#2}}}ŽŸ��‘R±17Ž‘\ª®È\DeclareRobustCommand\setlength{\calc@assign@skip}Ž¡��‘R±18Ž‘\ª®È\DeclareRobustCommand\addtolength[1]{\calc@assign@skip{\advance#1}}ŽŸ�‘R²(Í\setlength–UU²and“Í\addtolength“²are“robust“according“to“[�2Ž‘].)ŽŸþ6��‘RÐ5.4Ž‘pÀThe‘€scannerަ�‘R²W‘ÿ*ªe–VVev‘ÿqÇaluate“expressions“bš¸ãy“explicit“scanning“of“c˜haracters.‘tËW‘ÿ*ªe“do“not“rely“onޤ �‘Ractiv•¸ãe›UUc“haracters˜for˜this.Ž¡�‘aThe–‰scanner“consists“of“t•¸ãw“o–‰parts,‘ÖÍ\calc@pre@scan“²and“Í\calc@post@scan²;Ž¡�‘RÍ\calc@pre@scan––²consumes“left“paren�¸ãtheses,‘¦Land“Í\calc@post@scan“²consumes“bi-Ž¡�‘Rnary–UUop�Gerator,“Í\real²,“Í\ratio²,“and“righš¸ãt“paren˜thesis“tok˜ens.Ž©����‘ 6È\calc@pre@scanŽŽŽ‘R²Note–Ñ\that“this“is“called“at“least“once“on“evš¸ãery“use“of“calc“pro�Gcessing,‘ð^ev˜en“whenŽ¡�‘Rnone–ž+of“the“extended“synš¸ãtax“is“presen˜t;‘Û9it“therefore“needs“to“b�Ge“made“v˜ery“ecien˜t.Ž¡�‘aIt–Ktreads“the“initial“part“of“expressions,‘Èûun�¸ãtil“some“¸h²text“dimen“factor¸i“²orŽ¡�‘R¸h²nš¸ãumeric¸i–@º²is“seen;‘G˜in“fact,‘DÙan˜ything“not“explicitly“recognized“here“is“tak˜en“to“b�Ge“aŽ¡�‘R¸h²nš¸ãumeric¸i–of²of“some“sort“as“this“allo˜ws“unary“`Í+²'“and“unary“`Í-²'“to“b�Ge“treated“easilyŽ¡�‘Rand– Ncorrectly��Ÿü^ÿ±6ŽŽ‘‡Á²but“means“that“anš¸ãything“illegal“will“simply“generate“a“T�‘þU>Ÿ'EŽ‘ãxX-lev˜elŽ¡�‘Rerror,–UUoften“a“reasonably“comprehensible“one!Ž¡�‘aThe–Øämanš¸ãy“Í\expandafter²s“are“needed“to“ecien˜tly“end“the“nested“conditionalsŽ¡�‘Rso–UUthat“Í\calc@textsize“²can“pro�Gcess“its“argumen�¸ãt.ŽŸ��‘R±19Ž‘\ª®È\def\calc@pre@scan#1{%ޤ ��‘R±20Ž‘j×pÈ\ifx(#1%Ž¡��‘R±21Ž‘}½ÈÈ\expandafter\calc@openŽ¡��‘R±22Ž‘j×pÈ\elseŽ¡��‘R±23Ž’‚w^È\ifx\widthof#1%Ž¡��‘R±24Ž’•]¶È\expandafter\expandafter\expandafter\calc@textsizeŽ¡��‘R±25Ž’‚w^È\elseŽ¡��‘R±26Ž’•]¶È\calc@numeric%–¹–no“\expandafter“needed“for“this“one.Ž¡��‘R±27Ž’‚w^È\fiŽ¡��‘R±28Ž‘j×pÈ\fiŽ¡��‘R±29Ž‘j×pÈ#1}ަ�‘RÍ\calc@open–)i²is“used“when“there“is“a“left“parenš¸ãthesis“righ˜t“ahead.‘c#This“paren˜thesisޤ �‘Ris–K2replaced“b�¸ãy“T�‘þU>Ÿ'EŽ‘ãxX“cošGde“corresp˜onding“to“the“co˜de“sequence“\¸f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ–"`ã¸f��ŸÎ:´,‘þ¢_·!±[´B�W=· ´A±]ŽŽ“²"Ž¡�‘Rderiv�¸ãed–UUin“Section“4.‘qÇFinally‘ÿ*ª,“Í\calc@pre@scan“²is“called“again.ŽŸ��‘R±30Ž‘\ª®È\def\calc@open({\begingroup\aftergroup\calc@initBŽŸ ��‘R±31Ž‘j×pÈ\begingroup\aftergroup\calc@initBŽ‘RŸff‰ff�ÿrŸ J=����‘ "5Ÿý-:Á6ŽŽŽ‘LÜÀIn–ÕXthe“few“conšÃŽtexts“where“signs“are“allo˜w˜ed:‘Ç this“could,“I“think,“b�Ÿ'EŽ‘ãxX“user��Ÿü^ÿ±8ŽŽ‘|s².ަ��‘R±35Ž‘\ª®È\newcommand\widthof{}ޤ ��‘R±36Ž‘\ª®È\let\widthof\ignorespacesŽ¡��‘R±37Ž‘\ª®È\newcommand\heightof{}Ž¡��‘R±38Ž‘\ª®È\let\heightof\ignorespacesŽ¡��‘R±39Ž‘\ª®È\newcommand\depthof{}Ž¡��‘R±40Ž‘\ª®È\let\depthof\ignorespacesŽŸ¼í����‘ 6\calc@textsizeŽŽŽ‘R²The–»~presence“of“the“abšGo•¸ãv“e–»~three“commands“in•¸ãv“ok“es–»~this“co˜de,‘where“wš¸ãe“m˜ustޤ �‘Rdistinguish–Ê¥them“from“eacš¸ãh“other.‘C�This“implemen˜tation“is“somewhat“optimized“b˜yŽ¡�‘Rusing›UUlo•¸ãw-lev“el˜co�Gde˜from˜the˜commands˜Í\settowidth²,˜etc��Ÿü^ÿ±9ŽŽ‘|s².Ž¡�‘aWithin–¹xthe“text“argumenš¸ãt“w˜e“m˜ust“restore“the“normal“meanings“of“the“threeŽ¡�‘Ruser-lev�¸ãel–² commands“since“arbitrary“material“can“app�Gear“in“here,‘Òµincluding“furtherŽ¡�‘Ruses–UUof“calc.ަ��‘R±41Ž‘\ª®È\def\calc@textsize‘¹–#1#2{%ޤ ��‘R±42Ž‘fÚÈ\begingroupŽ¡��‘R±43Ž‘o‘È\let\widthof\wdŽ¡��‘R±44Ž‘o‘È\let\heightof\htŽ¡��‘R±45Ž‘o‘È\let\depthof\dpŽ¡��‘R±46Ž‘o‘È\@settodim‘¹–#1%Ž¡��‘R±47Ž‘y2È{\global\calc@A}%Ž¡��‘R±48Ž‘y2È{%Ž¡��‘R±49Ž‘}½ÈÈ\let\widthof\ignorespacesŽ¡��‘R±50Ž‘}½ÈÈ\let\heightof\ignorespacesŽ¡��‘R±51Ž‘}½ÈÈ\let\depthof\ignorespacesŽ¡��‘R±52Ž‘}½ÈÈ#2}%Ž¡��‘R±53Ž‘fÚÈ\endgroupŽ¡��‘R±54Ž‘fÚÈ\calc@post@scan}ŽŸ¼í����‘f \calc@post@scanŽŽŽ‘R²The–•Vmacro“Í\calc@post@scan“²is“called“righš¸ãt“after“a“v‘ÿqÇalue“has“b�Geen“read.‘1ËA˜t“thisޤ �‘RpšGoin�¸ãt,‘‡¥a–T9binary“op˜erator,‘‡¥a“sequence“of“righš¸ãt“paren˜theses,‘‡¥and“the“end-of-expressionŽ¡�‘Rmark–ùv(`Í!²')“is“allo•¸ãw“ed��Ÿü^ÿ±10ŽŽ‘xæ².‘^*Dep�Gending–ùvon“our“ ndings,‘"~w�¸ãe“call“a“suitable“macro“toŽ¡�‘Rgenerate–UTthe“correspšGonding“T�‘þU>Ÿ'EŽ‘ãxX“co˜de“(except“when“w�¸ãe“detect“the“end-of-expressionŽ¡�‘Rmarkš¸ãer:‘q[then–T}scanning“ends,‘T©and“con˜trol“is“returned“to“Í\calc@assign@generic²).Ž‘RŸ9¯‰ff�ÿrŸ J=����‘ "5Ÿý-:Á7ŽŽŽ‘LÜÀIf–ÕXthis“levšÃŽel“of“safet˜y“is“not“needed“then“the“coš����‘ "5Ÿý-:Á8ŽŽŽ‘LÜÀIs–ÕXthis“necessary‘ÿJª,“CAR?Ž¡����‘ "5Ÿý-:Á9ŽŽŽ‘LÜÀIt–ÕXis“based“on“suggestions“bšÃŽy“Donald“Arsenau“and“Da˜vid“Carlisle.Ž¡����‘wŽŸý-:Á10ŽŽŽ‘LÜÀIs–ÕXÎ!‘Ç Àa“go•‰W˜e“therefore“equate“them“toŽ¡�‘RÍ\relax–S¯²but“only“if“they“ha•¸ãv“e–S¯not“already“b�Geen“de ned��Ÿü^ÿ±11ŽŽ‘ Ì•²(bš¸ãy“some“other“pac˜k‘ÿqÇage:Ž¡�‘Rdangerous–nbut“pšGossible!);‘ûthis“will“also“mak�¸ãe“them“app˜ear“to“b˜e“unde ned“to“aŽ¡�‘RL�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX–UUuser“(also“p�Gossibly“dangerous).ަ��‘R±76Ž‘\ª®È\ifx\real\@undefined\let\real\relax\fiޤ ��‘R±77Ž‘\ª®È\ifx\ratio\@undefined\let\ratio\relax\fiŽŸ�‘R²In–UUorder“to“test“for“them,“wš¸ãe“de ne“these“t˜w˜o��Ÿü^ÿ±12ŽŽ‘xæ².ަ��‘R±78Ž‘\ª®È\def\calc@ratio@x{\ratio}Ž¡��‘R±79Ž‘\ª®È\def\calc@real@x{\real}ŽŸ��‘R±80Ž‘\ª®È\def\calc@multiplyx#1{\def\calc@tmp{#1}%Ž¡��‘R±81Ž‘j×pÈ\ifx\calc@tmp\calc@ratio@x–¹–\let\calc@next\calc@ratio@multiply“\elseŽ‘RŸff‰ff�ÿrŸ J=����‘wŽŸý-:Á11ŽŽŽ‘LÜÀSuggested–ÕXco�����‘wŽŸý-:Á12ŽŽŽ‘LÜÀMa�ÃŽy–ÕXnot“need“the“extra“names,“CAR?ŽŽŸ�’þÿ²10ŽŽŒ‹ }ñ y� ý£ ?� ýä��‘R±82Ž‘y2È\ifx\calc@tmp\calc@real@x–¹–\let\calc@next\calc@real@multiply“\elseޤ ��‘R±83Ž’‡0ôÈ\let\calc@next\calc@multiplyŽ¡��‘R±84Ž‘y2È\fiŽ¡��‘R±85Ž‘j×pÈ\fiŽ¡��‘R±86Ž‘j×pÈ\calc@next#1}Ž¡��‘R±87Ž‘\ª®È\def\calc@dividex#1{\def\calc@tmp{#1}%Ž¡��‘R±88Ž‘j×pÈ\ifx\calc@tmp\calc@ratio@x–¹–\let\calc@next\calc@ratio@divide“\elseŽ¡��‘R±89Ž‘y2È\ifx\calc@tmp\calc@real@x–¹–\let\calc@next\calc@real@divide“\elseŽ¡��‘R±90Ž’‡0ôÈ\let\calc@next\calc@divideŽ¡��‘R±91Ž‘y2È\fiŽ¡��‘R±92Ž‘j×pÈ\fiŽ¡��‘R±93Ž‘j×pÈ\calc@next#1}ŽŸ�‘R²The–Spbinary“opšGerators“`Í*²'“and“`Í/²'“also“insert“co˜de“as“determined“ab˜o•¸ãv“e.‘q%Moreo“v“er,ޤ �‘Rthe–ú¯meaning“of“Í\calc@A›ú˜²and“Í\calc@B˜²is“cš¸ãhanged“as“factors“follo˜wing“a“m˜ultiplica-Ž¡�‘Rtion–]and“division“op�Gerator“alw•¸ãa“ys›]ha“v“e˜in“teger˜t“yp�Ge;‘,°the˜original˜meaning˜of˜theseŽ¡�‘Rmacros–UUwill“bšGe“restored“when“the“factor“has“b˜een“read“and“ev‘ÿqÇaluated.Ž©��‘R±94Ž‘\ª®È\def\calc@multiply{\calc@generic@multiply\calc@multiplyBbyA}ޤ ��‘R±95Ž‘\ª®È\def\calc@divide{\calc@generic@multiply\calc@divideBbyA}Ž¡��‘R±96Ž‘\ª®È\def\calc@generic@multiply#1{\endgroup\begingroupŽ¡��‘R±97Ž‘j×pÈ\let\calc@A\calc@Acount‘¹–\let\calc@B\calc@BcountŽ¡��‘R±98Ž‘j×pÈ\aftergroup#1\calc@pre@scan}Ž¡��‘R±99Ž‘\ª®È\def\calc@multiplyBbyA{\multiply\calc@B\calc@Acount}Ž¡��‘N�±100Ž‘\ª®È\def\calc@divideBbyA{\divide\calc@B\calc@Acount}ŽŸ�‘R²Since–ƒŠthe“v‘ÿqÇalue“to“use“in“the“m�¸ãultiplication/division“op�Geration“is“stored“in“theޤ �‘RÍ\calc@Acount–ò$²register,‘ûthe“Í\calc@multiplyBbyA›ò ²and“Í\calc@divideBbyA˜²macrosŽ¡�‘Ruse–UUthis“register.Ž¡�‘aÍ\calc@close–÷x²generates“co�Gde“for“a“righš¸ãt“paren˜thesis“(whic˜h“w˜as“deriv˜ed“toŽ¡�‘Rb�Ge‘�(\¸gµA–ºË¸(“µB›€q¸gµA“¸(“µB˜²"–�(in“Section“4).‘õAAfter“this“co�Gde,‘Ìthe“con�¸ãtrol“is“returnedŽ¡�‘Rto–UîÍ\calc@post@scan“²in“order“to“lo�Gok“for“another“righš¸ãt“paren˜thesis“or“a“binaryŽ¡�‘Rop�Gerator.ަ��‘N�±101Ž‘\ª®È\def\calc@closeޤ ��‘N�±102Ž‘j×pÈ{\endgroup\global\calc@A\calc@BŽ¡��‘N�±103Ž‘o‘È\endgroup\global\calc@A\calc@BŽ¡��‘N�±104Ž‘o‘È\calc@post@scan}ŽŸþ6��‘RÐ5.5Ž‘pÀCalculating–€a“ratioŽŸuT�‘R²When–ºÔÍ\calc@post@scan“²encounš¸ãters“a“Í\ratio“²con˜trol“sequence,‘Ô3it“hands“con˜trolޤ �‘Rto–ÐFone“of“the“macros“Í\calc@ratio@multiply“²or“Í\calc@ratio@divide²,‘êãdep�GendingŽ¡�‘Ron–^wthe“preceding“cš¸ãharacter.‘�-Those“macros“b�Goth“forw˜ard“the“con˜trol“to“the“macroŽ¡�‘RÍ\calc@ratio@evaluate²,‘ô¾whicš¸ãh–¡©p�Gerforms“t˜w˜o“steps:‘ o(1)“it“calculates“the“ratio,Ž¡�‘Rwhicš¸ãh–ËËis“sa˜v˜ed“in“the“global“macro“tok˜en“Í\calc@the@ratio²;‘ù¤(2)“it“mak˜es“sure“thatŽ¡�‘Rthe–b!v‘ÿqÇalue“of“Í\calc@B‘b²will“b�Ge“mš¸ãultiplied“b˜y“the“ratio“as“so�Gon“as“the“curren˜t“groupŽ¡�‘Rends.Ž¡�‘aThe–jfolloš¸ãwing“macros“call“Í\calc@ratio@evaluate“²whic˜h“m˜ultiplies“Í\calc@BŽ¡�‘R²bš¸ãy–g the“ratio,‘kwbut“Í\calc@ratio@divide“² ips“the“argumen˜ts“so“that“the“`opp�Gosite'ŽŽŸ�’þÿ11ŽŽŒ‹ ŠJ y� ý£ ?� ýä�‘R²fraction–UUis“actually“ev‘ÿqÇaluated.ޤ��‘N�±105Ž‘\ª®È\def\calc@ratio@multiply\ratio{\calc@ratio@evaluate}Ž© ��‘N�±106Ž‘\ª®È\def\calc@ratio@divide\ratio#1#2{\calc@ratio@evaluate{#2}{#1}}ŽŸ�‘R²W›ÿ*ªe–V¿shall“need“t•¸ãw“o–V¿registers“for“temp�Gorary“usage“in“the“calculations.‘vW˜e“can“sa•¸ãv“eŽŸ �‘Rone–UUregister“since“w�¸ãe“can“reuse“Í\calc@Bcount².Ž¡��‘N�±107Ž‘\ª®È\let\calc@numerator=\calc@Bcountަ��‘N�±108Ž‘\ª®È\newcount\calc@denominatorŽŸ�‘R²Here–›is“the“macro“that“handles“the“actual“ev‘ÿqÇaluation“of“ratios.‘BÐThe“pro�Gcedure“isޤ �‘Rthis:‘‹ßFirst,‘e¤the›bat•¸ãw“o˜expressions˜are˜ev‘ÿqÇaluated˜and˜co�Gerced˜to˜in“tegers.‘˜ìThe˜wholeŽ¡�‘RprošGcedure–9ýis“enclosed“in“a“group“to“b˜e“able“to“use“the“registers“Í\calc@numeratorŽ¡�‘R²and–UUÍ\calc@denominator“²for“temp�Gorary“manipulations.ŽŸ��‘N�±109Ž‘\ª®È\def\calc@ratio@evaluate#1#2{%ަ��‘N�±110Ž‘j×pÈ\endgroup\begingroupަ��‘N�±111Ž‘y2È\calc@assign@dimen\calc@numerator{#1}%ަ��‘N�±112Ž‘y2È\calc@assign@dimen\calc@denominator{#2}%ŽŸ�‘R²Here–Ÿìwš¸ãe“calculate“the“ratio.‘5OFirst,‘Ä4w˜e“c˜hec˜k“for“negativ˜e“n˜umerator“and/or“denom-Ž¡�‘Rinator;‘Ãßnote–Ÿthat“T�‘þU>Ÿ'EŽ‘ãxX“inš¸ãterprets“t˜w˜o“min˜us“signs“the“same“as“a“plus“sign.‘NÜThen,Ž¡�‘Rwš¸ãe–upcalculate“the“in˜teger“part.‘ÒThe“min˜us“sign(s),‘}wthe“in˜teger“part,‘}wand“a“decimalŽ¡�‘Rp�Goin�¸ãt,–UUform“the“initial“expansion“of“the“Í\calc@the@ratio“²macro.ŽŸ��‘N�±113Ž‘y2È\gdef\calc@the@ratio{}%ަ��‘N�±114Ž‘y2È\ifnum\calc@numerator<0‘¹–\calc@numerator-\calc@numeratorަ��‘N�±115Ž’‡0ôÈ\gdef\calc@the@ratio{-}%ަ��‘N�±116Ž‘y2È\fiަ��‘N�±117Ž‘y2È\ifnum\calc@denominator<0‘¹–\calc@denominator-\calc@denominatorަ��‘N�±118Ž’‡0ôÈ\xdef\calc@the@ratio{\calc@the@ratio-}%ަ��‘N�±119Ž‘y2È\fiަ��‘N�±120Ž‘y2È\calc@Acount\calc@numeratorަ��‘N�±121Ž‘y2È\divide\calc@Acount\calc@denominatorަ��‘N�±122Ž‘y2È\xdef\calc@the@ratio{\calc@the@ratio\number\calc@Acount.}%ŽŸ�‘R²No•¸ãw›%¡w“e˜generate˜the˜digits˜after˜the˜decimal˜p�Goin“t,‘Y´one˜at˜a˜time.‘â¬When˜T�‘þU>Ÿ'EŽ‘ãxXŽ¡�‘Rscans–¿‚these“digits“(in“the“actual“m�¸ãultiplication“opšGeration),‘Ú it“forms“a“ xed-p˜oin�¸ãtŽ¡�‘Rn•¸ãum“bšGer–„owith“16“bits“for“the“fractional“part.‘ÿW‘ÿ*ªe“hop˜e“that“six“digits“is“sucien�¸ãt,Ž¡�‘Revš¸ãen–UUthough“the“last“digit“ma˜y“not“b�Ge“rounded“correctly‘ÿ*ª.ŽŸ��‘N�±123Ž‘y2È\calc@next@digit–¹–\calc@next@digit“\calc@next@digitަ��‘N�±124Ž‘y2È\calc@next@digit–¹–\calc@next@digit“\calc@next@digitަ��‘N�±125Ž‘j×pÈ\endgroupŽŸ�‘R²No•¸ãw›K×w“e˜ha“v“e˜the˜ratio˜represen“ted˜(as˜the˜expansion˜of˜the˜global˜macroŽ¡�‘RÍ\calc@the@ratio²)–zèin“the“synš¸ãtax“¸h²decimal“constan˜t¸i“²[�1Ž‘,‘ÄLpage“270].‘âThis“is“fedŽ¡�‘Rto–}mÍ\calc@multiply@by@real“²that“will“p�Gerform“the“actual“m�¸ãultiplication.‘êIt“isŽ¡�‘Rimp�Gortanš¸ãt–÷°that“the“m˜ultiplication“tak˜es“place“at“the“correct“grouping“lev˜el“so“thatŽ¡�‘Rthe–.Æcorrect“instance“of“the“µB‘¯7²register“will“b�Ge“used.‘díAlso“note“that“w�¸ãe“do“not“needŽ¡�‘Rthe–UUÍ\aftergroup“²mec�¸ãhanism“in“this“case.ŽŸ��‘N�±126Ž‘j×pÈ\calc@multiply@by@real\calc@the@ratioަ��‘N�±127Ž‘j×pÈ\begingroupަ��‘N�±128Ž‘j×pÈ\calc@post@scan}ŽŽŸ�’þÿ²12ŽŽŒ‹ –Y y� ý£ ?� ýä�‘R²The–åÍ\begingroup“²inserted“bšGefore“the“Í\calc@post@scan“²will“b˜e“matcš¸ãhed“b˜y“theޤ �‘RÍ\endgroup–m@²generated“as“part“of“the“replacemenš¸ãt“of“a“subsequen˜t“binary“op�GeratorŽ¡�‘Ror–UUrighš¸ãt“paren˜thesis.Ž© Ö`��‘N�±129Ž‘\ª®È\def\calc@next@digit{%ޤ ��‘N�±130Ž‘y2È\multiply\calc@Acount\calc@denominatorŽ¡��‘N�±131Ž‘y2È\advance\calc@numerator‘¹–-\calc@AcountŽ¡��‘N�±132Ž‘y2È\multiply\calc@numerator‘¹–10Ž¡��‘N�±133Ž‘y2È\calc@Acount\calc@numeratorŽ¡��‘N�±134Ž‘y2È\divide\calc@Acount\calc@denominatorŽ¡��‘N�±135Ž‘y2È\xdef\calc@the@ratio{\calc@the@ratio\number\calc@Acount}}ޤÖ`�‘R²In–rthe“follo�¸ãwing“cošGde,‘<¹it“is“imp˜ortanš¸ãt“that“w˜e“ rst“assign“the“result“to“a“dimenŽŸ �‘Rregister.‘qÇOtherwise,–UUT�‘þU>Ÿ'EŽ‘ãxX“wš¸ãon't“allo˜w“us“to“m˜ultiply“with“a“real“n˜um˜b�Ger.ަ��‘N�±136Ž‘\ª®È\def\calc@multiply@by@real#1{\calc@Bdimen–¹–#1\calc@B“\calc@B\calc@Bdimen}Ž¡�‘R²(Note–(Othat“this“co�Gde“wš¸ãouldn't“w˜ork“if“Í\calc@B‘(²w˜ere“a“m˜uglue“register.‘ê´This“isޤ �‘Rthe–ZÌreal“reason“whš¸ãy“the“Ícalc“²pac˜k‘ÿqÇage“došGesn't“supp˜ort“m�¸ãuglue“expressions.‘‚+T‘ÿ*ªoŽ¡�‘Rsupp�Gort–¾‚mš¸ãuglue“expressions“in“full,‘Íthe“Í\calc@multiply@by@real“²macro“m˜ustŽ¡�‘Ruse–²ea“mš¸ãuglue“register“instead“of“Í\calc@Bdimen“²when“Í\calc@B‘²;²is“a“m˜uglue“register;Ž¡�‘Rotherwise,‘Šýa–€Bdimen“register“should“bšGe“used.‘ò�Since“in�¸ãteger“expressions“can“app˜earŽ¡�‘Ras–Cœpart“of“a“mš¸ãuglue“expression,‘.it“w˜ould“b�Ge“necessary“to“determine“the“correctŽ¡�‘Rregister–UUto“use“eacš¸ãh“time“a“m˜ultiplication“is“made.)ŽŸÚ^��‘RÐ5.6Ž‘pÀMultiplication–€bš y“real“n˜um˜b�`ersŽŸuT�‘R²This–==is“similar“to“the“Í\calc@ratio@evaluate“²macro“ab�Go•¸ãv“e,‘Bexcept–==that“it“is“con-Ž¡�‘Rsiderably–UUsimpli ed“since“w�¸ãe“don't“need“to“calculate“the“factor“explicitly‘ÿ*ª.ަ��‘N�±137Ž‘\ª®È\def\calc@real@multiply\real#1{\endgroupޤ ��‘N�±138Ž‘j×pÈ\calc@multiply@by@real{#1}\begingroupŽ¡��‘N�±139Ž‘j×pÈ\calc@post@scan}Ž¡��‘N�±140Ž‘\ª®È\def\calc@real@divide\real#1{\calc@ratio@evaluate{1pt}{#1pt}}ŽŸ íì��‘RÌ6Ž‘jLËRep�s3orting‘fferrorsŽŸç�‘R²If–5Í\calc@post@scan“²reads“a“c�¸ãharacter“that“is“not“one“of“`Í+²',–;�`Í-²',“`Í*²',“`Í/²',“or‘5`Í)²',“anޤ �‘Rerror–Üûhas“ošGccurred,‘þäand“this“is“rep˜orted“to“the“user.‘¹Violations“in“the“syn�¸ãtax“ofŽ¡�‘R¸h²n�¸ãumeric¸i²s–UUwill“bšGe“detected“and“rep˜orted“b�¸ãy“T�‘þU>Ÿ'EŽ‘ãxX.ަ��‘N�±141Ž‘\ª®È\def\calc@error#1{%ޤ ��‘N�±142Ž‘j×pÈ\PackageError{calc}%Ž¡��‘N�±143Ž‘tJœÈ{`#1'–¹–invalid“at“this“point}%Ž¡��‘N�±144Ž‘tJœÈ{I–¹–expected“to“see“one“of:“+“-“*“/“)}}Ž¡��‘N�±145Ž‘\ª®Êh�ó5ùž" cmmi9É=Ñpack�¾9ageŽ‘#g ÊiŽŸ íì�‘RÌReferencesŽŸç���‘R²[1]ŽŽ‘aŽ;ó.Œ-ø cmcsc10ÙD.–ôE.“Knuth².›b ÏThe‘ü1T�‘þKß'EŽ‘Í-Xb–ÿ}'o“ok‘Ãú²(Computers–°m&“T�¸ãyp�Gesetting“V‘ÿ*ªolume“A).˜Addison-ŽŸ �‘aŽ;W–ÿ*ªesley“,–UUReading,“Massac•¸ãh“usetts,‘UU1986.ŽŽŸ�’þÿ13ŽŽŒ‹£] y� ý£ ?� ýä���‘R²[2]ŽŽ‘aŽ;ÙL.‘´WLampor‘ÿUTt².‘ÄaÏL�Ÿýé›�‘üQíó/t}\Êcmti7ÚAŽŽ‘ÙÏT�‘þKß'EŽ‘Í-X,‘ÓPA‘¢ìDo–ÿ}'cument›£)Pr“ep“ar“ation˜System.‘Äa²Addison-W–ÿ*ªesley“,‘ƒýRead-ŽŸ �‘aŽ;ing,›UUMassac•¸ãh“usetts,˜Second˜edition˜1994/1985.ŽŽŸ�’þÿ14ŽŽŒø¯.ƒ’À;èyµó/t}\Êcmti7ó.Œ-ø cmcsc10ó-2Ç@Écmbx8ó&ÒoÇw cmss9ó%ÂÖN  cmbx12ó$ý': cmti10ó#ßCÊscmtt8ó"ßê cmmi10ó 0e—rcmmi7óKñ`y cmr10óÙ“ Rcmr7ù°vßßßßß