Number of digits in a number in decimal and hexadecimal representation. https://github.com/trskop/number-length
|Latest on Hackage:||0.2.1.0|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
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
-fpedantic(disabled by default)
Pass additional warning flags to GHC.
The BSD 3-Clause License, see [LICENSE] file for details.
Contributions, pull requests and bug reports are welcome! Please don't be afraid to contact author using GitHub or by e-mail.
http://hackage.haskell.org/package/number-length "Package number-length on Hackage" [Haskell.org]: http://www.haskell.org "The Haskell Programming Language" [LICENSE]: https://github.com/trskop/number-length/blob/master/LICENSE "License of number-length package." [tl;dr Legal: BSD3]: https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29 "BSD 3-Clause License (Revised)"
ChangeLog / ReleaseNotes
instance Arbitrary Naturalfor unit tests. (minor change)
- Instances for
- Build on GHC 8.2.2 and Stackage LTS 10.*.
- Removed dead code. (minor change)
- Better and expanded test suite, which now includes tests for methods of
SignedNumberLength. (minor change)
- Depending on tagged package only for GHC <7.8. This is due to the fact, that
Data.Proxymodule was introduce in base ==4.7, which was bundled with GHC 7.8. (minor change)
- Small examples included in description. (minor change)
- Uploaded to Hackage: http://hackage.haskell.org/package/number-length-0.1.0.1
- First public release.
- Uploaded to Hackage: http://hackage.haskell.org/package/number-length-0.1.0.0
http://hackage.haskell.org/ "HackageDB (or just Hackage) is a collection of releases of Haskell packages."