X      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Trustworthy 8 Et cetera9#A precision of 3 significant digits:#A precision of 2 significant digits;A precision of (p 2) significant digits<A precision of (p + 1) significant digits="A precision of 1 significant digit>+A precision of unlimited significant digits?(A subclass of precisions that are finite@XPrecision indicates the maximum number of significant decimal digits a number may have.A)Return the precision of the argument, or  if the precision is infinite.M  !"#$%&'()*+,-./0123456789:;<=>?@AB  !"#$%&'()*+,-./0123456789:;<=>?@AL  !"#$%&'()*+,-./0123456789:;<=>?@A Trustworthy Y.(Round zero or five away from 0.) The same as Z, except that rounding up only occurs if the digit to be rounded up is 0 or 5, and after overflow the result is the same as for `.Z(Round away from 0.) If all of the discarded digits are zero the result is unchanged. Otherwise, the result coefficient should be incremented by 1 (rounded up).[If the discarded digits represent greater than half (0.5) of the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). Otherwise (the discarded digits are 0.5 or less) the discarded digits are ignored.\F(Round toward "".) If all of the discarded digits are zero or if the signo is 0 the result is unchanged. Otherwise, the sign is 1 and the result coefficient should be incremented by 1.]F(Round toward +".) If all of the discarded digits are zero or if the signj is 1 the result is unchanged. Otherwise, the result coefficient should be incremented by 1 (rounded up).^*If the discarded digits represent greater than half (0.5) the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). If they represent less than half, then the result coefficient is not adjusted (that is, the discarded digits are ignored).Otherwise (they represent exactly half) the result coefficient is unaltered if its rightmost digit is even, or incremented by 1 (rounded up) if its rightmost digit is odd (to make an even digit)._If the discarded digits represent greater than or equal to half (0.5) of the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). Otherwise the discarded digits are ignored.`W(Round toward 0; truncate.) The discarded digits are ignored; the result is unchanged.apA rounding algorithm to use when the result of an arithmetic operation exceeds the precision of the result typeb4A value representation of a rounding algorithm (cf. a).Round a Bd to the precision of the arithmetic context using the rounding algorithm of the arithmetic context.!YZ[\]^_`abcdefghijYZ[\]^_`abdehfgijcYZ[\]^_`abcdefghij Trustworthy!BQA decimal floating point number with selectable precision and rounding algorithmDPositive or non-negativeENegative4Return the number of decimal digits of the argument.0Compute an infinite series to maximum precision.QCompute the arcsine of the argument to maximum precision using series expansion.BCompute  to maximum precision using the arcsine series expansion.cCast a number with two additional digits of precision down to a number with the desired precision.A B representing the value zeroA B representing the value A B representing the value oneA B representing the value twoA B representing the value tenA B$ representing the value negative oneA B) representing the value positive infinityA B representing undefined results A signaling B representing undefined resultsNegate the given B by directly flipping its sign.yCast a B to another precision and/or rounding algorithm, immediately rounding if necessary to the new precision using the new algorithm.Cast a BX to another rounding algorithm, maintaining the same precision. No new rounding occurs.Is the sign of the given B positive?Is the sign of the given B negative?Does the given B represent a finite value?Does the given B represent the value zero? Is the given B normal? Is the given B subnormal?zIf the argument is  , return a B value zero; if 8, return the value one. This is basically an optimized toEnum . fromEnum: to support an all-decimal usage of the operations from Numeric.Decimal.Operation that return a .Return % if the argument is zero or NaN, and  otherwise.1Upper limit on the absolute value of the exponent&Minimum value of the adjusted exponent&Maximum value of the adjusted exponent3Minimum value of the exponent for subnormal results$Range of permissible exponent valuesDB CDE    yz &B CDE  yz:B  CDE    yz  TrustworthyFConvert a string to a number, as defined by its abstract representation. The string is expected to conform to the numeric string syntax described here.GRConvert a number to a string, using scientific notation if an exponent is needed.{SConvert a number to a string, using engineering notation if an exponent is needed.FG{!"FG{G{FFG{!" Trustworthy9;<="H,A representation of an exceptional conditionJRaised when the exponent of a result has been altered or constrained in order to fit the constraints of a specific concrete representationK2Raised when a non-zero dividend is divided by zeroLkRaised when a result is not exact (one or more non-zero coefficient digits were discarded during rounding)M5Raised when a result would be undefined or impossibleNCRaised when the exponent of a result is too large to be representedOiRaised when a result has been rounded (that is, some zero or non-zero coefficient digits were discarded)PHRaised when a result is subnormal (its adjusted exponent is less than Emin), before any roundingQ2Raised when a result is both subnormal and inexactR:A decimal arithmetic monad parameterized by the precision p and rounding algorithm rS}A context for decimal arithmetic, carrying signal flags, trap enabler state, and a trap handler, parameterized by precision p and rounding algorithm rT1The defined result for the exceptional conditionUSet the given signal flag in the context of the current arithmetic computation, and call the trap handler if the trap for this signal is currently enabled.V3Return the precision of the arithmetic context (or  if the precision is infinite).WEvaluate an arithmetic computation in the given context and return the final value or exception, discarding the resulting context.XJReturn a new context with all signal flags cleared and all traps disabled.|A trap handler function may return a substitute result for the operation that caused the exceptional condition, or it may call #" to pass control to an enclosing $0 handler (or abort the arithmetic computation).}/A group of signals can be manipulated as a set.~/The signal raised by the exceptional condition'The current signal flags of the context%)The trap handler function for the contextRReturn a new context with all signal flags cleared, all traps enabled except for L, O, and Pi, using a precision of 9 significant decimal digits, and rounding half up. Trapped signals simply call # with the corresponding H, and can be caught using $.Return a new context with all signal flags cleared, all traps disabled (IEEE 854 7), using selectable precision (the IEEE 754 smallest and basic formats correspond to precisions 5, ,, or -), and rounding half even (IEEE 754 4.3.3).yEvaluate an arithmetic computation in the given context and return the final value (or exception) and resulting context.HPerform a subcomputation using a different precision and/or rounding algorithm. The subcomputation is evaluated within a new context with all flags cleared and all traps disabled. Any flags set in the context of the subcomputation are ignored, but if an exception is returned it will be re-raised within the current context.8Return the rounding algorithm of the arithmetic context.)Create a set of signals from a singleton.$Create a set of signals from a list.A set containing every signal&#Enumerate the given set of signals.'0Remove the first set of signals from the second.0Determine whether a signal is a member of a set.UClear the given signal flags from the context of the current arithmetic computation.6Evaluate an arithmetic computation within a modified context that enables the given signals to be trapped by the given handler. The previous trap handler (and enabler state) will be restored during any trap, as well as upon completion. Any existing trap handlers for signals not mentioned remain in effect..HIJKLMNOPQR(STUVWX|})*~+%&')HT~INQJKLMOPRSUVWXbdehfgijc|},SXVbcdefghijRWH~T~TIJKLMNOPQ}U|H*~TIJKLMNOPQR(S+%UVWX|})&' Trustworthy2kk( takes one operand. If the operand is a  special value then the general rules apply.Otherwise, the ideal exponent of the result is defined to be half the exponent of the operand (rounded to an integer, towards -Infinity, if necessary) and then:JIf the operand is less than zero an Invalid operation condition is raised.If the operand is greater than zero, the result is the square root of the operand. If no rounding is necessary (the exact result requires  precision digits or fewer) then the the coefficient and exponent giving the correct value and with the exponent closest to the ideal exponent is used. If the result must be inexact, it is rounded using the round-half-even2 algorithm and the coefficient will have exactly  precisionf digits (unless the result is subnormal), and the exponent will be set to maintain the correct value.Otherwise (the operand is equal to zero), the result will be the zero with the same sign as the operand and with the ideal exponent.ll~ takes two operands, and raises a number (the left-hand operand) to a power (the right-hand operand). If either operand is a  special value8 then the general rules apply, except in certain cases.mm takes two operands, compares their values numerically, and returns the maximum. If either operand is a NaN then the general rules apply, unless one is a quiet NaN and the other is numeric, in which case the numeric operand is returned.nn takes two operands, compares their values numerically, and returns the minimum. If either operand is a NaN then the general rules apply, unless one is a quiet NaN and the other is numeric, in which case the numeric operand is returned.ooS takes two operands and compares their values numerically. If either operand is a  special valueV then the general rules apply. No flags are set unless an operand is a signaling NaN.0Otherwise, the operands are compared, returning -1( if the first is less than the second, 0 if they are equal, or 1* if the first is greater than the second.ppU takes one operand. If the operand is negative, the result is the same as using the qK operation on the operand. Otherwise, the result is the same as using the  operation on the operand.KNote that the result of this operation is affected by context and may set flags. The . operation may be used if this is not desired.qq[ takes one operand, and corresponds to the prefix minus operator in programming languages.KNote that the result of this operation is affected by context and may set flags. The " operation may be used instead of q if this is not desired.rr] takes one operand. If the operand is a NaN then the general rules for special values apply.Otherwise, the operand must be a zero or positive, and the result is the base 10 logarithm of the operand, with the following cases:<If the operand is a zero, the result is -Infinity and exact.?If the operand is +Infinity, the result is +Infinity and exact.mIf the operand equals an integral power of ten (including 10^0 and negative powers) and there is sufficient  precisiong to hold the integral part of the result, the result is an integer (with an exponent of 0) and exact.?Otherwise the result is inexact and will be rounded using the round-half-even. algorithm. The coefficient will have exactly  precision digits (unless the result is subnormal). These inexact results should be correctly rounded, but may be up to 1 ulp (unit in last place) in error.ss] takes one operand. If the operand is a NaN then the general rules for special values apply.XOtherwise, the operand must be a zero or positive, and the result is the natural (base e5) logarithm of the operand, with the following cases:<If the operand is a zero, the result is -Infinity and exact.?If the operand is +Infinity, the result is +Infinity and exact.5If the operand equals one, the result is 0 and exact.?Otherwise the result is inexact and will be rounded using the round-half-even. algorithm. The coefficient will have exactly  precision digits (unless the result is subnormal). These inexact results should be correctly rounded, but may be up to 1 ulp (unit in last place) in error.tt] takes one operand. If the operand is a NaN then the general rules for special values apply.Otherwise, the result is e? raised to the power of the operand, with the following cases:7If the operand is -Infinity, the result is 0 and exact.4If the operand is a zero, the result is 1 and exact.?If the operand is +Infinity, the result is +Infinity and exact.?Otherwise the result is inexact and will be rounded using the round-half-even. algorithm. The coefficient will have exactly  precision digits (unless the result is subnormal). These inexact results should be correctly rounded, but may be up to 1 ulp (unit in last place) in error.uu, takes two operands. If either operand is a  special value then the general rules apply.Otherwise, if the divisor is zero then either the Division undefined condition is raised (if the dividend is zero) and the result is NaN, or the Division by zero condition is raised and the result is an Infinity with a sign which is the exclusive or of the signs of the operands.)Otherwise, a long division  is effected.The result is then rounded to  precision) digits, if necessary, according to the roundingD algorithm and taking into account the remainder from the division.vv, takes two operands. If either operand is a  special value then the general rules apply. Otherwise, the operands are multiplied together ( long multiplication ), resulting in a number which may be as long as the sum of the lengths of the two operands.The result is then rounded to  precisionN digits if necessary, counting from the most significant digit of the result.ww, takes two operands. If either operand is a  special value then the general rules apply.6Otherwise, the operands are added after inverting the sign used for the second operand.The result is then rounded to  precisionN digits if necessary, counting from the most significant digit of the result.xx, takes two operands. If either operand is a  special value then the general rules apply."Otherwise, the operands are added.The result is then rounded to  precisionN digits if necessary, counting from the most significant digit of the result.Not a number (quiet)Not a number (signaling)ZeroSubnormal finite numberNormal finite numberInfinityNumber (finite or infinite)!Not a number (quiet or signaling)Z takes one operand, and corresponds to the prefix plus operator in programming languages.KNote that the result of this operation is affected by context and may set flags.E takes three operands; the first two are multiplied together, using v[, with sufficient precision and exponent range that the result is exact and unrounded. No flags are set by the multiplication unless one of the first two operands is a signaling NaN or one is a zero and the other is an infinity.oUnless the multiplication failed, the third operand is then added to the result of that multiplication, using x, under the current context.In other words, fusedMultiplyAdd x y z delivers a result which is  (x y) + z$ with only the one, final, rounding.[ takes two operands and compares their values numerically. This operation is identical to o, except that if neither operand is a signaling NaN then any quiet NaN operand is treated as though it were a signaling NaN. (That is, all NaNs signal, with signaling NaNs taking precedence over quiet NaNs.)F takes two operands and compares their values numerically with their sign ignored and assumed to be 0.If, without signs, the first operand is the larger then the original first operand is returned (that is, with the original sign). If, without signs, the second operand is the larger then the original second operand is returned. Otherwise the result is the same as from the m operation.F takes two operands and compares their values numerically with their sign ignored and assumed to be 0.If, without signs, the first operand is the smaller then the original first operand is returned (that is, with the original sign). If, without signs, the second operand is the smaller then the original second operand is returned. Otherwise the result is the same as from the n operation.,Ordering function for n, , m, and c: returns the original arguments as (smaller, larger) when the given function is applied to them., takes two operands. If either operand is a  special value then the general rules apply, except that if either operand is infinite and the other is finite an Invalid operation condition is raised and the result is NaN, or if both are infinite then the result is the first operand.&Otherwise (both operands are finite),  returns the number which is equal in value (except for any rounding) and sign to the first (left-hand) operand and which has an exponentE set to be equal to the exponent of the second (right-hand) operand.The  coefficientc of the result is derived from that of the left-hand operand. It may be rounded using the current rounding setting (if the exponentE is being increased), multiplied by a positive power of ten (if the exponent. is being decreased), or is unchanged (if the exponent6 is already equal to that of the right-hand operand)..Unlike other operations, if the length of the  coefficient5 after the quantize operation would be greater than  precisionp then an Invalid operation condition is raised. This guarantees that, unless there is an error condition, the exponentP of the result of a quantize is always equal to that of the right-hand operand.pAlso unlike other operations, quantize will never raise Underflow, even if the result is subnormal and inexact.5 takes one operand. It has the same semantics as the  operation, except that if the final result is finite it is reduced to its simplest form, with all trailing zeros removed and its sign preserved.T takes one operand. The result has the same value as the operand but always uses a  canonical encoding. The definition of  canonical is implementation-defined; if more than one internal encoding for a given NaN, Infinity, or finite number is possible then one preferred  encoding is deemed canonical. This operation then returns the value using that preferred encoding.EIf all possible operands have just one internal encoding each, then K always returns the operand unchanged (that is, it has the same effect as >). This operation is unaffected by context and is quiet  no flags are changed in the context.7 takes one operand. The result is an indication of the classd of the operand, where the class is one of ten possibilities, corresponding to one of the strings "sNaN" (signaling NaN), "NaN" (quiet NaN),  "-Infinity" (negative infinity),  "-Normal"# (negative normal finite number),  "-Subnormal"% (negative subnormal finite number), "-Zero" (negative zero), "+Zero" (non-negative zero),  "+Subnormal"& (positive subnormal finite number),  "+Normal"& (positive normal finite number), or  "+Infinity"2 (positive infinity). This operation is quiet; no flags are changed in the context.Note that unlike the special values in the model, the sign of any NaN is ignored in the classification, as required by IEEE 754.t takes one operand. The result is a copy of the operand. This operation is unaffected by context and is quiet  no flags are changed in the context.B takes one operand. The result is a copy of the operand with the sign set to 0. Unlike the pG operation, this operation is unaffected by context and is quiet  no flags are changed in the context.B takes one operand. The result is a copy of the operand with the sign inverted (a sign- of 0 becomes 1 and vice versa). Unlike the qG operation, this operation is unaffected by context and is quiet  no flags are changed in the context.I takes two operands. The result is a copy of the first operand with the sign set to be the same as the signS of the second operand. This operation is unaffected by context and is quiet  no flags are changed in the context.7 takes one operand. The result is 1 if the operand is  canonical'; otherwise it is 0. The definition of  canonical is implementation-defined; if more than one internal encoding for a given NaN, Infinity, or finite number is possible then one preferred  encoding is deemed canonical. This operation then tests whether the internal encoding is that preferred encoding.EIf all possible operands have just one internal encoding each, then N always returns 1. This operation is unaffected by context and is quiet  no flags are changed in the context. takes one operand. The result is 1 if the operand is neither infinite nor a NaN (that is, it is a normal number, a subnormal number, or a zero); otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context. takes one operand. The result is 1 if the operand is an Infinity; otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context. takes one operand. The result is 1 if the operand is a NaN (quiet or signaling); otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context.N takes one operand. The result is 1 if the operand is a positive or negative  normal number2; otherwise it is 0. This operation is quiet; no flags are changed in the context. takes one operand. The result is 1 if the operand is a quiet NaN; otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context.+ takes one operand. The result is 1 if the signe of the operand is 1; otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context. takes one operand. The result is 1 if the operand is a signaling NaN; otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context.N takes one operand. The result is 1 if the operand is a positive or negative subnormal number2; otherwise it is 0. This operation is quiet; no flags are changed in the context. takes one operand. The result is 1 if the operand is a zero; otherwise it is 0. This operation is unaffected by context and is quiet  no flags are changed in the context. takes one operand. If the operand is a NaN then the general arithmetic rules apply. If the operand is infinite then +Infinity is returned. If the operand is a zero, then -Infinity is returned and the Division by zero exceptional condition is raised.ZOtherwise, the result is the integer which is the exponent of the magnitude of the most significant digit of the operand (as though the operand were truncated to a single digit while maintaining the value of that digit and without limiting the resulting exponent). All results are exact unless an integer result does not fit in the available  precision. takes no operands. The result is the radix (base) in which arithmetic is effected; for this specification the result will have the value 10.F takes two operands, and returns 1 if the two operands have the same exponentg or 0 otherwise. The result is never affected by either the sign or the coefficient of either operand.If either operand is a  special valueG, 1 is returned only if both operands are NaNs or both are infinities. does not change any flags in the context.E takes two operands. The second operand must be an integer (with an exponent of 0) in the range  -precision through  precision. If the first operand is a NaN then the general arithmetic rules apply, and if it is infinite then the result is the Infinity unchanged.@Otherwise (the first operand is finite) the result has the same sign and exponent as the first operand, and a  coefficient6 which is a shifted copy of the digits in the coefficient of the first operand. The number of places to shift is taken from the absolute value of the second operand, with the shift being to the left if the second operand is positive or to the right otherwise. Digits shifted into the coefficient are zeros. The only flag that might be set is invalid-operationC (set if the first operand is an sNaN or the second is not valid).The rotateB operation can be used to rotate rather than shift a coefficient.Iklmnopqrstuvwx-./0123456789:;,<=>?7CDEklmnopqrstuvwx7pxwoutsrmnqvlkCDEAklmnopqrstuvwx-./0123456789:;,<=>?>General arbitrary-precision decimal floating-point number type 2016 Robert LeslieBSD3 rob@mars.org experimental Trustworthy7A decimal floating point number with infinite precisionNA decimal floating point number with selectable precision, rounding half evenMA decimal floating point number with 9 digits of precision, rounding half upQ  !"#$%&'()*+,-./0123456789:;<=>?@ABYZ[\]^_`ayzQB@A?=:9876543210/.-,+*)('&%$#"!  <;>a_^[]\ZY`yz@      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijhgfedcbaklmnopqrstuvwxyz{|}~      !" !#$%&Z}P['()*+,-./01234567891decimal-arithmetic-0.3.0.0-LmLjtMYXzrX4Zzsp2RvBlxNumeric.DecimalNumeric.Decimal.OperationNumeric.Decimal.ConversionNumeric.Decimal.ArithmeticNumeric.Decimal.PrecisionNumeric.Decimal.RoundingNumeric.Decimal.NumberP2000P1000P500P400P300P250P200P150P100P75P50P49P48P47P46P45P44P43P42P41P40P39P38P37P36P35P34P33P32P31P30P29P28P27P26P25P24P23P22P21P20P19P18P17P16P15P14P13P12P11P10P9P8P7P6P5P4P3P2PTimes2PPlus1P1 PInfiniteFinitePrecision Precision precisionDecimalSignPosNegtoNumbertoScientificString ExceptionSignalClampedDivisionByZeroInexactInvalidOperationOverflowRounded Subnormal UnderflowArithContextexceptionResult raiseSignal getPrecision evalArith newContext Round05UpRoundUp RoundHalfDown RoundFloor RoundCeiling RoundHalfEven RoundHalfUp RoundDownRoundingRoundingAlgorithm squareRootpowermaxmincompareabsminuslog10lnexpdividemultiplysubtractaddcastfromBooltoEngineeringString TrapHandlerSignalsexceptionSignalflagsbasicDefaultContextextendedDefaultContextrunArithsubArith getRoundingsignalsignals allSignals signalMember clearFlagstrap$fMonoidSignals $fShowSignals$fMonadStateContextArith$fMonadErrorExceptionArith $fMonadArith$fApplicativeArith$fFunctorArith $fEqSignal $fEnumSignal$fBoundedSignal $fShowSignal $fEqSignals$fShowExceptionNaNClass QNaNClass SNaNClass NumberClass ZeroClassSubnormalClass NormalClass InfinityClassClassplusfusedMultiplyAdd compareSignal maxMagnitude minMagnitudequantizereduce canonicalclass_copycopyAbs copyNegatecopySign isCanonicalisFinite isInfiniteisNaNisNormalisQNaNisSignedisSNaN isSubnormalisZerologbradix sameQuantumshift $fShowClass$fEqNumberClass $fEqNaNClass $fEqClassGeneralDecimalExtendedDecimal BasicDecimalbaseGHC.BaseNothingP125P124P74P62$fFinitePrecisionPTimes2$fPrecisionPTimes2$fFinitePrecisionPPlus1$fPrecisionPPlus1$fFinitePrecisionP1 $fPrecisionP1$fPrecisionPInfinite roundDecimalRounderDivisor RemainderroundingroundCoefficient getRounder$fRoundingRound05Up$fRoundingRoundUp$fRoundingRoundHalfDown$fRoundingRoundFloor$fRoundingRoundCeiling$fRoundingRoundHalfEven$fRoundingRoundHalfUp$fRoundingRoundDown numDigitsinfiniteSeriesarcsineseriesPicastDownzerooneHalfonetwoten negativeOneinfinityqNaNsNaNflipSign castRounding isPositive isNegativeghc-prim GHC.TypesFalseTrueBooltoBooleLimiteMineMaxeTinyeRangeNumInfQNaNSNaNsign coefficientexponentpayloadPayloadExponent Coefficient negateSignxorSignssignFunc signMatchevalOp enumFromWithnotyetmaxCoefficientadjustedExponent integralValue$fRealFloatDecimal$fFloatingDecimal$fRealFracDecimal$fFractionalDecimal $fRealDecimal $fNumDecimal $fEnumDecimal $fOrdDecimal $fEqDecimal$fPrecisionDecimal $fReadDecimal $fShowDecimal showNumber showExponent mtl-2.2.1-6qsR1PHUy5lL47Hpoa4jCMControl.Monad.Error.Class throwError catchError trapHandler signalListunsignalminMaxQuotientDividendfinitePrecision roundingAlgresultinvalidOperationtoQNaNtoQNaN2 quietToSignaltaylorLnln10 longDivision reciprocal withoutSign powerSign integralPower validShift