dozenal: A Haskell library for using Dozenal (Duodecimal - Base 12) numbers.

[ gpl, library, math ] [ Propose Tags ] [ Report a vulnerability ]

A Haskell library for using Dozenal (Duodecimal - Base 12) numbers.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0
Dependencies base (>=4.7 && <4.8) [details]
License GPL-3.0-only
Author Siddhanathan Shanmugam
Maintainer siddhanathan@gmail.com
Category Math
Home page https://github.com/siddhanathan/dozenal
Uploaded by siddhanathan at 2015-04-11T17:42:14Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 986 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-04-11 [all 1 reports]

Readme for dozenal-0.1.0.0

[back to package description]

dozenal

A Haskell library for using Dozenal (Duodecimal - Base 12) numbers.

Usage

Create number using: (Dozenal String)

Example: Dozenal "1X"

Permitted digits: [0..9] ++ "X" ++ "E"

Dozenal is an instance of the Num class, so you can do numerical computations with it.

Example:

(Dozenal "10")^2

(Dozenal "10") + (Dozenal "10")

Limitations

Internally, the string is converted to decimal and calculations proceed in decimal. Once calculations are done, the decimal digit is converted back to dozenal. This means that, you may run into an error if the base conversion is not possible. Converting from a higher base to a lower base can sometimes not be possible (usually only when there are floting point numbers or numbers after the dit - decimal point equivalent in dozenal).

Also, the current implementation uses only integers, and does not support floating point numbers.