number-length

Number of digits in a number in decimal and hexadecimal representation. https://github.com/trskop/number-length

Latest on Hackage:0.1.0.1

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.

BSD3 licensed by Peter Trško
Maintained by peter.trsko@gmail.com

Number Length

Hackage Hackage Dependencies [Haskell Programming Language][Haskell.org] [BSD3 License][tl;dr Legal: BSD3]

Build Coverage Status

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.

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)"

Changes

ChangeLog / ReleaseNotes

Version 0.1.0.1

  • 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.Proxy module 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

Version 0.1.0.0

http://hackage.haskell.org/ "HackageDB (or just Hackage) is a collection of releases of Haskell packages."

Depends on:
Used by 1 package:
comments powered byDisqus