Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions that compute the required allocation size by value.
Synopsis
- word64AsciiDec :: Word64 -> Int
- int64AsciiDec :: Int64 -> Int
- textUtf8 :: Text -> Int
Documentation
word64AsciiDec :: Word64 -> Int Source #
Efficiently count the amount of bytes required to encode Word64 as a decimal number in ASCII.
Implemented as a balanced tree of "ifs" centered around the middle of the range. This is much faster than anything based on logarithms.
int64AsciiDec :: Int64 -> Int Source #
Efficiently count the amount of bytes required to encode Int64 as a signed decimal number in ASCII.
Implemented as a balanced tree of "ifs" centered around the middle of the range. This is much faster than anything based on logarithms.