Click here to Skip to main content
15,898,222 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Unique number from two numbers Pin
harold aptroot15-May-10 5:37
harold aptroot15-May-10 5:37 
GeneralRe: Unique number from two numbers Pin
Luc Pattyn15-May-10 5:40
sitebuilderLuc Pattyn15-May-10 5:40 
GeneralRe: Unique number from two numbers Pin
theCPkid15-May-10 5:47
theCPkid15-May-10 5:47 
GeneralRe: Unique number from two numbers Pin
harold aptroot15-May-10 5:49
harold aptroot15-May-10 5:49 
GeneralRe: Unique number from two numbers Pin
Luc Pattyn15-May-10 5:53
sitebuilderLuc Pattyn15-May-10 5:53 
GeneralRe: Unique number from two numbers Pin
theCPkid15-May-10 5:41
theCPkid15-May-10 5:41 
GeneralRe: Unique number from two numbers Pin
harold aptroot15-May-10 5:43
harold aptroot15-May-10 5:43 
GeneralRe: Unique number from two numbers Pin
Luc Pattyn15-May-10 6:00
sitebuilderLuc Pattyn15-May-10 6:00 
Windows does that itself, it often stores both x and y coordinates in "lParam", the good old 32-bit parameter in Windows messages.

Two remarks;
1. If your x and y values are within [ -2^15, 2^15), you could do with a 32-bit signed integer, so no need for "long long". Similar for unsigned.
2. If your app is graphics oriented, you may want to use signed variables; you then must be careful about sign propagation effects in right shifts!

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Unique number from two numbers Pin
CPallini18-May-10 1:52
mveCPallini18-May-10 1:52 
GeneralRe: Unique number from two numbers Pin
CPallini17-May-10 22:37
mveCPallini17-May-10 22:37 
GeneralRe: Unique number from two numbers Pin
theCPkid18-May-10 1:39
theCPkid18-May-10 1:39 
GeneralRe: Unique number from two numbers Pin
CPallini18-May-10 1:45
mveCPallini18-May-10 1:45 
QuestionSocket message(frame) pattern matching Pin
Hamed Musavi13-May-10 7:42
Hamed Musavi13-May-10 7:42 
AnswerRe: Socket message(frame) pattern matching Pin
Luc Pattyn13-May-10 7:55
sitebuilderLuc Pattyn13-May-10 7:55 
GeneralRe: Socket message(frame) pattern matching Pin
Hamed Musavi13-May-10 8:21
Hamed Musavi13-May-10 8:21 
GeneralRe: Socket message(frame) pattern matching Pin
Luc Pattyn13-May-10 8:31
sitebuilderLuc Pattyn13-May-10 8:31 
GeneralRe: Socket message(frame) pattern matching Pin
Hamed Musavi13-May-10 8:55
Hamed Musavi13-May-10 8:55 
GeneralRe: Socket message(frame) pattern matching Pin
Luc Pattyn13-May-10 9:05
sitebuilderLuc Pattyn13-May-10 9:05 
GeneralRe: Socket message(frame) pattern matching Pin
Hamed Musavi13-May-10 9:25
Hamed Musavi13-May-10 9:25 
GeneralRe: Socket message(frame) pattern matching Pin
Luc Pattyn13-May-10 9:34
sitebuilderLuc Pattyn13-May-10 9:34 
GeneralRe: Socket message(frame) pattern matching Pin
Hamed Musavi13-May-10 9:39
Hamed Musavi13-May-10 9:39 
QuestionNeed of Decision Tree Implementation Pin
Radiit6-May-10 3:05
Radiit6-May-10 3:05 
Questionfind a sulution! Pin
wbgxx3-May-10 3:59
wbgxx3-May-10 3:59 
AnswerRe: find a sulution! Pin
Kevin Drzycimski3-May-10 4:06
Kevin Drzycimski3-May-10 4:06 
GeneralRe: find a sulution! Pin
wbgxx3-May-10 4:12
wbgxx3-May-10 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.