1 -- | Functions for comparing 'Double' values.
5 -- | epsilon is the value that will be used in all tests that require
6 -- some measure of \"closeness.\" Increasing it will make those
7 -- tests more tolerant.
12 -- | x almost equals y if x is within 'epsilon' of y.
13 almost_equals :: Double -> Double -> Bool
14 almost_equals x y = (abs (x - y)) < epsilon
17 (~=) :: Double -> Double -> Bool
21 -- | x is very positive if it is 'epsilon' greater than zero.
22 very_positive :: Double -> Bool
23 very_positive x = x - epsilon > 0
26 -- | Takes a list of 'Double' and returns the ones which are not very
28 non_very_positive_entries :: [Double] -> [Double]
29 non_very_positive_entries = filter (not . very_positive)