Re: must go faster!

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Severian (severian_at_chlamydia-is-not-a-flower.com)
Date: 03/18/05


Date: Fri, 18 Mar 2005 13:27:49 GMT

On Fri, 18 Mar 2005 09:31:11 +0100, "Bruno van Dooren"
<microvax@hotmail.com> wrote:

<snip>

>dividing an integer by 2 however is often replaced by shifting the bits 1
>position to the right, because it is faster and it has the exact same
>result.

In standard C and C++, this is necessarily true only for unsigned
values!

The result of right-shifting a signed quantity is
implementation-defined.

--
Sev

Quantcast