linear-1.20.7: Linear Algebra

Copyright (C) 2012-2015 Edward Kmett BSD-style (see the file LICENSE) Edward Kmett provisional portable Safe Haskell98

Linear.Epsilon

Description

Testing for values "near" zero

Synopsis

# Documentation

class Num a => Epsilon a where #

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


Minimal complete definition

nearZero

Methods

nearZero :: a -> Bool #

Determine if a quantity is near zero.

Instances

 # abs a <= 1e-12 Methods # abs a <= 1e-6 Methods # abs a <= 1e-6 Methods # abs a <= 1e-12 Methods Epsilon (V0 a) # MethodsnearZero :: V0 a -> Bool # Epsilon a => Epsilon (V1 a) # MethodsnearZero :: V1 a -> Bool # Epsilon a => Epsilon (V2 a) # MethodsnearZero :: V2 a -> Bool # Epsilon a => Epsilon (V3 a) # MethodsnearZero :: V3 a -> Bool # Epsilon a => Epsilon (V4 a) # MethodsnearZero :: V4 a -> Bool # Epsilon a => Epsilon (Plucker a) # MethodsnearZero :: Plucker a -> Bool # (RealFloat a, Epsilon a) => Epsilon (Quaternion a) # MethodsnearZero :: Quaternion a -> Bool # Epsilon (f a) => Epsilon (Point f a) # MethodsnearZero :: Point f a -> Bool # (Dim k n, Epsilon a) => Epsilon (V k n a) # MethodsnearZero :: V k n a -> Bool #