On 13 Dec 2004 04:15:11 -0800
"Steve" <st************@yahoo.com> wrote:
Assuming that "division" is a very costly operation (except by any
multiples of 2), whats the fastest way of printing a 32-bit number as
a base-10 unsigned integer.
puts("a 32-bit number as a base-10 unsigned integer.");
The C language does not define the relative speed of different
operations. printf and friends on your implementation might be highly
optimised assembler that you could not beet using C, or it might be
incredibly slow and easy to beet in C. It might be fastest to use
multiply and shift down (I know one processor where this is definitely
true) or multiple might be slow and you are best using a shift and
add/subtract algorithm.
In short, if you want to know what is fast for your implementation you
need to ask in a group dedicated to your platform.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.