Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types with finite bit count
Synopsis
- class FiniteBits a where
Documentation
class FiniteBits a where Source #
Type representable by a fixed amount of bits
bitSize :: (Integral i, KnownNat (BitSize a)) => a -> i Source #
Number of bits (the value is ignored)
All bits set to 0
All bits set to 1
oneBits :: Bitwise a => a Source #
All bits set to 1
countLeadingZeros :: a -> Word Source #
Count number of zero bits preceding the most significant set bit
countTrailingZeros :: a -> Word Source #
Count number of zero bits following the least significant set bit