ireal-0.1: Real numbers and intervals with not so inefficient exact arithmetic.

Safe HaskellNone
LanguageHaskell98

Data.Number.IReal.IRealOperations

Synopsis

Documentation

(+-) :: Rational -> Rational -> IReal infix 6 Source

Constructs an interval from midpoint and radius.

(-+-) :: IReal -> IReal -> IReal infix 6 Source

Constructs an interval from end points (which can be given in any order).

lower :: IReal -> IReal Source

Returns left end point of argument.

rad :: IReal -> IReal Source

Returns radius of argument.

mid :: IReal -> IReal Source

Returns midpoint of argument.

upper :: IReal -> IReal Source

Returns right end point of argument.

hull :: [IReal] -> IReal Source

Convex hull of a list of intervals.

containedIn :: IReal -> IReal -> Precision -> Bool Source

Tests whether first arg is contained in second, using total tests of given precision.

intersection :: IReal -> IReal -> Maybe IReal Source

Intersection of intervals; empty intersection gives Nothing

(=?=) :: IReal -> IReal -> Precision -> Bool infix 3 Source

Total, approximate equality test. If x =?= y atDecimals d returns False, then x and y are definitely not equal. If it returns True, then the absolute value of their difference is less than 10^(-d) (but they may be non-equal).

(<!) :: IReal -> IReal -> Precision -> Bool infix 3 Source

Total, approximate inequality test. If x <! y atDecimals d returns True, then x is definitely smaller than y, If it returns False, x may still be smaller than y, but their difference is then at most 10^(-d).

(>!) :: IReal -> IReal -> Precision -> Bool infix 3 Source

x >! y is the same as y <! x.

(?) :: IReal -> Int -> IO () infix 3 Source

Prints an IReal with given number of decimals. Rounding error is up to one unit in the last position.

(??) :: IReal -> Int -> IO () infix 3 Source

Prints an IReal in scientific notation with given number of digits. Rounding error is up to one unit in the last position.

force :: Int -> IReal -> IReal Source

Forces evaluation of second argument to given number of decimals; returns second argument.

powerSeries :: (Num a1, Integral a, Enum a1) => (Integer -> a1 -> Integer) -> Integer -> (Int -> a) -> IReal -> IReal Source