summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Special/Internal.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Special/Internal.hsc')
-rw-r--r--lib/Numeric/GSL/Special/Internal.hsc10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Numeric/GSL/Special/Internal.hsc b/lib/Numeric/GSL/Special/Internal.hsc
index 03a431c..e0744d7 100644
--- a/lib/Numeric/GSL/Special/Internal.hsc
+++ b/lib/Numeric/GSL/Special/Internal.hsc
@@ -30,7 +30,7 @@ where
30 30
31import Foreign 31import Foreign
32import Data.Packed.Internal(check,(//)) 32import Data.Packed.Internal(check,(//))
33import Foreign.C.Types(CSize) 33import Foreign.C.Types(CSize,CInt)
34 34
35 35
36data Precision = PrecDouble | PrecSingle | PrecApprox 36data Precision = PrecDouble | PrecSingle | PrecApprox
@@ -61,7 +61,7 @@ instance Storable Gsl_sf_result where
61 (#poke gsl_sf_result, err) ptr err 61 (#poke gsl_sf_result, err) ptr err
62 62
63 63
64data Gsl_sf_result_e10 = SFE Double Double Int 64data Gsl_sf_result_e10 = SFE Double Double CInt
65 deriving (Show) 65 deriving (Show)
66 66
67instance Storable Gsl_sf_result_e10 where 67instance Storable Gsl_sf_result_e10 where
@@ -80,7 +80,7 @@ instance Storable Gsl_sf_result_e10 where
80 80
81---------------------------------------------------------------- 81----------------------------------------------------------------
82-- | access to a sf_result 82-- | access to a sf_result
83createSFR :: String -> (Ptr a -> IO Int) -> (Double, Double) 83createSFR :: String -> (Ptr a -> IO CInt) -> (Double, Double)
84createSFR s f = unsafePerformIO $ do 84createSFR s f = unsafePerformIO $ do
85 p <- malloc :: IO (Ptr Gsl_sf_result) 85 p <- malloc :: IO (Ptr Gsl_sf_result)
86 f (castPtr p) // check s 86 f (castPtr p) // check s
@@ -93,10 +93,10 @@ createSFR s f = unsafePerformIO $ do
93-- the sf_result_e10 contains two doubles and the exponent 93-- the sf_result_e10 contains two doubles and the exponent
94 94
95-- | access to sf_result_e10 95-- | access to sf_result_e10
96createSFR_E10 :: String -> (Ptr a -> IO Int) -> (Double, Int, Double) 96createSFR_E10 :: String -> (Ptr a -> IO CInt) -> (Double, Int, Double)
97createSFR_E10 s f = unsafePerformIO $ do 97createSFR_E10 s f = unsafePerformIO $ do
98 p <- malloc :: IO (Ptr Gsl_sf_result_e10) 98 p <- malloc :: IO (Ptr Gsl_sf_result_e10)
99 f (castPtr p) // check s 99 f (castPtr p) // check s
100 SFE val err expo <- peek p 100 SFE val err expo <- peek p
101 free p 101 free p
102 return (val,expo,err) 102 return (val, fromIntegral expo,err)