Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Numeric.Extra
Description
Extra numeric functions - formatting and specialised conversions.
Synopsis
- class Fractional a => Floating a where
- pi :: a
- exp :: a -> a
- log :: a -> a
- sqrt :: a -> a
- (**) :: a -> a -> a
- logBase :: a -> a -> a
- sin :: a -> a
- cos :: a -> a
- tan :: a -> a
- asin :: a -> a
- acos :: a -> a
- atan :: a -> a
- sinh :: a -> a
- cosh :: a -> a
- tanh :: a -> a
- asinh :: a -> a
- acosh :: a -> a
- atanh :: a -> a
- log1p :: a -> a
- expm1 :: a -> a
- log1pexp :: a -> a
- log1mexp :: a -> a
- fromRat :: RealFloat a => Rational -> a
- floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)
- showFloat :: RealFloat a => a -> ShowS
- showFFloat :: RealFloat a => Maybe Int -> a -> ShowS
- readBin :: (Eq a, Num a) => ReadS a
- readDec :: (Eq a, Num a) => ReadS a
- readFloat :: RealFrac a => ReadS a
- readHex :: (Eq a, Num a) => ReadS a
- readInt :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
- readOct :: (Eq a, Num a) => ReadS a
- readSigned :: Real a => ReadS a -> ReadS a
- showBin :: Integral a => a -> ShowS
- showEFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showGFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showHFloat :: RealFloat a => a -> ShowS
- showHex :: Integral a => a -> ShowS
- showInt :: Integral a => a -> ShowS
- showIntAtBase :: Integral a => a -> (Int -> Char) -> a -> ShowS
- showOct :: Integral a => a -> ShowS
- lexDigits :: ReadS String
- showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS
- showDP :: RealFloat a => Int -> a -> String
- intToDouble :: Int -> Double
- intToFloat :: Int -> Float
- floatToDouble :: Float -> Double
- doubleToFloat :: Double -> Float
Documentation
class Fractional a => Floating a where #
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Methods
Instances
Floating CDouble | |
Floating CFloat | |
Floating Double | |
Floating Float | |
Defined in GHC.Internal.Float | |
RealFloat a => Floating (Complex a) | |
Defined in Data.Complex Methods exp :: Complex a -> Complex a # log :: Complex a -> Complex a # sqrt :: Complex a -> Complex a # (**) :: Complex a -> Complex a -> Complex a # logBase :: Complex a -> Complex a -> Complex a # sin :: Complex a -> Complex a # cos :: Complex a -> Complex a # tan :: Complex a -> Complex a # asin :: Complex a -> Complex a # acos :: Complex a -> Complex a # atan :: Complex a -> Complex a # sinh :: Complex a -> Complex a # cosh :: Complex a -> Complex a # tanh :: Complex a -> Complex a # asinh :: Complex a -> Complex a # acosh :: Complex a -> Complex a # atanh :: Complex a -> Complex a # log1p :: Complex a -> Complex a # expm1 :: Complex a -> Complex a # | |
Floating a => Floating (Identity a) | |
Defined in GHC.Internal.Data.Functor.Identity Methods exp :: Identity a -> Identity a # log :: Identity a -> Identity a # sqrt :: Identity a -> Identity a # (**) :: Identity a -> Identity a -> Identity a # logBase :: Identity a -> Identity a -> Identity a # sin :: Identity a -> Identity a # cos :: Identity a -> Identity a # tan :: Identity a -> Identity a # asin :: Identity a -> Identity a # acos :: Identity a -> Identity a # atan :: Identity a -> Identity a # sinh :: Identity a -> Identity a # cosh :: Identity a -> Identity a # tanh :: Identity a -> Identity a # asinh :: Identity a -> Identity a # acosh :: Identity a -> Identity a # atanh :: Identity a -> Identity a # log1p :: Identity a -> Identity a # expm1 :: Identity a -> Identity a # | |
Floating a => Floating (Op a b) | |
Floating a => Floating (Const a b) | |
Defined in GHC.Internal.Data.Functor.Const Methods exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # | |
Floating (f (g a)) => Floating (Compose f g a) | |
Defined in Data.Functor.Compose Methods exp :: Compose f g a -> Compose f g a # log :: Compose f g a -> Compose f g a # sqrt :: Compose f g a -> Compose f g a # (**) :: Compose f g a -> Compose f g a -> Compose f g a # logBase :: Compose f g a -> Compose f g a -> Compose f g a # sin :: Compose f g a -> Compose f g a # cos :: Compose f g a -> Compose f g a # tan :: Compose f g a -> Compose f g a # asin :: Compose f g a -> Compose f g a # acos :: Compose f g a -> Compose f g a # atan :: Compose f g a -> Compose f g a # sinh :: Compose f g a -> Compose f g a # cosh :: Compose f g a -> Compose f g a # tanh :: Compose f g a -> Compose f g a # asinh :: Compose f g a -> Compose f g a # acosh :: Compose f g a -> Compose f g a # atanh :: Compose f g a -> Compose f g a # log1p :: Compose f g a -> Compose f g a # expm1 :: Compose f g a -> Compose f g a # |
floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int) #
showFFloat :: RealFloat a => Maybe Int -> a -> ShowS #
readSigned :: Real a => ReadS a -> ReadS a #
showEFloat :: RealFloat a => Maybe Int -> a -> ShowS #
showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #
showGFloat :: RealFloat a => Maybe Int -> a -> ShowS #
showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #
showHFloat :: RealFloat a => a -> ShowS #
showIntAtBase :: Integral a => a -> (Int -> Char) -> a -> ShowS #
showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS #
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
.