nums-1.0.0: Handy common number functions

Safe HaskellSafe-Inferred

Nums.Fractionals

Synopsis

Documentation

towardZero :: (Integral b, RealFrac a) => a -> bSource

Round toward zero (truncate).

towardInf :: (Integral b, RealFrac a) => a -> bSource

Round upwards (ceiling).

towardNegInf :: (Integral b, RealFrac a) => a -> bSource

Round backwards (floor).

awayFromZero :: (Integral b, RealFrac a) => a -> bSource

Round away from zero (ceiling if positive, floor otherwise).

nearestTowardZero :: (Integral b, RealFrac a) => a -> bSource

Round torwards zero (if half go towards zero, otherwise up to 1).

nearestTowardInf :: (Integral b, RealFrac a) => a -> bSource

Same as nearestTowardZero but to infinity instead of zero.

nearestTowardNegInf :: (Integral b, RealFrac a) => a -> bSource

Same as nearestTowardZero but towards negative instead of zero.

nearestAwayFromZero :: (Integral b, RealFrac a) => a -> bSource

Same as nearestTowardZero but rounds away from zero (by positive or negative).

nearestBanker :: (Integral b, RealFrac a) => a -> bSource

Round up (round).

isHalf :: RealFrac a => a -> BoolSource

Is a number x.5?