ieee-0.5: Approximate comparisons for IEEE floating point numbersSource codeContentsIndex
Data.AEq
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
A type class for approximate and exact equalilty comparisons and instances for common data types.
Documentation
class Eq a => AEq a whereSource
Methods
(===) :: a -> a -> BoolSource
A reliable way to test if two values are exactly equal. For floating point values, this will consider NaN to be (===) to NaN.
(~==) :: a -> a -> BoolSource
An approximate equality comparison operator. For RealFloat values, (~==) x y = (x == y) || (abs (x - y) < epsilon) || (eqRel delta x y) || (isNaN x && isNaN y). For Complex numbers, the if the real and imaginary parts are not approximately equal, the polar forms are compared, instead.
show/hide Instances
Produced by Haddock version 2.4.2