plutus-metatheory-0.1.0.0: Command line tool for running plutus core programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

MAlonzo.RTE.Float

Synopsis

Documentation

doubleDenotEqDoubleDoubleBool Source #

Denotational equality for floating point numbers, checks bitwise equality.

NOTE: Denotational equality distinguishes NaNs, so its results may vary depending on the architecture and compilation flags. Unfortunately, this is a problem with floating-point numbers in general.

doubleDenotOrdDoubleDoubleOrdering Source #

I guess "denotational orderings" are now a thing? The point is that we need an Ord instance which provides a total ordering, and is consistent with the denotational equality.

NOTE: The ordering induced via doubleToWord64 is total, and is consistent with doubleDenotEq. However, it is *deeply* unintuitive. For one, it considers all negative numbers to be larger than positive numbers.

asFiniteDoubleMaybe Double Source #

Return Just x if it's a finite number, otherwise return Nothing.

doubleToRatioDouble → (Integer, Integer) Source #

Decode a Double to an integer ratio.

ratioToDoubleIntegerIntegerDouble Source #

Encode an integer ratio as a double.

doubleDecodeDoubleMaybe (Integer, Integer) Source #

Decode a Double to its mantissa and its exponent, normalised such that the mantissa is the smallest possible number without loss of accuracy.

isSafeIntegerDoubleBool Source #

Checks whether or not the Double is within a safe range of operation.

minMantissaInteger Source #

The smallest representable mantissa. Simultaneously, the smallest integer which can be represented as a Double without loss of precision.

maxMantissaInteger Source #

The largest representable mantissa. Simultaneously, the largest integer which can be represented as a Double without loss of precision.

minExponentInteger Source #

The largest representable exponent.

maxExponentInteger Source #

The smallest representable exponent.

doubleEncodeIntegerIntegerMaybe Double Source #

Encode a mantissa and an exponent as a Double.