|
|
Thorsten Froehlich <tho### [at] trfde> wrote:
> In fact, the integer division is slow due to the iterative algorithm (in
> hardware!) needed to execute it. It would in fact be slower for most 64 bit
> integers assuming the numbers you divide are sufficiently big (outside 32
> bit range) because the time an integer division takes is not constant but
> rather depends on the number of one- and zero-bits with any reasonable
> processor released in the last three decades.
Are you sure it's an iterative algorithm at transistor level?
One would think that, for example, adding two integers is iterative
(how else could you know if the sum of two bits overflows, thus creating
the need to add an additional 1 to the next bit?). However, it is
perfectly possible to add integers of any amount of bits in 1 clock cycle.
--
- Warp
Post a reply to this message
|
|