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

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) (Num (Fix a), Integral a, Bits a, Real a) => Fractional (Fix a) (Integral a, Bits a, Real a) => Num (Fix a) Type a => Show (Fix a) Type a => Syntactic (Fix a) (Syntactic (Fix a), ~ (* -> *) (Domain (Fix a)) FeldDomainAll, Type (Internal (Fix a)), Type a) => Syntax (Fix a) (Syntax (Dynamic (Fix a)), Bits a) => Splittable (Fix a) (Splittable (Fix a), Bits a) => Fixable (Fix a)

class Splittable t => Fixable t whereSource

Operations to get and set exponent

Methods

fix :: Data IntN -> t -> tSource

getExp :: t -> Data IntNSource

Instances

 Fixable (Data Float) (Splittable (Fix a), 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 aSource

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

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

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

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

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

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

A version of branching for fixed point algorithms

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

A version of vector fold for fixed point algorithms