Safe Haskell | Safe-Inferred |
---|
Extra numeric functions - formatting and specialised conversions.
- module Numeric
- showDP :: RealFloat a => Int -> a -> String
- intToDouble :: Int -> Double
- intToFloat :: Int -> Float
- floatToDouble :: Float -> Double
- doubleToFloat :: Double -> Float
Documentation
module Numeric
showDP :: RealFloat a => Int -> a -> StringSource
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 -> DoubleSource
Specialised numeric conversion, type restricted version of fromIntegral
.
intToFloat :: Int -> FloatSource
Specialised numeric conversion, type restricted version of fromIntegral
.
floatToDouble :: Float -> DoubleSource
Specialised numeric conversion, type restricted version of realToFrac
.
doubleToFloat :: Double -> FloatSource
Specialised numeric conversion, type restricted version of realToFrac
.