AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bits (results -1) (https://forums.alliedmods.net/showthread.php?t=214204)

Xalus 04-24-2013 07:53

Bits (results -1)
 
Hey,

For the weaponsystem I'm making for Dimensions,
I'm trying to get the result of:

PHP Code:

( (<< 0) | (<< 1) | (<< 2) | (<< 3) | (<< 4) | (<< 5) | (<< 6) | (<< 7) | (<< 8) | (<< 9) | (<< 10) | (<< 11) | (<< 12) | (<< 13) | (<< 14) | (<< 15) | (<< 16) | (<< 17) | (<< 18) | (<< 19) | (<< 20) | (<< 21) | (<< 22) | (<< 23) | (<< 24) | (<< 25) | (<< 26) | (<< 27) | (<< 28) | (<< 29) | (<< 30) | (<< 31) ) 

But it returns -1

Whats wrong with it

Xalus 04-24-2013 08:07

Re: Bits (results -1)
 
Looks like 1<<31 was to much for PAWN

Solved ;)

Arkshine 04-24-2013 08:28

Re: Bits (results -1)
 
It's because you use %d/%i instead of %u (unsigned) (so unrelated to 1 << 31 itself)

And to get such value, you can do : ~( 1 << 32 ) + 1.

Xalus 04-24-2013 11:01

Re: Bits (results -1)
 
Aight,

Thanks!


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

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