packages feed

cmath 0.2 → 0.3

raw patch · 2 files changed

+121/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Foreign.C.Math.Double: acosh :: Double -> Double
+ Foreign.C.Math.Double: asinh :: Double -> Double
+ Foreign.C.Math.Double: atanh :: Double -> Double
+ Foreign.C.Math.Double: c_acosh :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_asinh :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_atanh :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_cbrt :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_copysign :: CDouble -> CDouble -> CDouble
+ Foreign.C.Math.Double: c_ilogb :: CDouble -> CInt
+ Foreign.C.Math.Double: c_logb :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_nextafter :: CDouble -> CDouble -> CDouble
+ Foreign.C.Math.Double: c_remainder :: CDouble -> CDouble -> CDouble
+ Foreign.C.Math.Double: c_rint :: CDouble -> CDouble
+ Foreign.C.Math.Double: c_scalb :: CDouble -> CDouble -> CDouble
+ Foreign.C.Math.Double: c_significand :: CDouble -> CDouble
+ Foreign.C.Math.Double: cbrt :: Double -> Double
+ Foreign.C.Math.Double: copysign :: Double -> Double -> Double
+ Foreign.C.Math.Double: ilogb :: Double -> Int
+ Foreign.C.Math.Double: logb :: Double -> Double
+ Foreign.C.Math.Double: nextafter :: Double -> Double -> Double
+ Foreign.C.Math.Double: remainder :: Double -> Double -> Double
+ Foreign.C.Math.Double: rint :: Double -> Double
+ Foreign.C.Math.Double: scalb :: Double -> Double -> Double
+ Foreign.C.Math.Double: significand :: Double -> Double

Files

Foreign/C/Math/Double.hsc view
@@ -404,3 +404,123 @@  foreign import ccall unsafe "math.h lgamma"      c_lgamma    :: CDouble -> CDouble+++-- | The acosh function computes the inverse hyperbolic cosine of the real argument x. +--+acosh :: Double -> Double+acosh x = realToFrac (c_acosh (realToFrac x))+{-# INLINE acosh #-}++foreign import ccall unsafe "math.h acosh"+     c_acosh    :: CDouble -> CDouble++-- | The asinh function computes the inverse hyperbolic sine of the real argument. +--+asinh :: Double -> Double+asinh x = realToFrac (c_asinh (realToFrac x))+{-# INLINE asinh #-}++foreign import ccall unsafe "math.h asinh"+     c_asinh    :: CDouble -> CDouble++-- | The atanh function computes the inverse hyperbolic tangent of the real argument x.+--+atanh :: Double -> Double+atanh x = realToFrac (c_atanh (realToFrac x))+{-# INLINE atanh #-}++foreign import ccall unsafe "math.h atanh"+     c_atanh    :: CDouble -> CDouble++-- | The cbrt function computes the cube root of x.+--+cbrt :: Double -> Double+cbrt x = realToFrac (c_cbrt (realToFrac x))+{-# INLINE cbrt #-}++foreign import ccall unsafe "math.h cbrt"+     c_cbrt    :: CDouble -> CDouble++-- | logb x returns x's exponent n, a signed integer converted to+-- double-precision floating-point.  +-- +-- > logb(+-Infinity) = +Infinity;+-- > logb(0) = -Infinity with a division by zero exception.+--+logb :: Double -> Double+logb x = realToFrac (c_logb (realToFrac x))+{-# INLINE logb #-}++foreign import ccall unsafe "math.h logb"+     c_logb    :: CDouble -> CDouble+++-- | nextafter returns the next machine representable number from x in direction y.+--+nextafter :: Double -> Double -> Double+nextafter x y = realToFrac (c_nextafter (realToFrac x) (realToFrac y))+{-# INLINE nextafter #-}++foreign import ccall unsafe "math.h nextafter"+     c_nextafter    :: CDouble -> CDouble -> CDouble++-- | remainder returns the remainder r := x - n*y where n is the integer+-- nearest the exact value of x/y; moreover if |n - x/y| = 1/2 then n is even.+-- Consequently, the remainder is computed exactly and |r| <= |y|/2.  But+-- remainder(x, 0) and remainder(Infinity, 0) are invalid operations that produce+-- a NaN.  --+remainder :: Double -> Double -> Double+remainder x y = realToFrac (c_remainder (realToFrac x) (realToFrac y))+{-# INLINE remainder #-}++foreign import ccall unsafe "math.h remainder"+     c_remainder    :: CDouble -> CDouble -> CDouble++-- | scalb(x, n) returns x*(2**n) computed by exponent manipulation.+scalb :: Double -> Double -> Double+scalb x y = realToFrac (c_scalb (realToFrac x) (realToFrac y))+{-# INLINE scalb #-}++foreign import ccall unsafe "math.h scalb"+     c_scalb    :: CDouble -> CDouble -> CDouble++-- | significand(x) returns sig, where x := sig * 2**n with 1 <= sig < 2.+-- significand(x) is not defined when x is 0, +-Infinity, or NaN.+--+significand :: Double -> Double+significand x = realToFrac (c_significand (realToFrac x))+{-# INLINE significand #-}++foreign import ccall unsafe "math.h significand"+     c_significand    :: CDouble -> CDouble+++-- |  copysign x y returns x with its sign changed to y's.+copysign :: Double -> Double -> Double+copysign x y = realToFrac (c_copysign (realToFrac x) (realToFrac y))+{-# INLINE copysign #-}++foreign import ccall unsafe "math.h copysign"+     c_copysign    :: CDouble -> CDouble -> CDouble++-- | ilogb() returns x's exponent n, in integer format.+--    ilogb(+-Infinity) re- turns INT_MAX and ilogb(0) returns INT_MIN.+--+ilogb :: Double -> Int+ilogb x = fromIntegral (c_ilogb (realToFrac x))+{-# INLINE ilogb #-}++foreign import ccall unsafe "math.h ilogb"+     c_ilogb    :: CDouble -> CInt++-- | The rint() function returns the integral value (represented as a+-- double precision number) nearest to x according to the prevailing+-- rounding mode.+--+rint :: Double -> Double+rint x = realToFrac (c_rint (realToFrac x))+{-# INLINE rint #-}++foreign import ccall unsafe "math.h rint"+     c_rint    :: CDouble -> CDouble
cmath.cabal view
@@ -1,5 +1,5 @@ name:            cmath-version:         0.2+version:         0.3 homepage:        http://code.haskell.org/~dons/code/cmath synopsis:        A binding to the standard C math library description:     A binding to the standard C math library