Copyright | (C) 2012-2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Testing for values "near" zero
Documentation
class Num a => Epsilon a where Source #
Provides a fairly subjective test to see if a quantity is near zero.
>>>
nearZero (1e-11 :: Double)
False
>>>
nearZero (1e-17 :: Double)
True
>>>
nearZero (1e-5 :: Float)
False
>>>
nearZero (1e-7 :: Float)
True
Instances
Epsilon Double Source # |
|
Epsilon Float Source # |
|
Epsilon CFloat Source # |
|
Epsilon CDouble Source # |
|
(Epsilon a, RealFloat a) => Epsilon (Complex a) Source # | |
Epsilon a => Epsilon (V1 a) Source # | |
Epsilon a => Epsilon (V2 a) Source # | |
Epsilon a => Epsilon (V3 a) Source # | |
Epsilon a => Epsilon (V4 a) Source # | |
Epsilon (V0 a) Source # | |
(RealFloat a, Epsilon a) => Epsilon (Quaternion a) Source # | |
Defined in Linear.Quaternion nearZero :: Quaternion a -> Bool Source # | |
Epsilon a => Epsilon (Plucker a) Source # | |
Epsilon (f a) => Epsilon (Point f a) Source # | |
(Dim n, Epsilon a) => Epsilon (V n a) Source # | |