feldspar-language-0.7: A functional embedded language for DSP and parallelism

Safe Haskell None Haskell2010

Feldspar.FixedPoint

Synopsis

# Documentation

data Fix a Source

Abstract real number type with exponent and mantissa

Constructors

 Fix Fieldsexponent :: Data IntN mantissa :: Data a

Instances

 Type a => Eq (Fix a) (Integral a, Bits a, Floating a) => Fractional (Fix a) (Integral a, Bits a) => Num (Fix a) Type a => Show (Fix a) Type a => Syntactic (Fix a) Bits a => Fixable (Fix a) type Internal (Fix a) = (IntN, a) type Domain (Fix a) = FeldDomain

class Splittable t => Fixable t where Source

Operations to get and set exponent

Methods

fix :: Data IntN -> t -> t Source

getExp :: t -> Data IntN Source

Instances

 Fixable (Data Float) Bits a => Fixable (Fix a)

freezeFix :: Type a => Fix a -> (Data IntN, Data a) Source

Converts an abstract real number to a pair of exponent and mantissa

freezeFix' :: Bits a => IntN -> Fix a -> Data a Source

Converts an abstract real number to fixed point integer with given exponent

unfreezeFix :: Type a => (Data IntN, Data a) -> Fix a Source

Converts a pair of exponent and mantissa to an abstract real number

unfreezeFix' :: IntN -> Data a -> Fix a Source

Converts a fixed point integer with given exponent to an abstract real number

(?!) :: forall a. (Syntax a, Splittable a) => Data Bool -> (a, a) -> a infix 1 Source

A version of branching for fixed point algorithms

fixFold :: forall a b. Splittable a => (a -> b -> a) -> a -> Vector b -> a Source

A version of vector fold for fixed point algorithms