-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell binding to the MPFR library
--   
--   Haskell binding to the MPFR library.
--   
--   The library includes both a pure and a mutable interface. The mutable
--   interface should have a lot less overhead than the pure one.
--   
--   Some simple examples of usage can be found in demo/Demo.hs.
@package hmpfr
@version 0.4.4

module Data.Number.MPFR.FFIhelper
data RoundMode
Near :: RoundMode
Zero :: RoundMode
Up :: RoundMode
Down :: RoundMode
MPFR_RNDNA :: RoundMode
data MPFR
MP :: {-# UNPACK #-} !CPrecision -> {-# UNPACK #-} !Sign -> {-# UNPACK #-} !Exp -> {-# UNPACK #-} !(ForeignPtr Limb) -> MPFR
[precision] :: MPFR -> {-# UNPACK #-} !CPrecision
[sign] :: MPFR -> {-# UNPACK #-} !Sign
[exponent] :: MPFR -> {-# UNPACK #-} !Exp
[limbs] :: MPFR -> {-# UNPACK #-} !(ForeignPtr Limb)
newtype Precision
Precision :: Word -> Precision
[runPrec] :: Precision -> Word
peekNoLimbPrec :: Ptr MPFR -> IO (Sign, Exp)
peekP :: Ptr MPFR -> ForeignPtr Limb -> IO MPFR
withDummy :: Precision -> (Ptr MPFR -> IO CInt) -> IO (MPFR, Int)
pokeDummy :: Ptr MPFR -> ForeignPtr Limb -> Precision -> IO ()
bitsPerMPLimb :: Int
bitsPerIntegerLimb :: Int
expZero :: Exp
expNaN :: Exp
expInf :: Exp
type CRoundMode = CInt
type Limb = Word64
type Sign = Int32
type CPrecision = Int64
type Exp = Int64
type MpSize = Int64
initS :: CPrecision -> IO (Ptr MPFR)
new_gmp_randstate :: IO (Ptr GmpRandState)
mpfr_urandomb_deref_randstate :: (Ptr MPFR) -> (Ptr GmpRandState) -> IO Int
type GmpRandState = ()
mpfr_get_prec :: Ptr MPFR -> IO CPrecision
mpfr_set :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_set_ui :: Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_set_si :: Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_set_d :: Ptr MPFR -> CDouble -> CRoundMode -> IO CInt
mpfr_set_ui_2exp :: Ptr MPFR -> CULong -> Exp -> CRoundMode -> IO CInt
mpfr_set_si_2exp :: Ptr MPFR -> CLong -> Exp -> CRoundMode -> IO CInt
mpfr_set_str :: Ptr MPFR -> CString -> CInt -> CRoundMode -> IO CInt
mpfr_strtofr :: Ptr MPFR -> CString -> Ptr (Ptr CChar) -> CInt -> CRoundMode -> IO CInt
mpfr_set_inf :: Ptr MPFR -> CInt -> IO ()
mpfr_set_nan :: Ptr MPFR -> IO ()
mpfr_swap :: Ptr MPFR -> Ptr MPFR -> IO ()
mpfr_get_d :: Ptr MPFR -> CRoundMode -> IO CDouble
mpfr_get_d_2exp :: Ptr CLong -> Ptr MPFR -> CRoundMode -> IO CDouble
mpfr_get_si :: Ptr MPFR -> CRoundMode -> IO CLong
mpfr_get_ui :: Ptr MPFR -> CRoundMode -> IO CULong
mpfr_get_str :: CString -> Ptr Exp -> CInt -> CUInt -> Ptr MPFR -> CRoundMode -> IO CString
mpfr_free_str :: CString -> IO ()
mpfr_fits_ulong_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_slong_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_uint_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_sint_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_ushort_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_sshort_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_intmax_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fits_uintmax_p :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_add :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_add_ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_add_si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_add_d :: Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt
mpfr_sub :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_ui_sub :: Ptr MPFR -> CULong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sub_ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_si_sub :: Ptr MPFR -> CLong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sub_si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_sub_d :: Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt
mpfr_d_sub :: Ptr MPFR -> CDouble -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_mul :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_mul_ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_mul_si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_mul_d :: Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt
mpfr_sqr :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_div :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_ui_div :: Ptr MPFR -> CULong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_div_ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_si_div :: Ptr MPFR -> CLong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_div_si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_div_d :: Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt
mpfr_d_div :: Ptr MPFR -> CDouble -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sqrt :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sqrt_ui :: Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_rec_sqrt :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_cbrt :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_root :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_pow :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_pow_ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_pow_si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_ui_pow_ui :: Ptr MPFR -> CULong -> CULong -> CRoundMode -> IO CInt
mpfr_ui_pow :: Ptr MPFR -> CULong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_neg :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_abs :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_dim :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_mul_2ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_mul_2si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_div_2ui :: Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_div_2si :: Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt
mpfr_cmp :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_cmp_ui :: Ptr MPFR -> CULong -> IO CInt
mpfr_cmp_si :: Ptr MPFR -> CLong -> IO CInt
mpfr_cmp_d :: Ptr MPFR -> CDouble -> IO CInt
mpfr_cmp_ui_2exp :: Ptr MPFR -> CULong -> Exp -> IO CInt
mpfr_cmp_si_2exp :: Ptr MPFR -> CLong -> Exp -> IO CInt
mpfr_cmpabs :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_nan_p :: Ptr MPFR -> IO CInt
mpfr_inf_p :: Ptr MPFR -> IO CInt
mpfr_number_p :: Ptr MPFR -> IO CInt
mpfr_zero_p :: Ptr MPFR -> IO CInt
mpfr_sgn :: Ptr MPFR -> IO CInt
mpfr_greater_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_greaterequal_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_less_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_lessequal_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_lessgreater_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_equal_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_unordered_p :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_log :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_log2 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_log10 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_exp :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_exp2 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_exp10 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sin :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_cos :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_tan :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sec :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_csc :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_cot :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sin_cos :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_asin :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_acos :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_atan :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_atan2 :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_cosh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sinh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_tanh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sinh_cosh :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_sech :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_csch :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_coth :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_asinh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_acosh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_atanh :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fac_ui :: Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_log1p :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_expm1 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_li2 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_eint :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_gamma :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_lngamma :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_lgamma :: Ptr MPFR -> Ptr CInt -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_digamma :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_zeta :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_zeta_ui :: Ptr MPFR -> CULong -> CRoundMode -> IO CInt
mpfr_erf :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_erfc :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_j0 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_j1 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_jn :: Ptr MPFR -> CLong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_y0 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_y1 :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_yn :: Ptr MPFR -> CLong -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fma :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fms :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_agm :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_hypot :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_const_log2 :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_const_pi :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_const_euler :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_const_catalan :: Ptr MPFR -> CRoundMode -> IO CInt
mpfr_free_cache :: IO ()
mpfr_sum :: Ptr MPFR -> Ptr (Ptr MPFR) -> CULong -> CRoundMode -> IO CInt
mpfr_rint :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_ceil :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_floor :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_round :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_trunc :: Ptr MPFR -> Ptr MPFR -> IO CInt
mpfr_rint_ceil :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_rint_floor :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_rint_round :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_rint_trunc :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_frac :: Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_modf :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_fmod :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_remainder :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_remquo :: Ptr MPFR -> Ptr CLong -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_integer_p :: Ptr MPFR -> IO CInt
mpfr_nexttoward :: Ptr MPFR -> Ptr MPFR -> IO ()
mpfr_nextabove :: Ptr MPFR -> IO ()
mpfr_nextbelow :: Ptr MPFR -> IO ()
mpfr_min :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_max :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_urandomb :: Ptr MPFR -> Ptr GmpRandState -> IO ()
mpfr_get_exp :: Ptr MPFR -> IO Exp
mpfr_set_exp :: Ptr MPFR -> Exp -> IO CInt
mpfr_signbit :: Ptr MPFR -> IO CInt
mpfr_setsign :: Ptr MPFR -> Ptr MPFR -> CInt -> CRoundMode -> IO CInt
mpfr_copysign :: Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt
mpfr_get_emin :: IO Exp
mpfr_get_emax :: IO Exp
mpfr_set_emin :: Exp -> IO CInt
mpfr_set_emax :: Exp -> IO CInt
mpfr_get_emin_min :: IO Exp
mpfr_get_emin_max :: IO Exp
mpfr_get_emax_min :: IO Exp
mpfr_get_emax_max :: IO Exp
mpfr_check_range :: Ptr MPFR -> CInt -> CRoundMode -> IO CInt
mpfr_subnormalize :: Ptr MPFR -> CInt -> CRoundMode -> IO CInt
mpfr_clear_underflow :: IO ()
mpfr_clear_overflow :: IO ()
mpfr_clear_nanflag :: IO ()
mpfr_clear_inexflag :: IO ()
mpfr_clear_erangeflag :: IO ()
mpfr_set_underflow :: IO ()
mpfr_set_overflow :: IO ()
mpfr_set_nanflag :: IO ()
mpfr_set_inexflag :: IO ()
mpfr_set_erangeflag :: IO ()
mpfr_clear_flags :: IO ()
mpfr_underflow_p :: IO CInt
mpfr_overflow_p :: IO CInt
mpfr_nanflag_p :: IO CInt
mpfr_inexflag_p :: IO CInt
mpfr_erangeflag_p :: IO CInt
mpfr_custom_get_size :: CPrecision -> IO Word64
mpfr_custom_init :: Ptr Word64 -> CPrecision -> IO ()
mpfr_custom_init_set :: Ptr MPFR -> CInt -> Exp -> CPrecision -> Ptr Limb -> IO ()
mpfr_custom_get_kind :: Ptr MPFR -> IO CInt
mpfr_custom_get_mantissa :: Ptr MPFR -> IO (Ptr Limb)
mpfr_custom_get_exp :: Ptr MPFR -> IO Exp
mpfr_custom_move :: Ptr MPFR -> Ptr Word64 -> IO ()
instance GHC.Generics.Generic Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Enum.Enum Data.Number.MPFR.FFIhelper.Precision
instance GHC.Show.Show Data.Number.MPFR.FFIhelper.Precision
instance GHC.Classes.Ord Data.Number.MPFR.FFIhelper.Precision
instance GHC.Classes.Eq Data.Number.MPFR.FFIhelper.Precision
instance GHC.Read.Read Data.Number.MPFR.FFIhelper.RoundMode
instance GHC.Show.Show Data.Number.MPFR.FFIhelper.RoundMode
instance Foreign.Storable.Storable Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Num.Num Data.Number.MPFR.FFIhelper.Precision
instance GHC.Real.Real Data.Number.MPFR.FFIhelper.Precision
instance GHC.Real.Integral Data.Number.MPFR.FFIhelper.Precision
instance GHC.Enum.Enum Data.Number.MPFR.FFIhelper.RoundMode

module Data.Number.MPFR.Internal
withMPFRsBA :: RoundMode -> Precision -> MPFR -> MPFR -> (Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAui :: RoundMode -> Precision -> MPFR -> CULong -> (Ptr MPFR -> Ptr MPFR -> CULong -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAiu :: RoundMode -> Precision -> CULong -> MPFR -> (Ptr MPFR -> CULong -> Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAd :: RoundMode -> Precision -> MPFR -> CDouble -> (Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAsi :: RoundMode -> Precision -> MPFR -> CLong -> (Ptr MPFR -> Ptr MPFR -> CLong -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAis :: RoundMode -> Precision -> CLong -> MPFR -> (Ptr MPFR -> CLong -> Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBAd' :: RoundMode -> Precision -> CDouble -> MPFR -> (Ptr MPFR -> CDouble -> Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRB :: MPFR -> (Ptr MPFR -> IO CInt) -> CInt
withMPFRP :: MPFR -> (Ptr MPFR -> IO CPrecision) -> CPrecision
withMPFR :: RoundMode -> Precision -> MPFR -> (Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRBB :: MPFR -> MPFR -> (Ptr MPFR -> Ptr MPFR -> IO CInt) -> CInt
withMPFRC :: RoundMode -> Precision -> (Ptr MPFR -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRF :: MPFR -> RoundMode -> (Ptr MPFR -> CRoundMode -> IO CInt) -> Int
withMPFRUI :: RoundMode -> Precision -> Word -> (Ptr MPFR -> CULong -> CRoundMode -> IO CInt) -> (MPFR, Int)
withMPFRR :: Precision -> MPFR -> (Ptr MPFR -> Ptr MPFR -> IO CInt) -> (MPFR, Int)
checkPrec :: Precision -> Precision
getMantissa' :: MPFR -> [Limb]

-- | This is the "back door" into the <a>IO</a> monad, allowing <a>IO</a>
--   computation to be performed at any time. For this to be safe, the
--   <a>IO</a> computation should be free of side effects and independent
--   of its environment.
--   
--   If the I/O computation wrapped in <a>unsafePerformIO</a> performs side
--   effects, then the relative order in which those side effects take
--   place (relative to the main I/O trunk, or other calls to
--   <a>unsafePerformIO</a>) is indeterminate. Furthermore, when using
--   <a>unsafePerformIO</a> to cause side-effects, you should take the
--   following precautions to ensure the side effects are performed as many
--   times as you expect them to be. Note that these precautions are
--   necessary for GHC, but may not be sufficient, and other compilers may
--   require different precautions:
--   
--   <ul>
--   <li>Use <tt>{-# NOINLINE foo #-}</tt> as a pragma on any function
--   <tt>foo</tt> that calls <a>unsafePerformIO</a>. If the call is
--   inlined, the I/O may be performed more than once.</li>
--   <li>Use the compiler flag <tt>-fno-cse</tt> to prevent common
--   sub-expression elimination being performed on the module, which might
--   combine two side effects that were meant to be separate. A good
--   example is using multiple global variables (like <tt>test</tt> in the
--   example below).</li>
--   <li>Make sure that the either you switch off let-floating
--   (<tt>-fno-full-laziness</tt>), or that the call to
--   <a>unsafePerformIO</a> cannot float outside a lambda. For example, if
--   you say: <tt> f x = unsafePerformIO (newIORef []) </tt> you may get
--   only one reference cell shared between all calls to <tt>f</tt>. Better
--   would be <tt> f x = unsafePerformIO (newIORef [x]) </tt> because now
--   it can't float outside the lambda.</li>
--   </ul>
--   
--   It is less well known that <a>unsafePerformIO</a> is not type safe.
--   For example:
--   
--   <pre>
--   test :: IORef [a]
--   test = unsafePerformIO $ newIORef []
--   
--   main = do
--           writeIORef test [42]
--           bang &lt;- readIORef test
--           print (bang :: [Char])
--   </pre>
--   
--   This program will core dump. This problem with polymorphic references
--   is well known in the ML community, and does not arise with normal
--   monadic use of references. There is no easy way to make it impossible
--   once you use <a>unsafePerformIO</a>. Indeed, it is possible to write
--   <tt>coerce :: a -&gt; b</tt> with the help of <a>unsafePerformIO</a>.
--   So be careful!
unsafePerformIO :: () => IO a -> a

-- | Read a value from the given memory location.
--   
--   Note that the peek and poke functions might require properly aligned
--   addresses to function correctly. This is architecture dependent; thus,
--   portable code should ensure that when peeking or poking values of some
--   type <tt>a</tt>, the alignment constraint for <tt>a</tt>, as given by
--   the function <a>alignment</a> is fulfilled.
peek :: Storable a => Ptr a -> IO a

-- | A value of type <tt><a>Ptr</a> a</tt> represents a pointer to an
--   object, or an array of objects, which may be marshalled to or from
--   Haskell values of type <tt>a</tt>.
--   
--   The type <tt>a</tt> will often be an instance of class <a>Storable</a>
--   which provides the marshalling operations. However this is not
--   essential, and you can provide your own operations to access the
--   pointer. For example you might write small foreign functions to get or
--   set the fields of a C <tt>struct</tt>.
data Ptr a

-- | The constant <a>nullPtr</a> contains a distinguished value of
--   <a>Ptr</a> that is not associated with a valid memory location.
nullPtr :: () => Ptr a

-- | This function is similar to <a>mallocForeignPtr</a>, except that the
--   size of the memory required is given explicitly as a number of bytes.
mallocForeignPtrBytes :: () => Int -> IO ForeignPtr a

-- | <tt><a>with</a> val f</tt> executes the computation <tt>f</tt>,
--   passing as argument a pointer to a temporarily allocated block of
--   memory into which <tt>val</tt> has been marshalled (the combination of
--   <a>alloca</a> and <a>poke</a>).
--   
--   The memory is freed when <tt>f</tt> terminates (either normally or via
--   an exception), so the pointer passed to <tt>f</tt> must <i>not</i> be
--   used after this.
with :: Storable a => a -> Ptr a -> IO b -> IO b

-- | This is a way to look at the pointer living inside a foreign object.
--   This function takes a function which is applied to that pointer. The
--   resulting <a>IO</a> action is then executed. The foreign object is
--   kept alive at least during the whole action, even if it is not used
--   directly inside. Note that it is not safe to return the pointer from
--   the action and use it after the action completes. All uses of the
--   pointer should be inside the <a>withForeignPtr</a> bracket. The reason
--   for this unsafeness is the same as for <a>unsafeForeignPtrToPtr</a>
--   below: the finalizer may run earlier than expected, because the
--   compiler can only track usage of the <a>ForeignPtr</a> object, not a
--   <a>Ptr</a> object made from it.
--   
--   This function is normally used for marshalling data to or from the
--   object pointed to by the <a>ForeignPtr</a>, using the operations from
--   the <a>Storable</a> class.
withForeignPtr :: () => ForeignPtr a -> Ptr a -> IO b -> IO b

-- | Haskell type representing the C <tt>int</tt> type.
data CInt

-- | Haskell type representing the C <tt>long</tt> type.
data CLong

-- | Haskell type representing the C <tt>unsigned long</tt> type.
data CULong

-- | Marshal a Haskell string into a NUL terminated C string using
--   temporary storage.
--   
--   <ul>
--   <li>the Haskell string may <i>not</i> contain any NUL characters</li>
--   <li>the memory is freed when the subcomputation terminates (either
--   normally or via an exception), so the pointer to the temporary storage
--   must <i>not</i> be used after this.</li>
--   </ul>
withCString :: () => String -> CString -> IO a -> IO a

-- | Marshal a NUL terminated C string into a Haskell string.
peekCString :: CString -> IO String

-- | <tt><a>alloca</a> f</tt> executes the computation <tt>f</tt>, passing
--   as argument a pointer to a temporarily allocated block of memory
--   sufficient to hold values of type <tt>a</tt>.
--   
--   The memory is freed when <tt>f</tt> terminates (either normally or via
--   an exception), so the pointer passed to <tt>f</tt> must <i>not</i> be
--   used after this.
alloca :: Storable a => Ptr a -> IO b -> IO b

-- | Convert an array of given length into a Haskell list. The
--   implementation is tail-recursive and so uses constant stack space.
peekArray :: Storable a => Int -> Ptr a -> IO [a]

-- | Shift the argument left by the specified number of bits (which must be
--   non-negative).
--   
--   An instance can define either this and <a>shiftR</a> or the unified
--   <a>shift</a>, depending on which is more convenient for the type in
--   question.
shiftL :: Bits a => a -> Int -> a
infixl 8 `shiftL`

-- | A <a>Word</a> is an unsigned integral type, with the same size as
--   <a>Int</a>.
data Word
minPrec :: Precision


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-chttp://www.mpfr.org/mpfr-current/mpfr.html#Integer-Related-Functions</a>
module Data.Number.MPFR.Integer
rint :: RoundMode -> Precision -> MPFR -> MPFR
ceil :: Precision -> MPFR -> MPFR
floor :: Precision -> MPFR -> MPFR
round :: Precision -> MPFR -> MPFR
trunc :: Precision -> MPFR -> MPFR
rintCeil :: RoundMode -> Precision -> MPFR -> MPFR
rintFloor :: RoundMode -> Precision -> MPFR -> MPFR
rintRound :: RoundMode -> Precision -> MPFR -> MPFR
rintTrunc :: RoundMode -> Precision -> MPFR -> MPFR
modf :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR)
frac :: RoundMode -> Precision -> MPFR -> MPFR
fmod :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
remainder :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
remquo :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
rint_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
ceil_ :: Precision -> MPFR -> (MPFR, Int)
floor_ :: Precision -> MPFR -> (MPFR, Int)
round_ :: Precision -> MPFR -> (MPFR, Int)
trunc_ :: Precision -> MPFR -> (MPFR, Int)
rintCeil_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
rintFloor_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
rintRound_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
rintTrunc_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
modf_ :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR, Int)
frac_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
fmod_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
remainder_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
remquo_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int, Int)
isInteger :: MPFR -> Bool


-- | All the functions that return Maybe Ordering return Nothing when one
--   of the operands is NaN and Just _ otherwise.
--   
--   For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Comparison-Functions</a>
module Data.Number.MPFR.Comparison
cmp :: MPFR -> MPFR -> Maybe Ordering
cmpw :: MPFR -> Word -> Maybe Ordering
cmpi :: MPFR -> Int -> Maybe Ordering
cmpd :: MPFR -> Double -> Maybe Ordering
cmp2w :: MPFR -> Word -> Exp -> Maybe Ordering
cmp2i :: MPFR -> Int -> Exp -> Maybe Ordering
cmpabs :: MPFR -> MPFR -> Maybe Ordering
isNaN :: MPFR -> Bool
isInfinite :: MPFR -> Bool
isNumber :: MPFR -> Bool
isZero :: MPFR -> Bool
sgn :: MPFR -> Maybe Int
greater :: MPFR -> MPFR -> Bool
greatereq :: MPFR -> MPFR -> Bool
less :: MPFR -> MPFR -> Bool
lesseq :: MPFR -> MPFR -> Bool
lessgreater :: MPFR -> MPFR -> Maybe Bool
equal :: MPFR -> MPFR -> Bool
unordered :: MPFR -> MPFR -> Maybe Bool
instance GHC.Classes.Eq Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Classes.Ord Data.Number.MPFR.FFIhelper.MPFR


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Basic-Arithmetic-Functions</a>.
module Data.Number.MPFR.Arithmetic
add :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
addw :: RoundMode -> Precision -> MPFR -> Word -> MPFR
addi :: RoundMode -> Precision -> MPFR -> Int -> MPFR
addd :: RoundMode -> Precision -> MPFR -> Double -> MPFR
sub :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
subw :: RoundMode -> Precision -> MPFR -> Word -> MPFR
subi :: RoundMode -> Precision -> MPFR -> Int -> MPFR
subd :: RoundMode -> Precision -> MPFR -> Double -> MPFR
wsub :: RoundMode -> Precision -> Word -> MPFR -> MPFR
isub :: RoundMode -> Precision -> Int -> MPFR -> MPFR
dsub :: RoundMode -> Precision -> Double -> MPFR -> MPFR
mul :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
mulw :: RoundMode -> Precision -> MPFR -> Word -> MPFR
muli :: RoundMode -> Precision -> MPFR -> Int -> MPFR
muld :: RoundMode -> Precision -> MPFR -> Double -> MPFR
sqr :: RoundMode -> Precision -> MPFR -> MPFR
div :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
divw :: RoundMode -> Precision -> MPFR -> Word -> MPFR
divi :: RoundMode -> Precision -> MPFR -> Int -> MPFR
divd :: RoundMode -> Precision -> MPFR -> Double -> MPFR
wdiv :: RoundMode -> Precision -> Word -> MPFR -> MPFR
idiv :: RoundMode -> Precision -> Int -> MPFR -> MPFR
ddiv :: RoundMode -> Precision -> Double -> MPFR -> MPFR
sqrt :: RoundMode -> Precision -> MPFR -> MPFR
sqrtw :: RoundMode -> Precision -> Word -> MPFR
recSqrt :: RoundMode -> Precision -> MPFR -> MPFR
cbrt :: RoundMode -> Precision -> MPFR -> MPFR
root :: RoundMode -> Precision -> MPFR -> Word -> MPFR
pow :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
poww :: RoundMode -> Precision -> MPFR -> Word -> MPFR
powi :: RoundMode -> Precision -> MPFR -> Int -> MPFR
wpoww :: RoundMode -> Precision -> Word -> Word -> MPFR
wpow :: RoundMode -> Precision -> Word -> MPFR -> MPFR
neg :: RoundMode -> Precision -> MPFR -> MPFR
absD :: RoundMode -> Precision -> MPFR -> MPFR
dim :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
mul2w :: RoundMode -> Precision -> MPFR -> Word -> MPFR
mul2i :: RoundMode -> Precision -> MPFR -> Int -> MPFR
div2w :: RoundMode -> Precision -> MPFR -> Word -> MPFR
div2i :: RoundMode -> Precision -> MPFR -> Int -> MPFR
add_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
addw_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
addi_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
addd_ :: RoundMode -> Precision -> MPFR -> Double -> (MPFR, Int)
sub_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
subw_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
subi_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
subd_ :: RoundMode -> Precision -> MPFR -> Double -> (MPFR, Int)
wsub_ :: RoundMode -> Precision -> Word -> MPFR -> (MPFR, Int)
isub_ :: RoundMode -> Precision -> Int -> MPFR -> (MPFR, Int)
dsub_ :: RoundMode -> Precision -> Double -> MPFR -> (MPFR, Int)
mul_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
mulw_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
muli_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
muld_ :: RoundMode -> Precision -> MPFR -> Double -> (MPFR, Int)
sqr_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
div_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
divw_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
divi_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
divd_ :: RoundMode -> Precision -> MPFR -> Double -> (MPFR, Int)
wdiv_ :: RoundMode -> Precision -> Word -> MPFR -> (MPFR, Int)
idiv_ :: RoundMode -> Precision -> Int -> MPFR -> (MPFR, Int)
ddiv_ :: RoundMode -> Precision -> Double -> MPFR -> (MPFR, Int)
sqrt_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
sqrtw_ :: RoundMode -> Precision -> Word -> (MPFR, Int)
recSqrt_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
cbrt_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
root_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
pow_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
poww_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
powi_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
wpoww_ :: RoundMode -> Precision -> Word -> Word -> (MPFR, Int)
wpow_ :: RoundMode -> Precision -> Word -> MPFR -> (MPFR, Int)
neg_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
absD_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
dim_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
mul2w_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
mul2i_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)
div2w_ :: RoundMode -> Precision -> MPFR -> Word -> (MPFR, Int)
div2i_ :: RoundMode -> Precision -> MPFR -> Int -> (MPFR, Int)


-- | Conversion from basic Haskell types to MPFR. See
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Assignment-Functions</a>
--   for documentation on particular functions.
module Data.Number.MPFR.Assignment
set :: RoundMode -> Precision -> MPFR -> MPFR
set_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
fromWord :: RoundMode -> Precision -> Word -> MPFR
fromInt :: RoundMode -> Precision -> Int -> MPFR
fromDouble :: RoundMode -> Precision -> Double -> MPFR
fromWord_ :: RoundMode -> Precision -> Word -> (MPFR, Int)
fromInt_ :: RoundMode -> Precision -> Int -> (MPFR, Int)
fromDouble_ :: RoundMode -> Precision -> Double -> (MPFR, Int)

-- | x * 2 ^ y
int2w :: RoundMode -> Precision -> Word -> Int -> MPFR

-- | x * 2 ^ y
int2i :: RoundMode -> Precision -> Int -> Int -> MPFR
int2w_ :: RoundMode -> Precision -> Word -> Int -> (MPFR, Int)
int2i_ :: RoundMode -> Precision -> Int -> Int -> (MPFR, Int)
stringToMPFR :: RoundMode -> Precision -> Word -> String -> MPFR
stringToMPFR_ :: RoundMode -> Precision -> Word -> String -> (MPFR, Int)
strtofr :: RoundMode -> Precision -> Word -> String -> (MPFR, String)
strtofr_ :: RoundMode -> Precision -> Word -> String -> (MPFR, String, Int)
setInf :: Precision -> Int -> MPFR
setNaN :: Precision -> MPFR
fromIntegerA :: RoundMode -> Precision -> Integer -> MPFR
bitsInInteger :: (Num a) => Integer -> a
compose :: RoundMode -> Precision -> (Integer, Int) -> MPFR

-- | <a>stringToMPFR</a> with default rounding to Near.
fromString :: String -> Precision -> Word -> MPFR


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Miscellaneous-Functions</a>.
module Data.Number.MPFR.Misc
nextToward :: MPFR -> MPFR -> MPFR
nextAbove :: MPFR -> MPFR
nextBelow :: MPFR -> MPFR
maxD :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
minD :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
newRandomStatePointer :: Ptr GmpRandState
urandomb :: Ptr GmpRandState -> Precision -> MPFR
getExp :: MPFR -> Exp
setExp :: MPFR -> Exp -> MPFR
signbit :: MPFR -> Bool
maxD_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
minD_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
getPrec :: MPFR -> Precision

-- | getMantissa and getExp return values such that
--   
--   <pre>
--   d = getMantissa d * 2^(getExp d - ceiling ((getPrec d) / bitsPerMPLimb)* bitsPerMPLimb )
--   </pre>
--   
--   In case of <tt>0</tt>, <tt>NaN</tt> or <tt>+-Inf</tt> getMantissa will
--   return <tt>0</tt>
getMantissa :: MPFR -> Integer
one :: MPFR
zero :: MPFR
maxPrec :: MPFR -> MPFR -> Precision


-- | Conversion from basic MPFR back to basic Haskell types. See
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Conversion-Functions</a>
--   for documentation on particular functions.
module Data.Number.MPFR.Conversion
toDouble :: RoundMode -> MPFR -> Double
toDouble2exp :: RoundMode -> MPFR -> (Double, Int)
toInt :: RoundMode -> MPFR -> Int
toWord :: RoundMode -> MPFR -> Word
mpfrToString :: RoundMode -> Word -> Word -> MPFR -> (String, Exp)
fitsULong :: RoundMode -> MPFR -> Bool
fitsSLong :: RoundMode -> MPFR -> Bool
fitsUInt :: RoundMode -> MPFR -> Bool
fitsSInt :: RoundMode -> MPFR -> Bool
fitsUShort :: RoundMode -> MPFR -> Bool
fitsSShort :: RoundMode -> MPFR -> Bool
decompose :: MPFR -> (Integer, Exp)

-- | Output a string in base 10 rounded to Near in exponential form.
toStringExp :: Word -> MPFR -> String

-- | Output a string in base 10 rounded to Near. The difference from
--   <tt>toStringExp</tt> is that it won't output in exponential form if it
--   is sensible to do so.
toString :: Word -> MPFR -> String
instance GHC.Show.Show Data.Number.MPFR.FFIhelper.MPFR

module Data.Number.MPFR.Mutable.Internal
withMutableMPFRBA :: (Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFR1 :: (Integral a, Integral b) => (Ptr MPFR -> Ptr MPFR -> a -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> b -> RoundMode -> ST s Int
withMutableMPFR2 :: (Integral a, Integral b) => (Ptr MPFR -> a -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> b -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFRS :: (Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFRUI :: (Integral a, Integral b) => (Ptr MPFR -> a -> CRoundMode -> IO CInt) -> MMPFR s -> b -> RoundMode -> ST s Int
withMutableMPFRd :: (Ptr MPFR -> Ptr MPFR -> CDouble -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> Double -> RoundMode -> ST s Int
withMutableMPFRd' :: (Ptr MPFR -> CDouble -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> Double -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFRBA3 :: (Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFRSC :: (Ptr MPFR -> Ptr MPFR -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
withMutableMPFRSNR :: (Ptr MPFR -> Ptr MPFR -> IO CInt) -> MMPFR s -> MMPFR s -> ST s Int
withMutableMPFRSNRNR :: (Ptr MPFR -> IO ()) -> MMPFR s -> ST s ()
withMutableMPFRP :: (Ptr MPFR -> IO CInt) -> MMPFR s -> ST s Int
withMutableMPFRB :: (Ptr MPFR -> Ptr MPFR -> IO CInt) -> MMPFR s -> MMPFR s -> ST s Int

-- | Replace the state of the mutable MPFR with a new one. The actual limbs
--   are not copied, so any further modifications on the mutable MPFR will
--   reflect on the MPFR given in as the second argument.
unsafeWriteMMPFR :: MMPFR s -> MPFR -> ST s ()

-- | Convert a mutable MPFR to an immutable one. The unsafe prefix comes
--   from the fact that limbs of the MPFR are not copied so any further
--   modifications on the mutable MPFR will reflect on the "frozen" one. If
--   mutable MPFR will not be modified afterwards, it is perfectly safe to
--   use.
unsafeFreeze :: MMPFR s -> ST s MPFR

-- | Convert an immutable MPFR to a mutable one. The unsafe prefix comes
--   from the fact that limbs of the MPFR are not copied so any
--   modifications done on on the mutable MPFR will reflect on the
--   original. If the original will not be used or limbs of the mutable not
--   modified, then it is safe to use.
unsafeThaw :: MPFR -> ST s (MMPFR s)

-- | Replace the state of the mutable MPFR with a new one, making a
--   complete copy.
writeMMPFR :: MMPFR s -> MPFR -> ST s ()

-- | Convert a mutable MPFR to an immutable one, making a complete copy.
freeze :: MMPFR s -> ST s MPFR

-- | Convert an immutable MPFR to a mutable one, making a complete copy.
thaw :: MPFR -> ST s (MMPFR s)

-- | A mutable MPFR. Currently this is just a newtype wrapped STRef to a
--   MPFR but this may change in the future for a more efficient
--   implementation. Type argument <tt>s</tt> is the state variable
--   argument for the <tt>ST</tt> type.
data MMPFR s
instance GHC.Classes.Eq (Data.Number.MPFR.Mutable.Internal.MMPFR s)


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-chttp://www.mpfr.org/mpfr-current/mpfr.html#Integer-Related-Functions</a>
module Data.Number.MPFR.Mutable.Integer
rint :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
ceil :: MMPFR s -> MMPFR s -> ST s Int
floor :: MMPFR s -> MMPFR s -> ST s Int
round :: MMPFR s -> MMPFR s -> ST s Int
trunc :: MMPFR s -> MMPFR s -> ST s Int
rintCeil :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
rintFloor :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
rintRound :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
rintTrunc :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
modf :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
frac :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
fmod :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
remainder :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Basic-Arithmetic-Functions</a>.
module Data.Number.MPFR.Mutable.Arithmetic
add :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
addw :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
addi :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
addd :: MMPFR s -> MMPFR s -> Double -> RoundMode -> ST s Int
sub :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
subw :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
subi :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
subd :: MMPFR s -> MMPFR s -> Double -> RoundMode -> ST s Int
wsub :: MMPFR s -> Word -> MMPFR s -> RoundMode -> ST s Int
isub :: MMPFR s -> Int -> MMPFR s -> RoundMode -> ST s Int
dsub :: MMPFR s -> Double -> MMPFR s -> RoundMode -> ST s Int
mul :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
mulw :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
muli :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
muld :: MMPFR s -> MMPFR s -> Double -> RoundMode -> ST s Int
sqr :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
div :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
divw :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
divi :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
divd :: MMPFR s -> MMPFR s -> Double -> RoundMode -> ST s Int
wdiv :: MMPFR s -> Word -> MMPFR s -> RoundMode -> ST s Int
idiv :: MMPFR s -> Int -> MMPFR s -> RoundMode -> ST s Int
ddiv :: MMPFR s -> Double -> MMPFR s -> RoundMode -> ST s Int
sqrt :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sqrtw :: MMPFR s -> Word -> RoundMode -> ST s Int
recSqrt :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
cbrt :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
root :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
pow :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
poww :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
powi :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
wpow :: MMPFR s -> Word -> MMPFR s -> RoundMode -> ST s Int
neg :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
absD :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
dim :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
mul2w :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
mul2i :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int
div2w :: MMPFR s -> MMPFR s -> Word -> RoundMode -> ST s Int
div2i :: MMPFR s -> MMPFR s -> Int -> RoundMode -> ST s Int


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Miscellaneous-Functions</a>.
module Data.Number.MPFR.Mutable.Misc
nextAbove :: MMPFR s -> ST s ()
nextbelow :: MMPFR s -> ST s ()
max :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
min :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
getExp :: MMPFR s -> ST s Exp
getPrec :: MMPFR s -> ST s Precision


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Special-Functions</a>.
module Data.Number.MPFR.Mutable.Special
log :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
log2 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
log10 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
exp :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
exp2 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
exp10 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sin :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
cos :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
tan :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sec :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
csc :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
cot :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sincos :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
asin :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
acos :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
atan :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
atan2 :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sinh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
cosh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
tanh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sinhcosh :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
sech :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
csch :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
coth :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
asinh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
acosh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
atanh :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
facw :: MMPFR s -> Word -> RoundMode -> ST s Int
log1p :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
expm1 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
eint :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
li2 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
gamma :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
lngamma :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
digamma :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
zeta :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
zetaw :: MMPFR s -> Word -> RoundMode -> ST s Int
erf :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
erfc :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
j0 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
j1 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
jn :: MMPFR s -> Word -> MMPFR s -> RoundMode -> ST s Int
y0 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
y1 :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int
yn :: MMPFR s -> Word -> MMPFR s -> RoundMode -> ST s Int
fma :: MMPFR s -> MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
fms :: MMPFR s -> MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
agm :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int
hypot :: MMPFR s -> MMPFR s -> MMPFR s -> RoundMode -> ST s Int


-- | This module provides a "mutable" interface to the MPFR library.
--   Functions i this module should have very little overhead over the
--   original <tt>C</tt> functions.
--   
--   Type signatures of functions should be self-explanatory. Order of
--   arguments is identical to the one in <tt>C</tt> functions. See MPFR
--   manual for documentation on particular functions.
--   
--   All operations are performed in the <tt>ST</tt> monad so safe
--   transition between mutable and immutable interface is possible with
--   <tt>runST</tt>. For example mutable interface could be used in inner
--   loops or in local calculations with temporary variables, helping
--   reduce allocation overhead of the pure interface.
module Data.Number.MPFR.Mutable

-- | A mutable MPFR. Currently this is just a newtype wrapped STRef to a
--   MPFR but this may change in the future for a more efficient
--   implementation. Type argument <tt>s</tt> is the state variable
--   argument for the <tt>ST</tt> type.
data MMPFR s

-- | Convert an immutable MPFR to a mutable one, making a complete copy.
thaw :: MPFR -> ST s (MMPFR s)

-- | Replace the state of the mutable MPFR with a new one, making a
--   complete copy.
writeMMPFR :: MMPFR s -> MPFR -> ST s ()

-- | Convert a mutable MPFR to an immutable one, making a complete copy.
freeze :: MMPFR s -> ST s MPFR

-- | Convert an immutable MPFR to a mutable one. The unsafe prefix comes
--   from the fact that limbs of the MPFR are not copied so any
--   modifications done on on the mutable MPFR will reflect on the
--   original. If the original will not be used or limbs of the mutable not
--   modified, then it is safe to use.
unsafeThaw :: MPFR -> ST s (MMPFR s)

-- | Replace the state of the mutable MPFR with a new one. The actual limbs
--   are not copied, so any further modifications on the mutable MPFR will
--   reflect on the MPFR given in as the second argument.
unsafeWriteMMPFR :: MMPFR s -> MPFR -> ST s ()

-- | Convert a mutable MPFR to an immutable one. The unsafe prefix comes
--   from the fact that limbs of the MPFR are not copied so any further
--   modifications on the mutable MPFR will reflect on the "frozen" one. If
--   mutable MPFR will not be modified afterwards, it is perfectly safe to
--   use.
unsafeFreeze :: MMPFR s -> ST s MPFR


-- | For documentation on particular functions see
--   <a>http://www.mpfr.org/mpfr-current/mpfr.html#Special-Functions</a>.
module Data.Number.MPFR.Special
log :: RoundMode -> Precision -> MPFR -> MPFR
log2 :: RoundMode -> Precision -> MPFR -> MPFR
log10 :: RoundMode -> Precision -> MPFR -> MPFR
exp :: RoundMode -> Precision -> MPFR -> MPFR
exp2 :: RoundMode -> Precision -> MPFR -> MPFR
exp10 :: RoundMode -> Precision -> MPFR -> MPFR
sin :: RoundMode -> Precision -> MPFR -> MPFR
cos :: RoundMode -> Precision -> MPFR -> MPFR
tan :: RoundMode -> Precision -> MPFR -> MPFR
sec :: RoundMode -> Precision -> MPFR -> MPFR
csc :: RoundMode -> Precision -> MPFR -> MPFR
cot :: RoundMode -> Precision -> MPFR -> MPFR
sincos :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR)
asin :: RoundMode -> Precision -> MPFR -> MPFR
acos :: RoundMode -> Precision -> MPFR -> MPFR
atan :: RoundMode -> Precision -> MPFR -> MPFR
atan2 :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
sinh :: RoundMode -> Precision -> MPFR -> MPFR
cosh :: RoundMode -> Precision -> MPFR -> MPFR
tanh :: RoundMode -> Precision -> MPFR -> MPFR
sinhcosh :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR)
sech :: RoundMode -> Precision -> MPFR -> MPFR
csch :: RoundMode -> Precision -> MPFR -> MPFR
coth :: RoundMode -> Precision -> MPFR -> MPFR
acosh :: RoundMode -> Precision -> MPFR -> MPFR
asinh :: RoundMode -> Precision -> MPFR -> MPFR
atanh :: RoundMode -> Precision -> MPFR -> MPFR
facw :: RoundMode -> Precision -> Word -> MPFR
log1p :: RoundMode -> Precision -> MPFR -> MPFR
expm1 :: RoundMode -> Precision -> MPFR -> MPFR
eint :: RoundMode -> Precision -> MPFR -> MPFR
li2 :: RoundMode -> Precision -> MPFR -> MPFR
gamma :: RoundMode -> Precision -> MPFR -> MPFR
lngamma :: RoundMode -> Precision -> MPFR -> MPFR
lgamma :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
digamma :: RoundMode -> Precision -> MPFR -> MPFR
zeta :: RoundMode -> Precision -> MPFR -> MPFR
zetaw :: RoundMode -> Precision -> Word -> MPFR
erf :: RoundMode -> Precision -> MPFR -> MPFR
erfc :: RoundMode -> Precision -> MPFR -> MPFR
j0 :: RoundMode -> Precision -> MPFR -> MPFR
j1 :: RoundMode -> Precision -> MPFR -> MPFR
jn :: RoundMode -> Precision -> Int -> MPFR -> MPFR
y0 :: RoundMode -> Precision -> MPFR -> MPFR
y1 :: RoundMode -> Precision -> MPFR -> MPFR
yn :: RoundMode -> Precision -> Int -> MPFR -> MPFR
fma :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR -> MPFR
fms :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR -> MPFR
agm :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
hypot :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR
pi :: RoundMode -> Precision -> MPFR
log2c :: RoundMode -> Precision -> MPFR
euler :: RoundMode -> Precision -> MPFR
catalan :: RoundMode -> Precision -> MPFR
log_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
log2_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
log10_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
exp_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
exp2_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
exp10_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
sin_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
cos_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
tan_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
sec_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
csc_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
cot_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
sincos_ :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR, Int)
asin_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
acos_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
atan_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
atan2_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
sinh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
cosh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
tanh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
sinhcosh_ :: RoundMode -> Precision -> Precision -> MPFR -> (MPFR, MPFR, Int)
sech_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
csch_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
coth_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
acosh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
asinh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
atanh_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
facw_ :: RoundMode -> Precision -> Word -> (MPFR, Int)
log1p_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
expm1_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
eint_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
li2_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
gamma_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
lngamma_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
lgamma_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int, Int)
digamma_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
zeta_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
zetaw_ :: RoundMode -> Precision -> Word -> (MPFR, Int)
erf_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
erfc_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
j0_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
j1_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
jn_ :: RoundMode -> Precision -> Int -> MPFR -> (MPFR, Int)
y0_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
y1_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int)
yn_ :: RoundMode -> Precision -> Int -> MPFR -> (MPFR, Int)
fma_ :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR -> (MPFR, Int)
fms_ :: RoundMode -> Precision -> MPFR -> MPFR -> MPFR -> (MPFR, Int)
agm_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
hypot_ :: RoundMode -> Precision -> MPFR -> MPFR -> (MPFR, Int)
pi_ :: RoundMode -> Precision -> (MPFR, Int)
log2c_ :: RoundMode -> Precision -> (MPFR, Int)
euler_ :: RoundMode -> Precision -> (MPFR, Int)
catalan_ :: RoundMode -> Precision -> (MPFR, Int)
freeCache :: IO ()


-- | This module defines instances <a>Num</a>, <a>Real</a>,
--   <a>Fractional</a>, <a>Floating</a> and <a>RealFrac</a> of <a>MPFR</a>.
--   Operations are rounded with <a>RoundMode</a> <a>Zero</a> and computed
--   with maximum precision of two operands or with the precision of the
--   operand.
module Data.Number.MPFR.Instances.Zero
instance GHC.Num.Num Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Real Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Fractional Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.Floating Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.RealFrac Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.RealFloat Data.Number.MPFR.FFIhelper.MPFR


-- | This module defines instances <a>Num</a>, <a>Real</a>,
--   <a>Fractional</a>, <a>Floating</a> and <a>RealFrac</a> of <a>MPFR</a>.
--   Operations are rounded with <a>RoundMode</a> <a>Up</a> and computed
--   with maximum precision of two operands or with the precision of the
--   operand.
module Data.Number.MPFR.Instances.Up
instance GHC.Num.Num Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Real Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Fractional Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.Floating Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.RealFrac Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.RealFloat Data.Number.MPFR.FFIhelper.MPFR


-- | This module defines instances <a>Num</a>, <a>Real</a>,
--   <a>Fractional</a>, <a>Floating</a> and <a>RealFrac</a> of <a>MPFR</a>.
--   Operations are rounded with <a>RoundMode</a> <a>Near</a> and computed
--   with maximum precision of two operands or with the precision of the
--   operand.
module Data.Number.MPFR.Instances.Near
instance GHC.Num.Num Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Real Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Fractional Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.Floating Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.RealFrac Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.RealFloat Data.Number.MPFR.FFIhelper.MPFR


-- | This module defines instances <a>Num</a>, <a>Real</a>,
--   <a>Fractional</a>, <a>Floating</a> and <a>RealFrac</a> of <a>MPFR</a>.
--   Operations are rounded with <a>RoundMode</a> <a>Down</a> and computed
--   with maximum precision of two operands or with the precision of the
--   operand.
module Data.Number.MPFR.Instances.Down
instance GHC.Num.Num Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Real Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.Fractional Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.Floating Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Real.RealFrac Data.Number.MPFR.FFIhelper.MPFR
instance GHC.Float.RealFloat Data.Number.MPFR.FFIhelper.MPFR


-- | This module exports a pure interface to the MPFR library functions.
--   Functions return new <a>MPFR</a> structures instead of modifying
--   existing ones and so all functions which produce a new MPFR structure
--   take one more parameter than their original <tt>C</tt> counterparts.
--   This parameter, <a>Precision</a>, is the precision of the resulting
--   <a>MPFR</a>.
--   
--   This is naturally slower than modifying in-place, especially when
--   dealing with lower precisions, so a "mutable" interface is provided in
--   <a>Data.Number.MPFR.Mutable</a> module.
--   
--   <i>Naming conventions</i>
--   
--   <ul>
--   <li>functions ending with _ (underscore) usually return a pair
--   <tt>(<a>MPFR</a>, <a>Int</a>)</tt>, where <a>Int</a> is a return value
--   of a corresponding <tt>mpfr_</tt> function. See the MPFR manual for a
--   description of return values.</li>
--   <li>the same functions without the _ return just the <a>MPFR</a>.</li>
--   <li><tt>mpfr_</tt> prefix in functions is removed</li>
--   <li><tt>_ui</tt> and <tt>ui_</tt> in function becomes <tt>w</tt>
--   (stands for <a>Word</a>). For example <tt>mpfr_sub_ui</tt> becomes
--   <tt><a>subw</a></tt> and <tt>mpfr_ui_sub</tt> becomes
--   <a>wsub</a>.</li>
--   <li><tt>si_</tt> and <tt>_si</tt> in functions becomes <tt>i</tt>
--   (stands for <a>Int</a>). For example <tt>mpfr_sub_si</tt> becomes
--   <tt><a>subi</a></tt> and <tt>mpfr_si_sub</tt> becomes
--   <a>isub</a>.</li>
--   <li>comparison functions which have <tt>_p</tt> appended loose it. For
--   example <tt>mpfr_less_p</tt> becomes <tt><a>less</a></tt>.</li>
--   </ul>
--   
--   <i>Instances</i>
--   
--   <ul>
--   <li><i><tt><a>Eq</a></tt></i> <ul><li>NaN /= NaN,</li><li>Infinity =
--   Infinity,</li><li>-Infinity = -Infinity</li><li>otherwise normal
--   comparison</li></ul></li>
--   <li><i><tt><a>Ord</a></tt></i></li>
--   </ul>
--   
--   <ul>
--   <li>compare NaN _ = <a>GT</a></li>
--   <li>compare _ NaN = <a>GT</a></li>
--   <li>infinity &lt; _ = <a>False</a></li>
--   <li>-infinity &gt; _ = <a>False</a></li>
--   <li>NaN [&lt;,&gt;,&gt;=,&lt;=] _ = <a>False</a></li>
--   </ul>
--   
--   This mimics the behaviour of built in Haskell <a>Float</a> and
--   <a>Double</a>.
--   
--   If you need instances of numeric typeclasses import one of the
--   Data.Number.MPFR.Instances.* modules.
module Data.Number.MPFR
data RoundMode
Near :: RoundMode
Zero :: RoundMode
Up :: RoundMode
Down :: RoundMode
data MPFR
data Precision
type Exp = Int64
type MpSize = Int64
