module Bindings.Gsl.IeeeFloatingPointArithmetic where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
c'GSL_IEEE_TYPE_NAN = 1
c'GSL_IEEE_TYPE_NAN :: (Num a) => a
c'GSL_IEEE_TYPE_INF = 2
c'GSL_IEEE_TYPE_INF :: (Num a) => a
c'GSL_IEEE_TYPE_NORMAL = 3
c'GSL_IEEE_TYPE_NORMAL :: (Num a) => a
c'GSL_IEEE_TYPE_DENORMAL = 4
c'GSL_IEEE_TYPE_DENORMAL :: (Num a) => a
c'GSL_IEEE_TYPE_ZERO = 5
c'GSL_IEEE_TYPE_ZERO :: (Num a) => a
data C'gsl_ieee_float_rep = C'gsl_ieee_float_rep{
c'gsl_ieee_float_rep'sign :: CInt
,
c'gsl_ieee_float_rep'mantissa :: [CChar]
,
c'gsl_ieee_float_rep'exponent :: CInt
,
c'gsl_ieee_float_rep'type :: CInt
} deriving (Eq,Show)
instance Storable C'gsl_ieee_float_rep where
sizeOf _ = 36
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekArray 24 (plusPtr p 4)
v2 <- peekByteOff p 28
v3 <- peekByteOff p 32
return $ C'gsl_ieee_float_rep v0 v1 v2 v3
poke p (C'gsl_ieee_float_rep v0 v1 v2 v3) = do
pokeByteOff p 0 v0
pokeArray (plusPtr p 4) (take 24 v1)
pokeByteOff p 28 v2
pokeByteOff p 32 v3
return ()
data C'gsl_ieee_double_rep = C'gsl_ieee_double_rep{
c'gsl_ieee_double_rep'sign :: CInt
,
c'gsl_ieee_double_rep'mantissa :: [CChar]
,
c'gsl_ieee_double_rep'exponent :: CInt
,
c'gsl_ieee_double_rep'type :: CInt
} deriving (Eq,Show)
instance Storable C'gsl_ieee_double_rep where
sizeOf _ = 68
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekArray 53 (plusPtr p 4)
v2 <- peekByteOff p 60
v3 <- peekByteOff p 64
return $ C'gsl_ieee_double_rep v0 v1 v2 v3
poke p (C'gsl_ieee_double_rep v0 v1 v2 v3) = do
pokeByteOff p 0 v0
pokeArray (plusPtr p 4) (take 53 v1)
pokeByteOff p 60 v2
pokeByteOff p 64 v3
return ()
foreign import ccall "gsl_ieee_printf_float" c'gsl_ieee_printf_float
:: Ptr CFloat -> IO ()
foreign import ccall "&gsl_ieee_printf_float" p'gsl_ieee_printf_float
:: FunPtr (Ptr CFloat -> IO ())
foreign import ccall "gsl_ieee_printf_double" c'gsl_ieee_printf_double
:: Ptr CDouble -> IO ()
foreign import ccall "&gsl_ieee_printf_double" p'gsl_ieee_printf_double
:: FunPtr (Ptr CDouble -> IO ())
foreign import ccall "gsl_ieee_fprintf_float" c'gsl_ieee_fprintf_float
:: Ptr CFile -> Ptr CFloat -> IO ()
foreign import ccall "&gsl_ieee_fprintf_float" p'gsl_ieee_fprintf_float
:: FunPtr (Ptr CFile -> Ptr CFloat -> IO ())
foreign import ccall "gsl_ieee_fprintf_double" c'gsl_ieee_fprintf_double
:: Ptr CFile -> Ptr CDouble -> IO ()
foreign import ccall "&gsl_ieee_fprintf_double" p'gsl_ieee_fprintf_double
:: FunPtr (Ptr CFile -> Ptr CDouble -> IO ())
foreign import ccall "gsl_ieee_float_to_rep" c'gsl_ieee_float_to_rep
:: Ptr CFloat -> Ptr C'gsl_ieee_float_rep -> IO ()
foreign import ccall "&gsl_ieee_float_to_rep" p'gsl_ieee_float_to_rep
:: FunPtr (Ptr CFloat -> Ptr C'gsl_ieee_float_rep -> IO ())
foreign import ccall "gsl_ieee_double_to_rep" c'gsl_ieee_double_to_rep
:: Ptr CDouble -> Ptr C'gsl_ieee_double_rep -> IO ()
foreign import ccall "&gsl_ieee_double_to_rep" p'gsl_ieee_double_to_rep
:: FunPtr (Ptr CDouble -> Ptr C'gsl_ieee_double_rep -> IO ())
c'GSL_IEEE_SINGLE_PRECISION = 1
c'GSL_IEEE_SINGLE_PRECISION :: (Num a) => a
c'GSL_IEEE_DOUBLE_PRECISION = 2
c'GSL_IEEE_DOUBLE_PRECISION :: (Num a) => a
c'GSL_IEEE_EXTENDED_PRECISION = 3
c'GSL_IEEE_EXTENDED_PRECISION :: (Num a) => a
c'GSL_IEEE_ROUND_TO_NEAREST = 1
c'GSL_IEEE_ROUND_TO_NEAREST :: (Num a) => a
c'GSL_IEEE_ROUND_DOWN = 2
c'GSL_IEEE_ROUND_DOWN :: (Num a) => a
c'GSL_IEEE_ROUND_UP = 3
c'GSL_IEEE_ROUND_UP :: (Num a) => a
c'GSL_IEEE_ROUND_TO_ZERO = 4
c'GSL_IEEE_ROUND_TO_ZERO :: (Num a) => a
c'GSL_IEEE_MASK_INVALID = 1
c'GSL_IEEE_MASK_INVALID :: (Num a) => a
c'GSL_IEEE_MASK_DENORMALIZED = 2
c'GSL_IEEE_MASK_DENORMALIZED :: (Num a) => a
c'GSL_IEEE_MASK_DIVISION_BY_ZERO = 4
c'GSL_IEEE_MASK_DIVISION_BY_ZERO :: (Num a) => a
c'GSL_IEEE_MASK_OVERFLOW = 8
c'GSL_IEEE_MASK_OVERFLOW :: (Num a) => a
c'GSL_IEEE_MASK_UNDERFLOW = 16
c'GSL_IEEE_MASK_UNDERFLOW :: (Num a) => a
c'GSL_IEEE_MASK_ALL = 31
c'GSL_IEEE_MASK_ALL :: (Num a) => a
c'GSL_IEEE_TRAP_INEXACT = 32
c'GSL_IEEE_TRAP_INEXACT :: (Num a) => a
foreign import ccall "gsl_ieee_env_setup" c'gsl_ieee_env_setup
:: IO ()
foreign import ccall "&gsl_ieee_env_setup" p'gsl_ieee_env_setup
:: FunPtr (IO ())
foreign import ccall "gsl_ieee_read_mode_string" c'gsl_ieee_read_mode_string
:: CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
foreign import ccall "&gsl_ieee_read_mode_string" p'gsl_ieee_read_mode_string
:: FunPtr (CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt)
foreign import ccall "gsl_ieee_set_mode" c'gsl_ieee_set_mode
:: CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt
foreign import ccall "&gsl_ieee_set_mode" p'gsl_ieee_set_mode
:: FunPtr (CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt)