packages feed

intervals 0.5.1 → 0.5.1.1

raw patch · 3 files changed

+16/−8 lines, 3 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,11 @@+0.5.1.1+-------+* Misc `doctest` fixes.++0.5.1+-----+* Added `interval` to facilitate the construction of known non-empty intervals.+ 0.5 --- * The default `Numeric.Interval` now deals more conventionally with empty intervals.
intervals.cabal view
@@ -1,5 +1,5 @@ name:              intervals-version:           0.5.1+version:           0.5.1.1 synopsis:          Interval Arithmetic description:   A 'Numeric.Interval.Interval' is a closed, convex set of floating point values.
src/Numeric/Interval/Internal.hs view
@@ -115,7 +115,7 @@ -- -- >>> empty -- Empty-empty :: Fractional a => Interval a+empty :: Ord a => Interval a empty = Empty {-# INLINE empty #-} @@ -144,8 +144,8 @@  -- | The infinumum (lower bound) of an interval ----- >>> inf (1 ... 20)--- 1+-- >>> inf (1.0 ... 20.0)+-- 1.0 inf :: Fractional a => Interval a -> a inf (I a _) = a inf Empty = nan@@ -153,8 +153,8 @@  -- | The supremum (upper bound) of an interval ----- >>> sup (1 ... 20)--- 20+-- >>> sup (1.0 ... 20.0)+-- 20.0 sup :: Fractional a => Interval a -> a sup (I _ b) = b sup Empty = nan@@ -271,8 +271,8 @@ -- >>> bisect (singleton 5.0) -- (5.0 ... 5.0,5.0 ... 5.0) ----- >>> bisect empty--- (NaN ... NaN,NaN ... NaN)+-- >>> bisect Empty+-- (Empty,Empty) bisect :: Fractional a => Interval a -> (Interval a, Interval a) bisect Empty = (Empty,Empty) bisect (I a b) = (I a m, I m b) where m = a + (b - a) / 2