half-0.3: Half-precision floating-point

Copyright(C) 2014 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
PortabilityPatternSynonyms
Safe HaskellNone
LanguageHaskell98

Numeric.Half

Description

Half-precision floating-point values. These arise commonly in GPU work and it is useful to be able to compute them and compute with them on the CPU as well.

Synopsis

Documentation

newtype Half Source #

Constructors

Half 

Fields

Instances
Eq Half Source # 
Instance details

Defined in Numeric.Half

Methods

(==) :: Half -> Half -> Bool Source #

(/=) :: Half -> Half -> Bool Source #

Floating Half Source # 
Instance details

Defined in Numeric.Half

Fractional Half Source # 
Instance details

Defined in Numeric.Half

Num Half Source # 
Instance details

Defined in Numeric.Half

Ord Half Source # 
Instance details

Defined in Numeric.Half

Read Half Source # 
Instance details

Defined in Numeric.Half

Real Half Source # 
Instance details

Defined in Numeric.Half

RealFloat Half Source # 
Instance details

Defined in Numeric.Half

RealFrac Half Source # 
Instance details

Defined in Numeric.Half

Methods

properFraction :: Integral b => Half -> (b, Half) Source #

truncate :: Integral b => Half -> b Source #

round :: Integral b => Half -> b Source #

ceiling :: Integral b => Half -> b Source #

floor :: Integral b => Half -> b Source #

Show Half Source # 
Instance details

Defined in Numeric.Half

Generic Half Source # 
Instance details

Defined in Numeric.Half

Associated Types

type Rep Half :: Type -> Type Source #

Methods

from :: Half -> Rep Half x Source #

to :: Rep Half x -> Half Source #

Lift Half Source # 
Instance details

Defined in Numeric.Half

Methods

lift :: Half -> Q Exp Source #

Storable Half Source # 
Instance details

Defined in Numeric.Half

NFData Half Source # 
Instance details

Defined in Numeric.Half

Methods

rnf :: Half -> () Source #

type Rep Half Source # 
Instance details

Defined in Numeric.Half

type Rep Half = D1 (MetaData "Half" "Numeric.Half" "half-0.3-Ev8Lz3j60xACodwSKk6ogk" True) (C1 (MetaCons "Half" PrefixI True) (S1 (MetaSel (Just "getHalf") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CUShort)))

isZero :: Half -> Bool Source #

Is this Half equal to 0?

fromHalf :: Half -> Float Source #

Convert a Half to a Float while preserving NaN

toHalf :: Float -> Half Source #

Convert a Float to a Half with proper rounding, while preserving NaN and dealing appropriately with infinity

pattern POS_INF :: Half Source #

Positive infinity

pattern NEG_INF :: Half Source #

Negative infinity

pattern QNaN :: Half Source #

Quiet NaN

pattern SNaN :: Half Source #

Signalling NaN

pattern HALF_MIN :: Half Source #

Smallest positive half

pattern HALF_NRM_MIN :: Half Source #

Smallest positive normalized half

pattern HALF_MAX :: Half Source #

Largest positive half

pattern HALF_EPSILON :: Half Source #

Smallest positive e for which half (1.0 + e) != half (1.0)

pattern HALF_DIG :: forall a. (Eq a, Num a) => a Source #

Number of base 10 digits that can be represented without change

pattern HALF_MIN_10_EXP :: forall a. (Eq a, Num a) => a Source #

pattern HALF_MAX_10_EXP :: forall a. (Eq a, Num a) => a Source #