class Bits
package de.polygonal.ds.tools
Helper class for working with bits
Static methods
staticinline flipDWORD (x:Int):Int
Flips the bytes within the DWORD x (4 bytes) to convert between little endian and big endian format.
staticinline flipWORD (x:Int):Int
Flips the bytes within the WORD x (2 bytes) to convert between little endian and big endian format.
staticinline nlz (x:Int):Int
Counts the number of leading 0's in x. For example 0b10000 has 27 leading 0's.
staticinline ntz (x:Int):Int
Counts the number of trailing 0's in x. For example 0b10000 has 4 trailing 0's.
staticinline ones (x:Int):Int
Counts the number of "1"-bits in x. For example 0b00110111 has 5 bits set.