Click here to Skip to main content
16,006,013 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pointers problem with unsafe code Pin
Christian Graus13-Dec-07 17:50
protectorChristian Graus13-Dec-07 17:50 
GeneralRe: Pointers problem with unsafe code Pin
Luc Pattyn13-Dec-07 23:47
sitebuilderLuc Pattyn13-Dec-07 23:47 
GeneralCombining redundant code for implicit type conversions Pin
Skippums13-Dec-07 14:13
Skippums13-Dec-07 14:13 
GeneralRe: Combining redundant code for implicit type conversions Pin
Pete O'Hanlon14-Dec-07 1:34
mvePete O'Hanlon14-Dec-07 1:34 
AnswerRe: Combining redundant code for implicit type conversions Pin
Skippums14-Dec-07 6:06
Skippums14-Dec-07 6:06 
GeneralIs number a power of 2 Pin
#realJSOP13-Dec-07 10:20
professional#realJSOP13-Dec-07 10:20 
GeneralRe: Is number a power of 2 Pin
Christian Graus13-Dec-07 12:08
protectorChristian Graus13-Dec-07 12:08 
GeneralRe: Is number a power of 2 Pin
Luc Pattyn13-Dec-07 12:09
sitebuilderLuc Pattyn13-Dec-07 12:09 
Hi John, the following test applies to signed integers and returns true if and only if the
value is either zero, a positive power of 2, or the minimum value (which equals the negative
of a power of 2); it basically checks that there are either zero or one bits set:
(x & -x)==x

It relies on the fact that -x, when looking from right to left, preserves all the low-end zeroes
of x, as well as one low-end one, and flips all the other bits.

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


Sorry for any delays in replying, I currently don't always get e-mail notifications.


GeneralRe: Is number a power of 2 Pin
Paul Conrad23-Dec-07 9:52
professionalPaul Conrad23-Dec-07 9:52 
GeneralRe: Is number a power of 2 Pin
Judah Gabriel Himango13-Dec-07 12:16
sponsorJudah Gabriel Himango13-Dec-07 12:16 
GeneralRe: Is number a power of 2 Pin
Luc Pattyn13-Dec-07 12:36
sitebuilderLuc Pattyn13-Dec-07 12:36 
GeneralRe: Is number a power of 2 Pin
Judah Gabriel Himango13-Dec-07 12:53
sponsorJudah Gabriel Himango13-Dec-07 12:53 
GeneralRe: Is number a power of 2 Pin
Pete O'Hanlon14-Dec-07 1:00
mvePete O'Hanlon14-Dec-07 1:00 
GeneralCheckBox selection in DataGridView.. Pin
sribachana13-Dec-07 9:29
sribachana13-Dec-07 9:29 
GeneralRe: CheckBox selection in DataGridView.. Pin
Pankaj - Joshi13-Dec-07 18:12
Pankaj - Joshi13-Dec-07 18:12 
GeneralEvent Handler in a control Pin
Stephen McAllister13-Dec-07 9:18
Stephen McAllister13-Dec-07 9:18 
GeneralRe: Event Handler in a control Pin
Dave Kreskowiak14-Dec-07 4:04
mveDave Kreskowiak14-Dec-07 4:04 
GeneralShow MDI child as not maximized Pin
eggsovereasy13-Dec-07 8:55
eggsovereasy13-Dec-07 8:55 
GeneralRe: Show MDI child as not maximized Pin
Dave Kreskowiak13-Dec-07 9:51
mveDave Kreskowiak13-Dec-07 9:51 
GeneralRe: Show MDI child as not maximized Pin
eggsovereasy13-Dec-07 10:20
eggsovereasy13-Dec-07 10:20 
QuestionWays to re-establish connection between client and server on remoting? Pin
kumar.bs13-Dec-07 8:00
kumar.bs13-Dec-07 8:00 
AnswerRe: Ways to re-establish connection between client and server on remoting? Pin
mav.northwind14-Dec-07 1:22
mav.northwind14-Dec-07 1:22 
QuestionIn console App can i bound an area for user entry? Pin
dipak.dipak13-Dec-07 7:11
dipak.dipak13-Dec-07 7:11 
GeneralRe: In console App can i bound an area for user entry? Pin
Skippums13-Dec-07 7:53
Skippums13-Dec-07 7:53 
Generalextracting a certain text from a string before and after a comma Pin
jimmy2shoes13-Dec-07 7:08
jimmy2shoes13-Dec-07 7:08 

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.