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

Safe HaskellNone

Feldspar.FixedPoint

Synopsis

Documentation

data Fix a Source

Abstract real number type with exponent and mantissa

Constructors

Fix 

Fields

exponent :: 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) 

class Splittable t => Fixable t whereSource

Operations to get and set exponent

Methods

fix :: Data IntN -> t -> tSource

getExp :: t -> Data IntNSource

Instances

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