Fast Binary-to-Decimal Conversion Algorithms?
From: Simon G Best (s.g.best_at_btopenworld.com)
Date: 07/31/04
- Next message: Thomas Gagne: "Programming liability (was rework was dynamic...)"
- Previous message: mensanator_at_aol.com: "Re: monospaced fonts good for programming. For those bored to tears with the same ol' @#$%"
- Next in thread: Richard Harter: "Re: Fast Binary-to-Decimal Conversion Algorithms?"
- Reply: Richard Harter: "Re: Fast Binary-to-Decimal Conversion Algorithms?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 31 Jul 2004 00:55:28 +0000 (UTC)
Hello!
Without much success, I've been trying to find a 'fast' algorithm for
converting large numbers from binary to decimal. By 'fast', I mean
something like O(N log(N)). By 'large', I mean billions of bits. Oh,
and I'd like a similarly fast algorithm for converting back from decimal
to binary, too, please. Oh, and yes, I'd like fries with that :-)
O(N^2) algorithms are obvious, and I've had no trouble finding those on
the web (not that I need to look them up).
I've also been informed of what seems to be a faster algorithm by
Christian Bau in sci.math. It's a way of using an n-bit-to-m-digit
converter in a 2n-bit-to-2m-digit converter. It works as follows.
To convert a 2n bit binary number, x, into a 2m digit decimal number,
split x into two, n bit binary numbers, y and z, such that x = (2^n)y +
z. Convert 2^n, y and z into decimal (using the n-bit-to-m-digit
converter), and then calculate x in decimal. This technique can
obviously be applied recursively for 4n bit numbers, 8n bit numbers, 16n
bit numbers, and so on.
Is there a faster algorithm? Where might I be able to find the kinds of
speedy algorithms I'm looking for? Where might I be able to find some
useful pointers? Which newsgroup should I really be asking this in?
Thanks!
Simon
- Next message: Thomas Gagne: "Programming liability (was rework was dynamic...)"
- Previous message: mensanator_at_aol.com: "Re: monospaced fonts good for programming. For those bored to tears with the same ol' @#$%"
- Next in thread: Richard Harter: "Re: Fast Binary-to-Decimal Conversion Algorithms?"
- Reply: Richard Harter: "Re: Fast Binary-to-Decimal Conversion Algorithms?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|