extra-1.7.4: Extra functions I use.

Safe Haskell | Safe
Language | Haskell2010

Numeric.Extra

Description

Extra numeric functions - formatting and specialised conversions.

Synopsis

- showDP :: RealFloat a => Int -> a -> String
- intToDouble :: Int -> Double
- intToFloat :: Int -> Float
- floatToDouble :: Float -> Double
- doubleToFloat :: Double -> Float

# Documentation

showDP :: RealFloat a => Int -> a -> String Source #

Show a number to a fixed number of decimal places.

    showDP 4 pi == "3.1416"
    showDP 0 pi == "3"
    showDP 2 3  == "3.00"

intToDouble :: Int -> Double Source #

Specialised numeric conversion, type restricted version of `fromIntegral`.

intToFloat :: Int -> Float Source #

Specialised numeric conversion, type restricted version of `fromIntegral`.

floatToDouble :: Float -> Double Source #

Specialised numeric conversion, type restricted version of `realToFrac`.

doubleToFloat :: Double -> Float Source #

Specialised numeric conversion, type restricted version of `realToFrac`.