Raised This Month: $ Target: $400
 0% 

Bits Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 12-09-2012 , 07:43   Bits Help
Reply With Quote #1

If I use

PHP Code:
 g_GetValue |=  ( << ) ) 
Is possible to return that 6 from g_GetValue?

Last edited by bogdyuttzu; 12-09-2012 at 07:43.
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-09-2012 , 08:05   Re: Bits Help
Reply With Quote #2

PHP Code:
new bits_set[32], cnt
for(new i=0i<32i++){
    if(
g_GetValue 1<<i)
        
bits_set[cnt++] = i

__________________
Impossible is Nothing
Sylwester is offline
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 12-09-2012 , 08:38   Re: Bits Help
Reply With Quote #3

If is possible I wait another method..

Last edited by bogdyuttzu; 12-09-2012 at 08:39.
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-09-2012 , 14:56   Re: Bits Help
Reply With Quote #4

Quote:
Originally Posted by bogdyuttzu View Post
If is possible I wait another method..
Why? The array gives you all the bit positions that are set to 1. If the seventh bit (1<<6) is set, it will have a 6 in the array.

You probably need to explain exactly what you are trying to do.
__________________

Last edited by fysiks; 12-09-2012 at 14:57.
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode