diff options
Diffstat (limited to 'lib/Numeric/GSL/Special/Internal.hsc')
-rw-r--r-- | lib/Numeric/GSL/Special/Internal.hsc | 10 |
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 | ||
31 | import Foreign | 31 | import Foreign |
32 | import Data.Packed.Internal(check,(//)) | 32 | import Data.Packed.Internal(check,(//)) |
33 | import Foreign.C.Types(CSize) | 33 | import Foreign.C.Types(CSize,CInt) |
34 | 34 | ||
35 | 35 | ||
36 | data Precision = PrecDouble | PrecSingle | PrecApprox | 36 | data 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 | ||
64 | data Gsl_sf_result_e10 = SFE Double Double Int | 64 | data Gsl_sf_result_e10 = SFE Double Double CInt |
65 | deriving (Show) | 65 | deriving (Show) |
66 | 66 | ||
67 | instance Storable Gsl_sf_result_e10 where | 67 | instance 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 |
83 | createSFR :: String -> (Ptr a -> IO Int) -> (Double, Double) | 83 | createSFR :: String -> (Ptr a -> IO CInt) -> (Double, Double) |
84 | createSFR s f = unsafePerformIO $ do | 84 | createSFR 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 |
96 | createSFR_E10 :: String -> (Ptr a -> IO Int) -> (Double, Int, Double) | 96 | createSFR_E10 :: String -> (Ptr a -> IO CInt) -> (Double, Int, Double) |
97 | createSFR_E10 s f = unsafePerformIO $ do | 97 | createSFR_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) |