Re: is there an efficient algorithm for switching representation base?




Robert Israel wrote:
In article <1151301282.057399.220090@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
apc <andres.paniagua@xxxxxx> wrote:

Hi Chip, at this point I'm not taking into account the computing
platform. What I'm looking for is an algorithm to transform the
representation of a whole positive number N in some base a into some
other base b. ie. N=4, a=2, b=3 Na=100 Nb=11. N, b, a will all be
integers. I already know the one you mention, but is there anything
better? By good I mean that it take as few simple steps as possible.
Thanks a lot
apc.

IIRC Knuth "The Art of Computer Programming" volume II sec. 4.4
has a good discussion of this. The key phrase to look up is "radix
conversion".

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

Thank you very much for the pointer, I should've thought of it myself.
I dug it up and am looking into it.

.



Relevant Pages

  • Re: No Set Contains Every Computable Natural (was Church-Turing compared to Zuse-Fredkin thesis)
    ... Russell is right about Turing saying this, ... You might not want to call this an algorithm which has ... decimal representation of x digit by digit. ...
    (comp.theory)
  • Re: Inverse chirp z
    ... It looks like chirp z and especially inverse transform is ... you have to separate the algorithm from the ... variant of Bluestein's 1968 FFT algorithm, ...
    (comp.dsp)
  • rapidly converging rational sqrt
    ... I do not know if this algorithm is new, ... We designate the tail of this continued fraction using ... representation has the form: ... If the evaluation of the first n terms produced ...
    (sci.math.research)
  • Re: printf "%.100f" the value 2 ^ (-127)
    ... > I was trying to imagine an algorithm that, for at least one finite FP ... > representation, would output an infinite series of digits. ... This range contains an infinite number of rational values. ... or as a periodic decimal fraction (e.g. ...
    (microsoft.public.vc.language)
  • Re: Modelling an OO data structure
    ... strike me as especially O-O representations. ... The choice of algorithm affects the representation. ... extending the programming language into the problem domain (a ...
    (comp.object)