Copyright | (c) Sirui Lu 2024 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Grisette.Internal.SymPrim.FP
Description
Synopsis
- type ValidFP (eb :: Nat) (sb :: Nat) = ValidFloat eb sb
- newtype FP (eb :: Nat) (sb :: Nat) = FP {
- unFP :: FloatingPoint eb sb
- type FP16 = FP 5 11
- type FP32 = FP 8 24
- type FP64 = FP 11 53
- withValidFPProofs :: forall eb sb r. ValidFP eb sb => ((KnownNat (eb + sb), BVIsNonZero (eb + sb), 1 <= (eb + sb), 1 <= eb, 1 <= sb) => r) -> r
- data FPRoundingMode
- allFPRoundingMode :: [FPRoundingMode]
Documentation
type ValidFP (eb :: Nat) (sb :: Nat) = ValidFloat eb sb Source #
A type-level proof that the given bit-widths are valid for a floating-point number.
newtype FP (eb :: Nat) (sb :: Nat) Source #
IEEE 754 floating-point number with eb
exponent bits and sb
significand
bits.
>>>
:set -XDataKinds
>>>
1.0 + 2.0 :: FP 11 53
3.0
More operations are available. Please refer to Grisette.Core for more information.
Constructors
FP | |
Fields
|
Instances
withValidFPProofs :: forall eb sb r. ValidFP eb sb => ((KnownNat (eb + sb), BVIsNonZero (eb + sb), 1 <= (eb + sb), 1 <= eb, 1 <= sb) => r) -> r Source #
Some type-level witnesses that could be derived from ValidFP
.
data FPRoundingMode Source #
Rounding mode for floating-point operations.
Constructors
RNE | Round to nearest, ties to even. |
RNA | Round to nearest, ties to away from zero. |
RTP | Round towards positive infinity. |
RTN | Round towards negative infinity. |
RTZ | Round towards zero. |
Instances
allFPRoundingMode :: [FPRoundingMode] Source #
All IEEE 754 rounding modes.