float128-0.1: FFI bindings for C _Float128

Copyright(C) 2020 Claude Heiland-Allen
LicenseBSD3
MaintainerClaude Heiland-Allen <claude@mathr.co.uk>
Stabilityexperimental
Portabilitynon-portable (needs C _Float128)
Safe HaskellNone
LanguageHaskell2010

Numeric.Float128

Contents

Description

This module contains a Float128 type that can be used if you need the extra precision or range from the IEEE _Float128 quadruple precision type. It has 15bit signed exponent (compared to 11bit signed exponent for Double) and 113bit mantissa (compared to 53bit mantissa for Double).

Performance is likely to be poor, as the instances are implemented using FFI with Ptr Float128, copying to and from memory around each operation. If you need to bind to functions taking/returning _Float128 you need to write wrapper functions expecting pointers to _Float128 instead, as GHC does not expose a CFloat128 FFI type.

Synopsis

_Float128 data type

data Float128 Source #

The _Float128 type.

Constructors

F128 !Word64 !Word64 
Instances
Eq Float128 Source # 
Instance details

Defined in Numeric.Float128

Floating Float128 Source # 
Instance details

Defined in Numeric.Float128

Fractional Float128 Source # 
Instance details

Defined in Numeric.Float128

Num Float128 Source # 
Instance details

Defined in Numeric.Float128

Ord Float128 Source # 
Instance details

Defined in Numeric.Float128

Read Float128 Source # 
Instance details

Defined in Numeric.Float128

Real Float128 Source # 
Instance details

Defined in Numeric.Float128

RealFloat Float128 Source # 
Instance details

Defined in Numeric.Float128

RealFrac Float128 Source # 
Instance details

Defined in Numeric.Float128

Methods

properFraction :: Integral b => Float128 -> (b, Float128) #

truncate :: Integral b => Float128 -> b #

round :: Integral b => Float128 -> b #

ceiling :: Integral b => Float128 -> b #

floor :: Integral b => Float128 -> b #

Show Float128 Source # 
Instance details

Defined in Numeric.Float128

Storable Float128 Source # 
Instance details

Defined in Numeric.Float128

RealFrac alternatives

truncate' :: Float128 -> Float128 Source #

Alternate versions of RealFrac methods that keep the value as a Float128.

round' :: Float128 -> Float128 Source #

Alternate versions of RealFrac methods that keep the value as a Float128.

ceiling' :: Float128 -> Float128 Source #

Alternate versions of RealFrac methods that keep the value as a Float128.

floor' :: Float128 -> Float128 Source #

Alternate versions of RealFrac methods that keep the value as a Float128.

Conversions