| 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
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 # | |
| IEEEFPRoundingMode a => IEEEFPRoundingMode (AsKey a) 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
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
| IEEEFPToAlgReal a fp mode => IEEEFPToAlgReal a (AsKey fp) (AsKey mode) Source # | |
Defined in Grisette.Internal.Core.Data.Class.AsKey Methods fpToAlgReal :: a -> AsKey fp -> a Source # | |
| 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 # | |
| IEEEFPToAlgReal a fp mode => IEEEFPToAlgReal (AsKey a) fp mode Source # | |
Defined in Grisette.Internal.Core.Data.Class.AsKey Methods fpToAlgReal :: AsKey a -> fp -> AsKey a Source # | |
| IEEEFPToAlgReal a fp mode => IEEEFPToAlgReal (AsKey a) (AsKey fp) (AsKey mode) Source # | |
Defined in Grisette.Internal.Core.Data.Class.AsKey | |