atrophy-0.1.0.0: Faster integer division and modulus operations
Safe HaskellNone
LanguageHaskell2010

Atrophy

Documentation

newtype NonZero a Source #

Constructors

NonZero a 

Instances

Instances details
(Bounded a, Num a) => Bounded (NonZero a) Source # 
Instance details

Defined in Atrophy.Internal

Num a => Num (NonZero a) Source # 
Instance details

Defined in Atrophy.Internal

Methods

(+) :: NonZero a -> NonZero a -> NonZero a #

(-) :: NonZero a -> NonZero a -> NonZero a #

(*) :: NonZero a -> NonZero a -> NonZero a #

negate :: NonZero a -> NonZero a #

abs :: NonZero a -> NonZero a #

signum :: NonZero a -> NonZero a #

fromInteger :: Integer -> NonZero a #

Show a => Show (NonZero a) Source # 
Instance details

Defined in Atrophy.Internal

Methods

showsPrec :: Int -> NonZero a -> ShowS #

show :: NonZero a -> String #

showList :: [NonZero a] -> ShowS #

isPowerOf2 :: (Bits a, Num a) => a -> Bool Source #

divRem64 :: (HasField "divisor" strRed a, HasField "multiplier" strRed Word128, Integral a, FiniteBits a) => a -> strRed -> (a, a) Source #

divRem :: forall strRed a b. (HasField "divisor" strRed a, HasField "multiplier" strRed b, Integral a, FiniteBits a, Integral b, FiniteBits (Half b), Bits b) => a -> strRed -> (a, a) Source #

new :: (Bits t, Integral t, Bounded (Multiplier t), Integral (Multiplier t)) => (Multiplier t -> t -> a) -> NonZero t -> a Source #

div64 :: (HasField "divisor" r b, HasField "multiplier" r Word128, Integral b, FiniteBits b) => b -> r -> b Source #

rem64 :: (HasField "divisor" r b, HasField "multiplier" r Word128, Integral b, FiniteBits b) => b -> r -> b Source #

div' :: (HasField "divisor" strRed b, HasField "multiplier" strRed w, Integral b, FiniteBits b, Integral w, FiniteBits (Half w), Bits w) => b -> strRed -> b Source #

rem' :: (HasField "divisor" strRed b, HasField "multiplier" strRed w, Integral b, FiniteBits b, Integral w, FiniteBits (Half w), Bits w) => b -> strRed -> b Source #

lowerHalf :: forall w. (FiniteBits (Half w), Bits w) => w -> w Source #

upperHalf :: forall w. (Bits w, FiniteBits (Half w)) => w -> w Source #

type family Half a where ... Source #