Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aiai!ken From: ken@aiai.ed.ac.uk (Ken Johnson) Newsgroups: comp.lang.pascal Subject: Base conversion (was Re: Brain Teaser) Message-ID: <1246@skye.ed.ac.uk> Date: 18 Oct 89 09:42:30 GMT References: <727@thor.wright.EDU> <1989Oct5.213548.13466@wuee1.wustl.edu> <1207@krafla.rhi.hi.is> Reply-To: ken@aiai.UUCP (Ken Johnson) Followup-To: comp.lang.pascal Organization: AIAI, University of Edinburgh, Scotland Lines: 13 > Write a routine that will convert from one base to another. > function convert(base : integer; input_num : string) : string; Can anyone extend this to cover multi-base arithmetic with fractions? For example, 1.4(8) should convert to 1.1(2) and 10.875(10) to A.E(16) -- Ken Johnson, AI Applications Institute, 80 South Bridge, Edinburgh EH1 1HN E-mail ken@aiai.ed.ac.uk, phone 031-225 4464 extension 212 `I have read your article, Mr Johnson, and I am no wiser now than when I started'. -- `Possibly not, sir, but far better informed.'