diff --git a/Data/Number/MPFR.hs b/Data/Number/MPFR.hs
--- a/Data/Number/MPFR.hs
+++ b/Data/Number/MPFR.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MagicHash, CPP #-}
+
 {-|
     Module      :  Data.Number.MPFR
     Description :  top level
@@ -82,6 +84,11 @@
 
 import Data.Ratio
 
+#if __GLASGOW_HASKELL__ >= 610
+import GHC.Integer.Internals
+#endif
+import GHC.Exts
+
 instance Num MPFR where
     d + d'        = add Zero (addPrec d d') d d'
     d - d'        = sub Zero (addPrec d d') d d'
@@ -89,8 +96,8 @@
     negate d      = neg Zero (getPrec d) d
     abs d         = absD Zero (getPrec d) d
     signum d      = fromInt Zero minPrec (fromMaybe (-1) (sgn d))
-    fromInteger i = fromIntegerA Zero (checkPrec $ binprec i) i
-                    -- TODO works only partially
+    fromInteger (S# i) = fromInt Zero minPrec (I# i)
+    fromInteger i@(J# n _) = fromIntegerA Zero (fromIntegral $ I# n * bitsPerIntegerLimb) i 
 
 addPrec       :: Dyadic -> Dyadic -> Precision
 addPrec d1 d2 = fromIntegral (max (p1 + e1 - e3) (p2 + e2 - e3)) + 1
diff --git a/Data/Number/MPFR/Arithmetic.hs b/Data/Number/MPFR/Arithmetic.hs
--- a/Data/Number/MPFR/Arithmetic.hs
+++ b/Data/Number/MPFR/Arithmetic.hs
@@ -18,6 +18,8 @@
 
 import Data.Number.MPFR.Internal
 
+import Prelude hiding(isNaN)
+
 add           :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
 add r p d1 d2 = fst $ add_ r p d1 d2
       
@@ -197,11 +199,13 @@
 wpow_           :: RoundMode -> Precision -> Word -> MPFR -> (MPFR , Int)
 wpow_ r p d1 d2 = withMPFRBAiu r p (fromIntegral d1) d2 mpfr_ui_pow
       
-neg_       :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
-neg_ r p d = withMPFR r p d mpfr_neg
+neg_                       :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
+neg_ r p mp1@(MP p' s e fp) | p' == fromIntegral p && e /= expNaN = (MP p' (negate s) e fp, 0)
+                            | otherwise = withMPFR r p mp1 mpfr_neg
       
 absD_      :: RoundMode -> Precision -> MPFR -> (MPFR , Int)
-absD_ r p d = withMPFR r p d mpfr_abs
+absD_ r p d@(MP p' s e fp) | p' == fromIntegral p && e /= expNaN = (MP p' (abs s) e fp, 0)
+                           | otherwise                           = withMPFR r p d mpfr_abs
       
 dim_           :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
 dim_ r p d1 d2 = withMPFRsBA r p d1 d2 mpfr_dim
diff --git a/Data/Number/MPFR/Comparison.hs b/Data/Number/MPFR/Comparison.hs
--- a/Data/Number/MPFR/Comparison.hs
+++ b/Data/Number/MPFR/Comparison.hs
@@ -18,17 +18,31 @@
 
 module Data.Number.MPFR.Comparison where
 
-import Data.Number.MPFR.Misc
+--import Data.Number.MPFR.Misc
 
 import Data.Number.MPFR.Internal
 
-import Prelude hiding (isNaN)
+import Prelude hiding (isNaN, exponent, isInfinite)
 
 import Data.Maybe
 
-cmp         :: MPFR -> MPFR -> Maybe Ordering
-cmp mp1 mp2 = if isNaN mp1 || isNaN mp2 then Nothing 
-                else Just (compare (withMPFRBB mp1 mp2 mpfr_cmp) 0)
+{-# INLINE cmp #-}
+cmp :: MPFR -> MPFR -> Maybe Ordering
+cmp mp1@(MP _ s e _) mp2@(MP _ s' e' _) | e > expInf && e' > expInf = 
+                                            case (s /= s', e /= e') of
+                                              (True, _) -> Just $ compare (signum s) (signum s')
+                                              (_, True) -> Just $ compare (fromIntegral s * e) (fromIntegral s * e')
+                                              (False, False) -> Just (compare (withMPFRBB mp1 mp2 mpfr_cmp) 0)
+                                        | isNaN mp1 || isNaN mp2 = Nothing 
+                                        | isZero mp1             = 
+                                            case isZero mp2 of
+                                              True -> Just EQ
+                                              False -> Just . toEnum . (+ 1) . negate . fromIntegral $ signum s' 
+                                        | isZero mp2             = Just . toEnum . (+ 1) . fromIntegral $ signum s
+                                        | isInfinite mp1         = case isInfinite mp2 of
+                                                                     True -> Just $ compare s s'
+                                                                     False -> Just $ compare s 0
+                                        | isInfinite mp2         = Just $ compare 0 s'
 
 cmpw       :: MPFR -> Word -> Maybe Ordering
 cmpw mp1 w = if isNaN mp1 then Nothing else Just (compare (unsafePerformIO go) 0)
@@ -67,46 +81,56 @@
                     if r2 == 0 then return (Just (compare r1 0))
                       else do mpfr_clear_erangeflag
                               return Nothing
+
 cmpabs         :: MPFR -> MPFR -> Maybe Ordering
 cmpabs mp1 mp2 = if isNaN mp1 || isNaN mp2 then Nothing 
                    else Just (compare (withMPFRBB mp1 mp2 mpfr_cmpabs) 0)
 
+{-# INLINE isNaN #-}
 isNaN   :: MPFR -> Bool
 isNaN (MP _ _ e _) = e == expNaN -- withMPFRB d mpfr_nan_p /= 0
 
+{-# INLINE isInfinite #-}
 isInfinite   :: MPFR -> Bool
 isInfinite (MP _ _ e _) = e == expInf -- withMPFRB d mpfr_inf_p /= 0 
 
 isNumber   :: MPFR -> Bool
 isNumber d = withMPFRB d mpfr_number_p /= 0 
 
+{-# INLINE isZero #-}
 isZero   :: MPFR -> Bool
 isZero (MP _ _ e _) = e == expZero --withMPFRB d mpfr_zero_p /= 0
 
+{-# INLINE sgn #-}
+sgn                               :: MPFR -> Maybe Int 
+sgn mp1@(MP _ s _ _) | isZero mp1 = Just 0
+                     | isNaN mp1  = Nothing
+                     | otherwise  = Just $ fromIntegral $ signum s
+{-
 sgn     :: MPFR -> Maybe Int 
 sgn mp1 = case (cmpw mp1 0) of
             Nothing -> Nothing
             Just x -> Just (pred . fromEnum $ x)
-
+-}
 -- TODO Maybe Bool????
 greater       :: MPFR -> MPFR -> Bool
-greater d1 d2 = withMPFRBB d1 d2 mpfr_greater_p /= 0
+greater d1 d2 = maybe False (== GT) (cmp d1 d2) --withMPFRBB d1 d2 mpfr_greater_p /= 0
 
 greatereq       :: MPFR -> MPFR -> Bool
-greatereq d1 d2 = withMPFRBB d1 d2 mpfr_greaterequal_p /= 0
+greatereq d1 d2 = maybe False (/= LT) (cmp d1 d2) --withMPFRBB d1 d2 mpfr_greaterequal_p /= 0
 
 less       :: MPFR -> MPFR -> Bool
-less d1 d2 = withMPFRBB d1 d2 mpfr_less_p /= 0
+less d1 d2 = maybe False (== LT) (cmp d1 d2) --withMPFRBB d1 d2 mpfr_less_p /= 0
 
 lesseq       :: MPFR -> MPFR -> Bool
-lesseq d1 d2 = withMPFRBB d1 d2 mpfr_lessequal_p /= 0
+lesseq d1 d2 = maybe False (/= GT) (cmp d1 d2) --withMPFRBB d1 d2 mpfr_lessequal_p /= 0
 
 lessgreater       :: MPFR -> MPFR -> Maybe Bool
 lessgreater d1 d2 = if isNaN d1 || isNaN d2 then Nothing 
                       else Just (withMPFRBB d1 d2 mpfr_lessgreater_p /= 0)
 
 equal       :: MPFR -> MPFR -> Bool
-equal d1 d2 = withMPFRBB d1 d2 mpfr_equal_p /= 0
+equal d1 d2 = maybe False (== EQ) (cmp d1 d2) --withMPFRBB d1 d2 mpfr_equal_p /= 0
 
 unordered       :: MPFR -> MPFR -> Maybe Bool
 unordered d1 d2 = if isNaN d1 || isNaN d2 then Nothing 
@@ -122,6 +146,6 @@
     (<=)         = lesseq
     (>)          = greater
     (>=)         = greatereq
-    max d d'     = maxD Zero (maxPrec d d') d d'
-    min d d'     = minD Zero (maxPrec d d') d d'
+--    max d d'     = maxD Zero (maxPrec d d') d d'
+--    min d d'     = minD Zero (maxPrec d d') d d'
                     
diff --git a/Data/Number/MPFR/Down.hs b/Data/Number/MPFR/Down.hs
--- a/Data/Number/MPFR/Down.hs
+++ b/Data/Number/MPFR/Down.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MagicHash, CPP #-}
+
 {-|
     Module      :  Data.Number.MPFR.Down
     Description :  top level
@@ -29,6 +31,14 @@
 
 import Data.Ratio
 
+#if __GLASGOW_HASKELL__ >= 610
+import GHC.Integer.Internals
+import GHC.Exts hiding (Down)
+#else 
+import GHC.Exts
+#endif
+
+
 instance Num MPFR where
     d + d'        = add Down (maxPrec d d') d d'
     d - d'        = sub Down (maxPrec d d') d d'
@@ -36,8 +46,8 @@
     negate d      = neg Down (getPrec d) d
     abs d         = absD Down (getPrec d) d
     signum d      = fromInt Down minPrec (fromMaybe (-1) (sgn d))
-    fromInteger i = fromIntegerA Zero (checkPrec $ binprec i) i
-                    -- TODO works only partially
+    fromInteger (S# i) = fromInt Down minPrec (I# i)
+    fromInteger i@(J# n _) = fromIntegerA Zero (fromIntegral $ I# n * bitsPerIntegerLimb) i 
 
 instance Real MPFR where
     toRational d = n % 2 ^ e
diff --git a/Data/Number/MPFR/FFIhelper.hsc b/Data/Number/MPFR/FFIhelper.hsc
--- a/Data/Number/MPFR/FFIhelper.hsc
+++ b/Data/Number/MPFR/FFIhelper.hsc
@@ -50,6 +50,7 @@
                                  #{poke __mpfr_struct, _mpfr_sign} p s 
                                  #{poke __mpfr_struct, _mpfr_exp} p e
                                  withForeignPtr fp $ \p1 -> #{poke __mpfr_struct, _mpfr_d} p p1
+
 {-# INLINE peekP #-}
 peekP      :: Ptr MPFR -> ForeignPtr Limb -> IO MPFR
 peekP p fp = do r11 <- #{peek __mpfr_struct, _mpfr_prec} p
@@ -78,6 +79,9 @@
 
 bitsPerMPLimb :: Int 
 bitsPerMPLimb = 8 * #size mp_limb_t
+
+bitsPerIntegerLimb :: Int
+bitsPerIntegerLimb = bitsPerMPLimb
 
 expZero :: Exp
 expZero = #const __MPFR_EXP_ZERO
diff --git a/Data/Number/MPFR/Internal.hs b/Data/Number/MPFR/Internal.hs
--- a/Data/Number/MPFR/Internal.hs
+++ b/Data/Number/MPFR/Internal.hs
@@ -20,6 +20,7 @@
 import Foreign.C(CInt, CLong, CULong, withCString, peekCString)
 import Foreign.Marshal(alloca, peekArray)
 import Foreign(unsafePerformIO, peek, Ptr, nullPtr, mallocForeignPtrBytes, with, withForeignPtr)
+import Foreign.Storable(sizeOf)
 
 import Data.Bits(shiftL)
 
@@ -134,7 +135,7 @@
                       f p1 p2
 
                         
-
+{-# INLINE checkPrec #-}
 checkPrec :: Precision -> Precision
 checkPrec = max minPrec
 
@@ -149,8 +150,10 @@
 binprec i = length (takeWhile (/= 0) (iterate (flip shiftR 1) i)
 -}
 -- TODO
+{-# INLINE binprec #-}
 binprec   :: Integer -> Precision
-binprec d = Prelude.floor (logBase 2 (fromInteger (if d >= 0 then d else -d)) :: Double) + 1
+binprec d | d == 0 = minPrec
+          | otherwise = Prelude.floor (logBase 2 (abs . fromInteger $ d) :: Double) + 1
 
 --one ::  MPFR              
 --one = fromWord Near minPrec 1
@@ -159,4 +162,4 @@
 --ggzero = fromWord Near minPrec 0
 
 minPrec :: Precision
-minPrec = 32
+minPrec = fromIntegral $ 8 * sizeOf (undefined :: Int)
diff --git a/Data/Number/MPFR/Misc.hs b/Data/Number/MPFR/Misc.hs
--- a/Data/Number/MPFR/Misc.hs
+++ b/Data/Number/MPFR/Misc.hs
@@ -19,6 +19,8 @@
 
 import Data.Number.MPFR.Assignment
 
+import Data.Number.MPFR.Comparison
+
 import Data.List(foldl')
 
 nextToward         :: MPFR -> MPFR -> MPFR
@@ -73,9 +75,9 @@
                      mpfr_random2 p1 m e
                      peekP p1 fp
 
-getExp   :: MPFR -> Exp
-getExp d = (fromIntegral . unsafePerformIO) go
-                 where go = do with d $ \p1 -> mpfr_custom_get_exp p1
+getExp              :: MPFR -> Exp
+getExp (MP _ _ e _) = e {-(fromIntegral . unsafePerformIO) go
+                 where go = do with d $ \p1 -> mpfr_custom_get_exp p1-}
 
 setExp     :: MPFR -> Exp -> MPFR
 setExp d e = unsafePerformIO go
@@ -93,10 +95,22 @@
 signbit d = withMPFRB d mpfr_signbit /= 0
 
 maxD_           :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
-maxD_ r p d1 d2 = withMPFRsBA r p d1 d2 mpfr_max
+--maxD_ r pw d1 d2 = withMPFRsBA r pw d1 d2 mpfr_max
 
+maxD_ r pw d1@(MP p _ e _) d2@(MP p' _ e' _) | fromIntegral pw == p && fromIntegral pw == p' && e > expInf && e' > expInf = 
+                                                 case cmp d1 d2 of 
+                                                   Just LT -> (d2, 0)
+                                                   _ -> (d1, 0)
+                                             | otherwise           = withMPFRsBA r pw d1 d2 mpfr_max
+
+
 minD_           :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
-minD_ r p d1 d2 = withMPFRsBA r p d1 d2 mpfr_min
+--minD_ r pw d1 d2 = withMPFRsBA r pw d1 d2 mpfr_min
+minD_ r pw d1@(MP p _ e _) d2@(MP p' _ e' _) | fromIntegral pw == p && fromIntegral pw == p' && e > expInf && e' > expInf = 
+                                                 case cmp d1 d2 of 
+                                                   Just GT -> (d2, 0)
+                                                   _ -> (d1, 0)
+                                             | otherwise = withMPFRsBA r pw d1 d2 mpfr_min
 
 getPrec   :: MPFR -> Precision
 getPrec (MP p _ _ _) = fromIntegral p -- fromIntegral (withMPFRP d mpfr_get_prec)
@@ -105,7 +119,7 @@
 --
 -- > d = getMantissa d * 2^(getExp d - ceiling ((getPrec d) / bitsPerMPLimb)* bitsPerMPLimb )
 --
--- If case of 0, NaN or +-Inf it will return 0
+-- In case of 0, NaN or +-Inf it will return 0
 getMantissa   :: MPFR -> Integer
 getMantissa d@(MP _ s e _) | e /= expInf && e /= expNaN && e /= expZero = toInteger s * h
                            | otherwise                                  = 0
diff --git a/Data/Number/MPFR/Near.hs b/Data/Number/MPFR/Near.hs
--- a/Data/Number/MPFR/Near.hs
+++ b/Data/Number/MPFR/Near.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MagicHash, CPP #-}
+
 {-|
     Module      :  Data.Number.MPFR.Near
     Description :  top level
@@ -30,6 +32,11 @@
 
 import Data.Ratio
 
+#if __GLASGOW_HASKELL__ >= 610
+import GHC.Integer.Internals
+#endif
+import GHC.Exts
+
 instance Num MPFR where
     d + d'        = add Near (maxPrec d d') d d'
     d - d'        = sub Near (maxPrec d d') d d'
@@ -37,8 +44,8 @@
     negate d      = neg Near (getPrec d) d
     abs d         = absD Near (getPrec d) d
     signum d      = fromInt Near minPrec (fromMaybe (-1) (sgn d))
-    fromInteger i = fromIntegerA Zero (checkPrec $ binprec i) i
-                    -- TODO works only partially
+    fromInteger (S# i) = fromInt Near minPrec (I# i)
+    fromInteger i@(J# n _) = fromIntegerA Zero (fromIntegral $ I# n * bitsPerIntegerLimb) i 
 
 instance Real MPFR where
     toRational d = n % 2 ^ e
diff --git a/Data/Number/MPFR/Up.hs b/Data/Number/MPFR/Up.hs
--- a/Data/Number/MPFR/Up.hs
+++ b/Data/Number/MPFR/Up.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MagicHash, CPP #-}
+
 {-|
     Module      :  Data.Number.MPFR.Up
     Description :  top level
@@ -31,6 +33,11 @@
 
 import Data.Ratio
 
+#if __GLASGOW_HASKELL__ >= 610
+import GHC.Integer.Internals
+#endif
+import GHC.Exts
+
 instance Num MPFR where
     d + d'        = add Up (maxPrec d d') d d'
     d - d'        = sub Up (maxPrec d d') d d'
@@ -38,8 +45,8 @@
     negate d      = neg Up (getPrec d) d
     abs d         = absD Up (getPrec d) d
     signum d      = fromInt Up minPrec (fromMaybe (-1) (sgn d))
-    fromInteger i = fromIntegerA Zero (checkPrec $ binprec i) i
-                    -- TODO works only partially
+    fromInteger (S# i) = fromInt Up minPrec (I# i)
+    fromInteger i@(J# n _) = fromIntegerA Zero (fromIntegral $ I# n * bitsPerIntegerLimb) i 
 
 instance Real MPFR where
     toRational d = n % 2 ^ e
diff --git a/Data/Number/MPFR/Zero.hs b/Data/Number/MPFR/Zero.hs
--- a/Data/Number/MPFR/Zero.hs
+++ b/Data/Number/MPFR/Zero.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MagicHash, CPP #-}
+
 {-|
     Module      :  Data.Number.MPFR.Zero
     Description :  top level
@@ -31,6 +33,11 @@
 
 import Data.Ratio
 
+#if __GLASGOW_HASKELL__ >= 610
+import GHC.Integer.Internals
+#endif
+import GHC.Exts
+
 instance Num MPFR where
     d + d'        = add Zero (maxPrec d d') d d'
     d - d'        = sub Zero (maxPrec d d') d d'
@@ -38,8 +45,8 @@
     negate d      = neg Zero (getPrec d) d
     abs d         = absD Zero (getPrec d) d
     signum d      = fromInt Zero minPrec (fromMaybe (-1) (sgn d))
-    fromInteger i = fromIntegerA Zero (checkPrec $ binprec i) i
-                    -- TODO works only partially
+    fromInteger (S# i) = fromInt Zero minPrec (I# i)
+    fromInteger i@(J# n _) = fromIntegerA Zero (fromIntegral $ I# n * bitsPerIntegerLimb) i 
 
 instance Real MPFR where
     toRational d = n % 2 ^ e
diff --git a/dict.txt b/dict.txt
new file mode 100644
--- /dev/null
+++ b/dict.txt
@@ -0,0 +1,158 @@
+-- Assignment functions
+mpfr_get_prec : getPrec
+mpfr_set : set
+mpfr_set_ui : fromWord
+mpfr_set_si : fromInt
+mpfr_set_d : fromDouble
+mpfr_set_ui_2exp : int2w
+mpfr_set_si_2exp : int2i
+mpfr_set_str : stringToMPFR
+mpfr_strtofr : strtofr
+mpfr_set_inf : setInf
+mpfr_set_nan : setNaN
+mpfr_get_d : toDouble
+mpfr_get_d_2exp : toDouble2Exp
+mpfr_get_si  : toInt
+mpfr_get_ui  : toWord
+mpfr_get_str : mpfrToString
+mpfr_fits_ulong_p : fitsUlong
+mpfr_fits_slong_p : fitsSLong
+mpfr_fits_uint_p : fitsUInt
+mpfr_fits_sint_p : fitsSInt
+mpfr_fits_ushort_p : fitsUShort
+mpfr_fits_sshort_p : fitsSShort
+
+--Basic arithmetic functions
+mpfr_add : add
+mpfr_add_ui : addw
+mpfr_add_si : addi
+mpfr_sub : sub
+mpfr_ui_sub  : wsub 
+mpfr_sub_ui : subw
+mpfr_si_sub  : isub
+mpfr_sub_si : subi
+mpfr_mul : mul
+mpfr_mul_ui : mulw
+mpfr_mul_si : muli
+mpfr_sqr : sqr
+mpfr_div : div
+mpfr_ui_div : wdiv
+mpfr_div_ui : divw
+mpfr_si_div : idiv
+mpfr_div_si : divi
+mpfr_sqrt : sqrt
+mpfr_sqrt_ui : sqrtw
+mpfr_cbrt : cbrt
+mpfr_root : root
+mpfr_pow : pow
+mpfr_pow_ui : poww
+mpfr_pow_si : powi
+mpfr_ui_pow_ui : wpoww
+mpfr_ui_pow : wpow
+mpfr_neg : neg
+mpfr_abs : absD
+mpfr_dim : dim
+mpfr_mul_2ui : mul2w
+mpfr_mul_2si : mul2i
+mpfr_div_2ui : div2w
+mpfr_div_2si : div2i
+
+--Comparisons
+mpfr_cmp : cmp
+mpfr_cmp_ui : cmpw
+mpfr_cmp_si : cmpi
+mpfr_cmp_d : cmpd
+mpfr_cmp_ui_2exp : cmp2w
+mpfr_cmp_si_2exp : cmp2i
+mpfr_cmpabs : cmpabs
+mpfr_nan_p : isNaN
+mpfr_inf_p : isInf
+mpfr_number_p : isNumber
+mpfr_zero_p : isZero
+mpfr_sgn : sgn
+mpfr_greater_p : greater
+mpfr_greaterequal_p : greatereq
+mpfr_less_p : less
+mpfr_lessequal_p : lesseq
+mpfr_lessgreater_p : lessgreater
+mpfr_equal_p : equal
+mpfr_unordered_p : unordered
+
+-- Special functions
+mpfr_log : log
+mpfr_log2 : log2
+mpfr_log10 : log10
+mpfr_exp : exp
+mpfr_exp2 : exp2
+mpfr_exp10 : exp10
+mpfr_sin : sin
+mpfr_cos : cos
+mpfr_tan : tan
+mpfr_sec : sec
+mpfr_csc : csc
+mpfr_cot : cot
+mpfr_sin_cos : sincos
+mpfr_asin : asin
+mpfr_acos : acos
+mpfr_atan : atan
+mpfr_atan2 : atan2
+mpfr_cosh : cosh
+mpfr_sinh : sinh
+mpfr_tanh : tanh
+mpfr_sech : sech
+mpfr_csch : csch
+mpfr_coth : coth
+mpfr_asinh : asinh
+mpfr_acosh : acosh
+mpfr_atanh : atanh
+mpfr_fac_ui : facw
+mpfr_log1p : log1p
+mpfr_expm1 : expm1
+mpfr_eint : eint
+mpfr_gamma : gamma
+mpfr_lngamma : lngamma
+mpfr_lgamma : lgamma
+mpfr_zeta : zeta
+mpfr_zeta_ui : zetaw
+mpfr_erf : erf
+mpfr_erfc : erfc
+mpfr_j0 : j0
+mpfr_j1 : j1
+mpfr_jn : jn
+mpfr_y0 : y0
+mpfr_y1 : y1
+mpfr_yn : yn
+mpfr_fma : fma
+mpfr_fms : fms
+mpfr_agm : agm
+mpfr_hypot : hypot
+mpfr_const_log2 : log2c
+mpfr_const_pi : pi
+mpfr_const_euler : euler
+mpfr_const_catalan : catalan
+
+-- Integer related functions
+mpfr_rint : rint
+mpfr_ceil : ceil
+mpfr_floor : floor
+mpfr_round : round
+mpfr_trunc : trunc
+mpfr_rint_ceil : rintCeil
+mpfr_rint_floor : rintFloor
+mpfr_rint_round : rintRound
+mpfr_rint_trunc : rintTrunc
+mpfr_frac : frac
+mpfr_remainder : remainder
+mpfr_remquo  : remquo
+mpfr_integer_p : isInteger
+
+-- Miscellaneous functions
+mpfr_nexttoward : nextToward
+mpfr_nextabove : nextAbove
+mpfr_nextbelow : nextBelow
+mpfr_min : maxD
+mpfr_max : minD
+mpfr_random2 : random2
+mpfr_get_exp : getExp
+mpfr_set_exp : setExp
+mpfr_signbit : signbit
diff --git a/hmpfr.cabal b/hmpfr.cabal
--- a/hmpfr.cabal
+++ b/hmpfr.cabal
@@ -1,50 +1,56 @@
 name:                hmpfr
-version:             0.1.2
+version:             0.1.3
 synopsis:            Haskell binding to MPFR library
-description:         Haskell binding to MPFR library. Tested with MPFR 2.3.1 and 2.3.2.
-		     Some simple examples of usage can be found in test/Demo.hs.
+description:         Haskell binding to MPFR library. Tested with 2.3.2.
+                     Some simple examples of usage can be found in test/Demo.hs.
 category:            Data, Math
 license:             BSD3
 license-file:        LICENSE
 Stability:           experimental
-tested-with:	     GHC == 6.8.3
+tested-with:         GHC == 6.8.3
 author:              Aleš Bizjak
 maintainer:          Aleš Bizjak <ales.bizjak0@gmail.com>
-Homepage:	     http://code.haskell.org/hmpfr/
-build-Depends:       base
+Homepage:            http://code.haskell.org/hmpfr/
 
-Other-modules:       Data.Number.MPFR.FFIhelper
-                     Data.Number.MPFR.Internal
-		     Data.Number.MPFR.Base
-		     
+build-type:          Simple
+cabal-version:       >= 1.2
+Extra-source-files:  test/Demo.hs
 
-Exposed-modules:     Data.Number.MPFR.Assignment
-		     Data.Number.MPFR.Conversion
-                     Data.Number.MPFR.Arithmetic
-                     Data.Number.MPFR.Comparison
-                     Data.Number.MPFR.Special
-                     Data.Number.MPFR.Integer
-                     Data.Number.MPFR.Misc
+Data-files:          README
+                     dict.txt
 
-		     Data.Number.MPFR.Near
-		     Data.Number.MPFR.Up
-		     Data.Number.MPFR.Down
-		     Data.Number.MPFR.Zero
+Library
+  build-Depends:       base
+  if impl(ghc >= 6.10)
+    build-depends:     integer
 
-		     Data.Number.MPFR
+  Other-modules:       Data.Number.MPFR.FFIhelper
+                       Data.Number.MPFR.Internal
+                       Data.Number.MPFR.Base
+                     
 
-Extra-source-files:  test/Demo.hs
+  Exposed-modules:     Data.Number.MPFR.Assignment
+                       Data.Number.MPFR.Conversion
+                       Data.Number.MPFR.Arithmetic
+                       Data.Number.MPFR.Comparison
+                       Data.Number.MPFR.Special
+                       Data.Number.MPFR.Integer
+                       Data.Number.MPFR.Misc
 
-Data-files:	     README
+                       Data.Number.MPFR.Near
+                       Data.Number.MPFR.Up
+                       Data.Number.MPFR.Down
+                       Data.Number.MPFR.Zero
 
-build-type:          Simple
-build-tools:         hsc2hs
-GHC-options:         -Wall -fno-warn-orphans -O2 -funfolding-keeness-factor=10 -fvia-C -optc-O2
-GHC-prof-options:    -prof -auto-all
-include-dirs:        cbits
-includes:            chsmpfr.h mpfr.h
-install-includes:    chsmpfr.h
-c-sources:           cbits/chsmpfr.c
+                       Data.Number.MPFR
 
-extra-libraries:     mpfr
+  build-tools:         hsc2hs
+  GHC-options:         -Wall -fno-warn-orphans -O2 -funfolding-keeness-factor=10
+  GHC-prof-options:    -prof -auto
+  include-dirs:        cbits
+  includes:            chsmpfr.h mpfr.h
+  install-includes:    chsmpfr.h
+  c-sources:           cbits/chsmpfr.c
+
+  extra-libraries:     mpfr
 
