sparse-linear-algebra-0.2.9.2: Numerical computation in native Haskell

Copyright (C) 2016 Marco Zocca 2012-2015 Edward Kmett GPL-3 (see LICENSE) zocca.marco gmail provisional portable Safe Haskell2010

Numeric.Eps

Description

Testing for values "near" zero

Synopsis

# Documentation

class (Floating a, Num a) => Epsilon a where Source #

Provides a 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 Source #

Determine if a quantity is near zero.

Instances

 Source # abs a <= 1e-12 Methods Source # abs a <= 1e-6 Methods Source # abs a <= 1e-6 Methods Source # abs a <= 1e-12 Methods Source # Methods Source # Complex types Methods Source # Methods Source # Methods

isNz :: Epsilon a => a -> Bool Source #

Rounding rule

roundZero :: Epsilon a => a -> a Source #

roundOne :: Epsilon a => a -> a Source #

roundZeroOne :: Epsilon a => a -> a Source #

Round to respectively 0 or 1

nearOne :: Epsilon a => a -> Bool Source #

Rounding rule