Number of digits in a number in decimal and hexadecimal representation.
There are situations when it is necessary to know the length of a number in decimal or hexadecimal form. In example when allocating buffer while serializing a number in to binary or human readable format.
λ> numberLength (123 :: Int)
3
λ> numberLengthHex (123 :: Int) -- 123 = 7b in hex
2
Number Length
Description
Number length in decimal and hexadecimal representation.
There are situations when it is necessary to know the length of a number in decimal or hexadecimal form. In example when allocating buffer while serializing a number in to binary or human readable format.
λ> numberLength (123 :: Int)
3
λ> numberLengthHex (123 :: Int) -- 123 = 7b in hex
2
Building Options
-fpedantic
(disabled by default)Pass additional warning flags to GHC.
License
The BSD 3-Clause License, see LICENSE file for details.
Contributions
Contributions, pull requests and bug reports are welcome! Please don't be afraid to contact author using GitHub or by e-mail.