clash-prelude-1.8.1: Clash: a functional hardware description language - Prelude library
Safe HaskellNone
LanguageHaskell2010

Clash.Num.Saturating

Synopsis

Documentation

data Saturating a Source #

A saturating number type is one where all operations saturate at the bounds of the underlying type, i.e. operations which overflow return maxBound and operations that underflow return minBound.

Numbers can be converted to saturate by default using toSaturating.

Instances

Instances details
Bounded a => Bounded (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

(Enum a, SaturatingNum a) => Enum (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Eq a => Eq (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

(==) :: Saturating a -> Saturating a -> Bool #

(/=) :: Saturating a -> Saturating a -> Bool #

(Fractional a, Ord a, SaturatingNum a) => Fractional (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

(Integral a, SaturatingNum a) => Integral (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

(Ord a, SaturatingNum a) => Num (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Ord a => Ord (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

(Real a, SaturatingNum a) => Real (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

(Ord a, RealFrac a, SaturatingNum a) => RealFrac (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

properFraction :: Integral b => Saturating a -> (b, Saturating a) #

truncate :: Integral b => Saturating a -> b #

round :: Integral b => Saturating a -> b #

ceiling :: Integral b => Saturating a -> b #

floor :: Integral b => Saturating a -> b #

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

Defined in Clash.Num.Saturating

Arbitrary a => Arbitrary (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Bits a => Bits (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

FiniteBits a => FiniteBits (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Binary a => Binary (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

put :: Saturating a -> Put #

get :: Get (Saturating a) #

putList :: [Saturating a] -> Put #

NFData a => NFData (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

rnf :: Saturating a -> () #

Hashable a => Hashable (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

hashWithSalt :: Int -> Saturating a -> Int #

hash :: Saturating a -> Int #

NFDataX a => NFDataX (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

ShowX a => ShowX (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

BitPack a => BitPack (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Associated Types

type BitSize (Saturating a) :: Nat Source #

Parity a => Parity (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating

Resize f => Resize (Compose Saturating f) Source # 
Instance details

Defined in Clash.Num.Saturating

Methods

resize :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Saturating f a -> Compose Saturating f b Source #

extend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Saturating f a -> Compose Saturating f (b + a) Source #

zeroExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Saturating f a -> Compose Saturating f (b + a) Source #

signExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Saturating f a -> Compose Saturating f (b + a) Source #

truncateB :: forall (a :: Nat) (b :: Nat). KnownNat a => Compose Saturating f (a + b) -> Compose Saturating f a Source #

type BitSize (Saturating a) Source # 
Instance details

Defined in Clash.Num.Saturating