Quote:
Originally Posted by StainlessS
This would be nice addition to +.
Code:
RT_BitSetCount(int)
Return an int, the count of the number of set bits (1's) in arg int.
NOTE, Previous Bit functions are similar to the v2.6 bit manipulation functions, however this one has no equivalent in v2.6
[perhaps it should, it is quite handy, as used in the ApparentFPS() script prototype)]
BitClrCount easily calc'd from above.
|
This one?
https://stackoverflow.com/questions/...32-bit-integer
RT_xxx collection have quite a few useful function, do you (or others) recommend to cherry-pick some of them, which are worth of integration and futureproof?
Edit:
Code:
- New script function: int BitSetCount(int[,int, int, ...])
Function accepts one or more integer parameters
Returns the number of bits set to 1 in the number or the total number of '1' bits in the supplied integers.