half-0.3.1: Half-precision floating-point
Copyright (C) 2014 Edward Kmett
License BSD-style (see the file LICENSE)
Maintainer Edward Kmett <ekmett@gmail.com>
Stability experimental
Portability PatternSynonyms
Safe Haskell Trustworthy
Language Haskell2010

Numeric.Half.Internal

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

Instances

Instances details
Eq Half Source #
Instance details

Defined in Numeric.Half.Internal

Floating Half Source #
Instance details

Defined in Numeric.Half.Internal

Fractional Half Source #
Instance details

Defined in Numeric.Half.Internal

Num Half Source #
Instance details

Defined in Numeric.Half.Internal

Ord Half Source #
Instance details

Defined in Numeric.Half.Internal

Read Half Source #
Instance details

Defined in Numeric.Half.Internal

Real Half Source #
Instance details

Defined in Numeric.Half.Internal

RealFloat Half Source #
Instance details

Defined in Numeric.Half.Internal

RealFrac Half Source #
Instance details

Defined in Numeric.Half.Internal

Show Half Source #
Instance details

Defined in Numeric.Half.Internal

Generic Half Source #
Instance details

Defined in Numeric.Half.Internal

Associated Types

type Rep Half :: Type -> Type Source #

Storable Half Source #
Instance details

Defined in Numeric.Half.Internal

Binary Half Source #
Instance details

Defined in Numeric.Half.Internal

NFData Half Source #
Instance details

Defined in Numeric.Half.Internal

Lift Half Source #
Instance details

Defined in Numeric.Half.Internal

type Rep Half Source #
Instance details

Defined in Numeric.Half.Internal

type Rep Half = D1 (' MetaData "Half" "Numeric.Half.Internal" "half-0.3.1-24IA3idx0A9FWJsnewHrt1" ' True ) ( C1 (' MetaCons "Half" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getHalf") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 CUShort )))

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

Patterns

These are available with GHC-7.8 and later.

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 :: ( Eq a, Num a) => a Source #

Number of base 10 digits that can be represented without change

Pure conversions

pure_floatToHalf :: Float -> Half Source #

Naive pure-Haskell implementation of toHalf .

pure_halfToFloat :: Half -> Float Source #

Naive pure-Haskell implementation of fromHalf .