hafar-0.1.0.0: Affine arithmetic library for Haskell

Safe HaskellSafe
LanguageHaskell2010

Numeric.AffineForm.ExplicitRounding

Description

ExplicitRounding defines the ExplicitRounding class and instances for some more common numeric types

Synopsis

Documentation

class (Ord a, Num a) => ExplicitRounding a Source #

The class of numeric values that can be rounded explicitly

Minimal complete definition

eps

Instances
ExplicitRounding Double Source # 
Instance details

Defined in Numeric.AffineForm.ExplicitRounding

ExplicitRounding Float Source # 
Instance details

Defined in Numeric.AffineForm.ExplicitRounding

ExplicitRounding Int Source # 
Instance details

Defined in Numeric.AffineForm.ExplicitRounding

Methods

eps :: Int -> Int Source #

prev :: Int -> Int Source #

next :: Int -> Int Source #

(+/) :: Int -> Int -> Int Source #

(+\) :: Int -> Int -> Int Source #

(-/) :: Int -> Int -> Int Source #

(-\) :: Int -> Int -> Int Source #

(*/) :: Int -> Int -> Int Source #

(*\) :: Int -> Int -> Int Source #

(Integral a, ExplicitRounding a) => ExplicitRounding (Ratio a) Source # 
Instance details

Defined in Numeric.AffineForm.ExplicitRounding

Methods

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 #

(*/) :: 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