Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
20th March 2006, 22:32 | #11 | Link | |
FFmpeg fan
Join Date: Dec 2003
Location: Germany
Posts: 427
|
Quote:
I wanted to express that ppl are advised to change Code:
int x = 8; int y = x/2; Code:
unsigned int x = 8; unsigned y = x >> 1; here. Hellfred Small programm to test: Code:
#include <iostream> using namespace std; int main() { unsigned int x = 8; x = x >> 1; // x/2 cout << x << endl; x = x >> 1; // x/2 cout << x << endl; unsigned int y = 2; y = y << 1; // y*2 cout << y << endl; y = y << 1; // y*2 cout << y << endl; return 0; } Code:
haibane@LapLap:~/tmp$ g++ shift.cpp -o shift haibane@LapLap:~/tmp$ ./shift 4 2 4 8 Last edited by hellfred; 20th March 2006 at 22:42. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|