extra-0.3.1: Extra functions I use.

Safe HaskellSafe-Inferred

Numeric.Extra

Synopsis

Documentation

showDP :: RealFloat a => Int -> a -> StringSource

Show a number to a number of decimal places.

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

intToDouble :: Int -> DoubleSource

Specialised numeric conversion.

intToFloat :: Int -> FloatSource

Specialised numeric conversion.

floatToDouble :: Float -> DoubleSource

Specialised numeric conversion.

doubleToFloat :: Double -> FloatSource

Specialised numeric conversion.