Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
ExplicitRounding defines the ExplicitRounding class and instances for some more common numeric types
Synopsis
- class (Ord a, Num a) => ExplicitRounding a
- eps :: ExplicitRounding a => a -> a
- prev :: ExplicitRounding a => a -> a
- next :: ExplicitRounding a => a -> a
- (+/) :: ExplicitRounding a => a -> a -> a
- (+\) :: ExplicitRounding a => a -> a -> a
- (-/) :: ExplicitRounding a => a -> a -> a
- (-\) :: ExplicitRounding a => a -> a -> a
- (*/) :: ExplicitRounding a => a -> a -> a
- (*\) :: ExplicitRounding a => a -> a -> a
Documentation
class (Ord a, Num a) => ExplicitRounding a Source #
The class of numeric values that can be rounded explicitly
Instances
ExplicitRounding Double Source # | |
Defined in Numeric.AffineForm.ExplicitRounding eps :: Double -> Double Source # prev :: Double -> Double Source # next :: Double -> Double Source # (+/) :: Double -> Double -> Double Source # (+\) :: Double -> Double -> Double Source # (-/) :: Double -> Double -> Double Source # (-\) :: Double -> Double -> Double Source # | |
ExplicitRounding Float Source # | |
Defined in Numeric.AffineForm.ExplicitRounding | |
ExplicitRounding Int Source # | |
Defined in Numeric.AffineForm.ExplicitRounding | |
(Integral a, ExplicitRounding a) => ExplicitRounding (Ratio a) Source # | |
Defined in Numeric.AffineForm.ExplicitRounding eps :: Ratio a -> Ratio a Source # prev :: Ratio a -> Ratio a Source # next :: Ratio a -> Ratio a Source # (+/) :: Ratio a -> Ratio a -> Ratio a Source # (+\) :: Ratio a -> Ratio a -> Ratio a Source # (-/) :: Ratio a -> Ratio a -> Ratio a Source # (-\) :: Ratio a -> Ratio a -> Ratio a Source # |
eps :: ExplicitRounding a => a -> a Source #
Return some number so that all the values that could be rounded to the parameter of this function would be at most that distance away from that parameter.
prev :: ExplicitRounding a => a -> a Source #
Returns parameter plus its epsilon
next :: ExplicitRounding a => a -> a Source #
Returns parameter minus its epsilon
(+/) :: ExplicitRounding a => a -> a -> a Source #
Add the two values, rounding the result up
(+\) :: ExplicitRounding a => a -> a -> a Source #
Add the two values, rounding the result down
(-/) :: ExplicitRounding a => a -> a -> a Source #
Subtract the two values, rounding the result up
(-\) :: ExplicitRounding a => a -> a -> a Source #
Subtract the two values, rounding the result down
(*/) :: ExplicitRounding a => a -> a -> a Source #
Multiply the two values, rounding the result up
(*\) :: ExplicitRounding a => a -> a -> a Source #
Multiply the two values, rounding the result down