Data.Fixed (original) (raw)

Copyright (c) Ashley Yakeley 2005 2006 2009
License BSD-style (see the file libraries/base/LICENSE)
Maintainer Ashley Yakeley ashley@semantic.org
Stability experimental
Portability portable
Safe Haskell Trustworthy
Language Haskell2010

Data.Fixed

Description

This module defines a "Fixed" type for fixed-precision arithmetic. The parameter to Fixed is any type that's an instance of HasResolution. HasResolution has a single method that gives the resolution of the Fixed type.

This module also contains generalisations of div, mod, and divmod to work with any Real instance.

Synopsis

Documentation

type Centi = Fixed E2 Source #

resolution of 10^-2 = .01, useful for many monetary currencies