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 | None |
Language | Haskell2010 |
Grisette.Internal.Core.Data.Class.IEEEFP
Description
Synopsis
- fpIsNaN :: RealFloat a => a -> Bool
- fpIsPositiveZero :: RealFloat a => a -> Bool
- fpIsNegativeZero :: RealFloat a => a -> Bool
- fpIsPositiveInfinite :: RealFloat a => a -> Bool
- fpIsNegativeInfinite :: RealFloat a => a -> Bool
- fpIsPositive :: RealFloat a => a -> Bool
- fpIsNegative :: RealFloat a => a -> Bool
- fpIsInfinite :: RealFloat a => a -> Bool
- fpIsZero :: RealFloat a => a -> Bool
- fpIsNormal :: RealFloat a => a -> Bool
- fpIsSubnormal :: RealFloat a => a -> Bool
- fpIsPoint :: RealFloat a => a -> Bool
- class IEEEFPConstants a where
- fpPositiveInfinite :: a
- fpNegativeInfinite :: a
- fpNaN :: a
- fpNegativeZero :: a
- fpPositiveZero :: a
- fpMinNormalized :: a
- fpMinSubnormal :: a
- fpMaxNormalized :: a
- fpMaxSubnormal :: a
- class IEEEFPRoundingMode mode where
- class IEEEFPOp a where
- fpAbs :: a -> a
- fpNeg :: a -> a
- fpRem :: a -> a -> a
- fpMinimum :: a -> a -> a
- fpMinimumNumber :: a -> a -> a
- fpMaximum :: a -> a -> a
- fpMaximumNumber :: a -> a -> a
- class IEEEFPRoundingMode mode => IEEEFPRoundingOp a mode | a -> mode where
- class IEEEFPConvertible a fp mode | fp -> mode where
- class (IEEEFPConvertible a fp mode, IEEEFPRoundingMode mode) => IEEEFPToAlgReal a fp mode | fp -> mode where
- fpToAlgReal :: a -> fp -> a
Documentation
fpIsPositiveZero :: RealFloat a => a -> Bool Source #
Check if a floating-point number is positive zero.
fpIsNegativeZero :: RealFloat a => a -> Bool Source #
Check if a floating-point number is negative zero.
fpIsPositiveInfinite :: RealFloat a => a -> Bool Source #
Check if a floating-point number is positive infinite.
fpIsNegativeInfinite :: RealFloat a => a -> Bool Source #
Check if a floating-point number is negative infinite.
fpIsPositive :: RealFloat a => a -> Bool Source #
Check if a floating-point number is positive. +0, +inf are considered positive. nan, -0, -inf are not positive.
fpIsNegative :: RealFloat a => a -> Bool Source #
Check if a floating-point number is negative. -0, -inf are considered negative. nan, +0, +inf are not negative.
fpIsInfinite :: RealFloat a => a -> Bool Source #
Check if a floating-point number is infinite.
fpIsNormal :: RealFloat a => a -> Bool Source #
Check if a floating-point number is normal, i.e., not 0, not inf, not nan, and not denormalized.
fpIsSubnormal :: RealFloat a => a -> Bool Source #
Check if a floating-point number is subnormal, i.e., denormalized. 0, inf, or nan are not subnormal.
fpIsPoint :: RealFloat a => a -> Bool Source #
Check if a floating-point number is a point, i.e., not inf, not nan.
class IEEEFPConstants a where Source #
Constants for IEEE floating-point numbers.
Methods
fpPositiveInfinite :: a Source #
Positive infinity.
fpNegativeInfinite :: a Source #
Negative infinity.
Not-a-number.
fpNegativeZero :: a Source #
Negative zero.
fpPositiveZero :: a Source #
Positive zero.
fpMinNormalized :: a Source #
Smallest positive normalized number.
fpMinSubnormal :: a Source #
Smallest positive subnormal number.
fpMaxNormalized :: a Source #
Largest positive normalized number.
fpMaxSubnormal :: a Source #
Largest positive subnormal number.
Instances
ValidFP eb sb => IEEEFPConstants (FP eb sb) Source # | |
Defined in Grisette.Internal.SymPrim.FP Methods fpPositiveInfinite :: FP eb sb Source # fpNegativeInfinite :: FP eb sb Source # fpNegativeZero :: FP eb sb Source # fpPositiveZero :: FP eb sb Source # fpMinNormalized :: FP eb sb Source # fpMinSubnormal :: FP eb sb Source # fpMaxNormalized :: FP eb sb Source # fpMaxSubnormal :: FP eb sb Source # | |
ValidFP eb sb => IEEEFPConstants (SymFP eb sb) Source # | |
Defined in Grisette.Internal.SymPrim.SymFP Methods fpPositiveInfinite :: SymFP eb sb Source # fpNegativeInfinite :: SymFP eb sb Source # fpNegativeZero :: SymFP eb sb Source # fpPositiveZero :: SymFP eb sb Source # fpMinNormalized :: SymFP eb sb Source # fpMinSubnormal :: SymFP eb sb Source # fpMaxNormalized :: SymFP eb sb Source # fpMaxSubnormal :: SymFP eb sb Source # |
class IEEEFPRoundingMode mode where Source #
Rounding modes for floating-point operations.
Methods
Round to nearest, ties to even.
Round to nearest, ties to away from zero.
Round towards positive infinity.
Round towards negative infinity.
Round towards zero.
Instances
IEEEFPRoundingMode FPRoundingMode Source # | |
Defined in Grisette.Internal.SymPrim.FP Methods rne :: FPRoundingMode Source # rna :: FPRoundingMode Source # rtp :: FPRoundingMode Source # rtn :: FPRoundingMode Source # rtz :: FPRoundingMode Source # | |
IEEEFPRoundingMode SymFPRoundingMode Source # | |
Defined in Grisette.Internal.SymPrim.SymFP Methods rne :: SymFPRoundingMode Source # rna :: SymFPRoundingMode Source # rtp :: SymFPRoundingMode Source # |
class IEEEFPOp a where Source #
Operations on IEEE floating-point numbers, without rounding mode.
Methods
IEEE754-2019 abs operation.
IEEE754-2019 negate operation.
IEEE754-2019 remainder operation.
fpMinimum :: a -> a -> a Source #
IEEE754-2019 minimum operation.
- The comparison for zeros follows -0 < 0
- Returns NaN if one operand is NaN.
fpMinimumNumber :: a -> a -> a Source #
IEEE754-2019 minimumNumber operation.
- The comparison for zeros follows -0 < 0
- Returns the other operand if one operand is NaN.
fpMaximum :: a -> a -> a Source #
IEEE754-2019 maximum operation.
- The comparison for zeros follows -0 < 0
- Returns NaN if one operand is NaN.
fpMaximumNumber :: a -> a -> a Source #
IEEE754-2019 maximumNumber operation.
- The comparison for zeros follows -0 < 0
- Returns the other operand if one operand is NaN.
Instances
ValidFP eb sb => IEEEFPOp (FP eb sb) Source # | |
Defined in Grisette.Internal.SymPrim.FP Methods fpAbs :: FP eb sb -> FP eb sb Source # fpNeg :: FP eb sb -> FP eb sb Source # fpRem :: FP eb sb -> FP eb sb -> FP eb sb Source # fpMinimum :: FP eb sb -> FP eb sb -> FP eb sb Source # fpMinimumNumber :: FP eb sb -> FP eb sb -> FP eb sb Source # fpMaximum :: FP eb sb -> FP eb sb -> FP eb sb Source # fpMaximumNumber :: FP eb sb -> FP eb sb -> FP eb sb Source # | |
ValidFP eb sb => IEEEFPOp (SymFP eb sb) Source # | |
Defined in Grisette.Internal.SymPrim.SymFP Methods fpAbs :: SymFP eb sb -> SymFP eb sb Source # fpNeg :: SymFP eb sb -> SymFP eb sb Source # fpRem :: SymFP eb sb -> SymFP eb sb -> SymFP eb sb Source # fpMinimum :: SymFP eb sb -> SymFP eb sb -> SymFP eb sb Source # fpMinimumNumber :: SymFP eb sb -> SymFP eb sb -> SymFP eb sb Source # fpMaximum :: SymFP eb sb -> SymFP eb sb -> SymFP eb sb Source # fpMaximumNumber :: SymFP eb sb -> SymFP eb sb -> SymFP eb sb Source # |
class IEEEFPRoundingMode mode => IEEEFPRoundingOp a mode | a -> mode where Source #
Operations on IEEE floating-point numbers, with rounding mode.
Methods
fpAdd :: mode -> a -> a -> a Source #
fpSub :: mode -> a -> a -> a Source #
fpMul :: mode -> a -> a -> a Source #
fpDiv :: mode -> a -> a -> a Source #
fpFMA :: mode -> a -> a -> a -> a Source #
fpSqrt :: mode -> a -> a Source #
fpRoundToIntegral :: mode -> a -> a Source #
Instances
class IEEEFPConvertible a fp mode | fp -> mode where Source #
Conversion from and to FPs.
Methods
Arguments
:: a | Default value when converting non-representable FPs. For example, when converting to non-FP types, the NaN and infinities are not representable. Additionally, when converting to bit-vectors, out-of-bound FPs are not representable. Note that out-of-bound means that the value after conversion is out of bound, not the value before conversion, meaning that converting from 3.5 to 2-bit unsigned bit-vector is out-of-bound when rounding to positive, but not when rounding to negative. |
-> mode | Rounding mode. Ignored when converting to |
-> fp | FP value. |
-> a |
Instances
class (IEEEFPConvertible a fp mode, IEEEFPRoundingMode mode) => IEEEFPToAlgReal a fp mode | fp -> mode where Source #
Converting FP to real numbers.
Minimal complete definition
Nothing
Methods
fpToAlgReal :: a -> fp -> a Source #
Instances
ValidFP eb sb => IEEEFPToAlgReal AlgReal (FP eb sb) FPRoundingMode Source # | |
Defined in Grisette.Internal.SymPrim.FP | |
ValidFP eb sb => IEEEFPToAlgReal SymAlgReal (SymFP eb sb) SymFPRoundingMode Source # | |
Defined in Grisette.Internal.SymPrim.SymFP Methods fpToAlgReal :: SymAlgReal -> SymFP eb sb -> SymAlgReal Source # |