@hackage / number-length

Number of digits in a number in decimal and hexadecimal representation.

Latest0.2.1.0

About

Metadata

  • Last updated , by PeterTrsko
  • License BSD-3-Clause
  • Maintained by: peter.trsko@gmail.com

  • Lottery factor: 0

Links

Installation

Package Flags

Use the -f option with cabal commands to enable flags

    pedantic (off by default)

    Pass additional warning flags to GHC.

Readme

Number Length

Hackage Hackage Dependencies Haskell Programming Language BSD3 License

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.