Copyright | Copyright © 2019-2021 Lars Kuhtz <lakuhtz@gmail.com> |
---|---|
License | BSD3 |
Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Internal Utilities. No guarantee is made about the stability of these functions. Changes to these function won't be announced in the CHANGELOG and are not reflected in the package version.
Synopsis
- w :: forall (n :: Nat). KnownNat n => Int
- int :: Integral a => Num b => a -> b
- fit :: Real a => Real b => Integral c => a -> b -> c
- intFit :: Integral a => Integral b => a -> b -> a
- nextPowerOfTwo :: Real a => Integral b => a -> b
- intNextPowerOfTwo :: Int -> Int
- set :: PrimMonad m => MutableByteArray (PrimState m) -> Int -> Word64 -> m ()
- get :: PrimMonad m => MutableByteArray (PrimState m) -> Int -> m Word64
Documentation
fit :: Real a => Real b => Integral c => a -> b -> c Source #
fit a b
computes how many b
s are needed to fit a
, i.e.
\(\left\lceil\frac{a}{b}\right\rceil\).
For instance,
>>>
fit 7 3
3
>>>
fit 6 3
2
intFit :: Integral a => Integral b => a -> b -> a Source #
fit a b
computes how many b
s are needed to fit a
, i.e.
\(\left\lceil\frac{a}{b}\right\rceil\).
For instance,
>>>
intFit 7 3
3
>>>
intFit 6 3
2
nextPowerOfTwo :: Real a => Integral b => a -> b Source #
nextPowerOfTwo a
computes the smallest power of two that is larger or
equal than a
.
intNextPowerOfTwo :: Int -> Int Source #
nextPowerOfTwo a
computes the smallest power of two that is larger or
equal than a
.
:: PrimMonad m | |
=> MutableByteArray (PrimState m) | |
-> Int | index in terms of |
-> Word64 |
|
-> m () |
Write a Word64
value into a Word32
aligned MutableByteArray