Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ncar!tank!oddjob!uxc!uxc.cso.uiuc.edu!a.cs.uiuc.edu!m.cs.uiuc.edu!calhoun From: calhoun@m.cs.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: base 10 --> base 3 ... Message-ID: <42200001@m.cs.uiuc.edu> Date: 24 Aug 88 18:04:00 GMT References: <730059@hpcilzb.HP.COM> Lines: 27 Nf-ID: #R:hpcilzb.HP.COM:730059:m.cs.uiuc.edu:42200001:000:795 Nf-From: m.cs.uiuc.edu!calhoun Aug 24 13:04:00 1988 >--------------------------------- > >ConvertBase(n, base){ > if(n >= base) > ConvertBase(n/base, base) > Output(n%base); >} > >--------------------------------- >where OutPut(digit) will emit the digit as the final result. Note: all the >declarations here default to short int, so I don't have to explicitly >declare anything. > >To convert this routine to pascal, declare everything and replace '%' by >' mod ' I may be mistaken (its been awhile since my pascal days) but I think you also need to change the / (indicating division) to DIV when converting to pascal. Jeff Calhoun University of Illinois Computer Science Dept Rm 200/220 Digital Computing Lab 1304 W. Springfield, Urbana, IL 61801 calhoun@a.cs.uiuc.edu uiucdcs!calhoun calhoun@uiucdcs.bitnet