]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged the decimal-branch (revisions 54886 to 58140). Decimal is now
authorFacundo Batista <facundobatista@gmail.com>
Thu, 13 Sep 2007 18:13:15 +0000 (18:13 +0000)
committerFacundo Batista <facundobatista@gmail.com>
Thu, 13 Sep 2007 18:13:15 +0000 (18:13 +0000)
fully updated to the latests Decimal Specification (v1.66) and the
latests test cases (v2.56).

Thanks to Mark Dickinson for all his help during this process.

149 files changed:
Lib/decimal.py
Lib/test/decimaltestdata/abs.decTest
Lib/test/decimaltestdata/add.decTest
Lib/test/decimaltestdata/and.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/base.decTest
Lib/test/decimaltestdata/clamp.decTest
Lib/test/decimaltestdata/class.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/compare.decTest
Lib/test/decimaltestdata/comparetotal.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/comparetotmag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/copy.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/copyabs.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/copynegate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/copysign.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddAbs.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddAdd.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddAnd.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddBase.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCanonical.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddClass.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCompare.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCompareSig.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCompareTotal.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCompareTotalMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCopy.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCopyAbs.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCopyNegate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddCopySign.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddDivide.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddDivideInt.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddEncode.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddFMA.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddInvert.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddLogB.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMax.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMaxMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMin.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMinMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMinus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddMultiply.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddNextMinus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddNextPlus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddNextToward.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddOr.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddPlus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddQuantize.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddReduce.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddRemainder.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddRemainderNear.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddRotate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddSameQuantum.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddScaleB.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddShift.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddSubtract.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddToIntegral.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ddXor.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/decDouble.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/decQuad.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/decSingle.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/decimal128.decTest [deleted file]
Lib/test/decimaltestdata/decimal32.decTest [deleted file]
Lib/test/decimaltestdata/decimal64.decTest [deleted file]
Lib/test/decimaltestdata/divide.decTest
Lib/test/decimaltestdata/divideint.decTest
Lib/test/decimaltestdata/dqAbs.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqAdd.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqAnd.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqBase.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCanonical.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqClass.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCompare.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCompareSig.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCompareTotal.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCompareTotalMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCopy.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCopyAbs.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCopyNegate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqCopySign.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqDivide.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqDivideInt.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqEncode.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqFMA.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqInvert.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqLogB.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMax.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMaxMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMin.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMinMag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMinus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqMultiply.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqNextMinus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqNextPlus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqNextToward.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqOr.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqPlus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqQuantize.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqReduce.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqRemainder.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqRemainderNear.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqRotate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqSameQuantum.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqScaleB.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqShift.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqSubtract.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqToIntegral.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dqXor.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dsBase.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/dsEncode.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/exp.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/extra.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/fma.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/inexact.decTest
Lib/test/decimaltestdata/invert.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/ln.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/log10.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/logb.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/max.decTest
Lib/test/decimaltestdata/maxmag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/min.decTest
Lib/test/decimaltestdata/minmag.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/minus.decTest
Lib/test/decimaltestdata/multiply.decTest
Lib/test/decimaltestdata/nextminus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/nextplus.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/nexttoward.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/normalize.decTest [deleted file]
Lib/test/decimaltestdata/or.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/plus.decTest
Lib/test/decimaltestdata/power.decTest
Lib/test/decimaltestdata/powersqrt.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/quantize.decTest
Lib/test/decimaltestdata/randomBound32.decTest
Lib/test/decimaltestdata/randoms.decTest
Lib/test/decimaltestdata/reduce.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/remainder.decTest
Lib/test/decimaltestdata/remainderNear.decTest
Lib/test/decimaltestdata/rescale.decTest
Lib/test/decimaltestdata/rotate.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/rounding.decTest
Lib/test/decimaltestdata/samequantum.decTest
Lib/test/decimaltestdata/scaleb.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/shift.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/squareroot.decTest
Lib/test/decimaltestdata/subtract.decTest
Lib/test/decimaltestdata/testall.decTest
Lib/test/decimaltestdata/tointegral.decTest
Lib/test/decimaltestdata/tointegralx.decTest [new file with mode: 0644]
Lib/test/decimaltestdata/xor.decTest [new file with mode: 0644]
Lib/test/test_decimal.py

index 7c67895560a1dc4f65e259e3bc29dcf4adac33b6..8543e1090a9a09d1e6743b113316adc60af5fcbb 100644 (file)
@@ -128,7 +128,7 @@ __all__ = [
 
     # Constants for use in setting up contexts
     'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING',
-    'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN',
+    'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP',
 
     # Functions for manipulating contexts
     'setcontext', 'getcontext', 'localcontext'
@@ -144,6 +144,7 @@ ROUND_CEILING = 'ROUND_CEILING'
 ROUND_FLOOR = 'ROUND_FLOOR'
 ROUND_UP = 'ROUND_UP'
 ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
+ROUND_05UP = 'ROUND_05UP'
 
 # Rounding decision (not part of the public API)
 NEVER_ROUND = 'NEVER_ROUND'    # Round in division (non-divmod), sqrt ONLY
@@ -204,13 +205,22 @@ class InvalidOperation(DecimalException):
     x ** (non-integer)
     x ** (+-)INF
     An operand is invalid
+
+    The result of the operation after these is a quiet positive NaN,
+    except when the cause is a signaling NaN, in which case the result is
+    also a quiet NaN, but with the original sign, and an optional
+    diagnostic information.
     """
     def handle(self, context, *args):
         if args:
             if args[0] == 1:  # sNaN, must drop 's' but keep diagnostics
-                return Decimal( (args[1]._sign, args[1]._int, 'n') )
+                ans = Decimal((args[1]._sign, args[1]._int, 'n'))
+                return ans._fix_nan(context)
+            elif args[0] == 2:
+                return Decimal( (args[1], args[2], 'n') )
         return NaN
 
+
 class ConversionSyntax(InvalidOperation):
     """Trying to convert badly formed string.
 
@@ -218,9 +228,8 @@ class ConversionSyntax(InvalidOperation):
     converted to a number and it does not conform to the numeric string
     syntax.  The result is [0,qNaN].
     """
-
     def handle(self, context, *args):
-        return (0, (0,), 'n')  # Passed to something which uses a tuple.
+        return NaN
 
 class DivisionByZero(DecimalException, ZeroDivisionError):
     """Division by 0.
@@ -340,7 +349,7 @@ class Overflow(Inexact, Rounded):
 
     def handle(self, context, sign, *args):
         if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN,
-                                     ROUND_HALF_DOWN, ROUND_UP):
+                                ROUND_HALF_DOWN, ROUND_UP):
             return Infsign[sign]
         if sign == 0:
             if context.rounding == ROUND_CEILING:
@@ -562,7 +571,7 @@ class Decimal(object):
                 raise ValueError('Invalid sign')
             for digit in value[1]:
                 if not isinstance(digit, (int,long)) or digit < 0:
-                    raise ValueError("The second value in the tuple must be"
+                    raise ValueError("The second value in the tuple must be "
                                 "composed of non negative integer elements.")
             self._sign = value[0]
             self._int  = tuple(value[1])
@@ -596,10 +605,6 @@ class Decimal(object):
             if _isnan(value):
                 sig, sign, diag = _isnan(value)
                 self._is_special = True
-                if len(diag) > context.prec:  # Diagnostic info too long
-                    self._sign, self._int, self._exp = \
-                                context._raise_error(ConversionSyntax)
-                    return self
                 if sig == 1:
                     self._exp = 'n'  # qNaN
                 else:  # sig == 2
@@ -611,9 +616,8 @@ class Decimal(object):
                 self._sign, self._int, self._exp = _string2exact(value)
             except ValueError:
                 self._is_special = True
-                self._sign, self._int, self._exp = \
-                              context._raise_error(ConversionSyntax,
-                                  "Invalid literal for Decimal: %r" % value)
+                return context._raise_error(ConversionSyntax,
+                                   "Invalid literal for Decimal: %r" % value)
             return self
 
         raise TypeError("Cannot convert %r to Decimal" % value)
@@ -622,7 +626,7 @@ class Decimal(object):
         """Returns whether the number is not actually one.
 
         0 if a number
-        1 if NaN
+        1 if NaN  (it could be a normal quiet NaN or a phantom one)
         2 if sNaN
         """
         if self._is_special:
@@ -646,7 +650,7 @@ class Decimal(object):
             return 1
         return 0
 
-    def _check_nans(self, other = None, context=None):
+    def _check_nans(self, other=None, context=None):
         """Returns whether the number is not actually one.
 
         if self, other are sNaN, signal
@@ -673,9 +677,9 @@ class Decimal(object):
                 return context._raise_error(InvalidOperation, 'sNaN',
                                         1, other)
             if self_is_nan:
-                return self
+                return self._fix_nan(context)
 
-            return other
+            return other._fix_nan(context)
         return 0
 
     def __nonzero__(self):
@@ -685,24 +689,31 @@ class Decimal(object):
         1 if self != 0
         """
         if self._is_special:
-            return 1
+            return True
         return sum(self._int) != 0
 
-    def __cmp__(self, other, context=None):
+    def __cmp__(self, other):
         other = _convert_other(other)
         if other is NotImplemented:
-            return other
+            # Never return NotImplemented
+            return 1
 
         if self._is_special or other._is_special:
-            ans = self._check_nans(other, context)
-            if ans:
+            # check for nans, without raising on a signaling nan
+            if self._isnan() or other._isnan():
                 return 1  # Comparison involving NaN's always reports self > other
 
             # INF = INF
             return cmp(self._isinfinity(), other._isinfinity())
 
-        if not self and not other:
-            return 0  # If both 0, sign comparison isn't certain.
+        # check for zeros;  note that cmp(0, -0) should return 0
+        if not self:
+            if not other:
+                return 0
+            else:
+                return -((-1)**other._sign)
+        if not other:
+            return (-1)**self._sign
 
         # If different signs, neg one is less
         if other._sign < self._sign:
@@ -712,35 +723,15 @@ class Decimal(object):
 
         self_adjusted = self.adjusted()
         other_adjusted = other.adjusted()
-        if self_adjusted == other_adjusted and \
-           self._int + (0,)*(self._exp - other._exp) == \
-           other._int + (0,)*(other._exp - self._exp):
-            return 0  # equal, except in precision. ([0]*(-x) = [])
-        elif self_adjusted > other_adjusted and self._int[0] != 0:
+        if self_adjusted == other_adjusted:
+            self_padded = self._int + (0,)*(self._exp - other._exp)
+            other_padded = other._int + (0,)*(other._exp - self._exp)
+            return cmp(self_padded, other_padded) * (-1)**self._sign
+        elif self_adjusted > other_adjusted:
             return (-1)**self._sign
-        elif self_adjusted < other_adjusted and other._int[0] != 0:
+        else: # self_adjusted < other_adjusted
             return -((-1)**self._sign)
 
-        # Need to round, so make sure we have a valid context
-        if context is None:
-            context = getcontext()
-
-        context = context._shallow_copy()
-        rounding = context._set_rounding(ROUND_UP)  # round away from 0
-
-        flags = context._ignore_all_flags()
-        res = self.__sub__(other, context=context)
-
-        context._regard_flags(*flags)
-
-        context.rounding = rounding
-
-        if not res:
-            return 0
-        elif res._sign:
-            return -1
-        return 1
-
     def __eq__(self, other):
         if not isinstance(other, (Decimal, int, long)):
             return NotImplemented
@@ -760,9 +751,7 @@ class Decimal(object):
         NaN => one is NaN
         Like __cmp__, but returns Decimal instances.
         """
-        other = _convert_other(other)
-        if other is NotImplemented:
-            return other
+        other = _convert_other(other, raiseit=True)
 
         # Compare(NaN, NaN) = NaN
         if (self._is_special or other and other._is_special):
@@ -770,7 +759,7 @@ class Decimal(object):
             if ans:
                 return ans
 
-        return Decimal(self.__cmp__(other, context))
+        return Decimal(self.__cmp__(other))
 
     def __hash__(self):
         """x.__hash__() <==> hash(x)"""
@@ -799,7 +788,7 @@ class Decimal(object):
         # Invariant:  eval(repr(d)) == d
         return 'Decimal("%s")' % str(self)
 
-    def __str__(self, eng = 0, context=None):
+    def __str__(self, eng=False, context=None):
         """Return string representation of the number in scientific notation.
 
         Captures all of the information in the underlying representation.
@@ -889,7 +878,7 @@ class Decimal(object):
 
         Same rules for when in exponential and when as a value as in __str__.
         """
-        return self.__str__(eng=1, context=context)
+        return self.__str__(eng=True, context=context)
 
     def __neg__(self, context=None):
         """Returns a copy with the sign switched.
@@ -903,17 +892,15 @@ class Decimal(object):
 
         if not self:
             # -Decimal('0') is Decimal('0'), not Decimal('-0')
-            sign = 0
-        elif self._sign:
-            sign = 0
+            ans = self.copy_sign(Dec_0)
         else:
-            sign = 1
+            ans = self.copy_negate()
 
         if context is None:
             context = getcontext()
         if context._rounding_decision == ALWAYS_ROUND:
-            return Decimal((sign, self._int, self._exp))._fix(context)
-        return Decimal( (sign, self._int, self._exp))
+            return ans._fix(context)
+        return ans
 
     def __pos__(self, context=None):
         """Returns a copy, unless it is a sNaN.
@@ -925,19 +912,16 @@ class Decimal(object):
             if ans:
                 return ans
 
-        sign = self._sign
         if not self:
             # + (-0) = 0
-            sign = 0
+            ans = self.copy_sign(Dec_0)
+        else:
+            ans = Decimal(self)
 
         if context is None:
             context = getcontext()
-
         if context._rounding_decision == ALWAYS_ROUND:
-            ans = self._fix(context)
-        else:
-            ans = Decimal(self)
-        ans._sign = sign
+            return ans._fix(context)
         return ans
 
     def __abs__(self, round=1, context=None):
@@ -1000,16 +984,19 @@ class Decimal(object):
             sign = min(self._sign, other._sign)
             if negativezero:
                 sign = 1
-            return Decimal( (sign, (0,), exp))
+            ans = Decimal( (sign, (0,), exp))
+            if shouldround:
+                ans = ans._fix(context)
+            return ans
         if not self:
             exp = max(exp, other._exp - context.prec-1)
-            ans = other._rescale(exp, watchexp=0, context=context)
+            ans = other._rescale(exp, context.rounding)
             if shouldround:
                 ans = ans._fix(context)
             return ans
         if not other:
             exp = max(exp, self._exp - context.prec-1)
-            ans = self._rescale(exp, watchexp=0, context=context)
+            ans = self._rescale(exp, context.rounding)
             if shouldround:
                 ans = ans._fix(context)
             return ans
@@ -1022,10 +1009,10 @@ class Decimal(object):
         if op1.sign != op2.sign:
             # Equal and opposite
             if op1.int == op2.int:
-                if exp < context.Etiny():
-                    exp = context.Etiny()
-                    context._raise_error(Clamped)
-                return Decimal((negativezero, (0,), exp))
+                ans = Decimal((negativezero, (0,), exp))
+                if shouldround:
+                    ans = ans._fix(context)
+                return ans
             if op1.int < op2.int:
                 op1, op2 = op2, op1
                 # OK, now abs(op1) > abs(op2)
@@ -1056,7 +1043,7 @@ class Decimal(object):
     __radd__ = __add__
 
     def __sub__(self, other, context=None):
-        """Return self + (-other)"""
+        """Return self - other"""
         other = _convert_other(other)
         if other is NotImplemented:
             return other
@@ -1066,41 +1053,28 @@ class Decimal(object):
             if ans:
                 return ans
 
-        # -Decimal(0) = Decimal(0), which we don't want since
-        # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.)
-        # so we change the sign directly to a copy
-        tmp = Decimal(other)
-        tmp._sign = 1-tmp._sign
-
-        return self.__add__(tmp, context=context)
+        # self - other is computed as self + other.copy_negate()
+        return self.__add__(other.copy_negate(), context=context)
 
     def __rsub__(self, other, context=None):
-        """Return other + (-self)"""
+        """Return other - self"""
         other = _convert_other(other)
         if other is NotImplemented:
             return other
 
-        tmp = Decimal(self)
-        tmp._sign = 1 - tmp._sign
-        return other.__add__(tmp, context=context)
+        return other.__sub__(self, context=context)
 
-    def _increment(self, round=1, context=None):
+    def _increment(self):
         """Special case of add, adding 1eExponent
 
         Since it is common, (rounding, for example) this adds
         (sign)*one E self._exp to the number more efficiently than add.
 
+        Assumes that self is nonspecial.
+
         For example:
         Decimal('5.624e10')._increment() == Decimal('5.625e10')
         """
-        if self._is_special:
-            ans = self._check_nans(context=context)
-            if ans:
-                return ans
-
-            # Must be infinite, and incrementing makes no difference
-            return Decimal(self)
-
         L = list(self._int)
         L[-1] += 1
         spot = len(L)-1
@@ -1111,13 +1085,7 @@ class Decimal(object):
                 break
             L[spot-1] += 1
             spot -= 1
-        ans = Decimal((self._sign, L, self._exp))
-
-        if context is None:
-            context = getcontext()
-        if round and context._rounding_decision == ALWAYS_ROUND:
-            ans = ans._fix(context)
-        return ans
+        return Decimal((self._sign, L, self._exp))
 
     def __mul__(self, other, context=None):
         """Return self * other.
@@ -1207,6 +1175,8 @@ class Decimal(object):
         if context is None:
             context = getcontext()
 
+        shouldround = context._rounding_decision == ALWAYS_ROUND
+
         sign = self._sign ^ other._sign
 
         if self._is_special or other._is_special:
@@ -1218,10 +1188,11 @@ class Decimal(object):
 
             if self._isinfinity() and other._isinfinity():
                 if divmod:
-                    return (context._raise_error(InvalidOperation,
+                    reloco = (context._raise_error(InvalidOperation,
                                             '(+-)INF // (+-)INF'),
                             context._raise_error(InvalidOperation,
                                             '(+-)INF % (+-)INF'))
+                    return reloco
                 return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF')
 
             if self._isinfinity():
@@ -1237,7 +1208,10 @@ class Decimal(object):
 
             if other._isinfinity():
                 if divmod:
-                    return (Decimal((sign, (0,), 0)), Decimal(self))
+                    otherside = Decimal(self)
+                    if shouldround and (divmod == 1 or divmod == 3):
+                        otherside = otherside._fix(context)
+                    return (Decimal((sign, (0,), 0)), otherside)
                 context._raise_error(Clamped, 'Division by infinity')
                 return Decimal((sign, (0,), context.Etiny()))
 
@@ -1249,17 +1223,14 @@ class Decimal(object):
 
         if not self:
             if divmod:
-                otherside = Decimal(self)
-                otherside._exp = min(self._exp, other._exp)
+                otherside = Decimal((self._sign, (0,), min(self._exp, other._exp)))
+                if shouldround and (divmod == 1 or divmod == 3):
+                    otherside = otherside._fix(context)
                 return (Decimal((sign, (0,), 0)),  otherside)
             exp = self._exp - other._exp
-            if exp < context.Etiny():
-                exp = context.Etiny()
-                context._raise_error(Clamped, '0e-x / y')
-            if exp > context.Emax:
-                exp = context.Emax
-                context._raise_error(Clamped, '0e+x / y')
-            return Decimal( (sign, (0,), exp) )
+            ans = Decimal((sign, (0,), exp))
+            ans = ans._fix(context)
+            return ans
 
         if not other:
             if divmod:
@@ -1268,7 +1239,6 @@ class Decimal(object):
             return context._raise_error(DivisionByZero, 'x / 0', sign)
 
         # OK, so neither = 0, INF or NaN
-        shouldround = context._rounding_decision == ALWAYS_ROUND
 
         # If we're dividing into ints, and self < other, stop.
         # self.__abs__(0) does not round.
@@ -1276,7 +1246,7 @@ class Decimal(object):
 
             if divmod == 1 or divmod == 3:
                 exp = min(self._exp, other._exp)
-                ans2 = self._rescale(exp, context=context, watchexp=0)
+                ans2 = self._rescale(exp, context.rounding)
                 if shouldround:
                     ans2 = ans2._fix(context)
                 return (Decimal( (sign, (0,), 0) ),
@@ -1302,12 +1272,9 @@ class Decimal(object):
                 if res.int >= prec_limit and shouldround:
                     return context._raise_error(DivisionImpossible)
                 otherside = Decimal(op1)
-                frozen = context._ignore_all_flags()
-
                 exp = min(self._exp, other._exp)
-                otherside = otherside._rescale(exp, context=context, watchexp=0)
-                context._regard_flags(*frozen)
-                if shouldround:
+                otherside = otherside._rescale(exp, context.rounding)
+                if shouldround and (divmod == 1 or divmod == 3):
                     otherside = otherside._fix(context)
                 return (Decimal(res), otherside)
 
@@ -1331,21 +1298,6 @@ class Decimal(object):
             op1.int *= 10
             op1.exp -= 1
 
-            if res.exp == 0 and divmod and op2.int > op1.int:
-                # Solves an error in precision.  Same as a previous block.
-
-                if res.int >= prec_limit and shouldround:
-                    return context._raise_error(DivisionImpossible)
-                otherside = Decimal(op1)
-                frozen = context._ignore_all_flags()
-
-                exp = min(self._exp, other._exp)
-                otherside = otherside._rescale(exp, context=context)
-
-                context._regard_flags(*frozen)
-
-                return (Decimal(res), otherside)
-
         ans = Decimal(res)
         if shouldround:
             ans = ans._fix(context)
@@ -1401,81 +1353,76 @@ class Decimal(object):
         """
         Remainder nearest to 0-  abs(remainder-near) <= other/2
         """
-        other = _convert_other(other)
-        if other is NotImplemented:
-            return other
-
-        if self._is_special or other._is_special:
-            ans = self._check_nans(other, context)
-            if ans:
-                return ans
-        if self and not other:
-            return context._raise_error(InvalidOperation, 'x % 0')
-
         if context is None:
             context = getcontext()
-        # If DivisionImpossible causes an error, do not leave Rounded/Inexact
-        # ignored in the calling function.
-        context = context._shallow_copy()
-        flags = context._ignore_flags(Rounded, Inexact)
-        # Keep DivisionImpossible flags
-        (side, r) = self.__divmod__(other, context=context)
-
-        if r._isnan():
-            context._regard_flags(*flags)
-            return r
 
-        context = context._shallow_copy()
-        rounding = context._set_rounding_decision(NEVER_ROUND)
-
-        if other._sign:
-            comparison = other.__div__(Decimal(-2), context=context)
-        else:
-            comparison = other.__div__(Decimal(2), context=context)
+        other = _convert_other(other, raiseit=True)
 
-        context._set_rounding_decision(rounding)
-        context._regard_flags(*flags)
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
 
-        s1, s2 = r._sign, comparison._sign
-        r._sign, comparison._sign = 0, 0
+        # self == +/-infinity -> InvalidOperation
+        if self._isinfinity():
+            return context._raise_error(InvalidOperation,
+                                        'remainder_near(infinity, x)')
 
-        if r < comparison:
-            r._sign, comparison._sign = s1, s2
-            # Get flags now
-            self.__divmod__(other, context=context)
-            return r._fix(context)
-        r._sign, comparison._sign = s1, s2
+        # other == 0 -> either InvalidOperation or DivisionUndefined
+        if not other:
+            if self:
+                return context._raise_error(InvalidOperation,
+                                            'remainder_near(x, 0)')
+            else:
+                return context._raise_error(DivisionUndefined,
+                                            'remainder_near(0, 0)')
 
-        rounding = context._set_rounding_decision(NEVER_ROUND)
+        # other = +/-infinity -> remainder = self
+        if other._isinfinity():
+            ans = Decimal(self)
+            return ans._fix(context)
 
-        (side, r) = self.__divmod__(other, context=context)
-        context._set_rounding_decision(rounding)
-        if r._isnan():
-            return r
+        # self = 0 -> remainder = self, with ideal exponent
+        ideal_exponent = min(self._exp, other._exp)
+        if not self:
+            ans = Decimal((self._sign, (0,), ideal_exponent))
+            return ans._fix(context)
 
-        decrease = not side._iseven()
-        rounding = context._set_rounding_decision(NEVER_ROUND)
-        side = side.__abs__(context=context)
-        context._set_rounding_decision(rounding)
+        # catch most cases of large or small quotient
+        expdiff = self.adjusted() - other.adjusted()
+        if expdiff >= context.prec + 1:
+            # expdiff >= prec+1 => abs(self/other) > 10**prec
+            return context._raise_error(DivisionImpossible)[0]
+        if expdiff <= -2:
+            # expdiff <= -2 => abs(self/other) < 0.1
+            ans = self._rescale(ideal_exponent, context.rounding)
+            return ans._fix(context)
 
-        s1, s2 = r._sign, comparison._sign
-        r._sign, comparison._sign = 0, 0
-        if r > comparison or decrease and r == comparison:
-            r._sign, comparison._sign = s1, s2
-            context.prec += 1
-            numbsquant = len(side.__add__(Decimal(1), context=context)._int)
-            if numbsquant >= context.prec:
-                context.prec -= 1
-                return context._raise_error(DivisionImpossible)[1]
-            context.prec -= 1
-            if self._sign == other._sign:
-                r = r.__sub__(other, context=context)
-            else:
-                r = r.__add__(other, context=context)
+        # adjust both arguments to have the same exponent, then divide
+        op1 = _WorkRep(self)
+        op2 = _WorkRep(other)
+        if op1.exp >= op2.exp:
+            op1.int *= 10**(op1.exp - op2.exp)
         else:
-            r._sign, comparison._sign = s1, s2
+            op2.int *= 10**(op2.exp - op1.exp)
+        q, r = divmod(op1.int, op2.int)
+        # remainder is r*10**ideal_exponent; other is +/-op2.int *
+        # 10**ideal_exponent.   Apply correction to ensure that
+        # abs(remainder) <= abs(other)/2
+        if 2*r + (q&1) > op2.int:
+            r -= op2.int
+            q += 1
+
+        if q >= 10**context.prec:
+            return context._raise_error(DivisionImpossible)[0]
+
+        # result has same sign as self unless r is negative
+        sign = self._sign
+        if r < 0:
+            sign = 1-sign
+            r = -r
 
-        return r._fix(context)
+        ans = Decimal((sign, map(int, str(r)), ideal_exponent))
+        return ans._fix(context)
 
     def __floordiv__(self, other, context=None):
         """self // other"""
@@ -1500,14 +1447,11 @@ class Decimal(object):
                 return context._raise_error(InvalidContext)
             elif self._isinfinity():
                 raise OverflowError("Cannot convert infinity to long")
+        s = (-1)**self._sign
         if self._exp >= 0:
-            s = ''.join(map(str, self._int)) + '0'*self._exp
+            return s*int(''.join(map(str, self._int)))*10**self._exp
         else:
-            s = ''.join(map(str, self._int))[:self._exp]
-        if s == '':
-            s = '0'
-        sign = '-'*self._sign
-        return int(sign + s)
+            return s*int(''.join(map(str, self._int))[:self._exp] or '0')
 
     def __long__(self):
         """Converts to a long.
@@ -1516,6 +1460,21 @@ class Decimal(object):
         """
         return long(self.__int__())
 
+    def _fix_nan(self, context):
+        """Decapitate the payload of a NaN to fit the context"""
+        payload = self._int
+
+        # maximum length of payload is precision if _clamp=0,
+        # precision-1 if _clamp=1.
+        max_payload_len = context.prec - context._clamp
+        if len(payload) > max_payload_len:
+            pos = len(payload)-max_payload_len
+            while pos < len(payload) and payload[pos] == 0:
+                pos += 1
+            payload = payload[pos:]
+            return Decimal((self._sign, payload, self._exp))
+        return self
+
     def _fix(self, context):
         """Round if it is necessary to keep self within prec precision.
 
@@ -1525,338 +1484,693 @@ class Decimal(object):
         self - Decimal instance
         context - context used.
         """
-        if self._is_special:
-            return self
-        if context is None:
-            context = getcontext()
-        prec = context.prec
-        ans = self._fixexponents(context)
-        if len(ans._int) > prec:
-            ans = ans._round(prec, context=context)
-            ans = ans._fixexponents(context)
-        return ans
-
-    def _fixexponents(self, context):
-        """Fix the exponents and return a copy with the exponent in bounds.
-        Only call if known to not be a special value.
-        """
-        folddown = context._clamp
-        Emin = context.Emin
-        ans = self
-        ans_adjusted = ans.adjusted()
-        if ans_adjusted < Emin:
-            Etiny = context.Etiny()
-            if ans._exp < Etiny:
-                if not ans:
-                    ans = Decimal(self)
-                    ans._exp = Etiny
-                    context._raise_error(Clamped)
-                    return ans
-                ans = ans._rescale(Etiny, context=context)
-                # It isn't zero, and exp < Emin => subnormal
-                context._raise_error(Subnormal)
-                if context.flags[Inexact]:
-                    context._raise_error(Underflow)
-            else:
-                if ans:
-                    # Only raise subnormal if non-zero.
-                    context._raise_error(Subnormal)
-        else:
-            Etop = context.Etop()
-            if folddown and ans._exp > Etop:
-                context._raise_error(Clamped)
-                ans = ans._rescale(Etop, context=context)
-            else:
-                Emax = context.Emax
-                if ans_adjusted > Emax:
-                    if not ans:
-                        ans = Decimal(self)
-                        ans._exp = Emax
-                        context._raise_error(Clamped)
-                        return ans
-                    context._raise_error(Inexact)
-                    context._raise_error(Rounded)
-                    c = context._raise_error(Overflow, 'above Emax', ans._sign)
-                    return c
-        return ans
-
-    def _round(self, prec=None, rounding=None, context=None):
-        """Returns a rounded version of self.
-
-        You can specify the precision or rounding method.  Otherwise, the
-        context determines it.
-        """
-
-        if self._is_special:
-            ans = self._check_nans(context=context)
-            if ans:
-                return ans
-
-            if self._isinfinity():
-                return Decimal(self)
 
         if context is None:
             context = getcontext()
 
-        if rounding is None:
-            rounding = context.rounding
-        if prec is None:
-            prec = context.prec
+        if self._is_special:
+            if self._isnan():
+                # decapitate payload if necessary
+                return self._fix_nan(context)
+            else:
+                # self is +/-Infinity; return unaltered
+                return self
 
+        # if self is zero then exponent should be between Etiny and
+        # Emax if _clamp==0, and between Etiny and Etop if _clamp==1.
+        Etiny = context.Etiny()
+        Etop = context.Etop()
         if not self:
-            if prec <= 0:
-                dig = (0,)
-                exp = len(self._int) - prec + self._exp
+            exp_max = [context.Emax, Etop][context._clamp]
+            new_exp = min(max(self._exp, Etiny), exp_max)
+            if new_exp != self._exp:
+                context._raise_error(Clamped)
+                return Decimal((self._sign, (0,), new_exp))
             else:
-                dig = (0,) * prec
-                exp = len(self._int) + self._exp - prec
-            ans = Decimal((self._sign, dig, exp))
-            context._raise_error(Rounded)
-            return ans
+                return self
 
-        if prec == 0:
-            temp = Decimal(self)
-            temp._int = (0,)+temp._int
-            prec = 1
-        elif prec < 0:
-            exp = self._exp + len(self._int) - prec - 1
-            temp = Decimal( (self._sign, (0, 1), exp))
-            prec = 1
-        else:
-            temp = Decimal(self)
-
-        numdigits = len(temp._int)
-        if prec == numdigits:
-            return temp
-
-        # See if we need to extend precision
-        expdiff = prec - numdigits
-        if expdiff > 0:
-            tmp = list(temp._int)
-            tmp.extend([0] * expdiff)
-            ans =  Decimal( (temp._sign, tmp, temp._exp - expdiff))
-            return ans
+        # exp_min is the smallest allowable exponent of the result,
+        # equal to max(self.adjusted()-context.prec+1, Etiny)
+        exp_min = len(self._int) + self._exp - context.prec
+        if exp_min > Etop:
+            # overflow: exp_min > Etop iff self.adjusted() > Emax
+            context._raise_error(Inexact)
+            context._raise_error(Rounded)
+            return context._raise_error(Overflow, 'above Emax', self._sign)
+        self_is_subnormal = exp_min < Etiny
+        if self_is_subnormal:
+            context._raise_error(Subnormal)
+            exp_min = Etiny
 
-        # OK, but maybe all the lost digits are 0.
-        lostdigits = self._int[expdiff:]
-        if lostdigits == (0,) * len(lostdigits):
-            ans = Decimal( (temp._sign, temp._int[:prec], temp._exp - expdiff))
-            # Rounded, but not Inexact
+        # round if self has too many digits
+        if self._exp < exp_min:
             context._raise_error(Rounded)
+            ans = self._rescale(exp_min, context.rounding)
+            if ans != self:
+                context._raise_error(Inexact)
+                if self_is_subnormal:
+                    context._raise_error(Underflow)
+                    if not ans:
+                        # raise Clamped on underflow to 0
+                        context._raise_error(Clamped)
+                elif len(ans._int) == context.prec+1:
+                    # we get here only if rescaling rounds the
+                    # cofficient up to exactly 10**context.prec
+                    if ans._exp < Etop:
+                        ans = Decimal((ans._sign, ans._int[:-1], ans._exp+1))
+                    else:
+                        # Inexact and Rounded have already been raised
+                        ans = context._raise_error(Overflow, 'above Emax',
+                                                   self._sign)
             return ans
 
-        # Okay, let's round and lose data
-
-        this_function = getattr(temp, self._pick_rounding_function[rounding])
-        # Now we've got the rounding function
+        # fold down if _clamp == 1 and self has too few digits
+        if context._clamp == 1 and self._exp > Etop:
+            context._raise_error(Clamped)
+            self_padded = self._int + (0,)*(self._exp - Etop)
+            return Decimal((self._sign, self_padded, Etop))
 
-        if prec != context.prec:
-            context = context._shallow_copy()
-            context.prec = prec
-        ans = this_function(prec, expdiff, context)
-        context._raise_error(Rounded)
-        context._raise_error(Inexact, 'Changed in rounding')
-
-        return ans
+        # here self was representable to begin with; return unchanged
+        return self
 
     _pick_rounding_function = {}
 
-    def _round_down(self, prec, expdiff, context):
-        """Also known as round-towards-0, truncate."""
-        return Decimal( (self._sign, self._int[:prec], self._exp - expdiff) )
+    # for each of the rounding functions below:
+    #   self is a finite, nonzero Decimal
+    #   prec is an integer satisfying 0 <= prec < len(self._int)
+    # the rounded result will have exponent self._exp + len(self._int) - prec;
 
-    def _round_half_up(self, prec, expdiff, context, tmp = None):
-        """Rounds 5 up (away from 0)"""
+    def _round_down(self, prec):
+        """Also known as round-towards-0, truncate."""
+        newexp = self._exp + len(self._int) - prec
+        return Decimal((self._sign, self._int[:prec] or (0,), newexp))
 
-        if tmp is None:
-            tmp = Decimal( (self._sign,self._int[:prec], self._exp - expdiff))
-        if self._int[prec] >= 5:
-            tmp = tmp._increment(round=0, context=context)
-            if len(tmp._int) > prec:
-                return Decimal( (tmp._sign, tmp._int[:-1], tmp._exp + 1))
+    def _round_up(self, prec):
+        """Rounds away from 0."""
+        newexp = self._exp + len(self._int) - prec
+        tmp = Decimal((self._sign, self._int[:prec] or (0,), newexp))
+        for digit in self._int[prec:]:
+            if digit != 0:
+                return tmp._increment()
         return tmp
 
-    def _round_half_even(self, prec, expdiff, context):
-        """Round 5 to even, rest to nearest."""
-
-        tmp = Decimal( (self._sign, self._int[:prec], self._exp - expdiff))
-        half = (self._int[prec] == 5)
-        if half:
-            for digit in self._int[prec+1:]:
-                if digit != 0:
-                    half = 0
-                    break
-        if half:
-            if self._int[prec-1] & 1 == 0:
-                return tmp
-        return self._round_half_up(prec, expdiff, context, tmp)
+    def _round_half_up(self, prec):
+        """Rounds 5 up (away from 0)"""
+        if self._int[prec] >= 5:
+            return self._round_up(prec)
+        else:
+            return self._round_down(prec)
 
-    def _round_half_down(self, prec, expdiff, context):
+    def _round_half_down(self, prec):
         """Round 5 down"""
-
-        tmp = Decimal( (self._sign, self._int[:prec], self._exp - expdiff))
-        half = (self._int[prec] == 5)
-        if half:
+        if self._int[prec] == 5:
             for digit in self._int[prec+1:]:
                 if digit != 0:
-                    half = 0
                     break
-        if half:
-            return tmp
-        return self._round_half_up(prec, expdiff, context, tmp)
+            else:
+                return self._round_down(prec)
+        return self._round_half_up(prec)
 
-    def _round_up(self, prec, expdiff, context):
-        """Rounds away from 0."""
-        tmp = Decimal( (self._sign, self._int[:prec], self._exp - expdiff) )
-        for digit in self._int[prec:]:
-            if digit != 0:
-                tmp = tmp._increment(round=1, context=context)
-                if len(tmp._int) > prec:
-                    return Decimal( (tmp._sign, tmp._int[:-1], tmp._exp + 1))
-                else:
-                    return tmp
-        return tmp
+    def _round_half_even(self, prec):
+        """Round 5 to even, rest to nearest."""
+        if prec and self._int[prec-1] & 1:
+            return self._round_half_up(prec)
+        else:
+            return self._round_half_down(prec)
 
-    def _round_ceiling(self, prec, expdiff, context):
+    def _round_ceiling(self, prec):
         """Rounds up (not away from 0 if negative.)"""
         if self._sign:
-            return self._round_down(prec, expdiff, context)
+            return self._round_down(prec)
         else:
-            return self._round_up(prec, expdiff, context)
+            return self._round_up(prec)
 
-    def _round_floor(self, prec, expdiff, context):
+    def _round_floor(self, prec):
         """Rounds down (not towards 0 if negative)"""
         if not self._sign:
-            return self._round_down(prec, expdiff, context)
+            return self._round_down(prec)
         else:
-            return self._round_up(prec, expdiff, context)
+            return self._round_up(prec)
 
-    def __pow__(self, n, modulo = None, context=None):
-        """Return self ** n (mod modulo)
+    def _round_05up(self, prec):
+        """Round down unless digit prec-1 is 0 or 5."""
+        if prec == 0 or self._int[prec-1] in (0, 5):
+            return self._round_up(prec)
+        else:
+            return self._round_down(prec)
+
+    def fma(self, other, third, context=None):
+        """Fused multiply-add.
 
-        If modulo is None (default), don't take it mod modulo.
+        Returns self*other+third with no rounding of the intermediate
+        product self*other.
+
+        self and other are multiplied together, with no rounding of
+        the result.  The third operand is then added to the result,
+        and a single final rounding is performed.
         """
-        n = _convert_other(n)
-        if n is NotImplemented:
-            return n
+
+        other = _convert_other(other, raiseit=True)
+        third = _convert_other(third, raiseit=True)
 
         if context is None:
             context = getcontext()
 
-        if self._is_special or n._is_special or n.adjusted() > 8:
-            # Because the spot << doesn't work with really big exponents
-            if n._isinfinity() or n.adjusted() > 8:
-                return context._raise_error(InvalidOperation, 'x ** INF')
+        # do self*other in fresh context with no traps and no rounding
+        mul_context = Context(traps=[], flags=[],
+                              _rounding_decision=NEVER_ROUND)
+        product = self.__mul__(other, mul_context)
 
-            ans = self._check_nans(n, context)
-            if ans:
-                return ans
+        if mul_context.flags[InvalidOperation]:
+            # reraise in current context
+            return context._raise_error(InvalidOperation,
+                                        'invalid multiplication in fma',
+                                        1, product)
 
-        if not n._isinteger():
-            return context._raise_error(InvalidOperation, 'x ** (non-integer)')
+        ans = product.__add__(third, context)
+        return ans
 
-        if not self and not n:
-            return context._raise_error(InvalidOperation, '0 ** 0')
+    def _power_modulo(self, other, modulo, context=None):
+        """Three argument version of __pow__"""
 
-        if not n:
-            return Decimal(1)
+        # if can't convert other and modulo to Decimal, raise
+        # TypeError; there's no point returning NotImplemented (no
+        # equivalent of __rpow__ for three argument pow)
+        other = _convert_other(other, raiseit=True)
+        modulo = _convert_other(modulo, raiseit=True)
 
-        if self == Decimal(1):
-            return Decimal(1)
+        if context is None:
+            context = getcontext()
 
-        sign = self._sign and not n._iseven()
-        n = int(n)
+        # deal with NaNs: if there are any sNaNs then first one wins,
+        # (i.e. behaviour for NaNs is identical to that of fma)
+        self_is_nan = self._isnan()
+        other_is_nan = other._isnan()
+        modulo_is_nan = modulo._isnan()
+        if self_is_nan or other_is_nan or modulo_is_nan:
+            if self_is_nan == 2:
+                return context._raise_error(InvalidOperation, 'sNaN',
+                                        1, self)
+            if other_is_nan == 2:
+                return context._raise_error(InvalidOperation, 'sNaN',
+                                        1, other)
+            if modulo_is_nan == 2:
+                return context._raise_error(InvalidOperation, 'sNaN',
+                                        1, modulo)
+            if self_is_nan:
+                return self
+            if other_is_nan:
+                return other
+            return modulo
+
+        # check inputs: we apply same restrictions as Python's pow()
+        if not (self._isinteger() and
+                other._isinteger() and
+                modulo._isinteger()):
+            return context._raise_error(InvalidOperation,
+                                        'pow() 3rd argument not allowed '
+                                        'unless all arguments are integers')
+        if other < 0:
+            return context._raise_error(InvalidOperation,
+                                        'pow() 2nd argument cannot be '
+                                        'negative when 3rd argument specified')
+        if not modulo:
+            return context._raise_error(InvalidOperation,
+                                        'pow() 3rd argument cannot be 0')
+
+        # additional restriction for decimal: the modulus must be less
+        # than 10**prec in absolute value
+        if modulo.adjusted() >= context.prec:
+            return context._raise_error(InvalidOperation,
+                                        'insufficient precision: pow() 3rd '
+                                        'argument must not have more than '
+                                        'precision digits')
+
+        # define 0**0 == NaN, for consistency with two-argument pow
+        # (even though it hurts!)
+        if not other and not self:
+            return context._raise_error(InvalidOperation,
+                                        'at least one of pow() 1st argument '
+                                        'and 2nd argument must be nonzero ;'
+                                        '0**0 is not defined')
+
+        # compute sign of result
+        if other._iseven():
+            sign = 0
+        else:
+            sign = self._sign
+
+        # convert modulo to a Python integer, and self and other to
+        # Decimal integers (i.e. force their exponents to be >= 0)
+        modulo = abs(int(modulo))
+        base = _WorkRep(self.to_integral_value())
+        exponent = _WorkRep(other.to_integral_value())
+
+        # compute result using integer pow()
+        base = (base.int % modulo * pow(10, base.exp, modulo)) % modulo
+        for i in xrange(exponent.exp):
+            base = pow(base, 10, modulo)
+        base = pow(base, exponent.int, modulo)
+
+        return Decimal((sign, map(int, str(base)), 0))
+
+    def _power_exact(self, other, p):
+        """Attempt to compute self**other exactly.
+
+        Given Decimals self and other and an integer p, attempt to
+        compute an exact result for the power self**other, with p
+        digits of precision.  Return None if self**other is not
+        exactly representable in p digits.
+
+        Assumes that elimination of special cases has already been
+        performed: self and other must both be nonspecial; self must
+        be positive and not numerically equal to 1; other must be
+        nonzero.  For efficiency, other._exp should not be too large,
+        so that 10**abs(other._exp) is a feasible calculation."""
+
+        # In the comments below, we write x for the value of self and
+        # y for the value of other.  Write x = xc*10**xe and y =
+        # yc*10**ye.
+
+        # The main purpose of this method is to identify the *failure*
+        # of x**y to be exactly representable with as little effort as
+        # possible.  So we look for cheap and easy tests that
+        # eliminate the possibility of x**y being exact.  Only if all
+        # these tests are passed do we go on to actually compute x**y.
+
+        # Here's the main idea.  First normalize both x and y.  We
+        # express y as a rational m/n, with m and n relatively prime
+        # and n>0.  Then for x**y to be exactly representable (at
+        # *any* precision), xc must be the nth power of a positive
+        # integer and xe must be divisible by n.  If m is negative
+        # then additionally xc must be a power of either 2 or 5, hence
+        # a power of 2**n or 5**n.
+        #
+        # There's a limit to how small |y| can be: if y=m/n as above
+        # then:
+        #
+        #  (1) if xc != 1 then for the result to be representable we
+        #      need xc**(1/n) >= 2, and hence also xc**|y| >= 2.  So
+        #      if |y| <= 1/nbits(xc) then xc < 2**nbits(xc) <=
+        #      2**(1/|y|), hence xc**|y| < 2 and the result is not
+        #      representable.
+        #
+        #  (2) if xe != 0, |xe|*(1/n) >= 1, so |xe|*|y| >= 1.  Hence if
+        #      |y| < 1/|xe| then the result is not representable.
+        #
+        # Note that since x is not equal to 1, at least one of (1) and
+        # (2) must apply.  Now |y| < 1/nbits(xc) iff |yc|*nbits(xc) <
+        # 10**-ye iff len(str(|yc|*nbits(xc)) <= -ye.
+        #
+        # There's also a limit to how large y can be, at least if it's
+        # positive: the normalized result will have coefficient xc**y,
+        # so if it's representable then xc**y < 10**p, and y <
+        # p/log10(xc).  Hence if y*log10(xc) >= p then the result is
+        # not exactly representable.
+
+        # if len(str(abs(yc*xe)) <= -ye then abs(yc*xe) < 10**-ye,
+        # so |y| < 1/xe and the result is not representable.
+        # Similarly, len(str(abs(yc)*xc_bits)) <= -ye implies |y|
+        # < 1/nbits(xc).
+
+        x = _WorkRep(self)
+        xc, xe = x.int, x.exp
+        while xc % 10 == 0:
+            xc //= 10
+            xe += 1
+
+        y = _WorkRep(other)
+        yc, ye = y.int, y.exp
+        while yc % 10 == 0:
+            yc //= 10
+            ye += 1
+
+        # case where xc == 1: result is 10**(xe*y), with xe*y
+        # required to be an integer
+        if xc == 1:
+            if ye >= 0:
+                exponent = xe*yc*10**ye
+            else:
+                exponent, remainder = divmod(xe*yc, 10**-ye)
+                if remainder:
+                    return None
+            if y.sign == 1:
+                exponent = -exponent
+            # if other is a nonnegative integer, use ideal exponent
+            if other._isinteger() and other._sign == 0:
+                ideal_exponent = self._exp*int(other)
+                zeros = min(exponent-ideal_exponent, p-1)
+            else:
+                zeros = 0
+            return Decimal((0, (1,) + (0,)*zeros, exponent-zeros))
+
+        # case where y is negative: xc must be either a power
+        # of 2 or a power of 5.
+        if y.sign == 1:
+            last_digit = xc % 10
+            if last_digit in (2,4,6,8):
+                # quick test for power of 2
+                if xc & -xc != xc:
+                    return None
+                # now xc is a power of 2; e is its exponent
+                e = _nbits(xc)-1
+                # find e*y and xe*y; both must be integers
+                if ye >= 0:
+                    y_as_int = yc*10**ye
+                    e = e*y_as_int
+                    xe = xe*y_as_int
+                else:
+                    ten_pow = 10**-ye
+                    e, remainder = divmod(e*yc, ten_pow)
+                    if remainder:
+                        return None
+                    xe, remainder = divmod(xe*yc, ten_pow)
+                    if remainder:
+                        return None
+
+                if e*65 >= p*93: # 93/65 > log(10)/log(5)
+                    return None
+                xc = 5**e
+
+            elif last_digit == 5:
+                # e >= log_5(xc) if xc is a power of 5; we have
+                # equality all the way up to xc=5**2658
+                e = _nbits(xc)*28//65
+                xc, remainder = divmod(5**e, xc)
+                if remainder:
+                    return None
+                while xc % 5 == 0:
+                    xc //= 5
+                    e -= 1
+                if ye >= 0:
+                    y_as_integer = yc*10**ye
+                    e = e*y_as_integer
+                    xe = xe*y_as_integer
+                else:
+                    ten_pow = 10**-ye
+                    e, remainder = divmod(e*yc, ten_pow)
+                    if remainder:
+                        return None
+                    xe, remainder = divmod(xe*yc, ten_pow)
+                    if remainder:
+                        return None
+                if e*3 >= p*10: # 10/3 > log(10)/log(2)
+                    return None
+                xc = 2**e
+            else:
+                return None
 
-        if self._isinfinity():
-            if modulo:
-                return context._raise_error(InvalidOperation, 'INF % x')
-            if n > 0:
-                return Infsign[sign]
-            return Decimal( (sign, (0,), 0) )
+            if xc >= 10**p:
+                return None
+            xe = -e-xe
+            return Decimal((0, map(int, str(xc)), xe))
 
-        # With ludicrously large exponent, just raise an overflow
-        # and return inf.
-        if not modulo and n > 0 and \
-           (self._exp + len(self._int) - 1) * n > context.Emax and self:
+        # now y is positive; find m and n such that y = m/n
+        if ye >= 0:
+            m, n = yc*10**ye, 1
+        else:
+            if xe != 0 and len(str(abs(yc*xe))) <= -ye:
+                return None
+            xc_bits = _nbits(xc)
+            if xc != 1 and len(str(abs(yc)*xc_bits)) <= -ye:
+                return None
+            m, n = yc, 10**(-ye)
+            while m % 2 == n % 2 == 0:
+                m //= 2
+                n //= 2
+            while m % 5 == n % 5 == 0:
+                m //= 5
+                n //= 5
+
+        # compute nth root of xc*10**xe
+        if n > 1:
+            # if 1 < xc < 2**n then xc isn't an nth power
+            if xc != 1 and xc_bits <= n:
+                return None
+
+            xe, rem = divmod(xe, n)
+            if rem != 0:
+                return None
+
+            # compute nth root of xc using Newton's method
+            a = 1L << -(-_nbits(xc)//n) # initial estimate
+            while True:
+                q, r = divmod(xc, a**(n-1))
+                if a <= q:
+                    break
+                else:
+                    a = (a*(n-1) + q)//n
+            if not (a == q and r == 0):
+                return None
+            xc = a
+
+        # now xc*10**xe is the nth root of the original xc*10**xe
+        # compute mth power of xc*10**xe
+
+        # if m > p*100//_log10_lb(xc) then m > p/log10(xc), hence xc**m >
+        # 10**p and the result is not representable.
+        if xc > 1 and m > p*100//_log10_lb(xc):
+            return None
+        xc = xc**m
+        xe *= m
+        if xc > 10**p:
+            return None
+
+        # by this point the result *is* exactly representable
+        # adjust the exponent to get as close as possible to the ideal
+        # exponent, if necessary
+        str_xc = str(xc)
+        if other._isinteger() and other._sign == 0:
+            ideal_exponent = self._exp*int(other)
+            zeros = min(xe-ideal_exponent, p-len(str_xc))
+        else:
+            zeros = 0
+        return Decimal((0, map(int, str_xc)+[0,]*zeros, xe-zeros))
 
-            tmp = Decimal('inf')
-            tmp._sign = sign
-            context._raise_error(Rounded)
-            context._raise_error(Inexact)
-            context._raise_error(Overflow, 'Big power', sign)
-            return tmp
+    def __pow__(self, other, modulo=None, context=None):
+        """Return self ** other [ % modulo].
 
-        elength = len(str(abs(n)))
-        firstprec = context.prec
+        With two arguments, compute self**other.
 
-        if not modulo and firstprec + elength + 1 > DefaultContext.Emax:
-            return context._raise_error(Overflow, 'Too much precision.', sign)
+        With three arguments, compute (self**other) % modulo.  For the
+        three argument form, the following restrictions on the
+        arguments hold:
 
-        mul = Decimal(self)
-        val = Decimal(1)
-        context = context._shallow_copy()
-        context.prec = firstprec + elength + 1
-        if n < 0:
-            # n is a long now, not Decimal instance
-            n = -n
-            mul = Decimal(1).__div__(mul, context=context)
-
-        spot = 1
-        while spot <= n:
-            spot <<= 1
-
-        spot >>= 1
-        # spot is the highest power of 2 less than n
-        while spot:
-            val = val.__mul__(val, context=context)
-            if val._isinfinity():
-                val = Infsign[sign]
-                break
-            if spot & n:
-                val = val.__mul__(mul, context=context)
-            if modulo is not None:
-                val = val.__mod__(modulo, context=context)
-            spot >>= 1
-        context.prec = firstprec
+         - all three arguments must be integral
+         - other must be nonnegative
+         - either self or other (or both) must be nonzero
+         - modulo must be nonzero and must have at most p digits,
+           where p is the context precision.
 
-        if context._rounding_decision == ALWAYS_ROUND:
-            return val._fix(context)
-        return val
+        If any of these restrictions is violated the InvalidOperation
+        flag is raised.
+
+        The result of pow(self, other, modulo) is identical to the
+        result that would be obtained by computing (self**other) %
+        modulo with unbounded precision, but is computed more
+        efficiently.  It is always exact.
+        """
+
+        if modulo is not None:
+            return self._power_modulo(other, modulo, context)
 
-    def __rpow__(self, other, context=None):
-        """Swaps self/other and returns __pow__."""
         other = _convert_other(other)
         if other is NotImplemented:
             return other
-        return other.__pow__(self, context=context)
 
-    def normalize(self, context=None):
-        """Normalize- strip trailing 0s, change anything equal to 0 to 0e0"""
+        if context is None:
+            context = getcontext()
 
-        if self._is_special:
-            ans = self._check_nans(context=context)
-            if ans:
-                return ans
+        # either argument is a NaN => result is NaN
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
 
-        dup = self._fix(context)
-        if dup._isinfinity():
-            return dup
+        # 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity)
+        if not other:
+            if not self:
+                return context._raise_error(InvalidOperation, '0 ** 0')
+            else:
+                return Dec_p1
 
-        if not dup:
-            return Decimal( (dup._sign, (0,), 0) )
-        end = len(dup._int)
+        # result has sign 1 iff self._sign is 1 and other is an odd integer
+        result_sign = 0
+        if self._sign == 1:
+            if other._isinteger():
+                if not other._iseven():
+                    result_sign = 1
+            else:
+                # -ve**noninteger = NaN
+                # (-0)**noninteger = 0**noninteger
+                if self:
+                    return context._raise_error(InvalidOperation,
+                        'x ** y with x negative and y not an integer')
+            # negate self, without doing any unwanted rounding
+            self = Decimal((0, self._int, self._exp))
+
+        # 0**(+ve or Inf)= 0; 0**(-ve or -Inf) = Infinity
+        if not self:
+            if other._sign == 0:
+                return Decimal((result_sign, (0,), 0))
+            else:
+                return Infsign[result_sign]
+
+        # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0
+        if self._isinfinity():
+            if other._sign == 0:
+                return Infsign[result_sign]
+            else:
+                return Decimal((result_sign, (0,), 0))
+
+        # 1**other = 1, but the choice of exponent and the flags
+        # depend on the exponent of self, and on whether other is a
+        # positive integer, a negative integer, or neither
+        if self == Dec_p1:
+            if other._isinteger():
+                # exp = max(self._exp*max(int(other), 0),
+                # 1-context.prec) but evaluating int(other) directly
+                # is dangerous until we know other is small (other
+                # could be 1e999999999)
+                if other._sign == 1:
+                    multiplier = 0
+                elif other > context.prec:
+                    multiplier = context.prec
+                else:
+                    multiplier = int(other)
+
+                exp = self._exp * multiplier
+                if exp < 1-context.prec:
+                    exp = 1-context.prec
+                    context._raise_error(Rounded)
+            else:
+                context._raise_error(Inexact)
+                context._raise_error(Rounded)
+                exp = 1-context.prec
+
+            return Decimal((result_sign, (1,)+(0,)*-exp, exp))
+
+        # compute adjusted exponent of self
+        self_adj = self.adjusted()
+
+        # self ** infinity is infinity if self > 1, 0 if self < 1
+        # self ** -infinity is infinity if self < 1, 0 if self > 1
+        if other._isinfinity():
+            if (other._sign == 0) == (self_adj < 0):
+                return Decimal((result_sign, (0,), 0))
+            else:
+                return Infsign[result_sign]
+
+        # from here on, the result always goes through the call
+        # to _fix at the end of this function.
+        ans = None
+
+        # crude test to catch cases of extreme overflow/underflow.  If
+        # log10(self)*other >= 10**bound and bound >= len(str(Emax))
+        # then 10**bound >= 10**len(str(Emax)) >= Emax+1 and hence
+        # self**other >= 10**(Emax+1), so overflow occurs.  The test
+        # for underflow is similar.
+        bound = self._log10_exp_bound() + other.adjusted()
+        if (self_adj >= 0) == (other._sign == 0):
+            # self > 1 and other +ve, or self < 1 and other -ve
+            # possibility of overflow
+            if bound >= len(str(context.Emax)):
+                ans = Decimal((result_sign, (1,), context.Emax+1))
+        else:
+            # self > 1 and other -ve, or self < 1 and other +ve
+            # possibility of underflow to 0
+            Etiny = context.Etiny()
+            if bound >= len(str(-Etiny)):
+                ans = Decimal((result_sign, (1,), Etiny-1))
+
+        # try for an exact result with precision +1
+        if ans is None:
+            ans = self._power_exact(other, context.prec + 1)
+            if ans is not None and result_sign == 1:
+                ans = Decimal((1, ans._int, ans._exp))
+
+        # usual case: inexact result, x**y computed directly as exp(y*log(x))
+        if ans is None:
+            p = context.prec
+            x = _WorkRep(self)
+            xc, xe = x.int, x.exp
+            y = _WorkRep(other)
+            yc, ye = y.int, y.exp
+            if y.sign == 1:
+                yc = -yc
+
+            # compute correctly rounded result:  start with precision +3,
+            # then increase precision until result is unambiguously roundable
+            extra = 3
+            while True:
+                coeff, exp = _dpower(xc, xe, yc, ye, p+extra)
+                if coeff % (5*10**(len(str(coeff))-p-1)):
+                    break
+                extra += 3
+
+            ans = Decimal((result_sign, map(int, str(coeff)), exp))
+
+        # the specification says that for non-integer other we need to
+        # raise Inexact, even when the result is actually exact.  In
+        # the same way, we need to raise Underflow here if the result
+        # is subnormal.  (The call to _fix will take care of raising
+        # Rounded and Subnormal, as usual.)
+        if not other._isinteger():
+            context._raise_error(Inexact)
+            # pad with zeros up to length context.prec+1 if necessary
+            if len(ans._int) <= context.prec:
+                expdiff = context.prec+1 - len(ans._int)
+                ans = Decimal((ans._sign, ans._int+(0,)*expdiff, ans._exp-expdiff))
+            if ans.adjusted() < context.Emin:
+                context._raise_error(Underflow)
+
+        # unlike exp, ln and log10, the power function respects the
+        # rounding mode; no need to use ROUND_HALF_EVEN here
+        ans = ans._fix(context)
+        return ans
+
+    def __rpow__(self, other, context=None):
+        """Swaps self/other and returns __pow__."""
+        other = _convert_other(other)
+        if other is NotImplemented:
+            return other
+        return other.__pow__(self, context=context)
+
+    def normalize(self, context=None):
+        """Normalize- strip trailing 0s, change anything equal to 0 to 0e0"""
+
+        if context is None:
+            context = getcontext()
+
+        if self._is_special:
+            ans = self._check_nans(context=context)
+            if ans:
+                return ans
+
+        dup = self._fix(context)
+        if dup._isinfinity():
+            return dup
+
+        if not dup:
+            return Decimal( (dup._sign, (0,), 0) )
+        exp_max = [context.Emax, context.Etop()][context._clamp]
+        end = len(dup._int)
         exp = dup._exp
-        while dup._int[end-1] == 0:
+        while dup._int[end-1] == 0 and exp < exp_max:
             exp += 1
             end -= 1
         return Decimal( (dup._sign, dup._int[:end], exp) )
 
 
-    def quantize(self, exp, rounding=None, context=None, watchexp=1):
+    def quantize(self, exp, rounding=None, context=None):
         """Quantize self so its exponent is the same as that of exp.
 
         Similar to self._rescale(exp._exp) but with error checking.
         """
+        if context is None:
+            context = getcontext()
+        if rounding is None:
+            rounding = context.rounding
+
         if self._is_special or exp._is_special:
             ans = self._check_nans(exp, context)
             if ans:
@@ -1865,11 +2179,45 @@ class Decimal(object):
             if exp._isinfinity() or self._isinfinity():
                 if exp._isinfinity() and self._isinfinity():
                     return self  # if both are inf, it is OK
-                if context is None:
-                    context = getcontext()
                 return context._raise_error(InvalidOperation,
                                         'quantize with one INF')
-        return self._rescale(exp._exp, rounding, context, watchexp)
+
+        # exp._exp should be between Etiny and Emax
+        if not (context.Etiny() <= exp._exp <= context.Emax):
+            return context._raise_error(InvalidOperation,
+                   'target exponent out of bounds in quantize')
+
+        if not self:
+            ans = Decimal((self._sign, (0,), exp._exp))
+            return ans._fix(context)
+
+        self_adjusted = self.adjusted()
+        if self_adjusted > context.Emax:
+            return context._raise_error(InvalidOperation,
+                                        'exponent of quantize result too large for current context')
+        if self_adjusted - exp._exp + 1 > context.prec:
+            return context._raise_error(InvalidOperation,
+                                        'quantize result has too many digits for current context')
+
+        ans = self._rescale(exp._exp, rounding)
+        if ans.adjusted() > context.Emax:
+            return context._raise_error(InvalidOperation,
+                                        'exponent of quantize result too large for current context')
+        if len(ans._int) > context.prec:
+            return context._raise_error(InvalidOperation,
+                                        'quantize result has too many digits for current context')
+
+        # raise appropriate flags
+        if ans._exp > self._exp:
+            context._raise_error(Rounded)
+            if ans != self:
+                context._raise_error(Inexact)
+        if ans and ans.adjusted() < context.Emin:
+            context._raise_error(Subnormal)
+
+        # call to fix takes care of any necessary folddown
+        ans = ans._fix(context)
+        return ans
 
     def same_quantum(self, other):
         """Test whether self and other have the same exponent.
@@ -1883,82 +2231,85 @@ class Decimal(object):
                 return self._isinfinity() and other._isinfinity() and True
         return self._exp == other._exp
 
-    def _rescale(self, exp, rounding=None, context=None, watchexp=1):
-        """Rescales so that the exponent is exp.
+    def _rescale(self, exp, rounding):
+        """Rescale self so that the exponent is exp, either by padding with zeros
+        or by truncating digits, using the given rounding mode.
+
+        Specials are returned without change.  This operation is
+        quiet: it raises no flags, and uses no information from the
+        context.
 
         exp = exp to scale to (an integer)
-        rounding = rounding version
-        watchexp: if set (default) an error is returned if exp is greater
-        than Emax or less than Etiny.
+        rounding = rounding mode
         """
-        if context is None:
-            context = getcontext()
-
         if self._is_special:
-            if self._isinfinity():
-                return context._raise_error(InvalidOperation, 'rescale with an INF')
-
-            ans = self._check_nans(context=context)
-            if ans:
-                return ans
-
-        if watchexp and (context.Emax  < exp or context.Etiny() > exp):
-            return context._raise_error(InvalidOperation, 'rescale(a, INF)')
-
+            return self
         if not self:
-            ans = Decimal(self)
-            ans._int = (0,)
-            ans._exp = exp
-            return ans
+            return Decimal((self._sign, (0,), exp))
 
-        diff = self._exp - exp
-        digits = len(self._int) + diff
-
-        if watchexp and digits > context.prec:
-            return context._raise_error(InvalidOperation, 'Rescale > prec')
-
-        tmp = Decimal(self)
-        tmp._int = (0,) + tmp._int
-        digits += 1
+        if self._exp >= exp:
+            # pad answer with zeros if necessary
+            return Decimal((self._sign, self._int + (0,)*(self._exp - exp), exp))
 
+        # too many digits; round and lose data.  If self.adjusted() <
+        # exp-1, replace self by 10**(exp-1) before rounding
+        digits = len(self._int) + self._exp - exp
         if digits < 0:
-            tmp._exp = -digits + tmp._exp
-            tmp._int = (0,1)
-            digits = 1
-        tmp = tmp._round(digits, rounding, context=context)
+            self = Decimal((self._sign, (1,), exp-1))
+            digits = 0
+        this_function = getattr(self, self._pick_rounding_function[rounding])
+        return this_function(digits)
 
-        if tmp._int[0] == 0 and len(tmp._int) > 1:
-            tmp._int = tmp._int[1:]
-        tmp._exp = exp
+    def to_integral_exact(self, rounding=None, context=None):
+        """Rounds to a nearby integer.
 
-        tmp_adjusted = tmp.adjusted()
-        if tmp and tmp_adjusted < context.Emin:
-            context._raise_error(Subnormal)
-        elif tmp and tmp_adjusted > context.Emax:
-            return context._raise_error(InvalidOperation, 'rescale(a, INF)')
-        return tmp
+        If no rounding mode is specified, take the rounding mode from
+        the context.  This method raises the Rounded and Inexact flags
+        when appropriate.
 
-    def to_integral(self, rounding=None, context=None):
-        """Rounds to the nearest integer, without raising inexact, rounded."""
+        See also: to_integral_value, which does exactly the same as
+        this method except that it doesn't raise Inexact or Rounded.
+        """
         if self._is_special:
             ans = self._check_nans(context=context)
             if ans:
                 return ans
+            return self
         if self._exp >= 0:
             return self
+        if not self:
+            return Decimal((self._sign, (0,), 0))
         if context is None:
             context = getcontext()
-        flags = context._ignore_flags(Rounded, Inexact)
-        ans = self._rescale(0, rounding, context=context)
-        context._regard_flags(flags)
+        if rounding is None:
+            rounding = context.rounding
+        context._raise_error(Rounded)
+        ans = self._rescale(0, rounding)
+        if ans != self:
+            context._raise_error(Inexact)
         return ans
 
-    def sqrt(self, context=None):
-        """Return the square root of self.
+    def to_integral_value(self, rounding=None, context=None):
+        """Rounds to the nearest integer, without raising inexact, rounded."""
+        if context is None:
+            context = getcontext()
+        if rounding is None:
+            rounding = context.rounding
+        if self._is_special:
+            ans = self._check_nans(context=context)
+            if ans:
+                return ans
+            return self
+        if self._exp >= 0:
+            return self
+        else:
+            return self._rescale(0, rounding)
 
-        Uses a converging algorithm (Xn+1 = 0.5*(Xn + self / Xn))
-        Should quadratically approach the right answer.
-        """
+    # the method name changed, but we provide also the old one, for compatibility
+    to_integral = to_integral_value
+
+    def sqrt(self, context=None):
+        """Return the square root of self."""
         if self._is_special:
             ans = self._check_nans(context=context)
             if ans:
@@ -1968,16 +2319,9 @@ class Decimal(object):
                 return Decimal(self)
 
         if not self:
-            # exponent = self._exp / 2, using round_down.
-            # if self._exp < 0:
-            #    exp = (self._exp+1) // 2
-            # else:
-            exp = (self._exp) // 2
-            if self._sign == 1:
-                # sqrt(-0) = -0
-                return Decimal( (1, (0,), exp))
-            else:
-                return Decimal( (0, (0,), exp))
+            # exponent = self._exp // 2.  sqrt(-0) = -0
+            ans = Decimal((self._sign, (0,), self._exp // 2))
+            return ans._fix(context)
 
         if context is None:
             context = getcontext()
@@ -1985,104 +2329,91 @@ class Decimal(object):
         if self._sign == 1:
             return context._raise_error(InvalidOperation, 'sqrt(-x), x > 0')
 
-        tmp = Decimal(self)
-
-        expadd = tmp._exp // 2
-        if tmp._exp & 1:
-            tmp._int += (0,)
-            tmp._exp = 0
+        # At this point self represents a positive number.  Let p be
+        # the desired precision and express self in the form c*100**e
+        # with c a positive real number and e an integer, c and e
+        # being chosen so that 100**(p-1) <= c < 100**p.  Then the
+        # (exact) square root of self is sqrt(c)*10**e, and 10**(p-1)
+        # <= sqrt(c) < 10**p, so the closest representable Decimal at
+        # precision p is n*10**e where n = round_half_even(sqrt(c)),
+        # the closest integer to sqrt(c) with the even integer chosen
+        # in the case of a tie.
+        #
+        # To ensure correct rounding in all cases, we use the
+        # following trick: we compute the square root to an extra
+        # place (precision p+1 instead of precision p), rounding down.
+        # Then, if the result is inexact and its last digit is 0 or 5,
+        # we increase the last digit to 1 or 6 respectively; if it's
+        # exact we leave the last digit alone.  Now the final round to
+        # p places (or fewer in the case of underflow) will round
+        # correctly and raise the appropriate flags.
+
+        # use an extra digit of precision
+        prec = context.prec+1
+
+        # write argument in the form c*100**e where e = self._exp//2
+        # is the 'ideal' exponent, to be used if the square root is
+        # exactly representable.  l is the number of 'digits' of c in
+        # base 100, so that 100**(l-1) <= c < 100**l.
+        op = _WorkRep(self)
+        e = op.exp >> 1
+        if op.exp & 1:
+            c = op.int * 10
+            l = (len(self._int) >> 1) + 1
         else:
-            tmp._exp = 0
-
-        context = context._shallow_copy()
-        flags = context._ignore_all_flags()
-        firstprec = context.prec
-        context.prec = 3
-        if tmp.adjusted() & 1 == 0:
-            ans = Decimal( (0, (8,1,9), tmp.adjusted()  - 2) )
-            ans = ans.__add__(tmp.__mul__(Decimal((0, (2,5,9), -2)),
-                                          context=context), context=context)
-            ans._exp -= 1 + tmp.adjusted() // 2
+            c = op.int
+            l = len(self._int)+1 >> 1
+
+        # rescale so that c has exactly prec base 100 'digits'
+        shift = prec-l
+        if shift >= 0:
+            c *= 100**shift
+            exact = True
         else:
-            ans = Decimal( (0, (2,5,9), tmp._exp + len(tmp._int)- 3) )
-            ans = ans.__add__(tmp.__mul__(Decimal((0, (8,1,9), -3)),
-                                          context=context), context=context)
-            ans._exp -= 1 + tmp.adjusted()  // 2
-
-        # ans is now a linear approximation.
-        Emax, Emin = context.Emax, context.Emin
-        context.Emax, context.Emin = DefaultContext.Emax, DefaultContext.Emin
-
-        half = Decimal('0.5')
-
-        maxp = firstprec + 2
-        rounding = context._set_rounding(ROUND_HALF_EVEN)
-        while 1:
-            context.prec = min(2*context.prec - 2, maxp)
-            ans = half.__mul__(ans.__add__(tmp.__div__(ans, context=context),
-                                           context=context), context=context)
-            if context.prec == maxp:
+            c, remainder = divmod(c, 100**-shift)
+            exact = not remainder
+        e -= shift
+
+        # find n = floor(sqrt(c)) using Newton's method
+        n = 10**prec
+        while True:
+            q = c//n
+            if n <= q:
                 break
-
-        # Round to the answer's precision-- the only error can be 1 ulp.
-        context.prec = firstprec
-        prevexp = ans.adjusted()
-        ans = ans._round(context=context)
-
-        # Now, check if the other last digits are better.
-        context.prec = firstprec + 1
-        # In case we rounded up another digit and we should actually go lower.
-        if prevexp != ans.adjusted():
-            ans._int += (0,)
-            ans._exp -= 1
-
-
-        lower = ans.__sub__(Decimal((0, (5,), ans._exp-1)), context=context)
-        context._set_rounding(ROUND_UP)
-        if lower.__mul__(lower, context=context) > (tmp):
-            ans = ans.__sub__(Decimal((0, (1,), ans._exp)), context=context)
-
+            else:
+                n = n + q >> 1
+        exact = exact and n*n == c
+
+        if exact:
+            # result is exact; rescale to use ideal exponent e
+            if shift >= 0:
+                # assert n % 10**shift == 0
+                n //= 10**shift
+            else:
+                n *= 10**-shift
+            e += shift
         else:
-            upper = ans.__add__(Decimal((0, (5,), ans._exp-1)),context=context)
-            context._set_rounding(ROUND_DOWN)
-            if upper.__mul__(upper, context=context) < tmp:
-                ans = ans.__add__(Decimal((0, (1,), ans._exp)),context=context)
+            # result is not exact; fix last digit as described above
+            if n % 5 == 0:
+                n += 1
 
-        ans._exp += expadd
+        ans = Decimal((0, map(int, str(n)), e))
 
-        context.prec = firstprec
-        context.rounding = rounding
+        # round, and fit to current context
+        context = context._shallow_copy()
+        rounding = context._set_rounding(ROUND_HALF_EVEN)
         ans = ans._fix(context)
+        context.rounding = rounding
 
-        rounding = context._set_rounding_decision(NEVER_ROUND)
-        if not ans.__mul__(ans, context=context) == self:
-            # Only rounded/inexact if here.
-            context._regard_flags(flags)
-            context._raise_error(Rounded)
-            context._raise_error(Inexact)
-        else:
-            # Exact answer, so let's set the exponent right.
-            # if self._exp < 0:
-            #    exp = (self._exp +1)// 2
-            # else:
-            exp = self._exp // 2
-            context.prec += ans._exp - exp
-            ans = ans._rescale(exp, context=context)
-            context.prec = firstprec
-            context._regard_flags(flags)
-        context.Emax, context.Emin = Emax, Emin
-
-        return ans._fix(context)
+        return ans
 
     def max(self, other, context=None):
         """Returns the larger value.
 
-        like max(self, other) except if one is not a number, returns
+        Like max(self, other) except if one is not a number, returns
         NaN (and signals if one is sNaN).  Also rounds.
         """
-        other = _convert_other(other)
-        if other is NotImplemented:
-            return other
+        other = _convert_other(other, raiseit=True)
 
         if self._is_special or other._is_special:
             # If one operand is a quiet NaN and the other is number, then the
@@ -2096,7 +2427,6 @@ class Decimal(object):
                     return other
                 return self._check_nans(other, context)
 
-        ans = self
         c = self.__cmp__(other)
         if c == 0:
             # If both operands are finite and equal in numerical value
@@ -2106,16 +2436,13 @@ class Decimal(object):
             # positive sign and min returns the operand with the negative sign
             #
             # If the signs are the same then the exponent is used to select
-            # the result.
-            if self._sign != other._sign:
-                if self._sign:
-                    ans = other
-            elif self._exp < other._exp and not self._sign:
-                ans = other
-            elif self._exp > other._exp and self._sign:
-                ans = other
-        elif c == -1:
+            # the result.  This is exactly the ordering used in compare_total.
+            c = self.compare_total(other)
+
+        if c == -1:
             ans = other
+        else:
+            ans = self
 
         if context is None:
             context = getcontext()
@@ -2129,9 +2456,7 @@ class Decimal(object):
         Like min(self, other) except if one is not a number, returns
         NaN (and signals if one is sNaN).  Also rounds.
         """
-        other = _convert_other(other)
-        if other is NotImplemented:
-            return other
+        other = _convert_other(other, raiseit=True)
 
         if self._is_special or other._is_special:
             # If one operand is a quiet NaN and the other is number, then the
@@ -2145,25 +2470,13 @@ class Decimal(object):
                     return other
                 return self._check_nans(other, context)
 
-        ans = self
         c = self.__cmp__(other)
         if c == 0:
-            # If both operands are finite and equal in numerical value
-            # then an ordering is applied:
-            #
-            # If the signs differ then max returns the operand with the
-            # positive sign and min returns the operand with the negative sign
-            #
-            # If the signs are the same then the exponent is used to select
-            # the result.
-            if self._sign != other._sign:
-                if other._sign:
-                    ans = other
-            elif self._exp > other._exp and not self._sign:
-                ans = other
-            elif self._exp < other._exp and self._sign:
-                ans = other
-        elif c == 1:
+            c = self.compare_total(other)
+
+        if c == -1:
+            ans = self
+        else:
             ans = other
 
         if context is None:
@@ -2174,15 +2487,17 @@ class Decimal(object):
 
     def _isinteger(self):
         """Returns whether self is an integer"""
+        if self._is_special:
+            return False
         if self._exp >= 0:
             return True
         rest = self._int[self._exp:]
         return rest == (0,)*len(rest)
 
     def _iseven(self):
-        """Returns 1 if self is even.  Assumes self is an integer."""
-        if self._exp > 0:
-            return 1
+        """Returns True if self is even.  Assumes self is an integer."""
+        if not self or self._exp > 0:
+            return True
         return self._int[-1+self._exp] & 1 == 0
 
     def adjusted(self):
@@ -2193,6 +2508,872 @@ class Decimal(object):
         except TypeError:
             return 0
 
+    def canonical(self, context=None):
+        """Returns the same Decimal object.
+
+        As we do not have different encodings for the same number, the
+        received object already is in its canonical form.
+        """
+        return self
+
+    def compare_signal(self, other, context=None):
+        """Compares self to the other operand numerically.
+
+        It's pretty much like compare(), but all NaNs signal, with signaling
+        NaNs taking precedence over quiet NaNs.
+        """
+        if context is None:
+            context = getcontext()
+
+        self_is_nan = self._isnan()
+        other_is_nan = other._isnan()
+        if self_is_nan == 2:
+            return context._raise_error(InvalidOperation, 'sNaN',
+                                        1, self)
+        if other_is_nan == 2:
+            return context._raise_error(InvalidOperation, 'sNaN',
+                                        1, other)
+        if self_is_nan:
+            return context._raise_error(InvalidOperation, 'NaN in compare_signal',
+                                        1, self)
+        if other_is_nan:
+            return context._raise_error(InvalidOperation, 'NaN in compare_signal',
+                                        1, other)
+        return self.compare(other, context=context)
+
+    def compare_total(self, other):
+        """Compares self to other using the abstract representations.
+
+        This is not like the standard compare, which use their numerical
+        value. Note that a total ordering is defined for all possible abstract
+        representations.
+        """
+        # if one is negative and the other is positive, it's easy
+        if self._sign and not other._sign:
+            return Dec_n1
+        if not self._sign and other._sign:
+            return Dec_p1
+        sign = self._sign
+
+        # let's handle both NaN types
+        self_nan = self._isnan()
+        other_nan = other._isnan()
+        if self_nan or other_nan:
+            if self_nan == other_nan:
+                if self._int < other._int:
+                    if sign:
+                        return Dec_p1
+                    else:
+                        return Dec_n1
+                if self._int > other._int:
+                    if sign:
+                        return Dec_n1
+                    else:
+                        return Dec_p1
+                return Dec_0
+
+            if sign:
+                if self_nan == 1:
+                    return Dec_n1
+                if other_nan == 1:
+                    return Dec_p1
+                if self_nan == 2:
+                    return Dec_n1
+                if other_nan == 2:
+                    return Dec_p1
+            else:
+                if self_nan == 1:
+                    return Dec_p1
+                if other_nan == 1:
+                    return Dec_n1
+                if self_nan == 2:
+                    return Dec_p1
+                if other_nan == 2:
+                    return Dec_n1
+
+        if self < other:
+            return Dec_n1
+        if self > other:
+            return Dec_p1
+
+        if self._exp < other._exp:
+            if sign:
+                return Dec_p1
+            else:
+                return Dec_n1
+        if self._exp > other._exp:
+            if sign:
+                return Dec_n1
+            else:
+                return Dec_p1
+        return Dec_0
+
+
+    def compare_total_mag(self, other):
+        """Compares self to other using abstract repr., ignoring sign.
+
+        Like compare_total, but with operand's sign ignored and assumed to be 0.
+        """
+        s = self.copy_abs()
+        o = other.copy_abs()
+        return s.compare_total(o)
+
+    def copy_abs(self):
+        """Returns a copy with the sign set to 0. """
+        return Decimal((0, self._int, self._exp))
+
+    def copy_negate(self):
+        """Returns a copy with the sign inverted."""
+        if self._sign:
+            return Decimal((0, self._int, self._exp))
+        else:
+            return Decimal((1, self._int, self._exp))
+
+    def copy_sign(self, other):
+        """Returns self with the sign of other."""
+        return Decimal((other._sign, self._int, self._exp))
+
+    def exp(self, context=None):
+        """Returns e ** self."""
+
+        if context is None:
+            context = getcontext()
+
+        # exp(NaN) = NaN
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        # exp(-Infinity) = 0
+        if self._isinfinity() == -1:
+            return Dec_0
+
+        # exp(0) = 1
+        if not self:
+            return Dec_p1
+
+        # exp(Infinity) = Infinity
+        if self._isinfinity() == 1:
+            return Decimal(self)
+
+        # the result is now guaranteed to be inexact (the true
+        # mathematical result is transcendental). There's no need to
+        # raise Rounded and Inexact here---they'll always be raised as
+        # a result of the call to _fix.
+        p = context.prec
+        adj = self.adjusted()
+
+        # we only need to do any computation for quite a small range
+        # of adjusted exponents---for example, -29 <= adj <= 10 for
+        # the default context.  For smaller exponent the result is
+        # indistinguishable from 1 at the given precision, while for
+        # larger exponent the result either overflows or underflows.
+        if self._sign == 0 and adj > len(str((context.Emax+1)*3)):
+            # overflow
+            ans = Decimal((0, (1,), context.Emax+1))
+        elif self._sign == 1 and adj > len(str((-context.Etiny()+1)*3)):
+            # underflow to 0
+            ans = Decimal((0, (1,), context.Etiny()-1))
+        elif self._sign == 0 and adj < -p:
+            # p+1 digits; final round will raise correct flags
+            ans = Decimal((0, (1,) + (0,)*(p-1) + (1,), -p))
+        elif self._sign == 1 and adj < -p-1:
+            # p+1 digits; final round will raise correct flags
+            ans = Decimal((0, (9,)*(p+1), -p-1))
+        # general case
+        else:
+            op = _WorkRep(self)
+            c, e = op.int, op.exp
+            if op.sign == 1:
+                c = -c
+
+            # compute correctly rounded result: increase precision by
+            # 3 digits at a time until we get an unambiguously
+            # roundable result
+            extra = 3
+            while True:
+                coeff, exp = _dexp(c, e, p+extra)
+                if coeff % (5*10**(len(str(coeff))-p-1)):
+                    break
+                extra += 3
+
+            ans = Decimal((0, map(int, str(coeff)), exp))
+
+        # at this stage, ans should round correctly with *any*
+        # rounding mode, not just with ROUND_HALF_EVEN
+        context = context._shallow_copy()
+        rounding = context._set_rounding(ROUND_HALF_EVEN)
+        ans = ans._fix(context)
+        context.rounding = rounding
+
+        return ans
+
+    def is_canonical(self):
+        """Returns 1 if self is canonical; otherwise returns 0."""
+        return Dec_p1
+
+    def is_finite(self):
+        """Returns 1 if self is finite, otherwise returns 0.
+
+        For it to be finite, it must be neither infinite nor a NaN.
+        """
+        if self._is_special:
+            return Dec_0
+        else:
+            return Dec_p1
+
+    def is_infinite(self):
+        """Returns 1 if self is an Infinite, otherwise returns 0."""
+        if self._isinfinity():
+            return Dec_p1
+        else:
+            return Dec_0
+
+    def is_nan(self):
+        """Returns 1 if self is qNaN or sNaN, otherwise returns 0."""
+        if self._isnan():
+            return Dec_p1
+        else:
+            return Dec_0
+
+    def is_normal(self, context=None):
+        """Returns 1 if self is a normal number, otherwise returns 0."""
+        if self._is_special:
+            return Dec_0
+        if not self:
+            return Dec_0
+        if context is None:
+            context = getcontext()
+        if context.Emin <= self.adjusted() <= context.Emax:
+            return Dec_p1
+        else:
+            return Dec_0
+
+    def is_qnan(self):
+        """Returns 1 if self is a quiet NaN, otherwise returns 0."""
+        if self._isnan() == 1:
+            return Dec_p1
+        else:
+            return Dec_0
+
+    def is_signed(self):
+        """Returns 1 if self is negative, otherwise returns 0."""
+        return Decimal(self._sign)
+
+    def is_snan(self):
+        """Returns 1 if self is a signaling NaN, otherwise returns 0."""
+        if self._isnan() == 2:
+            return Dec_p1
+        else:
+            return Dec_0
+
+    def is_subnormal(self, context=None):
+        """Returns 1 if self is subnormal, otherwise returns 0."""
+        if self._is_special:
+            return Dec_0
+        if not self:
+            return Dec_0
+        if context is None:
+            context = getcontext()
+
+        r = self._exp + len(self._int)
+        if r <= context.Emin:
+            return Dec_p1
+        return Dec_0
+
+    def is_zero(self):
+        """Returns 1 if self is a zero, otherwise returns 0."""
+        if self:
+            return Dec_0
+        else:
+            return Dec_p1
+
+    def _ln_exp_bound(self):
+        """Compute a lower bound for the adjusted exponent of self.ln().
+        In other words, compute r such that self.ln() >= 10**r.  Assumes
+        that self is finite and positive and that self != 1.
+        """
+
+        # for 0.1 <= x <= 10 we use the inequalities 1-1/x <= ln(x) <= x-1
+        adj = self._exp + len(self._int) - 1
+        if adj >= 1:
+            # argument >= 10; we use 23/10 = 2.3 as a lower bound for ln(10)
+            return len(str(adj*23//10)) - 1
+        if adj <= -2:
+            # argument <= 0.1
+            return len(str((-1-adj)*23//10)) - 1
+        op = _WorkRep(self)
+        c, e = op.int, op.exp
+        if adj == 0:
+            # 1 < self < 10
+            num = str(c-10**-e)
+            den = str(c)
+            return len(num) - len(den) - (num < den)
+        # adj == -1, 0.1 <= self < 1
+        return e + len(str(10**-e - c)) - 1
+
+
+    def ln(self, context=None):
+        """Returns the natural (base e) logarithm of self."""
+
+        if context is None:
+            context = getcontext()
+
+        # ln(NaN) = NaN
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        # ln(0.0) == -Infinity
+        if not self:
+            return negInf
+
+        # ln(Infinity) = Infinity
+        if self._isinfinity() == 1:
+            return Inf
+
+        # ln(1.0) == 0.0
+        if self == Dec_p1:
+            return Dec_0
+
+        # ln(negative) raises InvalidOperation
+        if self._sign == 1:
+            return context._raise_error(InvalidOperation,
+                                        'ln of a negative value')
+
+        # result is irrational, so necessarily inexact
+        op = _WorkRep(self)
+        c, e = op.int, op.exp
+        p = context.prec
+
+        # correctly rounded result: repeatedly increase precision by 3
+        # until we get an unambiguously roundable result
+        places = p - self._ln_exp_bound() + 2 # at least p+3 places
+        while True:
+            coeff = _dlog(c, e, places)
+            # assert len(str(abs(coeff)))-p >= 1
+            if coeff % (5*10**(len(str(abs(coeff)))-p-1)):
+                break
+            places += 3
+        ans = Decimal((int(coeff<0), map(int, str(abs(coeff))), -places))
+
+        context = context._shallow_copy()
+        rounding = context._set_rounding(ROUND_HALF_EVEN)
+        ans = ans._fix(context)
+        context.rounding = rounding
+        return ans
+
+    def _log10_exp_bound(self):
+        """Compute a lower bound for the adjusted exponent of self.log10().
+        In other words, find r such that self.log10() >= 10**r.
+        Assumes that self is finite and positive and that self != 1.
+        """
+
+        # For x >= 10 or x < 0.1 we only need a bound on the integer
+        # part of log10(self), and this comes directly from the
+        # exponent of x.  For 0.1 <= x <= 10 we use the inequalities
+        # 1-1/x <= log(x) <= x-1. If x > 1 we have |log10(x)| >
+        # (1-1/x)/2.31 > 0.  If x < 1 then |log10(x)| > (1-x)/2.31 > 0
+
+        adj = self._exp + len(self._int) - 1
+        if adj >= 1:
+            # self >= 10
+            return len(str(adj))-1
+        if adj <= -2:
+            # self < 0.1
+            return len(str(-1-adj))-1
+        op = _WorkRep(self)
+        c, e = op.int, op.exp
+        if adj == 0:
+            # 1 < self < 10
+            num = str(c-10**-e)
+            den = str(231*c)
+            return len(num) - len(den) - (num < den) + 2
+        # adj == -1, 0.1 <= self < 1
+        num = str(10**-e-c)
+        return len(num) + e - (num < "231") - 1
+
+    def log10(self, context=None):
+        """Returns the base 10 logarithm of self."""
+
+        if context is None:
+            context = getcontext()
+
+        # log10(NaN) = NaN
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        # log10(0.0) == -Infinity
+        if not self:
+            return negInf
+
+        # log10(Infinity) = Infinity
+        if self._isinfinity() == 1:
+            return Inf
+
+        # log10(negative or -Infinity) raises InvalidOperation
+        if self._sign == 1:
+            return context._raise_error(InvalidOperation,
+                                        'log10 of a negative value')
+
+        # log10(10**n) = n
+        if self._int[0] == 1 and self._int[1:] == (0,)*(len(self._int) - 1):
+            # answer may need rounding
+            ans = Decimal(self._exp + len(self._int) - 1)
+        else:
+            # result is irrational, so necessarily inexact
+            op = _WorkRep(self)
+            c, e = op.int, op.exp
+            p = context.prec
+
+            # correctly rounded result: repeatedly increase precision
+            # until result is unambiguously roundable
+            places = p-self._log10_exp_bound()+2
+            while True:
+                coeff = _dlog10(c, e, places)
+                # assert len(str(abs(coeff)))-p >= 1
+                if coeff % (5*10**(len(str(abs(coeff)))-p-1)):
+                    break
+                places += 3
+            ans = Decimal((int(coeff<0), map(int, str(abs(coeff))), -places))
+
+        context = context._shallow_copy()
+        rounding = context._set_rounding(ROUND_HALF_EVEN)
+        ans = ans._fix(context)
+        context.rounding = rounding
+        return ans
+
+    def logb(self, context=None):
+        """ Returns the exponent of the magnitude of self's MSD.
+
+        The result is the integer which is the exponent of the magnitude
+        of the most significant digit of self (as though it were truncated
+        to a single digit while maintaining the value of that digit and
+        without limiting the resulting exponent).
+        """
+        # logb(NaN) = NaN
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        if context is None:
+            context = getcontext()
+
+        # logb(+/-Inf) = +Inf
+        if self._isinfinity():
+            return Inf
+
+        # logb(0) = -Inf, DivisionByZero
+        if not self:
+            return context._raise_error(DivisionByZero, 'logb(0)', -1)
+
+        # otherwise, simply return the adjusted exponent of self, as a
+        # Decimal.  Note that no attempt is made to fit the result
+        # into the current context.
+        return Decimal(self.adjusted())
+
+    def _islogical(self):
+        """Return True if self is a logical operand.
+
+        For being logical, it must be a finite numbers with a sign of 0,
+        an exponent of 0, and a coefficient whose digits must all be
+        either 0 or 1.
+        """
+        if self._sign != 0 or self._exp != 0:
+            return False
+        for dig in self._int:
+            if dig not in (0, 1):
+                return False
+        return True
+
+    def _fill_logical(self, context, opa, opb):
+        dif = context.prec - len(opa)
+        if dif > 0:
+            opa = (0,)*dif + opa
+        elif dif < 0:
+            opa = opa[-context.prec:]
+        dif = context.prec - len(opb)
+        if dif > 0:
+            opb = (0,)*dif + opb
+        elif dif < 0:
+            opb = opb[-context.prec:]
+        return opa, opb
+
+    def logical_and(self, other, context=None):
+        """Applies an 'and' operation between self and other's digits."""
+        if context is None:
+            context = getcontext()
+        if not self._islogical() or not other._islogical():
+            return context._raise_error(InvalidOperation)
+
+        # fill to context.prec
+        (opa, opb) = self._fill_logical(context, self._int, other._int)
+
+        # make the operation, and clean starting zeroes
+        result = [a&b for a,b in zip(opa,opb)]
+        for i,d in enumerate(result):
+            if d == 1:
+                break
+        result = tuple(result[i:])
+
+        # if empty, we must have at least a zero
+        if not result:
+            result = (0,)
+        return Decimal((0, result, 0))
+
+    def logical_invert(self, context=None):
+        """Invert all its digits."""
+        if context is None:
+            context = getcontext()
+        return self.logical_xor(Decimal((0,(1,)*context.prec,0)), context)
+
+    def logical_or(self, other, context=None):
+        """Applies an 'or' operation between self and other's digits."""
+        if context is None:
+            context = getcontext()
+        if not self._islogical() or not other._islogical():
+            return context._raise_error(InvalidOperation)
+
+        # fill to context.prec
+        (opa, opb) = self._fill_logical(context, self._int, other._int)
+
+        # make the operation, and clean starting zeroes
+        result = [a|b for a,b in zip(opa,opb)]
+        for i,d in enumerate(result):
+            if d == 1:
+                break
+        result = tuple(result[i:])
+
+        # if empty, we must have at least a zero
+        if not result:
+            result = (0,)
+        return Decimal((0, result, 0))
+
+    def logical_xor(self, other, context=None):
+        """Applies an 'xor' operation between self and other's digits."""
+        if context is None:
+            context = getcontext()
+        if not self._islogical() or not other._islogical():
+            return context._raise_error(InvalidOperation)
+
+        # fill to context.prec
+        (opa, opb) = self._fill_logical(context, self._int, other._int)
+
+        # make the operation, and clean starting zeroes
+        result = [a^b for a,b in zip(opa,opb)]
+        for i,d in enumerate(result):
+            if d == 1:
+                break
+        result = tuple(result[i:])
+
+        # if empty, we must have at least a zero
+        if not result:
+            result = (0,)
+        return Decimal((0, result, 0))
+
+    def max_mag(self, other, context=None):
+        """Compares the values numerically with their sign ignored."""
+        other = _convert_other(other, raiseit=True)
+
+        if self._is_special or other._is_special:
+            # If one operand is a quiet NaN and the other is number, then the
+            # number is always returned
+            sn = self._isnan()
+            on = other._isnan()
+            if sn or on:
+                if on == 1 and sn != 2:
+                    return self
+                if sn == 1 and on != 2:
+                    return other
+                return self._check_nans(other, context)
+
+        c = self.copy_abs().__cmp__(other.copy_abs())
+        if c == 0:
+            c = self.compare_total(other)
+
+        if c == -1:
+            ans = other
+        else:
+            ans = self
+
+        if context is None:
+            context = getcontext()
+        if context._rounding_decision == ALWAYS_ROUND:
+            return ans._fix(context)
+        return ans
+
+    def min_mag(self, other, context=None):
+        """Compares the values numerically with their sign ignored."""
+        other = _convert_other(other, raiseit=True)
+
+        if self._is_special or other._is_special:
+            # If one operand is a quiet NaN and the other is number, then the
+            # number is always returned
+            sn = self._isnan()
+            on = other._isnan()
+            if sn or on:
+                if on == 1 and sn != 2:
+                    return self
+                if sn == 1 and on != 2:
+                    return other
+                return self._check_nans(other, context)
+
+        c = self.copy_abs().__cmp__(other.copy_abs())
+        if c == 0:
+            c = self.compare_total(other)
+
+        if c == -1:
+            ans = self
+        else:
+            ans = other
+
+        if context is None:
+            context = getcontext()
+        if context._rounding_decision == ALWAYS_ROUND:
+            return ans._fix(context)
+        return ans
+
+    def next_minus(self, context=None):
+        """Returns the largest representable number smaller than itself."""
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        if self._isinfinity() == -1:
+            return negInf
+        if self._isinfinity() == 1:
+            return Decimal((0, (9,)*context.prec, context.Etop()))
+
+        context = context.copy()
+        context._set_rounding(ROUND_FLOOR)
+        context._ignore_all_flags()
+        new_self = self._fix(context)
+        if new_self != self:
+            return new_self
+        return self.__sub__(Decimal((0, (1,), context.Etiny()-1)), context)
+
+    def next_plus(self, context=None):
+        """Returns the smallest representable number larger than itself."""
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(context=context)
+        if ans:
+            return ans
+
+        if self._isinfinity() == 1:
+            return Inf
+        if self._isinfinity() == -1:
+            return Decimal((1, (9,)*context.prec, context.Etop()))
+
+        context = context.copy()
+        context._set_rounding(ROUND_CEILING)
+        context._ignore_all_flags()
+        new_self = self._fix(context)
+        if new_self != self:
+            return new_self
+        return self.__add__(Decimal((0, (1,), context.Etiny()-1)), context)
+
+    def next_toward(self, other, context=None):
+        """Returns the number closest to self, in the direction towards other.
+
+        The result is the closest representable number to self
+        (excluding self) that is in the direction towards other,
+        unless both have the same value.  If the two operands are
+        numerically equal, then the result is a copy of self with the
+        sign set to be the same as the sign of other.
+        """
+        other = _convert_other(other, raiseit=True)
+
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
+
+        comparison = self.__cmp__(other)
+        if comparison == 0:
+            return Decimal((other._sign, self._int, self._exp))
+
+        if comparison == -1:
+            ans = self.next_plus(context)
+        else: # comparison == 1
+            ans = self.next_minus(context)
+
+        # decide which flags to raise using value of ans
+        if ans._isinfinity():
+            context._raise_error(Overflow,
+                                 'Infinite result from next_toward',
+                                 ans._sign)
+            context._raise_error(Rounded)
+            context._raise_error(Inexact)
+        elif ans.adjusted() < context.Emin:
+            context._raise_error(Underflow)
+            context._raise_error(Subnormal)
+            context._raise_error(Rounded)
+            context._raise_error(Inexact)
+            # if precision == 1 then we don't raise Clamped for a
+            # result 0E-Etiny.
+            if not ans:
+                context._raise_error(Clamped)
+
+        return ans
+
+    def number_class(self, context=None):
+        """Returns an indication of the class of self.
+
+        The class is one of the following strings:
+          -sNaN
+          -NaN
+          -Infinity
+          -Normal
+          -Subnormal
+          -Zero
+          +Zero
+          +Subnormal
+          +Normal
+          +Infinity
+        """
+        if self.is_snan():
+            return "sNaN"
+        if self.is_qnan():
+            return "NaN"
+        inf = self._isinfinity()
+        if inf == 1:
+            return "+Infinity"
+        if inf == -1:
+            return "-Infinity"
+        if self.is_zero():
+            if self._sign:
+                return "-Zero"
+            else:
+                return "+Zero"
+        if context is None:
+            context = getcontext()
+        if self.is_subnormal(context=context):
+            if self._sign:
+                return "-Subnormal"
+            else:
+                return "+Subnormal"
+        # just a normal, regular, boring number, :)
+        if self._sign:
+            return "-Normal"
+        else:
+            return "+Normal"
+
+    def radix(self):
+        """Just returns 10, as this is Decimal, :)"""
+        return Decimal(10)
+
+    def rotate(self, other, context=None):
+        """Returns a rotated copy of self, value-of-other times."""
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
+
+        if other._exp != 0:
+            return context._raise_error(InvalidOperation)
+        if not (-context.prec <= int(other) <= context.prec):
+            return context._raise_error(InvalidOperation)
+
+        if self._isinfinity():
+            return self
+
+        # get values, pad if necessary
+        torot = int(other)
+        rotdig = self._int
+        topad = context.prec - len(rotdig)
+        if topad:
+            rotdig = ((0,)*topad) + rotdig
+
+        # let's rotate!
+        rotated = rotdig[torot:] + rotdig[:torot]
+
+        # clean starting zeroes
+        for i,d in enumerate(rotated):
+            if d != 0:
+                break
+        rotated = rotated[i:]
+
+        return Decimal((self._sign, rotated, self._exp))
+
+
+    def scaleb (self, other, context=None):
+        """Returns self operand after adding the second value to its exp."""
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
+
+        if other._exp != 0:
+            return context._raise_error(InvalidOperation)
+        liminf = -2 * (context.Emax + context.prec)
+        limsup =  2 * (context.Emax + context.prec)
+        if not (liminf <= int(other) <= limsup):
+            return context._raise_error(InvalidOperation)
+
+        if self._isinfinity():
+            return self
+
+        d = Decimal((self._sign, self._int, self._exp + int(other)))
+        d = d._fix(context)
+        return d
+
+    def shift(self, other, context=None):
+        """Returns a shifted copy of self, value-of-other times."""
+        if context is None:
+            context = getcontext()
+
+        ans = self._check_nans(other, context)
+        if ans:
+            return ans
+
+        if other._exp != 0:
+            return context._raise_error(InvalidOperation)
+        if not (-context.prec <= int(other) <= context.prec):
+            return context._raise_error(InvalidOperation)
+
+        if self._isinfinity():
+            return self
+
+        # get values, pad if necessary
+        torot = int(other)
+        if not torot:
+            return self
+        rotdig = self._int
+        topad = context.prec - len(rotdig)
+        if topad:
+            rotdig = ((0,)*topad) + rotdig
+
+        # let's shift!
+        if torot < 0:
+            rotated = rotdig[:torot]
+        else:
+            rotated = (rotdig + ((0,) * torot))
+            rotated = rotated[-context.prec:]
+
+        # clean starting zeroes
+        if rotated:
+            for i,d in enumerate(rotated):
+                if d != 0:
+                    break
+            rotated = rotated[i:]
+        else:
+            rotated = (0,)
+
+        return Decimal((self._sign, rotated, self._exp))
+
+
     # Support for pickling, copy, and deepcopy
     def __reduce__(self):
         return (self.__class__, (str(self),))
@@ -2407,6 +3588,9 @@ class Context(object):
     def create_decimal(self, num='0'):
         """Creates a new Decimal instance but using self as context."""
         d = Decimal(num, context=self)
+        if d._isnan() and len(d._int) > self.prec - self._clamp:
+            return self._raise_error(ConversionSyntax,
+                                     "diagnostic info too long in NaN")
         return d._fix(self)
 
     # Methods
@@ -2441,6 +3625,17 @@ class Context(object):
     def _apply(self, a):
         return str(a._fix(self))
 
+    def canonical(self, a):
+        """Returns the same Decimal object.
+
+        As we do not have different encodings for the same number, the
+        received object already is in its canonical form.
+
+        >>> ExtendedContext.canonical(Decimal('2.50'))
+        Decimal("2.50")
+        """
+        return a.canonical(context=self)
+
     def compare(self, a, b):
         """Compares values numerically.
 
@@ -2470,6 +3665,110 @@ class Context(object):
         """
         return a.compare(b, context=self)
 
+    def compare_signal(self, a, b):
+        """Compares the values of the two operands numerically.
+
+        It's pretty much like compare(), but all NaNs signal, with signaling
+        NaNs taking precedence over quiet NaNs.
+
+        >>> c = ExtendedContext
+        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
+        Decimal("-1")
+        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
+        Decimal("0")
+        >>> c.flags[InvalidOperation] = 0
+        >>> print c.flags[InvalidOperation]
+        0
+        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
+        Decimal("NaN")
+        >>> print c.flags[InvalidOperation]
+        1
+        >>> c.flags[InvalidOperation] = 0
+        >>> print c.flags[InvalidOperation]
+        0
+        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
+        Decimal("NaN")
+        >>> print c.flags[InvalidOperation]
+        1
+        """
+        return a.compare_signal(b, context=self)
+
+    def compare_total(self, a, b):
+        """Compares two operands using their abstract representation.
+
+        This is not like the standard compare, which use their numerical
+        value. Note that a total ordering is defined for all possible abstract
+        representations.
+
+        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
+        Decimal("-1")
+        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
+        Decimal("-1")
+        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
+        Decimal("-1")
+        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
+        Decimal("0")
+        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
+        Decimal("1")
+        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
+        Decimal("-1")
+        """
+        return a.compare_total(b)
+
+    def compare_total_mag(self, a, b):
+        """Compares two operands using their abstract representation ignoring sign.
+
+        Like compare_total, but with operand's sign ignored and assumed to be 0.
+        """
+        return a.compare_total_mag(b)
+
+    def copy_abs(self, a):
+        """Returns a copy of the operand with the sign set to 0.
+
+        >>> ExtendedContext.copy_abs(Decimal('2.1'))
+        Decimal("2.1")
+        >>> ExtendedContext.copy_abs(Decimal('-100'))
+        Decimal("100")
+        """
+        return a.copy_abs()
+
+    def copy_decimal(self, a):
+        """Returns a copy of the decimal objet.
+
+        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
+        Decimal("2.1")
+        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
+        Decimal("-1.00")
+        """
+        return a
+
+    def copy_negate(self, a):
+        """Returns a copy of the operand with the sign inverted.
+
+        >>> ExtendedContext.copy_negate(Decimal('101.5'))
+        Decimal("-101.5")
+        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
+        Decimal("101.5")
+        """
+        return a.copy_negate()
+
+    def copy_sign(self, a, b):
+        """Copies the second operand's sign to the first one.
+
+        In detail, it returns a copy of the first operand with the sign
+        equal to the sign of the second operand.
+
+        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
+        Decimal("1.50")
+        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
+        Decimal("1.50")
+        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
+        Decimal("-1.50")
+        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
+        Decimal("-1.50")
+        """
+        return a.copy_sign(b)
+
     def divide(self, a, b):
         """Decimal division in a specified context.
 
@@ -2511,6 +3810,316 @@ class Context(object):
     def divmod(self, a, b):
         return a.__divmod__(b, context=self)
 
+    def exp(self, a):
+        """Returns e ** a.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.exp(Decimal('-Infinity'))
+        Decimal("0")
+        >>> c.exp(Decimal('-1'))
+        Decimal("0.367879441")
+        >>> c.exp(Decimal('0'))
+        Decimal("1")
+        >>> c.exp(Decimal('1'))
+        Decimal("2.71828183")
+        >>> c.exp(Decimal('0.693147181'))
+        Decimal("2.00000000")
+        >>> c.exp(Decimal('+Infinity'))
+        Decimal("Infinity")
+        """
+        return a.exp(context=self)
+
+    def fma(self, a, b, c):
+        """Returns a multiplied by b, plus c.
+
+        The first two operands are multiplied together, using multiply,
+        the third operand is then added to the result of that
+        multiplication, using add, all with only one final rounding.
+
+        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
+        Decimal("22")
+        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
+        Decimal("-8")
+        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
+        Decimal("1.38435736E+12")
+        """
+        return a.fma(b, c, context=self)
+
+    def is_canonical(self, a):
+        """Returns 1 if the operand is canonical; otherwise returns 0.
+
+        >>> ExtendedContext.is_canonical(Decimal('2.50'))
+        Decimal("1")
+        """
+        return Dec_p1
+
+    def is_finite(self, a):
+        """Returns 1 if the operand is finite, otherwise returns 0.
+
+        For it to be finite, it must be neither infinite nor a NaN.
+
+        >>> ExtendedContext.is_finite(Decimal('2.50'))
+        Decimal("1")
+        >>> ExtendedContext.is_finite(Decimal('-0.3'))
+        Decimal("1")
+        >>> ExtendedContext.is_finite(Decimal('0'))
+        Decimal("1")
+        >>> ExtendedContext.is_finite(Decimal('Inf'))
+        Decimal("0")
+        >>> ExtendedContext.is_finite(Decimal('NaN'))
+        Decimal("0")
+        """
+        return a.is_finite()
+
+    def is_infinite(self, a):
+        """Returns 1 if the operand is an Infinite, otherwise returns 0.
+
+        >>> ExtendedContext.is_infinite(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
+        Decimal("1")
+        >>> ExtendedContext.is_infinite(Decimal('NaN'))
+        Decimal("0")
+        """
+        return a.is_infinite()
+
+    def is_nan(self, a):
+        """Returns 1 if the operand is qNaN or sNaN, otherwise returns 0.
+
+        >>> ExtendedContext.is_nan(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_nan(Decimal('NaN'))
+        Decimal("1")
+        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
+        Decimal("1")
+        """
+        return a.is_nan()
+
+    def is_normal(self, a):
+        """Returns 1 if the operand is a normal number, otherwise returns 0.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.is_normal(Decimal('2.50'))
+        Decimal("1")
+        >>> c.is_normal(Decimal('0.1E-999'))
+        Decimal("0")
+        >>> c.is_normal(Decimal('0.00'))
+        Decimal("0")
+        >>> c.is_normal(Decimal('-Inf'))
+        Decimal("0")
+        >>> c.is_normal(Decimal('NaN'))
+        Decimal("0")
+        """
+        return a.is_normal(context=self)
+
+    def is_qnan(self, a):
+        """Returns 1 if the operand is a quiet NaN, otherwise returns 0.
+
+        >>> ExtendedContext.is_qnan(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_qnan(Decimal('NaN'))
+        Decimal("1")
+        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
+        Decimal("0")
+        """
+        return a.is_qnan()
+
+    def is_signed(self, a):
+        """Returns 1 if the operand is negative, otherwise returns 0.
+
+        >>> ExtendedContext.is_signed(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_signed(Decimal('-12'))
+        Decimal("1")
+        >>> ExtendedContext.is_signed(Decimal('-0'))
+        Decimal("1")
+        """
+        return a.is_signed()
+
+    def is_snan(self, a):
+        """Returns 1 if the operand is a signaling NaN, otherwise returns 0.
+
+        >>> ExtendedContext.is_snan(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_snan(Decimal('NaN'))
+        Decimal("0")
+        >>> ExtendedContext.is_snan(Decimal('sNaN'))
+        Decimal("1")
+        """
+        return a.is_snan()
+
+    def is_subnormal(self, a):
+        """Returns 1 if the operand is subnormal, otherwise returns 0.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.is_subnormal(Decimal('2.50'))
+        Decimal("0")
+        >>> c.is_subnormal(Decimal('0.1E-999'))
+        Decimal("1")
+        >>> c.is_subnormal(Decimal('0.00'))
+        Decimal("0")
+        >>> c.is_subnormal(Decimal('-Inf'))
+        Decimal("0")
+        >>> c.is_subnormal(Decimal('NaN'))
+        Decimal("0")
+        """
+        return a.is_subnormal(context=self)
+
+    def is_zero(self, a):
+        """Returns 1 if the operand is a zero, otherwise returns 0.
+
+        >>> ExtendedContext.is_zero(Decimal('0'))
+        Decimal("1")
+        >>> ExtendedContext.is_zero(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
+        Decimal("1")
+        """
+        return a.is_zero()
+
+    def ln(self, a):
+        """Returns the natural (base e) logarithm of the operand.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.ln(Decimal('0'))
+        Decimal("-Infinity")
+        >>> c.ln(Decimal('1.000'))
+        Decimal("0")
+        >>> c.ln(Decimal('2.71828183'))
+        Decimal("1.00000000")
+        >>> c.ln(Decimal('10'))
+        Decimal("2.30258509")
+        >>> c.ln(Decimal('+Infinity'))
+        Decimal("Infinity")
+        """
+        return a.ln(context=self)
+
+    def log10(self, a):
+        """Returns the base 10 logarithm of the operand.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.log10(Decimal('0'))
+        Decimal("-Infinity")
+        >>> c.log10(Decimal('0.001'))
+        Decimal("-3")
+        >>> c.log10(Decimal('1.000'))
+        Decimal("0")
+        >>> c.log10(Decimal('2'))
+        Decimal("0.301029996")
+        >>> c.log10(Decimal('10'))
+        Decimal("1")
+        >>> c.log10(Decimal('70'))
+        Decimal("1.84509804")
+        >>> c.log10(Decimal('+Infinity'))
+        Decimal("Infinity")
+        """
+        return a.log10(context=self)
+
+    def logb(self, a):
+        """ Returns the exponent of the magnitude of the operand's MSD.
+
+        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).
+
+        >>> ExtendedContext.logb(Decimal('250'))
+        Decimal("2")
+        >>> ExtendedContext.logb(Decimal('2.50'))
+        Decimal("0")
+        >>> ExtendedContext.logb(Decimal('0.03'))
+        Decimal("-2")
+        >>> ExtendedContext.logb(Decimal('0'))
+        Decimal("-Infinity")
+        """
+        return a.logb(context=self)
+
+    def logical_and(self, a, b):
+        """Applies the logical operation 'and' between each operand's digits.
+
+        The operands must be both logical numbers.
+
+        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
+        Decimal("0")
+        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
+        Decimal("0")
+        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
+        Decimal("0")
+        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
+        Decimal("1")
+        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
+        Decimal("1000")
+        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
+        Decimal("10")
+        """
+        return a.logical_and(b, context=self)
+
+    def logical_invert(self, a):
+        """Invert all the digits in the operand.
+
+        The operand must be a logical number.
+
+        >>> ExtendedContext.logical_invert(Decimal('0'))
+        Decimal("111111111")
+        >>> ExtendedContext.logical_invert(Decimal('1'))
+        Decimal("111111110")
+        >>> ExtendedContext.logical_invert(Decimal('111111111'))
+        Decimal("0")
+        >>> ExtendedContext.logical_invert(Decimal('101010101'))
+        Decimal("10101010")
+        """
+        return a.logical_invert(context=self)
+
+    def logical_or(self, a, b):
+        """Applies the logical operation 'or' between each operand's digits.
+
+        The operands must be both logical numbers.
+
+        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
+        Decimal("0")
+        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
+        Decimal("1")
+        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
+        Decimal("1")
+        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
+        Decimal("1")
+        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
+        Decimal("1110")
+        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
+        Decimal("1110")
+        """
+        return a.logical_or(b, context=self)
+
+    def logical_xor(self, a, b):
+        """Applies the logical operation 'xor' between each operand's digits.
+
+        The operands must be both logical numbers.
+
+        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
+        Decimal("0")
+        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
+        Decimal("1")
+        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
+        Decimal("1")
+        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
+        Decimal("0")
+        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
+        Decimal("110")
+        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
+        Decimal("1101")
+        """
+        return a.logical_xor(b, context=self)
+
     def max(self, a,b):
         """max compares two values numerically and returns the maximum.
 
@@ -2531,6 +4140,10 @@ class Context(object):
         """
         return a.max(b, context=self)
 
+    def max_mag(self, a, b):
+        """Compares the values numerically with their sign ignored."""
+        return a.max_mag(b, context=self)
+
     def min(self, a,b):
         """min compares two values numerically and returns the minimum.
 
@@ -2551,6 +4164,10 @@ class Context(object):
         """
         return a.min(b, context=self)
 
+    def min_mag(self, a, b):
+        """Compares the values numerically with their sign ignored."""
+        return a.min_mag(b, context=self)
+
     def minus(self, a):
         """Minus corresponds to unary prefix minus in Python.
 
@@ -2586,6 +4203,68 @@ class Context(object):
         """
         return a.__mul__(b, context=self)
 
+    def next_minus(self, a):
+        """Returns the largest representable number smaller than a.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> ExtendedContext.next_minus(Decimal('1'))
+        Decimal("0.999999999")
+        >>> c.next_minus(Decimal('1E-1007'))
+        Decimal("0E-1007")
+        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
+        Decimal("-1.00000004")
+        >>> c.next_minus(Decimal('Infinity'))
+        Decimal("9.99999999E+999")
+        """
+        return a.next_minus(context=self)
+
+    def next_plus(self, a):
+        """Returns the smallest representable number larger than a.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> ExtendedContext.next_plus(Decimal('1'))
+        Decimal("1.00000001")
+        >>> c.next_plus(Decimal('-1E-1007'))
+        Decimal("-0E-1007")
+        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
+        Decimal("-1.00000002")
+        >>> c.next_plus(Decimal('-Infinity'))
+        Decimal("-9.99999999E+999")
+        """
+        return a.next_plus(context=self)
+
+    def next_toward(self, a, b):
+        """Returns the number closest to a, in direction towards b.
+
+        The result is the closest representable number from the first
+        operand (but not the first operand) that is in the direction
+        towards the second operand, unless the operands have the same
+        value.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.next_toward(Decimal('1'), Decimal('2'))
+        Decimal("1.00000001")
+        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
+        Decimal("-0E-1007")
+        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
+        Decimal("-1.00000002")
+        >>> c.next_toward(Decimal('1'), Decimal('0'))
+        Decimal("0.999999999")
+        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
+        Decimal("0E-1007")
+        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
+        Decimal("-1.00000004")
+        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
+        Decimal("-0.00")
+        """
+        return a.next_toward(b, context=self)
+
     def normalize(self, a):
         """normalize reduces an operand to its simplest form.
 
@@ -2607,6 +4286,53 @@ class Context(object):
         """
         return a.normalize(context=self)
 
+    def number_class(self, a):
+        """Returns an indication of the class of the operand.
+
+        The class is one of the following strings:
+          -sNaN
+          -NaN
+          -Infinity
+          -Normal
+          -Subnormal
+          -Zero
+          +Zero
+          +Subnormal
+          +Normal
+          +Infinity
+
+        >>> c = Context(ExtendedContext)
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.number_class(Decimal('Infinity'))
+        '+Infinity'
+        >>> c.number_class(Decimal('1E-10'))
+        '+Normal'
+        >>> c.number_class(Decimal('2.50'))
+        '+Normal'
+        >>> c.number_class(Decimal('0.1E-999'))
+        '+Subnormal'
+        >>> c.number_class(Decimal('0'))
+        '+Zero'
+        >>> c.number_class(Decimal('-0'))
+        '-Zero'
+        >>> c.number_class(Decimal('-0.1E-999'))
+        '-Subnormal'
+        >>> c.number_class(Decimal('-1E-10'))
+        '-Normal'
+        >>> c.number_class(Decimal('-2.50'))
+        '-Normal'
+        >>> c.number_class(Decimal('-Infinity'))
+        '-Infinity'
+        >>> c.number_class(Decimal('NaN'))
+        'NaN'
+        >>> c.number_class(Decimal('-NaN'))
+        'NaN'
+        >>> c.number_class(Decimal('sNaN'))
+        'sNaN'
+        """
+        return a.number_class(context=self)
+
     def plus(self, a):
         """Plus corresponds to unary prefix plus in Python.
 
@@ -2624,49 +4350,69 @@ class Context(object):
     def power(self, a, b, modulo=None):
         """Raises a to the power of b, to modulo if given.
 
-        The right-hand operand must be a whole number whose integer part (after
-        any exponent has been applied) has no more than 9 digits and whose
-        fractional part (if any) is all zeros before any rounding.  The operand
-        may be positive, negative, or zero; if negative, the absolute value of
-        the power is used, and the left-hand operand is inverted (divided into
-        1) before use.
-
-        If the increased precision needed for the intermediate calculations
-        exceeds the capabilities of the implementation then an Invalid
-        operation condition is raised.
-
-        If, when raising to a negative power, an underflow occurs during the
-        division into 1, the operation is not halted at that point but
-        continues.
-
-        >>> ExtendedContext.power(Decimal('2'), Decimal('3'))
+        With two arguments, compute a**b.  If a is negative then b
+        must be integral.  The result will be inexact unless b is
+        integral and the result is finite and can be expressed exactly
+        in 'precision' digits.
+
+        With three arguments, compute (a**b) % modulo.  For the
+        three argument form, the following restrictions on the
+        arguments hold:
+
+         - all three arguments must be integral
+         - b must be nonnegative
+         - at least one of a or b must be nonzero
+         - modulo must be nonzero and have at most 'precision' digits
+
+        The result of pow(a, b, modulo) is identical to the result
+        that would be obtained by computing (a**b) % modulo with
+        unbounded precision, but is computed more efficiently.  It is
+        always exact.
+
+        >>> c = ExtendedContext.copy()
+        >>> c.Emin = -999
+        >>> c.Emax = 999
+        >>> c.power(Decimal('2'), Decimal('3'))
         Decimal("8")
-        >>> ExtendedContext.power(Decimal('2'), Decimal('-3'))
+        >>> c.power(Decimal('-2'), Decimal('3'))
+        Decimal("-8")
+        >>> c.power(Decimal('2'), Decimal('-3'))
         Decimal("0.125")
-        >>> ExtendedContext.power(Decimal('1.7'), Decimal('8'))
+        >>> c.power(Decimal('1.7'), Decimal('8'))
         Decimal("69.7575744")
-        >>> ExtendedContext.power(Decimal('Infinity'), Decimal('-2'))
+        >>> c.power(Decimal('10'), Decimal('0.301029996'))
+        Decimal("2.00000000")
+        >>> c.power(Decimal('Infinity'), Decimal('-1'))
         Decimal("0")
-        >>> ExtendedContext.power(Decimal('Infinity'), Decimal('-1'))
-        Decimal("0")
-        >>> ExtendedContext.power(Decimal('Infinity'), Decimal('0'))
+        >>> c.power(Decimal('Infinity'), Decimal('0'))
         Decimal("1")
-        >>> ExtendedContext.power(Decimal('Infinity'), Decimal('1'))
-        Decimal("Infinity")
-        >>> ExtendedContext.power(Decimal('Infinity'), Decimal('2'))
+        >>> c.power(Decimal('Infinity'), Decimal('1'))
         Decimal("Infinity")
-        >>> ExtendedContext.power(Decimal('-Infinity'), Decimal('-2'))
-        Decimal("0")
-        >>> ExtendedContext.power(Decimal('-Infinity'), Decimal('-1'))
+        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
         Decimal("-0")
-        >>> ExtendedContext.power(Decimal('-Infinity'), Decimal('0'))
+        >>> c.power(Decimal('-Infinity'), Decimal('0'))
         Decimal("1")
-        >>> ExtendedContext.power(Decimal('-Infinity'), Decimal('1'))
+        >>> c.power(Decimal('-Infinity'), Decimal('1'))
         Decimal("-Infinity")
-        >>> ExtendedContext.power(Decimal('-Infinity'), Decimal('2'))
+        >>> c.power(Decimal('-Infinity'), Decimal('2'))
         Decimal("Infinity")
-        >>> ExtendedContext.power(Decimal('0'), Decimal('0'))
+        >>> c.power(Decimal('0'), Decimal('0'))
         Decimal("NaN")
+
+        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
+        Decimal("11")
+        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
+        Decimal("-11")
+        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
+        Decimal("1")
+        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
+        Decimal("11")
+        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
+        Decimal("11729830")
+        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
+        Decimal("-0")
+        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
+        Decimal("1")
         """
         return a.__pow__(b, modulo, context=self)
 
@@ -2721,6 +4467,14 @@ class Context(object):
         """
         return a.quantize(b, context=self)
 
+    def radix(self):
+        """Just returns 10, as this is Decimal, :)
+
+        >>> ExtendedContext.radix()
+        Decimal("10")
+        """
+        return Decimal(10)
+
     def remainder(self, a, b):
         """Returns the remainder from integer division.
 
@@ -2775,6 +4529,28 @@ class Context(object):
         """
         return a.remainder_near(b, context=self)
 
+    def rotate(self, a, b):
+        """Returns a rotated copy of a, b times.
+
+        The coefficient of the result is a rotated copy of the digits in
+        the coefficient of the first operand.  The number of places of
+        rotation is taken from the absolute value of the second operand,
+        with the rotation being to the left if the second operand is
+        positive or to the right otherwise.
+
+        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
+        Decimal("400000003")
+        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
+        Decimal("12")
+        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
+        Decimal("891234567")
+        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
+        Decimal("123456789")
+        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
+        Decimal("345678912")
+        """
+        return a.rotate(b, context=self)
+
     def same_quantum(self, a, b):
         """Returns True if the two operands have the same exponent.
 
@@ -2792,6 +4568,41 @@ class Context(object):
         """
         return a.same_quantum(b)
 
+    def scaleb (self, a, b):
+        """Returns the first operand after adding the second value its exp.
+
+        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
+        Decimal("0.0750")
+        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
+        Decimal("7.50")
+        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
+        Decimal("7.50E+3")
+        """
+        return a.scaleb (b, context=self)
+
+    def shift(self, a, b):
+        """Returns a shifted copy of a, b times.
+
+        The coefficient of the result 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.
+
+        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
+        Decimal("400000000")
+        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
+        Decimal("0")
+        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
+        Decimal("1234567")
+        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
+        Decimal("123456789")
+        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
+        Decimal("345678900")
+        """
+        return a.shift(b, context=self)
+
     def sqrt(self, a):
         """Square root of a non-negative number to context precision.
 
@@ -2847,7 +4658,36 @@ class Context(object):
         """
         return a.__str__(context=self)
 
-    def to_integral(self, a):
+    def to_integral_exact(self, a):
+        """Rounds to an integer.
+
+        When the operand has a negative exponent, the result is the same
+        as using the quantize() operation using the given operand as the
+        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
+        of the operand as the precision setting; Inexact and Rounded flags
+        are allowed in this operation.  The rounding mode is taken from the
+        context.
+
+        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
+        Decimal("2")
+        >>> ExtendedContext.to_integral_exact(Decimal('100'))
+        Decimal("100")
+        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
+        Decimal("100")
+        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
+        Decimal("102")
+        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
+        Decimal("-102")
+        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
+        Decimal("1.0E+6")
+        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
+        Decimal("7.89E+77")
+        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
+        Decimal("-Infinity")
+        """
+        return a.to_integral_exact(context=self)
+
+    def to_integral_value(self, a):
         """Rounds to an integer.
 
         When the operand has a negative exponent, the result is the same
@@ -2856,24 +4696,27 @@ class Context(object):
         of the operand as the precision setting, except that no flags will
         be set.  The rounding mode is taken from the context.
 
-        >>> ExtendedContext.to_integral(Decimal('2.1'))
+        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
         Decimal("2")
-        >>> ExtendedContext.to_integral(Decimal('100'))
+        >>> ExtendedContext.to_integral_value(Decimal('100'))
         Decimal("100")
-        >>> ExtendedContext.to_integral(Decimal('100.0'))
+        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
         Decimal("100")
-        >>> ExtendedContext.to_integral(Decimal('101.5'))
+        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
         Decimal("102")
-        >>> ExtendedContext.to_integral(Decimal('-101.5'))
+        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
         Decimal("-102")
-        >>> ExtendedContext.to_integral(Decimal('10E+5'))
+        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
         Decimal("1.0E+6")
-        >>> ExtendedContext.to_integral(Decimal('7.89E+77'))
+        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
         Decimal("7.89E+77")
-        >>> ExtendedContext.to_integral(Decimal('-Inf'))
+        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
         Decimal("-Infinity")
         """
-        return a.to_integral(context=self)
+        return a.to_integral_value(context=self)
+
+    # the method name changed, but we provide also the old one, for compatibility
+    to_integral = to_integral_value
 
 class _WorkRep(object):
     __slots__ = ('sign','int','exp')
@@ -2911,39 +4754,28 @@ def _normalize(op1, op2, shouldround = 0, prec = 0):
 
     Done during addition.
     """
-    # Yes, the exponent is a long, but the difference between exponents
-    # must be an int-- otherwise you'd get a big memory problem.
-    numdigits = int(op1.exp - op2.exp)
-    if numdigits < 0:
-        numdigits = -numdigits
+    if op1.exp < op2.exp:
         tmp = op2
         other = op1
     else:
         tmp = op1
         other = op2
 
-
-    if shouldround and numdigits > prec + 1:
-        # Big difference in exponents - check the adjusted exponents
+    # Let exp = min(tmp.exp - 1, tmp.adjusted() - precision - 1).
+    # Then adding 10**exp to tmp has the same effect (after rounding)
+    # as adding any positive quantity smaller than 10**exp; similarly
+    # for subtraction.  So if other is smaller than 10**exp we replace
+    # it with 10**exp.  This avoids tmp.exp - other.exp getting too large.
+    if shouldround:
         tmp_len = len(str(tmp.int))
         other_len = len(str(other.int))
-        if numdigits > (other_len + prec + 1 - tmp_len):
-            # If the difference in adjusted exps is > prec+1, we know
-            # other is insignificant, so might as well put a 1 after the
-            # precision (since this is only for addition).  Also stops
-            # use of massive longs.
-
-            extend = prec + 2 - tmp_len
-            if extend <= 0:
-                extend = 1
-            tmp.int *= 10 ** extend
-            tmp.exp -= extend
+        exp = tmp.exp + min(-1, tmp_len - prec - 2)
+        if other_len + other.exp - 1 < exp:
             other.int = 1
-            other.exp = tmp.exp
-            return op1, op2
+            other.exp = exp
 
-    tmp.int *= 10 ** numdigits
-    tmp.exp -= numdigits
+    tmp.int *= 10 ** (tmp.exp - other.exp)
+    tmp.exp = other.exp
     return op1, op2
 
 def _adjust_coefficients(op1, op2):
@@ -2968,9 +4800,315 @@ def _adjust_coefficients(op1, op2):
 
     return op1, op2, adjust
 
+
+##### Integer arithmetic functions used by ln, log10, exp and __pow__ #####
+
+# This function from Tim Peters was taken from here:
+# http://mail.python.org/pipermail/python-list/1999-July/007758.html
+# The correction being in the function definition is for speed, and
+# the whole function is not resolved with math.log because of avoiding
+# the use of floats.
+def _nbits(n, correction = {
+        '0': 4, '1': 3, '2': 2, '3': 2,
+        '4': 1, '5': 1, '6': 1, '7': 1,
+        '8': 0, '9': 0, 'a': 0, 'b': 0,
+        'c': 0, 'd': 0, 'e': 0, 'f': 0}):
+    """Number of bits in binary representation of the positive integer n,
+    or 0 if n == 0.
+    """
+    if n < 0:
+        raise ValueError("The argument to _nbits should be nonnegative.")
+    hex_n = "%x" % n
+    return 4*len(hex_n) - correction[hex_n[0]]
+
+def _sqrt_nearest(n, a):
+    """Closest integer to the square root of the positive integer n.  a is
+    an initial approximation to the square root.  Any positive integer
+    will do for a, but the closer a is to the square root of n the
+    faster convergence will be.
+
+    """
+    if n <= 0 or a <= 0:
+        raise ValueError("Both arguments to _sqrt_nearest should be positive.")
+
+    b=0
+    while a != b:
+        b, a = a, a--n//a>>1
+    return a
+
+def _rshift_nearest(x, shift):
+    """Given an integer x and a nonnegative integer shift, return closest
+    integer to x / 2**shift; use round-to-even in case of a tie.
+
+    """
+    b, q = 1L << shift, x >> shift
+    return q + (2*(x & (b-1)) + (q&1) > b)
+
+def _div_nearest(a, b):
+    """Closest integer to a/b, a and b positive integers; rounds to even
+    in the case of a tie.
+
+    """
+    q, r = divmod(a, b)
+    return q + (2*r + (q&1) > b)
+
+def _ilog(x, M, L = 8):
+    """Integer approximation to M*log(x/M), with absolute error boundable
+    in terms only of x/M.
+
+    Given positive integers x and M, return an integer approximation to
+    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
+    between the approximation and the exact result is at most 22.  For
+    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
+    both cases these are upper bounds on the error; it will usually be
+    much smaller."""
+
+    # The basic algorithm is the following: let log1p be the function
+    # log1p(x) = log(1+x).  Then log(x/M) = log1p((x-M)/M).  We use
+    # the reduction
+    #
+    #    log1p(y) = 2*log1p(y/(1+sqrt(1+y)))
+    #
+    # repeatedly until the argument to log1p is small (< 2**-L in
+    # absolute value).  For small y we can use the Taylor series
+    # expansion
+    #
+    #    log1p(y) ~ y - y**2/2 + y**3/3 - ... - (-y)**T/T
+    #
+    # truncating at T such that y**T is small enough.  The whole
+    # computation is carried out in a form of fixed-point arithmetic,
+    # with a real number z being represented by an integer
+    # approximation to z*M.  To avoid loss of precision, the y below
+    # is actually an integer approximation to 2**R*y*M, where R is the
+    # number of reductions performed so far.
+
+    y = x-M
+    # argument reduction; R = number of reductions performed
+    R = 0
+    while (R <= L and long(abs(y)) << L-R >= M or
+           R > L and abs(y) >> R-L >= M):
+        y = _div_nearest(long(M*y) << 1,
+                         M + _sqrt_nearest(M*(M+_rshift_nearest(y, R)), M))
+        R += 1
+
+    # Taylor series with T terms
+    T = -int(-10*len(str(M))//(3*L))
+    yshift = _rshift_nearest(y, R)
+    w = _div_nearest(M, T)
+    for k in xrange(T-1, 0, -1):
+        w = _div_nearest(M, k) - _div_nearest(yshift*w, M)
+
+    return _div_nearest(w*y, M)
+
+def _dlog10(c, e, p):
+    """Given integers c, e and p with c > 0, p >= 0, compute an integer
+    approximation to 10**p * log10(c*10**e), with an absolute error of
+    at most 1.  Assumes that c*10**e is not exactly 1."""
+
+    # increase precision by 2; compensate for this by dividing
+    # final result by 100
+    p += 2
+
+    # write c*10**e as d*10**f with either:
+    #   f >= 0 and 1 <= d <= 10, or
+    #   f <= 0 and 0.1 <= d <= 1.
+    # Thus for c*10**e close to 1, f = 0
+    l = len(str(c))
+    f = e+l - (e+l >= 1)
+
+    if p > 0:
+        M = 10**p
+        k = e+p-f
+        if k >= 0:
+            c *= 10**k
+        else:
+            c = _div_nearest(c, 10**-k)
+
+        log_d = _ilog(c, M) # error < 5 + 22 = 27
+        log_10 = _ilog(10*M, M) # error < 15
+        log_d = _div_nearest(log_d*M, log_10)
+        log_tenpower = f*M # exact
+    else:
+        log_d = 0  # error < 2.31
+        log_tenpower = div_nearest(f, 10**-p) # error < 0.5
+
+    return _div_nearest(log_tenpower+log_d, 100)
+
+def _dlog(c, e, p):
+    """Given integers c, e and p with c > 0, compute an integer
+    approximation to 10**p * log(c*10**e), with an absolute error of
+    at most 1.  Assumes that c*10**e is not exactly 1."""
+
+    # Increase precision by 2. The precision increase is compensated
+    # for at the end with a division by 100.
+    p += 2
+
+    # rewrite c*10**e as d*10**f with either f >= 0 and 1 <= d <= 10,
+    # or f <= 0 and 0.1 <= d <= 1.  Then we can compute 10**p * log(c*10**e)
+    # as 10**p * log(d) + 10**p*f * log(10).
+    l = len(str(c))
+    f = e+l - (e+l >= 1)
+
+    # compute approximation to 10**p*log(d), with error < 27
+    if p > 0:
+        k = e+p-f
+        if k >= 0:
+            c *= 10**k
+        else:
+            c = _div_nearest(c, 10**-k)  # error of <= 0.5 in c
+
+        # _ilog magnifies existing error in c by a factor of at most 10
+        log_d = _ilog(c, 10**p) # error < 5 + 22 = 27
+    else:
+        # p <= 0: just approximate the whole thing by 0; error < 2.31
+        log_d = 0
+
+    # compute approximation to 10**p*f*log(10), with error < 17
+    if f:
+        sign_f = [-1, 1][f > 0]
+        if p >= 0:
+            M = 10**p * abs(f)
+        else:
+            M = _div_nearest(abs(f), 10**-p) # M = 10**p*|f|, error <= 0.5
+
+        if M:
+            f_log_ten = sign_f*_ilog(10*M, M)   # M*log(10), error <= 1.2 + 15 < 17
+        else:
+            f_log_ten = 0
+    else:
+        f_log_ten = 0
+
+    # error in sum < 17+27 = 44; error after division < 0.44 + 0.5 < 1
+    return _div_nearest(f_log_ten + log_d, 100)
+
+def _iexp(x, M, L=8):
+    """Given integers x and M, M > 0, such that x/M is small in absolute
+    value, compute an integer approximation to M*exp(x/M).  For 0 <=
+    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
+    is usually much smaller)."""
+
+    # Algorithm: to compute exp(z) for a real number z, first divide z
+    # by a suitable power R of 2 so that |z/2**R| < 2**-L.  Then
+    # compute expm1(z/2**R) = exp(z/2**R) - 1 using the usual Taylor
+    # series
+    #
+    #     expm1(x) = x + x**2/2! + x**3/3! + ...
+    #
+    # Now use the identity
+    #
+    #     expm1(2x) = expm1(x)*(expm1(x)+2)
+    #
+    # R times to compute the sequence expm1(z/2**R),
+    # expm1(z/2**(R-1)), ... , exp(z/2), exp(z).
+
+    # Find R such that x/2**R/M <= 2**-L
+    R = _nbits((long(x)<<L)//M)
+
+    # Taylor series.  (2**L)**T > M
+    T = -int(-10*len(str(M))//(3*L))
+    y = _div_nearest(x, T)
+    Mshift = long(M)<<R
+    for i in xrange(T-1, 0, -1):
+        y = _div_nearest(x*(Mshift + y), Mshift * i)
+
+    # Expansion
+    for k in xrange(R-1, -1, -1):
+        Mshift = long(M)<<(k+2)
+        y = _div_nearest(y*(y+Mshift), Mshift)
+
+    return M+y
+
+def _dexp(c, e, p):
+    """Compute an approximation to exp(c*10**e), with p decimal places of
+    precision.
+
+    Returns d, f such that:
+
+      10**(p-1) <= d <= 10**p, and
+      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f
+
+    In other words, d*10**f is an approximation to exp(c*10**e) with p
+    digits of precision, and with an error in d of at most 1.  This is
+    almost, but not quite, the same as the error being < 1ulp: when d
+    = 10**(p-1) the error could be up to 10 ulp."""
+
+    # we'll call iexp with M = 10**(p+2), giving p+3 digits of precision
+    p += 2
+
+    # compute log10 with extra precision = adjusted exponent of c*10**e
+    extra = max(0, e + len(str(c)) - 1)
+    q = p + extra
+    log10 = _dlog(10, 0, q)  # error <= 1
+
+    # compute quotient c*10**e/(log10/10**q) = c*10**(e+q)/log10,
+    # rounding down
+    shift = e+q
+    if shift >= 0:
+        cshift = c*10**shift
+    else:
+        cshift = c//10**-shift
+    quot, rem = divmod(cshift, log10)
+
+    # reduce remainder back to original precision
+    rem = _div_nearest(rem, 10**extra)
+
+    # error in result of _iexp < 120;  error after division < 0.62
+    return _div_nearest(_iexp(rem, 10**p), 1000), quot - p + 3
+
+def _dpower(xc, xe, yc, ye, p):
+    """Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
+    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:
+
+      10**(p-1) <= c <= 10**p, and
+      (c-1)*10**e < x**y < (c+1)*10**e
+
+    in other words, c*10**e is an approximation to x**y with p digits
+    of precision, and with an error in c of at most 1.  (This is
+    almost, but not quite, the same as the error being < 1ulp: when c
+    == 10**(p-1) we can only guarantee error < 10ulp.)
+
+    We assume that: x is positive and not equal to 1, and y is nonzero.
+    """
+
+    # Find b such that 10**(b-1) <= |y| <= 10**b
+    b = len(str(abs(yc))) + ye
+
+    # log(x) = lxc*10**(-p-b-1), to p+b+1 places after the decimal point
+    lxc = _dlog(xc, xe, p+b+1)
+
+    # compute product y*log(x) = yc*lxc*10**(-p-b-1+ye) = pc*10**(-p-1)
+    shift = ye-b
+    if shift >= 0:
+        pc = lxc*yc*10**shift
+    else:
+        pc = _div_nearest(lxc*yc, 10**-shift)
+
+    if pc == 0:
+        # we prefer a result that isn't exactly 1; this makes it
+        # easier to compute a correctly rounded result in __pow__
+        if ((len(str(xc)) + xe >= 1) == (yc > 0)): # if x**y > 1:
+            coeff, exp = 10**(p-1)+1, 1-p
+        else:
+            coeff, exp = 10**p-1, -p
+    else:
+        coeff, exp = _dexp(pc, -(p+1), p+1)
+        coeff = _div_nearest(coeff, 10)
+        exp += 1
+
+    return coeff, exp
+
+def _log10_lb(c, correction = {
+        '1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
+        '6': 23, '7': 16, '8': 10, '9': 5}):
+    """Compute a lower bound for 100*log10(c) for a positive integer c."""
+    if c <= 0:
+        raise ValueError("The argument to _log10_lb should be nonnegative.")
+    str_c = str(c)
+    return 100*len(str_c) - correction[str_c[0]]
+
 ##### Helper Functions ####################################################
 
-def _convert_other(other):
+def _convert_other(other, raiseit=False):
     """Convert other to Decimal.
 
     Verifies that it's ok to use in an implicit construction.
@@ -2979,6 +5117,8 @@ def _convert_other(other):
         return other
     if isinstance(other, (int, long)):
         return Decimal(other)
+    if raiseit:
+        raise TypeError("Unable to convert %s to Decimal" % other)
     return NotImplemented
 
 _infinity_map = {
@@ -3066,12 +5206,16 @@ ExtendedContext = Context(
 # Reusable defaults
 Inf = Decimal('Inf')
 negInf = Decimal('-Inf')
+NaN = Decimal('NaN')
+Dec_0 = Decimal(0)
+Dec_p1 = Decimal(1)
+Dec_n1 = Decimal(-1)
+Dec_p2 = Decimal(2)
+Dec_n2 = Decimal(-2)
 
 # Infsign[sign] is infinity w/ that sign
 Infsign = (Inf, negInf)
 
-NaN = Decimal('NaN')
-
 
 ##### crud for parsing strings #############################################
 import re
index 3f0849a0adb29c0887c265b35e18915dbb165a48..ed4c46e7d8c7a0e3c869e56e0ba79daa071e2903 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- abs.decTest -- decimal absolute value                              --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- This set of tests primarily tests the existence of the operator.
 -- Additon, subtraction, rounding, and more overflows are tested
@@ -106,9 +106,9 @@ absx214 abs  0.01E-999        ->   1E-1001   Subnormal
 absx215 abs  0.999E-999       ->   1.00E-999 Inexact Rounded Subnormal Underflow
 absx216 abs  0.099E-999       ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 absx217 abs  0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
-absx218 abs  0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow
-absx219 abs  0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
-absx220 abs  0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
+absx218 abs  0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+absx219 abs  0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+absx220 abs  0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 absx230 abs -1.00E-999        ->   1.00E-999
 absx231 abs -0.1E-999         ->   1E-1000   Subnormal
@@ -119,9 +119,9 @@ absx234 abs -0.01E-999        ->   1E-1001   Subnormal
 absx235 abs -0.999E-999       ->   1.00E-999 Inexact Rounded Subnormal Underflow
 absx236 abs -0.099E-999       ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 absx237 abs -0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
-absx238 abs -0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow
-absx239 abs -0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
-absx240 abs -0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
+absx238 abs -0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+absx239 abs -0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+absx240 abs -0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 -- long operand tests
 maxexponent: 999
index 2d3efabe2060130a233a04d4186a9297f23eab71..3460aa4cd2510caea628162ef8cf011fa8f3a239 100644 (file)
@@ -1,6 +1,6 @@
-------------------------------------------------------------------------
+------/cancell----------------------------------------------------------
 -- add.decTest -- decimal addition                                    --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 precision:   9
 rounding:    half_up
@@ -86,6 +86,7 @@ addx048 add '10000e+9'  '700' -> '10000000000700'
 addx049 add '10000e+9'  '7000' -> '10000000007000'
 addx050 add '10000e+9'  '70000' -> '10000000070000'
 addx051 add '10000e+9'  '700000' -> '10000000700000'
+addx052 add '10000e+9'  '7000000' -> '10000007000000'
 
 -- examples from decarith
 addx053 add '12' '7.00' -> '19.00'
@@ -216,7 +217,7 @@ addx166 add '7E+12'  '1.11' -> '7000000000001.11'
 addx167 add '1.11'  '7E+12' -> '7000000000001.11'
 addx168 add '-1'    '7E+12' -> '6999999999999'
 
---            123456789012345      123456789012345      1 23456789012345
+--             123456789012345      123456789012345      1 23456789012345
 addx170 add '0.444444444444444'  '0.555555555555563' -> '1.00000000000001' Inexact Rounded
 addx171 add '0.444444444444444'  '0.555555555555562' -> '1.00000000000001' Inexact Rounded
 addx172 add '0.444444444444444'  '0.555555555555561' -> '1.00000000000001' Inexact Rounded
@@ -396,6 +397,7 @@ minexponent: -92
 addx361  add 0E+50 10000E+1  -> 1.0000E+5
 addx362  add 10000E+1 0E-50  -> 100000.0  Rounded
 addx363  add 10000E+1 10000E-50  -> 100000.0  Rounded Inexact
+addx364  add 9.999999E+92 -9.999999E+92 -> 0E+86
 
 -- a curiosity from JSR 13 testing
 rounding:    half_down
@@ -568,7 +570,7 @@ minExponent: -393
 rounding:     down
 addx561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
 addx562 add      0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
--- and using decimal64 bounds...
+-- and using decimal64 bounds (see also ddadd.decTest)
 precision:    16
 maxExponent: +384
 minExponent: -383
@@ -576,6 +578,7 @@ rounding:     down
 addx563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
 addx564 add      0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
 
+
 -- some more residue effects with extreme rounding
 precision:   9
 rounding: half_up
@@ -955,26 +958,26 @@ addx911 add  0.1E-999    0    ->   1E-1000   Subnormal
 addx912 add  0.10E-999   0    ->   1.0E-1000 Subnormal
 addx913 add  0.100E-999  0    ->   1.0E-1000 Subnormal Rounded
 addx914 add  0.01E-999   0    ->   1E-1001   Subnormal
--- next is rounded to Emin
+-- next is rounded to Nmin
 addx915 add  0.999E-999  0    ->   1.00E-999 Inexact Rounded Subnormal Underflow
 addx916 add  0.099E-999  0    ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 addx917 add  0.009E-999  0    ->   1E-1001   Inexact Rounded Subnormal Underflow
-addx918 add  0.001E-999  0    ->   0E-1001   Inexact Rounded Subnormal Underflow
-addx919 add  0.0009E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow
-addx920 add  0.0001E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow
+addx918 add  0.001E-999  0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+addx919 add  0.0009E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+addx920 add  0.0001E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 addx930 add -1.00E-999   0    ->  -1.00E-999
 addx931 add -0.1E-999    0    ->  -1E-1000   Subnormal
 addx932 add -0.10E-999   0    ->  -1.0E-1000 Subnormal
 addx933 add -0.100E-999  0    ->  -1.0E-1000 Subnormal Rounded
 addx934 add -0.01E-999   0    ->  -1E-1001   Subnormal
--- next is rounded to Emin
+-- next is rounded to Nmin
 addx935 add -0.999E-999  0    ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 addx936 add -0.099E-999  0    ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 addx937 add -0.009E-999  0    ->  -1E-1001   Inexact Rounded Subnormal Underflow
-addx938 add -0.001E-999  0    ->  -0E-1001   Inexact Rounded Subnormal Underflow
-addx939 add -0.0009E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow
-addx940 add -0.0001E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow
+addx938 add -0.001E-999  0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+addx939 add -0.0009E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+addx940 add -0.0001E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 -- some non-zero subnormal adds
 addx950 add  1.00E-999    0.1E-999  ->   1.10E-999
@@ -995,12 +998,43 @@ addx963 add  0.10E-999   -0.1E-999  ->   0E-1001
 addx964 add  0.100E-999  -0.1E-999  ->   0E-1001    Clamped
 addx965 add  0.01E-999   -0.1E-999  ->   -9E-1001   Subnormal
 addx966 add  0.999E-999  -0.1E-999  ->   9.0E-1000  Inexact Rounded Subnormal Underflow
-addx967 add  0.099E-999  -0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow
+addx967 add  0.099E-999  -0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 addx968 add  0.009E-999  -0.1E-999  ->   -9E-1001   Inexact Rounded Subnormal Underflow
 addx969 add  0.001E-999  -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
 addx970 add  0.0009E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
 addx971 add  0.0001E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
 
+-- some 'real' numbers
+maxExponent: 384
+minExponent: -383
+precision: 8
+addx566 add 99999061735E-394  0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
+precision: 7
+addx567 add 99999061735E-394  0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
+precision: 6
+addx568 add 99999061735E-394  0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+precision:   16
+rounding:    half_up
+maxExponent: 384
+minExponent: -383
+
+addx571 add       1E-383       0  -> 1E-383
+addx572 add       1E-384       0  -> 1E-384   Subnormal
+addx573 add       1E-383  1E-384  -> 1.1E-383
+addx574 subtract  1E-383  1E-384  ->   9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+addx575 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
+addx576 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
+addx577 subtract  1E-383  1E-399  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx578 subtract  1E-383  1E-400  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx579 subtract  1E-383  1E-401  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx580 subtract  1E-383  1E-402  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
 -- check overflow edge case
 precision:   7
 rounding:    half_up
@@ -1106,22 +1140,1566 @@ addx1138 add      10000E-101 -1e-200  ->  9.999E-98  Subnormal Inexact Rounded U
 addx1139 add       1000E-101 -1e-200  ->  9.99E-99   Subnormal Inexact Rounded Underflow
 addx1140 add        100E-101 -1e-200  ->  9.9E-100   Subnormal Inexact Rounded Underflow
 addx1141 add         10E-101 -1e-200  ->  9E-101     Subnormal Inexact Rounded Underflow
-addx1142 add          1E-101 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow
-addx1143 add          0E-101 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow
-addx1144 add          1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow
+addx1142 add          1E-101 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped
+addx1143 add          0E-101 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow Clamped
+addx1144 add          1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped
 
 addx1151 add      10000E-102 -1e-200  ->  9.99E-99  Subnormal Inexact Rounded Underflow
 addx1152 add       1000E-102 -1e-200  ->  9.9E-100  Subnormal Inexact Rounded Underflow
 addx1153 add        100E-102 -1e-200  ->  9E-101   Subnormal Inexact Rounded Underflow
-addx1154 add         10E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow
-addx1155 add          1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow
-addx1156 add          0E-102 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow
-addx1157 add          1E-103 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow
+addx1154 add         10E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped
+addx1155 add          1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped
+addx1156 add          0E-102 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow Clamped
+addx1157 add          1E-103 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped
+
+addx1160 add        100E-105 -1e-101  -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+addx1161 add        100E-105 -1e-201  ->  0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+-- tests based on Gunnar Degnbol's edge case
+precision:   15
+rounding:    half_up
+maxExponent: 384
+minexponent: -383
+
+addx1200 add 1E15  -0.5                 ->  1.00000000000000E+15 Inexact Rounded
+addx1201 add 1E15  -0.50                ->  1.00000000000000E+15 Inexact Rounded
+addx1210 add 1E15  -0.51                ->  999999999999999      Inexact Rounded
+addx1211 add 1E15  -0.501               ->  999999999999999      Inexact Rounded
+addx1212 add 1E15  -0.5001              ->  999999999999999      Inexact Rounded
+addx1213 add 1E15  -0.50001             ->  999999999999999      Inexact Rounded
+addx1214 add 1E15  -0.500001            ->  999999999999999      Inexact Rounded
+addx1215 add 1E15  -0.5000001           ->  999999999999999      Inexact Rounded
+addx1216 add 1E15  -0.50000001          ->  999999999999999      Inexact Rounded
+addx1217 add 1E15  -0.500000001         ->  999999999999999      Inexact Rounded
+addx1218 add 1E15  -0.5000000001        ->  999999999999999      Inexact Rounded
+addx1219 add 1E15  -0.50000000001       ->  999999999999999      Inexact Rounded
+addx1220 add 1E15  -0.500000000001      ->  999999999999999      Inexact Rounded
+addx1221 add 1E15  -0.5000000000001     ->  999999999999999      Inexact Rounded
+addx1222 add 1E15  -0.50000000000001    ->  999999999999999      Inexact Rounded
+addx1223 add 1E15  -0.500000000000001   ->  999999999999999      Inexact Rounded
+addx1224 add 1E15  -0.5000000000000001  ->  999999999999999      Inexact Rounded
+addx1225 add 1E15  -0.5000000000000000  ->  1.00000000000000E+15 Inexact Rounded
+addx1230 add 1E15  -5000000.000000001   ->  999999995000000      Inexact Rounded
+
+precision:   16
+
+addx1300 add 1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded
+addx1310 add 1E16  -0.51                ->  9999999999999999      Inexact Rounded
+addx1311 add 1E16  -0.501               ->  9999999999999999      Inexact Rounded
+addx1312 add 1E16  -0.5001              ->  9999999999999999      Inexact Rounded
+addx1313 add 1E16  -0.50001             ->  9999999999999999      Inexact Rounded
+addx1314 add 1E16  -0.500001            ->  9999999999999999      Inexact Rounded
+addx1315 add 1E16  -0.5000001           ->  9999999999999999      Inexact Rounded
+addx1316 add 1E16  -0.50000001          ->  9999999999999999      Inexact Rounded
+addx1317 add 1E16  -0.500000001         ->  9999999999999999      Inexact Rounded
+addx1318 add 1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded
+addx1319 add 1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded
+addx1320 add 1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded
+addx1321 add 1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded
+addx1322 add 1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded
+addx1323 add 1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded
+addx1324 add 1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded
+addx1325 add 1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
+addx1326 add 1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
+addx1327 add 1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
+addx1328 add 1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
+addx1329 add 1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
+addx1330 add 1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
+addx1331 add 1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
+addx1332 add 1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded
+addx1333 add 1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded
+addx1334 add 1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded
+addx1335 add 1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded
+addx1336 add 1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded
+addx1337 add 1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded
+addx1338 add 1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded
+addx1339 add 1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded
+
+addx1340 add 1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded
+addx1341 add 1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded
+
+addx1349 add 9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded
+addx1350 add 9999999999999999 0.49                ->  9999999999999999      Inexact Rounded
+addx1351 add 9999999999999999 0.499               ->  9999999999999999      Inexact Rounded
+addx1352 add 9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded
+addx1353 add 9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded
+addx1354 add 9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded
+addx1355 add 9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded
+addx1356 add 9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded
+addx1357 add 9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded
+addx1358 add 9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded
+addx1359 add 9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded
+addx1360 add 9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded
+addx1361 add 9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded
+addx1362 add 9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded
+addx1363 add 9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded
+addx1364 add 9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded
+addx1365 add 9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
+addx1367 add 9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
+addx1368 add 9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
+addx1369 add 9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
+addx1370 add 9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
+addx1371 add 9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
+addx1372 add 9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
+addx1373 add 9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded
+addx1374 add 9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded
+addx1375 add 9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded
+addx1376 add 9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded
+addx1377 add 9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded
+addx1378 add 9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded
+addx1379 add 9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded
+addx1380 add 9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded
+addx1381 add 9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded
+addx1382 add 9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded
+addx1383 add 9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded
+addx1384 add 9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded
+addx1385 add 9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded
+addx1386 add 9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded
+addx1387 add 9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded
+addx1388 add 9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded
+addx1389 add 9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded
+addx1390 add 9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded
+addx1391 add 9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded
+addx1392 add 9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded
+addx1393 add 9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded
+addx1394 add 9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded
+addx1395 add 9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded
+addx1396 add 9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+precision:   15
+rounding:    half_up
+maxExponent: 384
+minexponent: -383
+
+addx1400 add  0 1.23456789012345     -> 1.23456789012345
+addx1401 add  0 1.23456789012345E-1  -> 0.123456789012345
+addx1402 add  0 1.23456789012345E-2  -> 0.0123456789012345
+addx1403 add  0 1.23456789012345E-3  -> 0.00123456789012345
+addx1404 add  0 1.23456789012345E-4  -> 0.000123456789012345
+addx1405 add  0 1.23456789012345E-5  -> 0.0000123456789012345
+addx1406 add  0 1.23456789012345E-6  -> 0.00000123456789012345
+addx1407 add  0 1.23456789012345E-7  -> 1.23456789012345E-7
+addx1408 add  0 1.23456789012345E-8  -> 1.23456789012345E-8
+addx1409 add  0 1.23456789012345E-9  -> 1.23456789012345E-9
+addx1410 add  0 1.23456789012345E-10 -> 1.23456789012345E-10
+addx1411 add  0 1.23456789012345E-11 -> 1.23456789012345E-11
+addx1412 add  0 1.23456789012345E-12 -> 1.23456789012345E-12
+addx1413 add  0 1.23456789012345E-13 -> 1.23456789012345E-13
+addx1414 add  0 1.23456789012345E-14 -> 1.23456789012345E-14
+addx1415 add  0 1.23456789012345E-15 -> 1.23456789012345E-15
+addx1416 add  0 1.23456789012345E-16 -> 1.23456789012345E-16
+addx1417 add  0 1.23456789012345E-17 -> 1.23456789012345E-17
+addx1418 add  0 1.23456789012345E-18 -> 1.23456789012345E-18
+addx1419 add  0 1.23456789012345E-19 -> 1.23456789012345E-19
+
+-- same, precision 16..
+precision:   16
+addx1420 add  0 1.123456789012345     -> 1.123456789012345
+addx1421 add  0 1.123456789012345E-1  -> 0.1123456789012345
+addx1422 add  0 1.123456789012345E-2  -> 0.01123456789012345
+addx1423 add  0 1.123456789012345E-3  -> 0.001123456789012345
+addx1424 add  0 1.123456789012345E-4  -> 0.0001123456789012345
+addx1425 add  0 1.123456789012345E-5  -> 0.00001123456789012345
+addx1426 add  0 1.123456789012345E-6  -> 0.000001123456789012345
+addx1427 add  0 1.123456789012345E-7  -> 1.123456789012345E-7
+addx1428 add  0 1.123456789012345E-8  -> 1.123456789012345E-8
+addx1429 add  0 1.123456789012345E-9  -> 1.123456789012345E-9
+addx1430 add  0 1.123456789012345E-10 -> 1.123456789012345E-10
+addx1431 add  0 1.123456789012345E-11 -> 1.123456789012345E-11
+addx1432 add  0 1.123456789012345E-12 -> 1.123456789012345E-12
+addx1433 add  0 1.123456789012345E-13 -> 1.123456789012345E-13
+addx1434 add  0 1.123456789012345E-14 -> 1.123456789012345E-14
+addx1435 add  0 1.123456789012345E-15 -> 1.123456789012345E-15
+addx1436 add  0 1.123456789012345E-16 -> 1.123456789012345E-16
+addx1437 add  0 1.123456789012345E-17 -> 1.123456789012345E-17
+addx1438 add  0 1.123456789012345E-18 -> 1.123456789012345E-18
+addx1439 add  0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+addx1440 add 1.123456789012345     0 -> 1.123456789012345
+addx1441 add 1.123456789012345E-1  0 -> 0.1123456789012345
+addx1442 add 1.123456789012345E-2  0 -> 0.01123456789012345
+addx1443 add 1.123456789012345E-3  0 -> 0.001123456789012345
+addx1444 add 1.123456789012345E-4  0 -> 0.0001123456789012345
+addx1445 add 1.123456789012345E-5  0 -> 0.00001123456789012345
+addx1446 add 1.123456789012345E-6  0 -> 0.000001123456789012345
+addx1447 add 1.123456789012345E-7  0 -> 1.123456789012345E-7
+addx1448 add 1.123456789012345E-8  0 -> 1.123456789012345E-8
+addx1449 add 1.123456789012345E-9  0 -> 1.123456789012345E-9
+addx1450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
+addx1451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
+addx1452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
+addx1453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
+addx1454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
+addx1455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
+addx1456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
+addx1457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
+addx1458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
+addx1459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+addx1460 add 1.123456789012345  0E-0   -> 1.123456789012345
+addx1461 add 1.123456789012345  0E-1   -> 1.123456789012345
+addx1462 add 1.123456789012345  0E-2   -> 1.123456789012345
+addx1463 add 1.123456789012345  0E-3   -> 1.123456789012345
+addx1464 add 1.123456789012345  0E-4   -> 1.123456789012345
+addx1465 add 1.123456789012345  0E-5   -> 1.123456789012345
+addx1466 add 1.123456789012345  0E-6   -> 1.123456789012345
+addx1467 add 1.123456789012345  0E-7   -> 1.123456789012345
+addx1468 add 1.123456789012345  0E-8   -> 1.123456789012345
+addx1469 add 1.123456789012345  0E-9   -> 1.123456789012345
+addx1470 add 1.123456789012345  0E-10  -> 1.123456789012345
+addx1471 add 1.123456789012345  0E-11  -> 1.123456789012345
+addx1472 add 1.123456789012345  0E-12  -> 1.123456789012345
+addx1473 add 1.123456789012345  0E-13  -> 1.123456789012345
+addx1474 add 1.123456789012345  0E-14  -> 1.123456789012345
+addx1475 add 1.123456789012345  0E-15  -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+addx1476 add 1.123456789012345  0E-16  -> 1.123456789012345 Rounded
+addx1477 add 1.123456789012345  0E-17  -> 1.123456789012345 Rounded
+addx1478 add 1.123456789012345  0E-18  -> 1.123456789012345 Rounded
+addx1479 add 1.123456789012345  0E-19  -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+precision:   16
+maxExponent: 384
+minexponent: -383
+
+rounding:    half_up
+-- exact zeros from zeros
+addx1500 add  0        0E-19  ->  0E-19
+addx1501 add -0        0E-19  ->  0E-19
+addx1502 add  0       -0E-19  ->  0E-19
+addx1503 add -0       -0E-19  -> -0E-19
+addx1504 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1505 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1506 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1507 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1511 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1512 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1513 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1514 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx1515 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1516 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1517 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1518 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    half_down
+-- exact zeros from zeros
+addx1520 add  0        0E-19  ->  0E-19
+addx1521 add -0        0E-19  ->  0E-19
+addx1522 add  0       -0E-19  ->  0E-19
+addx1523 add -0       -0E-19  -> -0E-19
+addx1524 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1525 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1526 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1527 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1531 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1532 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1533 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1534 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx1535 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1536 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1537 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1538 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    half_even
+-- exact zeros from zeros
+addx1540 add  0        0E-19  ->  0E-19
+addx1541 add -0        0E-19  ->  0E-19
+addx1542 add  0       -0E-19  ->  0E-19
+addx1543 add -0       -0E-19  -> -0E-19
+addx1544 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1545 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1546 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1547 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1551 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1552 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1553 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1554 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx1555 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1556 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1557 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1558 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    up
+-- exact zeros from zeros
+addx1560 add  0        0E-19  ->  0E-19
+addx1561 add -0        0E-19  ->  0E-19
+addx1562 add  0       -0E-19  ->  0E-19
+addx1563 add -0       -0E-19  -> -0E-19
+addx1564 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1565 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1566 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1567 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1571 add  1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1572 add -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1573 add  1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+addx1574 add -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+addx1575 add  1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1576 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1577 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1578 add -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding:    down
+-- exact zeros from zeros
+addx1580 add  0        0E-19  ->  0E-19
+addx1581 add -0        0E-19  ->  0E-19
+addx1582 add  0       -0E-19  ->  0E-19
+addx1583 add -0       -0E-19  -> -0E-19
+addx1584 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1585 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1586 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1587 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1591 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1592 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1593 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1594 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx1595 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1596 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1597 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1598 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    ceiling
+-- exact zeros from zeros
+addx1600 add  0        0E-19  ->  0E-19
+addx1601 add -0        0E-19  ->  0E-19
+addx1602 add  0       -0E-19  ->  0E-19
+addx1603 add -0       -0E-19  -> -0E-19
+addx1604 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1605 add -0E-400   0E-19  ->  0E-398 Clamped
+addx1606 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx1607 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1611 add  1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1612 add -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1613 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1614 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx1615 add  1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx1616 add -1E-401   1E-401 ->  0E-398 Clamped
+addx1617 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx1618 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding:    floor
+-- exact zeros from zeros
+addx1620 add  0        0E-19  ->  0E-19
+addx1621 add -0        0E-19  -> -0E-19           -- *
+addx1622 add  0       -0E-19  -> -0E-19           -- *
+addx1623 add -0       -0E-19  -> -0E-19
+addx1624 add  0E-400   0E-19  ->  0E-398 Clamped
+addx1625 add -0E-400   0E-19  -> -0E-398 Clamped  -- *
+addx1626 add  0E-400  -0E-19  -> -0E-398 Clamped  -- *
+addx1627 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx1631 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1632 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1633 add  1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+addx1634 add -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+addx1635 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx1636 add -1E-401   1E-401 -> -0E-398 Clamped  -- *
+addx1637 add  1E-401  -1E-401 -> -0E-398 Clamped  -- *
+addx1638 add -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- BigDecimal problem testcases 2006.01.23
+precision:   16
+maxExponent: 384
+minexponent: -383
+
+rounding:  down
+precision: 7
+addx1651 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 6
+addx1652 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 5
+addx1653 add  10001E+2  -2E+1 -> 1.0000E+6   Inexact Rounded
+precision: 4
+addx1654 add  10001E+2  -2E+1 -> 1.000E+6    Inexact Rounded
+precision: 3
+addx1655 add  10001E+2  -2E+1 -> 1.00E+6     Inexact Rounded
+precision: 2
+addx1656 add  10001E+2  -2E+1 -> 1.0E+6      Inexact Rounded
+precision: 1
+addx1657 add  10001E+2  -2E+1 -> 1E+6        Inexact Rounded
+
+rounding:  half_even
+precision: 7
+addx1661 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 6
+addx1662 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 5
+addx1663 add  10001E+2  -2E+1 -> 1.0001E+6   Inexact Rounded
+precision: 4
+addx1664 add  10001E+2  -2E+1 -> 1.000E+6    Inexact Rounded
+precision: 3
+addx1665 add  10001E+2  -2E+1 -> 1.00E+6     Inexact Rounded
+precision: 2
+addx1666 add  10001E+2  -2E+1 -> 1.0E+6      Inexact Rounded
+precision: 1
+addx1667 add  10001E+2  -2E+1 -> 1E+6        Inexact Rounded
+
+rounding:  up
+precision: 7
+addx1671 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 6
+addx1672 add  10001E+2  -2E+1 -> 1.00008E+6
+precision: 5
+addx1673 add  10001E+2  -2E+1 -> 1.0001E+6   Inexact Rounded
+precision: 4
+addx1674 add  10001E+2  -2E+1 -> 1.001E+6    Inexact Rounded
+precision: 3
+addx1675 add  10001E+2  -2E+1 -> 1.01E+6     Inexact Rounded
+precision: 2
+addx1676 add  10001E+2  -2E+1 -> 1.1E+6      Inexact Rounded
+precision: 1
+addx1677 add  10001E+2  -2E+1 -> 2E+6        Inexact Rounded
+
+precision:   34
+rounding:    half_up
+maxExponent: 6144
+minExponent: -6143
+-- Examples from SQL proposal (Krishna Kulkarni)
+addx1701  add 130E-2    120E-2    -> 2.50
+addx1702  add 130E-2    12E-1     -> 2.50
+addx1703  add 130E-2    1E0       -> 2.30
+addx1704  add 1E2       1E4       -> 1.01E+4
+addx1705  subtract 130E-2  120E-2 -> 0.10
+addx1706  subtract 130E-2  12E-1  -> 0.10
+addx1707  subtract 130E-2  1E0    -> 0.30
+addx1708  subtract 1E2     1E4    -> -9.9E+3
+
+------------------------------------------------------------------------
+-- Same as above, using decimal64 default parameters                  --
+------------------------------------------------------------------------
+precision:   16
+rounding:    half_even
+maxExponent: 384
+minexponent: -383
+
+-- [first group are 'quick confidence check']
+addx6001 add 1       1       ->  2
+addx6002 add 2       3       ->  5
+addx6003 add '5.75'  '3.3'   ->  9.05
+addx6004 add '5'     '-3'    ->  2
+addx6005 add '-5'    '-3'    ->  -8
+addx6006 add '-7'    '2.5'   ->  -4.5
+addx6007 add '0.7'   '0.3'   ->  1.0
+addx6008 add '1.25'  '1.25'  ->  2.50
+addx6009 add '1.23456789'  '1.00000000' -> '2.23456789'
+addx6010 add '1.23456789'  '1.00000011' -> '2.23456800'
+
+addx6011 add '0.44444444444444444'  '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+addx6012 add '0.44444444444444440'  '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+addx6013 add '0.44444444444444444'  '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded
+addx6014 add '0.444444444444444449'    '0' -> '0.4444444444444444' Inexact Rounded
+addx6015 add '0.4444444444444444499'   '0' -> '0.4444444444444444' Inexact Rounded
+addx6016 add '0.44444444444444444999'  '0' -> '0.4444444444444444' Inexact Rounded
+addx6017 add '0.44444444444444445000'  '0' -> '0.4444444444444444' Inexact Rounded
+addx6018 add '0.44444444444444445001'  '0' -> '0.4444444444444445' Inexact Rounded
+addx6019 add '0.4444444444444444501'   '0' -> '0.4444444444444445' Inexact Rounded
+addx6020 add '0.444444444444444451'    '0' -> '0.4444444444444445' Inexact Rounded
+
+addx6021 add 0 1 -> 1
+addx6022 add 1 1 -> 2
+addx6023 add 2 1 -> 3
+addx6024 add 3 1 -> 4
+addx6025 add 4 1 -> 5
+addx6026 add 5 1 -> 6
+addx6027 add 6 1 -> 7
+addx6028 add 7 1 -> 8
+addx6029 add 8 1 -> 9
+addx6030 add 9 1 -> 10
+
+-- some carrying effects
+addx6031 add '0.9998'  '0.0000' -> '0.9998'
+addx6032 add '0.9998'  '0.0001' -> '0.9999'
+addx6033 add '0.9998'  '0.0002' -> '1.0000'
+addx6034 add '0.9998'  '0.0003' -> '1.0001'
+
+addx6035 add '70'      '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+addx6036 add '700'     '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+addx6037 add '7000'    '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+addx6038 add '70000'   '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+addx6039 add '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+addx6040 add '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded
+addx6041 add '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded
+addx6042 add '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded
+addx6044 add '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded
+addx6045 add '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded
+
+addx6046 add '10000e+9'  '7' -> '10000000000007'
+addx6047 add '10000e+9'  '70' -> '10000000000070'
+addx6048 add '10000e+9'  '700' -> '10000000000700'
+addx6049 add '10000e+9'  '7000' -> '10000000007000'
+addx6050 add '10000e+9'  '70000' -> '10000000070000'
+addx6051 add '10000e+9'  '700000' -> '10000000700000'
+
+-- examples from decarith
+addx6053 add '12' '7.00' -> '19.00'
+addx6054 add '1.3' '-1.07' -> '0.23'
+addx6055 add '1.3' '-1.30' -> '0.00'
+addx6056 add '1.3' '-2.07' -> '-0.77'
+addx6057 add '1E+2' '1E+4' -> '1.01E+4'
+
+-- from above
+addx6061 add 1 '0.1' -> '1.1'
+addx6062 add 1 '0.01' -> '1.01'
+addx6063 add 1 '0.001' -> '1.001'
+addx6064 add 1 '0.0001' -> '1.0001'
+addx6065 add 1 '0.00001' -> '1.00001'
+addx6066 add 1 '0.000001' -> '1.000001'
+addx6067 add 1 '0.0000001' -> '1.0000001'
+addx6068 add 1 '0.00000001' -> '1.00000001'
+
+-- cancellation to integer
+addx6069 add 99999999999999123456789 -99999999999999E+9 -> 123456789
+
+-- some funny zeros [in case of bad signum]
+addx6070 add 1  0    -> 1
+addx6071 add 1 0.    -> 1
+addx6072 add 1  .0   -> 1.0
+addx6073 add 1 0.0   -> 1.0
+addx6074 add 1 0.00  -> 1.00
+addx6075 add  0  1   -> 1
+addx6076 add 0.  1   -> 1
+addx6077 add  .0 1   -> 1.0
+addx6078 add 0.0 1   -> 1.0
+addx6079 add 0.00 1  -> 1.00
+
+-- some carries
+addx6080 add 9999999999999998 1  -> 9999999999999999
+addx6081 add 9999999999999999 1  -> 1.000000000000000E+16 Rounded
+addx6082 add  999999999999999 1  -> 1000000000000000
+addx6083 add    9999999999999 1  -> 10000000000000
+addx6084 add      99999999999 1  -> 100000000000
+addx6085 add        999999999 1  -> 1000000000
+addx6086 add          9999999 1  -> 10000000
+addx6087 add            99999 1  -> 100000
+addx6088 add              999 1  -> 1000
+addx6089 add                9 1  -> 10
+
 
-addx1160 add        100E-105 -1e-101  -> -0E-101 Subnormal Inexact Rounded Underflow
-addx1161 add        100E-105 -1e-201  ->  0E-101 Subnormal Inexact Rounded Underflow
+-- more LHS swaps
+addx6090 add '-56267E-10'   0 ->  '-0.0000056267'
+addx6091 add '-56267E-6'    0 ->  '-0.056267'
+addx6092 add '-56267E-5'    0 ->  '-0.56267'
+addx6093 add '-56267E-4'    0 ->  '-5.6267'
+addx6094 add '-56267E-3'    0 ->  '-56.267'
+addx6095 add '-56267E-2'    0 ->  '-562.67'
+addx6096 add '-56267E-1'    0 ->  '-5626.7'
+addx6097 add '-56267E-0'    0 ->  '-56267'
+addx6098 add '-5E-10'       0 ->  '-5E-10'
+addx6099 add '-5E-7'        0 ->  '-5E-7'
+addx6100 add '-5E-6'        0 ->  '-0.000005'
+addx6101 add '-5E-5'        0 ->  '-0.00005'
+addx6102 add '-5E-4'        0 ->  '-0.0005'
+addx6103 add '-5E-1'        0 ->  '-0.5'
+addx6104 add '-5E0'         0 ->  '-5'
+addx6105 add '-5E1'         0 ->  '-50'
+addx6106 add '-5E5'         0 ->  '-500000'
+addx6107 add '-5E15'        0 ->  '-5000000000000000'
+addx6108 add '-5E16'        0 ->  '-5.000000000000000E+16'   Rounded
+addx6109 add '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded
+addx6110 add '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded
+addx6111 add '-5E100'       0 ->  '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+addx6113 add 0  '-56267E-10' ->  '-0.0000056267'
+addx6114 add 0  '-56267E-6'  ->  '-0.056267'
+addx6116 add 0  '-56267E-5'  ->  '-0.56267'
+addx6117 add 0  '-56267E-4'  ->  '-5.6267'
+addx6119 add 0  '-56267E-3'  ->  '-56.267'
+addx6120 add 0  '-56267E-2'  ->  '-562.67'
+addx6121 add 0  '-56267E-1'  ->  '-5626.7'
+addx6122 add 0  '-56267E-0'  ->  '-56267'
+addx6123 add 0  '-5E-10'     ->  '-5E-10'
+addx6124 add 0  '-5E-7'      ->  '-5E-7'
+addx6125 add 0  '-5E-6'      ->  '-0.000005'
+addx6126 add 0  '-5E-5'      ->  '-0.00005'
+addx6127 add 0  '-5E-4'      ->  '-0.0005'
+addx6128 add 0  '-5E-1'      ->  '-0.5'
+addx6129 add 0  '-5E0'       ->  '-5'
+addx6130 add 0  '-5E1'       ->  '-50'
+addx6131 add 0  '-5E5'       ->  '-500000'
+addx6132 add 0  '-5E15'      ->  '-5000000000000000'
+addx6133 add 0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded
+addx6134 add 0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded
+addx6135 add 0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded
+addx6136 add 0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded
+
+-- related
+addx6137 add  1  '0E-19'      ->  '1.000000000000000'  Rounded
+addx6138 add -1  '0E-19'      ->  '-1.000000000000000' Rounded
+addx6139 add '0E-19' 1        ->  '1.000000000000000'  Rounded
+addx6140 add '0E-19' -1       ->  '-1.000000000000000' Rounded
+addx6141 add 1E+11   0.0000   ->  '100000000000.0000'
+addx6142 add 1E+11   0.00000  ->  '100000000000.0000'  Rounded
+addx6143 add 0.000   1E+12    ->  '1000000000000.000'
+addx6144 add 0.0000  1E+12    ->  '1000000000000.000'  Rounded
+
+-- [some of the next group are really constructor tests]
+addx6146 add '00.0'  0       ->  '0.0'
+addx6147 add '0.00'  0       ->  '0.00'
+addx6148 add  0      '0.00'  ->  '0.00'
+addx6149 add  0      '00.0'  ->  '0.0'
+addx6150 add '00.0'  '0.00'  ->  '0.00'
+addx6151 add '0.00'  '00.0'  ->  '0.00'
+addx6152 add '3'     '.3'    ->  '3.3'
+addx6153 add '3.'    '.3'    ->  '3.3'
+addx6154 add '3.0'   '.3'    ->  '3.3'
+addx6155 add '3.00'  '.3'    ->  '3.30'
+addx6156 add '3'     '3'     ->  '6'
+addx6157 add '3'     '+3'    ->  '6'
+addx6158 add '3'     '-3'    ->  '0'
+addx6159 add '0.3'   '-0.3'  ->  '0.0'
+addx6160 add '0.03'  '-0.03' ->  '0.00'
+
+-- try borderline precision, with carries, etc.
+addx6161 add '1E+13' '-1'    -> '9999999999999'
+addx6162 add '1E+13'  '1.11' -> '10000000000001.11'
+addx6163 add '1.11'  '1E+13' -> '10000000000001.11'
+addx6164 add '-1'    '1E+13' -> '9999999999999'
+addx6165 add '7E+13' '-1'    -> '69999999999999'
+addx6166 add '7E+13'  '1.11' -> '70000000000001.11'
+addx6167 add '1.11'  '7E+13' -> '70000000000001.11'
+addx6168 add '-1'    '7E+13' -> '69999999999999'
+
+--             1234567890123456      1234567890123456      1 234567890123456
+addx6170 add '0.4444444444444444'  '0.5555555555555563' -> '1.000000000000001' Inexact Rounded
+addx6171 add '0.4444444444444444'  '0.5555555555555562' -> '1.000000000000001' Inexact Rounded
+addx6172 add '0.4444444444444444'  '0.5555555555555561' -> '1.000000000000000' Inexact Rounded
+addx6173 add '0.4444444444444444'  '0.5555555555555560' -> '1.000000000000000' Inexact Rounded
+addx6174 add '0.4444444444444444'  '0.5555555555555559' -> '1.000000000000000' Inexact Rounded
+addx6175 add '0.4444444444444444'  '0.5555555555555558' -> '1.000000000000000' Inexact Rounded
+addx6176 add '0.4444444444444444'  '0.5555555555555557' -> '1.000000000000000' Inexact Rounded
+addx6177 add '0.4444444444444444'  '0.5555555555555556' -> '1.000000000000000' Rounded
+addx6178 add '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'
+addx6179 add '0.4444444444444444'  '0.5555555555555554' -> '0.9999999999999998'
+addx6180 add '0.4444444444444444'  '0.5555555555555553' -> '0.9999999999999997'
+addx6181 add '0.4444444444444444'  '0.5555555555555552' -> '0.9999999999999996'
+addx6182 add '0.4444444444444444'  '0.5555555555555551' -> '0.9999999999999995'
+addx6183 add '0.4444444444444444'  '0.5555555555555550' -> '0.9999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+addx6200 add '6543210123456789' 0             -> '6543210123456789'
+addx6201 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
+addx6202 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
+addx6203 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
+addx6204 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
+addx6205 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
+addx6206 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
+addx6207 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
+addx6208 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded
+addx6209 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded
+addx6210 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded
+addx6211 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded
+addx6212 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded
+addx6213 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded
+addx6214 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded
+addx6215 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded
+addx6216 add '6543210123456789' 1             -> '6543210123456790'
+addx6217 add '6543210123456789' 1.000000001   -> '6543210123456790' Inexact Rounded
+addx6218 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
+addx6219 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+addx6220 add '6543210123456789' 0             -> '6543210123456789'
+addx6221 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
+addx6222 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
+addx6223 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
+addx6224 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
+addx6225 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
+addx6226 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
+addx6227 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
+addx6228 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded
+addx6229 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded
+addx6230 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded
+addx6231 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded
+addx6232 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded
+addx6233 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded
+addx6234 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded
+addx6235 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded
+addx6236 add '6543210123456789' 1             -> '6543210123456790'
+addx6237 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded
+addx6238 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
+addx6239 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
+-- critical few with even bottom digit...
+addx6240 add '6543210123456788' 0.499999999   -> '6543210123456788' Inexact Rounded
+addx6241 add '6543210123456788' 0.5           -> '6543210123456788' Inexact Rounded
+addx6242 add '6543210123456788' 0.500000001   -> '6543210123456789' Inexact Rounded
+
+rounding: down
+addx6250 add '6543210123456789' 0             -> '6543210123456789'
+addx6251 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded
+addx6252 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded
+addx6253 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded
+addx6254 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded
+addx6255 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded
+addx6256 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded
+addx6257 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded
+addx6258 add '6543210123456789' 0.5           -> '6543210123456789' Inexact Rounded
+addx6259 add '6543210123456789' 0.500000001   -> '6543210123456789' Inexact Rounded
+addx6260 add '6543210123456789' 0.500001      -> '6543210123456789' Inexact Rounded
+addx6261 add '6543210123456789' 0.51          -> '6543210123456789' Inexact Rounded
+addx6262 add '6543210123456789' 0.6           -> '6543210123456789' Inexact Rounded
+addx6263 add '6543210123456789' 0.9           -> '6543210123456789' Inexact Rounded
+addx6264 add '6543210123456789' 0.99999       -> '6543210123456789' Inexact Rounded
+addx6265 add '6543210123456789' 0.999999999   -> '6543210123456789' Inexact Rounded
+addx6266 add '6543210123456789' 1             -> '6543210123456790'
+addx6267 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded
+addx6268 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded
+addx6269 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_even
+addx6301 add  -1   1      ->   0
+addx6302 add   0   1      ->   1
+addx6303 add   1   1      ->   2
+addx6304 add  12   1      ->  13
+addx6305 add  98   1      ->  99
+addx6306 add  99   1      -> 100
+addx6307 add 100   1      -> 101
+addx6308 add 101   1      -> 102
+addx6309 add  -1  -1      ->  -2
+addx6310 add   0  -1      ->  -1
+addx6311 add   1  -1      ->   0
+addx6312 add  12  -1      ->  11
+addx6313 add  98  -1      ->  97
+addx6314 add  99  -1      ->  98
+addx6315 add 100  -1      ->  99
+addx6316 add 101  -1      -> 100
+
+addx6321 add -0.01  0.01    ->  0.00
+addx6322 add  0.00  0.01    ->  0.01
+addx6323 add  0.01  0.01    ->  0.02
+addx6324 add  0.12  0.01    ->  0.13
+addx6325 add  0.98  0.01    ->  0.99
+addx6326 add  0.99  0.01    ->  1.00
+addx6327 add  1.00  0.01    ->  1.01
+addx6328 add  1.01  0.01    ->  1.02
+addx6329 add -0.01 -0.01    -> -0.02
+addx6330 add  0.00 -0.01    -> -0.01
+addx6331 add  0.01 -0.01    ->  0.00
+addx6332 add  0.12 -0.01    ->  0.11
+addx6333 add  0.98 -0.01    ->  0.97
+addx6334 add  0.99 -0.01    ->  0.98
+addx6335 add  1.00 -0.01    ->  0.99
+addx6336 add  1.01 -0.01    ->  1.00
+
+-- some more cases where adding 0 affects the coefficient
+addx6340 add 1E+3    0    ->         1000
+addx6341 add 1E+15   0    ->    1000000000000000
+addx6342 add 1E+16   0    ->   1.000000000000000E+16  Rounded
+addx6343 add 1E+17   0    ->   1.000000000000000E+17  Rounded
+-- which simply follow from these cases ...
+addx6344 add 1E+3    1    ->         1001
+addx6345 add 1E+15   1    ->    1000000000000001
+addx6346 add 1E+16   1    ->   1.000000000000000E+16  Inexact Rounded
+addx6347 add 1E+17   1    ->   1.000000000000000E+17  Inexact Rounded
+addx6348 add 1E+3    7    ->         1007
+addx6349 add 1E+15   7    ->    1000000000000007
+addx6350 add 1E+16   7    ->   1.000000000000001E+16  Inexact Rounded
+addx6351 add 1E+17   7    ->   1.000000000000000E+17  Inexact Rounded
+
+-- tryzeros cases
+addx6361  add 0E+50 10000E+1  -> 1.0000E+5
+addx6362  add 10000E+1 0E-50  -> 100000.0000000000  Rounded
+addx6363  add 10000E+1 10000E-50  -> 100000.0000000000  Rounded Inexact
+addx6364  add 12.34    0e-398  -> 12.34000000000000  Rounded
+
+-- ulp replacement tests
+addx6400 add   1   77e-14      ->  1.00000000000077
+addx6401 add   1   77e-15      ->  1.000000000000077
+addx6402 add   1   77e-16      ->  1.000000000000008 Inexact Rounded
+addx6403 add   1   77e-17      ->  1.000000000000001 Inexact Rounded
+addx6404 add   1   77e-18      ->  1.000000000000000 Inexact Rounded
+addx6405 add   1   77e-19      ->  1.000000000000000 Inexact Rounded
+addx6406 add   1   77e-99      ->  1.000000000000000 Inexact Rounded
+
+addx6410 add  10   77e-14      ->  10.00000000000077
+addx6411 add  10   77e-15      ->  10.00000000000008 Inexact Rounded
+addx6412 add  10   77e-16      ->  10.00000000000001 Inexact Rounded
+addx6413 add  10   77e-17      ->  10.00000000000000 Inexact Rounded
+addx6414 add  10   77e-18      ->  10.00000000000000 Inexact Rounded
+addx6415 add  10   77e-19      ->  10.00000000000000 Inexact Rounded
+addx6416 add  10   77e-99      ->  10.00000000000000 Inexact Rounded
+
+addx6420 add  77e-14       1   ->  1.00000000000077
+addx6421 add  77e-15       1   ->  1.000000000000077
+addx6422 add  77e-16       1   ->  1.000000000000008 Inexact Rounded
+addx6423 add  77e-17       1   ->  1.000000000000001 Inexact Rounded
+addx6424 add  77e-18       1   ->  1.000000000000000 Inexact Rounded
+addx6425 add  77e-19       1   ->  1.000000000000000 Inexact Rounded
+addx6426 add  77e-99       1   ->  1.000000000000000 Inexact Rounded
+
+addx6430 add  77e-14      10   ->  10.00000000000077
+addx6431 add  77e-15      10   ->  10.00000000000008 Inexact Rounded
+addx6432 add  77e-16      10   ->  10.00000000000001 Inexact Rounded
+addx6433 add  77e-17      10   ->  10.00000000000000 Inexact Rounded
+addx6434 add  77e-18      10   ->  10.00000000000000 Inexact Rounded
+addx6435 add  77e-19      10   ->  10.00000000000000 Inexact Rounded
+addx6436 add  77e-99      10   ->  10.00000000000000 Inexact Rounded
+
+-- negative ulps
+addx6440 add   1   -77e-14      ->  0.99999999999923
+addx6441 add   1   -77e-15      ->  0.999999999999923
+addx6442 add   1   -77e-16      ->  0.9999999999999923
+addx6443 add   1   -77e-17      ->  0.9999999999999992 Inexact Rounded
+addx6444 add   1   -77e-18      ->  0.9999999999999999 Inexact Rounded
+addx6445 add   1   -77e-19      ->  1.000000000000000 Inexact Rounded
+addx6446 add   1   -77e-99      ->  1.000000000000000 Inexact Rounded
+
+addx6450 add  10   -77e-14      ->   9.99999999999923
+addx6451 add  10   -77e-15      ->   9.999999999999923
+addx6452 add  10   -77e-16      ->   9.999999999999992 Inexact Rounded
+addx6453 add  10   -77e-17      ->   9.999999999999999 Inexact Rounded
+addx6454 add  10   -77e-18      ->  10.00000000000000 Inexact Rounded
+addx6455 add  10   -77e-19      ->  10.00000000000000 Inexact Rounded
+addx6456 add  10   -77e-99      ->  10.00000000000000 Inexact Rounded
+
+addx6460 add  -77e-14       1   ->  0.99999999999923
+addx6461 add  -77e-15       1   ->  0.999999999999923
+addx6462 add  -77e-16       1   ->  0.9999999999999923
+addx6463 add  -77e-17       1   ->  0.9999999999999992 Inexact Rounded
+addx6464 add  -77e-18       1   ->  0.9999999999999999 Inexact Rounded
+addx6465 add  -77e-19       1   ->  1.000000000000000 Inexact Rounded
+addx6466 add  -77e-99       1   ->  1.000000000000000 Inexact Rounded
+
+addx6470 add  -77e-14      10   ->   9.99999999999923
+addx6471 add  -77e-15      10   ->   9.999999999999923
+addx6472 add  -77e-16      10   ->   9.999999999999992 Inexact Rounded
+addx6473 add  -77e-17      10   ->   9.999999999999999 Inexact Rounded
+addx6474 add  -77e-18      10   ->  10.00000000000000 Inexact Rounded
+addx6475 add  -77e-19      10   ->  10.00000000000000 Inexact Rounded
+addx6476 add  -77e-99      10   ->  10.00000000000000 Inexact Rounded
+
+-- negative ulps
+addx6480 add  -1    77e-14      ->  -0.99999999999923
+addx6481 add  -1    77e-15      ->  -0.999999999999923
+addx6482 add  -1    77e-16      ->  -0.9999999999999923
+addx6483 add  -1    77e-17      ->  -0.9999999999999992 Inexact Rounded
+addx6484 add  -1    77e-18      ->  -0.9999999999999999 Inexact Rounded
+addx6485 add  -1    77e-19      ->  -1.000000000000000 Inexact Rounded
+addx6486 add  -1    77e-99      ->  -1.000000000000000 Inexact Rounded
+
+addx6490 add -10    77e-14      ->   -9.99999999999923
+addx6491 add -10    77e-15      ->   -9.999999999999923
+addx6492 add -10    77e-16      ->   -9.999999999999992 Inexact Rounded
+addx6493 add -10    77e-17      ->   -9.999999999999999 Inexact Rounded
+addx6494 add -10    77e-18      ->  -10.00000000000000 Inexact Rounded
+addx6495 add -10    77e-19      ->  -10.00000000000000 Inexact Rounded
+addx6496 add -10    77e-99      ->  -10.00000000000000 Inexact Rounded
+
+addx6500 add   77e-14      -1   ->  -0.99999999999923
+addx6501 add   77e-15      -1   ->  -0.999999999999923
+addx6502 add   77e-16      -1   ->  -0.9999999999999923
+addx6503 add   77e-17      -1   ->  -0.9999999999999992 Inexact Rounded
+addx6504 add   77e-18      -1   ->  -0.9999999999999999 Inexact Rounded
+addx6505 add   77e-19      -1   ->  -1.000000000000000 Inexact Rounded
+addx6506 add   77e-99      -1   ->  -1.000000000000000 Inexact Rounded
+
+addx6510 add   77e-14      -10  ->   -9.99999999999923
+addx6511 add   77e-15      -10  ->   -9.999999999999923
+addx6512 add   77e-16      -10  ->   -9.999999999999992 Inexact Rounded
+addx6513 add   77e-17      -10  ->   -9.999999999999999 Inexact Rounded
+addx6514 add   77e-18      -10  ->  -10.00000000000000 Inexact Rounded
+addx6515 add   77e-19      -10  ->  -10.00000000000000 Inexact Rounded
+addx6516 add   77e-99      -10  ->  -10.00000000000000 Inexact Rounded
 
 
+-- long operands
+addx6521 add 101234562345678000 0 -> 1.012345623456780E+17 Rounded
+addx6522 add 0 101234562345678000 -> 1.012345623456780E+17 Rounded
+addx6523 add 10123456234567800  0 -> 1.012345623456780E+16 Rounded
+addx6524 add 0 10123456234567800  -> 1.012345623456780E+16 Rounded
+addx6525 add 10123456234567890  0 -> 1.012345623456789E+16 Rounded
+addx6526 add 0 10123456234567890  -> 1.012345623456789E+16 Rounded
+addx6527 add 10123456234567891  0 -> 1.012345623456789E+16 Inexact Rounded
+addx6528 add 0 10123456234567891  -> 1.012345623456789E+16 Inexact Rounded
+addx6529 add 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded
+addx6530 add 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded
+addx6531 add 10123456234567896  0 -> 1.012345623456790E+16 Inexact Rounded
+addx6532 add 0 10123456234567896  -> 1.012345623456790E+16 Inexact Rounded
+
+-- verify a query
+rounding:     down
+addx6561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+addx6562 add      0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+-- and using decimal64 bounds...
+rounding:     down
+addx6563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+addx6564 add      0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+addx6701 add 5.00 1.00E-3 -> 5.00100
+addx6702 add 00.00 0.000  -> 0.000
+addx6703 add 00.00 0E-3   -> 0.000
+addx6704 add 0E-3  00.00  -> 0.000
+
+addx6710 add 0E+3  00.00  -> 0.00
+addx6711 add 0E+3  00.0   -> 0.0
+addx6712 add 0E+3  00.    -> 0
+addx6713 add 0E+3  00.E+1 -> 0E+1
+addx6714 add 0E+3  00.E+2 -> 0E+2
+addx6715 add 0E+3  00.E+3 -> 0E+3
+addx6716 add 0E+3  00.E+4 -> 0E+3
+addx6717 add 0E+3  00.E+5 -> 0E+3
+addx6718 add 0E+3  -00.0   -> 0.0
+addx6719 add 0E+3  -00.    -> 0
+addx6731 add 0E+3  -00.E+1 -> 0E+1
+
+addx6720 add 00.00  0E+3  -> 0.00
+addx6721 add 00.0   0E+3  -> 0.0
+addx6722 add 00.    0E+3  -> 0
+addx6723 add 00.E+1 0E+3  -> 0E+1
+addx6724 add 00.E+2 0E+3  -> 0E+2
+addx6725 add 00.E+3 0E+3  -> 0E+3
+addx6726 add 00.E+4 0E+3  -> 0E+3
+addx6727 add 00.E+5 0E+3  -> 0E+3
+addx6728 add -00.00 0E+3  -> 0.00
+addx6729 add -00.0  0E+3  -> 0.0
+addx6730 add -00.   0E+3  -> 0
+
+addx6732 add  0     0     ->  0
+addx6733 add  0    -0     ->  0
+addx6734 add -0     0     ->  0
+addx6735 add -0    -0     -> -0     -- IEEE 854 special case
+
+addx6736 add  1    -1     ->  0
+addx6737 add -1    -1     -> -2
+addx6738 add  1     1     ->  2
+addx6739 add -1     1     ->  0
+
+addx6741 add  0    -1     -> -1
+addx6742 add -0    -1     -> -1
+addx6743 add  0     1     ->  1
+addx6744 add -0     1     ->  1
+addx6745 add -1     0     -> -1
+addx6746 add -1    -0     -> -1
+addx6747 add  1     0     ->  1
+addx6748 add  1    -0     ->  1
+
+addx6751 add  0.0  -1     -> -1.0
+addx6752 add -0.0  -1     -> -1.0
+addx6753 add  0.0   1     ->  1.0
+addx6754 add -0.0   1     ->  1.0
+addx6755 add -1.0   0     -> -1.0
+addx6756 add -1.0  -0     -> -1.0
+addx6757 add  1.0   0     ->  1.0
+addx6758 add  1.0  -0     ->  1.0
+
+addx6761 add  0    -1.0   -> -1.0
+addx6762 add -0    -1.0   -> -1.0
+addx6763 add  0     1.0   ->  1.0
+addx6764 add -0     1.0   ->  1.0
+addx6765 add -1     0.0   -> -1.0
+addx6766 add -1    -0.0   -> -1.0
+addx6767 add  1     0.0   ->  1.0
+addx6768 add  1    -0.0   ->  1.0
+
+addx6771 add  0.0  -1.0   -> -1.0
+addx6772 add -0.0  -1.0   -> -1.0
+addx6773 add  0.0   1.0   ->  1.0
+addx6774 add -0.0   1.0   ->  1.0
+addx6775 add -1.0   0.0   -> -1.0
+addx6776 add -1.0  -0.0   -> -1.0
+addx6777 add  1.0   0.0   ->  1.0
+addx6778 add  1.0  -0.0   ->  1.0
+
+-- Specials
+addx6780 add -Inf  -Inf   -> -Infinity
+addx6781 add -Inf  -1000  -> -Infinity
+addx6782 add -Inf  -1     -> -Infinity
+addx6783 add -Inf  -0     -> -Infinity
+addx6784 add -Inf   0     -> -Infinity
+addx6785 add -Inf   1     -> -Infinity
+addx6786 add -Inf   1000  -> -Infinity
+addx6787 add -1000 -Inf   -> -Infinity
+addx6788 add -Inf  -Inf   -> -Infinity
+addx6789 add -1    -Inf   -> -Infinity
+addx6790 add -0    -Inf   -> -Infinity
+addx6791 add  0    -Inf   -> -Infinity
+addx6792 add  1    -Inf   -> -Infinity
+addx6793 add  1000 -Inf   -> -Infinity
+addx6794 add  Inf  -Inf   ->  NaN  Invalid_operation
+
+addx6800 add  Inf  -Inf   ->  NaN  Invalid_operation
+addx6801 add  Inf  -1000  ->  Infinity
+addx6802 add  Inf  -1     ->  Infinity
+addx6803 add  Inf  -0     ->  Infinity
+addx6804 add  Inf   0     ->  Infinity
+addx6805 add  Inf   1     ->  Infinity
+addx6806 add  Inf   1000  ->  Infinity
+addx6807 add  Inf   Inf   ->  Infinity
+addx6808 add -1000  Inf   ->  Infinity
+addx6809 add -Inf   Inf   ->  NaN  Invalid_operation
+addx6810 add -1     Inf   ->  Infinity
+addx6811 add -0     Inf   ->  Infinity
+addx6812 add  0     Inf   ->  Infinity
+addx6813 add  1     Inf   ->  Infinity
+addx6814 add  1000  Inf   ->  Infinity
+addx6815 add  Inf   Inf   ->  Infinity
+
+addx6821 add  NaN -Inf    ->  NaN
+addx6822 add  NaN -1000   ->  NaN
+addx6823 add  NaN -1      ->  NaN
+addx6824 add  NaN -0      ->  NaN
+addx6825 add  NaN  0      ->  NaN
+addx6826 add  NaN  1      ->  NaN
+addx6827 add  NaN  1000   ->  NaN
+addx6828 add  NaN  Inf    ->  NaN
+addx6829 add  NaN  NaN    ->  NaN
+addx6830 add -Inf  NaN    ->  NaN
+addx6831 add -1000 NaN    ->  NaN
+addx6832 add -1    NaN    ->  NaN
+addx6833 add -0    NaN    ->  NaN
+addx6834 add  0    NaN    ->  NaN
+addx6835 add  1    NaN    ->  NaN
+addx6836 add  1000 NaN    ->  NaN
+addx6837 add  Inf  NaN    ->  NaN
+
+addx6841 add  sNaN -Inf   ->  NaN  Invalid_operation
+addx6842 add  sNaN -1000  ->  NaN  Invalid_operation
+addx6843 add  sNaN -1     ->  NaN  Invalid_operation
+addx6844 add  sNaN -0     ->  NaN  Invalid_operation
+addx6845 add  sNaN  0     ->  NaN  Invalid_operation
+addx6846 add  sNaN  1     ->  NaN  Invalid_operation
+addx6847 add  sNaN  1000  ->  NaN  Invalid_operation
+addx6848 add  sNaN  NaN   ->  NaN  Invalid_operation
+addx6849 add  sNaN sNaN   ->  NaN  Invalid_operation
+addx6850 add  NaN  sNaN   ->  NaN  Invalid_operation
+addx6851 add -Inf  sNaN   ->  NaN  Invalid_operation
+addx6852 add -1000 sNaN   ->  NaN  Invalid_operation
+addx6853 add -1    sNaN   ->  NaN  Invalid_operation
+addx6854 add -0    sNaN   ->  NaN  Invalid_operation
+addx6855 add  0    sNaN   ->  NaN  Invalid_operation
+addx6856 add  1    sNaN   ->  NaN  Invalid_operation
+addx6857 add  1000 sNaN   ->  NaN  Invalid_operation
+addx6858 add  Inf  sNaN   ->  NaN  Invalid_operation
+addx6859 add  NaN  sNaN   ->  NaN  Invalid_operation
+
+-- propagating NaNs
+addx6861 add  NaN1   -Inf    ->  NaN1
+addx6862 add +NaN2   -1000   ->  NaN2
+addx6863 add  NaN3    1000   ->  NaN3
+addx6864 add  NaN4    Inf    ->  NaN4
+addx6865 add  NaN5   +NaN6   ->  NaN5
+addx6866 add -Inf     NaN7   ->  NaN7
+addx6867 add -1000    NaN8   ->  NaN8
+addx6868 add  1000    NaN9   ->  NaN9
+addx6869 add  Inf    +NaN10  ->  NaN10
+addx6871 add  sNaN11  -Inf   ->  NaN11  Invalid_operation
+addx6872 add  sNaN12  -1000  ->  NaN12  Invalid_operation
+addx6873 add  sNaN13   1000  ->  NaN13  Invalid_operation
+addx6874 add  sNaN14   NaN17 ->  NaN14  Invalid_operation
+addx6875 add  sNaN15  sNaN18 ->  NaN15  Invalid_operation
+addx6876 add  NaN16   sNaN19 ->  NaN19  Invalid_operation
+addx6877 add -Inf    +sNaN20 ->  NaN20  Invalid_operation
+addx6878 add -1000    sNaN21 ->  NaN21  Invalid_operation
+addx6879 add  1000    sNaN22 ->  NaN22  Invalid_operation
+addx6880 add  Inf     sNaN23 ->  NaN23  Invalid_operation
+addx6881 add +NaN25  +sNaN24 ->  NaN24  Invalid_operation
+addx6882 add -NaN26    NaN28 -> -NaN26
+addx6883 add -sNaN27  sNaN29 -> -NaN27  Invalid_operation
+addx6884 add  1000    -NaN30 -> -NaN30
+addx6885 add  1000   -sNaN31 -> -NaN31  Invalid_operation
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+
+addx6571 add       1E-383       0  -> 1E-383
+addx6572 add       1E-384       0  -> 1E-384   Subnormal
+addx6573 add       1E-383  1E-384  -> 1.1E-383
+addx6574 subtract  1E-383  1E-384  ->   9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+addx6575 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
+addx6576 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal
+addx6577 subtract  1E-383  1E-399  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx6578 subtract  1E-383  1E-400  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx6579 subtract  1E-383  1E-401  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+addx6580 subtract  1E-383  1E-402  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- check overflow edge case
+--               1234567890123456
+addx6972 apply   9.999999999999999E+384         -> 9.999999999999999E+384
+addx6973 add     9.999999999999999E+384  1      -> 9.999999999999999E+384 Inexact Rounded
+addx6974 add      9999999999999999E+369  1      -> 9.999999999999999E+384 Inexact Rounded
+addx6975 add      9999999999999999E+369  1E+369  -> Infinity Overflow Inexact Rounded
+addx6976 add      9999999999999999E+369  9E+368  -> Infinity Overflow Inexact Rounded
+addx6977 add      9999999999999999E+369  8E+368  -> Infinity Overflow Inexact Rounded
+addx6978 add      9999999999999999E+369  7E+368  -> Infinity Overflow Inexact Rounded
+addx6979 add      9999999999999999E+369  6E+368  -> Infinity Overflow Inexact Rounded
+addx6980 add      9999999999999999E+369  5E+368  -> Infinity Overflow Inexact Rounded
+addx6981 add      9999999999999999E+369  4E+368  -> 9.999999999999999E+384 Inexact Rounded
+addx6982 add      9999999999999999E+369  3E+368  -> 9.999999999999999E+384 Inexact Rounded
+addx6983 add      9999999999999999E+369  2E+368  -> 9.999999999999999E+384 Inexact Rounded
+addx6984 add      9999999999999999E+369  1E+368  -> 9.999999999999999E+384 Inexact Rounded
+
+addx6985 apply  -9.999999999999999E+384         -> -9.999999999999999E+384
+addx6986 add    -9.999999999999999E+384 -1      -> -9.999999999999999E+384 Inexact Rounded
+addx6987 add     -9999999999999999E+369 -1      -> -9.999999999999999E+384 Inexact Rounded
+addx6988 add     -9999999999999999E+369 -1E+369  -> -Infinity Overflow Inexact Rounded
+addx6989 add     -9999999999999999E+369 -9E+368  -> -Infinity Overflow Inexact Rounded
+addx6990 add     -9999999999999999E+369 -8E+368  -> -Infinity Overflow Inexact Rounded
+addx6991 add     -9999999999999999E+369 -7E+368  -> -Infinity Overflow Inexact Rounded
+addx6992 add     -9999999999999999E+369 -6E+368  -> -Infinity Overflow Inexact Rounded
+addx6993 add     -9999999999999999E+369 -5E+368  -> -Infinity Overflow Inexact Rounded
+addx6994 add     -9999999999999999E+369 -4E+368  -> -9.999999999999999E+384 Inexact Rounded
+addx6995 add     -9999999999999999E+369 -3E+368  -> -9.999999999999999E+384 Inexact Rounded
+addx6996 add     -9999999999999999E+369 -2E+368  -> -9.999999999999999E+384 Inexact Rounded
+addx6997 add     -9999999999999999E+369 -1E+368  -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding:     down
+addx61100 add 1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact
+addx61101 add 1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact
+addx61103 add   +1 -1e-383    -> 0.9999999999999999  Rounded Inexact
+addx61104 add 1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact
+addx61105 add 1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact
+addx61106 add 1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact
+addx61107 add 1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact
+addx61108 add 1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact
+addx61109 add 1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact
+
+rounding:     ceiling
+addx61110 add -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact
+addx61111 add -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact
+addx61113 add    -1 +1e-383   -> -0.9999999999999999  Rounded Inexact
+addx61114 add -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact
+addx61115 add -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact
+addx61116 add -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact
+addx61117 add -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact
+addx61118 add -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact
+addx61119 add -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding:     half_even
+
+addx61300 add 1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded
+addx61310 add 1E16  -0.51                ->  9999999999999999      Inexact Rounded
+addx61311 add 1E16  -0.501               ->  9999999999999999      Inexact Rounded
+addx61312 add 1E16  -0.5001              ->  9999999999999999      Inexact Rounded
+addx61313 add 1E16  -0.50001             ->  9999999999999999      Inexact Rounded
+addx61314 add 1E16  -0.500001            ->  9999999999999999      Inexact Rounded
+addx61315 add 1E16  -0.5000001           ->  9999999999999999      Inexact Rounded
+addx61316 add 1E16  -0.50000001          ->  9999999999999999      Inexact Rounded
+addx61317 add 1E16  -0.500000001         ->  9999999999999999      Inexact Rounded
+addx61318 add 1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded
+addx61319 add 1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded
+addx61320 add 1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded
+addx61321 add 1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded
+addx61322 add 1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded
+addx61323 add 1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded
+addx61324 add 1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded
+addx61325 add 1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
+addx61326 add 1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
+addx61327 add 1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
+addx61328 add 1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
+addx61329 add 1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
+addx61330 add 1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
+addx61331 add 1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
+addx61332 add 1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded
+addx61333 add 1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded
+addx61334 add 1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded
+addx61335 add 1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded
+addx61336 add 1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded
+addx61337 add 1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded
+addx61338 add 1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded
+addx61339 add 1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded
+
+addx61340 add 1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded
+addx61341 add 1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded
+
+addx61349 add 9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded
+addx61350 add 9999999999999999 0.49                ->  9999999999999999      Inexact Rounded
+addx61351 add 9999999999999999 0.499               ->  9999999999999999      Inexact Rounded
+addx61352 add 9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded
+addx61353 add 9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded
+addx61354 add 9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded
+addx61355 add 9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded
+addx61356 add 9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded
+addx61357 add 9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded
+addx61358 add 9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded
+addx61359 add 9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded
+addx61360 add 9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded
+addx61361 add 9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded
+addx61362 add 9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded
+addx61363 add 9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded
+addx61364 add 9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded
+addx61365 add 9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded
+addx61367 add 9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded
+addx61368 add 9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded
+addx61369 add 9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded
+addx61370 add 9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded
+addx61371 add 9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded
+addx61372 add 9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded
+addx61373 add 9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded
+addx61374 add 9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded
+addx61375 add 9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded
+addx61376 add 9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded
+addx61377 add 9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded
+addx61378 add 9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded
+addx61379 add 9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded
+addx61380 add 9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded
+addx61381 add 9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded
+addx61382 add 9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded
+addx61383 add 9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded
+addx61384 add 9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded
+addx61385 add 9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded
+addx61386 add 9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded
+addx61387 add 9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded
+addx61388 add 9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded
+addx61389 add 9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded
+addx61390 add 9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded
+addx61391 add 9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded
+addx61392 add 9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded
+addx61393 add 9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded
+addx61394 add 9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded
+addx61395 add 9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded
+addx61396 add 9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+addx61420 add  0 1.123456789012345     -> 1.123456789012345
+addx61421 add  0 1.123456789012345E-1  -> 0.1123456789012345
+addx61422 add  0 1.123456789012345E-2  -> 0.01123456789012345
+addx61423 add  0 1.123456789012345E-3  -> 0.001123456789012345
+addx61424 add  0 1.123456789012345E-4  -> 0.0001123456789012345
+addx61425 add  0 1.123456789012345E-5  -> 0.00001123456789012345
+addx61426 add  0 1.123456789012345E-6  -> 0.000001123456789012345
+addx61427 add  0 1.123456789012345E-7  -> 1.123456789012345E-7
+addx61428 add  0 1.123456789012345E-8  -> 1.123456789012345E-8
+addx61429 add  0 1.123456789012345E-9  -> 1.123456789012345E-9
+addx61430 add  0 1.123456789012345E-10 -> 1.123456789012345E-10
+addx61431 add  0 1.123456789012345E-11 -> 1.123456789012345E-11
+addx61432 add  0 1.123456789012345E-12 -> 1.123456789012345E-12
+addx61433 add  0 1.123456789012345E-13 -> 1.123456789012345E-13
+addx61434 add  0 1.123456789012345E-14 -> 1.123456789012345E-14
+addx61435 add  0 1.123456789012345E-15 -> 1.123456789012345E-15
+addx61436 add  0 1.123456789012345E-16 -> 1.123456789012345E-16
+addx61437 add  0 1.123456789012345E-17 -> 1.123456789012345E-17
+addx61438 add  0 1.123456789012345E-18 -> 1.123456789012345E-18
+addx61439 add  0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+addx61440 add 1.123456789012345     0 -> 1.123456789012345
+addx61441 add 1.123456789012345E-1  0 -> 0.1123456789012345
+addx61442 add 1.123456789012345E-2  0 -> 0.01123456789012345
+addx61443 add 1.123456789012345E-3  0 -> 0.001123456789012345
+addx61444 add 1.123456789012345E-4  0 -> 0.0001123456789012345
+addx61445 add 1.123456789012345E-5  0 -> 0.00001123456789012345
+addx61446 add 1.123456789012345E-6  0 -> 0.000001123456789012345
+addx61447 add 1.123456789012345E-7  0 -> 1.123456789012345E-7
+addx61448 add 1.123456789012345E-8  0 -> 1.123456789012345E-8
+addx61449 add 1.123456789012345E-9  0 -> 1.123456789012345E-9
+addx61450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
+addx61451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
+addx61452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
+addx61453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
+addx61454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
+addx61455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
+addx61456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
+addx61457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
+addx61458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
+addx61459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+addx61460 add 1.123456789012345  0E-0   -> 1.123456789012345
+addx61461 add 1.123456789012345  0E-1   -> 1.123456789012345
+addx61462 add 1.123456789012345  0E-2   -> 1.123456789012345
+addx61463 add 1.123456789012345  0E-3   -> 1.123456789012345
+addx61464 add 1.123456789012345  0E-4   -> 1.123456789012345
+addx61465 add 1.123456789012345  0E-5   -> 1.123456789012345
+addx61466 add 1.123456789012345  0E-6   -> 1.123456789012345
+addx61467 add 1.123456789012345  0E-7   -> 1.123456789012345
+addx61468 add 1.123456789012345  0E-8   -> 1.123456789012345
+addx61469 add 1.123456789012345  0E-9   -> 1.123456789012345
+addx61470 add 1.123456789012345  0E-10  -> 1.123456789012345
+addx61471 add 1.123456789012345  0E-11  -> 1.123456789012345
+addx61472 add 1.123456789012345  0E-12  -> 1.123456789012345
+addx61473 add 1.123456789012345  0E-13  -> 1.123456789012345
+addx61474 add 1.123456789012345  0E-14  -> 1.123456789012345
+addx61475 add 1.123456789012345  0E-15  -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+addx61476 add 1.123456789012345  0E-16  -> 1.123456789012345 Rounded
+addx61477 add 1.123456789012345  0E-17  -> 1.123456789012345 Rounded
+addx61478 add 1.123456789012345  0E-18  -> 1.123456789012345 Rounded
+addx61479 add 1.123456789012345  0E-19  -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding:    half_up
+-- exact zeros from zeros
+addx61500 add  0        0E-19  ->  0E-19
+addx61501 add -0        0E-19  ->  0E-19
+addx61502 add  0       -0E-19  ->  0E-19
+addx61503 add -0       -0E-19  -> -0E-19
+addx61504 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61505 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61506 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61507 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61511 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61512 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61513 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61514 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx61515 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61516 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61517 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61518 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    half_down
+-- exact zeros from zeros
+addx61520 add  0        0E-19  ->  0E-19
+addx61521 add -0        0E-19  ->  0E-19
+addx61522 add  0       -0E-19  ->  0E-19
+addx61523 add -0       -0E-19  -> -0E-19
+addx61524 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61525 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61526 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61527 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61531 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61532 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61533 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61534 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx61535 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61536 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61537 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61538 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    half_even
+-- exact zeros from zeros
+addx61540 add  0        0E-19  ->  0E-19
+addx61541 add -0        0E-19  ->  0E-19
+addx61542 add  0       -0E-19  ->  0E-19
+addx61543 add -0       -0E-19  -> -0E-19
+addx61544 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61545 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61546 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61547 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61551 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61552 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61553 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61554 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx61555 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61556 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61557 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61558 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    up
+-- exact zeros from zeros
+addx61560 add  0        0E-19  ->  0E-19
+addx61561 add -0        0E-19  ->  0E-19
+addx61562 add  0       -0E-19  ->  0E-19
+addx61563 add -0       -0E-19  -> -0E-19
+addx61564 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61565 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61566 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61567 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61571 add  1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61572 add -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61573 add  1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+addx61574 add -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+addx61575 add  1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61576 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61577 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61578 add -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding:    down
+-- exact zeros from zeros
+addx61580 add  0        0E-19  ->  0E-19
+addx61581 add -0        0E-19  ->  0E-19
+addx61582 add  0       -0E-19  ->  0E-19
+addx61583 add -0       -0E-19  -> -0E-19
+addx61584 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61585 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61586 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61587 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61591 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61592 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61593 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61594 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx61595 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61596 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61597 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61598 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding:    ceiling
+-- exact zeros from zeros
+addx61600 add  0        0E-19  ->  0E-19
+addx61601 add -0        0E-19  ->  0E-19
+addx61602 add  0       -0E-19  ->  0E-19
+addx61603 add -0       -0E-19  -> -0E-19
+addx61604 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61605 add -0E-400   0E-19  ->  0E-398 Clamped
+addx61606 add  0E-400  -0E-19  ->  0E-398 Clamped
+addx61607 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61611 add  1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61612 add -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61613 add  1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61614 add -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+addx61615 add  1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow
+addx61616 add -1E-401   1E-401 ->  0E-398 Clamped
+addx61617 add  1E-401  -1E-401 ->  0E-398 Clamped
+addx61618 add -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding:    floor
+-- exact zeros from zeros
+addx61620 add  0        0E-19  ->  0E-19
+addx61621 add -0        0E-19  -> -0E-19           -- *
+addx61622 add  0       -0E-19  -> -0E-19           -- *
+addx61623 add -0       -0E-19  -> -0E-19
+addx61624 add  0E-400   0E-19  ->  0E-398 Clamped
+addx61625 add -0E-400   0E-19  -> -0E-398 Clamped  -- *
+addx61626 add  0E-400  -0E-19  -> -0E-398 Clamped  -- *
+addx61627 add -0E-400  -0E-19  -> -0E-398 Clamped
+-- inexact zeros
+addx61631 add  1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61632 add -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61633 add  1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+addx61634 add -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+addx61635 add  1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped
+addx61636 add -1E-401   1E-401 -> -0E-398 Clamped  -- *
+addx61637 add  1E-401  -1E-401 -> -0E-398 Clamped  -- *
+addx61638 add -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+addx61701 add 130E-2    120E-2    -> 2.50
+addx61702 add 130E-2    12E-1     -> 2.50
+addx61703 add 130E-2    1E0       -> 2.30
+addx61704 add 1E2       1E4       -> 1.01E+4
+addx61705 subtract 130E-2  120E-2 -> 0.10
+addx61706 subtract 130E-2  12E-1  -> 0.10
+addx61707 subtract 130E-2  1E0    -> 0.30
+addx61708 subtract 1E2     1E4    -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+addx62001 add 1234567890123456 1      -> 1234567890123457
+addx62002 add 1234567890123456 0.6    -> 1234567890123457  Inexact Rounded
+addx62003 add 1234567890123456 0.06   -> 1234567890123456  Inexact Rounded
+addx62004 add 1234567890123456 6E-3   -> 1234567890123456  Inexact Rounded
+addx62005 add 1234567890123456 6E-4   -> 1234567890123456  Inexact Rounded
+addx62006 add 1234567890123456 6E-5   -> 1234567890123456  Inexact Rounded
+addx62007 add 1234567890123456 6E-6   -> 1234567890123456  Inexact Rounded
+addx62008 add 1234567890123456 6E-7   -> 1234567890123456  Inexact Rounded
+addx62009 add 1234567890123456 6E-8   -> 1234567890123456  Inexact Rounded
+addx62010 add 1234567890123456 6E-9   -> 1234567890123456  Inexact Rounded
+addx62011 add 1234567890123456 6E-10  -> 1234567890123456  Inexact Rounded
+addx62012 add 1234567890123456 6E-11  -> 1234567890123456  Inexact Rounded
+addx62013 add 1234567890123456 6E-12  -> 1234567890123456  Inexact Rounded
+addx62014 add 1234567890123456 6E-13  -> 1234567890123456  Inexact Rounded
+addx62015 add 1234567890123456 6E-14  -> 1234567890123456  Inexact Rounded
+addx62016 add 1234567890123456 6E-15  -> 1234567890123456  Inexact Rounded
+addx62017 add 1234567890123456 6E-16  -> 1234567890123456  Inexact Rounded
+addx62018 add 1234567890123456 6E-17  -> 1234567890123456  Inexact Rounded
+addx62019 add 1234567890123456 6E-18  -> 1234567890123456  Inexact Rounded
+addx62020 add 1234567890123456 6E-19  -> 1234567890123456  Inexact Rounded
+addx62021 add 1234567890123456 6E-20  -> 1234567890123456  Inexact Rounded
+
+-- widening second argument at gap
+addx62030 add 12345678 1                       -> 12345679
+addx62031 add 12345678 0.1                     -> 12345678.1
+addx62032 add 12345678 0.12                    -> 12345678.12
+addx62033 add 12345678 0.123                   -> 12345678.123
+addx62034 add 12345678 0.1234                  -> 12345678.1234
+addx62035 add 12345678 0.12345                 -> 12345678.12345
+addx62036 add 12345678 0.123456                -> 12345678.123456
+addx62037 add 12345678 0.1234567               -> 12345678.1234567
+addx62038 add 12345678 0.12345678              -> 12345678.12345678
+addx62039 add 12345678 0.123456789             -> 12345678.12345679 Inexact Rounded
+addx62040 add 12345678 0.123456785             -> 12345678.12345678 Inexact Rounded
+addx62041 add 12345678 0.1234567850            -> 12345678.12345678 Inexact Rounded
+addx62042 add 12345678 0.1234567851            -> 12345678.12345679 Inexact Rounded
+addx62043 add 12345678 0.12345678501           -> 12345678.12345679 Inexact Rounded
+addx62044 add 12345678 0.123456785001          -> 12345678.12345679 Inexact Rounded
+addx62045 add 12345678 0.1234567850001         -> 12345678.12345679 Inexact Rounded
+addx62046 add 12345678 0.12345678500001        -> 12345678.12345679 Inexact Rounded
+addx62047 add 12345678 0.123456785000001       -> 12345678.12345679 Inexact Rounded
+addx62048 add 12345678 0.1234567850000001      -> 12345678.12345679 Inexact Rounded
+addx62049 add 12345678 0.1234567850000000      -> 12345678.12345678 Inexact Rounded
+--                               90123456
+rounding: half_even
+addx62050 add 12345678 0.0234567750000000      -> 12345678.02345678 Inexact Rounded
+addx62051 add 12345678 0.0034567750000000      -> 12345678.00345678 Inexact Rounded
+addx62052 add 12345678 0.0004567750000000      -> 12345678.00045678 Inexact Rounded
+addx62053 add 12345678 0.0000567750000000      -> 12345678.00005678 Inexact Rounded
+addx62054 add 12345678 0.0000067750000000      -> 12345678.00000678 Inexact Rounded
+addx62055 add 12345678 0.0000007750000000      -> 12345678.00000078 Inexact Rounded
+addx62056 add 12345678 0.0000000750000000      -> 12345678.00000008 Inexact Rounded
+addx62057 add 12345678 0.0000000050000000      -> 12345678.00000000 Inexact Rounded
+addx62060 add 12345678 0.0234567750000001      -> 12345678.02345678 Inexact Rounded
+addx62061 add 12345678 0.0034567750000001      -> 12345678.00345678 Inexact Rounded
+addx62062 add 12345678 0.0004567750000001      -> 12345678.00045678 Inexact Rounded
+addx62063 add 12345678 0.0000567750000001      -> 12345678.00005678 Inexact Rounded
+addx62064 add 12345678 0.0000067750000001      -> 12345678.00000678 Inexact Rounded
+addx62065 add 12345678 0.0000007750000001      -> 12345678.00000078 Inexact Rounded
+addx62066 add 12345678 0.0000000750000001      -> 12345678.00000008 Inexact Rounded
+addx62067 add 12345678 0.0000000050000001      -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+addx62070 add 12345678 1E-8                    -> 12345678.00000001
+addx62071 add 12345678 1E-9                    -> 12345678.00000001 Inexact Rounded
+addx62072 add 12345678 1E-10                   -> 12345678.00000001 Inexact Rounded
+addx62073 add 12345678 1E-11                   -> 12345678.00000001 Inexact Rounded
+addx62074 add 12345678 1E-12                   -> 12345678.00000001 Inexact Rounded
+addx62075 add 12345678 1E-13                   -> 12345678.00000001 Inexact Rounded
+addx62076 add 12345678 1E-14                   -> 12345678.00000001 Inexact Rounded
+addx62077 add 12345678 1E-15                   -> 12345678.00000001 Inexact Rounded
+addx62078 add 12345678 1E-16                   -> 12345678.00000001 Inexact Rounded
+addx62079 add 12345678 1E-17                   -> 12345678.00000001 Inexact Rounded
+addx62080 add 12345678 1E-18                   -> 12345678.00000001 Inexact Rounded
+addx62081 add 12345678 1E-19                   -> 12345678.00000001 Inexact Rounded
+addx62082 add 12345678 1E-20                   -> 12345678.00000001 Inexact Rounded
+addx62083 add 12345678 1E-25                   -> 12345678.00000001 Inexact Rounded
+addx62084 add 12345678 1E-30                   -> 12345678.00000001 Inexact Rounded
+addx62085 add 12345678 1E-31                   -> 12345678.00000001 Inexact Rounded
+addx62086 add 12345678 1E-32                   -> 12345678.00000001 Inexact Rounded
+addx62087 add 12345678 1E-33                   -> 12345678.00000001 Inexact Rounded
+addx62088 add 12345678 1E-34                   -> 12345678.00000001 Inexact Rounded
+addx62089 add 12345678 1E-35                   -> 12345678.00000001 Inexact Rounded
+
+-- payload decapitate
+precision: 5
+addx62100 add      11  sNaN123456789 ->  NaN56789  Invalid_operation
+addx62101 add     -11 -sNaN123456789 -> -NaN56789  Invalid_operation
+addx62102 add      11   NaN123456789 ->  NaN56789
+addx62103 add     -11  -NaN123456789 -> -NaN56789
+
 -- Null tests
 addx9990 add 10  # -> NaN Invalid_operation
 addx9991 add  # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/and.decTest b/Lib/test/decimaltestdata/and.decTest
new file mode 100644 (file)
index 0000000..18ba881
--- /dev/null
@@ -0,0 +1,338 @@
+------------------------------------------------------------------------\r
+-- and.decTest -- digitwise logical AND                               --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check (truth table)\r
+andx001 and             0    0 ->    0\r
+andx002 and             0    1 ->    0\r
+andx003 and             1    0 ->    0\r
+andx004 and             1    1 ->    1\r
+andx005 and          1100 1010 -> 1000\r
+andx006 and          1111   10 ->   10\r
+andx007 and          1111 1010 -> 1010\r
+\r
+-- and at msd and msd-1\r
+andx010 and 000000000 000000000 ->           0\r
+andx011 and 000000000 100000000 ->           0\r
+andx012 and 100000000 000000000 ->           0\r
+andx013 and 100000000 100000000 ->   100000000\r
+andx014 and 000000000 000000000 ->           0\r
+andx015 and 000000000 010000000 ->           0\r
+andx016 and 010000000 000000000 ->           0\r
+andx017 and 010000000 010000000 ->    10000000\r
+\r
+-- Various lengths\r
+--          123456789     123456789      123456789\r
+andx021 and 111111111     111111111  ->  111111111\r
+andx022 and 111111111111  111111111  ->  111111111\r
+andx023 and 111111111111   11111111  ->   11111111\r
+andx024 and 111111111      11111111  ->   11111111\r
+andx025 and 111111111       1111111  ->    1111111\r
+andx026 and 111111111111     111111  ->     111111\r
+andx027 and 111111111111      11111  ->      11111\r
+andx028 and 111111111111       1111  ->       1111\r
+andx029 and 111111111111        111  ->        111\r
+andx031 and 111111111111         11  ->         11\r
+andx032 and 111111111111          1  ->          1\r
+andx033 and 111111111111 1111111111  ->  111111111\r
+andx034 and 11111111111 11111111111  ->  111111111\r
+andx035 and 1111111111 111111111111  ->  111111111\r
+andx036 and 111111111 1111111111111  ->  111111111\r
+\r
+andx040 and 111111111  111111111111  ->  111111111\r
+andx041 and  11111111  111111111111  ->   11111111\r
+andx042 and  11111111     111111111  ->   11111111\r
+andx043 and   1111111     111111111  ->    1111111\r
+andx044 and    111111     111111111  ->     111111\r
+andx045 and     11111     111111111  ->      11111\r
+andx046 and      1111     111111111  ->       1111\r
+andx047 and       111     111111111  ->        111\r
+andx048 and        11     111111111  ->         11\r
+andx049 and         1     111111111  ->          1\r
+\r
+andx050 and 1111111111  1  ->  1\r
+andx051 and  111111111  1  ->  1\r
+andx052 and   11111111  1  ->  1\r
+andx053 and    1111111  1  ->  1\r
+andx054 and     111111  1  ->  1\r
+andx055 and      11111  1  ->  1\r
+andx056 and       1111  1  ->  1\r
+andx057 and        111  1  ->  1\r
+andx058 and         11  1  ->  1\r
+andx059 and          1  1  ->  1\r
+\r
+andx060 and 1111111111  0  ->  0\r
+andx061 and  111111111  0  ->  0\r
+andx062 and   11111111  0  ->  0\r
+andx063 and    1111111  0  ->  0\r
+andx064 and     111111  0  ->  0\r
+andx065 and      11111  0  ->  0\r
+andx066 and       1111  0  ->  0\r
+andx067 and        111  0  ->  0\r
+andx068 and         11  0  ->  0\r
+andx069 and          1  0  ->  0\r
+\r
+andx070 and 1  1111111111  ->  1\r
+andx071 and 1   111111111  ->  1\r
+andx072 and 1    11111111  ->  1\r
+andx073 and 1     1111111  ->  1\r
+andx074 and 1      111111  ->  1\r
+andx075 and 1       11111  ->  1\r
+andx076 and 1        1111  ->  1\r
+andx077 and 1         111  ->  1\r
+andx078 and 1          11  ->  1\r
+andx079 and 1           1  ->  1\r
+\r
+andx080 and 0  1111111111  ->  0\r
+andx081 and 0   111111111  ->  0\r
+andx082 and 0    11111111  ->  0\r
+andx083 and 0     1111111  ->  0\r
+andx084 and 0      111111  ->  0\r
+andx085 and 0       11111  ->  0\r
+andx086 and 0        1111  ->  0\r
+andx087 and 0         111  ->  0\r
+andx088 and 0          11  ->  0\r
+andx089 and 0           1  ->  0\r
+\r
+andx090 and 011111111  111111111  ->   11111111\r
+andx091 and 101111111  111111111  ->  101111111\r
+andx092 and 110111111  111111111  ->  110111111\r
+andx093 and 111011111  111111111  ->  111011111\r
+andx094 and 111101111  111111111  ->  111101111\r
+andx095 and 111110111  111111111  ->  111110111\r
+andx096 and 111111011  111111111  ->  111111011\r
+andx097 and 111111101  111111111  ->  111111101\r
+andx098 and 111111110  111111111  ->  111111110\r
+\r
+andx100 and 111111111  011111111  ->   11111111\r
+andx101 and 111111111  101111111  ->  101111111\r
+andx102 and 111111111  110111111  ->  110111111\r
+andx103 and 111111111  111011111  ->  111011111\r
+andx104 and 111111111  111101111  ->  111101111\r
+andx105 and 111111111  111110111  ->  111110111\r
+andx106 and 111111111  111111011  ->  111111011\r
+andx107 and 111111111  111111101  ->  111111101\r
+andx108 and 111111111  111111110  ->  111111110\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+andx220 and 111111112  111111111  ->  NaN Invalid_operation\r
+andx221 and 333333333  333333333  ->  NaN Invalid_operation\r
+andx222 and 555555555  555555555  ->  NaN Invalid_operation\r
+andx223 and 777777777  777777777  ->  NaN Invalid_operation\r
+andx224 and 999999999  999999999  ->  NaN Invalid_operation\r
+andx225 and 222222222  999999999  ->  NaN Invalid_operation\r
+andx226 and 444444444  999999999  ->  NaN Invalid_operation\r
+andx227 and 666666666  999999999  ->  NaN Invalid_operation\r
+andx228 and 888888888  999999999  ->  NaN Invalid_operation\r
+andx229 and 999999999  222222222  ->  NaN Invalid_operation\r
+andx230 and 999999999  444444444  ->  NaN Invalid_operation\r
+andx231 and 999999999  666666666  ->  NaN Invalid_operation\r
+andx232 and 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+andx240 and  567468689 -934981942 ->  NaN Invalid_operation\r
+andx241 and  567367689  934981942 ->  NaN Invalid_operation\r
+andx242 and -631917772 -706014634 ->  NaN Invalid_operation\r
+andx243 and -756253257  138579234 ->  NaN Invalid_operation\r
+andx244 and  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+andx250 and  200000000 100000000 ->  NaN Invalid_operation\r
+andx251 and  700000000 100000000 ->  NaN Invalid_operation\r
+andx252 and  800000000 100000000 ->  NaN Invalid_operation\r
+andx253 and  900000000 100000000 ->  NaN Invalid_operation\r
+andx254 and  200000000 000000000 ->  NaN Invalid_operation\r
+andx255 and  700000000 000000000 ->  NaN Invalid_operation\r
+andx256 and  800000000 000000000 ->  NaN Invalid_operation\r
+andx257 and  900000000 000000000 ->  NaN Invalid_operation\r
+andx258 and  100000000 200000000 ->  NaN Invalid_operation\r
+andx259 and  100000000 700000000 ->  NaN Invalid_operation\r
+andx260 and  100000000 800000000 ->  NaN Invalid_operation\r
+andx261 and  100000000 900000000 ->  NaN Invalid_operation\r
+andx262 and  000000000 200000000 ->  NaN Invalid_operation\r
+andx263 and  000000000 700000000 ->  NaN Invalid_operation\r
+andx264 and  000000000 800000000 ->  NaN Invalid_operation\r
+andx265 and  000000000 900000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+andx270 and  020000000 100000000 ->  NaN Invalid_operation\r
+andx271 and  070100000 100000000 ->  NaN Invalid_operation\r
+andx272 and  080010000 100000001 ->  NaN Invalid_operation\r
+andx273 and  090001000 100000010 ->  NaN Invalid_operation\r
+andx274 and  100000100 020010100 ->  NaN Invalid_operation\r
+andx275 and  100000000 070001000 ->  NaN Invalid_operation\r
+andx276 and  100000010 080010100 ->  NaN Invalid_operation\r
+andx277 and  100000000 090000010 ->  NaN Invalid_operation\r
+-- test LSD\r
+andx280 and  001000002 100000000 ->  NaN Invalid_operation\r
+andx281 and  000000007 100000000 ->  NaN Invalid_operation\r
+andx282 and  000000008 100000000 ->  NaN Invalid_operation\r
+andx283 and  000000009 100000000 ->  NaN Invalid_operation\r
+andx284 and  100000000 000100002 ->  NaN Invalid_operation\r
+andx285 and  100100000 001000007 ->  NaN Invalid_operation\r
+andx286 and  100010000 010000008 ->  NaN Invalid_operation\r
+andx287 and  100001000 100000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+andx288 and  001020000 100000000 ->  NaN Invalid_operation\r
+andx289 and  000070001 100000000 ->  NaN Invalid_operation\r
+andx290 and  000080000 100010000 ->  NaN Invalid_operation\r
+andx291 and  000090000 100001000 ->  NaN Invalid_operation\r
+andx292 and  100000010 000020100 ->  NaN Invalid_operation\r
+andx293 and  100100000 000070010 ->  NaN Invalid_operation\r
+andx294 and  100010100 000080001 ->  NaN Invalid_operation\r
+andx295 and  100001000 000090000 ->  NaN Invalid_operation\r
+-- signs\r
+andx296 and -100001000 -000000000 ->  NaN Invalid_operation\r
+andx297 and -100001000  000010000 ->  NaN Invalid_operation\r
+andx298 and  100001000 -000000000 ->  NaN Invalid_operation\r
+andx299 and  100001000  000011000 ->  1000\r
+\r
+-- Nmax, Nmin, Ntiny\r
+andx331 and  2   9.99999999E+999     -> NaN Invalid_operation\r
+andx332 and  3   1E-999              -> NaN Invalid_operation\r
+andx333 and  4   1.00000000E-999     -> NaN Invalid_operation\r
+andx334 and  5   1E-1007             -> NaN Invalid_operation\r
+andx335 and  6   -1E-1007            -> NaN Invalid_operation\r
+andx336 and  7   -1.00000000E-999    -> NaN Invalid_operation\r
+andx337 and  8   -1E-999             -> NaN Invalid_operation\r
+andx338 and  9   -9.99999999E+999    -> NaN Invalid_operation\r
+andx341 and  9.99999999E+999     -18 -> NaN Invalid_operation\r
+andx342 and  1E-999               01 -> NaN Invalid_operation\r
+andx343 and  1.00000000E-999     -18 -> NaN Invalid_operation\r
+andx344 and  1E-1007              18 -> NaN Invalid_operation\r
+andx345 and  -1E-1007            -10 -> NaN Invalid_operation\r
+andx346 and  -1.00000000E-999     18 -> NaN Invalid_operation\r
+andx347 and  -1E-999              10 -> NaN Invalid_operation\r
+andx348 and  -9.99999999E+999    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+andx361 and  1.0                  1  -> NaN Invalid_operation\r
+andx362 and  1E+1                 1  -> NaN Invalid_operation\r
+andx363 and  0.0                  1  -> NaN Invalid_operation\r
+andx364 and  0E+1                 1  -> NaN Invalid_operation\r
+andx365 and  9.9                  1  -> NaN Invalid_operation\r
+andx366 and  9E+1                 1  -> NaN Invalid_operation\r
+andx371 and  0 1.0                   -> NaN Invalid_operation\r
+andx372 and  0 1E+1                  -> NaN Invalid_operation\r
+andx373 and  0 0.0                   -> NaN Invalid_operation\r
+andx374 and  0 0E+1                  -> NaN Invalid_operation\r
+andx375 and  0 9.9                   -> NaN Invalid_operation\r
+andx376 and  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+andx780 and -Inf  -Inf   -> NaN Invalid_operation\r
+andx781 and -Inf  -1000  -> NaN Invalid_operation\r
+andx782 and -Inf  -1     -> NaN Invalid_operation\r
+andx783 and -Inf  -0     -> NaN Invalid_operation\r
+andx784 and -Inf   0     -> NaN Invalid_operation\r
+andx785 and -Inf   1     -> NaN Invalid_operation\r
+andx786 and -Inf   1000  -> NaN Invalid_operation\r
+andx787 and -1000 -Inf   -> NaN Invalid_operation\r
+andx788 and -Inf  -Inf   -> NaN Invalid_operation\r
+andx789 and -1    -Inf   -> NaN Invalid_operation\r
+andx790 and -0    -Inf   -> NaN Invalid_operation\r
+andx791 and  0    -Inf   -> NaN Invalid_operation\r
+andx792 and  1    -Inf   -> NaN Invalid_operation\r
+andx793 and  1000 -Inf   -> NaN Invalid_operation\r
+andx794 and  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+andx800 and  Inf  -Inf   -> NaN Invalid_operation\r
+andx801 and  Inf  -1000  -> NaN Invalid_operation\r
+andx802 and  Inf  -1     -> NaN Invalid_operation\r
+andx803 and  Inf  -0     -> NaN Invalid_operation\r
+andx804 and  Inf   0     -> NaN Invalid_operation\r
+andx805 and  Inf   1     -> NaN Invalid_operation\r
+andx806 and  Inf   1000  -> NaN Invalid_operation\r
+andx807 and  Inf   Inf   -> NaN Invalid_operation\r
+andx808 and -1000  Inf   -> NaN Invalid_operation\r
+andx809 and -Inf   Inf   -> NaN Invalid_operation\r
+andx810 and -1     Inf   -> NaN Invalid_operation\r
+andx811 and -0     Inf   -> NaN Invalid_operation\r
+andx812 and  0     Inf   -> NaN Invalid_operation\r
+andx813 and  1     Inf   -> NaN Invalid_operation\r
+andx814 and  1000  Inf   -> NaN Invalid_operation\r
+andx815 and  Inf   Inf   -> NaN Invalid_operation\r
+\r
+andx821 and  NaN -Inf    -> NaN Invalid_operation\r
+andx822 and  NaN -1000   -> NaN Invalid_operation\r
+andx823 and  NaN -1      -> NaN Invalid_operation\r
+andx824 and  NaN -0      -> NaN Invalid_operation\r
+andx825 and  NaN  0      -> NaN Invalid_operation\r
+andx826 and  NaN  1      -> NaN Invalid_operation\r
+andx827 and  NaN  1000   -> NaN Invalid_operation\r
+andx828 and  NaN  Inf    -> NaN Invalid_operation\r
+andx829 and  NaN  NaN    -> NaN Invalid_operation\r
+andx830 and -Inf  NaN    -> NaN Invalid_operation\r
+andx831 and -1000 NaN    -> NaN Invalid_operation\r
+andx832 and -1    NaN    -> NaN Invalid_operation\r
+andx833 and -0    NaN    -> NaN Invalid_operation\r
+andx834 and  0    NaN    -> NaN Invalid_operation\r
+andx835 and  1    NaN    -> NaN Invalid_operation\r
+andx836 and  1000 NaN    -> NaN Invalid_operation\r
+andx837 and  Inf  NaN    -> NaN Invalid_operation\r
+\r
+andx841 and  sNaN -Inf   ->  NaN  Invalid_operation\r
+andx842 and  sNaN -1000  ->  NaN  Invalid_operation\r
+andx843 and  sNaN -1     ->  NaN  Invalid_operation\r
+andx844 and  sNaN -0     ->  NaN  Invalid_operation\r
+andx845 and  sNaN  0     ->  NaN  Invalid_operation\r
+andx846 and  sNaN  1     ->  NaN  Invalid_operation\r
+andx847 and  sNaN  1000  ->  NaN  Invalid_operation\r
+andx848 and  sNaN  NaN   ->  NaN  Invalid_operation\r
+andx849 and  sNaN sNaN   ->  NaN  Invalid_operation\r
+andx850 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+andx851 and -Inf  sNaN   ->  NaN  Invalid_operation\r
+andx852 and -1000 sNaN   ->  NaN  Invalid_operation\r
+andx853 and -1    sNaN   ->  NaN  Invalid_operation\r
+andx854 and -0    sNaN   ->  NaN  Invalid_operation\r
+andx855 and  0    sNaN   ->  NaN  Invalid_operation\r
+andx856 and  1    sNaN   ->  NaN  Invalid_operation\r
+andx857 and  1000 sNaN   ->  NaN  Invalid_operation\r
+andx858 and  Inf  sNaN   ->  NaN  Invalid_operation\r
+andx859 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+andx861 and  NaN1   -Inf    -> NaN Invalid_operation\r
+andx862 and +NaN2   -1000   -> NaN Invalid_operation\r
+andx863 and  NaN3    1000   -> NaN Invalid_operation\r
+andx864 and  NaN4    Inf    -> NaN Invalid_operation\r
+andx865 and  NaN5   +NaN6   -> NaN Invalid_operation\r
+andx866 and -Inf     NaN7   -> NaN Invalid_operation\r
+andx867 and -1000    NaN8   -> NaN Invalid_operation\r
+andx868 and  1000    NaN9   -> NaN Invalid_operation\r
+andx869 and  Inf    +NaN10  -> NaN Invalid_operation\r
+andx871 and  sNaN11  -Inf   -> NaN Invalid_operation\r
+andx872 and  sNaN12  -1000  -> NaN Invalid_operation\r
+andx873 and  sNaN13   1000  -> NaN Invalid_operation\r
+andx874 and  sNaN14   NaN17 -> NaN Invalid_operation\r
+andx875 and  sNaN15  sNaN18 -> NaN Invalid_operation\r
+andx876 and  NaN16   sNaN19 -> NaN Invalid_operation\r
+andx877 and -Inf    +sNaN20 -> NaN Invalid_operation\r
+andx878 and -1000    sNaN21 -> NaN Invalid_operation\r
+andx879 and  1000    sNaN22 -> NaN Invalid_operation\r
+andx880 and  Inf     sNaN23 -> NaN Invalid_operation\r
+andx881 and +NaN25  +sNaN24 -> NaN Invalid_operation\r
+andx882 and -NaN26    NaN28 -> NaN Invalid_operation\r
+andx883 and -sNaN27  sNaN29 -> NaN Invalid_operation\r
+andx884 and  1000    -NaN30 -> NaN Invalid_operation\r
+andx885 and  1000   -sNaN31 -> NaN Invalid_operation\r
index 96a4b9d1d26b01491d93a89cdc39379df2630405..de0b8138bce4c0f6aee03663a169516d2d3f4177 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- base.decTest -- base decimal <--> string conversions               --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,8 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
+extended:    1
 
 -- This file tests base conversions from string to a decimal number
 -- and back to a string (in either Scientific or Engineering form)
@@ -26,11 +27,10 @@ version: 2.39
 -- to conform to emax and precision settings (that is, numbers will
 -- conform to rules and exponent will be in permitted range).
 
-precision:   15
+precision:   16
 rounding:    half_up
-maxExponent: 999999999
-minExponent: -999999999
-extended:    1
+maxExponent: 384
+minExponent: -383
 
 basx001 toSci       0 -> 0
 basx002 toSci       1 -> 1
@@ -73,41 +73,62 @@ basx038 toSci '0.123456789012345'   -> '0.123456789012345'
 
 -- String [many more examples are implicitly tested elsewhere]
 -- strings without E cannot generate E in result
-basx100 toSci "12"        -> '12'
-basx101 toSci "-76"       -> '-76'
-basx102 toSci "12.76"     -> '12.76'
-basx103 toSci "+12.76"    -> '12.76'
-basx104 toSci "012.76"    -> '12.76'
-basx105 toSci "+0.003"    -> '0.003'
-basx106 toSci "17."       -> '17'
-basx107 toSci ".5"        -> '0.5'
-basx108 toSci "044"       -> '44'
-basx109 toSci "0044"      -> '44'
-basx110 toSci "0.0005"      -> '0.0005'
-basx111 toSci "00.00005"    -> '0.00005'
-basx112 toSci "0.000005"    -> '0.000005'
-basx113 toSci "0.0000050"   -> '0.0000050'
-basx114 toSci "0.0000005"   -> '5E-7'
-basx115 toSci "0.00000005"  -> '5E-8'
-basx116 toSci "12345678.543210" -> '12345678.543210'
-basx117 toSci "2345678.543210" -> '2345678.543210'
-basx118 toSci "345678.543210" -> '345678.543210'
-basx119 toSci "0345678.54321" -> '345678.54321'
-basx120 toSci "345678.5432" -> '345678.5432'
-basx121 toSci "+345678.5432" -> '345678.5432'
-basx122 toSci "+0345678.5432" -> '345678.5432'
-basx123 toSci "+00345678.5432" -> '345678.5432'
-basx124 toSci "-345678.5432"  -> '-345678.5432'
-basx125 toSci "-0345678.5432"  -> '-345678.5432'
-basx126 toSci "-00345678.5432"  -> '-345678.5432'
+basx040 toSci "12"        -> '12'
+basx041 toSci "-76"       -> '-76'
+basx042 toSci "12.76"     -> '12.76'
+basx043 toSci "+12.76"    -> '12.76'
+basx044 toSci "012.76"    -> '12.76'
+basx045 toSci "+0.003"    -> '0.003'
+basx046 toSci "17."       -> '17'
+basx047 toSci ".5"        -> '0.5'
+basx048 toSci "044"       -> '44'
+basx049 toSci "0044"      -> '44'
+basx050 toSci "0.0005"      -> '0.0005'
+basx051 toSci "00.00005"    -> '0.00005'
+basx052 toSci "0.000005"    -> '0.000005'
+basx053 toSci "0.0000050"   -> '0.0000050'
+basx054 toSci "0.0000005"   -> '5E-7'
+basx055 toSci "0.00000005"  -> '5E-8'
+basx056 toSci "12345678.543210" -> '12345678.543210'
+basx057 toSci "2345678.543210" -> '2345678.543210'
+basx058 toSci "345678.543210" -> '345678.543210'
+basx059 toSci "0345678.54321" -> '345678.54321'
+basx060 toSci "345678.5432" -> '345678.5432'
+basx061 toSci "+345678.5432" -> '345678.5432'
+basx062 toSci "+0345678.5432" -> '345678.5432'
+basx063 toSci "+00345678.5432" -> '345678.5432'
+basx064 toSci "-345678.5432"  -> '-345678.5432'
+basx065 toSci "-0345678.5432"  -> '-345678.5432'
+basx066 toSci "-00345678.5432"  -> '-345678.5432'
 -- examples
-basx127 toSci "5E-6"        -> '0.000005'
-basx128 toSci "50E-7"       -> '0.0000050'
-basx129 toSci "5E-7"        -> '5E-7'
-
+basx067 toSci "5E-6"        -> '0.000005'
+basx068 toSci "50E-7"       -> '0.0000050'
+basx069 toSci "5E-7"        -> '5E-7'
 
 -- [No exotics as no Unicode]
 
+-- rounded with dots in all (including edge) places
+basx071 toSci  .1234567890123456123  -> 0.1234567890123456 Inexact Rounded
+basx072 toSci  1.234567890123456123  -> 1.234567890123456 Inexact Rounded
+basx073 toSci  12.34567890123456123  -> 12.34567890123456 Inexact Rounded
+basx074 toSci  123.4567890123456123  -> 123.4567890123456 Inexact Rounded
+basx075 toSci  1234.567890123456123  -> 1234.567890123456 Inexact Rounded
+basx076 toSci  12345.67890123456123  -> 12345.67890123456 Inexact Rounded
+basx077 toSci  123456.7890123456123  -> 123456.7890123456 Inexact Rounded
+basx078 toSci  1234567.890123456123  -> 1234567.890123456 Inexact Rounded
+basx079 toSci  12345678.90123456123  -> 12345678.90123456 Inexact Rounded
+basx080 toSci  123456789.0123456123  -> 123456789.0123456 Inexact Rounded
+basx081 toSci  1234567890.123456123  -> 1234567890.123456 Inexact Rounded
+basx082 toSci  12345678901.23456123  -> 12345678901.23456 Inexact Rounded
+basx083 toSci  123456789012.3456123  -> 123456789012.3456 Inexact Rounded
+basx084 toSci  1234567890123.456123  -> 1234567890123.456 Inexact Rounded
+basx085 toSci  12345678901234.56123  -> 12345678901234.56 Inexact Rounded
+basx086 toSci  123456789012345.6123  -> 123456789012345.6 Inexact Rounded
+basx087 toSci  1234567890123456.123  -> 1234567890123456  Inexact Rounded
+basx088 toSci  12345678901234561.23  -> 1.234567890123456E+16 Inexact Rounded
+basx089 toSci  123456789012345612.3  -> 1.234567890123456E+17 Inexact Rounded
+basx090 toSci  1234567890123456123.  -> 1.234567890123456E+18 Inexact Rounded
+
 -- Numbers with E
 basx130 toSci "0.000E-1"  -> '0.0000'
 basx131 toSci "0.000E-2"  -> '0.00000'
@@ -225,21 +246,6 @@ basx261 toSci "0.1265E+4"  -> '1265'
 basx262 toSci "0.1265E+8"  -> '1.265E+7'
 basx263 toSci "0.1265E+20" -> '1.265E+19'
 
-basx270 toSci "0.09e999"  -> '9E+997'
-basx271 toSci "0.9e999"   -> '9E+998'
-basx272 toSci "9e999"     -> '9E+999'
-basx273 toSci "9.9e999"   -> '9.9E+999'
-basx274 toSci "9.99e999"  -> '9.99E+999'
-basx275 toSci "9.99e-999" -> '9.99E-999'
-basx276 toSci "9.9e-999"  -> '9.9E-999'
-basx277 toSci "9e-999"    -> '9E-999'
-basx279 toSci "99e-999"   -> '9.9E-998'
-basx280 toSci "999e-999"  -> '9.99E-997'
-basx281 toSci '0.9e-998'  -> '9E-999'
-basx282 toSci '0.09e-997' -> '9E-999'
-basx283 toSci '0.1e1000'  -> '1E+999'
-basx284 toSci '10e-1000'  -> '1.0E-999'
-
 -- some more negative zeros [systematic tests below]
 basx290 toSci "-0.000E-1"  -> '-0.0000'
 basx291 toSci "-0.000E-2"  -> '-0.00000'
@@ -418,6 +424,22 @@ basx473  toEng 1000000005000 -> 1.00000001E+12   Rounded Inexact
 basx474  toSci 1000000009000 -> 1.00000001E+12   Rounded Inexact
 basx475  toEng 1000000009000 -> 1.00000001E+12   Rounded Inexact
 
+-- all-nines rounding
+precision: 9
+rounding:  half_up
+basx270  toSci 999999999          ->   999999999
+basx271  toSci 9999999990         ->   9.99999999E+9      Rounded
+basx272  toSci 9999999991         ->   9.99999999E+9      Rounded Inexact
+basx273  toSci 9999999992         ->   9.99999999E+9      Rounded Inexact
+basx274  toSci 9999999993         ->   9.99999999E+9      Rounded Inexact
+basx275  toSci 9999999994         ->   9.99999999E+9      Rounded Inexact
+basx276  toSci 9999999995         ->   1.00000000E+10     Rounded Inexact
+basx277  toSci 9999999996         ->   1.00000000E+10     Rounded Inexact
+basx278  toSci 9999999997         ->   1.00000000E+10     Rounded Inexact
+basx279  toSci 9999999998         ->   1.00000000E+10     Rounded Inexact
+basx280  toSci 9999999999         ->   1.00000000E+10     Rounded Inexact
+basx281  toSci 9999999999999999   ->   1.00000000E+16     Rounded Inexact
+
 -- check rounding modes heeded
 precision: 5
 rounding:  ceiling
@@ -425,11 +447,11 @@ bsrx401  toSci  1.23450    ->  1.2345  Rounded
 bsrx402  toSci  1.234549   ->  1.2346  Rounded Inexact
 bsrx403  toSci  1.234550   ->  1.2346  Rounded Inexact
 bsrx404  toSci  1.234551   ->  1.2346  Rounded Inexact
-rounding:  down
+rounding:  up
 bsrx405  toSci  1.23450    ->  1.2345  Rounded
-bsrx406  toSci  1.234549   ->  1.2345  Rounded Inexact
-bsrx407  toSci  1.234550   ->  1.2345  Rounded Inexact
-bsrx408  toSci  1.234551   ->  1.2345  Rounded Inexact
+bsrx406  toSci  1.234549   ->  1.2346  Rounded Inexact
+bsrx407  toSci  1.234550   ->  1.2346  Rounded Inexact
+bsrx408  toSci  1.234551   ->  1.2346  Rounded Inexact
 rounding:  floor
 bsrx410  toSci  1.23450    ->  1.2345  Rounded
 bsrx411  toSci  1.234549   ->  1.2345  Rounded Inexact
@@ -464,11 +486,11 @@ bsrx501  toSci -1.23450    -> -1.2345  Rounded
 bsrx502  toSci -1.234549   -> -1.2345  Rounded Inexact
 bsrx503  toSci -1.234550   -> -1.2345  Rounded Inexact
 bsrx504  toSci -1.234551   -> -1.2345  Rounded Inexact
-rounding:  down
+rounding:  up
 bsrx505  toSci -1.23450    -> -1.2345  Rounded
-bsrx506  toSci -1.234549   -> -1.2345  Rounded Inexact
-bsrx507  toSci -1.234550   -> -1.2345  Rounded Inexact
-bsrx508  toSci -1.234551   -> -1.2345  Rounded Inexact
+bsrx506  toSci -1.234549   -> -1.2346  Rounded Inexact
+bsrx507  toSci -1.234550   -> -1.2346  Rounded Inexact
+bsrx508  toSci -1.234551   -> -1.2346  Rounded Inexact
 rounding:  floor
 bsrx510  toSci -1.23450    -> -1.2345  Rounded
 bsrx511  toSci -1.234549   -> -1.2346  Rounded Inexact
@@ -498,6 +520,24 @@ bsrx533  toSci -1.234550   -> -1.2346  Rounded Inexact
 bsrx534  toSci -1.234650   -> -1.2347  Rounded Inexact
 bsrx535  toSci -1.234551   -> -1.2346  Rounded Inexact
 
+-- a few larger exponents
+maxExponent: 999999999
+minExponent: -999999999
+basx480 toSci "0.09e999"  -> '9E+997'
+basx481 toSci "0.9e999"   -> '9E+998'
+basx482 toSci "9e999"     -> '9E+999'
+basx483 toSci "9.9e999"   -> '9.9E+999'
+basx484 toSci "9.99e999"  -> '9.99E+999'
+basx485 toSci "9.99e-999" -> '9.99E-999'
+basx486 toSci "9.9e-999"  -> '9.9E-999'
+basx487 toSci "9e-999"    -> '9E-999'
+basx489 toSci "99e-999"   -> '9.9E-998'
+basx490 toSci "999e-999"  -> '9.99E-997'
+basx491 toSci '0.9e-998'  -> '9E-999'
+basx492 toSci '0.09e-997' -> '9E-999'
+basx493 toSci '0.1e1000'  -> '1E+999'
+basx494 toSci '10e-1000'  -> '1.0E-999'
+
 rounding:  half_up
 precision: 9
 
@@ -580,32 +620,23 @@ basx573 toSci "-sNa"            -> NaN Conversion_syntax
 basx574 toSci "xNaN"            -> NaN Conversion_syntax
 basx575 toSci "0sNaN"           -> NaN Conversion_syntax
 
--- subnormals and overflows
-basx576 toSci '99e999999999'       -> Infinity Overflow  Inexact Rounded
-basx577 toSci '999e999999999'      -> Infinity Overflow  Inexact Rounded
-basx578 toSci '0.9e-999999999'     -> 9E-1000000000 Subnormal
-basx579 toSci '0.09e-999999999'    -> 9E-1000000001 Subnormal
-basx580 toSci '0.1e1000000000'     -> 1E+999999999
-basx581 toSci '10e-1000000000'     -> 1.0E-999999999
-basx582 toSci '0.9e9999999999'     -> Infinity Overflow  Inexact Rounded
-basx583 toSci '99e-9999999999'     -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-basx584 toSci '111e9999999999'     -> Infinity Overflow  Inexact Rounded
-basx585 toSci '1111e-9999999999'   -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-basx586 toSci '1111e-99999999999'  -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-basx587 toSci '7e1000000000'       -> Infinity Overflow  Inexact Rounded
--- negatives the same
-basx588 toSci '-99e999999999'      -> -Infinity Overflow  Inexact Rounded
-basx589 toSci '-999e999999999'     -> -Infinity Overflow  Inexact Rounded
-basx590 toSci '-0.9e-999999999'    -> -9E-1000000000 Subnormal
-basx591 toSci '-0.09e-999999999'   -> -9E-1000000001 Subnormal
-basx592 toSci '-0.1e1000000000'    -> -1E+999999999
-basx593 toSci '-10e-1000000000'    -> -1.0E-999999999
-basx594 toSci '-0.9e9999999999'    -> -Infinity Overflow  Inexact Rounded
-basx595 toSci '-99e-9999999999'    -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-basx596 toSci '-111e9999999999'    -> -Infinity Overflow  Inexact Rounded
-basx597 toSci '-1111e-9999999999'  -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-basx598 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-basx599 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+-- some baddies with dots and Es and dots and specials
+basx576 toSci  'e+1'            ->  NaN Conversion_syntax
+basx577 toSci  '.e+1'           ->  NaN Conversion_syntax
+basx578 toSci  '+.e+1'          ->  NaN Conversion_syntax
+basx579 toSci  '-.e+'           ->  NaN Conversion_syntax
+basx580 toSci  '-.e'            ->  NaN Conversion_syntax
+basx581 toSci  'E+1'            ->  NaN Conversion_syntax
+basx582 toSci  '.E+1'           ->  NaN Conversion_syntax
+basx583 toSci  '+.E+1'          ->  NaN Conversion_syntax
+basx584 toSci  '-.E+'           ->  NaN Conversion_syntax
+basx585 toSci  '-.E'            ->  NaN Conversion_syntax
+
+basx586 toSci  '.NaN'           ->  NaN Conversion_syntax
+basx587 toSci  '-.NaN'          ->  NaN Conversion_syntax
+basx588 toSci  '+.sNaN'         ->  NaN Conversion_syntax
+basx589 toSci  '+.Inf'          ->  NaN Conversion_syntax
+basx590 toSci  '.Infinity'      ->  NaN Conversion_syntax
 
 -- Zeros
 basx601 toSci 0.000000000       -> 0E-9
@@ -686,6 +717,17 @@ basx677 toSci  0.00E-7          -> 0E-9
 basx678 toSci  0.00E-8          -> 0E-10
 basx679 toSci  0.00E-9          -> 0E-11
 
+basx680 toSci  000000.          ->  0
+basx681 toSci   00000.          ->  0
+basx682 toSci    0000.          ->  0
+basx683 toSci     000.          ->  0
+basx684 toSci      00.          ->  0
+basx685 toSci       0.          ->  0
+basx686 toSci  +00000.          ->  0
+basx687 toSci  -00000.          -> -0
+basx688 toSci  +0.              ->  0
+basx689 toSci  -0.              -> -0
+
 -- Specials
 precision: 4
 basx700 toSci "NaN"             -> NaN
@@ -868,6 +910,62 @@ basx877 toEng  0.00E-7          -> 0E-9
 basx878 toEng  0.00E-8          -> 0.0E-9
 basx879 toEng  0.00E-9          -> 0.00E-9
 
+
+rounding:  half_up
+precision: 9
+-- subnormals and overflows
+basx906 toSci '99e999999999'       -> Infinity Overflow  Inexact Rounded
+basx907 toSci '999e999999999'      -> Infinity Overflow  Inexact Rounded
+basx908 toSci '0.9e-999999999'     -> 9E-1000000000 Subnormal
+basx909 toSci '0.09e-999999999'    -> 9E-1000000001 Subnormal
+basx910 toSci '0.1e1000000000'     -> 1E+999999999
+basx911 toSci '10e-1000000000'     -> 1.0E-999999999
+basx912 toSci '0.9e9999999999'     -> Infinity Overflow  Inexact Rounded
+basx913 toSci '99e-9999999999'     -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx914 toSci '111e9999999999'     -> Infinity Overflow  Inexact Rounded
+basx915 toSci '1111e-9999999999'   -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx916 toSci '1111e-99999999999'  -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx917 toSci '7e1000000000'       -> Infinity Overflow  Inexact Rounded
+-- negatives the same
+basx918 toSci '-99e999999999'      -> -Infinity Overflow  Inexact Rounded
+basx919 toSci '-999e999999999'     -> -Infinity Overflow  Inexact Rounded
+basx920 toSci '-0.9e-999999999'    -> -9E-1000000000 Subnormal
+basx921 toSci '-0.09e-999999999'   -> -9E-1000000001 Subnormal
+basx922 toSci '-0.1e1000000000'    -> -1E+999999999
+basx923 toSci '-10e-1000000000'    -> -1.0E-999999999
+basx924 toSci '-0.9e9999999999'    -> -Infinity Overflow  Inexact Rounded
+basx925 toSci '-99e-9999999999'    -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx926 toSci '-111e9999999999'    -> -Infinity Overflow  Inexact Rounded
+basx927 toSci '-1111e-9999999999'  -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx928 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+basx929 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+
+rounding:  ceiling
+basx930 toSci  '7e1000000000'      ->  Infinity Overflow  Inexact Rounded
+basx931 toSci '-7e1000000000'      -> -9.99999999E+999999999 Overflow  Inexact Rounded
+rounding:  up
+basx932 toSci  '7e1000000000'      ->  Infinity Overflow  Inexact Rounded
+basx933 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+rounding:  down
+basx934 toSci  '7e1000000000'      ->  9.99999999E+999999999 Overflow  Inexact Rounded
+basx935 toSci '-7e1000000000'      -> -9.99999999E+999999999 Overflow  Inexact Rounded
+rounding:  floor
+basx936 toSci  '7e1000000000'      ->  9.99999999E+999999999 Overflow  Inexact Rounded
+basx937 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+
+rounding:  half_up
+basx938 toSci  '7e1000000000'      ->  Infinity Overflow  Inexact Rounded
+basx939 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+rounding:  half_even
+basx940 toSci  '7e1000000000'      ->  Infinity Overflow  Inexact Rounded
+basx941 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+rounding:  half_down
+basx942 toSci  '7e1000000000'      ->  Infinity Overflow  Inexact Rounded
+basx943 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded
+
+rounding:  half_even
+
+
 -- Giga exponent initial tests
 maxExponent: 999999999
 minExponent: -999999999
@@ -987,8 +1085,8 @@ emax225 toSci  1E-7  ->  1E-7  Subnormal
 emax226 toSci  1E-8  ->  1E-8  Subnormal
 emax227 toSci  1E-9  ->  1E-9  Subnormal
 emax228 toSci  1E-10 ->  1E-10 Subnormal
-emax229 toSci  1E-11 ->  0E-10 Underflow Subnormal Inexact Rounded
-emax230 toSci  1E-12 ->  0E-10 Underflow Subnormal Inexact Rounded
+emax229 toSci  1E-11 ->  0E-10 Underflow Subnormal Inexact Rounded Clamped
+emax230 toSci  1E-12 ->  0E-10 Underflow Subnormal Inexact Rounded Clamped
 
 maxexponent: 7
 minexponent: -7
@@ -1003,7 +1101,7 @@ emax238 toSci  1E+8  ->  Infinity Overflow Inexact Rounded
 
 maxexponent: 9
 minexponent: -9
-emax240 toSci  1E-21 ->  0E-17 Subnormal Underflow Inexact Rounded
+emax240 toSci  1E-21 ->  0E-17 Subnormal Underflow Inexact Rounded Clamped
 emax241 toSci  1E-10 ->  1E-10 Subnormal
 emax242 toSci  1E-9  ->  1E-9
 emax243 toSci  1E-8  ->  1E-8
@@ -1015,7 +1113,7 @@ emax248 toSci  1E+10 ->  Infinity Overflow Inexact Rounded
 
 maxexponent: 10  -- boundary
 minexponent: -10
-emax250 toSci  1E-21 ->  0E-18 Underflow Subnormal Inexact Rounded
+emax250 toSci  1E-21 ->  0E-18 Underflow Subnormal Inexact Rounded Clamped
 emax251 toSci  1E-11 ->  1E-11 Subnormal
 emax252 toSci  1E-10 ->  1E-10
 emax253 toSci  1E-9  ->  1E-9
@@ -1025,7 +1123,7 @@ emax256 toSci  1E+9  ->  1E+9
 emax257 toSci  1E+10 ->  1E+10
 emax258 toSci  1E+11 ->  Infinity Overflow Inexact Rounded
 
-emax260 toSci  1.00E-21 ->  0E-18 Underflow Subnormal Inexact Rounded
+emax260 toSci  1.00E-21 ->  0E-18 Underflow Subnormal Inexact Rounded Clamped
 emax261 toSci  1.00E-11 ->  1.00E-11 Subnormal
 emax262 toSci  1.00E-10 ->  1.00E-10
 emax263 toSci  1.00E-9  ->  1.00E-9
@@ -1034,7 +1132,7 @@ emax265 toSci  1.00E+8  ->  1.00E+8
 emax266 toSci  1.00E+9  ->  1.00E+9
 emax267 toSci  1.00E+10 ->  1.00E+10
 emax268 toSci  1.00E+11 ->  Infinity Overflow Inexact Rounded
-emax270 toSci  9.99E-21 ->  0E-18 Underflow Subnormal Inexact Rounded
+emax270 toSci  9.99E-21 ->  0E-18 Underflow Subnormal Inexact Rounded Clamped
 emax271 toSci  9.99E-11 ->  9.99E-11 Subnormal
 emax272 toSci  9.99E-10 ->  9.99E-10
 emax273 toSci  9.99E-9  ->  9.99E-9
@@ -1046,7 +1144,7 @@ emax278 toSci  9.99E+11 ->  Infinity Overflow Inexact Rounded
 
 maxexponent: 99
 minexponent: -99
-emax280 toSci  1E-120 ->  0E-107 Underflow Subnormal Inexact Rounded
+emax280 toSci  1E-120 ->  0E-107 Underflow Subnormal Inexact Rounded Clamped
 emax281 toSci  1E-100 ->  1E-100 Subnormal
 emax282 toSci  1E-99  ->  1E-99
 emax283 toSci  1E-98  ->  1E-98
@@ -1093,7 +1191,7 @@ emax344 toSci  1E+100000000 ->  Infinity Overflow Inexact Rounded
 
 maxexponent: 999999999
 minexponent: -999999999
-emax347 toSci  1E-1000000008     ->  0E-1000000007 Underflow Subnormal Inexact Rounded
+emax347 toSci  1E-1000000008     ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 emax348 toSci  1E-1000000007     ->  1E-1000000007 Subnormal
 emax349 toSci  1E-1000000000     ->  1E-1000000000 Subnormal
 emax350 toSci  1E-999999999      ->  1E-999999999
@@ -1103,7 +1201,7 @@ emax353 toSci  1.000E-1000000000 ->  1.000E-1000000000 Subnormal
 emax354 toSci  1.000E-999999999  ->  1.000E-999999999
 emax355 toSci  1.000E+999999999  ->  1.000E+999999999
 emax356 toSci  1.000E+1000000000 ->  Infinity Overflow Inexact Rounded
-emax357 toSci  1.001E-1000000008 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
+emax357 toSci  1.001E-1000000008 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 emax358 toSci  1.001E-1000000007 ->  1E-1000000007 Subnormal Inexact Rounded Underflow
 emax359 toSci  1.001E-1000000000 ->  1.001E-1000000000 Subnormal
 emax360 toSci  1.001E-999999999  ->  1.001E-999999999
@@ -1113,7 +1211,7 @@ emax363 toSci  9.000E-1000000000 ->  9.000E-1000000000 Subnormal
 emax364 toSci  9.000E-999999999  ->  9.000E-999999999
 emax365 toSci  9.000E+999999999  ->  9.000E+999999999
 emax366 toSci  9.000E+1000000000 ->  Infinity Overflow Inexact Rounded
-emax367 toSci  9.999E-1000000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
+emax367 toSci  9.999E-1000000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 emax368 toSci  9.999E-1000000008 ->  1E-1000000007 Underflow Subnormal Inexact Rounded
 emax369 toSci  9.999E-1000000007 ->  1.0E-1000000006 Underflow Subnormal Inexact Rounded
 emax370 toSci  9.999E-1000000000 ->  9.999E-1000000000 Subnormal
@@ -1129,11 +1227,11 @@ emax378 toSci -1.000E-1000000000 -> -1.000E-1000000000 Subnormal
 emax379 toSci -1.000E-999999999  -> -1.000E-999999999
 emax380 toSci -1.000E+999999999  -> -1.000E+999999999
 emax381 toSci -1.000E+1000000000 -> -Infinity Overflow Inexact Rounded
-emax382 toSci -1.001E-1000000008 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+emax382 toSci -1.001E-1000000008 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 emax383 toSci -1.001E-999999999  -> -1.001E-999999999
 emax384 toSci -1.001E+999999999  -> -1.001E+999999999
 emax385 toSci -1.001E+1000000000 -> -Infinity Overflow Inexact Rounded
-emax386 toSci -9.000E-1000000123 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+emax386 toSci -9.000E-1000000123 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 emax387 toSci -9.000E-999999999  -> -9.000E-999999999
 emax388 toSci -9.000E+999999999  -> -9.000E+999999999
 emax389 toSci -9.000E+1000000000 -> -Infinity Overflow Inexact Rounded
@@ -1168,11 +1266,11 @@ emax416 toSci  0.000249E-999   -> 2E-1003     Underflow Subnormal Inexact Rounde
 emax417 toSci  0.000250E-999   -> 2E-1003     Underflow Subnormal Inexact Rounded
 emax418 toSci  0.000251E-999   -> 3E-1003     Underflow Subnormal Inexact Rounded
 emax419 toSci  0.00009E-999    -> 1E-1003     Underflow Subnormal Inexact Rounded
-emax420 toSci  0.00005E-999    -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax421 toSci  0.00003E-999    -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax422 toSci  0.000009E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax423 toSci  0.000005E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax424 toSci  0.000003E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded
+emax420 toSci  0.00005E-999    -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax421 toSci  0.00003E-999    -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax422 toSci  0.000009E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax423 toSci  0.000005E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax424 toSci  0.000003E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
 
 emax425 toSci  0.001049E-999   -> 1.0E-1002   Underflow Subnormal Inexact Rounded
 emax426 toSci  0.001050E-999   -> 1.0E-1002   Underflow Subnormal Inexact Rounded
@@ -1223,9 +1321,9 @@ emax472 toSci  0.099999E-999       -> 1.000E-1000 Underflow Subnormal Inexact Ro
 emax473 toSci  0.0099999E-999      -> 1.00E-1001  Underflow Subnormal Inexact Rounded
 emax474 toSci  0.00099999E-999     -> 1.0E-1002   Underflow Subnormal Inexact Rounded
 emax475 toSci  0.000099999E-999    -> 1E-1003     Underflow Subnormal Inexact Rounded
-emax476 toSci  0.0000099999E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax477 toSci  0.00000099999E-999  -> 0E-1003     Underflow Subnormal Inexact Rounded
-emax478 toSci  0.000000099999E-999 -> 0E-1003     Underflow Subnormal Inexact Rounded
+emax476 toSci  0.0000099999E-999   -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax477 toSci  0.00000099999E-999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+emax478 toSci  0.000000099999E-999 -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
 
 -- Exponents with insignificant leading zeros
 precision:   16
@@ -1248,9 +1346,9 @@ basx1012 toSci  1e-000000000001000000007 -> 1E-1000000007 Subnormal
 basx1021 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded
 basx1022 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded
 basx1023 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded
-basx1024 tosci 1e-2147483647 -> 0E-1000000014 Underflow Subnormal Inexact Rounded
-basx1025 tosci 1e-2147483648 -> 0E-1000000014 Underflow Subnormal Inexact Rounded
-basx1026 tosci 1e-2147483649 -> 0E-1000000014 Underflow Subnormal Inexact Rounded
+basx1024 tosci 1e-2147483647 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
+basx1025 tosci 1e-2147483648 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
+basx1026 tosci 1e-2147483649 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
 -- same unbalanced
 precision:   7
 maxExponent: 96
@@ -1258,9 +1356,9 @@ minexponent: -95
 basx1031 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded
 basx1032 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded
 basx1033 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded
-basx1034 tosci 1e-2147483647 -> 0E-101 Underflow Subnormal Inexact Rounded
-basx1035 tosci 1e-2147483648 -> 0E-101 Underflow Subnormal Inexact Rounded
-basx1036 tosci 1e-2147483649 -> 0E-101 Underflow Subnormal Inexact Rounded
+basx1034 tosci 1e-2147483647 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+basx1035 tosci 1e-2147483648 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+basx1036 tosci 1e-2147483649 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
 
 -- check for double-rounded subnormals
 precision:   5
@@ -1270,3 +1368,44 @@ basx1041 toSci     1.52444E-80  ->  1.524E-80 Inexact Rounded Subnormal Underflo
 basx1042 toSci     1.52445E-80  ->  1.524E-80 Inexact Rounded Subnormal Underflow
 basx1043 toSci     1.52446E-80  ->  1.524E-80 Inexact Rounded Subnormal Underflow
 
+-- clamped zeros [see also clamp.decTest]
+precision:   34
+maxExponent: 6144
+minExponent: -6143
+
+basx1061 apply   0e+10000  ->  0E+6144 Clamped
+basx1062 apply   0e-10000  ->  0E-6176 Clamped
+basx1063 apply  -0e+10000  -> -0E+6144 Clamped
+basx1064 apply  -0e-10000  -> -0E-6176 Clamped
+
+precision:   16
+maxExponent: 384
+minExponent: -383
+
+basx1065 apply   0e+10000  ->  0E+384  Clamped
+basx1066 apply   0e-10000  ->  0E-398  Clamped
+basx1067 apply  -0e+10000  -> -0E+384  Clamped
+basx1068 apply  -0e-10000  -> -0E-398  Clamped
+
+-- same with IEEE clamping
+clamp:       1
+
+precision:   34
+maxExponent: 6144
+minExponent: -6143
+
+basx1071 apply   0e+10000  ->  0E+6111 Clamped
+basx1072 apply   0e-10000  ->  0E-6176 Clamped
+basx1073 apply  -0e+10000  -> -0E+6111 Clamped
+basx1074 apply  -0e-10000  -> -0E-6176 Clamped
+
+precision:   16
+maxExponent: 384
+minExponent: -383
+
+basx1075 apply   0e+10000  ->  0E+369  Clamped
+basx1076 apply   0e-10000  ->  0E-398  Clamped
+basx1077 apply  -0e+10000  -> -0E+369  Clamped
+basx1078 apply  -0e-10000  -> -0E-398  Clamped
+
+
index 722971ad8226feb36cecdd1e5f0b898cecdd392e..eca0cfb27767267a3f133d1eb076d10975eafab2 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- clamp.decTest -- clamped exponent tests (format-independent)       --
--- Copyright (c) IBM Corporation, 2000, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 2000, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- This set of tests uses the same limits as the 8-byte concrete
 -- representation, but applies clamping without using format-specific
@@ -73,10 +73,10 @@ clam092 apply   1.1e-398                -> #0000000000000001  Subnormal Underflo
 clam093 apply   1.00000000001e-398      -> #0000000000000001  Subnormal Underflow Inexact Rounded
 clam094 apply   1.00000000000001e-398   -> #0000000000000001  Subnormal Underflow Inexact Rounded
 clam095 apply   1.000000000000001e-398  -> #0000000000000001  Subnormal Underflow Inexact Rounded
-clam096 apply   0.1e-398                -> #0000000000000000  Subnormal Underflow Inexact Rounded
-clam097 apply   0.00000000001e-398      -> #0000000000000000  Subnormal Underflow Inexact Rounded
-clam098 apply   0.00000000000001e-398   -> #0000000000000000  Subnormal Underflow Inexact Rounded
-clam099 apply   0.000000000000001e-398  -> #0000000000000000  Subnormal Underflow Inexact Rounded
+clam096 apply   0.1e-398                -> #0000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam097 apply   0.00000000001e-398      -> #0000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam098 apply   0.00000000000001e-398   -> #0000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam099 apply   0.000000000000001e-398  -> #0000000000000000  Subnormal Underflow Inexact Rounded Clamped
 
 -- Same again, negatives
 -- Nmax and similar
@@ -112,10 +112,10 @@ clam192 apply   -1.1e-398               -> #8000000000000001  Subnormal Underflo
 clam193 apply   -1.00000000001e-398     -> #8000000000000001  Subnormal Underflow Inexact Rounded
 clam194 apply   -1.00000000000001e-398  -> #8000000000000001  Subnormal Underflow Inexact Rounded
 clam195 apply   -1.000000000000001e-398 -> #8000000000000001  Subnormal Underflow Inexact Rounded
-clam196 apply   -0.1e-398               -> #8000000000000000  Subnormal Underflow Inexact Rounded
-clam197 apply   -0.00000000001e-398     -> #8000000000000000  Subnormal Underflow Inexact Rounded
-clam198 apply   -0.00000000000001e-398  -> #8000000000000000  Subnormal Underflow Inexact Rounded
-clam199 apply   -0.000000000000001e-398 -> #8000000000000000  Subnormal Underflow Inexact Rounded
+clam196 apply   -0.1e-398               -> #8000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam197 apply   -0.00000000001e-398     -> #8000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam198 apply   -0.00000000000001e-398  -> #8000000000000000  Subnormal Underflow Inexact Rounded Clamped
+clam199 apply   -0.000000000000001e-398 -> #8000000000000000  Subnormal Underflow Inexact Rounded Clamped
 
 -- zeros
 clam401 apply   0E-500                  -> 0E-398  Clamped
@@ -184,6 +184,20 @@ clam669 apply   9E+370                  -> 9.0E+370 Clamped
 clam671 apply   9E+369                  -> 9E+369
 clam673 apply   9E+368                  -> 9E+368
 
+-- subnormals clamped to 0-Etiny
+precision:   16
+maxExponent: 384
+minExponent: -383
+clam681 apply 7E-398     -> 7E-398 Subnormal
+clam682 apply 0E-398     -> 0E-398
+clam683 apply 7E-399     -> 1E-398 Subnormal Underflow Inexact Rounded
+clam684 apply 4E-399     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+clam685 apply 7E-400     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+clam686 apply 7E-401     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+clam687 apply 0E-399     -> 0E-398 Clamped
+clam688 apply 0E-400     -> 0E-398 Clamped
+clam689 apply 0E-401     -> 0E-398 Clamped
+
 -- example from documentation
 precision:   7
 rounding:    half_even
diff --git a/Lib/test/decimaltestdata/class.decTest b/Lib/test/decimaltestdata/class.decTest
new file mode 100644 (file)
index 0000000..77a22e3
--- /dev/null
@@ -0,0 +1,131 @@
+------------------------------------------------------------------------\r
+-- class.decTest -- Class operations                                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- [New 2006.11.27]\r
+\r
+precision:   9\r
+maxExponent: 999\r
+minExponent: -999\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+clasx001  class    0                        -> +Zero\r
+clasx002  class    0.00                     -> +Zero\r
+clasx003  class    0E+5                     -> +Zero\r
+clasx004  class    1E-1007                  -> +Subnormal\r
+clasx005  class  0.1E-999                   -> +Subnormal\r
+clasx006  class  0.99999999E-999            -> +Subnormal\r
+clasx007  class  1.00000000E-999            -> +Normal\r
+clasx008  class   1E-999                    -> +Normal\r
+clasx009  class   1E-100                    -> +Normal\r
+clasx010  class   1E-10                     -> +Normal\r
+clasx012  class   1E-1                      -> +Normal\r
+clasx013  class   1                         -> +Normal\r
+clasx014  class   2.50                      -> +Normal\r
+clasx015  class   100.100                   -> +Normal\r
+clasx016  class   1E+30                     -> +Normal\r
+clasx017  class   1E+999                    -> +Normal\r
+clasx018  class   9.99999999E+999           -> +Normal\r
+clasx019  class   Inf                       -> +Infinity\r
+\r
+clasx021  class   -0                        -> -Zero\r
+clasx022  class   -0.00                     -> -Zero\r
+clasx023  class   -0E+5                     -> -Zero\r
+clasx024  class   -1E-1007                  -> -Subnormal\r
+clasx025  class  -0.1E-999                  -> -Subnormal\r
+clasx026  class  -0.99999999E-999           -> -Subnormal\r
+clasx027  class  -1.00000000E-999           -> -Normal\r
+clasx028  class  -1E-999                    -> -Normal\r
+clasx029  class  -1E-100                    -> -Normal\r
+clasx030  class  -1E-10                     -> -Normal\r
+clasx032  class  -1E-1                      -> -Normal\r
+clasx033  class  -1                         -> -Normal\r
+clasx034  class  -2.50                      -> -Normal\r
+clasx035  class  -100.100                   -> -Normal\r
+clasx036  class  -1E+30                     -> -Normal\r
+clasx037  class  -1E+999                    -> -Normal\r
+clasx038  class  -9.99999999E+999           -> -Normal\r
+clasx039  class  -Inf                       -> -Infinity\r
+\r
+clasx041  class   NaN                       -> NaN\r
+clasx042  class  -NaN                       -> NaN\r
+clasx043  class  +NaN12345                  -> NaN\r
+clasx044  class   sNaN                      -> sNaN\r
+clasx045  class  -sNaN                      -> sNaN\r
+clasx046  class  +sNaN12345                 -> sNaN\r
+\r
+\r
+-- decimal64 bounds\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+clasx201  class    0                        -> +Zero\r
+clasx202  class    0.00                     -> +Zero\r
+clasx203  class    0E+5                     -> +Zero\r
+clasx204  class    1E-396                   -> +Subnormal\r
+clasx205  class  0.1E-383                   -> +Subnormal\r
+clasx206  class  0.999999999999999E-383     -> +Subnormal\r
+clasx207  class  1.000000000000000E-383     -> +Normal\r
+clasx208  class   1E-383                    -> +Normal\r
+clasx209  class   1E-100                    -> +Normal\r
+clasx210  class   1E-10                     -> +Normal\r
+clasx212  class   1E-1                      -> +Normal\r
+clasx213  class   1                         -> +Normal\r
+clasx214  class   2.50                      -> +Normal\r
+clasx215  class   100.100                   -> +Normal\r
+clasx216  class   1E+30                     -> +Normal\r
+clasx217  class   1E+384                    -> +Normal\r
+clasx218  class   9.999999999999999E+384    -> +Normal\r
+clasx219  class   Inf                       -> +Infinity\r
+\r
+clasx221  class   -0                        -> -Zero\r
+clasx222  class   -0.00                     -> -Zero\r
+clasx223  class   -0E+5                     -> -Zero\r
+clasx224  class   -1E-396                   -> -Subnormal\r
+clasx225  class  -0.1E-383                  -> -Subnormal\r
+clasx226  class  -0.999999999999999E-383    -> -Subnormal\r
+clasx227  class  -1.000000000000000E-383    -> -Normal\r
+clasx228  class  -1E-383                    -> -Normal\r
+clasx229  class  -1E-100                    -> -Normal\r
+clasx230  class  -1E-10                     -> -Normal\r
+clasx232  class  -1E-1                      -> -Normal\r
+clasx233  class  -1                         -> -Normal\r
+clasx234  class  -2.50                      -> -Normal\r
+clasx235  class  -100.100                   -> -Normal\r
+clasx236  class  -1E+30                     -> -Normal\r
+clasx237  class  -1E+384                    -> -Normal\r
+clasx238  class  -9.999999999999999E+384    -> -Normal\r
+clasx239  class  -Inf                       -> -Infinity\r
+\r
+clasx241  class   NaN                       -> NaN\r
+clasx242  class  -NaN                       -> NaN\r
+clasx243  class  +NaN12345                  -> NaN\r
+clasx244  class   sNaN                      -> sNaN\r
+clasx245  class  -sNaN                      -> sNaN\r
+clasx246  class  +sNaN12345                 -> sNaN\r
+\r
+\r
+\r
index 21651ad0a3c650305a605c1ccca2a3422c6a9b0e..2d5e664076d5978377f2e8265cec75f99b4eeb79 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
--- compare.decTest -- decimal comparison                              --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- compare.decTest -- decimal comparison that allows quiet NaNs       --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- Note that we cannot assume add/subtract tests cover paths adequately,
 -- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necesary).
+-- overflow or underflow, so actual subtractions are not necessary).
 
 extended: 1
 
@@ -112,10 +112,10 @@ comx086 compare   2.0   2.0  -> 0
 -- now some cases which might overflow if subtract were used
 maxexponent: 999999999
 minexponent: -999999999
-comx090 compare  9.99999999E+999999999 9.99999999E+999999999  -> 0
-comx091 compare -9.99999999E+999999999 9.99999999E+999999999  -> -1
-comx092 compare  9.99999999E+999999999 -9.99999999E+999999999 -> 1
-comx093 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0
+comx095 compare  9.99999999E+999999999 9.99999999E+999999999  -> 0
+comx096 compare -9.99999999E+999999999 9.99999999E+999999999  -> -1
+comx097 compare  9.99999999E+999999999 -9.99999999E+999999999 -> 1
+comx098 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0
 
 -- some differing length/exponent cases
 comx100 compare   7.0    7.0    -> 0
@@ -265,6 +265,21 @@ comx448 compare   -8.0    -90E-1  -> 1
 comx449 compare   -8      -.9E+1  -> 1
 comx450 compare   -8      -90E-1  -> 1
 
+-- misalignment traps for little-endian
+comx451 compare      1.0       0.1  -> 1
+comx452 compare      0.1       1.0  -> -1
+comx453 compare     10.0       0.1  -> 1
+comx454 compare      0.1      10.0  -> -1
+comx455 compare      100       1.0  -> 1
+comx456 compare      1.0       100  -> -1
+comx457 compare     1000      10.0  -> 1
+comx458 compare     10.0      1000  -> -1
+comx459 compare    10000     100.0  -> 1
+comx460 compare    100.0     10000  -> -1
+comx461 compare   100000    1000.0  -> 1
+comx462 compare   1000.0    100000  -> -1
+comx463 compare  1000000   10000.0  -> 1
+comx464 compare  10000.0   1000000  -> -1
 
 -- testcases that subtract to lots of zeros at boundaries [pgr]
 precision: 40
@@ -362,7 +377,7 @@ comx568 compare    1E+12  1       ->  1
 comx569 compare    1E+13  1       ->  1
 comx570 compare    1E+14  1       ->  1
 comx571 compare    1E+15  1       ->  1
--- similar with an useful coefficient, one side only
+-- similar with a useful coefficient, one side only
 comx580 compare  0.000000987654321     1E-15    -> 1
 comx581 compare  0.000000987654321     1E-14    -> 1
 comx582 compare  0.000000987654321     1E-13    -> 1
@@ -712,6 +727,32 @@ comx906 compare  1e-777777777 -1e-411111111 ->  1
 comx907 compare -1e-777777777  1e-411111111 -> -1
 comx908 compare -1e-777777777 -1e-411111111 ->  1
 
+-- spread zeros
+comx910 compare   0E-383  0       ->  0
+comx911 compare   0E-383 -0       ->  0
+comx912 compare  -0E-383  0       ->  0
+comx913 compare  -0E-383 -0       ->  0
+comx914 compare   0E-383  0E+384  ->  0
+comx915 compare   0E-383 -0E+384  ->  0
+comx916 compare  -0E-383  0E+384  ->  0
+comx917 compare  -0E-383 -0E+384  ->  0
+comx918 compare   0       0E+384  ->  0
+comx919 compare   0      -0E+384  ->  0
+comx920 compare  -0       0E+384  ->  0
+comx921 compare  -0      -0E+384  ->  0
+comx930 compare   0E+384  0       ->  0
+comx931 compare   0E+384 -0       ->  0
+comx932 compare  -0E+384  0       ->  0
+comx933 compare  -0E+384 -0       ->  0
+comx934 compare   0E+384  0E-383  ->  0
+comx935 compare   0E+384 -0E-383  ->  0
+comx936 compare  -0E+384  0E-383  ->  0
+comx937 compare  -0E+384 -0E-383  ->  0
+comx938 compare   0       0E-383  ->  0
+comx939 compare   0      -0E-383  ->  0
+comx940 compare  -0       0E-383  ->  0
+comx941 compare  -0      -0E-383  ->  0
+
 -- Null tests
 comx990 compare 10  # -> NaN Invalid_operation
 comx991 compare  # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/comparetotal.decTest b/Lib/test/decimaltestdata/comparetotal.decTest
new file mode 100644 (file)
index 0000000..737293f
--- /dev/null
@@ -0,0 +1,798 @@
+------------------------------------------------------------------------\r
+-- comparetotal.decTest -- decimal comparison using total ordering    --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+-- Similarly, comparetotal will have some radically different paths\r
+-- than compare.\r
+\r
+extended:    1\r
+precision:   16\r
+rounding:    half_up\r
+maxExponent: 384\r
+minExponent: -383\r
+\r
+-- sanity checks\r
+cotx001 comparetotal  -2  -2  -> 0\r
+cotx002 comparetotal  -2  -1  -> -1\r
+cotx003 comparetotal  -2   0  -> -1\r
+cotx004 comparetotal  -2   1  -> -1\r
+cotx005 comparetotal  -2   2  -> -1\r
+cotx006 comparetotal  -1  -2  -> 1\r
+cotx007 comparetotal  -1  -1  -> 0\r
+cotx008 comparetotal  -1   0  -> -1\r
+cotx009 comparetotal  -1   1  -> -1\r
+cotx010 comparetotal  -1   2  -> -1\r
+cotx011 comparetotal   0  -2  -> 1\r
+cotx012 comparetotal   0  -1  -> 1\r
+cotx013 comparetotal   0   0  -> 0\r
+cotx014 comparetotal   0   1  -> -1\r
+cotx015 comparetotal   0   2  -> -1\r
+cotx016 comparetotal   1  -2  -> 1\r
+cotx017 comparetotal   1  -1  -> 1\r
+cotx018 comparetotal   1   0  -> 1\r
+cotx019 comparetotal   1   1  -> 0\r
+cotx020 comparetotal   1   2  -> -1\r
+cotx021 comparetotal   2  -2  -> 1\r
+cotx022 comparetotal   2  -1  -> 1\r
+cotx023 comparetotal   2   0  -> 1\r
+cotx025 comparetotal   2   1  -> 1\r
+cotx026 comparetotal   2   2  -> 0\r
+\r
+cotx031 comparetotal  -20  -20  -> 0\r
+cotx032 comparetotal  -20  -10  -> -1\r
+cotx033 comparetotal  -20   00  -> -1\r
+cotx034 comparetotal  -20   10  -> -1\r
+cotx035 comparetotal  -20   20  -> -1\r
+cotx036 comparetotal  -10  -20  -> 1\r
+cotx037 comparetotal  -10  -10  -> 0\r
+cotx038 comparetotal  -10   00  -> -1\r
+cotx039 comparetotal  -10   10  -> -1\r
+cotx040 comparetotal  -10   20  -> -1\r
+cotx041 comparetotal   00  -20  -> 1\r
+cotx042 comparetotal   00  -10  -> 1\r
+cotx043 comparetotal   00   00  -> 0\r
+cotx044 comparetotal   00   10  -> -1\r
+cotx045 comparetotal   00   20  -> -1\r
+cotx046 comparetotal   10  -20  -> 1\r
+cotx047 comparetotal   10  -10  -> 1\r
+cotx048 comparetotal   10   00  -> 1\r
+cotx049 comparetotal   10   10  -> 0\r
+cotx050 comparetotal   10   20  -> -1\r
+cotx051 comparetotal   20  -20  -> 1\r
+cotx052 comparetotal   20  -10  -> 1\r
+cotx053 comparetotal   20   00  -> 1\r
+cotx055 comparetotal   20   10  -> 1\r
+cotx056 comparetotal   20   20  -> 0\r
+\r
+cotx061 comparetotal  -2.0  -2.0  -> 0\r
+cotx062 comparetotal  -2.0  -1.0  -> -1\r
+cotx063 comparetotal  -2.0   0.0  -> -1\r
+cotx064 comparetotal  -2.0   1.0  -> -1\r
+cotx065 comparetotal  -2.0   2.0  -> -1\r
+cotx066 comparetotal  -1.0  -2.0  -> 1\r
+cotx067 comparetotal  -1.0  -1.0  -> 0\r
+cotx068 comparetotal  -1.0   0.0  -> -1\r
+cotx069 comparetotal  -1.0   1.0  -> -1\r
+cotx070 comparetotal  -1.0   2.0  -> -1\r
+cotx071 comparetotal   0.0  -2.0  -> 1\r
+cotx072 comparetotal   0.0  -1.0  -> 1\r
+cotx073 comparetotal   0.0   0.0  -> 0\r
+cotx074 comparetotal   0.0   1.0  -> -1\r
+cotx075 comparetotal   0.0   2.0  -> -1\r
+cotx076 comparetotal   1.0  -2.0  -> 1\r
+cotx077 comparetotal   1.0  -1.0  -> 1\r
+cotx078 comparetotal   1.0   0.0  -> 1\r
+cotx079 comparetotal   1.0   1.0  -> 0\r
+cotx080 comparetotal   1.0   2.0  -> -1\r
+cotx081 comparetotal   2.0  -2.0  -> 1\r
+cotx082 comparetotal   2.0  -1.0  -> 1\r
+cotx083 comparetotal   2.0   0.0  -> 1\r
+cotx085 comparetotal   2.0   1.0  -> 1\r
+cotx086 comparetotal   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+cotx090 comparetotal  9.99999999E+999999999 9.99999999E+999999999  -> 0\r
+cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999  -> -1\r
+cotx092 comparetotal  9.99999999E+999999999 -9.99999999E+999999999 -> 1\r
+cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0\r
+\r
+-- Examples\r
+cotx094 comparetotal  12.73  127.9  -> -1\r
+cotx095 comparetotal  -127   12     -> -1\r
+cotx096 comparetotal  12.30  12.3   -> -1\r
+cotx097 comparetotal  12.30  12.30  ->  0\r
+cotx098 comparetotal  12.3   12.300 ->  1\r
+cotx099 comparetotal  12.3   NaN    -> -1\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+cotx100 comparetotal   7.0    7.0    -> 0\r
+cotx101 comparetotal   7.0    7      -> -1\r
+cotx102 comparetotal   7      7.0    -> 1\r
+cotx103 comparetotal   7E+0   7.0    -> 1\r
+cotx104 comparetotal   70E-1  7.0    -> 0\r
+cotx105 comparetotal   0.7E+1 7      -> 0\r
+cotx106 comparetotal   70E-1  7      -> -1\r
+cotx107 comparetotal   7.0    7E+0   -> -1\r
+cotx108 comparetotal   7.0    70E-1  -> 0\r
+cotx109 comparetotal   7      0.7E+1 -> 0\r
+cotx110 comparetotal   7      70E-1  -> 1\r
+\r
+cotx120 comparetotal   8.0    7.0    -> 1\r
+cotx121 comparetotal   8.0    7      -> 1\r
+cotx122 comparetotal   8      7.0    -> 1\r
+cotx123 comparetotal   8E+0   7.0    -> 1\r
+cotx124 comparetotal   80E-1  7.0    -> 1\r
+cotx125 comparetotal   0.8E+1 7      -> 1\r
+cotx126 comparetotal   80E-1  7      -> 1\r
+cotx127 comparetotal   8.0    7E+0   -> 1\r
+cotx128 comparetotal   8.0    70E-1  -> 1\r
+cotx129 comparetotal   8      0.7E+1  -> 1\r
+cotx130 comparetotal   8      70E-1  -> 1\r
+\r
+cotx140 comparetotal   8.0    9.0    -> -1\r
+cotx141 comparetotal   8.0    9      -> -1\r
+cotx142 comparetotal   8      9.0    -> -1\r
+cotx143 comparetotal   8E+0   9.0    -> -1\r
+cotx144 comparetotal   80E-1  9.0    -> -1\r
+cotx145 comparetotal   0.8E+1 9      -> -1\r
+cotx146 comparetotal   80E-1  9      -> -1\r
+cotx147 comparetotal   8.0    9E+0   -> -1\r
+cotx148 comparetotal   8.0    90E-1  -> -1\r
+cotx149 comparetotal   8      0.9E+1 -> -1\r
+cotx150 comparetotal   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+cotx200 comparetotal  -7.0    7.0    -> -1\r
+cotx201 comparetotal  -7.0    7      -> -1\r
+cotx202 comparetotal  -7      7.0    -> -1\r
+cotx203 comparetotal  -7E+0   7.0    -> -1\r
+cotx204 comparetotal  -70E-1  7.0    -> -1\r
+cotx205 comparetotal  -0.7E+1 7      -> -1\r
+cotx206 comparetotal  -70E-1  7      -> -1\r
+cotx207 comparetotal  -7.0    7E+0   -> -1\r
+cotx208 comparetotal  -7.0    70E-1  -> -1\r
+cotx209 comparetotal  -7      0.7E+1 -> -1\r
+cotx210 comparetotal  -7      70E-1  -> -1\r
+\r
+cotx220 comparetotal  -8.0    7.0    -> -1\r
+cotx221 comparetotal  -8.0    7      -> -1\r
+cotx222 comparetotal  -8      7.0    -> -1\r
+cotx223 comparetotal  -8E+0   7.0    -> -1\r
+cotx224 comparetotal  -80E-1  7.0    -> -1\r
+cotx225 comparetotal  -0.8E+1 7      -> -1\r
+cotx226 comparetotal  -80E-1  7      -> -1\r
+cotx227 comparetotal  -8.0    7E+0   -> -1\r
+cotx228 comparetotal  -8.0    70E-1  -> -1\r
+cotx229 comparetotal  -8      0.7E+1 -> -1\r
+cotx230 comparetotal  -8      70E-1  -> -1\r
+\r
+cotx240 comparetotal  -8.0    9.0    -> -1\r
+cotx241 comparetotal  -8.0    9      -> -1\r
+cotx242 comparetotal  -8      9.0    -> -1\r
+cotx243 comparetotal  -8E+0   9.0    -> -1\r
+cotx244 comparetotal  -80E-1  9.0    -> -1\r
+cotx245 comparetotal  -0.8E+1 9      -> -1\r
+cotx246 comparetotal  -80E-1  9      -> -1\r
+cotx247 comparetotal  -8.0    9E+0   -> -1\r
+cotx248 comparetotal  -8.0    90E-1  -> -1\r
+cotx249 comparetotal  -8      0.9E+1 -> -1\r
+cotx250 comparetotal  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+cotx300 comparetotal   7.0    -7.0    -> 1\r
+cotx301 comparetotal   7.0    -7      -> 1\r
+cotx302 comparetotal   7      -7.0    -> 1\r
+cotx303 comparetotal   7E+0   -7.0    -> 1\r
+cotx304 comparetotal   70E-1  -7.0    -> 1\r
+cotx305 comparetotal   .7E+1  -7      -> 1\r
+cotx306 comparetotal   70E-1  -7      -> 1\r
+cotx307 comparetotal   7.0    -7E+0   -> 1\r
+cotx308 comparetotal   7.0    -70E-1  -> 1\r
+cotx309 comparetotal   7      -.7E+1  -> 1\r
+cotx310 comparetotal   7      -70E-1  -> 1\r
+\r
+cotx320 comparetotal   8.0    -7.0    -> 1\r
+cotx321 comparetotal   8.0    -7      -> 1\r
+cotx322 comparetotal   8      -7.0    -> 1\r
+cotx323 comparetotal   8E+0   -7.0    -> 1\r
+cotx324 comparetotal   80E-1  -7.0    -> 1\r
+cotx325 comparetotal   .8E+1  -7      -> 1\r
+cotx326 comparetotal   80E-1  -7      -> 1\r
+cotx327 comparetotal   8.0    -7E+0   -> 1\r
+cotx328 comparetotal   8.0    -70E-1  -> 1\r
+cotx329 comparetotal   8      -.7E+1  -> 1\r
+cotx330 comparetotal   8      -70E-1  -> 1\r
+\r
+cotx340 comparetotal   8.0    -9.0    -> 1\r
+cotx341 comparetotal   8.0    -9      -> 1\r
+cotx342 comparetotal   8      -9.0    -> 1\r
+cotx343 comparetotal   8E+0   -9.0    -> 1\r
+cotx344 comparetotal   80E-1  -9.0    -> 1\r
+cotx345 comparetotal   .8E+1  -9      -> 1\r
+cotx346 comparetotal   80E-1  -9      -> 1\r
+cotx347 comparetotal   8.0    -9E+0   -> 1\r
+cotx348 comparetotal   8.0    -90E-1  -> 1\r
+cotx349 comparetotal   8      -.9E+1  -> 1\r
+cotx350 comparetotal   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+cotx400 comparetotal   -7.0    -7.0    -> 0\r
+cotx401 comparetotal   -7.0    -7      -> 1\r
+cotx402 comparetotal   -7      -7.0    -> -1\r
+cotx403 comparetotal   -7E+0   -7.0    -> -1\r
+cotx404 comparetotal   -70E-1  -7.0    -> 0\r
+cotx405 comparetotal   -.7E+1  -7      -> 0\r
+cotx406 comparetotal   -70E-1  -7      -> 1\r
+cotx407 comparetotal   -7.0    -7E+0   -> 1\r
+cotx408 comparetotal   -7.0    -70E-1  -> 0\r
+cotx409 comparetotal   -7      -.7E+1  -> 0\r
+cotx410 comparetotal   -7      -70E-1  -> -1\r
+\r
+cotx420 comparetotal   -8.0    -7.0    -> -1\r
+cotx421 comparetotal   -8.0    -7      -> -1\r
+cotx422 comparetotal   -8      -7.0    -> -1\r
+cotx423 comparetotal   -8E+0   -7.0    -> -1\r
+cotx424 comparetotal   -80E-1  -7.0    -> -1\r
+cotx425 comparetotal   -.8E+1  -7      -> -1\r
+cotx426 comparetotal   -80E-1  -7      -> -1\r
+cotx427 comparetotal   -8.0    -7E+0   -> -1\r
+cotx428 comparetotal   -8.0    -70E-1  -> -1\r
+cotx429 comparetotal   -8      -.7E+1  -> -1\r
+cotx430 comparetotal   -8      -70E-1  -> -1\r
+\r
+cotx440 comparetotal   -8.0    -9.0    -> 1\r
+cotx441 comparetotal   -8.0    -9      -> 1\r
+cotx442 comparetotal   -8      -9.0    -> 1\r
+cotx443 comparetotal   -8E+0   -9.0    -> 1\r
+cotx444 comparetotal   -80E-1  -9.0    -> 1\r
+cotx445 comparetotal   -.8E+1  -9      -> 1\r
+cotx446 comparetotal   -80E-1  -9      -> 1\r
+cotx447 comparetotal   -8.0    -9E+0   -> 1\r
+cotx448 comparetotal   -8.0    -90E-1  -> 1\r
+cotx449 comparetotal   -8      -.9E+1  -> 1\r
+cotx450 comparetotal   -8      -90E-1  -> 1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+precision: 40\r
+cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1\r
+cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1\r
+cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1\r
+cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1\r
+cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1\r
+cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1\r
+cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1\r
+cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1\r
+cotx478 comparetotal 123.45600000E789 123.456E789 -> -1\r
+cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1\r
+cotx480 comparetotal 123.456000E789 123.456E789 -> -1\r
+cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1\r
+cotx482 comparetotal 123.4560E789 123.456E789 -> -1\r
+cotx483 comparetotal 123.456E-89 123.456E-89 -> 0\r
+cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1\r
+cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1\r
+cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1\r
+cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1\r
+cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1\r
+cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1\r
+cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1\r
+cotx491 comparetotal 123.456E789 123.456000000E789 -> 1\r
+cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1\r
+cotx493 comparetotal 123.456E789 123.4560000E789 -> 1\r
+cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1\r
+cotx495 comparetotal 123.456E789 123.45600E789 -> 1\r
+cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1\r
+cotx497 comparetotal 123.456E789 123.456E789 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+precision: 9\r
+cotx500 comparetotal    1     1E-15    -> 1\r
+cotx501 comparetotal    1     1E-14    -> 1\r
+cotx502 comparetotal    1     1E-13    -> 1\r
+cotx503 comparetotal    1     1E-12    -> 1\r
+cotx504 comparetotal    1     1E-11    -> 1\r
+cotx505 comparetotal    1     1E-10    -> 1\r
+cotx506 comparetotal    1     1E-9     -> 1\r
+cotx507 comparetotal    1     1E-8     -> 1\r
+cotx508 comparetotal    1     1E-7     -> 1\r
+cotx509 comparetotal    1     1E-6     -> 1\r
+cotx510 comparetotal    1     1E-5     -> 1\r
+cotx511 comparetotal    1     1E-4     -> 1\r
+cotx512 comparetotal    1     1E-3     -> 1\r
+cotx513 comparetotal    1     1E-2     -> 1\r
+cotx514 comparetotal    1     1E-1     -> 1\r
+cotx515 comparetotal    1     1E-0     -> 0\r
+cotx516 comparetotal    1     1E+1     -> -1\r
+cotx517 comparetotal    1     1E+2     -> -1\r
+cotx518 comparetotal    1     1E+3     -> -1\r
+cotx519 comparetotal    1     1E+4     -> -1\r
+cotx521 comparetotal    1     1E+5     -> -1\r
+cotx522 comparetotal    1     1E+6     -> -1\r
+cotx523 comparetotal    1     1E+7     -> -1\r
+cotx524 comparetotal    1     1E+8     -> -1\r
+cotx525 comparetotal    1     1E+9     -> -1\r
+cotx526 comparetotal    1     1E+10    -> -1\r
+cotx527 comparetotal    1     1E+11    -> -1\r
+cotx528 comparetotal    1     1E+12    -> -1\r
+cotx529 comparetotal    1     1E+13    -> -1\r
+cotx530 comparetotal    1     1E+14    -> -1\r
+cotx531 comparetotal    1     1E+15    -> -1\r
+-- LR swap\r
+cotx540 comparetotal    1E-15  1       -> -1\r
+cotx541 comparetotal    1E-14  1       -> -1\r
+cotx542 comparetotal    1E-13  1       -> -1\r
+cotx543 comparetotal    1E-12  1       -> -1\r
+cotx544 comparetotal    1E-11  1       -> -1\r
+cotx545 comparetotal    1E-10  1       -> -1\r
+cotx546 comparetotal    1E-9   1       -> -1\r
+cotx547 comparetotal    1E-8   1       -> -1\r
+cotx548 comparetotal    1E-7   1       -> -1\r
+cotx549 comparetotal    1E-6   1       -> -1\r
+cotx550 comparetotal    1E-5   1       -> -1\r
+cotx551 comparetotal    1E-4   1       -> -1\r
+cotx552 comparetotal    1E-3   1       -> -1\r
+cotx553 comparetotal    1E-2   1       -> -1\r
+cotx554 comparetotal    1E-1   1       -> -1\r
+cotx555 comparetotal    1E-0   1       ->  0\r
+cotx556 comparetotal    1E+1   1       ->  1\r
+cotx557 comparetotal    1E+2   1       ->  1\r
+cotx558 comparetotal    1E+3   1       ->  1\r
+cotx559 comparetotal    1E+4   1       ->  1\r
+cotx561 comparetotal    1E+5   1       ->  1\r
+cotx562 comparetotal    1E+6   1       ->  1\r
+cotx563 comparetotal    1E+7   1       ->  1\r
+cotx564 comparetotal    1E+8   1       ->  1\r
+cotx565 comparetotal    1E+9   1       ->  1\r
+cotx566 comparetotal    1E+10  1       ->  1\r
+cotx567 comparetotal    1E+11  1       ->  1\r
+cotx568 comparetotal    1E+12  1       ->  1\r
+cotx569 comparetotal    1E+13  1       ->  1\r
+cotx570 comparetotal    1E+14  1       ->  1\r
+cotx571 comparetotal    1E+15  1       ->  1\r
+-- similar with an useful coefficient, one side only\r
+cotx580 comparetotal  0.000000987654321     1E-15    -> 1\r
+cotx581 comparetotal  0.000000987654321     1E-14    -> 1\r
+cotx582 comparetotal  0.000000987654321     1E-13    -> 1\r
+cotx583 comparetotal  0.000000987654321     1E-12    -> 1\r
+cotx584 comparetotal  0.000000987654321     1E-11    -> 1\r
+cotx585 comparetotal  0.000000987654321     1E-10    -> 1\r
+cotx586 comparetotal  0.000000987654321     1E-9     -> 1\r
+cotx587 comparetotal  0.000000987654321     1E-8     -> 1\r
+cotx588 comparetotal  0.000000987654321     1E-7     -> 1\r
+cotx589 comparetotal  0.000000987654321     1E-6     -> -1\r
+cotx590 comparetotal  0.000000987654321     1E-5     -> -1\r
+cotx591 comparetotal  0.000000987654321     1E-4     -> -1\r
+cotx592 comparetotal  0.000000987654321     1E-3     -> -1\r
+cotx593 comparetotal  0.000000987654321     1E-2     -> -1\r
+cotx594 comparetotal  0.000000987654321     1E-1     -> -1\r
+cotx595 comparetotal  0.000000987654321     1E-0     -> -1\r
+cotx596 comparetotal  0.000000987654321     1E+1     -> -1\r
+cotx597 comparetotal  0.000000987654321     1E+2     -> -1\r
+cotx598 comparetotal  0.000000987654321     1E+3     -> -1\r
+cotx599 comparetotal  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+precision: 20\r
+cotx600 comparetotal   12            12.2345 -> -1\r
+cotx601 comparetotal   12.0          12.2345 -> -1\r
+cotx602 comparetotal   12.00         12.2345 -> -1\r
+cotx603 comparetotal   12.000        12.2345 -> -1\r
+cotx604 comparetotal   12.0000       12.2345 -> -1\r
+cotx605 comparetotal   12.00000      12.2345 -> -1\r
+cotx606 comparetotal   12.000000     12.2345 -> -1\r
+cotx607 comparetotal   12.0000000    12.2345 -> -1\r
+cotx608 comparetotal   12.00000000   12.2345 -> -1\r
+cotx609 comparetotal   12.000000000  12.2345 -> -1\r
+cotx610 comparetotal   12.1234 12            ->  1\r
+cotx611 comparetotal   12.1234 12.0          ->  1\r
+cotx612 comparetotal   12.1234 12.00         ->  1\r
+cotx613 comparetotal   12.1234 12.000        ->  1\r
+cotx614 comparetotal   12.1234 12.0000       ->  1\r
+cotx615 comparetotal   12.1234 12.00000      ->  1\r
+cotx616 comparetotal   12.1234 12.000000     ->  1\r
+cotx617 comparetotal   12.1234 12.0000000    ->  1\r
+cotx618 comparetotal   12.1234 12.00000000   ->  1\r
+cotx619 comparetotal   12.1234 12.000000000  ->  1\r
+cotx620 comparetotal  -12           -12.2345 ->  1\r
+cotx621 comparetotal  -12.0         -12.2345 ->  1\r
+cotx622 comparetotal  -12.00        -12.2345 ->  1\r
+cotx623 comparetotal  -12.000       -12.2345 ->  1\r
+cotx624 comparetotal  -12.0000      -12.2345 ->  1\r
+cotx625 comparetotal  -12.00000     -12.2345 ->  1\r
+cotx626 comparetotal  -12.000000    -12.2345 ->  1\r
+cotx627 comparetotal  -12.0000000   -12.2345 ->  1\r
+cotx628 comparetotal  -12.00000000  -12.2345 ->  1\r
+cotx629 comparetotal  -12.000000000 -12.2345 ->  1\r
+cotx630 comparetotal  -12.1234 -12           -> -1\r
+cotx631 comparetotal  -12.1234 -12.0         -> -1\r
+cotx632 comparetotal  -12.1234 -12.00        -> -1\r
+cotx633 comparetotal  -12.1234 -12.000       -> -1\r
+cotx634 comparetotal  -12.1234 -12.0000      -> -1\r
+cotx635 comparetotal  -12.1234 -12.00000     -> -1\r
+cotx636 comparetotal  -12.1234 -12.000000    -> -1\r
+cotx637 comparetotal  -12.1234 -12.0000000   -> -1\r
+cotx638 comparetotal  -12.1234 -12.00000000  -> -1\r
+cotx639 comparetotal  -12.1234 -12.000000000 -> -1\r
+precision: 9\r
+\r
+-- extended zeros\r
+cotx640 comparetotal   0     0   -> 0\r
+cotx641 comparetotal   0    -0   -> 1\r
+cotx642 comparetotal   0    -0.0 -> 1\r
+cotx643 comparetotal   0     0.0 -> 1\r
+cotx644 comparetotal  -0     0   -> -1\r
+cotx645 comparetotal  -0    -0   -> 0\r
+cotx646 comparetotal  -0    -0.0 -> -1\r
+cotx647 comparetotal  -0     0.0 -> -1\r
+cotx648 comparetotal   0.0   0   -> -1\r
+cotx649 comparetotal   0.0  -0   -> 1\r
+cotx650 comparetotal   0.0  -0.0 -> 1\r
+cotx651 comparetotal   0.0   0.0 -> 0\r
+cotx652 comparetotal  -0.0   0   -> -1\r
+cotx653 comparetotal  -0.0  -0   -> 1\r
+cotx654 comparetotal  -0.0  -0.0 -> 0\r
+cotx655 comparetotal  -0.0   0.0 -> -1\r
+\r
+cotx656 comparetotal  -0E1   0.0 -> -1\r
+cotx657 comparetotal  -0E2   0.0 -> -1\r
+cotx658 comparetotal   0E1   0.0 -> 1\r
+cotx659 comparetotal   0E2   0.0 -> 1\r
+cotx660 comparetotal  -0E1   0   -> -1\r
+cotx661 comparetotal  -0E2   0   -> -1\r
+cotx662 comparetotal   0E1   0   -> 1\r
+cotx663 comparetotal   0E2   0   -> 1\r
+cotx664 comparetotal  -0E1  -0E1 -> 0\r
+cotx665 comparetotal  -0E2  -0E1 -> -1\r
+cotx666 comparetotal   0E1  -0E1 -> 1\r
+cotx667 comparetotal   0E2  -0E1 -> 1\r
+cotx668 comparetotal  -0E1  -0E2 -> 1\r
+cotx669 comparetotal  -0E2  -0E2 -> 0\r
+cotx670 comparetotal   0E1  -0E2 -> 1\r
+cotx671 comparetotal   0E2  -0E2 -> 1\r
+cotx672 comparetotal  -0E1   0E1 -> -1\r
+cotx673 comparetotal  -0E2   0E1 -> -1\r
+cotx674 comparetotal   0E1   0E1 -> 0\r
+cotx675 comparetotal   0E2   0E1 -> 1\r
+cotx676 comparetotal  -0E1   0E2 -> -1\r
+cotx677 comparetotal  -0E2   0E2 -> -1\r
+cotx678 comparetotal   0E1   0E2 -> -1\r
+cotx679 comparetotal   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+precision: 20\r
+cotx680 comparetotal   12    12           -> 0\r
+cotx681 comparetotal   12    12.0         -> 1\r
+cotx682 comparetotal   12    12.00        -> 1\r
+cotx683 comparetotal   12    12.000       -> 1\r
+cotx684 comparetotal   12    12.0000      -> 1\r
+cotx685 comparetotal   12    12.00000     -> 1\r
+cotx686 comparetotal   12    12.000000    -> 1\r
+cotx687 comparetotal   12    12.0000000   -> 1\r
+cotx688 comparetotal   12    12.00000000  -> 1\r
+cotx689 comparetotal   12    12.000000000 -> 1\r
+cotx690 comparetotal   12              12 -> 0\r
+cotx691 comparetotal   12.0            12 -> -1\r
+cotx692 comparetotal   12.00           12 -> -1\r
+cotx693 comparetotal   12.000          12 -> -1\r
+cotx694 comparetotal   12.0000         12 -> -1\r
+cotx695 comparetotal   12.00000        12 -> -1\r
+cotx696 comparetotal   12.000000       12 -> -1\r
+cotx697 comparetotal   12.0000000      12 -> -1\r
+cotx698 comparetotal   12.00000000     12 -> -1\r
+cotx699 comparetotal   12.000000000    12 -> -1\r
+\r
+-- long operand checks\r
+maxexponent: 999\r
+minexponent: -999\r
+precision: 9\r
+cotx701 comparetotal 12345678000  1 ->  1\r
+cotx702 comparetotal 1 12345678000  -> -1\r
+cotx703 comparetotal 1234567800   1 ->  1\r
+cotx704 comparetotal 1 1234567800   -> -1\r
+cotx705 comparetotal 1234567890   1 ->  1\r
+cotx706 comparetotal 1 1234567890   -> -1\r
+cotx707 comparetotal 1234567891   1 ->  1\r
+cotx708 comparetotal 1 1234567891   -> -1\r
+cotx709 comparetotal 12345678901  1 ->  1\r
+cotx710 comparetotal 1 12345678901  -> -1\r
+cotx711 comparetotal 1234567896   1 ->  1\r
+cotx712 comparetotal 1 1234567896   -> -1\r
+cotx713 comparetotal -1234567891  1 -> -1\r
+cotx714 comparetotal 1 -1234567891  ->  1\r
+cotx715 comparetotal -12345678901 1 -> -1\r
+cotx716 comparetotal 1 -12345678901 ->  1\r
+cotx717 comparetotal -1234567896  1 -> -1\r
+cotx718 comparetotal 1 -1234567896  ->  1\r
+\r
+precision: 15\r
+-- same with plenty of precision\r
+cotx721 comparetotal 12345678000 1 -> 1\r
+cotx722 comparetotal 1 12345678000 -> -1\r
+cotx723 comparetotal 1234567800  1 -> 1\r
+cotx724 comparetotal 1 1234567800  -> -1\r
+cotx725 comparetotal 1234567890  1 -> 1\r
+cotx726 comparetotal 1 1234567890  -> -1\r
+cotx727 comparetotal 1234567891  1 -> 1\r
+cotx728 comparetotal 1 1234567891  -> -1\r
+cotx729 comparetotal 12345678901 1 -> 1\r
+cotx730 comparetotal 1 12345678901 -> -1\r
+cotx731 comparetotal 1234567896  1 -> 1\r
+cotx732 comparetotal 1 1234567896  -> -1\r
+\r
+-- residue cases\r
+precision: 5\r
+cotx740 comparetotal  1  0.9999999  -> 1\r
+cotx741 comparetotal  1  0.999999   -> 1\r
+cotx742 comparetotal  1  0.99999    -> 1\r
+cotx743 comparetotal  1  1.0000     -> 1\r
+cotx744 comparetotal  1  1.00001    -> -1\r
+cotx745 comparetotal  1  1.000001   -> -1\r
+cotx746 comparetotal  1  1.0000001  -> -1\r
+cotx750 comparetotal  0.9999999  1  -> -1\r
+cotx751 comparetotal  0.999999   1  -> -1\r
+cotx752 comparetotal  0.99999    1  -> -1\r
+cotx753 comparetotal  1.0000     1  -> -1\r
+cotx754 comparetotal  1.00001    1  -> 1\r
+cotx755 comparetotal  1.000001   1  -> 1\r
+cotx756 comparetotal  1.0000001  1  -> 1\r
+\r
+-- a selection of longies\r
+cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1\r
+cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931  -> 0\r
+cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931  -> -1\r
+cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+-- precisions above or below the difference should have no effect\r
+precision:   11\r
+cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:   10\r
+cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    9\r
+cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    8\r
+cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    7\r
+cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    6\r
+cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    5\r
+cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    4\r
+cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    3\r
+cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    2\r
+cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+precision:    1\r
+cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931  -> 1\r
+\r
+-- Specials\r
+precision:   9\r
+cotx780 comparetotal  Inf  -Inf   ->  1\r
+cotx781 comparetotal  Inf  -1000  ->  1\r
+cotx782 comparetotal  Inf  -1     ->  1\r
+cotx783 comparetotal  Inf  -0     ->  1\r
+cotx784 comparetotal  Inf   0     ->  1\r
+cotx785 comparetotal  Inf   1     ->  1\r
+cotx786 comparetotal  Inf   1000  ->  1\r
+cotx787 comparetotal  Inf   Inf   ->  0\r
+cotx788 comparetotal -1000  Inf   -> -1\r
+cotx789 comparetotal -Inf   Inf   -> -1\r
+cotx790 comparetotal -1     Inf   -> -1\r
+cotx791 comparetotal -0     Inf   -> -1\r
+cotx792 comparetotal  0     Inf   -> -1\r
+cotx793 comparetotal  1     Inf   -> -1\r
+cotx794 comparetotal  1000  Inf   -> -1\r
+cotx795 comparetotal  Inf   Inf   ->  0\r
+\r
+cotx800 comparetotal -Inf  -Inf   ->  0\r
+cotx801 comparetotal -Inf  -1000  -> -1\r
+cotx802 comparetotal -Inf  -1     -> -1\r
+cotx803 comparetotal -Inf  -0     -> -1\r
+cotx804 comparetotal -Inf   0     -> -1\r
+cotx805 comparetotal -Inf   1     -> -1\r
+cotx806 comparetotal -Inf   1000  -> -1\r
+cotx807 comparetotal -Inf   Inf   -> -1\r
+cotx808 comparetotal -Inf  -Inf   ->  0\r
+cotx809 comparetotal -1000 -Inf   ->  1\r
+cotx810 comparetotal -1    -Inf   ->  1\r
+cotx811 comparetotal -0    -Inf   ->  1\r
+cotx812 comparetotal  0    -Inf   ->  1\r
+cotx813 comparetotal  1    -Inf   ->  1\r
+cotx814 comparetotal  1000 -Inf   ->  1\r
+cotx815 comparetotal  Inf  -Inf   ->  1\r
+\r
+cotx821 comparetotal  NaN -Inf    ->  1\r
+cotx822 comparetotal  NaN -1000   ->  1\r
+cotx823 comparetotal  NaN -1      ->  1\r
+cotx824 comparetotal  NaN -0      ->  1\r
+cotx825 comparetotal  NaN  0      ->  1\r
+cotx826 comparetotal  NaN  1      ->  1\r
+cotx827 comparetotal  NaN  1000   ->  1\r
+cotx828 comparetotal  NaN  Inf    ->  1\r
+cotx829 comparetotal  NaN  NaN    ->  0\r
+cotx830 comparetotal -Inf  NaN    ->  -1\r
+cotx831 comparetotal -1000 NaN    ->  -1\r
+cotx832 comparetotal -1    NaN    ->  -1\r
+cotx833 comparetotal -0    NaN    ->  -1\r
+cotx834 comparetotal  0    NaN    ->  -1\r
+cotx835 comparetotal  1    NaN    ->  -1\r
+cotx836 comparetotal  1000 NaN    ->  -1\r
+cotx837 comparetotal  Inf  NaN    ->  -1\r
+cotx838 comparetotal -NaN -NaN    ->  0\r
+cotx839 comparetotal +NaN -NaN    ->  1\r
+cotx840 comparetotal -NaN +NaN    ->  -1\r
+\r
+cotx841 comparetotal  sNaN -sNaN  ->  1\r
+cotx842 comparetotal  sNaN -NaN   ->  1\r
+cotx843 comparetotal  sNaN -Inf   ->  1\r
+cotx844 comparetotal  sNaN -1000  ->  1\r
+cotx845 comparetotal  sNaN -1     ->  1\r
+cotx846 comparetotal  sNaN -0     ->  1\r
+cotx847 comparetotal  sNaN  0     ->  1\r
+cotx848 comparetotal  sNaN  1     ->  1\r
+cotx849 comparetotal  sNaN  1000  ->  1\r
+cotx850 comparetotal  sNaN  NaN   ->  -1\r
+cotx851 comparetotal  sNaN sNaN   ->  0\r
+\r
+cotx852 comparetotal -sNaN sNaN   ->  -1\r
+cotx853 comparetotal -NaN  sNaN   ->  -1\r
+cotx854 comparetotal -Inf  sNaN   ->  -1\r
+cotx855 comparetotal -1000 sNaN   ->  -1\r
+cotx856 comparetotal -1    sNaN   ->  -1\r
+cotx857 comparetotal -0    sNaN   ->  -1\r
+cotx858 comparetotal  0    sNaN   ->  -1\r
+cotx859 comparetotal  1    sNaN   ->  -1\r
+cotx860 comparetotal  1000 sNaN   ->  -1\r
+cotx861 comparetotal  Inf  sNaN   ->  -1\r
+cotx862 comparetotal  NaN  sNaN   ->  1\r
+cotx863 comparetotal  sNaN sNaN   ->  0\r
+\r
+cotx871 comparetotal  -sNaN -sNaN  ->  0\r
+cotx872 comparetotal  -sNaN -NaN   ->  1\r
+cotx873 comparetotal  -sNaN -Inf   ->  -1\r
+cotx874 comparetotal  -sNaN -1000  ->  -1\r
+cotx875 comparetotal  -sNaN -1     ->  -1\r
+cotx876 comparetotal  -sNaN -0     ->  -1\r
+cotx877 comparetotal  -sNaN  0     ->  -1\r
+cotx878 comparetotal  -sNaN  1     ->  -1\r
+cotx879 comparetotal  -sNaN  1000  ->  -1\r
+cotx880 comparetotal  -sNaN  NaN   ->  -1\r
+cotx881 comparetotal  -sNaN sNaN   ->  -1\r
+\r
+cotx882 comparetotal -sNaN -sNaN   ->  0\r
+cotx883 comparetotal -NaN  -sNaN   ->  -1\r
+cotx884 comparetotal -Inf  -sNaN   ->  1\r
+cotx885 comparetotal -1000 -sNaN   ->  1\r
+cotx886 comparetotal -1    -sNaN   ->  1\r
+cotx887 comparetotal -0    -sNaN   ->  1\r
+cotx888 comparetotal  0    -sNaN   ->  1\r
+cotx889 comparetotal  1    -sNaN   ->  1\r
+cotx890 comparetotal  1000 -sNaN   ->  1\r
+cotx891 comparetotal  Inf  -sNaN   ->  1\r
+cotx892 comparetotal  NaN  -sNaN   ->  1\r
+cotx893 comparetotal  sNaN -sNaN   ->  1\r
+\r
+-- NaNs with payload\r
+cotx960 comparetotal  NaN9 -Inf   ->  1\r
+cotx961 comparetotal  NaN8  999   ->  1\r
+cotx962 comparetotal  NaN77 Inf   ->  1\r
+cotx963 comparetotal -NaN67 NaN5  ->  -1\r
+cotx964 comparetotal -Inf  -NaN4  ->  1\r
+cotx965 comparetotal -999  -NaN33 ->  1\r
+cotx966 comparetotal  Inf   NaN2  ->  -1\r
+\r
+cotx970 comparetotal -NaN41 -NaN42 -> 1\r
+cotx971 comparetotal +NaN41 -NaN42 -> 1\r
+cotx972 comparetotal -NaN41 +NaN42 -> -1\r
+cotx973 comparetotal +NaN41 +NaN42 -> -1\r
+cotx974 comparetotal -NaN42 -NaN01 -> -1\r
+cotx975 comparetotal +NaN42 -NaN01 ->  1\r
+cotx976 comparetotal -NaN42 +NaN01 -> -1\r
+cotx977 comparetotal +NaN42 +NaN01 ->  1\r
+\r
+cotx980 comparetotal -sNaN771 -sNaN772 -> 1\r
+cotx981 comparetotal +sNaN771 -sNaN772 -> 1\r
+cotx982 comparetotal -sNaN771 +sNaN772 -> -1\r
+cotx983 comparetotal +sNaN771 +sNaN772 -> -1\r
+cotx984 comparetotal -sNaN772 -sNaN771 -> -1\r
+cotx985 comparetotal +sNaN772 -sNaN771 ->  1\r
+cotx986 comparetotal -sNaN772 +sNaN771 -> -1\r
+cotx987 comparetotal +sNaN772 +sNaN771 ->  1\r
+\r
+cotx991 comparetotal -sNaN99 -Inf    -> -1\r
+cotx992 comparetotal  sNaN98 -11     ->  1\r
+cotx993 comparetotal  sNaN97  NaN    -> -1\r
+cotx994 comparetotal  sNaN16 sNaN94  -> -1\r
+cotx995 comparetotal  NaN85  sNaN83  ->  1\r
+cotx996 comparetotal -Inf    sNaN92  -> -1\r
+cotx997 comparetotal  088    sNaN81  -> -1\r
+cotx998 comparetotal  Inf    sNaN90  -> -1\r
+cotx999 comparetotal  NaN   -sNaN89  ->  1\r
+\r
+-- overflow and underflow tests .. subnormal results now allowed\r
+maxExponent: 999999999\r
+minexponent: -999999999\r
+cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1\r
+cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 ->  1\r
+cotx1082 comparetotal +0.100 9E-999999999               ->  1\r
+cotx1083 comparetotal 9E-999999999 +0.100               -> -1\r
+cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1\r
+cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 ->  1\r
+cotx1087 comparetotal -0.100 9E-999999999               -> -1\r
+cotx1088 comparetotal 9E-999999999 -0.100               ->  1\r
+\r
+cotx1089 comparetotal 1e-599999999 1e-400000001   -> -1\r
+cotx1090 comparetotal 1e-599999999 1e-400000000   -> -1\r
+cotx1091 comparetotal 1e-600000000 1e-400000000   -> -1\r
+cotx1092 comparetotal 9e-999999998 0.01           -> -1\r
+cotx1093 comparetotal 9e-999999998 0.1            -> -1\r
+cotx1094 comparetotal 0.01 9e-999999998           ->  1\r
+cotx1095 comparetotal 1e599999999 1e400000001     ->  1\r
+cotx1096 comparetotal 1e599999999 1e400000000     ->  1\r
+cotx1097 comparetotal 1e600000000 1e400000000     ->  1\r
+cotx1098 comparetotal 9e999999998 100             ->  1\r
+cotx1099 comparetotal 9e999999998 10              ->  1\r
+cotx1100 comparetotal 100  9e999999998            -> -1\r
+-- signs\r
+cotx1101 comparetotal  1e+777777777  1e+411111111 ->  1\r
+cotx1102 comparetotal  1e+777777777 -1e+411111111 ->  1\r
+cotx1103 comparetotal -1e+777777777  1e+411111111 -> -1\r
+cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1\r
+cotx1105 comparetotal  1e-777777777  1e-411111111 -> -1\r
+cotx1106 comparetotal  1e-777777777 -1e-411111111 ->  1\r
+cotx1107 comparetotal -1e-777777777  1e-411111111 -> -1\r
+cotx1108 comparetotal -1e-777777777 -1e-411111111 ->  1\r
+\r
+-- spread zeros\r
+cotx1110 comparetotal   0E-383  0       -> -1\r
+cotx1111 comparetotal   0E-383 -0       ->  1\r
+cotx1112 comparetotal  -0E-383  0       -> -1\r
+cotx1113 comparetotal  -0E-383 -0       ->  1\r
+cotx1114 comparetotal   0E-383  0E+384  -> -1\r
+cotx1115 comparetotal   0E-383 -0E+384  ->  1\r
+cotx1116 comparetotal  -0E-383  0E+384  -> -1\r
+cotx1117 comparetotal  -0E-383 -0E+384  ->  1\r
+cotx1118 comparetotal   0       0E+384  -> -1\r
+cotx1119 comparetotal   0      -0E+384  ->  1\r
+cotx1120 comparetotal  -0       0E+384  -> -1\r
+cotx1121 comparetotal  -0      -0E+384  ->  1\r
+\r
+cotx1130 comparetotal   0E+384  0       ->  1\r
+cotx1131 comparetotal   0E+384 -0       ->  1\r
+cotx1132 comparetotal  -0E+384  0       -> -1\r
+cotx1133 comparetotal  -0E+384 -0       -> -1\r
+cotx1134 comparetotal   0E+384  0E-383  ->  1\r
+cotx1135 comparetotal   0E+384 -0E-383  ->  1\r
+cotx1136 comparetotal  -0E+384  0E-383  -> -1\r
+cotx1137 comparetotal  -0E+384 -0E-383  -> -1\r
+cotx1138 comparetotal   0       0E-383  ->  1\r
+cotx1139 comparetotal   0      -0E-383  ->  1\r
+cotx1140 comparetotal  -0       0E-383  -> -1\r
+cotx1141 comparetotal  -0      -0E-383  -> -1\r
+\r
+-- Null tests\r
+cotx9990 comparetotal 10  # -> NaN Invalid_operation\r
+cotx9991 comparetotal  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/comparetotmag.decTest b/Lib/test/decimaltestdata/comparetotmag.decTest
new file mode 100644 (file)
index 0000000..a12e614
--- /dev/null
@@ -0,0 +1,790 @@
+------------------------------------------------------------------------\r
+-- comparetotmag.decTest -- decimal comparison, abs. total ordering   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that it cannot be assumed that add/subtract tests cover paths\r
+-- for this operation adequately, here, because the code might be\r
+-- quite different (comparison cannot overflow or underflow, so\r
+-- actual subtractions are not necessary). Similarly, comparetotal\r
+-- will have some radically different paths than compare.\r
+\r
+extended:    1\r
+precision:   16\r
+rounding:    half_up\r
+maxExponent: 384\r
+minExponent: -383\r
+\r
+-- sanity checks\r
+ctmx001 comparetotmag  -2  -2   ->   0\r
+ctmx002 comparetotmag  -2  -1   ->   1\r
+ctmx003 comparetotmag  -2   0   ->   1\r
+ctmx004 comparetotmag  -2   1   ->   1\r
+ctmx005 comparetotmag  -2   2   ->   0\r
+ctmx006 comparetotmag  -1  -2   ->  -1\r
+ctmx007 comparetotmag  -1  -1   ->   0\r
+ctmx008 comparetotmag  -1   0   ->   1\r
+ctmx009 comparetotmag  -1   1   ->   0\r
+ctmx010 comparetotmag  -1   2   ->  -1\r
+ctmx011 comparetotmag   0  -2   ->  -1\r
+ctmx012 comparetotmag   0  -1   ->  -1\r
+ctmx013 comparetotmag   0   0   ->   0\r
+ctmx014 comparetotmag   0   1   ->  -1\r
+ctmx015 comparetotmag   0   2   ->  -1\r
+ctmx016 comparetotmag   1  -2   ->  -1\r
+ctmx017 comparetotmag   1  -1   ->   0\r
+ctmx018 comparetotmag   1   0   ->   1\r
+ctmx019 comparetotmag   1   1   ->   0\r
+ctmx020 comparetotmag   1   2   ->  -1\r
+ctmx021 comparetotmag   2  -2   ->   0\r
+ctmx022 comparetotmag   2  -1   ->   1\r
+ctmx023 comparetotmag   2   0   ->   1\r
+ctmx025 comparetotmag   2   1   ->   1\r
+ctmx026 comparetotmag   2   2   ->   0\r
+\r
+ctmx031 comparetotmag  -20  -20   ->   0\r
+ctmx032 comparetotmag  -20  -10   ->   1\r
+ctmx033 comparetotmag  -20   00   ->   1\r
+ctmx034 comparetotmag  -20   10   ->   1\r
+ctmx035 comparetotmag  -20   20   ->   0\r
+ctmx036 comparetotmag  -10  -20   ->  -1\r
+ctmx037 comparetotmag  -10  -10   ->   0\r
+ctmx038 comparetotmag  -10   00   ->   1\r
+ctmx039 comparetotmag  -10   10   ->   0\r
+ctmx040 comparetotmag  -10   20   ->  -1\r
+ctmx041 comparetotmag   00  -20   ->  -1\r
+ctmx042 comparetotmag   00  -10   ->  -1\r
+ctmx043 comparetotmag   00   00   ->   0\r
+ctmx044 comparetotmag   00   10   ->  -1\r
+ctmx045 comparetotmag   00   20   ->  -1\r
+ctmx046 comparetotmag   10  -20   ->  -1\r
+ctmx047 comparetotmag   10  -10   ->   0\r
+ctmx048 comparetotmag   10   00   ->   1\r
+ctmx049 comparetotmag   10   10   ->   0\r
+ctmx050 comparetotmag   10   20   ->  -1\r
+ctmx051 comparetotmag   20  -20   ->   0\r
+ctmx052 comparetotmag   20  -10   ->   1\r
+ctmx053 comparetotmag   20   00   ->   1\r
+ctmx055 comparetotmag   20   10   ->   1\r
+ctmx056 comparetotmag   20   20   ->   0\r
+\r
+ctmx061 comparetotmag  -2.0  -2.0   ->   0\r
+ctmx062 comparetotmag  -2.0  -1.0   ->   1\r
+ctmx063 comparetotmag  -2.0   0.0   ->   1\r
+ctmx064 comparetotmag  -2.0   1.0   ->   1\r
+ctmx065 comparetotmag  -2.0   2.0   ->   0\r
+ctmx066 comparetotmag  -1.0  -2.0   ->  -1\r
+ctmx067 comparetotmag  -1.0  -1.0   ->   0\r
+ctmx068 comparetotmag  -1.0   0.0   ->   1\r
+ctmx069 comparetotmag  -1.0   1.0   ->   0\r
+ctmx070 comparetotmag  -1.0   2.0   ->  -1\r
+ctmx071 comparetotmag   0.0  -2.0   ->  -1\r
+ctmx072 comparetotmag   0.0  -1.0   ->  -1\r
+ctmx073 comparetotmag   0.0   0.0   ->   0\r
+ctmx074 comparetotmag   0.0   1.0   ->  -1\r
+ctmx075 comparetotmag   0.0   2.0   ->  -1\r
+ctmx076 comparetotmag   1.0  -2.0   ->  -1\r
+ctmx077 comparetotmag   1.0  -1.0   ->   0\r
+ctmx078 comparetotmag   1.0   0.0   ->   1\r
+ctmx079 comparetotmag   1.0   1.0   ->   0\r
+ctmx080 comparetotmag   1.0   2.0   ->  -1\r
+ctmx081 comparetotmag   2.0  -2.0   ->   0\r
+ctmx082 comparetotmag   2.0  -1.0   ->   1\r
+ctmx083 comparetotmag   2.0   0.0   ->   1\r
+ctmx085 comparetotmag   2.0   1.0   ->   1\r
+ctmx086 comparetotmag   2.0   2.0   ->   0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+ctmx090 comparetotmag  9.99999999E+999999999 9.99999999E+999999999   ->   0\r
+ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999   ->   0\r
+ctmx092 comparetotmag  9.99999999E+999999999 -9.99999999E+999999999  ->   0\r
+ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999  ->   0\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+ctmx100 comparetotmag   7.0    7.0     ->   0\r
+ctmx101 comparetotmag   7.0    7       ->  -1\r
+ctmx102 comparetotmag   7      7.0     ->   1\r
+ctmx103 comparetotmag   7E+0   7.0     ->   1\r
+ctmx104 comparetotmag   70E-1  7.0     ->   0\r
+ctmx105 comparetotmag   0.7E+1 7       ->   0\r
+ctmx106 comparetotmag   70E-1  7       ->  -1\r
+ctmx107 comparetotmag   7.0    7E+0    ->  -1\r
+ctmx108 comparetotmag   7.0    70E-1   ->   0\r
+ctmx109 comparetotmag   7      0.7E+1  ->   0\r
+ctmx110 comparetotmag   7      70E-1   ->   1\r
+\r
+ctmx120 comparetotmag   8.0    7.0     ->   1\r
+ctmx121 comparetotmag   8.0    7       ->   1\r
+ctmx122 comparetotmag   8      7.0     ->   1\r
+ctmx123 comparetotmag   8E+0   7.0     ->   1\r
+ctmx124 comparetotmag   80E-1  7.0     ->   1\r
+ctmx125 comparetotmag   0.8E+1 7       ->   1\r
+ctmx126 comparetotmag   80E-1  7       ->   1\r
+ctmx127 comparetotmag   8.0    7E+0    ->   1\r
+ctmx128 comparetotmag   8.0    70E-1   ->   1\r
+ctmx129 comparetotmag   8      0.7E+1   ->   1\r
+ctmx130 comparetotmag   8      70E-1   ->   1\r
+\r
+ctmx140 comparetotmag   8.0    9.0     ->  -1\r
+ctmx141 comparetotmag   8.0    9       ->  -1\r
+ctmx142 comparetotmag   8      9.0     ->  -1\r
+ctmx143 comparetotmag   8E+0   9.0     ->  -1\r
+ctmx144 comparetotmag   80E-1  9.0     ->  -1\r
+ctmx145 comparetotmag   0.8E+1 9       ->  -1\r
+ctmx146 comparetotmag   80E-1  9       ->  -1\r
+ctmx147 comparetotmag   8.0    9E+0    ->  -1\r
+ctmx148 comparetotmag   8.0    90E-1   ->  -1\r
+ctmx149 comparetotmag   8      0.9E+1  ->  -1\r
+ctmx150 comparetotmag   8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes -+ ..\r
+ctmx200 comparetotmag  -7.0    7.0     ->   0\r
+ctmx201 comparetotmag  -7.0    7       ->  -1\r
+ctmx202 comparetotmag  -7      7.0     ->   1\r
+ctmx203 comparetotmag  -7E+0   7.0     ->   1\r
+ctmx204 comparetotmag  -70E-1  7.0     ->   0\r
+ctmx205 comparetotmag  -0.7E+1 7       ->   0\r
+ctmx206 comparetotmag  -70E-1  7       ->  -1\r
+ctmx207 comparetotmag  -7.0    7E+0    ->  -1\r
+ctmx208 comparetotmag  -7.0    70E-1   ->   0\r
+ctmx209 comparetotmag  -7      0.7E+1  ->   0\r
+ctmx210 comparetotmag  -7      70E-1   ->   1\r
+\r
+ctmx220 comparetotmag  -8.0    7.0     ->   1\r
+ctmx221 comparetotmag  -8.0    7       ->   1\r
+ctmx222 comparetotmag  -8      7.0     ->   1\r
+ctmx223 comparetotmag  -8E+0   7.0     ->   1\r
+ctmx224 comparetotmag  -80E-1  7.0     ->   1\r
+ctmx225 comparetotmag  -0.8E+1 7       ->   1\r
+ctmx226 comparetotmag  -80E-1  7       ->   1\r
+ctmx227 comparetotmag  -8.0    7E+0    ->   1\r
+ctmx228 comparetotmag  -8.0    70E-1   ->   1\r
+ctmx229 comparetotmag  -8      0.7E+1  ->   1\r
+ctmx230 comparetotmag  -8      70E-1   ->   1\r
+\r
+ctmx240 comparetotmag  -8.0    9.0     ->  -1\r
+ctmx241 comparetotmag  -8.0    9       ->  -1\r
+ctmx242 comparetotmag  -8      9.0     ->  -1\r
+ctmx243 comparetotmag  -8E+0   9.0     ->  -1\r
+ctmx244 comparetotmag  -80E-1  9.0     ->  -1\r
+ctmx245 comparetotmag  -0.8E+1 9       ->  -1\r
+ctmx246 comparetotmag  -80E-1  9       ->  -1\r
+ctmx247 comparetotmag  -8.0    9E+0    ->  -1\r
+ctmx248 comparetotmag  -8.0    90E-1   ->  -1\r
+ctmx249 comparetotmag  -8      0.9E+1  ->  -1\r
+ctmx250 comparetotmag  -8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes +- ..\r
+ctmx300 comparetotmag   7.0    -7.0     ->   0\r
+ctmx301 comparetotmag   7.0    -7       ->  -1\r
+ctmx302 comparetotmag   7      -7.0     ->   1\r
+ctmx303 comparetotmag   7E+0   -7.0     ->   1\r
+ctmx304 comparetotmag   70E-1  -7.0     ->   0\r
+ctmx305 comparetotmag   .7E+1  -7       ->   0\r
+ctmx306 comparetotmag   70E-1  -7       ->  -1\r
+ctmx307 comparetotmag   7.0    -7E+0    ->  -1\r
+ctmx308 comparetotmag   7.0    -70E-1   ->   0\r
+ctmx309 comparetotmag   7      -.7E+1   ->   0\r
+ctmx310 comparetotmag   7      -70E-1   ->   1\r
+\r
+ctmx320 comparetotmag   8.0    -7.0     ->   1\r
+ctmx321 comparetotmag   8.0    -7       ->   1\r
+ctmx322 comparetotmag   8      -7.0     ->   1\r
+ctmx323 comparetotmag   8E+0   -7.0     ->   1\r
+ctmx324 comparetotmag   80E-1  -7.0     ->   1\r
+ctmx325 comparetotmag   .8E+1  -7       ->   1\r
+ctmx326 comparetotmag   80E-1  -7       ->   1\r
+ctmx327 comparetotmag   8.0    -7E+0    ->   1\r
+ctmx328 comparetotmag   8.0    -70E-1   ->   1\r
+ctmx329 comparetotmag   8      -.7E+1   ->   1\r
+ctmx330 comparetotmag   8      -70E-1   ->   1\r
+\r
+ctmx340 comparetotmag   8.0    -9.0     ->  -1\r
+ctmx341 comparetotmag   8.0    -9       ->  -1\r
+ctmx342 comparetotmag   8      -9.0     ->  -1\r
+ctmx343 comparetotmag   8E+0   -9.0     ->  -1\r
+ctmx344 comparetotmag   80E-1  -9.0     ->  -1\r
+ctmx345 comparetotmag   .8E+1  -9       ->  -1\r
+ctmx346 comparetotmag   80E-1  -9       ->  -1\r
+ctmx347 comparetotmag   8.0    -9E+0    ->  -1\r
+ctmx348 comparetotmag   8.0    -90E-1   ->  -1\r
+ctmx349 comparetotmag   8      -.9E+1   ->  -1\r
+ctmx350 comparetotmag   8      -90E-1   ->  -1\r
+\r
+-- and again, with sign changes -- ..\r
+ctmx400 comparetotmag   -7.0    -7.0     ->   0\r
+ctmx401 comparetotmag   -7.0    -7       ->  -1\r
+ctmx402 comparetotmag   -7      -7.0     ->   1\r
+ctmx403 comparetotmag   -7E+0   -7.0     ->   1\r
+ctmx404 comparetotmag   -70E-1  -7.0     ->   0\r
+ctmx405 comparetotmag   -.7E+1  -7       ->   0\r
+ctmx406 comparetotmag   -70E-1  -7       ->  -1\r
+ctmx407 comparetotmag   -7.0    -7E+0    ->  -1\r
+ctmx408 comparetotmag   -7.0    -70E-1   ->   0\r
+ctmx409 comparetotmag   -7      -.7E+1   ->   0\r
+ctmx410 comparetotmag   -7      -70E-1   ->   1\r
+\r
+ctmx420 comparetotmag   -8.0    -7.0     ->   1\r
+ctmx421 comparetotmag   -8.0    -7       ->   1\r
+ctmx422 comparetotmag   -8      -7.0     ->   1\r
+ctmx423 comparetotmag   -8E+0   -7.0     ->   1\r
+ctmx424 comparetotmag   -80E-1  -7.0     ->   1\r
+ctmx425 comparetotmag   -.8E+1  -7       ->   1\r
+ctmx426 comparetotmag   -80E-1  -7       ->   1\r
+ctmx427 comparetotmag   -8.0    -7E+0    ->   1\r
+ctmx428 comparetotmag   -8.0    -70E-1   ->   1\r
+ctmx429 comparetotmag   -8      -.7E+1   ->   1\r
+ctmx430 comparetotmag   -8      -70E-1   ->   1\r
+\r
+ctmx440 comparetotmag   -8.0    -9.0     ->  -1\r
+ctmx441 comparetotmag   -8.0    -9       ->  -1\r
+ctmx442 comparetotmag   -8      -9.0     ->  -1\r
+ctmx443 comparetotmag   -8E+0   -9.0     ->  -1\r
+ctmx444 comparetotmag   -80E-1  -9.0     ->  -1\r
+ctmx445 comparetotmag   -.8E+1  -9       ->  -1\r
+ctmx446 comparetotmag   -80E-1  -9       ->  -1\r
+ctmx447 comparetotmag   -8.0    -9E+0    ->  -1\r
+ctmx448 comparetotmag   -8.0    -90E-1   ->  -1\r
+ctmx449 comparetotmag   -8      -.9E+1   ->  -1\r
+ctmx450 comparetotmag   -8      -90E-1   ->  -1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+precision: 40\r
+ctmx470 comparetotmag 123.4560000000000000E789 123.456E789  ->  -1\r
+ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89  ->  -1\r
+ctmx472 comparetotmag 123.45600000000000E789 123.456E789  ->  -1\r
+ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89  ->  -1\r
+ctmx474 comparetotmag 123.456000000000E789 123.456E789  ->  -1\r
+ctmx475 comparetotmag 123.45600000000E-89 123.456E-89  ->  -1\r
+ctmx476 comparetotmag 123.4560000000E789 123.456E789  ->  -1\r
+ctmx477 comparetotmag 123.456000000E-89 123.456E-89  ->  -1\r
+ctmx478 comparetotmag 123.45600000E789 123.456E789  ->  -1\r
+ctmx479 comparetotmag 123.4560000E-89 123.456E-89  ->  -1\r
+ctmx480 comparetotmag 123.456000E789 123.456E789  ->  -1\r
+ctmx481 comparetotmag 123.45600E-89 123.456E-89  ->  -1\r
+ctmx482 comparetotmag 123.4560E789 123.456E789  ->  -1\r
+ctmx483 comparetotmag 123.456E-89 123.456E-89  ->   0\r
+ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89  ->   1\r
+ctmx485 comparetotmag 123.456E789 123.456000000000000E789  ->   1\r
+ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89  ->   1\r
+ctmx487 comparetotmag 123.456E789 123.4560000000000E789  ->   1\r
+ctmx488 comparetotmag 123.456E-89 123.456000000000E-89  ->   1\r
+ctmx489 comparetotmag 123.456E789 123.45600000000E789  ->   1\r
+ctmx490 comparetotmag 123.456E-89 123.4560000000E-89  ->   1\r
+ctmx491 comparetotmag 123.456E789 123.456000000E789  ->   1\r
+ctmx492 comparetotmag 123.456E-89 123.45600000E-89  ->   1\r
+ctmx493 comparetotmag 123.456E789 123.4560000E789  ->   1\r
+ctmx494 comparetotmag 123.456E-89 123.456000E-89  ->   1\r
+ctmx495 comparetotmag 123.456E789 123.45600E789  ->   1\r
+ctmx496 comparetotmag 123.456E-89 123.4560E-89  ->   1\r
+ctmx497 comparetotmag 123.456E789 123.456E789  ->   0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+precision: 9\r
+ctmx500 comparetotmag    1     1E-15     ->   1\r
+ctmx501 comparetotmag    1     1E-14     ->   1\r
+ctmx502 comparetotmag    1     1E-13     ->   1\r
+ctmx503 comparetotmag    1     1E-12     ->   1\r
+ctmx504 comparetotmag    1     1E-11     ->   1\r
+ctmx505 comparetotmag    1     1E-10     ->   1\r
+ctmx506 comparetotmag    1     1E-9      ->   1\r
+ctmx507 comparetotmag    1     1E-8      ->   1\r
+ctmx508 comparetotmag    1     1E-7      ->   1\r
+ctmx509 comparetotmag    1     1E-6      ->   1\r
+ctmx510 comparetotmag    1     1E-5      ->   1\r
+ctmx511 comparetotmag    1     1E-4      ->   1\r
+ctmx512 comparetotmag    1     1E-3      ->   1\r
+ctmx513 comparetotmag    1     1E-2      ->   1\r
+ctmx514 comparetotmag    1     1E-1      ->   1\r
+ctmx515 comparetotmag    1     1E-0      ->   0\r
+ctmx516 comparetotmag    1     1E+1      ->  -1\r
+ctmx517 comparetotmag    1     1E+2      ->  -1\r
+ctmx518 comparetotmag    1     1E+3      ->  -1\r
+ctmx519 comparetotmag    1     1E+4      ->  -1\r
+ctmx521 comparetotmag    1     1E+5      ->  -1\r
+ctmx522 comparetotmag    1     1E+6      ->  -1\r
+ctmx523 comparetotmag    1     1E+7      ->  -1\r
+ctmx524 comparetotmag    1     1E+8      ->  -1\r
+ctmx525 comparetotmag    1     1E+9      ->  -1\r
+ctmx526 comparetotmag    1     1E+10     ->  -1\r
+ctmx527 comparetotmag    1     1E+11     ->  -1\r
+ctmx528 comparetotmag    1     1E+12     ->  -1\r
+ctmx529 comparetotmag    1     1E+13     ->  -1\r
+ctmx530 comparetotmag    1     1E+14     ->  -1\r
+ctmx531 comparetotmag    1     1E+15     ->  -1\r
+-- LR swap\r
+ctmx540 comparetotmag    1E-15  1        ->  -1\r
+ctmx541 comparetotmag    1E-14  1        ->  -1\r
+ctmx542 comparetotmag    1E-13  1        ->  -1\r
+ctmx543 comparetotmag    1E-12  1        ->  -1\r
+ctmx544 comparetotmag    1E-11  1        ->  -1\r
+ctmx545 comparetotmag    1E-10  1        ->  -1\r
+ctmx546 comparetotmag    1E-9   1        ->  -1\r
+ctmx547 comparetotmag    1E-8   1        ->  -1\r
+ctmx548 comparetotmag    1E-7   1        ->  -1\r
+ctmx549 comparetotmag    1E-6   1        ->  -1\r
+ctmx550 comparetotmag    1E-5   1        ->  -1\r
+ctmx551 comparetotmag    1E-4   1        ->  -1\r
+ctmx552 comparetotmag    1E-3   1        ->  -1\r
+ctmx553 comparetotmag    1E-2   1        ->  -1\r
+ctmx554 comparetotmag    1E-1   1        ->  -1\r
+ctmx555 comparetotmag    1E-0   1        ->   0\r
+ctmx556 comparetotmag    1E+1   1        ->   1\r
+ctmx557 comparetotmag    1E+2   1        ->   1\r
+ctmx558 comparetotmag    1E+3   1        ->   1\r
+ctmx559 comparetotmag    1E+4   1        ->   1\r
+ctmx561 comparetotmag    1E+5   1        ->   1\r
+ctmx562 comparetotmag    1E+6   1        ->   1\r
+ctmx563 comparetotmag    1E+7   1        ->   1\r
+ctmx564 comparetotmag    1E+8   1        ->   1\r
+ctmx565 comparetotmag    1E+9   1        ->   1\r
+ctmx566 comparetotmag    1E+10  1        ->   1\r
+ctmx567 comparetotmag    1E+11  1        ->   1\r
+ctmx568 comparetotmag    1E+12  1        ->   1\r
+ctmx569 comparetotmag    1E+13  1        ->   1\r
+ctmx570 comparetotmag    1E+14  1        ->   1\r
+ctmx571 comparetotmag    1E+15  1        ->   1\r
+-- similar with an useful coefficient, one side only\r
+ctmx580 comparetotmag  0.000000987654321     1E-15     ->   1\r
+ctmx581 comparetotmag  0.000000987654321     1E-14     ->   1\r
+ctmx582 comparetotmag  0.000000987654321     1E-13     ->   1\r
+ctmx583 comparetotmag  0.000000987654321     1E-12     ->   1\r
+ctmx584 comparetotmag  0.000000987654321     1E-11     ->   1\r
+ctmx585 comparetotmag  0.000000987654321     1E-10     ->   1\r
+ctmx586 comparetotmag  0.000000987654321     1E-9      ->   1\r
+ctmx587 comparetotmag  0.000000987654321     1E-8      ->   1\r
+ctmx588 comparetotmag  0.000000987654321     1E-7      ->   1\r
+ctmx589 comparetotmag  0.000000987654321     1E-6      ->  -1\r
+ctmx590 comparetotmag  0.000000987654321     1E-5      ->  -1\r
+ctmx591 comparetotmag  0.000000987654321     1E-4      ->  -1\r
+ctmx592 comparetotmag  0.000000987654321     1E-3      ->  -1\r
+ctmx593 comparetotmag  0.000000987654321     1E-2      ->  -1\r
+ctmx594 comparetotmag  0.000000987654321     1E-1      ->  -1\r
+ctmx595 comparetotmag  0.000000987654321     1E-0      ->  -1\r
+ctmx596 comparetotmag  0.000000987654321     1E+1      ->  -1\r
+ctmx597 comparetotmag  0.000000987654321     1E+2      ->  -1\r
+ctmx598 comparetotmag  0.000000987654321     1E+3      ->  -1\r
+ctmx599 comparetotmag  0.000000987654321     1E+4      ->  -1\r
+\r
+-- check some unit-y traps\r
+precision: 20\r
+ctmx600 comparetotmag   12            12.2345  ->  -1\r
+ctmx601 comparetotmag   12.0          12.2345  ->  -1\r
+ctmx602 comparetotmag   12.00         12.2345  ->  -1\r
+ctmx603 comparetotmag   12.000        12.2345  ->  -1\r
+ctmx604 comparetotmag   12.0000       12.2345  ->  -1\r
+ctmx605 comparetotmag   12.00000      12.2345  ->  -1\r
+ctmx606 comparetotmag   12.000000     12.2345  ->  -1\r
+ctmx607 comparetotmag   12.0000000    12.2345  ->  -1\r
+ctmx608 comparetotmag   12.00000000   12.2345  ->  -1\r
+ctmx609 comparetotmag   12.000000000  12.2345  ->  -1\r
+ctmx610 comparetotmag   12.1234 12             ->   1\r
+ctmx611 comparetotmag   12.1234 12.0           ->   1\r
+ctmx612 comparetotmag   12.1234 12.00          ->   1\r
+ctmx613 comparetotmag   12.1234 12.000         ->   1\r
+ctmx614 comparetotmag   12.1234 12.0000        ->   1\r
+ctmx615 comparetotmag   12.1234 12.00000       ->   1\r
+ctmx616 comparetotmag   12.1234 12.000000      ->   1\r
+ctmx617 comparetotmag   12.1234 12.0000000     ->   1\r
+ctmx618 comparetotmag   12.1234 12.00000000    ->   1\r
+ctmx619 comparetotmag   12.1234 12.000000000   ->   1\r
+ctmx620 comparetotmag  -12           -12.2345  ->  -1\r
+ctmx621 comparetotmag  -12.0         -12.2345  ->  -1\r
+ctmx622 comparetotmag  -12.00        -12.2345  ->  -1\r
+ctmx623 comparetotmag  -12.000       -12.2345  ->  -1\r
+ctmx624 comparetotmag  -12.0000      -12.2345  ->  -1\r
+ctmx625 comparetotmag  -12.00000     -12.2345  ->  -1\r
+ctmx626 comparetotmag  -12.000000    -12.2345  ->  -1\r
+ctmx627 comparetotmag  -12.0000000   -12.2345  ->  -1\r
+ctmx628 comparetotmag  -12.00000000  -12.2345  ->  -1\r
+ctmx629 comparetotmag  -12.000000000 -12.2345  ->  -1\r
+ctmx630 comparetotmag  -12.1234 -12            ->   1\r
+ctmx631 comparetotmag  -12.1234 -12.0          ->   1\r
+ctmx632 comparetotmag  -12.1234 -12.00         ->   1\r
+ctmx633 comparetotmag  -12.1234 -12.000        ->   1\r
+ctmx634 comparetotmag  -12.1234 -12.0000       ->   1\r
+ctmx635 comparetotmag  -12.1234 -12.00000      ->   1\r
+ctmx636 comparetotmag  -12.1234 -12.000000     ->   1\r
+ctmx637 comparetotmag  -12.1234 -12.0000000    ->   1\r
+ctmx638 comparetotmag  -12.1234 -12.00000000   ->   1\r
+ctmx639 comparetotmag  -12.1234 -12.000000000  ->   1\r
+precision: 9\r
+\r
+-- extended zeros\r
+ctmx640 comparetotmag   0     0    ->   0\r
+ctmx641 comparetotmag   0    -0    ->   0\r
+ctmx642 comparetotmag   0    -0.0  ->   1\r
+ctmx643 comparetotmag   0     0.0  ->   1\r
+ctmx644 comparetotmag  -0     0    ->   0\r
+ctmx645 comparetotmag  -0    -0    ->   0\r
+ctmx646 comparetotmag  -0    -0.0  ->   1\r
+ctmx647 comparetotmag  -0     0.0  ->   1\r
+ctmx648 comparetotmag   0.0   0    ->  -1\r
+ctmx649 comparetotmag   0.0  -0    ->  -1\r
+ctmx650 comparetotmag   0.0  -0.0  ->   0\r
+ctmx651 comparetotmag   0.0   0.0  ->   0\r
+ctmx652 comparetotmag  -0.0   0    ->  -1\r
+ctmx653 comparetotmag  -0.0  -0    ->  -1\r
+ctmx654 comparetotmag  -0.0  -0.0  ->   0\r
+ctmx655 comparetotmag  -0.0   0.0  ->   0\r
+\r
+ctmx656 comparetotmag  -0E1   0.0  ->   1\r
+ctmx657 comparetotmag  -0E2   0.0  ->   1\r
+ctmx658 comparetotmag   0E1   0.0  ->   1\r
+ctmx659 comparetotmag   0E2   0.0  ->   1\r
+ctmx660 comparetotmag  -0E1   0    ->   1\r
+ctmx661 comparetotmag  -0E2   0    ->   1\r
+ctmx662 comparetotmag   0E1   0    ->   1\r
+ctmx663 comparetotmag   0E2   0    ->   1\r
+ctmx664 comparetotmag  -0E1  -0E1  ->   0\r
+ctmx665 comparetotmag  -0E2  -0E1  ->   1\r
+ctmx666 comparetotmag   0E1  -0E1  ->   0\r
+ctmx667 comparetotmag   0E2  -0E1  ->   1\r
+ctmx668 comparetotmag  -0E1  -0E2  ->  -1\r
+ctmx669 comparetotmag  -0E2  -0E2  ->   0\r
+ctmx670 comparetotmag   0E1  -0E2  ->  -1\r
+ctmx671 comparetotmag   0E2  -0E2  ->   0\r
+ctmx672 comparetotmag  -0E1   0E1  ->   0\r
+ctmx673 comparetotmag  -0E2   0E1  ->   1\r
+ctmx674 comparetotmag   0E1   0E1  ->   0\r
+ctmx675 comparetotmag   0E2   0E1  ->   1\r
+ctmx676 comparetotmag  -0E1   0E2  ->  -1\r
+ctmx677 comparetotmag  -0E2   0E2  ->   0\r
+ctmx678 comparetotmag   0E1   0E2  ->  -1\r
+ctmx679 comparetotmag   0E2   0E2  ->   0\r
+\r
+-- trailing zeros; unit-y\r
+precision: 20\r
+ctmx680 comparetotmag   12    12            ->   0\r
+ctmx681 comparetotmag   12    12.0          ->   1\r
+ctmx682 comparetotmag   12    12.00         ->   1\r
+ctmx683 comparetotmag   12    12.000        ->   1\r
+ctmx684 comparetotmag   12    12.0000       ->   1\r
+ctmx685 comparetotmag   12    12.00000      ->   1\r
+ctmx686 comparetotmag   12    12.000000     ->   1\r
+ctmx687 comparetotmag   12    12.0000000    ->   1\r
+ctmx688 comparetotmag   12    12.00000000   ->   1\r
+ctmx689 comparetotmag   12    12.000000000  ->   1\r
+ctmx690 comparetotmag   12              12  ->   0\r
+ctmx691 comparetotmag   12.0            12  ->  -1\r
+ctmx692 comparetotmag   12.00           12  ->  -1\r
+ctmx693 comparetotmag   12.000          12  ->  -1\r
+ctmx694 comparetotmag   12.0000         12  ->  -1\r
+ctmx695 comparetotmag   12.00000        12  ->  -1\r
+ctmx696 comparetotmag   12.000000       12  ->  -1\r
+ctmx697 comparetotmag   12.0000000      12  ->  -1\r
+ctmx698 comparetotmag   12.00000000     12  ->  -1\r
+ctmx699 comparetotmag   12.000000000    12  ->  -1\r
+\r
+-- long operand checks\r
+maxexponent: 999\r
+minexponent: -999\r
+precision: 9\r
+ctmx701 comparetotmag 12345678000  1  ->   1\r
+ctmx702 comparetotmag 1 12345678000   ->  -1\r
+ctmx703 comparetotmag 1234567800   1  ->   1\r
+ctmx704 comparetotmag 1 1234567800    ->  -1\r
+ctmx705 comparetotmag 1234567890   1  ->   1\r
+ctmx706 comparetotmag 1 1234567890    ->  -1\r
+ctmx707 comparetotmag 1234567891   1  ->   1\r
+ctmx708 comparetotmag 1 1234567891    ->  -1\r
+ctmx709 comparetotmag 12345678901  1  ->   1\r
+ctmx710 comparetotmag 1 12345678901   ->  -1\r
+ctmx711 comparetotmag 1234567896   1  ->   1\r
+ctmx712 comparetotmag 1 1234567896    ->  -1\r
+ctmx713 comparetotmag -1234567891  1  ->   1\r
+ctmx714 comparetotmag 1 -1234567891   ->  -1\r
+ctmx715 comparetotmag -12345678901 1  ->   1\r
+ctmx716 comparetotmag 1 -12345678901  ->  -1\r
+ctmx717 comparetotmag -1234567896  1  ->   1\r
+ctmx718 comparetotmag 1 -1234567896   ->  -1\r
+\r
+precision: 15\r
+-- same with plenty of precision\r
+ctmx721 comparetotmag 12345678000 1  ->   1\r
+ctmx722 comparetotmag 1 12345678000  ->  -1\r
+ctmx723 comparetotmag 1234567800  1  ->   1\r
+ctmx724 comparetotmag 1 1234567800   ->  -1\r
+ctmx725 comparetotmag 1234567890  1  ->   1\r
+ctmx726 comparetotmag 1 1234567890   ->  -1\r
+ctmx727 comparetotmag 1234567891  1  ->   1\r
+ctmx728 comparetotmag 1 1234567891   ->  -1\r
+ctmx729 comparetotmag 12345678901 1  ->   1\r
+ctmx730 comparetotmag 1 12345678901  ->  -1\r
+ctmx731 comparetotmag 1234567896  1  ->   1\r
+ctmx732 comparetotmag 1 1234567896   ->  -1\r
+\r
+-- residue cases\r
+precision: 5\r
+ctmx740 comparetotmag  1  0.9999999   ->   1\r
+ctmx741 comparetotmag  1  0.999999    ->   1\r
+ctmx742 comparetotmag  1  0.99999     ->   1\r
+ctmx743 comparetotmag  1  1.0000      ->   1\r
+ctmx744 comparetotmag  1  1.00001     ->  -1\r
+ctmx745 comparetotmag  1  1.000001    ->  -1\r
+ctmx746 comparetotmag  1  1.0000001   ->  -1\r
+ctmx750 comparetotmag  0.9999999  1   ->  -1\r
+ctmx751 comparetotmag  0.999999   1   ->  -1\r
+ctmx752 comparetotmag  0.99999    1   ->  -1\r
+ctmx753 comparetotmag  1.0000     1   ->  -1\r
+ctmx754 comparetotmag  1.00001    1   ->   1\r
+ctmx755 comparetotmag  1.000001   1   ->   1\r
+ctmx756 comparetotmag  1.0000001  1   ->   1\r
+\r
+-- a selection of longies\r
+ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940  ->   1\r
+ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931   ->   0\r
+ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931   ->   1\r
+ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+-- precisions above or below the difference should have no effect\r
+precision:   11\r
+ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:   10\r
+ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    9\r
+ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    8\r
+ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    7\r
+ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    6\r
+ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    5\r
+ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    4\r
+ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    3\r
+ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    2\r
+ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+precision:    1\r
+ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931   ->  -1\r
+\r
+-- Specials\r
+precision:   9\r
+ctmx780 comparetotmag  Inf  -Inf   ->  0\r
+ctmx781 comparetotmag  Inf  -1000  ->  1\r
+ctmx782 comparetotmag  Inf  -1     ->  1\r
+ctmx783 comparetotmag  Inf  -0     ->  1\r
+ctmx784 comparetotmag  Inf   0     ->  1\r
+ctmx785 comparetotmag  Inf   1     ->  1\r
+ctmx786 comparetotmag  Inf   1000  ->  1\r
+ctmx787 comparetotmag  Inf   Inf   ->  0\r
+ctmx788 comparetotmag -1000  Inf   -> -1\r
+ctmx789 comparetotmag -Inf   Inf   ->  0\r
+ctmx790 comparetotmag -1     Inf   -> -1\r
+ctmx791 comparetotmag -0     Inf   -> -1\r
+ctmx792 comparetotmag  0     Inf   -> -1\r
+ctmx793 comparetotmag  1     Inf   -> -1\r
+ctmx794 comparetotmag  1000  Inf   -> -1\r
+ctmx795 comparetotmag  Inf   Inf   ->  0\r
+\r
+ctmx800 comparetotmag -Inf  -Inf   ->  0\r
+ctmx801 comparetotmag -Inf  -1000  ->  1\r
+ctmx802 comparetotmag -Inf  -1     ->  1\r
+ctmx803 comparetotmag -Inf  -0     ->  1\r
+ctmx804 comparetotmag -Inf   0     ->  1\r
+ctmx805 comparetotmag -Inf   1     ->  1\r
+ctmx806 comparetotmag -Inf   1000  ->  1\r
+ctmx807 comparetotmag -Inf   Inf   ->  0\r
+ctmx808 comparetotmag -Inf  -Inf   ->  0\r
+ctmx809 comparetotmag -1000 -Inf   -> -1\r
+ctmx810 comparetotmag -1    -Inf   -> -1\r
+ctmx811 comparetotmag -0    -Inf   -> -1\r
+ctmx812 comparetotmag  0    -Inf   -> -1\r
+ctmx813 comparetotmag  1    -Inf   -> -1\r
+ctmx814 comparetotmag  1000 -Inf   -> -1\r
+ctmx815 comparetotmag  Inf  -Inf   ->  0\r
+\r
+ctmx821 comparetotmag  NaN -Inf    ->  1\r
+ctmx822 comparetotmag  NaN -1000   ->  1\r
+ctmx823 comparetotmag  NaN -1      ->  1\r
+ctmx824 comparetotmag  NaN -0      ->  1\r
+ctmx825 comparetotmag  NaN  0      ->  1\r
+ctmx826 comparetotmag  NaN  1      ->  1\r
+ctmx827 comparetotmag  NaN  1000   ->  1\r
+ctmx828 comparetotmag  NaN  Inf    ->  1\r
+ctmx829 comparetotmag  NaN  NaN    ->  0\r
+ctmx830 comparetotmag -Inf  NaN    ->  -1\r
+ctmx831 comparetotmag -1000 NaN    ->  -1\r
+ctmx832 comparetotmag -1    NaN    ->  -1\r
+ctmx833 comparetotmag -0    NaN    ->  -1\r
+ctmx834 comparetotmag  0    NaN    ->  -1\r
+ctmx835 comparetotmag  1    NaN    ->  -1\r
+ctmx836 comparetotmag  1000 NaN    ->  -1\r
+ctmx837 comparetotmag  Inf  NaN    ->  -1\r
+ctmx838 comparetotmag -NaN -NaN    ->  0\r
+ctmx839 comparetotmag +NaN -NaN    ->  0\r
+ctmx840 comparetotmag -NaN +NaN    ->  0\r
+\r
+ctmx841 comparetotmag  sNaN -sNaN  ->  0\r
+ctmx842 comparetotmag  sNaN -NaN   ->  -1\r
+ctmx843 comparetotmag  sNaN -Inf   ->  1\r
+ctmx844 comparetotmag  sNaN -1000  ->  1\r
+ctmx845 comparetotmag  sNaN -1     ->  1\r
+ctmx846 comparetotmag  sNaN -0     ->  1\r
+ctmx847 comparetotmag  sNaN  0     ->  1\r
+ctmx848 comparetotmag  sNaN  1     ->  1\r
+ctmx849 comparetotmag  sNaN  1000  ->  1\r
+ctmx850 comparetotmag  sNaN  NaN   ->  -1\r
+ctmx851 comparetotmag  sNaN sNaN   ->  0\r
+\r
+ctmx852 comparetotmag -sNaN sNaN   ->  0\r
+ctmx853 comparetotmag -NaN  sNaN   ->  1\r
+ctmx854 comparetotmag -Inf  sNaN   ->  -1\r
+ctmx855 comparetotmag -1000 sNaN   ->  -1\r
+ctmx856 comparetotmag -1    sNaN   ->  -1\r
+ctmx857 comparetotmag -0    sNaN   ->  -1\r
+ctmx858 comparetotmag  0    sNaN   ->  -1\r
+ctmx859 comparetotmag  1    sNaN   ->  -1\r
+ctmx860 comparetotmag  1000 sNaN   ->  -1\r
+ctmx861 comparetotmag  Inf  sNaN   ->  -1\r
+ctmx862 comparetotmag  NaN  sNaN   ->  1\r
+ctmx863 comparetotmag  sNaN sNaN   ->  0\r
+\r
+ctmx871 comparetotmag  -sNaN -sNaN  ->  0\r
+ctmx872 comparetotmag  -sNaN -NaN   ->  -1\r
+ctmx873 comparetotmag  -sNaN -Inf   ->  1\r
+ctmx874 comparetotmag  -sNaN -1000  ->  1\r
+ctmx875 comparetotmag  -sNaN -1     ->  1\r
+ctmx876 comparetotmag  -sNaN -0     ->  1\r
+ctmx877 comparetotmag  -sNaN  0     ->  1\r
+ctmx878 comparetotmag  -sNaN  1     ->  1\r
+ctmx879 comparetotmag  -sNaN  1000  ->  1\r
+ctmx880 comparetotmag  -sNaN  NaN   ->  -1\r
+ctmx881 comparetotmag  -sNaN sNaN   ->  0\r
+\r
+ctmx882 comparetotmag -sNaN -sNaN   ->  0\r
+ctmx883 comparetotmag -NaN  -sNaN   ->  1\r
+ctmx884 comparetotmag -Inf  -sNaN   ->  -1\r
+ctmx885 comparetotmag -1000 -sNaN   ->  -1\r
+ctmx886 comparetotmag -1    -sNaN   ->  -1\r
+ctmx887 comparetotmag -0    -sNaN   ->  -1\r
+ctmx888 comparetotmag  0    -sNaN   ->  -1\r
+ctmx889 comparetotmag  1    -sNaN   ->  -1\r
+ctmx890 comparetotmag  1000 -sNaN   ->  -1\r
+ctmx891 comparetotmag  Inf  -sNaN   ->  -1\r
+ctmx892 comparetotmag  NaN  -sNaN   ->  1\r
+ctmx893 comparetotmag  sNaN -sNaN   ->  0\r
+\r
+-- NaNs with payload\r
+ctmx960 comparetotmag  NaN9 -Inf   ->  1\r
+ctmx961 comparetotmag  NaN8  999   ->  1\r
+ctmx962 comparetotmag  NaN77 Inf   ->  1\r
+ctmx963 comparetotmag -NaN67 NaN5  ->  1\r
+ctmx964 comparetotmag -Inf  -NaN4  ->  -1\r
+ctmx965 comparetotmag -999  -NaN33 ->  -1\r
+ctmx966 comparetotmag  Inf   NaN2  ->  -1\r
+\r
+ctmx970 comparetotmag -NaN41 -NaN42 -> -1\r
+ctmx971 comparetotmag +NaN41 -NaN42 -> -1\r
+ctmx972 comparetotmag -NaN41 +NaN42 -> -1\r
+ctmx973 comparetotmag +NaN41 +NaN42 -> -1\r
+ctmx974 comparetotmag -NaN42 -NaN01 ->  1\r
+ctmx975 comparetotmag +NaN42 -NaN01 ->  1\r
+ctmx976 comparetotmag -NaN42 +NaN01 ->  1\r
+ctmx977 comparetotmag +NaN42 +NaN01 ->  1\r
+\r
+ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1\r
+ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1\r
+ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1\r
+ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1\r
+ctmx984 comparetotmag -sNaN772 -sNaN771 ->  1\r
+ctmx985 comparetotmag +sNaN772 -sNaN771 ->  1\r
+ctmx986 comparetotmag -sNaN772 +sNaN771 ->  1\r
+ctmx987 comparetotmag +sNaN772 +sNaN771 ->  1\r
+\r
+ctmx991 comparetotmag -sNaN99 -Inf    ->  1\r
+ctmx992 comparetotmag  sNaN98 -11     ->  1\r
+ctmx993 comparetotmag  sNaN97  NaN    -> -1\r
+ctmx994 comparetotmag  sNaN16 sNaN94  -> -1\r
+ctmx995 comparetotmag  NaN85  sNaN83  ->  1\r
+ctmx996 comparetotmag -Inf    sNaN92  -> -1\r
+ctmx997 comparetotmag  088    sNaN81  -> -1\r
+ctmx998 comparetotmag  Inf    sNaN90  -> -1\r
+ctmx999 comparetotmag  NaN   -sNaN89  ->  1\r
+\r
+-- overflow and underflow tests .. subnormal results now allowed\r
+maxExponent: 999999999\r
+minexponent: -999999999\r
+ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999  ->  -1\r
+ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0  ->   1\r
+ctmx1082 comparetotmag +0.100 9E-999999999                ->   1\r
+ctmx1083 comparetotmag 9E-999999999 +0.100                ->  -1\r
+ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999  ->  -1\r
+ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0  ->   1\r
+ctmx1087 comparetotmag -0.100 9E-999999999                ->   1\r
+ctmx1088 comparetotmag 9E-999999999 -0.100                ->  -1\r
+\r
+ctmx1089 comparetotmag 1e-599999999 1e-400000001    ->  -1\r
+ctmx1090 comparetotmag 1e-599999999 1e-400000000    ->  -1\r
+ctmx1091 comparetotmag 1e-600000000 1e-400000000    ->  -1\r
+ctmx1092 comparetotmag 9e-999999998 0.01            ->  -1\r
+ctmx1093 comparetotmag 9e-999999998 0.1             ->  -1\r
+ctmx1094 comparetotmag 0.01 9e-999999998            ->   1\r
+ctmx1095 comparetotmag 1e599999999 1e400000001      ->   1\r
+ctmx1096 comparetotmag 1e599999999 1e400000000      ->   1\r
+ctmx1097 comparetotmag 1e600000000 1e400000000      ->   1\r
+ctmx1098 comparetotmag 9e999999998 100              ->   1\r
+ctmx1099 comparetotmag 9e999999998 10               ->   1\r
+ctmx1100 comparetotmag 100  9e999999998             ->  -1\r
+-- signs\r
+ctmx1101 comparetotmag  1e+777777777  1e+411111111  ->   1\r
+ctmx1102 comparetotmag  1e+777777777 -1e+411111111  ->   1\r
+ctmx1103 comparetotmag -1e+777777777  1e+411111111  ->   1\r
+ctmx1104 comparetotmag -1e+777777777 -1e+411111111  ->   1\r
+ctmx1105 comparetotmag  1e-777777777  1e-411111111  ->  -1\r
+ctmx1106 comparetotmag  1e-777777777 -1e-411111111  ->  -1\r
+ctmx1107 comparetotmag -1e-777777777  1e-411111111  ->  -1\r
+ctmx1108 comparetotmag -1e-777777777 -1e-411111111  ->  -1\r
+\r
+-- spread zeros\r
+ctmx1110 comparetotmag   0E-383  0        ->  -1\r
+ctmx1111 comparetotmag   0E-383 -0        ->  -1\r
+ctmx1112 comparetotmag  -0E-383  0        ->  -1\r
+ctmx1113 comparetotmag  -0E-383 -0        ->  -1\r
+ctmx1114 comparetotmag   0E-383  0E+384   ->  -1\r
+ctmx1115 comparetotmag   0E-383 -0E+384   ->  -1\r
+ctmx1116 comparetotmag  -0E-383  0E+384   ->  -1\r
+ctmx1117 comparetotmag  -0E-383 -0E+384   ->  -1\r
+ctmx1118 comparetotmag   0       0E+384   ->  -1\r
+ctmx1119 comparetotmag   0      -0E+384   ->  -1\r
+ctmx1120 comparetotmag  -0       0E+384   ->  -1\r
+ctmx1121 comparetotmag  -0      -0E+384   ->  -1\r
+\r
+ctmx1130 comparetotmag   0E+384  0        ->   1\r
+ctmx1131 comparetotmag   0E+384 -0        ->   1\r
+ctmx1132 comparetotmag  -0E+384  0        ->   1\r
+ctmx1133 comparetotmag  -0E+384 -0        ->   1\r
+ctmx1134 comparetotmag   0E+384  0E-383   ->   1\r
+ctmx1135 comparetotmag   0E+384 -0E-383   ->   1\r
+ctmx1136 comparetotmag  -0E+384  0E-383   ->   1\r
+ctmx1137 comparetotmag  -0E+384 -0E-383   ->   1\r
+ctmx1138 comparetotmag   0       0E-383   ->   1\r
+ctmx1139 comparetotmag   0      -0E-383   ->   1\r
+ctmx1140 comparetotmag  -0       0E-383   ->   1\r
+ctmx1141 comparetotmag  -0      -0E-383   ->   1\r
+\r
+-- Null tests\r
+ctmx9990 comparetotmag 10  # -> NaN Invalid_operation\r
+ctmx9991 comparetotmag  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/copy.decTest b/Lib/test/decimaltestdata/copy.decTest
new file mode 100644 (file)
index 0000000..5d4065d
--- /dev/null
@@ -0,0 +1,86 @@
+------------------------------------------------------------------------\r
+-- copy.decTest -- quiet copy                                         --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check\r
+cpyx001 copy       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+cpyx011 copy  Infinity    -> Infinity\r
+cpyx012 copy  -Infinity   -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+cpyx021 copy         NaN  -> NaN\r
+cpyx022 copy        -NaN  -> -NaN\r
+cpyx023 copy        sNaN  -> sNaN\r
+cpyx024 copy       -sNaN  -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+cpyx031 copy       NaN10  -> NaN10\r
+cpyx032 copy      -NaN10  -> -NaN10\r
+cpyx033 copy      sNaN10  -> sNaN10\r
+cpyx034 copy     -sNaN10  -> -sNaN10\r
+cpyx035 copy       NaN7   -> NaN7\r
+cpyx036 copy      -NaN7   -> -NaN7\r
+cpyx037 copy      sNaN101 -> sNaN101\r
+cpyx038 copy     -sNaN101 -> -sNaN101\r
+\r
+-- finites\r
+cpyx101 copy          7   -> 7\r
+cpyx102 copy         -7   -> -7\r
+cpyx103 copy         75   -> 75\r
+cpyx104 copy        -75   -> -75\r
+cpyx105 copy       7.50   -> 7.50\r
+cpyx106 copy      -7.50   -> -7.50\r
+cpyx107 copy       7.500  -> 7.500\r
+cpyx108 copy      -7.500  -> -7.500\r
+\r
+-- zeros\r
+cpyx111 copy          0   -> 0\r
+cpyx112 copy         -0   -> -0\r
+cpyx113 copy       0E+4   -> 0E+4\r
+cpyx114 copy      -0E+4   -> -0E+4\r
+cpyx115 copy     0.0000   -> 0.0000\r
+cpyx116 copy    -0.0000   -> -0.0000\r
+cpyx117 copy      0E-141  -> 0E-141\r
+cpyx118 copy     -0E-141  -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+cpyx121 copy   268268268        -> 268268268\r
+cpyx122 copy  -268268268        -> -268268268\r
+cpyx123 copy   134134134        -> 134134134\r
+cpyx124 copy  -134134134        -> -134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+cpyx131 copy  9.99999999E+999   -> 9.99999999E+999\r
+cpyx132 copy  1E-999            -> 1E-999\r
+cpyx133 copy  1.00000000E-999   -> 1.00000000E-999\r
+cpyx134 copy  1E-1007           -> 1E-1007\r
+\r
+cpyx135 copy  -1E-1007          -> -1E-1007\r
+cpyx136 copy  -1.00000000E-999  -> -1.00000000E-999\r
+cpyx137 copy  -1E-999           -> -1E-999\r
+cpyx138 copy  -9.99999999E+999  -> -9.99999999E+999\r
diff --git a/Lib/test/decimaltestdata/copyabs.decTest b/Lib/test/decimaltestdata/copyabs.decTest
new file mode 100644 (file)
index 0000000..7457552
--- /dev/null
@@ -0,0 +1,86 @@
+------------------------------------------------------------------------\r
+-- copyAbs.decTest -- quiet copy and set sign to zero                 --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check\r
+cpax001 copyabs       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+cpax011 copyabs  Infinity    -> Infinity\r
+cpax012 copyabs  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+cpax021 copyabs         NaN  -> NaN\r
+cpax022 copyabs        -NaN  -> NaN\r
+cpax023 copyabs        sNaN  -> sNaN\r
+cpax024 copyabs       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+cpax031 copyabs       NaN10  -> NaN10\r
+cpax032 copyabs      -NaN15  -> NaN15\r
+cpax033 copyabs      sNaN15  -> sNaN15\r
+cpax034 copyabs     -sNaN10  -> sNaN10\r
+cpax035 copyabs       NaN7   -> NaN7\r
+cpax036 copyabs      -NaN7   -> NaN7\r
+cpax037 copyabs      sNaN101 -> sNaN101\r
+cpax038 copyabs     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+cpax101 copyabs          7   -> 7\r
+cpax102 copyabs         -7   -> 7\r
+cpax103 copyabs         75   -> 75\r
+cpax104 copyabs        -75   -> 75\r
+cpax105 copyabs       7.10   -> 7.10\r
+cpax106 copyabs      -7.10   -> 7.10\r
+cpax107 copyabs       7.500  -> 7.500\r
+cpax108 copyabs      -7.500  -> 7.500\r
+\r
+-- zeros\r
+cpax111 copyabs          0   -> 0\r
+cpax112 copyabs         -0   -> 0\r
+cpax113 copyabs       0E+6   -> 0E+6\r
+cpax114 copyabs      -0E+6   -> 0E+6\r
+cpax115 copyabs     0.0000   -> 0.0000\r
+cpax116 copyabs    -0.0000   -> 0.0000\r
+cpax117 copyabs      0E-141  -> 0E-141\r
+cpax118 copyabs     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+cpax121 copyabs   268268268        -> 268268268\r
+cpax122 copyabs  -268268268        -> 268268268\r
+cpax123 copyabs   134134134        -> 134134134\r
+cpax124 copyabs  -134134134        -> 134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+cpax131 copyabs  9.99999999E+999   -> 9.99999999E+999\r
+cpax132 copyabs  1E-999            -> 1E-999\r
+cpax133 copyabs  1.00000000E-999   -> 1.00000000E-999\r
+cpax134 copyabs  1E-1007           -> 1E-1007\r
+\r
+cpax135 copyabs  -1E-1007          -> 1E-1007\r
+cpax136 copyabs  -1.00000000E-999  -> 1.00000000E-999\r
+cpax137 copyabs  -1E-999           -> 1E-999\r
+cpax199 copyabs  -9.99999999E+999  -> 9.99999999E+999\r
diff --git a/Lib/test/decimaltestdata/copynegate.decTest b/Lib/test/decimaltestdata/copynegate.decTest
new file mode 100644 (file)
index 0000000..3e502be
--- /dev/null
@@ -0,0 +1,86 @@
+------------------------------------------------------------------------\r
+-- copyNegate.decTest -- quiet copy and negate                        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check\r
+cpnx001 copynegate       +7.50  -> -7.50\r
+\r
+-- Infinities\r
+cpnx011 copynegate  Infinity    -> -Infinity\r
+cpnx012 copynegate  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+cpnx021 copynegate         NaN  -> -NaN\r
+cpnx022 copynegate        -NaN  -> NaN\r
+cpnx023 copynegate        sNaN  -> -sNaN\r
+cpnx024 copynegate       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+cpnx031 copynegate       NaN13  -> -NaN13\r
+cpnx032 copynegate      -NaN13  -> NaN13\r
+cpnx033 copynegate      sNaN13  -> -sNaN13\r
+cpnx034 copynegate     -sNaN13  -> sNaN13\r
+cpnx035 copynegate       NaN70  -> -NaN70\r
+cpnx036 copynegate      -NaN70  -> NaN70\r
+cpnx037 copynegate      sNaN101 -> -sNaN101\r
+cpnx038 copynegate     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+cpnx101 copynegate          7   -> -7\r
+cpnx102 copynegate         -7   -> 7\r
+cpnx103 copynegate         75   -> -75\r
+cpnx104 copynegate        -75   -> 75\r
+cpnx105 copynegate       7.50   -> -7.50\r
+cpnx106 copynegate      -7.50   -> 7.50\r
+cpnx107 copynegate       7.500  -> -7.500\r
+cpnx108 copynegate      -7.500  -> 7.500\r
+\r
+-- zeros\r
+cpnx111 copynegate          0   -> -0\r
+cpnx112 copynegate         -0   -> 0\r
+cpnx113 copynegate       0E+4   -> -0E+4\r
+cpnx114 copynegate      -0E+4   -> 0E+4\r
+cpnx115 copynegate     0.0000   -> -0.0000\r
+cpnx116 copynegate    -0.0000   -> 0.0000\r
+cpnx117 copynegate      0E-141  -> -0E-141\r
+cpnx118 copynegate     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+cpnx121 copynegate  268268268         -> -268268268\r
+cpnx122 copynegate  -268268268        -> 268268268\r
+cpnx123 copynegate  134134134         -> -134134134\r
+cpnx124 copynegate  -134134134        -> 134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+cpnx131 copynegate  9.99999999E+999   -> -9.99999999E+999\r
+cpnx132 copynegate  1E-999                     -> -1E-999\r
+cpnx133 copynegate  1.00000000E-999   -> -1.00000000E-999\r
+cpnx134 copynegate  1E-1007                    -> -1E-1007\r
+\r
+cpnx135 copynegate  -1E-1007                   -> 1E-1007\r
+cpnx136 copynegate  -1.00000000E-999  -> 1.00000000E-999\r
+cpnx137 copynegate  -1E-999                    -> 1E-999\r
+cpnx138 copynegate  -9.99999999E+999  -> 9.99999999E+999\r
diff --git a/Lib/test/decimaltestdata/copysign.decTest b/Lib/test/decimaltestdata/copysign.decTest
new file mode 100644 (file)
index 0000000..6b20fda
--- /dev/null
@@ -0,0 +1,177 @@
+------------------------------------------------------------------------\r
+-- copysign.decTest -- quiet copy with sign from rhs                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check, and examples from decArith\r
+cpsx001 copysign   +7.50       11  -> 7.50\r
+cpsx002 copysign   '1.50'   '7.33' -> 1.50\r
+cpsx003 copysign  '-1.50'   '7.33' -> 1.50\r
+cpsx004 copysign   '1.50'  '-7.33' -> -1.50\r
+cpsx005 copysign  '-1.50'  '-7.33' -> -1.50\r
+\r
+-- Infinities\r
+cpsx011 copysign  Infinity       11 -> Infinity\r
+cpsx012 copysign  -Infinity      11 -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+cpsx021 copysign         NaN     11 -> NaN\r
+cpsx022 copysign        -NaN     11 -> NaN\r
+cpsx023 copysign        sNaN     11 -> sNaN\r
+cpsx024 copysign       -sNaN     11 -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+cpsx031 copysign       NaN10     11 -> NaN10\r
+cpsx032 copysign      -NaN10     11 -> NaN10\r
+cpsx033 copysign      sNaN10     11 -> sNaN10\r
+cpsx034 copysign     -sNaN10     11 -> sNaN10\r
+cpsx035 copysign       NaN7      11 -> NaN7\r
+cpsx036 copysign      -NaN7      11 -> NaN7\r
+cpsx037 copysign      sNaN101    11 -> sNaN101\r
+cpsx038 copysign     -sNaN101    11 -> sNaN101\r
+\r
+-- finites\r
+cpsx101 copysign          7      11 -> 7\r
+cpsx102 copysign         -7      11 -> 7\r
+cpsx103 copysign         75      11 -> 75\r
+cpsx104 copysign        -75      11 -> 75\r
+cpsx105 copysign       7.50      11 -> 7.50\r
+cpsx106 copysign      -7.50      11 -> 7.50\r
+cpsx107 copysign       7.500     11 -> 7.500\r
+cpsx108 copysign      -7.500     11 -> 7.500\r
+\r
+-- zeros\r
+cpsx111 copysign          0      11 -> 0\r
+cpsx112 copysign         -0      11 -> 0\r
+cpsx113 copysign       0E+4      11 -> 0E+4\r
+cpsx114 copysign      -0E+4      11 -> 0E+4\r
+cpsx115 copysign     0.0000      11 -> 0.0000\r
+cpsx116 copysign    -0.0000      11 -> 0.0000\r
+cpsx117 copysign      0E-141     11 -> 0E-141\r
+cpsx118 copysign     -0E-141     11 -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+cpsx121 copysign   268268268           11 -> 268268268\r
+cpsx122 copysign  -268268268           11 -> 268268268\r
+cpsx123 copysign   134134134           11 -> 134134134\r
+cpsx124 copysign  -134134134           11 -> 134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+cpsx131 copysign  9.99999999E+999      11 -> 9.99999999E+999\r
+cpsx132 copysign  1E-999               11 -> 1E-999\r
+cpsx133 copysign  1.00000000E-999      11 -> 1.00000000E-999\r
+cpsx134 copysign  1E-1007              11 -> 1E-1007\r
+\r
+cpsx135 copysign  -1E-1007             11 -> 1E-1007\r
+cpsx136 copysign  -1.00000000E-999     11 -> 1.00000000E-999\r
+cpsx137 copysign  -1E-999              11 -> 1E-999\r
+cpsx138 copysign  -9.99999999E+999     11 -> 9.99999999E+999\r
+\r
+-- repeat with negative RHS\r
+\r
+-- Infinities\r
+cpsx211 copysign  Infinity       -34 -> -Infinity\r
+cpsx212 copysign  -Infinity      -34 -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+cpsx221 copysign         NaN     -34 -> -NaN\r
+cpsx222 copysign        -NaN     -34 -> -NaN\r
+cpsx223 copysign        sNaN     -34 -> -sNaN\r
+cpsx224 copysign       -sNaN     -34 -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+cpsx231 copysign       NaN10     -34 -> -NaN10\r
+cpsx232 copysign      -NaN10     -34 -> -NaN10\r
+cpsx233 copysign      sNaN10     -34 -> -sNaN10\r
+cpsx234 copysign     -sNaN10     -34 -> -sNaN10\r
+cpsx235 copysign       NaN7      -34 -> -NaN7\r
+cpsx236 copysign      -NaN7      -34 -> -NaN7\r
+cpsx237 copysign      sNaN101    -34 -> -sNaN101\r
+cpsx238 copysign     -sNaN101    -34 -> -sNaN101\r
+\r
+-- finites\r
+cpsx301 copysign          7      -34 -> -7\r
+cpsx302 copysign         -7      -34 -> -7\r
+cpsx303 copysign         75      -34 -> -75\r
+cpsx304 copysign        -75      -34 -> -75\r
+cpsx305 copysign       7.50      -34 -> -7.50\r
+cpsx306 copysign      -7.50      -34 -> -7.50\r
+cpsx307 copysign       7.500     -34 -> -7.500\r
+cpsx308 copysign      -7.500     -34 -> -7.500\r
+\r
+-- zeros\r
+cpsx311 copysign          0      -34 -> -0\r
+cpsx312 copysign         -0      -34 -> -0\r
+cpsx313 copysign       0E+4      -34 -> -0E+4\r
+cpsx314 copysign      -0E+4      -34 -> -0E+4\r
+cpsx315 copysign     0.0000      -34 -> -0.0000\r
+cpsx316 copysign    -0.0000      -34 -> -0.0000\r
+cpsx317 copysign      0E-141     -34 -> -0E-141\r
+cpsx318 copysign     -0E-141     -34 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+cpsx321 copysign   268268268          -18 -> -268268268\r
+cpsx322 copysign  -268268268          -18 -> -268268268\r
+cpsx323 copysign   134134134          -18 -> -134134134\r
+cpsx324 copysign  -134134134          -18 -> -134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+cpsx331 copysign  9.99999999E+999     -18 -> -9.99999999E+999\r
+cpsx332 copysign  1E-999              -18 -> -1E-999\r
+cpsx333 copysign  1.00000000E-999     -18 -> -1.00000000E-999\r
+cpsx334 copysign  1E-1007             -18 -> -1E-1007\r
+\r
+cpsx335 copysign  -1E-1007            -18 -> -1E-1007\r
+cpsx336 copysign  -1.00000000E-999    -18 -> -1.00000000E-999\r
+cpsx337 copysign  -1E-999             -18 -> -1E-999\r
+cpsx338 copysign  -9.99999999E+999    -18 -> -9.99999999E+999\r
+\r
+-- Other kinds of RHS\r
+cpsx401 copysign          701    -34 -> -701\r
+cpsx402 copysign         -720    -34 -> -720\r
+cpsx403 copysign          701    -0  -> -701\r
+cpsx404 copysign         -720    -0  -> -720\r
+cpsx405 copysign          701    +0  ->  701\r
+cpsx406 copysign         -720    +0  ->  720\r
+cpsx407 copysign          701    +34 ->  701\r
+cpsx408 copysign         -720    +34 ->  720\r
+\r
+cpsx413 copysign          701    -Inf  -> -701\r
+cpsx414 copysign         -720    -Inf  -> -720\r
+cpsx415 copysign          701    +Inf  ->  701\r
+cpsx416 copysign         -720    +Inf  ->  720\r
+\r
+cpsx420 copysign          701    -NaN  -> -701\r
+cpsx421 copysign         -720    -NaN  -> -720\r
+cpsx422 copysign          701    +NaN  ->  701\r
+cpsx423 copysign         -720    +NaN  ->  720\r
+cpsx425 copysign         -720    +NaN8 ->  720\r
+\r
+cpsx426 copysign          701    -sNaN  -> -701\r
+cpsx427 copysign         -720    -sNaN  -> -720\r
+cpsx428 copysign          701    +sNaN  ->  701\r
+cpsx429 copysign         -720    +sNaN  ->  720\r
+cpsx430 copysign         -720    +sNaN3 ->  720\r
+\r
diff --git a/Lib/test/decimaltestdata/ddAbs.decTest b/Lib/test/decimaltestdata/ddAbs.decTest
new file mode 100644 (file)
index 0000000..4da662c
--- /dev/null
@@ -0,0 +1,126 @@
+------------------------------------------------------------------------\r
+-- ddAbs.decTest -- decDouble absolute value, heeding sNaN            --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddabs001 abs '1'      -> '1'\r
+ddabs002 abs '-1'     -> '1'\r
+ddabs003 abs '1.00'   -> '1.00'\r
+ddabs004 abs '-1.00'  -> '1.00'\r
+ddabs005 abs '0'      -> '0'\r
+ddabs006 abs '0.00'   -> '0.00'\r
+ddabs007 abs '00.0'   -> '0.0'\r
+ddabs008 abs '00.00'  -> '0.00'\r
+ddabs009 abs '00'     -> '0'\r
+\r
+ddabs010 abs '-2'     -> '2'\r
+ddabs011 abs '2'      -> '2'\r
+ddabs012 abs '-2.00'  -> '2.00'\r
+ddabs013 abs '2.00'   -> '2.00'\r
+ddabs014 abs '-0'     -> '0'\r
+ddabs015 abs '-0.00'  -> '0.00'\r
+ddabs016 abs '-00.0'  -> '0.0'\r
+ddabs017 abs '-00.00' -> '0.00'\r
+ddabs018 abs '-00'    -> '0'\r
+\r
+ddabs020 abs '-2000000' -> '2000000'\r
+ddabs021 abs '2000000'  -> '2000000'\r
+\r
+ddabs030 abs '+0.1'            -> '0.1'\r
+ddabs031 abs '-0.1'            -> '0.1'\r
+ddabs032 abs '+0.01'           -> '0.01'\r
+ddabs033 abs '-0.01'           -> '0.01'\r
+ddabs034 abs '+0.001'          -> '0.001'\r
+ddabs035 abs '-0.001'          -> '0.001'\r
+ddabs036 abs '+0.000001'       -> '0.000001'\r
+ddabs037 abs '-0.000001'       -> '0.000001'\r
+ddabs038 abs '+0.000000000001' -> '1E-12'\r
+ddabs039 abs '-0.000000000001' -> '1E-12'\r
+\r
+-- examples from decArith\r
+ddabs040 abs '2.1'     ->  '2.1'\r
+ddabs041 abs '-100'    ->  '100'\r
+ddabs042 abs '101.5'   ->  '101.5'\r
+ddabs043 abs '-101.5'  ->  '101.5'\r
+\r
+-- more fixed, potential LHS swaps/overlays if done by subtract 0\r
+ddabs060 abs '-56267E-10'  -> '0.0000056267'\r
+ddabs061 abs '-56267E-5'   -> '0.56267'\r
+ddabs062 abs '-56267E-2'   -> '562.67'\r
+ddabs063 abs '-56267E-1'   -> '5626.7'\r
+ddabs065 abs '-56267E-0'   -> '56267'\r
+\r
+-- subnormals and underflow\r
+\r
+-- long operand tests\r
+ddabs321 abs 1234567890123456  -> 1234567890123456\r
+ddabs322 abs 12345678000  -> 12345678000\r
+ddabs323 abs 1234567800   -> 1234567800\r
+ddabs324 abs 1234567890   -> 1234567890\r
+ddabs325 abs 1234567891   -> 1234567891\r
+ddabs326 abs 12345678901  -> 12345678901\r
+ddabs327 abs 1234567896   -> 1234567896\r
+\r
+-- zeros\r
+ddabs111 abs          0   -> 0\r
+ddabs112 abs         -0   -> 0\r
+ddabs113 abs       0E+6   -> 0E+6\r
+ddabs114 abs      -0E+6   -> 0E+6\r
+ddabs115 abs     0.0000   -> 0.0000\r
+ddabs116 abs    -0.0000   -> 0.0000\r
+ddabs117 abs      0E-141  -> 0E-141\r
+ddabs118 abs     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddabs121 abs  2682682682682682         -> 2682682682682682\r
+ddabs122 abs  -2682682682682682        -> 2682682682682682\r
+ddabs123 abs  1341341341341341         -> 1341341341341341\r
+ddabs124 abs  -1341341341341341        -> 1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddabs131 abs  9.999999999999999E+384   -> 9.999999999999999E+384\r
+ddabs132 abs  1E-383                   -> 1E-383\r
+ddabs133 abs  1.000000000000000E-383   -> 1.000000000000000E-383\r
+ddabs134 abs  1E-398                   -> 1E-398 Subnormal\r
+\r
+ddabs135 abs  -1E-398                  -> 1E-398 Subnormal\r
+ddabs136 abs  -1.000000000000000E-383  -> 1.000000000000000E-383\r
+ddabs137 abs  -1E-383                  -> 1E-383\r
+ddabs138 abs  -9.999999999999999E+384  -> 9.999999999999999E+384\r
+\r
+-- specials\r
+ddabs520 abs 'Inf'    -> 'Infinity'\r
+ddabs521 abs '-Inf'   -> 'Infinity'\r
+ddabs522 abs   NaN    ->  NaN\r
+ddabs523 abs  sNaN    ->  NaN   Invalid_operation\r
+ddabs524 abs   NaN22  ->  NaN22\r
+ddabs525 abs  sNaN33  ->  NaN33 Invalid_operation\r
+ddabs526 abs  -NaN22  -> -NaN22\r
+ddabs527 abs -sNaN33  -> -NaN33 Invalid_operation\r
+\r
+-- Null tests\r
+ddabs900 abs  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddAdd.decTest b/Lib/test/decimaltestdata/ddAdd.decTest
new file mode 100644 (file)
index 0000000..49d89d4
--- /dev/null
@@ -0,0 +1,1290 @@
+------------------------------------------------------------------------\r
+-- ddAdd.decTest -- decDouble addition                                --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decDoubles only; all arguments are\r
+-- representable in a decDouble\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- [first group are 'quick confidence check']\r
+ddadd001 add 1       1       ->  2\r
+ddadd002 add 2       3       ->  5\r
+ddadd003 add '5.75'  '3.3'   ->  9.05\r
+ddadd004 add '5'     '-3'    ->  2\r
+ddadd005 add '-5'    '-3'    ->  -8\r
+ddadd006 add '-7'    '2.5'   ->  -4.5\r
+ddadd007 add '0.7'   '0.3'   ->  1.0\r
+ddadd008 add '1.25'  '1.25'  ->  2.50\r
+ddadd009 add '1.23456789'  '1.00000000' -> '2.23456789'\r
+ddadd010 add '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+--             1234567890123456      1234567890123456\r
+ddadd011 add '0.4444444444444446'  '0.5555555555555555' -> '1.000000000000000' Inexact Rounded\r
+ddadd012 add '0.4444444444444445'  '0.5555555555555555' -> '1.000000000000000' Rounded\r
+ddadd013 add '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'\r
+ddadd014 add   '4444444444444444' '0.49'   -> '4444444444444444' Inexact Rounded\r
+ddadd015 add   '4444444444444444' '0.499'  -> '4444444444444444' Inexact Rounded\r
+ddadd016 add   '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded\r
+ddadd017 add   '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded\r
+ddadd018 add   '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded\r
+ddadd019 add   '4444444444444444' '0.501'  -> '4444444444444445' Inexact Rounded\r
+ddadd020 add   '4444444444444444' '0.51'   -> '4444444444444445' Inexact Rounded\r
+\r
+ddadd021 add 0 1 -> 1\r
+ddadd022 add 1 1 -> 2\r
+ddadd023 add 2 1 -> 3\r
+ddadd024 add 3 1 -> 4\r
+ddadd025 add 4 1 -> 5\r
+ddadd026 add 5 1 -> 6\r
+ddadd027 add 6 1 -> 7\r
+ddadd028 add 7 1 -> 8\r
+ddadd029 add 8 1 -> 9\r
+ddadd030 add 9 1 -> 10\r
+\r
+-- some carrying effects\r
+ddadd031 add '0.9998'  '0.0000' -> '0.9998'\r
+ddadd032 add '0.9998'  '0.0001' -> '0.9999'\r
+ddadd033 add '0.9998'  '0.0002' -> '1.0000'\r
+ddadd034 add '0.9998'  '0.0003' -> '1.0001'\r
+\r
+ddadd035 add '70'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd036 add '700'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd037 add '7000'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd038 add '70000'  '10000e+16' -> '1.000000000000001E+20' Inexact Rounded\r
+ddadd039 add '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded\r
+\r
+-- symmetry:\r
+ddadd040 add '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd041 add '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd042 add '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded\r
+ddadd044 add '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded\r
+ddadd045 add '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded\r
+\r
+-- same, without rounding\r
+ddadd046 add '10000e+9'  '7' -> '10000000000007'\r
+ddadd047 add '10000e+9'  '70' -> '10000000000070'\r
+ddadd048 add '10000e+9'  '700' -> '10000000000700'\r
+ddadd049 add '10000e+9'  '7000' -> '10000000007000'\r
+ddadd050 add '10000e+9'  '70000' -> '10000000070000'\r
+ddadd051 add '10000e+9'  '700000' -> '10000000700000'\r
+ddadd052 add '10000e+9'  '7000000' -> '10000007000000'\r
+\r
+-- examples from decarith\r
+ddadd053 add '12' '7.00' -> '19.00'\r
+ddadd054 add '1.3' '-1.07' -> '0.23'\r
+ddadd055 add '1.3' '-1.30' -> '0.00'\r
+ddadd056 add '1.3' '-2.07' -> '-0.77'\r
+ddadd057 add '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- leading zero preservation\r
+ddadd061 add 1 '0.0001' -> '1.0001'\r
+ddadd062 add 1 '0.00001' -> '1.00001'\r
+ddadd063 add 1 '0.000001' -> '1.000001'\r
+ddadd064 add 1 '0.0000001' -> '1.0000001'\r
+ddadd065 add 1 '0.00000001' -> '1.00000001'\r
+\r
+-- some funny zeros [in case of bad signum]\r
+ddadd070 add 1  0    -> 1\r
+ddadd071 add 1 0.    -> 1\r
+ddadd072 add 1  .0   -> 1.0\r
+ddadd073 add 1 0.0   -> 1.0\r
+ddadd074 add 1 0.00  -> 1.00\r
+ddadd075 add  0  1   -> 1\r
+ddadd076 add 0.  1   -> 1\r
+ddadd077 add  .0 1   -> 1.0\r
+ddadd078 add 0.0 1   -> 1.0\r
+ddadd079 add 0.00 1  -> 1.00\r
+\r
+-- some carries\r
+ddadd080 add 999999998 1  -> 999999999\r
+ddadd081 add 999999999 1  -> 1000000000\r
+ddadd082 add  99999999 1  -> 100000000\r
+ddadd083 add   9999999 1  -> 10000000\r
+ddadd084 add    999999 1  -> 1000000\r
+ddadd085 add     99999 1  -> 100000\r
+ddadd086 add      9999 1  -> 10000\r
+ddadd087 add       999 1  -> 1000\r
+ddadd088 add        99 1  -> 100\r
+ddadd089 add         9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+ddadd090 add '-56267E-10'   0 ->  '-0.0000056267'\r
+ddadd091 add '-56267E-6'    0 ->  '-0.056267'\r
+ddadd092 add '-56267E-5'    0 ->  '-0.56267'\r
+ddadd093 add '-56267E-4'    0 ->  '-5.6267'\r
+ddadd094 add '-56267E-3'    0 ->  '-56.267'\r
+ddadd095 add '-56267E-2'    0 ->  '-562.67'\r
+ddadd096 add '-56267E-1'    0 ->  '-5626.7'\r
+ddadd097 add '-56267E-0'    0 ->  '-56267'\r
+ddadd098 add '-5E-10'       0 ->  '-5E-10'\r
+ddadd099 add '-5E-7'        0 ->  '-5E-7'\r
+ddadd100 add '-5E-6'        0 ->  '-0.000005'\r
+ddadd101 add '-5E-5'        0 ->  '-0.00005'\r
+ddadd102 add '-5E-4'        0 ->  '-0.0005'\r
+ddadd103 add '-5E-1'        0 ->  '-0.5'\r
+ddadd104 add '-5E0'         0 ->  '-5'\r
+ddadd105 add '-5E1'         0 ->  '-50'\r
+ddadd106 add '-5E5'         0 ->  '-500000'\r
+ddadd107 add '-5E15'        0 ->  '-5000000000000000'\r
+ddadd108 add '-5E16'        0 ->  '-5.000000000000000E+16'  Rounded\r
+ddadd109 add '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded\r
+ddadd110 add '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded\r
+ddadd111 add '-5E100'       0 ->  '-5.000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+ddadd113 add 0  '-56267E-10' ->  '-0.0000056267'\r
+ddadd114 add 0  '-56267E-6'  ->  '-0.056267'\r
+ddadd116 add 0  '-56267E-5'  ->  '-0.56267'\r
+ddadd117 add 0  '-56267E-4'  ->  '-5.6267'\r
+ddadd119 add 0  '-56267E-3'  ->  '-56.267'\r
+ddadd120 add 0  '-56267E-2'  ->  '-562.67'\r
+ddadd121 add 0  '-56267E-1'  ->  '-5626.7'\r
+ddadd122 add 0  '-56267E-0'  ->  '-56267'\r
+ddadd123 add 0  '-5E-10'     ->  '-5E-10'\r
+ddadd124 add 0  '-5E-7'      ->  '-5E-7'\r
+ddadd125 add 0  '-5E-6'      ->  '-0.000005'\r
+ddadd126 add 0  '-5E-5'      ->  '-0.00005'\r
+ddadd127 add 0  '-5E-4'      ->  '-0.0005'\r
+ddadd128 add 0  '-5E-1'      ->  '-0.5'\r
+ddadd129 add 0  '-5E0'       ->  '-5'\r
+ddadd130 add 0  '-5E1'       ->  '-50'\r
+ddadd131 add 0  '-5E5'       ->  '-500000'\r
+ddadd132 add 0  '-5E15'      ->  '-5000000000000000'\r
+ddadd133 add 0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded\r
+ddadd134 add 0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded\r
+ddadd135 add 0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded\r
+ddadd136 add 0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded\r
+\r
+-- related\r
+ddadd137 add  1  '0E-19'      ->  '1.000000000000000'  Rounded\r
+ddadd138 add -1  '0E-19'      ->  '-1.000000000000000' Rounded\r
+ddadd139 add '0E-19' 1        ->  '1.000000000000000'  Rounded\r
+ddadd140 add '0E-19' -1       ->  '-1.000000000000000' Rounded\r
+ddadd141 add 1E+11   0.0000   ->  '100000000000.0000'\r
+ddadd142 add 1E+11   0.00000  ->  '100000000000.0000'  Rounded\r
+ddadd143 add 0.000   1E+12    ->  '1000000000000.000'\r
+ddadd144 add 0.0000  1E+12    ->  '1000000000000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+ddadd146 add '00.0'  0       ->  '0.0'\r
+ddadd147 add '0.00'  0       ->  '0.00'\r
+ddadd148 add  0      '0.00'  ->  '0.00'\r
+ddadd149 add  0      '00.0'  ->  '0.0'\r
+ddadd150 add '00.0'  '0.00'  ->  '0.00'\r
+ddadd151 add '0.00'  '00.0'  ->  '0.00'\r
+ddadd152 add '3'     '.3'    ->  '3.3'\r
+ddadd153 add '3.'    '.3'    ->  '3.3'\r
+ddadd154 add '3.0'   '.3'    ->  '3.3'\r
+ddadd155 add '3.00'  '.3'    ->  '3.30'\r
+ddadd156 add '3'     '3'     ->  '6'\r
+ddadd157 add '3'     '+3'    ->  '6'\r
+ddadd158 add '3'     '-3'    ->  '0'\r
+ddadd159 add '0.3'   '-0.3'  ->  '0.0'\r
+ddadd160 add '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+ddadd161 add '1E+12' '-1'    -> '999999999999'\r
+ddadd162 add '1E+12'  '1.11' -> '1000000000001.11'\r
+ddadd163 add '1.11'  '1E+12' -> '1000000000001.11'\r
+ddadd164 add '-1'    '1E+12' -> '999999999999'\r
+ddadd165 add '7E+12' '-1'    -> '6999999999999'\r
+ddadd166 add '7E+12'  '1.11' -> '7000000000001.11'\r
+ddadd167 add '1.11'  '7E+12' -> '7000000000001.11'\r
+ddadd168 add '-1'    '7E+12' -> '6999999999999'\r
+\r
+rounding: half_up\r
+--           1.234567890123456      1234567890123456      1 234567890123456\r
+ddadd170 add '4.444444444444444'  '0.5555555555555567' -> '5.000000000000001' Inexact Rounded\r
+ddadd171 add '4.444444444444444'  '0.5555555555555566' -> '5.000000000000001' Inexact Rounded\r
+ddadd172 add '4.444444444444444'  '0.5555555555555565' -> '5.000000000000001' Inexact Rounded\r
+ddadd173 add '4.444444444444444'  '0.5555555555555564' -> '5.000000000000000' Inexact Rounded\r
+ddadd174 add '4.444444444444444'  '0.5555555555555553' -> '4.999999999999999' Inexact Rounded\r
+ddadd175 add '4.444444444444444'  '0.5555555555555552' -> '4.999999999999999' Inexact Rounded\r
+ddadd176 add '4.444444444444444'  '0.5555555555555551' -> '4.999999999999999' Inexact Rounded\r
+ddadd177 add '4.444444444444444'  '0.5555555555555550' -> '4.999999999999999' Rounded\r
+ddadd178 add '4.444444444444444'  '0.5555555555555545' -> '4.999999999999999' Inexact Rounded\r
+ddadd179 add '4.444444444444444'  '0.5555555555555544' -> '4.999999999999998' Inexact Rounded\r
+ddadd180 add '4.444444444444444'  '0.5555555555555543' -> '4.999999999999998' Inexact Rounded\r
+ddadd181 add '4.444444444444444'  '0.5555555555555542' -> '4.999999999999998' Inexact Rounded\r
+ddadd182 add '4.444444444444444'  '0.5555555555555541' -> '4.999999999999998' Inexact Rounded\r
+ddadd183 add '4.444444444444444'  '0.5555555555555540' -> '4.999999999999998' Rounded\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+ddadd200 add '1234560123456789' 0             -> '1234560123456789'\r
+ddadd201 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddadd202 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddadd203 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddadd204 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddadd205 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddadd206 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddadd207 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddadd208 add '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded\r
+ddadd209 add '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded\r
+ddadd210 add '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded\r
+ddadd211 add '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded\r
+ddadd212 add '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded\r
+ddadd213 add '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded\r
+ddadd214 add '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded\r
+ddadd215 add '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded\r
+ddadd216 add '1234560123456789' 1             -> '1234560123456790'\r
+ddadd217 add '1234560123456789' 1.000000001   -> '1234560123456790' Inexact Rounded\r
+ddadd218 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddadd219 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddadd220 add '1234560123456789' 0             -> '1234560123456789'\r
+ddadd221 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddadd222 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddadd223 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddadd224 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddadd225 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddadd226 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddadd227 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddadd228 add '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded\r
+ddadd229 add '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded\r
+ddadd230 add '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded\r
+ddadd231 add '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded\r
+ddadd232 add '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded\r
+ddadd233 add '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded\r
+ddadd234 add '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded\r
+ddadd235 add '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded\r
+ddadd236 add '1234560123456789' 1             -> '1234560123456790'\r
+ddadd237 add '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded\r
+ddadd238 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddadd239 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+ddadd240 add '1234560123456788' 0.499999999   -> '1234560123456788' Inexact Rounded\r
+ddadd241 add '1234560123456788' 0.5           -> '1234560123456788' Inexact Rounded\r
+ddadd242 add '1234560123456788' 0.500000001   -> '1234560123456789' Inexact Rounded\r
+\r
+rounding: down\r
+ddadd250 add '1234560123456789' 0             -> '1234560123456789'\r
+ddadd251 add '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddadd252 add '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddadd253 add '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddadd254 add '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddadd255 add '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddadd256 add '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddadd257 add '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddadd258 add '1234560123456789' 0.5           -> '1234560123456789' Inexact Rounded\r
+ddadd259 add '1234560123456789' 0.500000001   -> '1234560123456789' Inexact Rounded\r
+ddadd260 add '1234560123456789' 0.500001      -> '1234560123456789' Inexact Rounded\r
+ddadd261 add '1234560123456789' 0.51          -> '1234560123456789' Inexact Rounded\r
+ddadd262 add '1234560123456789' 0.6           -> '1234560123456789' Inexact Rounded\r
+ddadd263 add '1234560123456789' 0.9           -> '1234560123456789' Inexact Rounded\r
+ddadd264 add '1234560123456789' 0.99999       -> '1234560123456789' Inexact Rounded\r
+ddadd265 add '1234560123456789' 0.999999999   -> '1234560123456789' Inexact Rounded\r
+ddadd266 add '1234560123456789' 1             -> '1234560123456790'\r
+ddadd267 add '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded\r
+ddadd268 add '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddadd269 add '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_up\r
+ddadd301 add  -1   1      ->   0\r
+ddadd302 add   0   1      ->   1\r
+ddadd303 add   1   1      ->   2\r
+ddadd304 add  12   1      ->  13\r
+ddadd305 add  98   1      ->  99\r
+ddadd306 add  99   1      -> 100\r
+ddadd307 add 100   1      -> 101\r
+ddadd308 add 101   1      -> 102\r
+ddadd309 add  -1  -1      ->  -2\r
+ddadd310 add   0  -1      ->  -1\r
+ddadd311 add   1  -1      ->   0\r
+ddadd312 add  12  -1      ->  11\r
+ddadd313 add  98  -1      ->  97\r
+ddadd314 add  99  -1      ->  98\r
+ddadd315 add 100  -1      ->  99\r
+ddadd316 add 101  -1      -> 100\r
+\r
+ddadd321 add -0.01  0.01    ->  0.00\r
+ddadd322 add  0.00  0.01    ->  0.01\r
+ddadd323 add  0.01  0.01    ->  0.02\r
+ddadd324 add  0.12  0.01    ->  0.13\r
+ddadd325 add  0.98  0.01    ->  0.99\r
+ddadd326 add  0.99  0.01    ->  1.00\r
+ddadd327 add  1.00  0.01    ->  1.01\r
+ddadd328 add  1.01  0.01    ->  1.02\r
+ddadd329 add -0.01 -0.01    -> -0.02\r
+ddadd330 add  0.00 -0.01    -> -0.01\r
+ddadd331 add  0.01 -0.01    ->  0.00\r
+ddadd332 add  0.12 -0.01    ->  0.11\r
+ddadd333 add  0.98 -0.01    ->  0.97\r
+ddadd334 add  0.99 -0.01    ->  0.98\r
+ddadd335 add  1.00 -0.01    ->  0.99\r
+ddadd336 add  1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where adding 0 affects the coefficient\r
+ddadd340 add 1E+3    0    ->         1000\r
+ddadd341 add 1E+15   0    ->    1000000000000000\r
+ddadd342 add 1E+16   0    ->   1.000000000000000E+16  Rounded\r
+ddadd343 add 1E+20   0    ->   1.000000000000000E+20  Rounded\r
+-- which simply follow from these cases ...\r
+ddadd344 add 1E+3    1    ->         1001\r
+ddadd345 add 1E+15   1    ->    1000000000000001\r
+ddadd346 add 1E+16   1    ->   1.000000000000000E+16  Inexact Rounded\r
+ddadd347 add 1E+20   1    ->   1.000000000000000E+20  Inexact Rounded\r
+ddadd348 add 1E+3    7    ->         1007\r
+ddadd349 add 1E+15   7    ->    1000000000000007\r
+ddadd350 add 1E+16   7    ->   1.000000000000001E+16  Inexact Rounded\r
+ddadd351 add 1E+20   7    ->   1.000000000000000E+20  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+ddadd360  add 0E+50 10000E+1  -> 1.0000E+5\r
+ddadd361  add 0E-50 10000E+1  -> 100000.0000000000 Rounded\r
+ddadd362  add 10000E+1 0E-50  -> 100000.0000000000 Rounded\r
+ddadd363  add 10000E+1 10000E-50  -> 100000.0000000000 Rounded Inexact\r
+ddadd364  add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369\r
+\r
+-- a curiosity from JSR 13 testing\r
+rounding:    half_down\r
+ddadd370 add  999999999999999 815 -> 1000000000000814\r
+ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+rounding:    half_up\r
+ddadd372 add  999999999999999 815 -> 1000000000000814\r
+ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+rounding:    half_even\r
+ddadd374 add  999999999999999 815 -> 1000000000000814\r
+ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+\r
+-- operands folded\r
+ddadd380 add   1E+384  1E+384  ->  2.000000000000000E+384  Clamped\r
+ddadd381 add   1E+380  1E+380  ->  2.00000000000E+380      Clamped\r
+ddadd382 add   1E+376  1E+376  ->  2.0000000E+376          Clamped\r
+ddadd383 add   1E+372  1E+372  ->  2.000E+372              Clamped\r
+ddadd384 add   1E+370  1E+370  ->  2.0E+370                Clamped\r
+ddadd385 add   1E+369  1E+369  ->  2E+369\r
+ddadd386 add   1E+368  1E+368  ->  2E+368\r
+\r
+-- ulp replacement tests\r
+ddadd400 add   1   77e-14      ->  1.00000000000077\r
+ddadd401 add   1   77e-15      ->  1.000000000000077\r
+ddadd402 add   1   77e-16      ->  1.000000000000008 Inexact Rounded\r
+ddadd403 add   1   77e-17      ->  1.000000000000001 Inexact Rounded\r
+ddadd404 add   1   77e-18      ->  1.000000000000000 Inexact Rounded\r
+ddadd405 add   1   77e-19      ->  1.000000000000000 Inexact Rounded\r
+ddadd406 add   1   77e-299     ->  1.000000000000000 Inexact Rounded\r
+\r
+ddadd410 add  10   77e-14      ->  10.00000000000077\r
+ddadd411 add  10   77e-15      ->  10.00000000000008 Inexact Rounded\r
+ddadd412 add  10   77e-16      ->  10.00000000000001 Inexact Rounded\r
+ddadd413 add  10   77e-17      ->  10.00000000000000 Inexact Rounded\r
+ddadd414 add  10   77e-18      ->  10.00000000000000 Inexact Rounded\r
+ddadd415 add  10   77e-19      ->  10.00000000000000 Inexact Rounded\r
+ddadd416 add  10   77e-299     ->  10.00000000000000 Inexact Rounded\r
+\r
+ddadd420 add  77e-14       1   ->  1.00000000000077\r
+ddadd421 add  77e-15       1   ->  1.000000000000077\r
+ddadd422 add  77e-16       1   ->  1.000000000000008 Inexact Rounded\r
+ddadd423 add  77e-17       1   ->  1.000000000000001 Inexact Rounded\r
+ddadd424 add  77e-18       1   ->  1.000000000000000 Inexact Rounded\r
+ddadd425 add  77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+ddadd426 add  77e-299      1   ->  1.000000000000000 Inexact Rounded\r
+\r
+ddadd430 add  77e-14      10   ->  10.00000000000077\r
+ddadd431 add  77e-15      10   ->  10.00000000000008 Inexact Rounded\r
+ddadd432 add  77e-16      10   ->  10.00000000000001 Inexact Rounded\r
+ddadd433 add  77e-17      10   ->  10.00000000000000 Inexact Rounded\r
+ddadd434 add  77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+ddadd435 add  77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+ddadd436 add  77e-299     10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+ddadd6440 add   1   -77e-14      ->  0.99999999999923\r
+ddadd6441 add   1   -77e-15      ->  0.999999999999923\r
+ddadd6442 add   1   -77e-16      ->  0.9999999999999923\r
+ddadd6443 add   1   -77e-17      ->  0.9999999999999992 Inexact Rounded\r
+ddadd6444 add   1   -77e-18      ->  0.9999999999999999 Inexact Rounded\r
+ddadd6445 add   1   -77e-19      ->  1.000000000000000 Inexact Rounded\r
+ddadd6446 add   1   -77e-99      ->  1.000000000000000 Inexact Rounded\r
+\r
+ddadd6450 add  10   -77e-14      ->   9.99999999999923\r
+ddadd6451 add  10   -77e-15      ->   9.999999999999923\r
+ddadd6452 add  10   -77e-16      ->   9.999999999999992 Inexact Rounded\r
+ddadd6453 add  10   -77e-17      ->   9.999999999999999 Inexact Rounded\r
+ddadd6454 add  10   -77e-18      ->  10.00000000000000 Inexact Rounded\r
+ddadd6455 add  10   -77e-19      ->  10.00000000000000 Inexact Rounded\r
+ddadd6456 add  10   -77e-99      ->  10.00000000000000 Inexact Rounded\r
+\r
+ddadd6460 add  -77e-14       1   ->  0.99999999999923\r
+ddadd6461 add  -77e-15       1   ->  0.999999999999923\r
+ddadd6462 add  -77e-16       1   ->  0.9999999999999923\r
+ddadd6463 add  -77e-17       1   ->  0.9999999999999992 Inexact Rounded\r
+ddadd6464 add  -77e-18       1   ->  0.9999999999999999 Inexact Rounded\r
+ddadd6465 add  -77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+ddadd6466 add  -77e-99       1   ->  1.000000000000000 Inexact Rounded\r
+\r
+ddadd6470 add  -77e-14      10   ->   9.99999999999923\r
+ddadd6471 add  -77e-15      10   ->   9.999999999999923\r
+ddadd6472 add  -77e-16      10   ->   9.999999999999992 Inexact Rounded\r
+ddadd6473 add  -77e-17      10   ->   9.999999999999999 Inexact Rounded\r
+ddadd6474 add  -77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+ddadd6475 add  -77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+ddadd6476 add  -77e-99      10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+ddadd6480 add  -1    77e-14      ->  -0.99999999999923\r
+ddadd6481 add  -1    77e-15      ->  -0.999999999999923\r
+ddadd6482 add  -1    77e-16      ->  -0.9999999999999923\r
+ddadd6483 add  -1    77e-17      ->  -0.9999999999999992 Inexact Rounded\r
+ddadd6484 add  -1    77e-18      ->  -0.9999999999999999 Inexact Rounded\r
+ddadd6485 add  -1    77e-19      ->  -1.000000000000000 Inexact Rounded\r
+ddadd6486 add  -1    77e-99      ->  -1.000000000000000 Inexact Rounded\r
+\r
+ddadd6490 add -10    77e-14      ->   -9.99999999999923\r
+ddadd6491 add -10    77e-15      ->   -9.999999999999923\r
+ddadd6492 add -10    77e-16      ->   -9.999999999999992 Inexact Rounded\r
+ddadd6493 add -10    77e-17      ->   -9.999999999999999 Inexact Rounded\r
+ddadd6494 add -10    77e-18      ->  -10.00000000000000 Inexact Rounded\r
+ddadd6495 add -10    77e-19      ->  -10.00000000000000 Inexact Rounded\r
+ddadd6496 add -10    77e-99      ->  -10.00000000000000 Inexact Rounded\r
+\r
+ddadd6500 add   77e-14      -1   ->  -0.99999999999923\r
+ddadd6501 add   77e-15      -1   ->  -0.999999999999923\r
+ddadd6502 add   77e-16      -1   ->  -0.9999999999999923\r
+ddadd6503 add   77e-17      -1   ->  -0.9999999999999992 Inexact Rounded\r
+ddadd6504 add   77e-18      -1   ->  -0.9999999999999999 Inexact Rounded\r
+ddadd6505 add   77e-19      -1   ->  -1.000000000000000 Inexact Rounded\r
+ddadd6506 add   77e-99      -1   ->  -1.000000000000000 Inexact Rounded\r
+\r
+ddadd6510 add   77e-14      -10  ->   -9.99999999999923\r
+ddadd6511 add   77e-15      -10  ->   -9.999999999999923\r
+ddadd6512 add   77e-16      -10  ->   -9.999999999999992 Inexact Rounded\r
+ddadd6513 add   77e-17      -10  ->   -9.999999999999999 Inexact Rounded\r
+ddadd6514 add   77e-18      -10  ->  -10.00000000000000 Inexact Rounded\r
+ddadd6515 add   77e-19      -10  ->  -10.00000000000000 Inexact Rounded\r
+ddadd6516 add   77e-99      -10  ->  -10.00000000000000 Inexact Rounded\r
+\r
+-- and some more residue effects and different roundings\r
+rounding: half_up\r
+ddadd6540 add '6543210123456789' 0             -> '6543210123456789'\r
+ddadd6541 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddadd6542 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddadd6543 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddadd6544 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddadd6545 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddadd6546 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddadd6547 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddadd6548 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+ddadd6549 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+ddadd6550 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+ddadd6551 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+ddadd6552 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+ddadd6553 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+ddadd6554 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+ddadd6555 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded\r
+ddadd6556 add '6543210123456789' 1             -> '6543210123456790'\r
+ddadd6557 add '6543210123456789' 1.000000001   -> '6543210123456790' Inexact Rounded\r
+ddadd6558 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddadd6559 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddadd6560 add '6543210123456789' 0             -> '6543210123456789'\r
+ddadd6561 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddadd6562 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddadd6563 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddadd6564 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddadd6565 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddadd6566 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddadd6567 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddadd6568 add '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+ddadd6569 add '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+ddadd6570 add '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+ddadd6571 add '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+ddadd6572 add '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+ddadd6573 add '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+ddadd6574 add '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+ddadd6575 add '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded\r
+ddadd6576 add '6543210123456789' 1             -> '6543210123456790'\r
+ddadd6577 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+ddadd6578 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddadd6579 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+-- critical few with even bottom digit...\r
+ddadd7540 add '6543210123456788' 0.499999999   -> '6543210123456788' Inexact Rounded\r
+ddadd7541 add '6543210123456788' 0.5           -> '6543210123456788' Inexact Rounded\r
+ddadd7542 add '6543210123456788' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+\r
+rounding: down\r
+ddadd7550 add '6543210123456789' 0             -> '6543210123456789'\r
+ddadd7551 add '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddadd7552 add '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddadd7553 add '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddadd7554 add '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddadd7555 add '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddadd7556 add '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddadd7557 add '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddadd7558 add '6543210123456789' 0.5           -> '6543210123456789' Inexact Rounded\r
+ddadd7559 add '6543210123456789' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+ddadd7560 add '6543210123456789' 0.500001      -> '6543210123456789' Inexact Rounded\r
+ddadd7561 add '6543210123456789' 0.51          -> '6543210123456789' Inexact Rounded\r
+ddadd7562 add '6543210123456789' 0.6           -> '6543210123456789' Inexact Rounded\r
+ddadd7563 add '6543210123456789' 0.9           -> '6543210123456789' Inexact Rounded\r
+ddadd7564 add '6543210123456789' 0.99999       -> '6543210123456789' Inexact Rounded\r
+ddadd7565 add '6543210123456789' 0.999999999   -> '6543210123456789' Inexact Rounded\r
+ddadd7566 add '6543210123456789' 1             -> '6543210123456790'\r
+ddadd7567 add '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+ddadd7568 add '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddadd7569 add '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+-- verify a query\r
+rounding:     down\r
+ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded\r
+ddadd7662 add      0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded\r
+ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded\r
+ddadd7664 add      0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_even\r
+\r
+ddadd7701 add 5.00 1.00E-3 -> 5.00100\r
+ddadd7702 add 00.00 0.000  -> 0.000\r
+ddadd7703 add 00.00 0E-3   -> 0.000\r
+ddadd7704 add 0E-3  00.00  -> 0.000\r
+\r
+ddadd7710 add 0E+3  00.00  -> 0.00\r
+ddadd7711 add 0E+3  00.0   -> 0.0\r
+ddadd7712 add 0E+3  00.    -> 0\r
+ddadd7713 add 0E+3  00.E+1 -> 0E+1\r
+ddadd7714 add 0E+3  00.E+2 -> 0E+2\r
+ddadd7715 add 0E+3  00.E+3 -> 0E+3\r
+ddadd7716 add 0E+3  00.E+4 -> 0E+3\r
+ddadd7717 add 0E+3  00.E+5 -> 0E+3\r
+ddadd7718 add 0E+3  -00.0   -> 0.0\r
+ddadd7719 add 0E+3  -00.    -> 0\r
+ddadd7731 add 0E+3  -00.E+1 -> 0E+1\r
+\r
+ddadd7720 add 00.00  0E+3  -> 0.00\r
+ddadd7721 add 00.0   0E+3  -> 0.0\r
+ddadd7722 add 00.    0E+3  -> 0\r
+ddadd7723 add 00.E+1 0E+3  -> 0E+1\r
+ddadd7724 add 00.E+2 0E+3  -> 0E+2\r
+ddadd7725 add 00.E+3 0E+3  -> 0E+3\r
+ddadd7726 add 00.E+4 0E+3  -> 0E+3\r
+ddadd7727 add 00.E+5 0E+3  -> 0E+3\r
+ddadd7728 add -00.00 0E+3  -> 0.00\r
+ddadd7729 add -00.0  0E+3  -> 0.0\r
+ddadd7730 add -00.   0E+3  -> 0\r
+\r
+ddadd7732 add  0     0     ->  0\r
+ddadd7733 add  0    -0     ->  0\r
+ddadd7734 add -0     0     ->  0\r
+ddadd7735 add -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+ddadd7736 add  1    -1     ->  0\r
+ddadd7737 add -1    -1     -> -2\r
+ddadd7738 add  1     1     ->  2\r
+ddadd7739 add -1     1     ->  0\r
+\r
+ddadd7741 add  0    -1     -> -1\r
+ddadd7742 add -0    -1     -> -1\r
+ddadd7743 add  0     1     ->  1\r
+ddadd7744 add -0     1     ->  1\r
+ddadd7745 add -1     0     -> -1\r
+ddadd7746 add -1    -0     -> -1\r
+ddadd7747 add  1     0     ->  1\r
+ddadd7748 add  1    -0     ->  1\r
+\r
+ddadd7751 add  0.0  -1     -> -1.0\r
+ddadd7752 add -0.0  -1     -> -1.0\r
+ddadd7753 add  0.0   1     ->  1.0\r
+ddadd7754 add -0.0   1     ->  1.0\r
+ddadd7755 add -1.0   0     -> -1.0\r
+ddadd7756 add -1.0  -0     -> -1.0\r
+ddadd7757 add  1.0   0     ->  1.0\r
+ddadd7758 add  1.0  -0     ->  1.0\r
+\r
+ddadd7761 add  0    -1.0   -> -1.0\r
+ddadd7762 add -0    -1.0   -> -1.0\r
+ddadd7763 add  0     1.0   ->  1.0\r
+ddadd7764 add -0     1.0   ->  1.0\r
+ddadd7765 add -1     0.0   -> -1.0\r
+ddadd7766 add -1    -0.0   -> -1.0\r
+ddadd7767 add  1     0.0   ->  1.0\r
+ddadd7768 add  1    -0.0   ->  1.0\r
+\r
+ddadd7771 add  0.0  -1.0   -> -1.0\r
+ddadd7772 add -0.0  -1.0   -> -1.0\r
+ddadd7773 add  0.0   1.0   ->  1.0\r
+ddadd7774 add -0.0   1.0   ->  1.0\r
+ddadd7775 add -1.0   0.0   -> -1.0\r
+ddadd7776 add -1.0  -0.0   -> -1.0\r
+ddadd7777 add  1.0   0.0   ->  1.0\r
+ddadd7778 add  1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+ddadd7780 add -Inf  -Inf   -> -Infinity\r
+ddadd7781 add -Inf  -1000  -> -Infinity\r
+ddadd7782 add -Inf  -1     -> -Infinity\r
+ddadd7783 add -Inf  -0     -> -Infinity\r
+ddadd7784 add -Inf   0     -> -Infinity\r
+ddadd7785 add -Inf   1     -> -Infinity\r
+ddadd7786 add -Inf   1000  -> -Infinity\r
+ddadd7787 add -1000 -Inf   -> -Infinity\r
+ddadd7788 add -Inf  -Inf   -> -Infinity\r
+ddadd7789 add -1    -Inf   -> -Infinity\r
+ddadd7790 add -0    -Inf   -> -Infinity\r
+ddadd7791 add  0    -Inf   -> -Infinity\r
+ddadd7792 add  1    -Inf   -> -Infinity\r
+ddadd7793 add  1000 -Inf   -> -Infinity\r
+ddadd7794 add  Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+ddadd7800 add  Inf  -Inf   ->  NaN  Invalid_operation\r
+ddadd7801 add  Inf  -1000  ->  Infinity\r
+ddadd7802 add  Inf  -1     ->  Infinity\r
+ddadd7803 add  Inf  -0     ->  Infinity\r
+ddadd7804 add  Inf   0     ->  Infinity\r
+ddadd7805 add  Inf   1     ->  Infinity\r
+ddadd7806 add  Inf   1000  ->  Infinity\r
+ddadd7807 add  Inf   Inf   ->  Infinity\r
+ddadd7808 add -1000  Inf   ->  Infinity\r
+ddadd7809 add -Inf   Inf   ->  NaN  Invalid_operation\r
+ddadd7810 add -1     Inf   ->  Infinity\r
+ddadd7811 add -0     Inf   ->  Infinity\r
+ddadd7812 add  0     Inf   ->  Infinity\r
+ddadd7813 add  1     Inf   ->  Infinity\r
+ddadd7814 add  1000  Inf   ->  Infinity\r
+ddadd7815 add  Inf   Inf   ->  Infinity\r
+\r
+ddadd7821 add  NaN -Inf    ->  NaN\r
+ddadd7822 add  NaN -1000   ->  NaN\r
+ddadd7823 add  NaN -1      ->  NaN\r
+ddadd7824 add  NaN -0      ->  NaN\r
+ddadd7825 add  NaN  0      ->  NaN\r
+ddadd7826 add  NaN  1      ->  NaN\r
+ddadd7827 add  NaN  1000   ->  NaN\r
+ddadd7828 add  NaN  Inf    ->  NaN\r
+ddadd7829 add  NaN  NaN    ->  NaN\r
+ddadd7830 add -Inf  NaN    ->  NaN\r
+ddadd7831 add -1000 NaN    ->  NaN\r
+ddadd7832 add -1    NaN    ->  NaN\r
+ddadd7833 add -0    NaN    ->  NaN\r
+ddadd7834 add  0    NaN    ->  NaN\r
+ddadd7835 add  1    NaN    ->  NaN\r
+ddadd7836 add  1000 NaN    ->  NaN\r
+ddadd7837 add  Inf  NaN    ->  NaN\r
+\r
+ddadd7841 add  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddadd7842 add  sNaN -1000  ->  NaN  Invalid_operation\r
+ddadd7843 add  sNaN -1     ->  NaN  Invalid_operation\r
+ddadd7844 add  sNaN -0     ->  NaN  Invalid_operation\r
+ddadd7845 add  sNaN  0     ->  NaN  Invalid_operation\r
+ddadd7846 add  sNaN  1     ->  NaN  Invalid_operation\r
+ddadd7847 add  sNaN  1000  ->  NaN  Invalid_operation\r
+ddadd7848 add  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddadd7849 add  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddadd7850 add  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddadd7851 add -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddadd7852 add -1000 sNaN   ->  NaN  Invalid_operation\r
+ddadd7853 add -1    sNaN   ->  NaN  Invalid_operation\r
+ddadd7854 add -0    sNaN   ->  NaN  Invalid_operation\r
+ddadd7855 add  0    sNaN   ->  NaN  Invalid_operation\r
+ddadd7856 add  1    sNaN   ->  NaN  Invalid_operation\r
+ddadd7857 add  1000 sNaN   ->  NaN  Invalid_operation\r
+ddadd7858 add  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddadd7859 add  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddadd7861 add  NaN1   -Inf    ->  NaN1\r
+ddadd7862 add +NaN2   -1000   ->  NaN2\r
+ddadd7863 add  NaN3    1000   ->  NaN3\r
+ddadd7864 add  NaN4    Inf    ->  NaN4\r
+ddadd7865 add  NaN5   +NaN6   ->  NaN5\r
+ddadd7866 add -Inf     NaN7   ->  NaN7\r
+ddadd7867 add -1000    NaN8   ->  NaN8\r
+ddadd7868 add  1000    NaN9   ->  NaN9\r
+ddadd7869 add  Inf    +NaN10  ->  NaN10\r
+ddadd7871 add  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+ddadd7872 add  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+ddadd7873 add  sNaN13   1000  ->  NaN13  Invalid_operation\r
+ddadd7874 add  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+ddadd7875 add  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+ddadd7876 add  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+ddadd7877 add -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+ddadd7878 add -1000    sNaN21 ->  NaN21  Invalid_operation\r
+ddadd7879 add  1000    sNaN22 ->  NaN22  Invalid_operation\r
+ddadd7880 add  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+ddadd7881 add +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+ddadd7882 add -NaN26    NaN28 -> -NaN26\r
+ddadd7883 add -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+ddadd7884 add  1000    -NaN30 -> -NaN30\r
+ddadd7885 add  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Here we explore near the boundary of rounding a subnormal to Nmin\r
+ddadd7575 add  1E-383 -1E-398 ->  9.99999999999999E-384  Subnormal\r
+ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384  Subnormal\r
+\r
+-- check overflow edge case\r
+--               1234567890123456\r
+ddadd7972 apply   9.999999999999999E+384         -> 9.999999999999999E+384\r
+ddadd7973 add     9.999999999999999E+384  1      -> 9.999999999999999E+384 Inexact Rounded\r
+ddadd7974 add      9999999999999999E+369  1      -> 9.999999999999999E+384 Inexact Rounded\r
+ddadd7975 add      9999999999999999E+369  1E+369  -> Infinity Overflow Inexact Rounded\r
+ddadd7976 add      9999999999999999E+369  9E+368  -> Infinity Overflow Inexact Rounded\r
+ddadd7977 add      9999999999999999E+369  8E+368  -> Infinity Overflow Inexact Rounded\r
+ddadd7978 add      9999999999999999E+369  7E+368  -> Infinity Overflow Inexact Rounded\r
+ddadd7979 add      9999999999999999E+369  6E+368  -> Infinity Overflow Inexact Rounded\r
+ddadd7980 add      9999999999999999E+369  5E+368  -> Infinity Overflow Inexact Rounded\r
+ddadd7981 add      9999999999999999E+369  4E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddadd7982 add      9999999999999999E+369  3E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddadd7983 add      9999999999999999E+369  2E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddadd7984 add      9999999999999999E+369  1E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+\r
+ddadd7985 apply  -9.999999999999999E+384         -> -9.999999999999999E+384\r
+ddadd7986 add    -9.999999999999999E+384 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+ddadd7987 add     -9999999999999999E+369 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+ddadd7988 add     -9999999999999999E+369 -1E+369  -> -Infinity Overflow Inexact Rounded\r
+ddadd7989 add     -9999999999999999E+369 -9E+368  -> -Infinity Overflow Inexact Rounded\r
+ddadd7990 add     -9999999999999999E+369 -8E+368  -> -Infinity Overflow Inexact Rounded\r
+ddadd7991 add     -9999999999999999E+369 -7E+368  -> -Infinity Overflow Inexact Rounded\r
+ddadd7992 add     -9999999999999999E+369 -6E+368  -> -Infinity Overflow Inexact Rounded\r
+ddadd7993 add     -9999999999999999E+369 -5E+368  -> -Infinity Overflow Inexact Rounded\r
+ddadd7994 add     -9999999999999999E+369 -4E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddadd7995 add     -9999999999999999E+369 -3E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddadd7996 add     -9999999999999999E+369 -2E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddadd7997 add     -9999999999999999E+369 -1E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+\r
+-- And for round down full and subnormal results\r
+rounding:     down\r
+ddadd71100 add 1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact\r
+ddadd71101 add 1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact\r
+ddadd71103 add   +1 -1e-383    -> 0.9999999999999999  Rounded Inexact\r
+ddadd71104 add 1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact\r
+ddadd71105 add 1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact\r
+ddadd71106 add 1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact\r
+ddadd71107 add 1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact\r
+ddadd71108 add 1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact\r
+ddadd71109 add 1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+ddadd71110 add -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact\r
+ddadd71111 add -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact\r
+ddadd71113 add    -1 +1e-383   -> -0.9999999999999999  Rounded Inexact\r
+ddadd71114 add -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact\r
+ddadd71115 add -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact\r
+ddadd71116 add -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact\r
+ddadd71117 add -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact\r
+ddadd71118 add -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact\r
+ddadd71119 add -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+rounding:     half_even\r
+\r
+ddadd71300 add 1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71310 add 1E16  -0.51                ->  9999999999999999      Inexact Rounded\r
+ddadd71311 add 1E16  -0.501               ->  9999999999999999      Inexact Rounded\r
+ddadd71312 add 1E16  -0.5001              ->  9999999999999999      Inexact Rounded\r
+ddadd71313 add 1E16  -0.50001             ->  9999999999999999      Inexact Rounded\r
+ddadd71314 add 1E16  -0.500001            ->  9999999999999999      Inexact Rounded\r
+ddadd71315 add 1E16  -0.5000001           ->  9999999999999999      Inexact Rounded\r
+ddadd71316 add 1E16  -0.50000001          ->  9999999999999999      Inexact Rounded\r
+ddadd71317 add 1E16  -0.500000001         ->  9999999999999999      Inexact Rounded\r
+ddadd71318 add 1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded\r
+ddadd71319 add 1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded\r
+ddadd71320 add 1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded\r
+ddadd71321 add 1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded\r
+ddadd71322 add 1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded\r
+ddadd71323 add 1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded\r
+ddadd71324 add 1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded\r
+ddadd71325 add 1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71326 add 1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71327 add 1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71328 add 1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71329 add 1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71330 add 1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71331 add 1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71332 add 1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71333 add 1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71334 add 1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71335 add 1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71336 add 1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71337 add 1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71338 add 1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71339 add 1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+ddadd71340 add 1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded\r
+ddadd71341 add 1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded\r
+\r
+ddadd71349 add 9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded\r
+ddadd71350 add 9999999999999999 0.49                ->  9999999999999999      Inexact Rounded\r
+ddadd71351 add 9999999999999999 0.499               ->  9999999999999999      Inexact Rounded\r
+ddadd71352 add 9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded\r
+ddadd71353 add 9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded\r
+ddadd71354 add 9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded\r
+ddadd71355 add 9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded\r
+ddadd71356 add 9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded\r
+ddadd71357 add 9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded\r
+ddadd71358 add 9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded\r
+ddadd71359 add 9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded\r
+ddadd71360 add 9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded\r
+ddadd71361 add 9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded\r
+ddadd71362 add 9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded\r
+ddadd71363 add 9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded\r
+ddadd71364 add 9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded\r
+ddadd71365 add 9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71367 add 9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71368 add 9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71369 add 9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71370 add 9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71371 add 9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71372 add 9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71373 add 9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71374 add 9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71375 add 9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71376 add 9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71377 add 9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71378 add 9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71379 add 9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71380 add 9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71381 add 9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71382 add 9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71383 add 9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71384 add 9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71385 add 9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71386 add 9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71387 add 9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71388 add 9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71389 add 9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71390 add 9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71391 add 9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71392 add 9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71393 add 9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71394 add 9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71395 add 9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded\r
+ddadd71396 add 9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+ddadd71420 add  0 1.123456789012345     -> 1.123456789012345\r
+ddadd71421 add  0 1.123456789012345E-1  -> 0.1123456789012345\r
+ddadd71422 add  0 1.123456789012345E-2  -> 0.01123456789012345\r
+ddadd71423 add  0 1.123456789012345E-3  -> 0.001123456789012345\r
+ddadd71424 add  0 1.123456789012345E-4  -> 0.0001123456789012345\r
+ddadd71425 add  0 1.123456789012345E-5  -> 0.00001123456789012345\r
+ddadd71426 add  0 1.123456789012345E-6  -> 0.000001123456789012345\r
+ddadd71427 add  0 1.123456789012345E-7  -> 1.123456789012345E-7\r
+ddadd71428 add  0 1.123456789012345E-8  -> 1.123456789012345E-8\r
+ddadd71429 add  0 1.123456789012345E-9  -> 1.123456789012345E-9\r
+ddadd71430 add  0 1.123456789012345E-10 -> 1.123456789012345E-10\r
+ddadd71431 add  0 1.123456789012345E-11 -> 1.123456789012345E-11\r
+ddadd71432 add  0 1.123456789012345E-12 -> 1.123456789012345E-12\r
+ddadd71433 add  0 1.123456789012345E-13 -> 1.123456789012345E-13\r
+ddadd71434 add  0 1.123456789012345E-14 -> 1.123456789012345E-14\r
+ddadd71435 add  0 1.123456789012345E-15 -> 1.123456789012345E-15\r
+ddadd71436 add  0 1.123456789012345E-16 -> 1.123456789012345E-16\r
+ddadd71437 add  0 1.123456789012345E-17 -> 1.123456789012345E-17\r
+ddadd71438 add  0 1.123456789012345E-18 -> 1.123456789012345E-18\r
+ddadd71439 add  0 1.123456789012345E-19 -> 1.123456789012345E-19\r
+\r
+-- same, reversed 0\r
+ddadd71440 add 1.123456789012345     0 -> 1.123456789012345\r
+ddadd71441 add 1.123456789012345E-1  0 -> 0.1123456789012345\r
+ddadd71442 add 1.123456789012345E-2  0 -> 0.01123456789012345\r
+ddadd71443 add 1.123456789012345E-3  0 -> 0.001123456789012345\r
+ddadd71444 add 1.123456789012345E-4  0 -> 0.0001123456789012345\r
+ddadd71445 add 1.123456789012345E-5  0 -> 0.00001123456789012345\r
+ddadd71446 add 1.123456789012345E-6  0 -> 0.000001123456789012345\r
+ddadd71447 add 1.123456789012345E-7  0 -> 1.123456789012345E-7\r
+ddadd71448 add 1.123456789012345E-8  0 -> 1.123456789012345E-8\r
+ddadd71449 add 1.123456789012345E-9  0 -> 1.123456789012345E-9\r
+ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10\r
+ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11\r
+ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12\r
+ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13\r
+ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14\r
+ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15\r
+ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16\r
+ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17\r
+ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18\r
+ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19\r
+\r
+-- same, Es on the 0\r
+ddadd71460 add 1.123456789012345  0E-0   -> 1.123456789012345\r
+ddadd71461 add 1.123456789012345  0E-1   -> 1.123456789012345\r
+ddadd71462 add 1.123456789012345  0E-2   -> 1.123456789012345\r
+ddadd71463 add 1.123456789012345  0E-3   -> 1.123456789012345\r
+ddadd71464 add 1.123456789012345  0E-4   -> 1.123456789012345\r
+ddadd71465 add 1.123456789012345  0E-5   -> 1.123456789012345\r
+ddadd71466 add 1.123456789012345  0E-6   -> 1.123456789012345\r
+ddadd71467 add 1.123456789012345  0E-7   -> 1.123456789012345\r
+ddadd71468 add 1.123456789012345  0E-8   -> 1.123456789012345\r
+ddadd71469 add 1.123456789012345  0E-9   -> 1.123456789012345\r
+ddadd71470 add 1.123456789012345  0E-10  -> 1.123456789012345\r
+ddadd71471 add 1.123456789012345  0E-11  -> 1.123456789012345\r
+ddadd71472 add 1.123456789012345  0E-12  -> 1.123456789012345\r
+ddadd71473 add 1.123456789012345  0E-13  -> 1.123456789012345\r
+ddadd71474 add 1.123456789012345  0E-14  -> 1.123456789012345\r
+ddadd71475 add 1.123456789012345  0E-15  -> 1.123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+ddadd71476 add 1.123456789012345  0E-16  -> 1.123456789012345 Rounded\r
+ddadd71477 add 1.123456789012345  0E-17  -> 1.123456789012345 Rounded\r
+ddadd71478 add 1.123456789012345  0E-18  -> 1.123456789012345 Rounded\r
+ddadd71479 add 1.123456789012345  0E-19  -> 1.123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+ddadd71500 add  0        0E-19  ->  0E-19\r
+ddadd71501 add -0        0E-19  ->  0E-19\r
+ddadd71502 add  0       -0E-19  ->  0E-19\r
+ddadd71503 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71511 add -11      11    ->  0\r
+ddadd71512 add  11     -11    ->  0\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+ddadd71520 add  0        0E-19  ->  0E-19\r
+ddadd71521 add -0        0E-19  ->  0E-19\r
+ddadd71522 add  0       -0E-19  ->  0E-19\r
+ddadd71523 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71531 add -11      11    ->  0\r
+ddadd71532 add  11     -11    ->  0\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+ddadd71540 add  0        0E-19  ->  0E-19\r
+ddadd71541 add -0        0E-19  ->  0E-19\r
+ddadd71542 add  0       -0E-19  ->  0E-19\r
+ddadd71543 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71551 add -11      11    ->  0\r
+ddadd71552 add  11     -11    ->  0\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+ddadd71560 add  0        0E-19  ->  0E-19\r
+ddadd71561 add -0        0E-19  ->  0E-19\r
+ddadd71562 add  0       -0E-19  ->  0E-19\r
+ddadd71563 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71571 add -11      11    ->  0\r
+ddadd71572 add  11     -11    ->  0\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+ddadd71580 add  0        0E-19  ->  0E-19\r
+ddadd71581 add -0        0E-19  ->  0E-19\r
+ddadd71582 add  0       -0E-19  ->  0E-19\r
+ddadd71583 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71591 add -11      11    ->  0\r
+ddadd71592 add  11     -11    ->  0\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+ddadd71600 add  0        0E-19  ->  0E-19\r
+ddadd71601 add -0        0E-19  ->  0E-19\r
+ddadd71602 add  0       -0E-19  ->  0E-19\r
+ddadd71603 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71611 add -11      11    ->  0\r
+ddadd71612 add  11     -11    ->  0\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+ddadd71620 add  0        0E-19  ->  0E-19\r
+ddadd71621 add -0        0E-19  -> -0E-19           -- *\r
+ddadd71622 add  0       -0E-19  -> -0E-19           -- *\r
+ddadd71623 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddadd71631 add -11      11    ->  -0                -- *\r
+ddadd71632 add  11     -11    ->  -0                -- *\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+ddadd71701 add 130E-2    120E-2    -> 2.50\r
+ddadd71702 add 130E-2    12E-1     -> 2.50\r
+ddadd71703 add 130E-2    1E0       -> 2.30\r
+ddadd71704 add 1E2       1E4       -> 1.01E+4\r
+ddadd71705 add 130E-2   -120E-2 -> 0.10\r
+ddadd71706 add 130E-2   -12E-1  -> 0.10\r
+ddadd71707 add 130E-2   -1E0    -> 0.30\r
+ddadd71708 add 1E2      -1E4    -> -9.9E+3\r
+\r
+-- Gappy coefficients; check residue handling even with full coefficient gap\r
+rounding: half_even\r
+\r
+ddadd75001 add 1234567890123456 1      -> 1234567890123457\r
+ddadd75002 add 1234567890123456 0.6    -> 1234567890123457  Inexact Rounded\r
+ddadd75003 add 1234567890123456 0.06   -> 1234567890123456  Inexact Rounded\r
+ddadd75004 add 1234567890123456 6E-3   -> 1234567890123456  Inexact Rounded\r
+ddadd75005 add 1234567890123456 6E-4   -> 1234567890123456  Inexact Rounded\r
+ddadd75006 add 1234567890123456 6E-5   -> 1234567890123456  Inexact Rounded\r
+ddadd75007 add 1234567890123456 6E-6   -> 1234567890123456  Inexact Rounded\r
+ddadd75008 add 1234567890123456 6E-7   -> 1234567890123456  Inexact Rounded\r
+ddadd75009 add 1234567890123456 6E-8   -> 1234567890123456  Inexact Rounded\r
+ddadd75010 add 1234567890123456 6E-9   -> 1234567890123456  Inexact Rounded\r
+ddadd75011 add 1234567890123456 6E-10  -> 1234567890123456  Inexact Rounded\r
+ddadd75012 add 1234567890123456 6E-11  -> 1234567890123456  Inexact Rounded\r
+ddadd75013 add 1234567890123456 6E-12  -> 1234567890123456  Inexact Rounded\r
+ddadd75014 add 1234567890123456 6E-13  -> 1234567890123456  Inexact Rounded\r
+ddadd75015 add 1234567890123456 6E-14  -> 1234567890123456  Inexact Rounded\r
+ddadd75016 add 1234567890123456 6E-15  -> 1234567890123456  Inexact Rounded\r
+ddadd75017 add 1234567890123456 6E-16  -> 1234567890123456  Inexact Rounded\r
+ddadd75018 add 1234567890123456 6E-17  -> 1234567890123456  Inexact Rounded\r
+ddadd75019 add 1234567890123456 6E-18  -> 1234567890123456  Inexact Rounded\r
+ddadd75020 add 1234567890123456 6E-19  -> 1234567890123456  Inexact Rounded\r
+ddadd75021 add 1234567890123456 6E-20  -> 1234567890123456  Inexact Rounded\r
+\r
+-- widening second argument at gap\r
+ddadd75030 add 12345678 1                       -> 12345679\r
+ddadd75031 add 12345678 0.1                     -> 12345678.1\r
+ddadd75032 add 12345678 0.12                    -> 12345678.12\r
+ddadd75033 add 12345678 0.123                   -> 12345678.123\r
+ddadd75034 add 12345678 0.1234                  -> 12345678.1234\r
+ddadd75035 add 12345678 0.12345                 -> 12345678.12345\r
+ddadd75036 add 12345678 0.123456                -> 12345678.123456\r
+ddadd75037 add 12345678 0.1234567               -> 12345678.1234567\r
+ddadd75038 add 12345678 0.12345678              -> 12345678.12345678\r
+ddadd75039 add 12345678 0.123456789             -> 12345678.12345679 Inexact Rounded\r
+ddadd75040 add 12345678 0.123456785             -> 12345678.12345678 Inexact Rounded\r
+ddadd75041 add 12345678 0.1234567850            -> 12345678.12345678 Inexact Rounded\r
+ddadd75042 add 12345678 0.1234567851            -> 12345678.12345679 Inexact Rounded\r
+ddadd75043 add 12345678 0.12345678501           -> 12345678.12345679 Inexact Rounded\r
+ddadd75044 add 12345678 0.123456785001          -> 12345678.12345679 Inexact Rounded\r
+ddadd75045 add 12345678 0.1234567850001         -> 12345678.12345679 Inexact Rounded\r
+ddadd75046 add 12345678 0.12345678500001        -> 12345678.12345679 Inexact Rounded\r
+ddadd75047 add 12345678 0.123456785000001       -> 12345678.12345679 Inexact Rounded\r
+ddadd75048 add 12345678 0.1234567850000001      -> 12345678.12345679 Inexact Rounded\r
+ddadd75049 add 12345678 0.1234567850000000      -> 12345678.12345678 Inexact Rounded\r
+--                               90123456\r
+rounding: half_even\r
+ddadd75050 add 12345678 0.0234567750000000      -> 12345678.02345678 Inexact Rounded\r
+ddadd75051 add 12345678 0.0034567750000000      -> 12345678.00345678 Inexact Rounded\r
+ddadd75052 add 12345678 0.0004567750000000      -> 12345678.00045678 Inexact Rounded\r
+ddadd75053 add 12345678 0.0000567750000000      -> 12345678.00005678 Inexact Rounded\r
+ddadd75054 add 12345678 0.0000067750000000      -> 12345678.00000678 Inexact Rounded\r
+ddadd75055 add 12345678 0.0000007750000000      -> 12345678.00000078 Inexact Rounded\r
+ddadd75056 add 12345678 0.0000000750000000      -> 12345678.00000008 Inexact Rounded\r
+ddadd75057 add 12345678 0.0000000050000000      -> 12345678.00000000 Inexact Rounded\r
+ddadd75060 add 12345678 0.0234567750000001      -> 12345678.02345678 Inexact Rounded\r
+ddadd75061 add 12345678 0.0034567750000001      -> 12345678.00345678 Inexact Rounded\r
+ddadd75062 add 12345678 0.0004567750000001      -> 12345678.00045678 Inexact Rounded\r
+ddadd75063 add 12345678 0.0000567750000001      -> 12345678.00005678 Inexact Rounded\r
+ddadd75064 add 12345678 0.0000067750000001      -> 12345678.00000678 Inexact Rounded\r
+ddadd75065 add 12345678 0.0000007750000001      -> 12345678.00000078 Inexact Rounded\r
+ddadd75066 add 12345678 0.0000000750000001      -> 12345678.00000008 Inexact Rounded\r
+ddadd75067 add 12345678 0.0000000050000001      -> 12345678.00000001 Inexact Rounded\r
+-- far-out residues (full coefficient gap is 16+15 digits)\r
+rounding: up\r
+ddadd75070 add 12345678 1E-8                    -> 12345678.00000001\r
+ddadd75071 add 12345678 1E-9                    -> 12345678.00000001 Inexact Rounded\r
+ddadd75072 add 12345678 1E-10                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75073 add 12345678 1E-11                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75074 add 12345678 1E-12                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75075 add 12345678 1E-13                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75076 add 12345678 1E-14                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75077 add 12345678 1E-15                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75078 add 12345678 1E-16                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75079 add 12345678 1E-17                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75080 add 12345678 1E-18                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75081 add 12345678 1E-19                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75082 add 12345678 1E-20                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75083 add 12345678 1E-25                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75084 add 12345678 1E-30                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75085 add 12345678 1E-31                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75086 add 12345678 1E-32                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75087 add 12345678 1E-33                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75088 add 12345678 1E-34                   -> 12345678.00000001 Inexact Rounded\r
+ddadd75089 add 12345678 1E-35                   -> 12345678.00000001 Inexact Rounded\r
+\r
+-- Punit's\r
+ddadd75100 add 1.000 -200.000                   -> -199.000\r
+\r
+-- Rounding swathe\r
+rounding: half_even\r
+ddadd81100 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81101 add  .2301    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81102 add  .2310    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81103 add  .2350    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81104 add  .2351    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81105 add  .2450    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81106 add  .2451    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81107 add  .2360    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81108 add  .2370    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81109 add  .2399    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81120 add  9999999999999999E+369  9E+369  ->  Infinity Overflow  Inexact Rounded\r
+ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding: half_up\r
+ddadd81200 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81201 add  .2301    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81202 add  .2310    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81203 add  .2350    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81204 add  .2351    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81205 add  .2450    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81206 add  .2451    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81207 add  .2360    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81208 add  .2370    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81209 add  .2399    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81220 add  9999999999999999E+369  9E+369 ->  Infinity Overflow  Inexact Rounded\r
+ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding: half_down\r
+ddadd81300 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81301 add  .2301    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81302 add  .2310    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81303 add  .2350    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81304 add  .2351    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81305 add  .2450    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81306 add  .2451    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81307 add  .2360    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81308 add  .2370    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81309 add  .2399    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81320 add  9999999999999999E+369  9E+369 ->  Infinity Overflow  Inexact Rounded\r
+ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding: up\r
+ddadd81400 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81401 add  .2301    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81402 add  .2310    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81403 add  .2350    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81404 add  .2351    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81405 add  .2450    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81406 add  .2451    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81407 add  .2360    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81408 add  .2370    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81409 add  .2399    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81411 add -.2399   -12345678901234.00    -> -12345678901234.24  Inexact Rounded\r
+ddadd81420 add  9999999999999999E+369  9E+369 ->  Infinity Overflow  Inexact Rounded\r
+ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding: down\r
+ddadd81500 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81501 add  .2301    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81502 add  .2310    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81503 add  .2350    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81504 add  .2351    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81505 add  .2450    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81506 add  .2451    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81507 add  .2360    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81508 add  .2370    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81509 add  .2399    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81511 add -.2399   -12345678901234.00    -> -12345678901234.23  Inexact Rounded\r
+ddadd81520 add  9999999999999999E+369  9E+369 ->  9.999999999999999E+384 Overflow  Inexact Rounded\r
+ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow  Inexact Rounded\r
+\r
+rounding: ceiling\r
+ddadd81600 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81601 add  .2301    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81602 add  .2310    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81603 add  .2350    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81604 add  .2351    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81605 add  .2450    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81606 add  .2451    12345678901234.00    ->  12345678901234.25  Inexact Rounded\r
+ddadd81607 add  .2360    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81608 add  .2370    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81609 add  .2399    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81611 add -.2399   -12345678901234.00    -> -12345678901234.23  Inexact Rounded\r
+ddadd81620 add  9999999999999999E+369  9E+369 ->  Infinity Overflow  Inexact Rounded\r
+ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow  Inexact Rounded\r
+\r
+rounding: floor\r
+ddadd81700 add  .2300    12345678901234.00    ->  12345678901234.23  Rounded\r
+ddadd81701 add  .2301    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81702 add  .2310    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81703 add  .2350    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81704 add  .2351    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81705 add  .2450    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81706 add  .2451    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd81707 add  .2360    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81708 add  .2370    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81709 add  .2399    12345678901234.00    ->  12345678901234.23  Inexact Rounded\r
+ddadd81711 add -.2399   -12345678901234.00    -> -12345678901234.24  Inexact Rounded\r
+ddadd81720 add  9999999999999999E+369  9E+369 ->  9.999999999999999E+384 Overflow  Inexact Rounded\r
+ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding: 05up\r
+ddadd81800 add  .2000    12345678901234.00    ->  12345678901234.20  Rounded\r
+ddadd81801 add  .2001    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81802 add  .2010    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81803 add  .2050    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81804 add  .2051    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81807 add  .2060    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81808 add  .2070    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81809 add  .2099    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81811 add -.2099   -12345678901234.00    -> -12345678901234.21  Inexact Rounded\r
+ddadd81820 add  9999999999999999E+369  9E+369 ->  9.999999999999999E+384 Overflow  Inexact Rounded\r
+ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow  Inexact Rounded\r
+\r
+ddadd81900 add  .2100    12345678901234.00    ->  12345678901234.21  Rounded\r
+ddadd81901 add  .2101    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81902 add  .2110    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81903 add  .2150    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81904 add  .2151    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81907 add  .2160    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81908 add  .2170    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81909 add  .2199    12345678901234.00    ->  12345678901234.21  Inexact Rounded\r
+ddadd81911 add -.2199   -12345678901234.00    -> -12345678901234.21  Inexact Rounded\r
+\r
+ddadd82000 add  .2400    12345678901234.00    ->  12345678901234.24  Rounded\r
+ddadd82001 add  .2401    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82002 add  .2410    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82003 add  .2450    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82004 add  .2451    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82007 add  .2460    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82008 add  .2470    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82009 add  .2499    12345678901234.00    ->  12345678901234.24  Inexact Rounded\r
+ddadd82011 add -.2499   -12345678901234.00    -> -12345678901234.24  Inexact Rounded\r
+\r
+ddadd82100 add  .2500    12345678901234.00    ->  12345678901234.25  Rounded\r
+ddadd82101 add  .2501    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82102 add  .2510    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82103 add  .2550    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82104 add  .2551    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82107 add  .2560    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82108 add  .2570    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82109 add  .2599    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82111 add -.2599   -12345678901234.00    -> -12345678901234.26  Inexact Rounded\r
+\r
+ddadd82200 add  .2600    12345678901234.00    ->  12345678901234.26  Rounded\r
+ddadd82201 add  .2601    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82202 add  .2610    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82203 add  .2650    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82204 add  .2651    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82207 add  .2660    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82208 add  .2670    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82209 add  .2699    12345678901234.00    ->  12345678901234.26  Inexact Rounded\r
+ddadd82211 add -.2699   -12345678901234.00    -> -12345678901234.26  Inexact Rounded\r
+\r
+ddadd82300 add  .2900    12345678901234.00    ->  12345678901234.29  Rounded\r
+ddadd82301 add  .2901    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82302 add  .2910    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82303 add  .2950    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82304 add  .2951    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82307 add  .2960    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82308 add  .2970    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82309 add  .2999    12345678901234.00    ->  12345678901234.29  Inexact Rounded\r
+ddadd82311 add -.2999   -12345678901234.00    -> -12345678901234.29  Inexact Rounded\r
+\r
+-- Null tests\r
+ddadd9990 add 10  # -> NaN Invalid_operation\r
+ddadd9991 add  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddAnd.decTest b/Lib/test/decimaltestdata/ddAnd.decTest
new file mode 100644 (file)
index 0000000..e5fa38d
--- /dev/null
@@ -0,0 +1,347 @@
+------------------------------------------------------------------------\r
+-- ddAnd.decTest -- digitwise logical AND for decDoubles              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+ddand001 and             0    0 ->    0\r
+ddand002 and             0    1 ->    0\r
+ddand003 and             1    0 ->    0\r
+ddand004 and             1    1 ->    1\r
+ddand005 and          1100 1010 -> 1000\r
+-- and at msd and msd-1\r
+--           1234567890123456 1234567890123456      1234567890123456\r
+ddand006 and 0000000000000000 0000000000000000 ->                  0\r
+ddand007 and 0000000000000000 1000000000000000 ->                  0\r
+ddand008 and 1000000000000000 0000000000000000 ->                  0\r
+ddand009 and 1000000000000000 1000000000000000 ->   1000000000000000\r
+ddand010 and 0000000000000000 0000000000000000 ->                  0\r
+ddand011 and 0000000000000000 0100000000000000 ->                  0\r
+ddand012 and 0100000000000000 0000000000000000 ->                  0\r
+ddand013 and 0100000000000000 0100000000000000 ->    100000000000000\r
+\r
+-- Various lengths\r
+--           1234567890123456 1234567890123456      1234567890123456\r
+ddand021 and 1111111111111111 1111111111111111  ->  1111111111111111\r
+ddand024 and 1111111111111111  111111111111111  ->   111111111111111\r
+ddand025 and 1111111111111111   11111111111111  ->    11111111111111\r
+ddand026 and 1111111111111111    1111111111111  ->     1111111111111\r
+ddand027 and 1111111111111111     111111111111  ->      111111111111\r
+ddand028 and 1111111111111111      11111111111  ->       11111111111\r
+ddand029 and 1111111111111111       1111111111  ->        1111111111\r
+ddand030 and 1111111111111111        111111111  ->         111111111\r
+ddand031 and 1111111111111111         11111111  ->          11111111\r
+ddand032 and 1111111111111111          1111111  ->           1111111\r
+ddand033 and 1111111111111111           111111  ->            111111\r
+ddand034 and 1111111111111111            11111  ->             11111\r
+ddand035 and 1111111111111111             1111  ->              1111\r
+ddand036 and 1111111111111111              111  ->               111\r
+ddand037 and 1111111111111111               11  ->                11\r
+ddand038 and 1111111111111111                1  ->                 1\r
+ddand039 and 1111111111111111                0  ->                 0\r
+\r
+ddand040 and 1111111111111111    1111111111111111 ->  1111111111111111\r
+ddand041 and  111111111111111    1111111111111111 ->   111111111111111\r
+ddand042 and  111111111111111    1111111111111111 ->   111111111111111\r
+ddand043 and   11111111111111    1111111111111111 ->    11111111111111\r
+ddand044 and    1111111111111    1111111111111111 ->     1111111111111\r
+ddand045 and     111111111111    1111111111111111 ->      111111111111\r
+ddand046 and      11111111111    1111111111111111 ->       11111111111\r
+ddand047 and       1111111111    1111111111111111 ->        1111111111\r
+ddand048 and        111111111    1111111111111111 ->         111111111\r
+ddand049 and         11111111    1111111111111111 ->          11111111\r
+ddand050 and          1111111    1111111111111111 ->           1111111\r
+ddand051 and           111111    1111111111111111 ->            111111\r
+ddand052 and            11111    1111111111111111 ->             11111\r
+ddand053 and             1111    1111111111111111 ->              1111\r
+ddand054 and              111    1111111111111111 ->               111\r
+ddand055 and               11    1111111111111111 ->                11\r
+ddand056 and                1    1111111111111111 ->                 1\r
+ddand057 and                0    1111111111111111 ->                 0\r
+\r
+ddand150 and 1111111111  1  ->  1\r
+ddand151 and  111111111  1  ->  1\r
+ddand152 and   11111111  1  ->  1\r
+ddand153 and    1111111  1  ->  1\r
+ddand154 and     111111  1  ->  1\r
+ddand155 and      11111  1  ->  1\r
+ddand156 and       1111  1  ->  1\r
+ddand157 and        111  1  ->  1\r
+ddand158 and         11  1  ->  1\r
+ddand159 and          1  1  ->  1\r
+\r
+ddand160 and 1111111111  0  ->  0\r
+ddand161 and  111111111  0  ->  0\r
+ddand162 and   11111111  0  ->  0\r
+ddand163 and    1111111  0  ->  0\r
+ddand164 and     111111  0  ->  0\r
+ddand165 and      11111  0  ->  0\r
+ddand166 and       1111  0  ->  0\r
+ddand167 and        111  0  ->  0\r
+ddand168 and         11  0  ->  0\r
+ddand169 and          1  0  ->  0\r
+\r
+ddand170 and 1  1111111111  ->  1\r
+ddand171 and 1   111111111  ->  1\r
+ddand172 and 1    11111111  ->  1\r
+ddand173 and 1     1111111  ->  1\r
+ddand174 and 1      111111  ->  1\r
+ddand175 and 1       11111  ->  1\r
+ddand176 and 1        1111  ->  1\r
+ddand177 and 1         111  ->  1\r
+ddand178 and 1          11  ->  1\r
+ddand179 and 1           1  ->  1\r
+\r
+ddand180 and 0  1111111111  ->  0\r
+ddand181 and 0   111111111  ->  0\r
+ddand182 and 0    11111111  ->  0\r
+ddand183 and 0     1111111  ->  0\r
+ddand184 and 0      111111  ->  0\r
+ddand185 and 0       11111  ->  0\r
+ddand186 and 0        1111  ->  0\r
+ddand187 and 0         111  ->  0\r
+ddand188 and 0          11  ->  0\r
+ddand189 and 0           1  ->  0\r
+\r
+ddand090 and 011111111  111111111  ->   11111111\r
+ddand091 and 101111111  111111111  ->  101111111\r
+ddand092 and 110111111  111111111  ->  110111111\r
+ddand093 and 111011111  111111111  ->  111011111\r
+ddand094 and 111101111  111111111  ->  111101111\r
+ddand095 and 111110111  111111111  ->  111110111\r
+ddand096 and 111111011  111111111  ->  111111011\r
+ddand097 and 111111101  111111111  ->  111111101\r
+ddand098 and 111111110  111111111  ->  111111110\r
+\r
+ddand100 and 111111111  011111111  ->   11111111\r
+ddand101 and 111111111  101111111  ->  101111111\r
+ddand102 and 111111111  110111111  ->  110111111\r
+ddand103 and 111111111  111011111  ->  111011111\r
+ddand104 and 111111111  111101111  ->  111101111\r
+ddand105 and 111111111  111110111  ->  111110111\r
+ddand106 and 111111111  111111011  ->  111111011\r
+ddand107 and 111111111  111111101  ->  111111101\r
+ddand108 and 111111111  111111110  ->  111111110\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+ddand220 and 111111112  111111111  ->  NaN Invalid_operation\r
+ddand221 and 333333333  333333333  ->  NaN Invalid_operation\r
+ddand222 and 555555555  555555555  ->  NaN Invalid_operation\r
+ddand223 and 777777777  777777777  ->  NaN Invalid_operation\r
+ddand224 and 999999999  999999999  ->  NaN Invalid_operation\r
+ddand225 and 222222222  999999999  ->  NaN Invalid_operation\r
+ddand226 and 444444444  999999999  ->  NaN Invalid_operation\r
+ddand227 and 666666666  999999999  ->  NaN Invalid_operation\r
+ddand228 and 888888888  999999999  ->  NaN Invalid_operation\r
+ddand229 and 999999999  222222222  ->  NaN Invalid_operation\r
+ddand230 and 999999999  444444444  ->  NaN Invalid_operation\r
+ddand231 and 999999999  666666666  ->  NaN Invalid_operation\r
+ddand232 and 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+ddand240 and  567468689 -934981942 ->  NaN Invalid_operation\r
+ddand241 and  567367689  934981942 ->  NaN Invalid_operation\r
+ddand242 and -631917772 -706014634 ->  NaN Invalid_operation\r
+ddand243 and -756253257  138579234 ->  NaN Invalid_operation\r
+ddand244 and  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+ddand250 and  2000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddand251 and  7000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddand252 and  8000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddand253 and  9000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddand254 and  2000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddand255 and  7000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddand256 and  8000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddand257 and  9000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddand258 and  1000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddand259 and  1000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddand260 and  1000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddand261 and  1000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+ddand262 and  0000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddand263 and  0000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddand264 and  0000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddand265 and  0000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+ddand270 and  0200001000000000 1000100000000010 ->  NaN Invalid_operation\r
+ddand271 and  0700000100000000 1000010000000100 ->  NaN Invalid_operation\r
+ddand272 and  0800000010000000 1000001000001000 ->  NaN Invalid_operation\r
+ddand273 and  0900000001000000 1000000100010000 ->  NaN Invalid_operation\r
+ddand274 and  1000000000100000 0200000010100000 ->  NaN Invalid_operation\r
+ddand275 and  1000000000010000 0700000001000000 ->  NaN Invalid_operation\r
+ddand276 and  1000000000001000 0800000010100000 ->  NaN Invalid_operation\r
+ddand277 and  1000000000000100 0900000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+ddand280 and  0010000000000002 1000000100000001 ->  NaN Invalid_operation\r
+ddand281 and  0001000000000007 1000001000000011 ->  NaN Invalid_operation\r
+ddand282 and  0000100000000008 1000010000000001 ->  NaN Invalid_operation\r
+ddand283 and  0000010000000009 1000100000000001 ->  NaN Invalid_operation\r
+ddand284 and  1000001000000000 0001000000000002 ->  NaN Invalid_operation\r
+ddand285 and  1000000100000000 0010000000000007 ->  NaN Invalid_operation\r
+ddand286 and  1000000010000000 0100000000000008 ->  NaN Invalid_operation\r
+ddand287 and  1000000001000000 1000000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+ddand288 and  0010000020000000 1000001000000000 ->  NaN Invalid_operation\r
+ddand289 and  0001000070000001 1000000100000000 ->  NaN Invalid_operation\r
+ddand290 and  0000100080000010 1000000010000000 ->  NaN Invalid_operation\r
+ddand291 and  0000010090000100 1000000001000000 ->  NaN Invalid_operation\r
+ddand292 and  1000001000001000 0000000020100000 ->  NaN Invalid_operation\r
+ddand293 and  1000000100010000 0000000070010000 ->  NaN Invalid_operation\r
+ddand294 and  1000000010100000 0000000080001000 ->  NaN Invalid_operation\r
+ddand295 and  1000000001000000 0000000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+ddand296 and -1000000001000000 -0000010000000100 ->  NaN Invalid_operation\r
+ddand297 and -1000000001000000  0000000010000100 ->  NaN Invalid_operation\r
+ddand298 and  1000000001000000 -0000001000000100 ->  NaN Invalid_operation\r
+ddand299 and  1000000001000000  0000000011000100 ->  1000000\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+ddand331 and  2   9.99999999E+199     -> NaN Invalid_operation\r
+ddand332 and  3   1E-199              -> NaN Invalid_operation\r
+ddand333 and  4   1.00000000E-199     -> NaN Invalid_operation\r
+ddand334 and  5   1E-100              -> NaN Invalid_operation\r
+ddand335 and  6   -1E-100             -> NaN Invalid_operation\r
+ddand336 and  7   -1.00000000E-199    -> NaN Invalid_operation\r
+ddand337 and  8   -1E-199             -> NaN Invalid_operation\r
+ddand338 and  9   -9.99999999E+199    -> NaN Invalid_operation\r
+ddand341 and  9.99999999E+199     -18 -> NaN Invalid_operation\r
+ddand342 and  1E-199               01 -> NaN Invalid_operation\r
+ddand343 and  1.00000000E-199     -18 -> NaN Invalid_operation\r
+ddand344 and  1E-100               18 -> NaN Invalid_operation\r
+ddand345 and  -1E-100             -10 -> NaN Invalid_operation\r
+ddand346 and  -1.00000000E-199     18 -> NaN Invalid_operation\r
+ddand347 and  -1E-199              10 -> NaN Invalid_operation\r
+ddand348 and  -9.99999999E+199    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+ddand361 and  1.0                  1  -> NaN Invalid_operation\r
+ddand362 and  1E+1                 1  -> NaN Invalid_operation\r
+ddand363 and  0.0                  1  -> NaN Invalid_operation\r
+ddand364 and  0E+1                 1  -> NaN Invalid_operation\r
+ddand365 and  9.9                  1  -> NaN Invalid_operation\r
+ddand366 and  9E+1                 1  -> NaN Invalid_operation\r
+ddand371 and  0 1.0                   -> NaN Invalid_operation\r
+ddand372 and  0 1E+1                  -> NaN Invalid_operation\r
+ddand373 and  0 0.0                   -> NaN Invalid_operation\r
+ddand374 and  0 0E+1                  -> NaN Invalid_operation\r
+ddand375 and  0 9.9                   -> NaN Invalid_operation\r
+ddand376 and  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+ddand780 and -Inf  -Inf   -> NaN Invalid_operation\r
+ddand781 and -Inf  -1000  -> NaN Invalid_operation\r
+ddand782 and -Inf  -1     -> NaN Invalid_operation\r
+ddand783 and -Inf  -0     -> NaN Invalid_operation\r
+ddand784 and -Inf   0     -> NaN Invalid_operation\r
+ddand785 and -Inf   1     -> NaN Invalid_operation\r
+ddand786 and -Inf   1000  -> NaN Invalid_operation\r
+ddand787 and -1000 -Inf   -> NaN Invalid_operation\r
+ddand788 and -Inf  -Inf   -> NaN Invalid_operation\r
+ddand789 and -1    -Inf   -> NaN Invalid_operation\r
+ddand790 and -0    -Inf   -> NaN Invalid_operation\r
+ddand791 and  0    -Inf   -> NaN Invalid_operation\r
+ddand792 and  1    -Inf   -> NaN Invalid_operation\r
+ddand793 and  1000 -Inf   -> NaN Invalid_operation\r
+ddand794 and  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+ddand800 and  Inf  -Inf   -> NaN Invalid_operation\r
+ddand801 and  Inf  -1000  -> NaN Invalid_operation\r
+ddand802 and  Inf  -1     -> NaN Invalid_operation\r
+ddand803 and  Inf  -0     -> NaN Invalid_operation\r
+ddand804 and  Inf   0     -> NaN Invalid_operation\r
+ddand805 and  Inf   1     -> NaN Invalid_operation\r
+ddand806 and  Inf   1000  -> NaN Invalid_operation\r
+ddand807 and  Inf   Inf   -> NaN Invalid_operation\r
+ddand808 and -1000  Inf   -> NaN Invalid_operation\r
+ddand809 and -Inf   Inf   -> NaN Invalid_operation\r
+ddand810 and -1     Inf   -> NaN Invalid_operation\r
+ddand811 and -0     Inf   -> NaN Invalid_operation\r
+ddand812 and  0     Inf   -> NaN Invalid_operation\r
+ddand813 and  1     Inf   -> NaN Invalid_operation\r
+ddand814 and  1000  Inf   -> NaN Invalid_operation\r
+ddand815 and  Inf   Inf   -> NaN Invalid_operation\r
+\r
+ddand821 and  NaN -Inf    -> NaN Invalid_operation\r
+ddand822 and  NaN -1000   -> NaN Invalid_operation\r
+ddand823 and  NaN -1      -> NaN Invalid_operation\r
+ddand824 and  NaN -0      -> NaN Invalid_operation\r
+ddand825 and  NaN  0      -> NaN Invalid_operation\r
+ddand826 and  NaN  1      -> NaN Invalid_operation\r
+ddand827 and  NaN  1000   -> NaN Invalid_operation\r
+ddand828 and  NaN  Inf    -> NaN Invalid_operation\r
+ddand829 and  NaN  NaN    -> NaN Invalid_operation\r
+ddand830 and -Inf  NaN    -> NaN Invalid_operation\r
+ddand831 and -1000 NaN    -> NaN Invalid_operation\r
+ddand832 and -1    NaN    -> NaN Invalid_operation\r
+ddand833 and -0    NaN    -> NaN Invalid_operation\r
+ddand834 and  0    NaN    -> NaN Invalid_operation\r
+ddand835 and  1    NaN    -> NaN Invalid_operation\r
+ddand836 and  1000 NaN    -> NaN Invalid_operation\r
+ddand837 and  Inf  NaN    -> NaN Invalid_operation\r
+\r
+ddand841 and  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddand842 and  sNaN -1000  ->  NaN  Invalid_operation\r
+ddand843 and  sNaN -1     ->  NaN  Invalid_operation\r
+ddand844 and  sNaN -0     ->  NaN  Invalid_operation\r
+ddand845 and  sNaN  0     ->  NaN  Invalid_operation\r
+ddand846 and  sNaN  1     ->  NaN  Invalid_operation\r
+ddand847 and  sNaN  1000  ->  NaN  Invalid_operation\r
+ddand848 and  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddand849 and  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddand850 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddand851 and -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddand852 and -1000 sNaN   ->  NaN  Invalid_operation\r
+ddand853 and -1    sNaN   ->  NaN  Invalid_operation\r
+ddand854 and -0    sNaN   ->  NaN  Invalid_operation\r
+ddand855 and  0    sNaN   ->  NaN  Invalid_operation\r
+ddand856 and  1    sNaN   ->  NaN  Invalid_operation\r
+ddand857 and  1000 sNaN   ->  NaN  Invalid_operation\r
+ddand858 and  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddand859 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddand861 and  NaN1   -Inf    -> NaN Invalid_operation\r
+ddand862 and +NaN2   -1000   -> NaN Invalid_operation\r
+ddand863 and  NaN3    1000   -> NaN Invalid_operation\r
+ddand864 and  NaN4    Inf    -> NaN Invalid_operation\r
+ddand865 and  NaN5   +NaN6   -> NaN Invalid_operation\r
+ddand866 and -Inf     NaN7   -> NaN Invalid_operation\r
+ddand867 and -1000    NaN8   -> NaN Invalid_operation\r
+ddand868 and  1000    NaN9   -> NaN Invalid_operation\r
+ddand869 and  Inf    +NaN10  -> NaN Invalid_operation\r
+ddand871 and  sNaN11  -Inf   -> NaN Invalid_operation\r
+ddand872 and  sNaN12  -1000  -> NaN Invalid_operation\r
+ddand873 and  sNaN13   1000  -> NaN Invalid_operation\r
+ddand874 and  sNaN14   NaN17 -> NaN Invalid_operation\r
+ddand875 and  sNaN15  sNaN18 -> NaN Invalid_operation\r
+ddand876 and  NaN16   sNaN19 -> NaN Invalid_operation\r
+ddand877 and -Inf    +sNaN20 -> NaN Invalid_operation\r
+ddand878 and -1000    sNaN21 -> NaN Invalid_operation\r
+ddand879 and  1000    sNaN22 -> NaN Invalid_operation\r
+ddand880 and  Inf     sNaN23 -> NaN Invalid_operation\r
+ddand881 and +NaN25  +sNaN24 -> NaN Invalid_operation\r
+ddand882 and -NaN26    NaN28 -> NaN Invalid_operation\r
+ddand883 and -sNaN27  sNaN29 -> NaN Invalid_operation\r
+ddand884 and  1000    -NaN30 -> NaN Invalid_operation\r
+ddand885 and  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddBase.decTest b/Lib/test/decimaltestdata/ddBase.decTest
new file mode 100644 (file)
index 0000000..431bce1
--- /dev/null
@@ -0,0 +1,1096 @@
+------------------------------------------------------------------------\r
+-- ddBase.decTest -- base decDouble <--> string conversions           --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This file tests base conversions from string to a decimal number\r
+-- and back to a string (in Scientific form)\r
+\r
+-- Note that unlike other operations the operand is subject to rounding\r
+-- to conform to emax and precision settings (that is, numbers will\r
+-- conform to rules and exponent will be in permitted range).  The\r
+-- 'left hand side', therefore, may have numbers that cannot be\r
+-- represented in a decDouble.  Some testcases go to the limit of the\r
+-- next-wider format, and hence these testcases may also be used to\r
+-- test narrowing and widening operations.\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddbas001 toSci       0 -> 0\r
+ddbas002 toSci       1 -> 1\r
+ddbas003 toSci     1.0 -> 1.0\r
+ddbas004 toSci    1.00 -> 1.00\r
+ddbas005 toSci      10 -> 10\r
+ddbas006 toSci    1000 -> 1000\r
+ddbas007 toSci    10.0 -> 10.0\r
+ddbas008 toSci    10.1 -> 10.1\r
+ddbas009 toSci    10.4 -> 10.4\r
+ddbas010 toSci    10.5 -> 10.5\r
+ddbas011 toSci    10.6 -> 10.6\r
+ddbas012 toSci    10.9 -> 10.9\r
+ddbas013 toSci    11.0 -> 11.0\r
+ddbas014 toSci  1.234 -> 1.234\r
+ddbas015 toSci  0.123 -> 0.123\r
+ddbas016 toSci  0.012 -> 0.012\r
+ddbas017 toSci  -0    -> -0\r
+ddbas018 toSci  -0.0  -> -0.0\r
+ddbas019 toSci -00.00 -> -0.00\r
+\r
+ddbas021 toSci     -1 -> -1\r
+ddbas022 toSci   -1.0 -> -1.0\r
+ddbas023 toSci   -0.1 -> -0.1\r
+ddbas024 toSci   -9.1 -> -9.1\r
+ddbas025 toSci   -9.11 -> -9.11\r
+ddbas026 toSci   -9.119 -> -9.119\r
+ddbas027 toSci   -9.999 -> -9.999\r
+\r
+ddbas030 toSci  '123456789.123456'   -> '123456789.123456'\r
+ddbas031 toSci  '123456789.000000'   -> '123456789.000000'\r
+ddbas032 toSci   '123456789123456'   -> '123456789123456'\r
+ddbas033 toSci   '0.0000123456789'   -> '0.0000123456789'\r
+ddbas034 toSci  '0.00000123456789'   -> '0.00000123456789'\r
+ddbas035 toSci '0.000000123456789'   -> '1.23456789E-7'\r
+ddbas036 toSci '0.0000000123456789'  -> '1.23456789E-8'\r
+\r
+ddbas037 toSci '0.123456789012344'   -> '0.123456789012344'\r
+ddbas038 toSci '0.123456789012345'   -> '0.123456789012345'\r
+\r
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)\r
+ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384\r
+ddbsn002 toSci -1E-383 -> -1E-383\r
+ddbsn003 toSci -1E-398 -> -1E-398 Subnormal\r
+ddbsn004 toSci -0 -> -0\r
+ddbsn005 toSci +0 ->  0\r
+ddbsn006 toSci +1E-398 ->  1E-398 Subnormal\r
+ddbsn007 toSci +1E-383 ->  1E-383\r
+ddbsn008 toSci +9.999999999999999E+384 ->  9.999999999999999E+384\r
+\r
+-- String [many more examples are implicitly tested elsewhere]\r
+-- strings without E cannot generate E in result\r
+ddbas040 toSci "12"        -> '12'\r
+ddbas041 toSci "-76"       -> '-76'\r
+ddbas042 toSci "12.76"     -> '12.76'\r
+ddbas043 toSci "+12.76"    -> '12.76'\r
+ddbas044 toSci "012.76"    -> '12.76'\r
+ddbas045 toSci "+0.003"    -> '0.003'\r
+ddbas046 toSci "17."       -> '17'\r
+ddbas047 toSci ".5"        -> '0.5'\r
+ddbas048 toSci "044"       -> '44'\r
+ddbas049 toSci "0044"      -> '44'\r
+ddbas050 toSci "0.0005"      -> '0.0005'\r
+ddbas051 toSci "00.00005"    -> '0.00005'\r
+ddbas052 toSci "0.000005"    -> '0.000005'\r
+ddbas053 toSci "0.0000050"   -> '0.0000050'\r
+ddbas054 toSci "0.0000005"   -> '5E-7'\r
+ddbas055 toSci "0.00000005"  -> '5E-8'\r
+ddbas056 toSci "12345678.543210" -> '12345678.543210'\r
+ddbas057 toSci "2345678.543210" -> '2345678.543210'\r
+ddbas058 toSci "345678.543210" -> '345678.543210'\r
+ddbas059 toSci "0345678.54321" -> '345678.54321'\r
+ddbas060 toSci "345678.5432" -> '345678.5432'\r
+ddbas061 toSci "+345678.5432" -> '345678.5432'\r
+ddbas062 toSci "+0345678.5432" -> '345678.5432'\r
+ddbas063 toSci "+00345678.5432" -> '345678.5432'\r
+ddbas064 toSci "-345678.5432"  -> '-345678.5432'\r
+ddbas065 toSci "-0345678.5432"  -> '-345678.5432'\r
+ddbas066 toSci "-00345678.5432"  -> '-345678.5432'\r
+-- examples\r
+ddbas067 toSci "5E-6"        -> '0.000005'\r
+ddbas068 toSci "50E-7"       -> '0.0000050'\r
+ddbas069 toSci "5E-7"        -> '5E-7'\r
+\r
+-- [No exotics as no Unicode]\r
+\r
+-- rounded with dots in all (including edge) places\r
+ddbas071 toSci  .1234567890123456123  -> 0.1234567890123456 Inexact Rounded\r
+ddbas072 toSci  1.234567890123456123  -> 1.234567890123456 Inexact Rounded\r
+ddbas073 toSci  12.34567890123456123  -> 12.34567890123456 Inexact Rounded\r
+ddbas074 toSci  123.4567890123456123  -> 123.4567890123456 Inexact Rounded\r
+ddbas075 toSci  1234.567890123456123  -> 1234.567890123456 Inexact Rounded\r
+ddbas076 toSci  12345.67890123456123  -> 12345.67890123456 Inexact Rounded\r
+ddbas077 toSci  123456.7890123456123  -> 123456.7890123456 Inexact Rounded\r
+ddbas078 toSci  1234567.890123456123  -> 1234567.890123456 Inexact Rounded\r
+ddbas079 toSci  12345678.90123456123  -> 12345678.90123456 Inexact Rounded\r
+ddbas080 toSci  123456789.0123456123  -> 123456789.0123456 Inexact Rounded\r
+ddbas081 toSci  1234567890.123456123  -> 1234567890.123456 Inexact Rounded\r
+ddbas082 toSci  12345678901.23456123  -> 12345678901.23456 Inexact Rounded\r
+ddbas083 toSci  123456789012.3456123  -> 123456789012.3456 Inexact Rounded\r
+ddbas084 toSci  1234567890123.456123  -> 1234567890123.456 Inexact Rounded\r
+ddbas085 toSci  12345678901234.56123  -> 12345678901234.56 Inexact Rounded\r
+ddbas086 toSci  123456789012345.6123  -> 123456789012345.6 Inexact Rounded\r
+ddbas087 toSci  1234567890123456.123  -> 1234567890123456  Inexact Rounded\r
+ddbas088 toSci  12345678901234561.23  -> 1.234567890123456E+16 Inexact Rounded\r
+ddbas089 toSci  123456789012345612.3  -> 1.234567890123456E+17 Inexact Rounded\r
+ddbas090 toSci  1234567890123456123.  -> 1.234567890123456E+18 Inexact Rounded\r
+\r
+\r
+-- Numbers with E\r
+ddbas130 toSci "0.000E-1"  -> '0.0000'\r
+ddbas131 toSci "0.000E-2"  -> '0.00000'\r
+ddbas132 toSci "0.000E-3"  -> '0.000000'\r
+ddbas133 toSci "0.000E-4"  -> '0E-7'\r
+ddbas134 toSci "0.00E-2"   -> '0.0000'\r
+ddbas135 toSci "0.00E-3"   -> '0.00000'\r
+ddbas136 toSci "0.00E-4"   -> '0.000000'\r
+ddbas137 toSci "0.00E-5"   -> '0E-7'\r
+ddbas138 toSci "+0E+9"     -> '0E+9'\r
+ddbas139 toSci "-0E+9"     -> '-0E+9'\r
+ddbas140 toSci "1E+9"      -> '1E+9'\r
+ddbas141 toSci "1e+09"     -> '1E+9'\r
+ddbas142 toSci "1E+90"     -> '1E+90'\r
+ddbas143 toSci "+1E+009"   -> '1E+9'\r
+ddbas144 toSci "0E+9"      -> '0E+9'\r
+ddbas145 toSci "1E+9"      -> '1E+9'\r
+ddbas146 toSci "1E+09"     -> '1E+9'\r
+ddbas147 toSci "1e+90"     -> '1E+90'\r
+ddbas148 toSci "1E+009"    -> '1E+9'\r
+ddbas149 toSci "000E+9"    -> '0E+9'\r
+ddbas150 toSci "1E9"       -> '1E+9'\r
+ddbas151 toSci "1e09"      -> '1E+9'\r
+ddbas152 toSci "1E90"      -> '1E+90'\r
+ddbas153 toSci "1E009"     -> '1E+9'\r
+ddbas154 toSci "0E9"       -> '0E+9'\r
+ddbas155 toSci "0.000e+0"  -> '0.000'\r
+ddbas156 toSci "0.000E-1"  -> '0.0000'\r
+ddbas157 toSci "4E+9"      -> '4E+9'\r
+ddbas158 toSci "44E+9"     -> '4.4E+10'\r
+ddbas159 toSci "0.73e-7"   -> '7.3E-8'\r
+ddbas160 toSci "00E+9"     -> '0E+9'\r
+ddbas161 toSci "00E-9"     -> '0E-9'\r
+ddbas162 toSci "10E+9"     -> '1.0E+10'\r
+ddbas163 toSci "10E+09"    -> '1.0E+10'\r
+ddbas164 toSci "10e+90"    -> '1.0E+91'\r
+ddbas165 toSci "10E+009"   -> '1.0E+10'\r
+ddbas166 toSci "100e+9"    -> '1.00E+11'\r
+ddbas167 toSci "100e+09"   -> '1.00E+11'\r
+ddbas168 toSci "100E+90"   -> '1.00E+92'\r
+ddbas169 toSci "100e+009"  -> '1.00E+11'\r
+\r
+ddbas170 toSci "1.265"     -> '1.265'\r
+ddbas171 toSci "1.265E-20" -> '1.265E-20'\r
+ddbas172 toSci "1.265E-8"  -> '1.265E-8'\r
+ddbas173 toSci "1.265E-4"  -> '0.0001265'\r
+ddbas174 toSci "1.265E-3"  -> '0.001265'\r
+ddbas175 toSci "1.265E-2"  -> '0.01265'\r
+ddbas176 toSci "1.265E-1"  -> '0.1265'\r
+ddbas177 toSci "1.265E-0"  -> '1.265'\r
+ddbas178 toSci "1.265E+1"  -> '12.65'\r
+ddbas179 toSci "1.265E+2"  -> '126.5'\r
+ddbas180 toSci "1.265E+3"  -> '1265'\r
+ddbas181 toSci "1.265E+4"  -> '1.265E+4'\r
+ddbas182 toSci "1.265E+8"  -> '1.265E+8'\r
+ddbas183 toSci "1.265E+20" -> '1.265E+20'\r
+\r
+ddbas190 toSci "12.65"     -> '12.65'\r
+ddbas191 toSci "12.65E-20" -> '1.265E-19'\r
+ddbas192 toSci "12.65E-8"  -> '1.265E-7'\r
+ddbas193 toSci "12.65E-4"  -> '0.001265'\r
+ddbas194 toSci "12.65E-3"  -> '0.01265'\r
+ddbas195 toSci "12.65E-2"  -> '0.1265'\r
+ddbas196 toSci "12.65E-1"  -> '1.265'\r
+ddbas197 toSci "12.65E-0"  -> '12.65'\r
+ddbas198 toSci "12.65E+1"  -> '126.5'\r
+ddbas199 toSci "12.65E+2"  -> '1265'\r
+ddbas200 toSci "12.65E+3"  -> '1.265E+4'\r
+ddbas201 toSci "12.65E+4"  -> '1.265E+5'\r
+ddbas202 toSci "12.65E+8"  -> '1.265E+9'\r
+ddbas203 toSci "12.65E+20" -> '1.265E+21'\r
+\r
+ddbas210 toSci "126.5"     -> '126.5'\r
+ddbas211 toSci "126.5E-20" -> '1.265E-18'\r
+ddbas212 toSci "126.5E-8"  -> '0.000001265'\r
+ddbas213 toSci "126.5E-4"  -> '0.01265'\r
+ddbas214 toSci "126.5E-3"  -> '0.1265'\r
+ddbas215 toSci "126.5E-2"  -> '1.265'\r
+ddbas216 toSci "126.5E-1"  -> '12.65'\r
+ddbas217 toSci "126.5E-0"  -> '126.5'\r
+ddbas218 toSci "126.5E+1"  -> '1265'\r
+ddbas219 toSci "126.5E+2"  -> '1.265E+4'\r
+ddbas220 toSci "126.5E+3"  -> '1.265E+5'\r
+ddbas221 toSci "126.5E+4"  -> '1.265E+6'\r
+ddbas222 toSci "126.5E+8"  -> '1.265E+10'\r
+ddbas223 toSci "126.5E+20" -> '1.265E+22'\r
+\r
+ddbas230 toSci "1265"     -> '1265'\r
+ddbas231 toSci "1265E-20" -> '1.265E-17'\r
+ddbas232 toSci "1265E-8"  -> '0.00001265'\r
+ddbas233 toSci "1265E-4"  -> '0.1265'\r
+ddbas234 toSci "1265E-3"  -> '1.265'\r
+ddbas235 toSci "1265E-2"  -> '12.65'\r
+ddbas236 toSci "1265E-1"  -> '126.5'\r
+ddbas237 toSci "1265E-0"  -> '1265'\r
+ddbas238 toSci "1265E+1"  -> '1.265E+4'\r
+ddbas239 toSci "1265E+2"  -> '1.265E+5'\r
+ddbas240 toSci "1265E+3"  -> '1.265E+6'\r
+ddbas241 toSci "1265E+4"  -> '1.265E+7'\r
+ddbas242 toSci "1265E+8"  -> '1.265E+11'\r
+ddbas243 toSci "1265E+20" -> '1.265E+23'\r
+ddbas244 toSci "1265E-9"  -> '0.000001265'\r
+ddbas245 toSci "1265E-10" -> '1.265E-7'\r
+ddbas246 toSci "1265E-11" -> '1.265E-8'\r
+ddbas247 toSci "1265E-12" -> '1.265E-9'\r
+\r
+ddbas250 toSci "0.1265"     -> '0.1265'\r
+ddbas251 toSci "0.1265E-20" -> '1.265E-21'\r
+ddbas252 toSci "0.1265E-8"  -> '1.265E-9'\r
+ddbas253 toSci "0.1265E-4"  -> '0.00001265'\r
+ddbas254 toSci "0.1265E-3"  -> '0.0001265'\r
+ddbas255 toSci "0.1265E-2"  -> '0.001265'\r
+ddbas256 toSci "0.1265E-1"  -> '0.01265'\r
+ddbas257 toSci "0.1265E-0"  -> '0.1265'\r
+ddbas258 toSci "0.1265E+1"  -> '1.265'\r
+ddbas259 toSci "0.1265E+2"  -> '12.65'\r
+ddbas260 toSci "0.1265E+3"  -> '126.5'\r
+ddbas261 toSci "0.1265E+4"  -> '1265'\r
+ddbas262 toSci "0.1265E+8"  -> '1.265E+7'\r
+ddbas263 toSci "0.1265E+20" -> '1.265E+19'\r
+\r
+-- some more negative zeros [systematic tests below]\r
+ddbas290 toSci "-0.000E-1"  -> '-0.0000'\r
+ddbas291 toSci "-0.000E-2"  -> '-0.00000'\r
+ddbas292 toSci "-0.000E-3"  -> '-0.000000'\r
+ddbas293 toSci "-0.000E-4"  -> '-0E-7'\r
+ddbas294 toSci "-0.00E-2"   -> '-0.0000'\r
+ddbas295 toSci "-0.00E-3"   -> '-0.00000'\r
+ddbas296 toSci "-0.0E-2"    -> '-0.000'\r
+ddbas297 toSci "-0.0E-3"    -> '-0.0000'\r
+ddbas298 toSci "-0E-2"      -> '-0.00'\r
+ddbas299 toSci "-0E-3"      -> '-0.000'\r
+\r
+-- Engineering notation tests\r
+ddbas301  toSci 10e12  -> 1.0E+13\r
+ddbas302  toEng 10e12  -> 10E+12\r
+ddbas303  toSci 10e11  -> 1.0E+12\r
+ddbas304  toEng 10e11  -> 1.0E+12\r
+ddbas305  toSci 10e10  -> 1.0E+11\r
+ddbas306  toEng 10e10  -> 100E+9\r
+ddbas307  toSci 10e9   -> 1.0E+10\r
+ddbas308  toEng 10e9   -> 10E+9\r
+ddbas309  toSci 10e8   -> 1.0E+9\r
+ddbas310  toEng 10e8   -> 1.0E+9\r
+ddbas311  toSci 10e7   -> 1.0E+8\r
+ddbas312  toEng 10e7   -> 100E+6\r
+ddbas313  toSci 10e6   -> 1.0E+7\r
+ddbas314  toEng 10e6   -> 10E+6\r
+ddbas315  toSci 10e5   -> 1.0E+6\r
+ddbas316  toEng 10e5   -> 1.0E+6\r
+ddbas317  toSci 10e4   -> 1.0E+5\r
+ddbas318  toEng 10e4   -> 100E+3\r
+ddbas319  toSci 10e3   -> 1.0E+4\r
+ddbas320  toEng 10e3   -> 10E+3\r
+ddbas321  toSci 10e2   -> 1.0E+3\r
+ddbas322  toEng 10e2   -> 1.0E+3\r
+ddbas323  toSci 10e1   -> 1.0E+2\r
+ddbas324  toEng 10e1   -> 100\r
+ddbas325  toSci 10e0   -> 10\r
+ddbas326  toEng 10e0   -> 10\r
+ddbas327  toSci 10e-1  -> 1.0\r
+ddbas328  toEng 10e-1  -> 1.0\r
+ddbas329  toSci 10e-2  -> 0.10\r
+ddbas330  toEng 10e-2  -> 0.10\r
+ddbas331  toSci 10e-3  -> 0.010\r
+ddbas332  toEng 10e-3  -> 0.010\r
+ddbas333  toSci 10e-4  -> 0.0010\r
+ddbas334  toEng 10e-4  -> 0.0010\r
+ddbas335  toSci 10e-5  -> 0.00010\r
+ddbas336  toEng 10e-5  -> 0.00010\r
+ddbas337  toSci 10e-6  -> 0.000010\r
+ddbas338  toEng 10e-6  -> 0.000010\r
+ddbas339  toSci 10e-7  -> 0.0000010\r
+ddbas340  toEng 10e-7  -> 0.0000010\r
+ddbas341  toSci 10e-8  -> 1.0E-7\r
+ddbas342  toEng 10e-8  -> 100E-9\r
+ddbas343  toSci 10e-9  -> 1.0E-8\r
+ddbas344  toEng 10e-9  -> 10E-9\r
+ddbas345  toSci 10e-10 -> 1.0E-9\r
+ddbas346  toEng 10e-10 -> 1.0E-9\r
+ddbas347  toSci 10e-11 -> 1.0E-10\r
+ddbas348  toEng 10e-11 -> 100E-12\r
+ddbas349  toSci 10e-12 -> 1.0E-11\r
+ddbas350  toEng 10e-12 -> 10E-12\r
+ddbas351  toSci 10e-13 -> 1.0E-12\r
+ddbas352  toEng 10e-13 -> 1.0E-12\r
+\r
+ddbas361  toSci 7E12  -> 7E+12\r
+ddbas362  toEng 7E12  -> 7E+12\r
+ddbas363  toSci 7E11  -> 7E+11\r
+ddbas364  toEng 7E11  -> 700E+9\r
+ddbas365  toSci 7E10  -> 7E+10\r
+ddbas366  toEng 7E10  -> 70E+9\r
+ddbas367  toSci 7E9   -> 7E+9\r
+ddbas368  toEng 7E9   -> 7E+9\r
+ddbas369  toSci 7E8   -> 7E+8\r
+ddbas370  toEng 7E8   -> 700E+6\r
+ddbas371  toSci 7E7   -> 7E+7\r
+ddbas372  toEng 7E7   -> 70E+6\r
+ddbas373  toSci 7E6   -> 7E+6\r
+ddbas374  toEng 7E6   -> 7E+6\r
+ddbas375  toSci 7E5   -> 7E+5\r
+ddbas376  toEng 7E5   -> 700E+3\r
+ddbas377  toSci 7E4   -> 7E+4\r
+ddbas378  toEng 7E4   -> 70E+3\r
+ddbas379  toSci 7E3   -> 7E+3\r
+ddbas380  toEng 7E3   -> 7E+3\r
+ddbas381  toSci 7E2   -> 7E+2\r
+ddbas382  toEng 7E2   -> 700\r
+ddbas383  toSci 7E1   -> 7E+1\r
+ddbas384  toEng 7E1   -> 70\r
+ddbas385  toSci 7E0   -> 7\r
+ddbas386  toEng 7E0   -> 7\r
+ddbas387  toSci 7E-1  -> 0.7\r
+ddbas388  toEng 7E-1  -> 0.7\r
+ddbas389  toSci 7E-2  -> 0.07\r
+ddbas390  toEng 7E-2  -> 0.07\r
+ddbas391  toSci 7E-3  -> 0.007\r
+ddbas392  toEng 7E-3  -> 0.007\r
+ddbas393  toSci 7E-4  -> 0.0007\r
+ddbas394  toEng 7E-4  -> 0.0007\r
+ddbas395  toSci 7E-5  -> 0.00007\r
+ddbas396  toEng 7E-5  -> 0.00007\r
+ddbas397  toSci 7E-6  -> 0.000007\r
+ddbas398  toEng 7E-6  -> 0.000007\r
+ddbas399  toSci 7E-7  -> 7E-7\r
+ddbas400  toEng 7E-7  -> 700E-9\r
+ddbas401  toSci 7E-8  -> 7E-8\r
+ddbas402  toEng 7E-8  -> 70E-9\r
+ddbas403  toSci 7E-9  -> 7E-9\r
+ddbas404  toEng 7E-9  -> 7E-9\r
+ddbas405  toSci 7E-10 -> 7E-10\r
+ddbas406  toEng 7E-10 -> 700E-12\r
+ddbas407  toSci 7E-11 -> 7E-11\r
+ddbas408  toEng 7E-11 -> 70E-12\r
+ddbas409  toSci 7E-12 -> 7E-12\r
+ddbas410  toEng 7E-12 -> 7E-12\r
+ddbas411  toSci 7E-13 -> 7E-13\r
+ddbas412  toEng 7E-13 -> 700E-15\r
+\r
+-- Exacts remain exact up to precision ..\r
+rounding:  half_up\r
+ddbas420  toSci    100 -> 100\r
+ddbas421  toEng    100 -> 100\r
+ddbas422  toSci   1000 -> 1000\r
+ddbas423  toEng   1000 -> 1000\r
+ddbas424  toSci  999.9 ->  999.9\r
+ddbas425  toEng  999.9 ->  999.9\r
+ddbas426  toSci 1000.0 -> 1000.0\r
+ddbas427  toEng 1000.0 -> 1000.0\r
+ddbas428  toSci 1000.1 -> 1000.1\r
+ddbas429  toEng 1000.1 -> 1000.1\r
+ddbas430  toSci 10000 -> 10000\r
+ddbas431  toEng 10000 -> 10000\r
+ddbas432  toSci 100000 -> 100000\r
+ddbas433  toEng 100000 -> 100000\r
+ddbas434  toSci 1000000 -> 1000000\r
+ddbas435  toEng 1000000 -> 1000000\r
+ddbas436  toSci 10000000 -> 10000000\r
+ddbas437  toEng 10000000 -> 10000000\r
+ddbas438  toSci 100000000 -> 100000000\r
+ddbas439  toEng 1000000000000000 -> 1000000000000000\r
+ddbas440  toSci 10000000000000000    -> 1.000000000000000E+16   Rounded\r
+ddbas441  toEng 10000000000000000    -> 10.00000000000000E+15   Rounded\r
+ddbas442  toSci 10000000000000001    -> 1.000000000000000E+16   Rounded Inexact\r
+ddbas443  toEng 10000000000000001    -> 10.00000000000000E+15   Rounded Inexact\r
+ddbas444  toSci 10000000000000003    -> 1.000000000000000E+16   Rounded Inexact\r
+ddbas445  toEng 10000000000000003    -> 10.00000000000000E+15   Rounded Inexact\r
+ddbas446  toSci 10000000000000005    -> 1.000000000000001E+16   Rounded Inexact\r
+ddbas447  toEng 10000000000000005    -> 10.00000000000001E+15   Rounded Inexact\r
+ddbas448  toSci 100000000000000050   -> 1.000000000000001E+17   Rounded Inexact\r
+ddbas449  toEng 100000000000000050   -> 100.0000000000001E+15   Rounded Inexact\r
+ddbas450  toSci 10000000000000009    -> 1.000000000000001E+16   Rounded Inexact\r
+ddbas451  toEng 10000000000000009    -> 10.00000000000001E+15   Rounded Inexact\r
+ddbas452  toSci 100000000000000000   -> 1.000000000000000E+17   Rounded\r
+ddbas453  toEng 100000000000000000   -> 100.0000000000000E+15   Rounded\r
+ddbas454  toSci 100000000000000003   -> 1.000000000000000E+17   Rounded Inexact\r
+ddbas455  toEng 100000000000000003   -> 100.0000000000000E+15   Rounded Inexact\r
+ddbas456  toSci 100000000000000005   -> 1.000000000000000E+17   Rounded Inexact\r
+ddbas457  toEng 100000000000000005   -> 100.0000000000000E+15   Rounded Inexact\r
+ddbas458  toSci 100000000000000009   -> 1.000000000000000E+17   Rounded Inexact\r
+ddbas459  toEng 100000000000000009   -> 100.0000000000000E+15   Rounded Inexact\r
+ddbas460  toSci 1000000000000000000  -> 1.000000000000000E+18   Rounded\r
+ddbas461  toEng 1000000000000000000  -> 1.000000000000000E+18   Rounded\r
+ddbas462  toSci 1000000000000000300  -> 1.000000000000000E+18   Rounded Inexact\r
+ddbas463  toEng 1000000000000000300  -> 1.000000000000000E+18   Rounded Inexact\r
+ddbas464  toSci 1000000000000000500  -> 1.000000000000001E+18   Rounded Inexact\r
+ddbas465  toEng 1000000000000000500  -> 1.000000000000001E+18   Rounded Inexact\r
+ddbas466  toSci 1000000000000000900  -> 1.000000000000001E+18   Rounded Inexact\r
+ddbas467  toEng 1000000000000000900  -> 1.000000000000001E+18   Rounded Inexact\r
+ddbas468  toSci 10000000000000000000 -> 1.000000000000000E+19   Rounded\r
+ddbas469  toEng 10000000000000000000 -> 10.00000000000000E+18   Rounded\r
+ddbas470  toSci 10000000000000003000 -> 1.000000000000000E+19   Rounded Inexact\r
+ddbas471  toEng 10000000000000003000 -> 10.00000000000000E+18   Rounded Inexact\r
+ddbas472  toSci 10000000000000005000 -> 1.000000000000001E+19   Rounded Inexact\r
+ddbas473  toEng 10000000000000005000 -> 10.00000000000001E+18   Rounded Inexact\r
+ddbas474  toSci 10000000000000009000 -> 1.000000000000001E+19   Rounded Inexact\r
+ddbas475  toEng 10000000000000009000 -> 10.00000000000001E+18   Rounded Inexact\r
+\r
+-- check rounding modes heeded\r
+rounding:  ceiling\r
+ddbsr401  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr402  toSci  1.11111111111234549   ->  1.111111111112346  Rounded Inexact\r
+ddbsr403  toSci  1.11111111111234550   ->  1.111111111112346  Rounded Inexact\r
+ddbsr404  toSci  1.11111111111234551   ->  1.111111111112346  Rounded Inexact\r
+rounding:  up\r
+ddbsr405  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr406  toSci  1.11111111111234549   ->  1.111111111112346  Rounded Inexact\r
+ddbsr407  toSci  1.11111111111234550   ->  1.111111111112346  Rounded Inexact\r
+ddbsr408  toSci  1.11111111111234551   ->  1.111111111112346  Rounded Inexact\r
+rounding:  floor\r
+ddbsr410  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr411  toSci  1.11111111111234549   ->  1.111111111112345  Rounded Inexact\r
+ddbsr412  toSci  1.11111111111234550   ->  1.111111111112345  Rounded Inexact\r
+ddbsr413  toSci  1.11111111111234551   ->  1.111111111112345  Rounded Inexact\r
+rounding:  half_down\r
+ddbsr415  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr416  toSci  1.11111111111234549   ->  1.111111111112345  Rounded Inexact\r
+ddbsr417  toSci  1.11111111111234550   ->  1.111111111112345  Rounded Inexact\r
+ddbsr418  toSci  1.11111111111234650   ->  1.111111111112346  Rounded Inexact\r
+ddbsr419  toSci  1.11111111111234551   ->  1.111111111112346  Rounded Inexact\r
+rounding:  half_even\r
+ddbsr421  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr422  toSci  1.11111111111234549   ->  1.111111111112345  Rounded Inexact\r
+ddbsr423  toSci  1.11111111111234550   ->  1.111111111112346  Rounded Inexact\r
+ddbsr424  toSci  1.11111111111234650   ->  1.111111111112346  Rounded Inexact\r
+ddbsr425  toSci  1.11111111111234551   ->  1.111111111112346  Rounded Inexact\r
+rounding:  down\r
+ddbsr426  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr427  toSci  1.11111111111234549   ->  1.111111111112345  Rounded Inexact\r
+ddbsr428  toSci  1.11111111111234550   ->  1.111111111112345  Rounded Inexact\r
+ddbsr429  toSci  1.11111111111234551   ->  1.111111111112345  Rounded Inexact\r
+rounding:  half_up\r
+ddbsr431  toSci  1.1111111111123450    ->  1.111111111112345  Rounded\r
+ddbsr432  toSci  1.11111111111234549   ->  1.111111111112345  Rounded Inexact\r
+ddbsr433  toSci  1.11111111111234550   ->  1.111111111112346  Rounded Inexact\r
+ddbsr434  toSci  1.11111111111234650   ->  1.111111111112347  Rounded Inexact\r
+ddbsr435  toSci  1.11111111111234551   ->  1.111111111112346  Rounded Inexact\r
+-- negatives\r
+rounding:  ceiling\r
+ddbsr501  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr502  toSci -1.11111111111234549   -> -1.111111111112345  Rounded Inexact\r
+ddbsr503  toSci -1.11111111111234550   -> -1.111111111112345  Rounded Inexact\r
+ddbsr504  toSci -1.11111111111234551   -> -1.111111111112345  Rounded Inexact\r
+rounding:  up\r
+ddbsr505  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr506  toSci -1.11111111111234549   -> -1.111111111112346  Rounded Inexact\r
+ddbsr507  toSci -1.11111111111234550   -> -1.111111111112346  Rounded Inexact\r
+ddbsr508  toSci -1.11111111111234551   -> -1.111111111112346  Rounded Inexact\r
+rounding:  floor\r
+ddbsr510  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr511  toSci -1.11111111111234549   -> -1.111111111112346  Rounded Inexact\r
+ddbsr512  toSci -1.11111111111234550   -> -1.111111111112346  Rounded Inexact\r
+ddbsr513  toSci -1.11111111111234551   -> -1.111111111112346  Rounded Inexact\r
+rounding:  half_down\r
+ddbsr515  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr516  toSci -1.11111111111234549   -> -1.111111111112345  Rounded Inexact\r
+ddbsr517  toSci -1.11111111111234550   -> -1.111111111112345  Rounded Inexact\r
+ddbsr518  toSci -1.11111111111234650   -> -1.111111111112346  Rounded Inexact\r
+ddbsr519  toSci -1.11111111111234551   -> -1.111111111112346  Rounded Inexact\r
+rounding:  half_even\r
+ddbsr521  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr522  toSci -1.11111111111234549   -> -1.111111111112345  Rounded Inexact\r
+ddbsr523  toSci -1.11111111111234550   -> -1.111111111112346  Rounded Inexact\r
+ddbsr524  toSci -1.11111111111234650   -> -1.111111111112346  Rounded Inexact\r
+ddbsr525  toSci -1.11111111111234551   -> -1.111111111112346  Rounded Inexact\r
+rounding:  down\r
+ddbsr526  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr527  toSci -1.11111111111234549   -> -1.111111111112345  Rounded Inexact\r
+ddbsr528  toSci -1.11111111111234550   -> -1.111111111112345  Rounded Inexact\r
+ddbsr529  toSci -1.11111111111234551   -> -1.111111111112345  Rounded Inexact\r
+rounding:  half_up\r
+ddbsr531  toSci -1.1111111111123450    -> -1.111111111112345  Rounded\r
+ddbsr532  toSci -1.11111111111234549   -> -1.111111111112345  Rounded Inexact\r
+ddbsr533  toSci -1.11111111111234550   -> -1.111111111112346  Rounded Inexact\r
+ddbsr534  toSci -1.11111111111234650   -> -1.111111111112347  Rounded Inexact\r
+ddbsr535  toSci -1.11111111111234551   -> -1.111111111112346  Rounded Inexact\r
+\r
+rounding:    half_even\r
+\r
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones\r
+ddbas500 toSci '1..2'            -> NaN Conversion_syntax\r
+ddbas501 toSci '.'               -> NaN Conversion_syntax\r
+ddbas502 toSci '..'              -> NaN Conversion_syntax\r
+ddbas503 toSci '++1'             -> NaN Conversion_syntax\r
+ddbas504 toSci '--1'             -> NaN Conversion_syntax\r
+ddbas505 toSci '-+1'             -> NaN Conversion_syntax\r
+ddbas506 toSci '+-1'             -> NaN Conversion_syntax\r
+ddbas507 toSci '12e'             -> NaN Conversion_syntax\r
+ddbas508 toSci '12e++'           -> NaN Conversion_syntax\r
+ddbas509 toSci '12f4'            -> NaN Conversion_syntax\r
+ddbas510 toSci ' +1'             -> NaN Conversion_syntax\r
+ddbas511 toSci '+ 1'             -> NaN Conversion_syntax\r
+ddbas512 toSci '12 '             -> NaN Conversion_syntax\r
+ddbas513 toSci ' + 1'            -> NaN Conversion_syntax\r
+ddbas514 toSci ' - 1 '           -> NaN Conversion_syntax\r
+ddbas515 toSci 'x'               -> NaN Conversion_syntax\r
+ddbas516 toSci '-1-'             -> NaN Conversion_syntax\r
+ddbas517 toSci '12-'             -> NaN Conversion_syntax\r
+ddbas518 toSci '3+'              -> NaN Conversion_syntax\r
+ddbas519 toSci ''                -> NaN Conversion_syntax\r
+ddbas520 toSci '1e-'             -> NaN Conversion_syntax\r
+ddbas521 toSci '7e99999a'        -> NaN Conversion_syntax\r
+ddbas522 toSci '7e123567890x'    -> NaN Conversion_syntax\r
+ddbas523 toSci '7e12356789012x'  -> NaN Conversion_syntax\r
+ddbas524 toSci ''                -> NaN Conversion_syntax\r
+ddbas525 toSci 'e100'            -> NaN Conversion_syntax\r
+ddbas526 toSci '\u0e5a'          -> NaN Conversion_syntax\r
+ddbas527 toSci '\u0b65'          -> NaN Conversion_syntax\r
+ddbas528 toSci '123,65'          -> NaN Conversion_syntax\r
+ddbas529 toSci '1.34.5'          -> NaN Conversion_syntax\r
+ddbas530 toSci '.123.5'          -> NaN Conversion_syntax\r
+ddbas531 toSci '01.35.'          -> NaN Conversion_syntax\r
+ddbas532 toSci '01.35-'          -> NaN Conversion_syntax\r
+ddbas533 toSci '0000..'          -> NaN Conversion_syntax\r
+ddbas534 toSci '.0000.'          -> NaN Conversion_syntax\r
+ddbas535 toSci '00..00'          -> NaN Conversion_syntax\r
+ddbas536 toSci '111e*123'        -> NaN Conversion_syntax\r
+ddbas537 toSci '111e123-'        -> NaN Conversion_syntax\r
+ddbas538 toSci '111e+12+'        -> NaN Conversion_syntax\r
+ddbas539 toSci '111e1-3-'        -> NaN Conversion_syntax\r
+ddbas540 toSci '111e1*23'        -> NaN Conversion_syntax\r
+ddbas541 toSci '111e1e+3'        -> NaN Conversion_syntax\r
+ddbas542 toSci '1e1.0'           -> NaN Conversion_syntax\r
+ddbas543 toSci '1e123e'          -> NaN Conversion_syntax\r
+ddbas544 toSci 'ten'             -> NaN Conversion_syntax\r
+ddbas545 toSci 'ONE'             -> NaN Conversion_syntax\r
+ddbas546 toSci '1e.1'            -> NaN Conversion_syntax\r
+ddbas547 toSci '1e1.'            -> NaN Conversion_syntax\r
+ddbas548 toSci '1ee'             -> NaN Conversion_syntax\r
+ddbas549 toSci 'e+1'             -> NaN Conversion_syntax\r
+ddbas550 toSci '1.23.4'          -> NaN Conversion_syntax\r
+ddbas551 toSci '1.2.1'           -> NaN Conversion_syntax\r
+ddbas552 toSci '1E+1.2'          -> NaN Conversion_syntax\r
+ddbas553 toSci '1E+1.2.3'        -> NaN Conversion_syntax\r
+ddbas554 toSci '1E++1'           -> NaN Conversion_syntax\r
+ddbas555 toSci '1E--1'           -> NaN Conversion_syntax\r
+ddbas556 toSci '1E+-1'           -> NaN Conversion_syntax\r
+ddbas557 toSci '1E-+1'           -> NaN Conversion_syntax\r
+ddbas558 toSci '1E''1'           -> NaN Conversion_syntax\r
+ddbas559 toSci "1E""1"           -> NaN Conversion_syntax\r
+ddbas560 toSci "1E"""""          -> NaN Conversion_syntax\r
+-- Near-specials\r
+ddbas561 toSci "qNaN"            -> NaN Conversion_syntax\r
+ddbas562 toSci "NaNq"            -> NaN Conversion_syntax\r
+ddbas563 toSci "NaNs"            -> NaN Conversion_syntax\r
+ddbas564 toSci "Infi"            -> NaN Conversion_syntax\r
+ddbas565 toSci "Infin"           -> NaN Conversion_syntax\r
+ddbas566 toSci "Infini"          -> NaN Conversion_syntax\r
+ddbas567 toSci "Infinit"         -> NaN Conversion_syntax\r
+ddbas568 toSci "-Infinit"        -> NaN Conversion_syntax\r
+ddbas569 toSci "0Inf"            -> NaN Conversion_syntax\r
+ddbas570 toSci "9Inf"            -> NaN Conversion_syntax\r
+ddbas571 toSci "-0Inf"           -> NaN Conversion_syntax\r
+ddbas572 toSci "-9Inf"           -> NaN Conversion_syntax\r
+ddbas573 toSci "-sNa"            -> NaN Conversion_syntax\r
+ddbas574 toSci "xNaN"            -> NaN Conversion_syntax\r
+ddbas575 toSci "0sNaN"           -> NaN Conversion_syntax\r
+\r
+-- some baddies with dots and Es and dots and specials\r
+ddbas576 toSci  'e+1'            ->  NaN Conversion_syntax\r
+ddbas577 toSci  '.e+1'           ->  NaN Conversion_syntax\r
+ddbas578 toSci  '+.e+1'          ->  NaN Conversion_syntax\r
+ddbas579 toSci  '-.e+'           ->  NaN Conversion_syntax\r
+ddbas580 toSci  '-.e'            ->  NaN Conversion_syntax\r
+ddbas581 toSci  'E+1'            ->  NaN Conversion_syntax\r
+ddbas582 toSci  '.E+1'           ->  NaN Conversion_syntax\r
+ddbas583 toSci  '+.E+1'          ->  NaN Conversion_syntax\r
+ddbas584 toSci  '-.E+'           ->  NaN Conversion_syntax\r
+ddbas585 toSci  '-.E'            ->  NaN Conversion_syntax\r
+\r
+ddbas586 toSci  '.NaN'           ->  NaN Conversion_syntax\r
+ddbas587 toSci  '-.NaN'          ->  NaN Conversion_syntax\r
+ddbas588 toSci  '+.sNaN'         ->  NaN Conversion_syntax\r
+ddbas589 toSci  '+.Inf'          ->  NaN Conversion_syntax\r
+ddbas590 toSci  '.Infinity'      ->  NaN Conversion_syntax\r
+\r
+-- Zeros\r
+ddbas601 toSci 0.000000000       -> 0E-9\r
+ddbas602 toSci 0.00000000        -> 0E-8\r
+ddbas603 toSci 0.0000000         -> 0E-7\r
+ddbas604 toSci 0.000000          -> 0.000000\r
+ddbas605 toSci 0.00000           -> 0.00000\r
+ddbas606 toSci 0.0000            -> 0.0000\r
+ddbas607 toSci 0.000             -> 0.000\r
+ddbas608 toSci 0.00              -> 0.00\r
+ddbas609 toSci 0.0               -> 0.0\r
+ddbas610 toSci  .0               -> 0.0\r
+ddbas611 toSci 0.                -> 0\r
+ddbas612 toSci -.0               -> -0.0\r
+ddbas613 toSci -0.               -> -0\r
+ddbas614 toSci -0.0              -> -0.0\r
+ddbas615 toSci -0.00             -> -0.00\r
+ddbas616 toSci -0.000            -> -0.000\r
+ddbas617 toSci -0.0000           -> -0.0000\r
+ddbas618 toSci -0.00000          -> -0.00000\r
+ddbas619 toSci -0.000000         -> -0.000000\r
+ddbas620 toSci -0.0000000        -> -0E-7\r
+ddbas621 toSci -0.00000000       -> -0E-8\r
+ddbas622 toSci -0.000000000      -> -0E-9\r
+\r
+ddbas630 toSci  0.00E+0          -> 0.00\r
+ddbas631 toSci  0.00E+1          -> 0.0\r
+ddbas632 toSci  0.00E+2          -> 0\r
+ddbas633 toSci  0.00E+3          -> 0E+1\r
+ddbas634 toSci  0.00E+4          -> 0E+2\r
+ddbas635 toSci  0.00E+5          -> 0E+3\r
+ddbas636 toSci  0.00E+6          -> 0E+4\r
+ddbas637 toSci  0.00E+7          -> 0E+5\r
+ddbas638 toSci  0.00E+8          -> 0E+6\r
+ddbas639 toSci  0.00E+9          -> 0E+7\r
+\r
+ddbas640 toSci  0.0E+0           -> 0.0\r
+ddbas641 toSci  0.0E+1           -> 0\r
+ddbas642 toSci  0.0E+2           -> 0E+1\r
+ddbas643 toSci  0.0E+3           -> 0E+2\r
+ddbas644 toSci  0.0E+4           -> 0E+3\r
+ddbas645 toSci  0.0E+5           -> 0E+4\r
+ddbas646 toSci  0.0E+6           -> 0E+5\r
+ddbas647 toSci  0.0E+7           -> 0E+6\r
+ddbas648 toSci  0.0E+8           -> 0E+7\r
+ddbas649 toSci  0.0E+9           -> 0E+8\r
+\r
+ddbas650 toSci  0E+0             -> 0\r
+ddbas651 toSci  0E+1             -> 0E+1\r
+ddbas652 toSci  0E+2             -> 0E+2\r
+ddbas653 toSci  0E+3             -> 0E+3\r
+ddbas654 toSci  0E+4             -> 0E+4\r
+ddbas655 toSci  0E+5             -> 0E+5\r
+ddbas656 toSci  0E+6             -> 0E+6\r
+ddbas657 toSci  0E+7             -> 0E+7\r
+ddbas658 toSci  0E+8             -> 0E+8\r
+ddbas659 toSci  0E+9             -> 0E+9\r
+\r
+ddbas660 toSci  0.0E-0           -> 0.0\r
+ddbas661 toSci  0.0E-1           -> 0.00\r
+ddbas662 toSci  0.0E-2           -> 0.000\r
+ddbas663 toSci  0.0E-3           -> 0.0000\r
+ddbas664 toSci  0.0E-4           -> 0.00000\r
+ddbas665 toSci  0.0E-5           -> 0.000000\r
+ddbas666 toSci  0.0E-6           -> 0E-7\r
+ddbas667 toSci  0.0E-7           -> 0E-8\r
+ddbas668 toSci  0.0E-8           -> 0E-9\r
+ddbas669 toSci  0.0E-9           -> 0E-10\r
+\r
+ddbas670 toSci  0.00E-0          -> 0.00\r
+ddbas671 toSci  0.00E-1          -> 0.000\r
+ddbas672 toSci  0.00E-2          -> 0.0000\r
+ddbas673 toSci  0.00E-3          -> 0.00000\r
+ddbas674 toSci  0.00E-4          -> 0.000000\r
+ddbas675 toSci  0.00E-5          -> 0E-7\r
+ddbas676 toSci  0.00E-6          -> 0E-8\r
+ddbas677 toSci  0.00E-7          -> 0E-9\r
+ddbas678 toSci  0.00E-8          -> 0E-10\r
+ddbas679 toSci  0.00E-9          -> 0E-11\r
+\r
+ddbas680 toSci  000000.          ->  0\r
+ddbas681 toSci   00000.          ->  0\r
+ddbas682 toSci    0000.          ->  0\r
+ddbas683 toSci     000.          ->  0\r
+ddbas684 toSci      00.          ->  0\r
+ddbas685 toSci       0.          ->  0\r
+ddbas686 toSci  +00000.          ->  0\r
+ddbas687 toSci  -00000.          -> -0\r
+ddbas688 toSci  +0.              ->  0\r
+ddbas689 toSci  -0.              -> -0\r
+\r
+-- Specials\r
+ddbas700 toSci "NaN"             -> NaN\r
+ddbas701 toSci "nan"             -> NaN\r
+ddbas702 toSci "nAn"             -> NaN\r
+ddbas703 toSci "NAN"             -> NaN\r
+ddbas704 toSci "+NaN"            -> NaN\r
+ddbas705 toSci "+nan"            -> NaN\r
+ddbas706 toSci "+nAn"            -> NaN\r
+ddbas707 toSci "+NAN"            -> NaN\r
+ddbas708 toSci "-NaN"            -> -NaN\r
+ddbas709 toSci "-nan"            -> -NaN\r
+ddbas710 toSci "-nAn"            -> -NaN\r
+ddbas711 toSci "-NAN"            -> -NaN\r
+ddbas712 toSci 'NaN0'            -> NaN\r
+ddbas713 toSci 'NaN1'            -> NaN1\r
+ddbas714 toSci 'NaN12'           -> NaN12\r
+ddbas715 toSci 'NaN123'          -> NaN123\r
+ddbas716 toSci 'NaN1234'         -> NaN1234\r
+ddbas717 toSci 'NaN01'           -> NaN1\r
+ddbas718 toSci 'NaN012'          -> NaN12\r
+ddbas719 toSci 'NaN0123'         -> NaN123\r
+ddbas720 toSci 'NaN01234'        -> NaN1234\r
+ddbas721 toSci 'NaN001'          -> NaN1\r
+ddbas722 toSci 'NaN0012'         -> NaN12\r
+ddbas723 toSci 'NaN00123'        -> NaN123\r
+ddbas724 toSci 'NaN001234'       -> NaN1234\r
+ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax\r
+ddbas726 toSci 'NaN123e+1'       -> NaN Conversion_syntax\r
+ddbas727 toSci 'NaN12.45'        -> NaN Conversion_syntax\r
+ddbas728 toSci 'NaN-12'          -> NaN Conversion_syntax\r
+ddbas729 toSci 'NaN+12'          -> NaN Conversion_syntax\r
+\r
+ddbas730 toSci "sNaN"            -> sNaN\r
+ddbas731 toSci "snan"            -> sNaN\r
+ddbas732 toSci "SnAn"            -> sNaN\r
+ddbas733 toSci "SNAN"            -> sNaN\r
+ddbas734 toSci "+sNaN"           -> sNaN\r
+ddbas735 toSci "+snan"           -> sNaN\r
+ddbas736 toSci "+SnAn"           -> sNaN\r
+ddbas737 toSci "+SNAN"           -> sNaN\r
+ddbas738 toSci "-sNaN"           -> -sNaN\r
+ddbas739 toSci "-snan"           -> -sNaN\r
+ddbas740 toSci "-SnAn"           -> -sNaN\r
+ddbas741 toSci "-SNAN"           -> -sNaN\r
+ddbas742 toSci 'sNaN0000'        -> sNaN\r
+ddbas743 toSci 'sNaN7'           -> sNaN7\r
+ddbas744 toSci 'sNaN007234'      -> sNaN7234\r
+ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax\r
+ddbas746 toSci 'sNaN72.45'       -> NaN Conversion_syntax\r
+ddbas747 toSci 'sNaN-72'         -> NaN Conversion_syntax\r
+\r
+ddbas748 toSci "Inf"             -> Infinity\r
+ddbas749 toSci "inf"             -> Infinity\r
+ddbas750 toSci "iNf"             -> Infinity\r
+ddbas751 toSci "INF"             -> Infinity\r
+ddbas752 toSci "+Inf"            -> Infinity\r
+ddbas753 toSci "+inf"            -> Infinity\r
+ddbas754 toSci "+iNf"            -> Infinity\r
+ddbas755 toSci "+INF"            -> Infinity\r
+ddbas756 toSci "-Inf"            -> -Infinity\r
+ddbas757 toSci "-inf"            -> -Infinity\r
+ddbas758 toSci "-iNf"            -> -Infinity\r
+ddbas759 toSci "-INF"            -> -Infinity\r
+\r
+ddbas760 toSci "Infinity"        -> Infinity\r
+ddbas761 toSci "infinity"        -> Infinity\r
+ddbas762 toSci "iNfInItY"        -> Infinity\r
+ddbas763 toSci "INFINITY"        -> Infinity\r
+ddbas764 toSci "+Infinity"       -> Infinity\r
+ddbas765 toSci "+infinity"       -> Infinity\r
+ddbas766 toSci "+iNfInItY"       -> Infinity\r
+ddbas767 toSci "+INFINITY"       -> Infinity\r
+ddbas768 toSci "-Infinity"       -> -Infinity\r
+ddbas769 toSci "-infinity"       -> -Infinity\r
+ddbas770 toSci "-iNfInItY"       -> -Infinity\r
+ddbas771 toSci "-INFINITY"       -> -Infinity\r
+\r
+-- Specials and zeros for toEng\r
+ddbast772 toEng "NaN"              -> NaN\r
+ddbast773 toEng "-Infinity"        -> -Infinity\r
+ddbast774 toEng "-sNaN"            -> -sNaN\r
+ddbast775 toEng "-NaN"             -> -NaN\r
+ddbast776 toEng "+Infinity"        -> Infinity\r
+ddbast778 toEng "+sNaN"            -> sNaN\r
+ddbast779 toEng "+NaN"             -> NaN\r
+ddbast780 toEng "INFINITY"         -> Infinity\r
+ddbast781 toEng "SNAN"             -> sNaN\r
+ddbast782 toEng "NAN"              -> NaN\r
+ddbast783 toEng "infinity"         -> Infinity\r
+ddbast784 toEng "snan"             -> sNaN\r
+ddbast785 toEng "nan"              -> NaN\r
+ddbast786 toEng "InFINITY"         -> Infinity\r
+ddbast787 toEng "SnAN"             -> sNaN\r
+ddbast788 toEng "nAN"              -> NaN\r
+ddbast789 toEng "iNfinity"         -> Infinity\r
+ddbast790 toEng "sNan"             -> sNaN\r
+ddbast791 toEng "Nan"              -> NaN\r
+ddbast792 toEng "Infinity"         -> Infinity\r
+ddbast793 toEng "sNaN"             -> sNaN\r
+\r
+-- Zero toEng, etc.\r
+ddbast800 toEng 0e+1              -> "0.00E+3"  -- doc example\r
+\r
+ddbast801 toEng 0.000000000       -> 0E-9\r
+ddbast802 toEng 0.00000000        -> 0.00E-6\r
+ddbast803 toEng 0.0000000         -> 0.0E-6\r
+ddbast804 toEng 0.000000          -> 0.000000\r
+ddbast805 toEng 0.00000           -> 0.00000\r
+ddbast806 toEng 0.0000            -> 0.0000\r
+ddbast807 toEng 0.000             -> 0.000\r
+ddbast808 toEng 0.00              -> 0.00\r
+ddbast809 toEng 0.0               -> 0.0\r
+ddbast810 toEng  .0               -> 0.0\r
+ddbast811 toEng 0.                -> 0\r
+ddbast812 toEng -.0               -> -0.0\r
+ddbast813 toEng -0.               -> -0\r
+ddbast814 toEng -0.0              -> -0.0\r
+ddbast815 toEng -0.00             -> -0.00\r
+ddbast816 toEng -0.000            -> -0.000\r
+ddbast817 toEng -0.0000           -> -0.0000\r
+ddbast818 toEng -0.00000          -> -0.00000\r
+ddbast819 toEng -0.000000         -> -0.000000\r
+ddbast820 toEng -0.0000000        -> -0.0E-6\r
+ddbast821 toEng -0.00000000       -> -0.00E-6\r
+ddbast822 toEng -0.000000000      -> -0E-9\r
+\r
+ddbast830 toEng  0.00E+0          -> 0.00\r
+ddbast831 toEng  0.00E+1          -> 0.0\r
+ddbast832 toEng  0.00E+2          -> 0\r
+ddbast833 toEng  0.00E+3          -> 0.00E+3\r
+ddbast834 toEng  0.00E+4          -> 0.0E+3\r
+ddbast835 toEng  0.00E+5          -> 0E+3\r
+ddbast836 toEng  0.00E+6          -> 0.00E+6\r
+ddbast837 toEng  0.00E+7          -> 0.0E+6\r
+ddbast838 toEng  0.00E+8          -> 0E+6\r
+ddbast839 toEng  0.00E+9          -> 0.00E+9\r
+\r
+ddbast840 toEng  0.0E+0           -> 0.0\r
+ddbast841 toEng  0.0E+1           -> 0\r
+ddbast842 toEng  0.0E+2           -> 0.00E+3\r
+ddbast843 toEng  0.0E+3           -> 0.0E+3\r
+ddbast844 toEng  0.0E+4           -> 0E+3\r
+ddbast845 toEng  0.0E+5           -> 0.00E+6\r
+ddbast846 toEng  0.0E+6           -> 0.0E+6\r
+ddbast847 toEng  0.0E+7           -> 0E+6\r
+ddbast848 toEng  0.0E+8           -> 0.00E+9\r
+ddbast849 toEng  0.0E+9           -> 0.0E+9\r
+\r
+ddbast850 toEng  0E+0             -> 0\r
+ddbast851 toEng  0E+1             -> 0.00E+3\r
+ddbast852 toEng  0E+2             -> 0.0E+3\r
+ddbast853 toEng  0E+3             -> 0E+3\r
+ddbast854 toEng  0E+4             -> 0.00E+6\r
+ddbast855 toEng  0E+5             -> 0.0E+6\r
+ddbast856 toEng  0E+6             -> 0E+6\r
+ddbast857 toEng  0E+7             -> 0.00E+9\r
+ddbast858 toEng  0E+8             -> 0.0E+9\r
+ddbast859 toEng  0E+9             -> 0E+9\r
+\r
+ddbast860 toEng  0.0E-0           -> 0.0\r
+ddbast861 toEng  0.0E-1           -> 0.00\r
+ddbast862 toEng  0.0E-2           -> 0.000\r
+ddbast863 toEng  0.0E-3           -> 0.0000\r
+ddbast864 toEng  0.0E-4           -> 0.00000\r
+ddbast865 toEng  0.0E-5           -> 0.000000\r
+ddbast866 toEng  0.0E-6           -> 0.0E-6\r
+ddbast867 toEng  0.0E-7           -> 0.00E-6\r
+ddbast868 toEng  0.0E-8           -> 0E-9\r
+ddbast869 toEng  0.0E-9           -> 0.0E-9\r
+\r
+ddbast870 toEng  0.00E-0          -> 0.00\r
+ddbast871 toEng  0.00E-1          -> 0.000\r
+ddbast872 toEng  0.00E-2          -> 0.0000\r
+ddbast873 toEng  0.00E-3          -> 0.00000\r
+ddbast874 toEng  0.00E-4          -> 0.000000\r
+ddbast875 toEng  0.00E-5          -> 0.0E-6\r
+ddbast876 toEng  0.00E-6          -> 0.00E-6\r
+ddbast877 toEng  0.00E-7          -> 0E-9\r
+ddbast878 toEng  0.00E-8          -> 0.0E-9\r
+ddbast879 toEng  0.00E-9          -> 0.00E-9\r
+\r
+-- long input strings\r
+ddbas801 tosci '01234567890123456' -> 1234567890123456\r
+ddbas802 tosci '001234567890123456' -> 1234567890123456\r
+ddbas803 tosci '0001234567890123456' -> 1234567890123456\r
+ddbas804 tosci '00001234567890123456' -> 1234567890123456\r
+ddbas805 tosci '000001234567890123456' -> 1234567890123456\r
+ddbas806 tosci '0000001234567890123456' -> 1234567890123456\r
+ddbas807 tosci '00000001234567890123456' -> 1234567890123456\r
+ddbas808 tosci '000000001234567890123456' -> 1234567890123456\r
+ddbas809 tosci '0000000001234567890123456' -> 1234567890123456\r
+ddbas810 tosci '00000000001234567890123456' -> 1234567890123456\r
+\r
+ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456\r
+ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456\r
+ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456\r
+ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456\r
+ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456\r
+ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456\r
+ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7\r
+ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8\r
+ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9\r
+ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10\r
+\r
+ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded\r
+ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded\r
+ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded\r
+ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded\r
+ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded\r
+ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded\r
+ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded\r
+ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded\r
+ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded\r
+\r
+-- subnormals and overflows\r
+ddbas906 toSci '99e999999999'       -> Infinity Overflow  Inexact Rounded\r
+ddbas907 toSci '999e999999999'      -> Infinity Overflow  Inexact Rounded\r
+ddbas908 toSci '0.9e-999999999'     -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas909 toSci '0.09e-999999999'    -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas910 toSci '0.1e1000000000'     -> Infinity Overflow  Inexact Rounded\r
+ddbas911 toSci '10e-1000000000'     -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas912 toSci '0.9e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+ddbas913 toSci '99e-9999999999'     -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas914 toSci '111e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+ddbas915 toSci '1111e-9999999999'   -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas916 toSci '1111e-99999999999'  -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas917 toSci '7e1000000000'       -> Infinity Overflow  Inexact Rounded\r
+-- negatives the same\r
+ddbas918 toSci '-99e999999999'      -> -Infinity Overflow  Inexact Rounded\r
+ddbas919 toSci '-999e999999999'     -> -Infinity Overflow  Inexact Rounded\r
+ddbas920 toSci '-0.9e-999999999'    -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas921 toSci '-0.09e-999999999'   -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas922 toSci '-0.1e1000000000'    -> -Infinity Overflow  Inexact Rounded\r
+ddbas923 toSci '-10e-1000000000'    -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas924 toSci '-0.9e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+ddbas925 toSci '-99e-9999999999'    -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas926 toSci '-111e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+ddbas927 toSci '-1111e-9999999999'  -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas929 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded\r
+\r
+-- overflow results at different rounding modes\r
+rounding:  ceiling\r
+ddbas930 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+ddbas931 toSci '-7e10000'  -> -9.999999999999999E+384 Overflow  Inexact Rounded\r
+rounding:  up\r
+ddbas932 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+ddbas933 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  down\r
+ddbas934 toSci  '7e10000'  ->  9.999999999999999E+384 Overflow  Inexact Rounded\r
+ddbas935 toSci '-7e10000'  -> -9.999999999999999E+384 Overflow  Inexact Rounded\r
+rounding:  floor\r
+ddbas936 toSci  '7e10000'  ->  9.999999999999999E+384 Overflow  Inexact Rounded\r
+ddbas937 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_up\r
+ddbas938 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+ddbas939 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_even\r
+ddbas940 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+ddbas941 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_down\r
+ddbas942 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+ddbas943 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_even\r
+\r
+-- Now check 854/754r some subnormals and underflow to 0\r
+ddbem400 toSci  1.0000E-383     -> 1.0000E-383\r
+ddbem401 toSci  0.1E-394        -> 1E-395       Subnormal\r
+ddbem402 toSci  0.1000E-394     -> 1.000E-395   Subnormal\r
+ddbem403 toSci  0.0100E-394     -> 1.00E-396    Subnormal\r
+ddbem404 toSci  0.0010E-394     -> 1.0E-397     Subnormal\r
+ddbem405 toSci  0.0001E-394     -> 1E-398       Subnormal\r
+ddbem406 toSci  0.00010E-394    -> 1E-398     Subnormal Rounded\r
+ddbem407 toSci  0.00013E-394    -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddbem408 toSci  0.00015E-394    -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem409 toSci  0.00017E-394    -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem410 toSci  0.00023E-394    -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem411 toSci  0.00025E-394    -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem412 toSci  0.00027E-394    -> 3E-398     Underflow Subnormal Inexact Rounded\r
+ddbem413 toSci  0.000149E-394   -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddbem414 toSci  0.000150E-394   -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem415 toSci  0.000151E-394   -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem416 toSci  0.000249E-394   -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem417 toSci  0.000250E-394   -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddbem418 toSci  0.000251E-394   -> 3E-398     Underflow Subnormal Inexact Rounded\r
+ddbem419 toSci  0.00009E-394    -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddbem420 toSci  0.00005E-394    -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem421 toSci  0.00003E-394    -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem422 toSci  0.000009E-394   -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem423 toSci  0.000005E-394   -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem424 toSci  0.000003E-394   -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+ddbem425 toSci  0.001049E-394   -> 1.0E-397   Underflow Subnormal Inexact Rounded\r
+ddbem426 toSci  0.001050E-394   -> 1.0E-397   Underflow Subnormal Inexact Rounded\r
+ddbem427 toSci  0.001051E-394   -> 1.1E-397   Underflow Subnormal Inexact Rounded\r
+ddbem428 toSci  0.001149E-394   -> 1.1E-397   Underflow Subnormal Inexact Rounded\r
+ddbem429 toSci  0.001150E-394   -> 1.2E-397   Underflow Subnormal Inexact Rounded\r
+ddbem430 toSci  0.001151E-394   -> 1.2E-397   Underflow Subnormal Inexact Rounded\r
+\r
+ddbem432 toSci  0.010049E-394   -> 1.00E-396  Underflow Subnormal Inexact Rounded\r
+ddbem433 toSci  0.010050E-394   -> 1.00E-396  Underflow Subnormal Inexact Rounded\r
+ddbem434 toSci  0.010051E-394   -> 1.01E-396  Underflow Subnormal Inexact Rounded\r
+ddbem435 toSci  0.010149E-394   -> 1.01E-396  Underflow Subnormal Inexact Rounded\r
+ddbem436 toSci  0.010150E-394   -> 1.02E-396  Underflow Subnormal Inexact Rounded\r
+ddbem437 toSci  0.010151E-394   -> 1.02E-396  Underflow Subnormal Inexact Rounded\r
+\r
+ddbem440 toSci  0.10103E-394    -> 1.010E-395 Underflow Subnormal Inexact Rounded\r
+ddbem441 toSci  0.10105E-394    -> 1.010E-395 Underflow Subnormal Inexact Rounded\r
+ddbem442 toSci  0.10107E-394    -> 1.011E-395 Underflow Subnormal Inexact Rounded\r
+ddbem443 toSci  0.10113E-394    -> 1.011E-395 Underflow Subnormal Inexact Rounded\r
+ddbem444 toSci  0.10115E-394    -> 1.012E-395 Underflow Subnormal Inexact Rounded\r
+ddbem445 toSci  0.10117E-394    -> 1.012E-395 Underflow Subnormal Inexact Rounded\r
+\r
+ddbem450 toSci  1.10730E-395   -> 1.107E-395 Underflow Subnormal Inexact Rounded\r
+ddbem451 toSci  1.10750E-395   -> 1.108E-395 Underflow Subnormal Inexact Rounded\r
+ddbem452 toSci  1.10770E-395   -> 1.108E-395 Underflow Subnormal Inexact Rounded\r
+ddbem453 toSci  1.10830E-395   -> 1.108E-395 Underflow Subnormal Inexact Rounded\r
+ddbem454 toSci  1.10850E-395   -> 1.108E-395 Underflow Subnormal Inexact Rounded\r
+ddbem455 toSci  1.10870E-395   -> 1.109E-395 Underflow Subnormal Inexact Rounded\r
+\r
+-- make sure sign OK\r
+ddbem456 toSci  -0.10103E-394   -> -1.010E-395 Underflow Subnormal Inexact Rounded\r
+ddbem457 toSci  -0.10105E-394   -> -1.010E-395 Underflow Subnormal Inexact Rounded\r
+ddbem458 toSci  -0.10107E-394   -> -1.011E-395 Underflow Subnormal Inexact Rounded\r
+ddbem459 toSci  -0.10113E-394   -> -1.011E-395 Underflow Subnormal Inexact Rounded\r
+ddbem460 toSci  -0.10115E-394   -> -1.012E-395 Underflow Subnormal Inexact Rounded\r
+ddbem461 toSci  -0.10117E-394   -> -1.012E-395 Underflow Subnormal Inexact Rounded\r
+\r
+-- '999s' cases\r
+ddbem464 toSci  999999E-395         -> 9.99999E-390 Subnormal\r
+ddbem465 toSci  99999.0E-394        -> 9.99990E-390 Subnormal\r
+ddbem466 toSci  99999.E-394         -> 9.9999E-390  Subnormal\r
+ddbem467 toSci  9999.9E-394         -> 9.9999E-391  Subnormal\r
+ddbem468 toSci  999.99E-394         -> 9.9999E-392  Subnormal\r
+ddbem469 toSci  99.999E-394         -> 9.9999E-393  Subnormal\r
+ddbem470 toSci  9.9999E-394         -> 9.9999E-394  Subnormal\r
+ddbem471 toSci  0.99999E-394        -> 1.0000E-394 Underflow Subnormal Inexact Rounded\r
+ddbem472 toSci  0.099999E-394       -> 1.000E-395 Underflow Subnormal Inexact Rounded\r
+ddbem473 toSci  0.0099999E-394      -> 1.00E-396  Underflow Subnormal Inexact Rounded\r
+ddbem474 toSci  0.00099999E-394     -> 1.0E-397   Underflow Subnormal Inexact Rounded\r
+ddbem475 toSci  0.000099999E-394    -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddbem476 toSci  0.0000099999E-394   -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem477 toSci  0.00000099999E-394  -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddbem478 toSci  0.000000099999E-394 -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- Exponents with insignificant leading zeros\r
+ddbas1001 toSci  1e999999999 -> Infinity Overflow Inexact Rounded\r
+ddbas1002 toSci  1e0999999999 -> Infinity Overflow Inexact Rounded\r
+ddbas1003 toSci  1e00999999999 -> Infinity Overflow Inexact Rounded\r
+ddbas1004 toSci  1e000999999999 -> Infinity Overflow Inexact Rounded\r
+ddbas1005 toSci  1e000000000000999999999 -> Infinity Overflow Inexact Rounded\r
+ddbas1006 toSci  1e000000000001000000007 -> Infinity Overflow Inexact Rounded\r
+ddbas1007 toSci  1e-999999999 -> 0E-398             Underflow Subnormal Inexact Rounded Clamped\r
+ddbas1008 toSci  1e-0999999999 -> 0E-398            Underflow Subnormal Inexact Rounded Clamped\r
+ddbas1009 toSci  1e-00999999999 -> 0E-398           Underflow Subnormal Inexact Rounded Clamped\r
+ddbas1010 toSci  1e-000999999999 -> 0E-398          Underflow Subnormal Inexact Rounded Clamped\r
+ddbas1011 toSci  1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddbas1012 toSci  1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- check for double-rounded subnormals\r
+ddbas1041 toSci     1.1111111111152444E-384 ->  1.11111111111524E-384 Inexact Rounded Subnormal Underflow\r
+ddbas1042 toSci     1.1111111111152445E-384 ->  1.11111111111524E-384 Inexact Rounded Subnormal Underflow\r
+ddbas1043 toSci     1.1111111111152446E-384 ->  1.11111111111524E-384 Inexact Rounded Subnormal Underflow\r
+\r
+-- clamped zeros [see also clamp.decTest]\r
+ddbas1075 toSci   0e+10000  ->  0E+369  Clamped\r
+ddbas1076 toSci   0e-10000  ->  0E-398  Clamped\r
+ddbas1077 toSci  -0e+10000  -> -0E+369  Clamped\r
+ddbas1078 toSci  -0e-10000  -> -0E-398  Clamped\r
+\r
+-- extreme values from next-wider\r
+ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded\r
+ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped\r
+ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped\r
+ddbas1104 toSci -0 -> -0\r
+ddbas1105 toSci +0 ->  0\r
+ddbas1106 toSci +1E-6176 ->  0E-398 Inexact Rounded Subnormal Underflow Clamped\r
+ddbas1107 toSci +1E-6173 ->  0E-398 Inexact Rounded Subnormal Underflow Clamped\r
+ddbas1108 toSci +9.99999999999999999999999999999999E+6144 ->  Infinity Overflow Inexact Rounded\r
+\r
diff --git a/Lib/test/decimaltestdata/ddCanonical.decTest b/Lib/test/decimaltestdata/ddCanonical.decTest
new file mode 100644 (file)
index 0000000..308b9ff
--- /dev/null
@@ -0,0 +1,357 @@
+------------------------------------------------------------------------\r
+-- ddCanonical.decTest -- test decDouble canonical results            --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This file tests that copy operations leave uncanonical operands\r
+-- unchanged, and vice versa\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Uncanonical declets are: abc, where:\r
+--   a=1,2,3\r
+--   b=6,7,e,f\r
+--   c=e,f\r
+\r
+-- assert some standard (canonical) values; this tests that FromString\r
+-- produces canonical results (many more in decimalNN)\r
+ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff\r
+ddcan002 apply 0                      -> #2238000000000000\r
+ddcan003 apply 1                      -> #2238000000000001\r
+ddcan004 apply -1                     -> #a238000000000001\r
+ddcan005 apply Infinity               -> #7800000000000000\r
+ddcan006 apply -Infinity              -> #f800000000000000\r
+ddcan007 apply -NaN                   -> #fc00000000000000\r
+ddcan008 apply -sNaN                  -> #fe00000000000000\r
+ddcan009 apply NaN999999999999999     -> #7c00ff3fcff3fcff\r
+ddcan010 apply sNaN999999999999999    -> #7e00ff3fcff3fcff\r
+decan011 apply  9999999999999999      -> #6e38ff3fcff3fcff\r
+ddcan012 apply 7.50                   -> #22300000000003d0\r
+ddcan013 apply 9.99                   -> #22300000000000ff\r
+\r
+-- Base tests for canonical encodings (individual operator\r
+-- propagation is tested later)\r
+\r
+-- Finites: declets in coefficient\r
+ddcan021 canonical  #77fcff3fcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan022 canonical  #77fcff3fcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan023 canonical  #77ffff3fcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan024 canonical  #77ffff3fcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan025 canonical  #77fcffffcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan026 canonical  #77fcffffcff3fcff  -> #77fcff3fcff3fcff\r
+ddcan027 canonical  #77fcff3ffff3fcff  -> #77fcff3fcff3fcff\r
+ddcan028 canonical  #77fcff3ffff3fcff  -> #77fcff3fcff3fcff\r
+ddcan030 canonical  #77fcff3fcffffcff  -> #77fcff3fcff3fcff\r
+ddcan031 canonical  #77fcff3fcffffcff  -> #77fcff3fcff3fcff\r
+ddcan032 canonical  #77fcff3fcff3ffff  -> #77fcff3fcff3fcff\r
+ddcan033 canonical  #77fcff3fcff3ffff  -> #77fcff3fcff3fcff\r
+ddcan035 canonical  #77fcff3fdff3fcff  -> #77fcff3fcff3fcff\r
+ddcan036 canonical  #77fcff3feff3fcff  -> #77fcff3fcff3fcff\r
+\r
+-- NaN: declets in payload\r
+ddcan100 canonical  NaN999999999999999 -> #7c00ff3fcff3fcff\r
+ddcan101 canonical  #7c00ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan102 canonical  #7c03ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan103 canonical  #7c00ffffcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan104 canonical  #7c00ff3ffff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan105 canonical  #7c00ff3fcffffcff  -> #7c00ff3fcff3fcff\r
+ddcan106 canonical  #7c00ff3fcff3ffff  -> #7c00ff3fcff3fcff\r
+ddcan107 canonical  #7c00ff3fcff3ffff  -> #7c00ff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan110 canonical  #7c00ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan112 canonical  #7d00ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan113 canonical  #7c80ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan114 canonical  #7c40ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan115 canonical  #7c20ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan116 canonical  #7c10ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan117 canonical  #7c08ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+ddcan118 canonical  #7c04ff3fcff3fcff  -> #7c00ff3fcff3fcff\r
+\r
+-- sNaN: declets in payload\r
+ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff\r
+ddcan121 canonical  #7e00ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan122 canonical  #7e03ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan123 canonical  #7e00ffffcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan124 canonical  #7e00ff3ffff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan125 canonical  #7e00ff3fcffffcff  -> #7e00ff3fcff3fcff\r
+ddcan126 canonical  #7e00ff3fcff3ffff  -> #7e00ff3fcff3fcff\r
+ddcan127 canonical  #7e00ff3fcff3ffff  -> #7e00ff3fcff3fcff\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan130 canonical  #7e00ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan132 canonical  #7f00ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan133 canonical  #7e80ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan134 canonical  #7e40ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan135 canonical  #7e20ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan136 canonical  #7e10ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan137 canonical  #7e08ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+ddcan138 canonical  #7e04ff3fcff3fcff  -> #7e00ff3fcff3fcff\r
+\r
+-- Inf: exponent continuation bits\r
+ddcan140 canonical  #7800000000000000  -> #7800000000000000\r
+ddcan141 canonical  #7900000000000000  -> #7800000000000000\r
+ddcan142 canonical  #7a00000000000000  -> #7800000000000000\r
+ddcan143 canonical  #7880000000000000  -> #7800000000000000\r
+ddcan144 canonical  #7840000000000000  -> #7800000000000000\r
+ddcan145 canonical  #7820000000000000  -> #7800000000000000\r
+ddcan146 canonical  #7810000000000000  -> #7800000000000000\r
+ddcan147 canonical  #7808000000000000  -> #7800000000000000\r
+ddcan148 canonical  #7804000000000000  -> #7800000000000000\r
+\r
+-- Inf: coefficient continuation bits (first, last, and a few others)\r
+ddcan150 canonical  #7800000000000000  -> #7800000000000000\r
+ddcan151 canonical  #7802000000000000  -> #7800000000000000\r
+ddcan152 canonical  #7800000000000001  -> #7800000000000000\r
+ddcan153 canonical  #7801000000000000  -> #7800000000000000\r
+ddcan154 canonical  #7800200000000000  -> #7800000000000000\r
+ddcan155 canonical  #7800080000000000  -> #7800000000000000\r
+ddcan156 canonical  #7800002000000000  -> #7800000000000000\r
+ddcan157 canonical  #7800000400000000  -> #7800000000000000\r
+ddcan158 canonical  #7800000040000000  -> #7800000000000000\r
+ddcan159 canonical  #7800000008000000  -> #7800000000000000\r
+ddcan160 canonical  #7800000000400000  -> #7800000000000000\r
+ddcan161 canonical  #7800000000020000  -> #7800000000000000\r
+ddcan162 canonical  #7800000000008000  -> #7800000000000000\r
+ddcan163 canonical  #7800000000000200  -> #7800000000000000\r
+ddcan164 canonical  #7800000000000040  -> #7800000000000000\r
+ddcan165 canonical  #7800000000000008  -> #7800000000000000\r
+\r
+\r
+-- Now the operators -- trying to check paths that might fail to\r
+-- canonicalize propagated operands\r
+\r
+----- Add:\r
+-- Finites: neutral 0\r
+ddcan202 add  0E+384 #77ffff3fcff3fcff        -> #77fcff3fcff3fcff\r
+ddcan203 add         #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff\r
+-- tiny zero\r
+ddcan204 add  0E-398 #77ffff3fcff3fcff        -> #77fcff3fcff3fcff Rounded\r
+ddcan205 add         #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded\r
+-- tiny non zero\r
+ddcan206 add -1E-398 #77ffff3fcff3fcff         -> #77fcff3fcff3fcff Inexact Rounded\r
+ddcan207 add         #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded\r
+-- NaN: declets in payload\r
+ddcan211 add  0  #7c03ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan212 add     #7c03ff3fcff3fcff  0   -> #7c00ff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan213 add  0  #7c40ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan214 add     #7c40ff3fcff3fcff  0   -> #7c00ff3fcff3fcff\r
+-- sNaN: declets in payload\r
+ddcan215 add  0  #7e00ffffcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan216 add     #7e00ffffcff3fcff  0   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan217 add  0  #7e80ff3fcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan218 add     #7e80ff3fcff3fcff  0   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- Inf: exponent continuation bits\r
+ddcan220 add  0  #7880000000000000      -> #7800000000000000\r
+ddcan221 add     #7880000000000000  0   -> #7800000000000000\r
+-- Inf: coefficient continuation bits\r
+ddcan222 add  0  #7802000000000000     -> #7800000000000000\r
+ddcan223 add     #7802000000000000  0  -> #7800000000000000\r
+ddcan224 add  0  #7800000000000001     -> #7800000000000000\r
+ddcan225 add     #7800000000000001  0  -> #7800000000000000\r
+ddcan226 add  0  #7800002000000000     -> #7800000000000000\r
+ddcan227 add     #7800002000000000  0  -> #7800000000000000\r
+\r
+----- Class: [does not return encoded]\r
+\r
+----- Compare:\r
+ddcan231 compare -Inf   1     ->  #a238000000000001\r
+ddcan232 compare -Inf  -Inf   ->  #2238000000000000\r
+ddcan233 compare  1    -Inf   ->  #2238000000000001\r
+ddcan234 compare  #7c00ff3ffff3fcff -1000  ->  #7c00ff3fcff3fcff\r
+ddcan235 compare  #7e00ff3ffff3fcff -1000  ->  #7c00ff3fcff3fcff  Invalid_operation\r
+\r
+----- CompareSig:\r
+ddcan241 comparesig -Inf   1     ->  #a238000000000001\r
+ddcan242 comparesig -Inf  -Inf   ->  #2238000000000000\r
+ddcan243 comparesig  1    -Inf   ->  #2238000000000001\r
+ddcan244 comparesig  #7c00ff3ffff3fcff -1000  ->  #7c00ff3fcff3fcff  Invalid_operation\r
+ddcan245 comparesig  #7e00ff3ffff3fcff -1000  ->  #7c00ff3fcff3fcff  Invalid_operation\r
+\r
+----- Copy: [does not usually canonicalize]\r
+-- finites\r
+ddcan250 copy  #77ffff3fcff3fcff  -> #77ffff3fcff3fcff\r
+ddcan251 copy  #77fcff3fdff3fcff  -> #77fcff3fdff3fcff\r
+-- NaNs\r
+ddcan252 copy  #7c03ff3fcff3fcff  -> #7c03ff3fcff3fcff\r
+ddcan253 copy  #7c00ff3fcff3ffff  -> #7c00ff3fcff3ffff\r
+ddcan254 copy  #7d00ff3fcff3fcff  -> #7d00ff3fcff3fcff\r
+ddcan255 copy  #7c04ff3fcff3fcff  -> #7c04ff3fcff3fcff\r
+-- sNaN\r
+ddcan256 copy  #7e00ff3fcffffcff  -> #7e00ff3fcffffcff\r
+ddcan257 copy  #7e40ff3fcff3fcff  -> #7e40ff3fcff3fcff\r
+-- Inf\r
+ddcan258 copy  #7a00000000000000  -> #7a00000000000000\r
+ddcan259 copy  #7800200000000000  -> #7800200000000000\r
+\r
+----- CopyAbs: [does not usually canonicalize]\r
+-- finites\r
+ddcan260 copyabs  #f7ffff3fcff3fcff  -> #77ffff3fcff3fcff\r
+ddcan261 copyabs  #f7fcff3fdff3fcff  -> #77fcff3fdff3fcff\r
+-- NaNs\r
+ddcan262 copyabs  #fc03ff3fcff3fcff  -> #7c03ff3fcff3fcff\r
+ddcan263 copyabs  #fc00ff3fcff3ffff  -> #7c00ff3fcff3ffff\r
+ddcan264 copyabs  #fd00ff3fcff3fcff  -> #7d00ff3fcff3fcff\r
+ddcan265 copyabs  #fc04ff3fcff3fcff  -> #7c04ff3fcff3fcff\r
+-- sNaN\r
+ddcan266 copyabs  #fe00ff3fcffffcff  -> #7e00ff3fcffffcff\r
+ddcan267 copyabs  #fe40ff3fcff3fcff  -> #7e40ff3fcff3fcff\r
+-- Inf\r
+ddcan268 copyabs  #fa00000000000000  -> #7a00000000000000\r
+ddcan269 copyabs  #f800200000000000  -> #7800200000000000\r
+\r
+----- CopyNegate: [does not usually canonicalize]\r
+-- finites\r
+ddcan270 copynegate  #77ffff3fcff3fcff  -> #f7ffff3fcff3fcff\r
+ddcan271 copynegate  #77fcff3fdff3fcff  -> #f7fcff3fdff3fcff\r
+-- NaNs\r
+ddcan272 copynegate  #7c03ff3fcff3fcff  -> #fc03ff3fcff3fcff\r
+ddcan273 copynegate  #7c00ff3fcff3ffff  -> #fc00ff3fcff3ffff\r
+ddcan274 copynegate  #7d00ff3fcff3fcff  -> #fd00ff3fcff3fcff\r
+ddcan275 copynegate  #7c04ff3fcff3fcff  -> #fc04ff3fcff3fcff\r
+-- sNaN\r
+ddcan276 copynegate  #7e00ff3fcffffcff  -> #fe00ff3fcffffcff\r
+ddcan277 copynegate  #7e40ff3fcff3fcff  -> #fe40ff3fcff3fcff\r
+-- Inf\r
+ddcan278 copynegate  #7a00000000000000  -> #fa00000000000000\r
+ddcan279 copynegate  #7800200000000000  -> #f800200000000000\r
+\r
+----- CopySign: [does not usually canonicalize]\r
+-- finites\r
+ddcan280 copysign  #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff\r
+ddcan281 copysign  #77fcff3fdff3fcff  1 -> #77fcff3fdff3fcff\r
+-- NaNs\r
+ddcan282 copysign  #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff\r
+ddcan283 copysign  #7c00ff3fcff3ffff  1 -> #7c00ff3fcff3ffff\r
+ddcan284 copysign  #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff\r
+ddcan285 copysign  #7c04ff3fcff3fcff  1 -> #7c04ff3fcff3fcff\r
+-- sNaN\r
+ddcan286 copysign  #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff\r
+ddcan287 copysign  #7e40ff3fcff3fcff  1 -> #7e40ff3fcff3fcff\r
+-- Inf\r
+ddcan288 copysign  #7a00000000000000 -1 -> #fa00000000000000\r
+ddcan289 copysign  #7800200000000000  1 -> #7800200000000000\r
+\r
+----- Multiply:\r
+-- Finites: neutral 0\r
+ddcan302 multiply  1      #77ffff3fcff3fcff        -> #77fcff3fcff3fcff\r
+ddcan303 multiply         #77fcffffcff3fcff  1     -> #77fcff3fcff3fcff\r
+-- negative\r
+ddcan306 multiply -1      #77ffff3fcff3fcff        -> #f7fcff3fcff3fcff\r
+ddcan307 multiply         #77fcffffcff3fcff -1     -> #f7fcff3fcff3fcff\r
+-- NaN: declets in payload\r
+ddcan311 multiply  1  #7c03ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan312 multiply     #7c03ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan313 multiply  1  #7c40ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan314 multiply     #7c40ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+-- sNaN: declets in payload\r
+ddcan315 multiply  1  #7e00ffffcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan316 multiply     #7e00ffffcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan317 multiply  1  #7e80ff3fcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan318 multiply     #7e80ff3fcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- Inf: exponent continuation bits\r
+ddcan320 multiply  1  #7880000000000000      -> #7800000000000000\r
+ddcan321 multiply     #7880000000000000  1   -> #7800000000000000\r
+-- Inf: coefficient continuation bits\r
+ddcan322 multiply  1  #7802000000000000     -> #7800000000000000\r
+ddcan323 multiply     #7802000000000000  1  -> #7800000000000000\r
+ddcan324 multiply  1  #7800000000000001     -> #7800000000000000\r
+ddcan325 multiply     #7800000000000001  1  -> #7800000000000000\r
+ddcan326 multiply  1  #7800002000000000     -> #7800000000000000\r
+ddcan327 multiply     #7800002000000000  1  -> #7800000000000000\r
+\r
+----- Quantize:\r
+ddcan401 quantize  #6e38ff3ffff3fcff 1    -> #6e38ff3fcff3fcff\r
+ddcan402 quantize  #6e38ff3fcff3fdff 0    -> #6e38ff3fcff3fcff\r
+ddcan403 quantize  #7880000000000000 Inf  -> #7800000000000000\r
+ddcan404 quantize  #7802000000000000 -Inf -> #7800000000000000\r
+ddcan410 quantize  #7c03ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+ddcan411 quantize  #7c03ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+ddcan412 quantize  #7c40ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+ddcan413 quantize  #7c40ff3fcff3fcff  1   -> #7c00ff3fcff3fcff\r
+ddcan414 quantize  #7e00ffffcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan415 quantize  #7e00ffffcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan416 quantize  #7e80ff3fcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan417 quantize  #7e80ff3fcff3fcff  1   -> #7c00ff3fcff3fcff Invalid_operation\r
+\r
+----- Subtract:\r
+-- Finites: neutral 0\r
+ddcan502 subtract  0E+384 #77ffff3fcff3fcff        -> #f7fcff3fcff3fcff\r
+ddcan503 subtract         #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff\r
+-- tiny zero\r
+ddcan504 subtract  0E-398 #77ffff3fcff3fcff        -> #f7fcff3fcff3fcff Rounded\r
+ddcan505 subtract         #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded\r
+-- tiny non zero\r
+ddcan506 subtract -1E-398 #77ffff3fcff3fcff         -> #f7fcff3fcff3fcff Inexact Rounded\r
+ddcan507 subtract         #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded\r
+-- NaN: declets in payload\r
+ddcan511 subtract  0  #7c03ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan512 subtract     #7c03ff3fcff3fcff  0   -> #7c00ff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan513 subtract  0  #7c40ff3fcff3fcff      -> #7c00ff3fcff3fcff\r
+ddcan514 subtract     #7c40ff3fcff3fcff  0   -> #7c00ff3fcff3fcff\r
+-- sNaN: declets in payload\r
+ddcan515 subtract  0  #7e00ffffcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan516 subtract     #7e00ffffcff3fcff  0   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+ddcan517 subtract  0  #7e80ff3fcff3fcff      -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan518 subtract     #7e80ff3fcff3fcff  0   -> #7c00ff3fcff3fcff Invalid_operation\r
+-- Inf: exponent continuation bits\r
+ddcan520 subtract  0  #7880000000000000      -> #f800000000000000\r
+ddcan521 subtract     #7880000000000000  0   -> #7800000000000000\r
+-- Inf: coefficient continuation bits\r
+ddcan522 subtract  0  #7802000000000000     -> #f800000000000000\r
+ddcan523 subtract     #7802000000000000  0  -> #7800000000000000\r
+ddcan524 subtract  0  #7800000000000001     -> #f800000000000000\r
+ddcan525 subtract     #7800000000000001  0  -> #7800000000000000\r
+ddcan526 subtract  0  #7800002000000000     -> #f800000000000000\r
+ddcan527 subtract     #7800002000000000  0  -> #7800000000000000\r
+\r
+----- ToIntegral:\r
+ddcan601 tointegralx  #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff\r
+ddcan602 tointegralx  #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff\r
+ddcan603 tointegralx  #7880000000000000 -> #7800000000000000\r
+ddcan604 tointegralx  #7802000000000000 -> #7800000000000000\r
+ddcan610 tointegralx  #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff\r
+ddcan611 tointegralx  #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff\r
+ddcan612 tointegralx  #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff\r
+ddcan613 tointegralx  #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff\r
+ddcan614 tointegralx  #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan615 tointegralx  #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan616 tointegralx  #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation\r
+ddcan617 tointegralx  #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation\r
+-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives\r
+ddcan618 tointegralx  #2238000000000fff -> #2238000000000cff\r
+ddcan619 tointegralx  #2230000000000fff -> #2238000000000040 Inexact Rounded\r
+ddcan620 tointegralx  #222c000000000fff -> #2238000000000004 Inexact Rounded\r
+ddcan621 tointegralx  #2228000000000fff -> #2238000000000000 Inexact Rounded\r
+ddcan622 tointegralx  #a238000000000fff -> #a238000000000cff\r
+ddcan623 tointegralx  #a230000000000fff -> #a238000000000040 Inexact Rounded\r
+ddcan624 tointegralx  #a22c000000000fff -> #a238000000000004 Inexact Rounded\r
+ddcan625 tointegralx  #a228000000000fff -> #a238000000000000 Inexact Rounded\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddClass.decTest b/Lib/test/decimaltestdata/ddClass.decTest
new file mode 100644 (file)
index 0000000..0b1d1f3
--- /dev/null
@@ -0,0 +1,76 @@
+------------------------------------------------------------------------\r
+-- ddClass.decTest -- decDouble Class operations                      --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- [New 2006.11.27]\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddcla001  class    0                        -> +Zero\r
+ddcla002  class    0.00                     -> +Zero\r
+ddcla003  class    0E+5                     -> +Zero\r
+ddcla004  class    1E-396                   -> +Subnormal\r
+ddcla005  class  0.1E-383                   -> +Subnormal\r
+ddcla006  class  0.999999999999999E-383     -> +Subnormal\r
+ddcla007  class  1.000000000000000E-383     -> +Normal\r
+ddcla008  class   1E-383                    -> +Normal\r
+ddcla009  class   1E-100                    -> +Normal\r
+ddcla010  class   1E-10                     -> +Normal\r
+ddcla012  class   1E-1                      -> +Normal\r
+ddcla013  class   1                         -> +Normal\r
+ddcla014  class   2.50                      -> +Normal\r
+ddcla015  class   100.100                   -> +Normal\r
+ddcla016  class   1E+30                     -> +Normal\r
+ddcla017  class   1E+384                    -> +Normal\r
+ddcla018  class   9.999999999999999E+384    -> +Normal\r
+ddcla019  class   Inf                       -> +Infinity\r
+\r
+ddcla021  class   -0                        -> -Zero\r
+ddcla022  class   -0.00                     -> -Zero\r
+ddcla023  class   -0E+5                     -> -Zero\r
+ddcla024  class   -1E-396                   -> -Subnormal\r
+ddcla025  class  -0.1E-383                  -> -Subnormal\r
+ddcla026  class  -0.999999999999999E-383    -> -Subnormal\r
+ddcla027  class  -1.000000000000000E-383    -> -Normal\r
+ddcla028  class  -1E-383                    -> -Normal\r
+ddcla029  class  -1E-100                    -> -Normal\r
+ddcla030  class  -1E-10                     -> -Normal\r
+ddcla032  class  -1E-1                      -> -Normal\r
+ddcla033  class  -1                         -> -Normal\r
+ddcla034  class  -2.50                      -> -Normal\r
+ddcla035  class  -100.100                   -> -Normal\r
+ddcla036  class  -1E+30                     -> -Normal\r
+ddcla037  class  -1E+384                    -> -Normal\r
+ddcla038  class  -9.999999999999999E+384    -> -Normal\r
+ddcla039  class  -Inf                       -> -Infinity\r
+\r
+ddcla041  class   NaN                       -> NaN\r
+ddcla042  class  -NaN                       -> NaN\r
+ddcla043  class  +NaN12345                  -> NaN\r
+ddcla044  class   sNaN                      -> sNaN\r
+ddcla045  class  -sNaN                      -> sNaN\r
+ddcla046  class  +sNaN12345                 -> sNaN\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddCompare.decTest b/Lib/test/decimaltestdata/ddCompare.decTest
new file mode 100644 (file)
index 0000000..b225d0d
--- /dev/null
@@ -0,0 +1,744 @@
+------------------------------------------------------------------------\r
+-- ddCompare.decTest -- decDouble comparison that allows quiet NaNs   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddcom001 compare  -2  -2  -> 0\r
+ddcom002 compare  -2  -1  -> -1\r
+ddcom003 compare  -2   0  -> -1\r
+ddcom004 compare  -2   1  -> -1\r
+ddcom005 compare  -2   2  -> -1\r
+ddcom006 compare  -1  -2  -> 1\r
+ddcom007 compare  -1  -1  -> 0\r
+ddcom008 compare  -1   0  -> -1\r
+ddcom009 compare  -1   1  -> -1\r
+ddcom010 compare  -1   2  -> -1\r
+ddcom011 compare   0  -2  -> 1\r
+ddcom012 compare   0  -1  -> 1\r
+ddcom013 compare   0   0  -> 0\r
+ddcom014 compare   0   1  -> -1\r
+ddcom015 compare   0   2  -> -1\r
+ddcom016 compare   1  -2  -> 1\r
+ddcom017 compare   1  -1  -> 1\r
+ddcom018 compare   1   0  -> 1\r
+ddcom019 compare   1   1  -> 0\r
+ddcom020 compare   1   2  -> -1\r
+ddcom021 compare   2  -2  -> 1\r
+ddcom022 compare   2  -1  -> 1\r
+ddcom023 compare   2   0  -> 1\r
+ddcom025 compare   2   1  -> 1\r
+ddcom026 compare   2   2  -> 0\r
+\r
+ddcom031 compare  -20  -20  -> 0\r
+ddcom032 compare  -20  -10  -> -1\r
+ddcom033 compare  -20   00  -> -1\r
+ddcom034 compare  -20   10  -> -1\r
+ddcom035 compare  -20   20  -> -1\r
+ddcom036 compare  -10  -20  -> 1\r
+ddcom037 compare  -10  -10  -> 0\r
+ddcom038 compare  -10   00  -> -1\r
+ddcom039 compare  -10   10  -> -1\r
+ddcom040 compare  -10   20  -> -1\r
+ddcom041 compare   00  -20  -> 1\r
+ddcom042 compare   00  -10  -> 1\r
+ddcom043 compare   00   00  -> 0\r
+ddcom044 compare   00   10  -> -1\r
+ddcom045 compare   00   20  -> -1\r
+ddcom046 compare   10  -20  -> 1\r
+ddcom047 compare   10  -10  -> 1\r
+ddcom048 compare   10   00  -> 1\r
+ddcom049 compare   10   10  -> 0\r
+ddcom050 compare   10   20  -> -1\r
+ddcom051 compare   20  -20  -> 1\r
+ddcom052 compare   20  -10  -> 1\r
+ddcom053 compare   20   00  -> 1\r
+ddcom055 compare   20   10  -> 1\r
+ddcom056 compare   20   20  -> 0\r
+\r
+ddcom061 compare  -2.0  -2.0  -> 0\r
+ddcom062 compare  -2.0  -1.0  -> -1\r
+ddcom063 compare  -2.0   0.0  -> -1\r
+ddcom064 compare  -2.0   1.0  -> -1\r
+ddcom065 compare  -2.0   2.0  -> -1\r
+ddcom066 compare  -1.0  -2.0  -> 1\r
+ddcom067 compare  -1.0  -1.0  -> 0\r
+ddcom068 compare  -1.0   0.0  -> -1\r
+ddcom069 compare  -1.0   1.0  -> -1\r
+ddcom070 compare  -1.0   2.0  -> -1\r
+ddcom071 compare   0.0  -2.0  -> 1\r
+ddcom072 compare   0.0  -1.0  -> 1\r
+ddcom073 compare   0.0   0.0  -> 0\r
+ddcom074 compare   0.0   1.0  -> -1\r
+ddcom075 compare   0.0   2.0  -> -1\r
+ddcom076 compare   1.0  -2.0  -> 1\r
+ddcom077 compare   1.0  -1.0  -> 1\r
+ddcom078 compare   1.0   0.0  -> 1\r
+ddcom079 compare   1.0   1.0  -> 0\r
+ddcom080 compare   1.0   2.0  -> -1\r
+ddcom081 compare   2.0  -2.0  -> 1\r
+ddcom082 compare   2.0  -1.0  -> 1\r
+ddcom083 compare   2.0   0.0  -> 1\r
+ddcom085 compare   2.0   1.0  -> 1\r
+ddcom086 compare   2.0   2.0  -> 0\r
+ddcom087 compare   1.0   0.1  -> 1\r
+ddcom088 compare   0.1   1.0  -> -1\r
+\r
+-- now some cases which might overflow if subtract were used\r
+ddcom095 compare  9.999999999999999E+384 9.999999999999999E+384  -> 0\r
+ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384  -> -1\r
+ddcom097 compare  9.999999999999999E+384 -9.999999999999999E+384 -> 1\r
+ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0\r
+\r
+-- some differing length/exponent cases\r
+ddcom100 compare   7.0    7.0    -> 0\r
+ddcom101 compare   7.0    7      -> 0\r
+ddcom102 compare   7      7.0    -> 0\r
+ddcom103 compare   7E+0   7.0    -> 0\r
+ddcom104 compare   70E-1  7.0    -> 0\r
+ddcom105 compare   0.7E+1 7      -> 0\r
+ddcom106 compare   70E-1  7      -> 0\r
+ddcom107 compare   7.0    7E+0   -> 0\r
+ddcom108 compare   7.0    70E-1  -> 0\r
+ddcom109 compare   7      0.7E+1 -> 0\r
+ddcom110 compare   7      70E-1  -> 0\r
+\r
+ddcom120 compare   8.0    7.0    -> 1\r
+ddcom121 compare   8.0    7      -> 1\r
+ddcom122 compare   8      7.0    -> 1\r
+ddcom123 compare   8E+0   7.0    -> 1\r
+ddcom124 compare   80E-1  7.0    -> 1\r
+ddcom125 compare   0.8E+1 7      -> 1\r
+ddcom126 compare   80E-1  7      -> 1\r
+ddcom127 compare   8.0    7E+0   -> 1\r
+ddcom128 compare   8.0    70E-1  -> 1\r
+ddcom129 compare   8      0.7E+1  -> 1\r
+ddcom130 compare   8      70E-1  -> 1\r
+\r
+ddcom140 compare   8.0    9.0    -> -1\r
+ddcom141 compare   8.0    9      -> -1\r
+ddcom142 compare   8      9.0    -> -1\r
+ddcom143 compare   8E+0   9.0    -> -1\r
+ddcom144 compare   80E-1  9.0    -> -1\r
+ddcom145 compare   0.8E+1 9      -> -1\r
+ddcom146 compare   80E-1  9      -> -1\r
+ddcom147 compare   8.0    9E+0   -> -1\r
+ddcom148 compare   8.0    90E-1  -> -1\r
+ddcom149 compare   8      0.9E+1 -> -1\r
+ddcom150 compare   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+ddcom200 compare  -7.0    7.0    -> -1\r
+ddcom201 compare  -7.0    7      -> -1\r
+ddcom202 compare  -7      7.0    -> -1\r
+ddcom203 compare  -7E+0   7.0    -> -1\r
+ddcom204 compare  -70E-1  7.0    -> -1\r
+ddcom205 compare  -0.7E+1 7      -> -1\r
+ddcom206 compare  -70E-1  7      -> -1\r
+ddcom207 compare  -7.0    7E+0   -> -1\r
+ddcom208 compare  -7.0    70E-1  -> -1\r
+ddcom209 compare  -7      0.7E+1 -> -1\r
+ddcom210 compare  -7      70E-1  -> -1\r
+\r
+ddcom220 compare  -8.0    7.0    -> -1\r
+ddcom221 compare  -8.0    7      -> -1\r
+ddcom222 compare  -8      7.0    -> -1\r
+ddcom223 compare  -8E+0   7.0    -> -1\r
+ddcom224 compare  -80E-1  7.0    -> -1\r
+ddcom225 compare  -0.8E+1 7      -> -1\r
+ddcom226 compare  -80E-1  7      -> -1\r
+ddcom227 compare  -8.0    7E+0   -> -1\r
+ddcom228 compare  -8.0    70E-1  -> -1\r
+ddcom229 compare  -8      0.7E+1 -> -1\r
+ddcom230 compare  -8      70E-1  -> -1\r
+\r
+ddcom240 compare  -8.0    9.0    -> -1\r
+ddcom241 compare  -8.0    9      -> -1\r
+ddcom242 compare  -8      9.0    -> -1\r
+ddcom243 compare  -8E+0   9.0    -> -1\r
+ddcom244 compare  -80E-1  9.0    -> -1\r
+ddcom245 compare  -0.8E+1 9      -> -1\r
+ddcom246 compare  -80E-1  9      -> -1\r
+ddcom247 compare  -8.0    9E+0   -> -1\r
+ddcom248 compare  -8.0    90E-1  -> -1\r
+ddcom249 compare  -8      0.9E+1 -> -1\r
+ddcom250 compare  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+ddcom300 compare   7.0    -7.0    -> 1\r
+ddcom301 compare   7.0    -7      -> 1\r
+ddcom302 compare   7      -7.0    -> 1\r
+ddcom303 compare   7E+0   -7.0    -> 1\r
+ddcom304 compare   70E-1  -7.0    -> 1\r
+ddcom305 compare   .7E+1  -7      -> 1\r
+ddcom306 compare   70E-1  -7      -> 1\r
+ddcom307 compare   7.0    -7E+0   -> 1\r
+ddcom308 compare   7.0    -70E-1  -> 1\r
+ddcom309 compare   7      -.7E+1  -> 1\r
+ddcom310 compare   7      -70E-1  -> 1\r
+\r
+ddcom320 compare   8.0    -7.0    -> 1\r
+ddcom321 compare   8.0    -7      -> 1\r
+ddcom322 compare   8      -7.0    -> 1\r
+ddcom323 compare   8E+0   -7.0    -> 1\r
+ddcom324 compare   80E-1  -7.0    -> 1\r
+ddcom325 compare   .8E+1  -7      -> 1\r
+ddcom326 compare   80E-1  -7      -> 1\r
+ddcom327 compare   8.0    -7E+0   -> 1\r
+ddcom328 compare   8.0    -70E-1  -> 1\r
+ddcom329 compare   8      -.7E+1  -> 1\r
+ddcom330 compare   8      -70E-1  -> 1\r
+\r
+ddcom340 compare   8.0    -9.0    -> 1\r
+ddcom341 compare   8.0    -9      -> 1\r
+ddcom342 compare   8      -9.0    -> 1\r
+ddcom343 compare   8E+0   -9.0    -> 1\r
+ddcom344 compare   80E-1  -9.0    -> 1\r
+ddcom345 compare   .8E+1  -9      -> 1\r
+ddcom346 compare   80E-1  -9      -> 1\r
+ddcom347 compare   8.0    -9E+0   -> 1\r
+ddcom348 compare   8.0    -90E-1  -> 1\r
+ddcom349 compare   8      -.9E+1  -> 1\r
+ddcom350 compare   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+ddcom400 compare   -7.0    -7.0    -> 0\r
+ddcom401 compare   -7.0    -7      -> 0\r
+ddcom402 compare   -7      -7.0    -> 0\r
+ddcom403 compare   -7E+0   -7.0    -> 0\r
+ddcom404 compare   -70E-1  -7.0    -> 0\r
+ddcom405 compare   -.7E+1  -7      -> 0\r
+ddcom406 compare   -70E-1  -7      -> 0\r
+ddcom407 compare   -7.0    -7E+0   -> 0\r
+ddcom408 compare   -7.0    -70E-1  -> 0\r
+ddcom409 compare   -7      -.7E+1  -> 0\r
+ddcom410 compare   -7      -70E-1  -> 0\r
+\r
+ddcom420 compare   -8.0    -7.0    -> -1\r
+ddcom421 compare   -8.0    -7      -> -1\r
+ddcom422 compare   -8      -7.0    -> -1\r
+ddcom423 compare   -8E+0   -7.0    -> -1\r
+ddcom424 compare   -80E-1  -7.0    -> -1\r
+ddcom425 compare   -.8E+1  -7      -> -1\r
+ddcom426 compare   -80E-1  -7      -> -1\r
+ddcom427 compare   -8.0    -7E+0   -> -1\r
+ddcom428 compare   -8.0    -70E-1  -> -1\r
+ddcom429 compare   -8      -.7E+1  -> -1\r
+ddcom430 compare   -8      -70E-1  -> -1\r
+\r
+ddcom440 compare   -8.0    -9.0    -> 1\r
+ddcom441 compare   -8.0    -9      -> 1\r
+ddcom442 compare   -8      -9.0    -> 1\r
+ddcom443 compare   -8E+0   -9.0    -> 1\r
+ddcom444 compare   -80E-1  -9.0    -> 1\r
+ddcom445 compare   -.8E+1  -9      -> 1\r
+ddcom446 compare   -80E-1  -9      -> 1\r
+ddcom447 compare   -8.0    -9E+0   -> 1\r
+ddcom448 compare   -8.0    -90E-1  -> 1\r
+ddcom449 compare   -8      -.9E+1  -> 1\r
+ddcom450 compare   -8      -90E-1  -> 1\r
+\r
+-- misalignment traps for little-endian\r
+ddcom451 compare      1.0       0.1  -> 1\r
+ddcom452 compare      0.1       1.0  -> -1\r
+ddcom453 compare     10.0       0.1  -> 1\r
+ddcom454 compare      0.1      10.0  -> -1\r
+ddcom455 compare      100       1.0  -> 1\r
+ddcom456 compare      1.0       100  -> -1\r
+ddcom457 compare     1000      10.0  -> 1\r
+ddcom458 compare     10.0      1000  -> -1\r
+ddcom459 compare    10000     100.0  -> 1\r
+ddcom460 compare    100.0     10000  -> -1\r
+ddcom461 compare   100000    1000.0  -> 1\r
+ddcom462 compare   1000.0    100000  -> -1\r
+ddcom463 compare  1000000   10000.0  -> 1\r
+ddcom464 compare  10000.0   1000000  -> -1\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0\r
+ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0\r
+ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0\r
+ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0\r
+ddcom477 compare 123.456000000E-89 123.456E-89 -> 0\r
+ddcom478 compare 123.45600000E+89 123.456E+89 -> 0\r
+ddcom479 compare 123.4560000E-89 123.456E-89 -> 0\r
+ddcom480 compare 123.456000E+89 123.456E+89 -> 0\r
+ddcom481 compare 123.45600E-89 123.456E-89 -> 0\r
+ddcom482 compare 123.4560E+89 123.456E+89 -> 0\r
+ddcom483 compare 123.456E-89 123.456E-89 -> 0\r
+ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0\r
+ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0\r
+ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0\r
+ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0\r
+ddcom491 compare 123.456E+89 123.456000000E+89 -> 0\r
+ddcom492 compare 123.456E-89 123.45600000E-89 -> 0\r
+ddcom493 compare 123.456E+89 123.4560000E+89 -> 0\r
+ddcom494 compare 123.456E-89 123.456000E-89 -> 0\r
+ddcom495 compare 123.456E+89 123.45600E+89 -> 0\r
+ddcom496 compare 123.456E-89 123.4560E-89 -> 0\r
+ddcom497 compare 123.456E+89 123.456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+ddcom500 compare    1     1E-15    -> 1\r
+ddcom501 compare    1     1E-14    -> 1\r
+ddcom502 compare    1     1E-13    -> 1\r
+ddcom503 compare    1     1E-12    -> 1\r
+ddcom504 compare    1     1E-11    -> 1\r
+ddcom505 compare    1     1E-10    -> 1\r
+ddcom506 compare    1     1E-9     -> 1\r
+ddcom507 compare    1     1E-8     -> 1\r
+ddcom508 compare    1     1E-7     -> 1\r
+ddcom509 compare    1     1E-6     -> 1\r
+ddcom510 compare    1     1E-5     -> 1\r
+ddcom511 compare    1     1E-4     -> 1\r
+ddcom512 compare    1     1E-3     -> 1\r
+ddcom513 compare    1     1E-2     -> 1\r
+ddcom514 compare    1     1E-1     -> 1\r
+ddcom515 compare    1     1E-0     -> 0\r
+ddcom516 compare    1     1E+1     -> -1\r
+ddcom517 compare    1     1E+2     -> -1\r
+ddcom518 compare    1     1E+3     -> -1\r
+ddcom519 compare    1     1E+4     -> -1\r
+ddcom521 compare    1     1E+5     -> -1\r
+ddcom522 compare    1     1E+6     -> -1\r
+ddcom523 compare    1     1E+7     -> -1\r
+ddcom524 compare    1     1E+8     -> -1\r
+ddcom525 compare    1     1E+9     -> -1\r
+ddcom526 compare    1     1E+10    -> -1\r
+ddcom527 compare    1     1E+11    -> -1\r
+ddcom528 compare    1     1E+12    -> -1\r
+ddcom529 compare    1     1E+13    -> -1\r
+ddcom530 compare    1     1E+14    -> -1\r
+ddcom531 compare    1     1E+15    -> -1\r
+-- LR swap\r
+ddcom540 compare    1E-15  1       -> -1\r
+ddcom541 compare    1E-14  1       -> -1\r
+ddcom542 compare    1E-13  1       -> -1\r
+ddcom543 compare    1E-12  1       -> -1\r
+ddcom544 compare    1E-11  1       -> -1\r
+ddcom545 compare    1E-10  1       -> -1\r
+ddcom546 compare    1E-9   1       -> -1\r
+ddcom547 compare    1E-8   1       -> -1\r
+ddcom548 compare    1E-7   1       -> -1\r
+ddcom549 compare    1E-6   1       -> -1\r
+ddcom550 compare    1E-5   1       -> -1\r
+ddcom551 compare    1E-4   1       -> -1\r
+ddcom552 compare    1E-3   1       -> -1\r
+ddcom553 compare    1E-2   1       -> -1\r
+ddcom554 compare    1E-1   1       -> -1\r
+ddcom555 compare    1E-0   1       ->  0\r
+ddcom556 compare    1E+1   1       ->  1\r
+ddcom557 compare    1E+2   1       ->  1\r
+ddcom558 compare    1E+3   1       ->  1\r
+ddcom559 compare    1E+4   1       ->  1\r
+ddcom561 compare    1E+5   1       ->  1\r
+ddcom562 compare    1E+6   1       ->  1\r
+ddcom563 compare    1E+7   1       ->  1\r
+ddcom564 compare    1E+8   1       ->  1\r
+ddcom565 compare    1E+9   1       ->  1\r
+ddcom566 compare    1E+10  1       ->  1\r
+ddcom567 compare    1E+11  1       ->  1\r
+ddcom568 compare    1E+12  1       ->  1\r
+ddcom569 compare    1E+13  1       ->  1\r
+ddcom570 compare    1E+14  1       ->  1\r
+ddcom571 compare    1E+15  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+ddcom580 compare  0.000000987654321     1E-15    -> 1\r
+ddcom581 compare  0.000000987654321     1E-14    -> 1\r
+ddcom582 compare  0.000000987654321     1E-13    -> 1\r
+ddcom583 compare  0.000000987654321     1E-12    -> 1\r
+ddcom584 compare  0.000000987654321     1E-11    -> 1\r
+ddcom585 compare  0.000000987654321     1E-10    -> 1\r
+ddcom586 compare  0.000000987654321     1E-9     -> 1\r
+ddcom587 compare  0.000000987654321     1E-8     -> 1\r
+ddcom588 compare  0.000000987654321     1E-7     -> 1\r
+ddcom589 compare  0.000000987654321     1E-6     -> -1\r
+ddcom590 compare  0.000000987654321     1E-5     -> -1\r
+ddcom591 compare  0.000000987654321     1E-4     -> -1\r
+ddcom592 compare  0.000000987654321     1E-3     -> -1\r
+ddcom593 compare  0.000000987654321     1E-2     -> -1\r
+ddcom594 compare  0.000000987654321     1E-1     -> -1\r
+ddcom595 compare  0.000000987654321     1E-0     -> -1\r
+ddcom596 compare  0.000000987654321     1E+1     -> -1\r
+ddcom597 compare  0.000000987654321     1E+2     -> -1\r
+ddcom598 compare  0.000000987654321     1E+3     -> -1\r
+ddcom599 compare  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+ddcom600 compare   12            12.2345 -> -1\r
+ddcom601 compare   12.0          12.2345 -> -1\r
+ddcom602 compare   12.00         12.2345 -> -1\r
+ddcom603 compare   12.000        12.2345 -> -1\r
+ddcom604 compare   12.0000       12.2345 -> -1\r
+ddcom605 compare   12.00000      12.2345 -> -1\r
+ddcom606 compare   12.000000     12.2345 -> -1\r
+ddcom607 compare   12.0000000    12.2345 -> -1\r
+ddcom608 compare   12.00000000   12.2345 -> -1\r
+ddcom609 compare   12.000000000  12.2345 -> -1\r
+ddcom610 compare   12.1234 12            ->  1\r
+ddcom611 compare   12.1234 12.0          ->  1\r
+ddcom612 compare   12.1234 12.00         ->  1\r
+ddcom613 compare   12.1234 12.000        ->  1\r
+ddcom614 compare   12.1234 12.0000       ->  1\r
+ddcom615 compare   12.1234 12.00000      ->  1\r
+ddcom616 compare   12.1234 12.000000     ->  1\r
+ddcom617 compare   12.1234 12.0000000    ->  1\r
+ddcom618 compare   12.1234 12.00000000   ->  1\r
+ddcom619 compare   12.1234 12.000000000  ->  1\r
+ddcom620 compare  -12           -12.2345 ->  1\r
+ddcom621 compare  -12.0         -12.2345 ->  1\r
+ddcom622 compare  -12.00        -12.2345 ->  1\r
+ddcom623 compare  -12.000       -12.2345 ->  1\r
+ddcom624 compare  -12.0000      -12.2345 ->  1\r
+ddcom625 compare  -12.00000     -12.2345 ->  1\r
+ddcom626 compare  -12.000000    -12.2345 ->  1\r
+ddcom627 compare  -12.0000000   -12.2345 ->  1\r
+ddcom628 compare  -12.00000000  -12.2345 ->  1\r
+ddcom629 compare  -12.000000000 -12.2345 ->  1\r
+ddcom630 compare  -12.1234 -12           -> -1\r
+ddcom631 compare  -12.1234 -12.0         -> -1\r
+ddcom632 compare  -12.1234 -12.00        -> -1\r
+ddcom633 compare  -12.1234 -12.000       -> -1\r
+ddcom634 compare  -12.1234 -12.0000      -> -1\r
+ddcom635 compare  -12.1234 -12.00000     -> -1\r
+ddcom636 compare  -12.1234 -12.000000    -> -1\r
+ddcom637 compare  -12.1234 -12.0000000   -> -1\r
+ddcom638 compare  -12.1234 -12.00000000  -> -1\r
+ddcom639 compare  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+ddcom640 compare   0     0   -> 0\r
+ddcom641 compare   0    -0   -> 0\r
+ddcom642 compare   0    -0.0 -> 0\r
+ddcom643 compare   0     0.0 -> 0\r
+ddcom644 compare  -0     0   -> 0\r
+ddcom645 compare  -0    -0   -> 0\r
+ddcom646 compare  -0    -0.0 -> 0\r
+ddcom647 compare  -0     0.0 -> 0\r
+ddcom648 compare   0.0   0   -> 0\r
+ddcom649 compare   0.0  -0   -> 0\r
+ddcom650 compare   0.0  -0.0 -> 0\r
+ddcom651 compare   0.0   0.0 -> 0\r
+ddcom652 compare  -0.0   0   -> 0\r
+ddcom653 compare  -0.0  -0   -> 0\r
+ddcom654 compare  -0.0  -0.0 -> 0\r
+ddcom655 compare  -0.0   0.0 -> 0\r
+\r
+ddcom656 compare  -0E1   0.0 -> 0\r
+ddcom657 compare  -0E2   0.0 -> 0\r
+ddcom658 compare   0E1   0.0 -> 0\r
+ddcom659 compare   0E2   0.0 -> 0\r
+ddcom660 compare  -0E1   0   -> 0\r
+ddcom661 compare  -0E2   0   -> 0\r
+ddcom662 compare   0E1   0   -> 0\r
+ddcom663 compare   0E2   0   -> 0\r
+ddcom664 compare  -0E1  -0E1 -> 0\r
+ddcom665 compare  -0E2  -0E1 -> 0\r
+ddcom666 compare   0E1  -0E1 -> 0\r
+ddcom667 compare   0E2  -0E1 -> 0\r
+ddcom668 compare  -0E1  -0E2 -> 0\r
+ddcom669 compare  -0E2  -0E2 -> 0\r
+ddcom670 compare   0E1  -0E2 -> 0\r
+ddcom671 compare   0E2  -0E2 -> 0\r
+ddcom672 compare  -0E1   0E1 -> 0\r
+ddcom673 compare  -0E2   0E1 -> 0\r
+ddcom674 compare   0E1   0E1 -> 0\r
+ddcom675 compare   0E2   0E1 -> 0\r
+ddcom676 compare  -0E1   0E2 -> 0\r
+ddcom677 compare  -0E2   0E2 -> 0\r
+ddcom678 compare   0E1   0E2 -> 0\r
+ddcom679 compare   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+ddcom680 compare   12    12           -> 0\r
+ddcom681 compare   12    12.0         -> 0\r
+ddcom682 compare   12    12.00        -> 0\r
+ddcom683 compare   12    12.000       -> 0\r
+ddcom684 compare   12    12.0000      -> 0\r
+ddcom685 compare   12    12.00000     -> 0\r
+ddcom686 compare   12    12.000000    -> 0\r
+ddcom687 compare   12    12.0000000   -> 0\r
+ddcom688 compare   12    12.00000000  -> 0\r
+ddcom689 compare   12    12.000000000 -> 0\r
+ddcom690 compare   12              12 -> 0\r
+ddcom691 compare   12.0            12 -> 0\r
+ddcom692 compare   12.00           12 -> 0\r
+ddcom693 compare   12.000          12 -> 0\r
+ddcom694 compare   12.0000         12 -> 0\r
+ddcom695 compare   12.00000        12 -> 0\r
+ddcom696 compare   12.000000       12 -> 0\r
+ddcom697 compare   12.0000000      12 -> 0\r
+ddcom698 compare   12.00000000     12 -> 0\r
+ddcom699 compare   12.000000000    12 -> 0\r
+\r
+-- first, second, & last digit\r
+ddcom700 compare   1234567890123456 1234567890123455 -> 1\r
+ddcom701 compare   1234567890123456 1234567890123456 -> 0\r
+ddcom702 compare   1234567890123456 1234567890123457 -> -1\r
+ddcom703 compare   1234567890123456 0234567890123456 -> 1\r
+ddcom704 compare   1234567890123456 1234567890123456 -> 0\r
+ddcom705 compare   1234567890123456 2234567890123456 -> -1\r
+ddcom706 compare   1134567890123456 1034567890123456 -> 1\r
+ddcom707 compare   1134567890123456 1134567890123456 -> 0\r
+ddcom708 compare   1134567890123456 1234567890123456 -> -1\r
+\r
+-- miscellaneous\r
+ddcom721 compare 12345678000 1 -> 1\r
+ddcom722 compare 1 12345678000 -> -1\r
+ddcom723 compare 1234567800  1 -> 1\r
+ddcom724 compare 1 1234567800  -> -1\r
+ddcom725 compare 1234567890  1 -> 1\r
+ddcom726 compare 1 1234567890  -> -1\r
+ddcom727 compare 1234567891  1 -> 1\r
+ddcom728 compare 1 1234567891  -> -1\r
+ddcom729 compare 12345678901 1 -> 1\r
+ddcom730 compare 1 12345678901 -> -1\r
+ddcom731 compare 1234567896  1 -> 1\r
+ddcom732 compare 1 1234567896  -> -1\r
+\r
+-- residue cases at lower precision\r
+ddcom740 compare  1  0.9999999  -> 1\r
+ddcom741 compare  1  0.999999   -> 1\r
+ddcom742 compare  1  0.99999    -> 1\r
+ddcom743 compare  1  1.0000     -> 0\r
+ddcom744 compare  1  1.00001    -> -1\r
+ddcom745 compare  1  1.000001   -> -1\r
+ddcom746 compare  1  1.0000001  -> -1\r
+ddcom750 compare  0.9999999  1  -> -1\r
+ddcom751 compare  0.999999   1  -> -1\r
+ddcom752 compare  0.99999    1  -> -1\r
+ddcom753 compare  1.0000     1  -> 0\r
+ddcom754 compare  1.00001    1  -> 1\r
+ddcom755 compare  1.000001   1  -> 1\r
+ddcom756 compare  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+ddcom780 compare  Inf  -Inf   ->  1\r
+ddcom781 compare  Inf  -1000  ->  1\r
+ddcom782 compare  Inf  -1     ->  1\r
+ddcom783 compare  Inf  -0     ->  1\r
+ddcom784 compare  Inf   0     ->  1\r
+ddcom785 compare  Inf   1     ->  1\r
+ddcom786 compare  Inf   1000  ->  1\r
+ddcom787 compare  Inf   Inf   ->  0\r
+ddcom788 compare -1000  Inf   -> -1\r
+ddcom789 compare -Inf   Inf   -> -1\r
+ddcom790 compare -1     Inf   -> -1\r
+ddcom791 compare -0     Inf   -> -1\r
+ddcom792 compare  0     Inf   -> -1\r
+ddcom793 compare  1     Inf   -> -1\r
+ddcom794 compare  1000  Inf   -> -1\r
+ddcom795 compare  Inf   Inf   ->  0\r
+\r
+ddcom800 compare -Inf  -Inf   ->  0\r
+ddcom801 compare -Inf  -1000  -> -1\r
+ddcom802 compare -Inf  -1     -> -1\r
+ddcom803 compare -Inf  -0     -> -1\r
+ddcom804 compare -Inf   0     -> -1\r
+ddcom805 compare -Inf   1     -> -1\r
+ddcom806 compare -Inf   1000  -> -1\r
+ddcom807 compare -Inf   Inf   -> -1\r
+ddcom808 compare -Inf  -Inf   ->  0\r
+ddcom809 compare -1000 -Inf   ->  1\r
+ddcom810 compare -1    -Inf   ->  1\r
+ddcom811 compare -0    -Inf   ->  1\r
+ddcom812 compare  0    -Inf   ->  1\r
+ddcom813 compare  1    -Inf   ->  1\r
+ddcom814 compare  1000 -Inf   ->  1\r
+ddcom815 compare  Inf  -Inf   ->  1\r
+\r
+ddcom821 compare  NaN -Inf    ->  NaN\r
+ddcom822 compare  NaN -1000   ->  NaN\r
+ddcom823 compare  NaN -1      ->  NaN\r
+ddcom824 compare  NaN -0      ->  NaN\r
+ddcom825 compare  NaN  0      ->  NaN\r
+ddcom826 compare  NaN  1      ->  NaN\r
+ddcom827 compare  NaN  1000   ->  NaN\r
+ddcom828 compare  NaN  Inf    ->  NaN\r
+ddcom829 compare  NaN  NaN    ->  NaN\r
+ddcom830 compare -Inf  NaN    ->  NaN\r
+ddcom831 compare -1000 NaN    ->  NaN\r
+ddcom832 compare -1    NaN    ->  NaN\r
+ddcom833 compare -0    NaN    ->  NaN\r
+ddcom834 compare  0    NaN    ->  NaN\r
+ddcom835 compare  1    NaN    ->  NaN\r
+ddcom836 compare  1000 NaN    ->  NaN\r
+ddcom837 compare  Inf  NaN    ->  NaN\r
+ddcom838 compare -NaN -NaN    -> -NaN\r
+ddcom839 compare +NaN -NaN    ->  NaN\r
+ddcom840 compare -NaN +NaN    -> -NaN\r
+\r
+ddcom841 compare  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddcom842 compare  sNaN -1000  ->  NaN  Invalid_operation\r
+ddcom843 compare  sNaN -1     ->  NaN  Invalid_operation\r
+ddcom844 compare  sNaN -0     ->  NaN  Invalid_operation\r
+ddcom845 compare  sNaN  0     ->  NaN  Invalid_operation\r
+ddcom846 compare  sNaN  1     ->  NaN  Invalid_operation\r
+ddcom847 compare  sNaN  1000  ->  NaN  Invalid_operation\r
+ddcom848 compare  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddcom849 compare  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddcom850 compare  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddcom851 compare -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddcom852 compare -1000 sNaN   ->  NaN  Invalid_operation\r
+ddcom853 compare -1    sNaN   ->  NaN  Invalid_operation\r
+ddcom854 compare -0    sNaN   ->  NaN  Invalid_operation\r
+ddcom855 compare  0    sNaN   ->  NaN  Invalid_operation\r
+ddcom856 compare  1    sNaN   ->  NaN  Invalid_operation\r
+ddcom857 compare  1000 sNaN   ->  NaN  Invalid_operation\r
+ddcom858 compare  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddcom859 compare  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddcom860 compare  NaN9 -Inf   ->  NaN9\r
+ddcom861 compare  NaN8  999   ->  NaN8\r
+ddcom862 compare  NaN77 Inf   ->  NaN77\r
+ddcom863 compare -NaN67 NaN5  -> -NaN67\r
+ddcom864 compare -Inf  -NaN4  -> -NaN4\r
+ddcom865 compare -999  -NaN33 -> -NaN33\r
+ddcom866 compare  Inf   NaN2  ->  NaN2\r
+ddcom867 compare -NaN41 -NaN42 -> -NaN41\r
+ddcom868 compare +NaN41 -NaN42 ->  NaN41\r
+ddcom869 compare -NaN41 +NaN42 -> -NaN41\r
+ddcom870 compare +NaN41 +NaN42 ->  NaN41\r
+\r
+ddcom871 compare -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+ddcom872 compare  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddcom873 compare  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+ddcom874 compare  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+ddcom875 compare  NaN85  sNaN83  ->  NaN83 Invalid_operation\r
+ddcom876 compare -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddcom877 compare  088    sNaN81  ->  NaN81 Invalid_operation\r
+ddcom878 compare  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+ddcom879 compare  NaN   -sNaN89  -> -NaN89 Invalid_operation\r
+\r
+-- wide range\r
+ddcom880 compare +1.23456789012345E-0 9E+384 -> -1\r
+ddcom881 compare 9E+384 +1.23456789012345E-0 ->  1\r
+ddcom882 compare +0.100 9E-383               ->  1\r
+ddcom883 compare 9E-383 +0.100               -> -1\r
+ddcom885 compare -1.23456789012345E-0 9E+384 -> -1\r
+ddcom886 compare 9E+384 -1.23456789012345E-0 ->  1\r
+ddcom887 compare -0.100 9E-383               -> -1\r
+ddcom888 compare 9E-383 -0.100               ->  1\r
+\r
+-- spread zeros\r
+ddcom900 compare   0E-383  0       ->  0\r
+ddcom901 compare   0E-383 -0       ->  0\r
+ddcom902 compare  -0E-383  0       ->  0\r
+ddcom903 compare  -0E-383 -0       ->  0\r
+ddcom904 compare   0E-383  0E+384  ->  0\r
+ddcom905 compare   0E-383 -0E+384  ->  0\r
+ddcom906 compare  -0E-383  0E+384  ->  0\r
+ddcom907 compare  -0E-383 -0E+384  ->  0\r
+ddcom908 compare   0       0E+384  ->  0\r
+ddcom909 compare   0      -0E+384  ->  0\r
+ddcom910 compare  -0       0E+384  ->  0\r
+ddcom911 compare  -0      -0E+384  ->  0\r
+ddcom930 compare   0E+384  0       ->  0\r
+ddcom931 compare   0E+384 -0       ->  0\r
+ddcom932 compare  -0E+384  0       ->  0\r
+ddcom933 compare  -0E+384 -0       ->  0\r
+ddcom934 compare   0E+384  0E-383  ->  0\r
+ddcom935 compare   0E+384 -0E-383  ->  0\r
+ddcom936 compare  -0E+384  0E-383  ->  0\r
+ddcom937 compare  -0E+384 -0E-383  ->  0\r
+ddcom938 compare   0       0E-383  ->  0\r
+ddcom939 compare   0      -0E-383  ->  0\r
+ddcom940 compare  -0       0E-383  ->  0\r
+ddcom941 compare  -0      -0E-383  ->  0\r
+\r
+-- signs\r
+ddcom961 compare  1e+77  1e+11 ->  1\r
+ddcom962 compare  1e+77 -1e+11 ->  1\r
+ddcom963 compare -1e+77  1e+11 -> -1\r
+ddcom964 compare -1e+77 -1e+11 -> -1\r
+ddcom965 compare  1e-77  1e-11 -> -1\r
+ddcom966 compare  1e-77 -1e-11 ->  1\r
+ddcom967 compare -1e-77  1e-11 -> -1\r
+ddcom968 compare -1e-77 -1e-11 ->  1\r
+\r
+-- full alignment range, both ways\r
+ddcomp1001 compare 1 1.000000000000000  -> 0\r
+ddcomp1002 compare 1 1.00000000000000   -> 0\r
+ddcomp1003 compare 1 1.0000000000000    -> 0\r
+ddcomp1004 compare 1 1.000000000000     -> 0\r
+ddcomp1005 compare 1 1.00000000000      -> 0\r
+ddcomp1006 compare 1 1.0000000000       -> 0\r
+ddcomp1007 compare 1 1.000000000        -> 0\r
+ddcomp1008 compare 1 1.00000000         -> 0\r
+ddcomp1009 compare 1 1.0000000          -> 0\r
+ddcomp1010 compare 1 1.000000           -> 0\r
+ddcomp1011 compare 1 1.00000            -> 0\r
+ddcomp1012 compare 1 1.0000             -> 0\r
+ddcomp1013 compare 1 1.000              -> 0\r
+ddcomp1014 compare 1 1.00               -> 0\r
+ddcomp1015 compare 1 1.0                -> 0\r
+ddcomp1021 compare 1.000000000000000  1 -> 0\r
+ddcomp1022 compare 1.00000000000000   1 -> 0\r
+ddcomp1023 compare 1.0000000000000    1 -> 0\r
+ddcomp1024 compare 1.000000000000     1 -> 0\r
+ddcomp1025 compare 1.00000000000      1 -> 0\r
+ddcomp1026 compare 1.0000000000       1 -> 0\r
+ddcomp1027 compare 1.000000000        1 -> 0\r
+ddcomp1028 compare 1.00000000         1 -> 0\r
+ddcomp1029 compare 1.0000000          1 -> 0\r
+ddcomp1030 compare 1.000000           1 -> 0\r
+ddcomp1031 compare 1.00000            1 -> 0\r
+ddcomp1032 compare 1.0000             1 -> 0\r
+ddcomp1033 compare 1.000              1 -> 0\r
+ddcomp1034 compare 1.00               1 -> 0\r
+ddcomp1035 compare 1.0                1 -> 0\r
+\r
+-- check MSD always detected non-zero\r
+ddcomp1040 compare 0 0.000000000000000  -> 0\r
+ddcomp1041 compare 0 1.000000000000000  -> -1\r
+ddcomp1042 compare 0 2.000000000000000  -> -1\r
+ddcomp1043 compare 0 3.000000000000000  -> -1\r
+ddcomp1044 compare 0 4.000000000000000  -> -1\r
+ddcomp1045 compare 0 5.000000000000000  -> -1\r
+ddcomp1046 compare 0 6.000000000000000  -> -1\r
+ddcomp1047 compare 0 7.000000000000000  -> -1\r
+ddcomp1048 compare 0 8.000000000000000  -> -1\r
+ddcomp1049 compare 0 9.000000000000000  -> -1\r
+ddcomp1050 compare 0.000000000000000  0 -> 0\r
+ddcomp1051 compare 1.000000000000000  0 -> 1\r
+ddcomp1052 compare 2.000000000000000  0 -> 1\r
+ddcomp1053 compare 3.000000000000000  0 -> 1\r
+ddcomp1054 compare 4.000000000000000  0 -> 1\r
+ddcomp1055 compare 5.000000000000000  0 -> 1\r
+ddcomp1056 compare 6.000000000000000  0 -> 1\r
+ddcomp1057 compare 7.000000000000000  0 -> 1\r
+ddcomp1058 compare 8.000000000000000  0 -> 1\r
+ddcomp1059 compare 9.000000000000000  0 -> 1\r
+\r
+-- Null tests\r
+ddcom9990 compare 10  # -> NaN Invalid_operation\r
+ddcom9991 compare  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddCompareSig.decTest b/Lib/test/decimaltestdata/ddCompareSig.decTest
new file mode 100644 (file)
index 0000000..388a656
--- /dev/null
@@ -0,0 +1,647 @@
+------------------------------------------------------------------------\r
+-- ddCompareSig.decTest -- decDouble comparison; all NaNs signal      --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddcms001 comparesig  -2  -2  -> 0\r
+ddcms002 comparesig  -2  -1  -> -1\r
+ddcms003 comparesig  -2   0  -> -1\r
+ddcms004 comparesig  -2   1  -> -1\r
+ddcms005 comparesig  -2   2  -> -1\r
+ddcms006 comparesig  -1  -2  -> 1\r
+ddcms007 comparesig  -1  -1  -> 0\r
+ddcms008 comparesig  -1   0  -> -1\r
+ddcms009 comparesig  -1   1  -> -1\r
+ddcms010 comparesig  -1   2  -> -1\r
+ddcms011 comparesig   0  -2  -> 1\r
+ddcms012 comparesig   0  -1  -> 1\r
+ddcms013 comparesig   0   0  -> 0\r
+ddcms014 comparesig   0   1  -> -1\r
+ddcms015 comparesig   0   2  -> -1\r
+ddcms016 comparesig   1  -2  -> 1\r
+ddcms017 comparesig   1  -1  -> 1\r
+ddcms018 comparesig   1   0  -> 1\r
+ddcms019 comparesig   1   1  -> 0\r
+ddcms020 comparesig   1   2  -> -1\r
+ddcms021 comparesig   2  -2  -> 1\r
+ddcms022 comparesig   2  -1  -> 1\r
+ddcms023 comparesig   2   0  -> 1\r
+ddcms025 comparesig   2   1  -> 1\r
+ddcms026 comparesig   2   2  -> 0\r
+\r
+ddcms031 comparesig  -20  -20  -> 0\r
+ddcms032 comparesig  -20  -10  -> -1\r
+ddcms033 comparesig  -20   00  -> -1\r
+ddcms034 comparesig  -20   10  -> -1\r
+ddcms035 comparesig  -20   20  -> -1\r
+ddcms036 comparesig  -10  -20  -> 1\r
+ddcms037 comparesig  -10  -10  -> 0\r
+ddcms038 comparesig  -10   00  -> -1\r
+ddcms039 comparesig  -10   10  -> -1\r
+ddcms040 comparesig  -10   20  -> -1\r
+ddcms041 comparesig   00  -20  -> 1\r
+ddcms042 comparesig   00  -10  -> 1\r
+ddcms043 comparesig   00   00  -> 0\r
+ddcms044 comparesig   00   10  -> -1\r
+ddcms045 comparesig   00   20  -> -1\r
+ddcms046 comparesig   10  -20  -> 1\r
+ddcms047 comparesig   10  -10  -> 1\r
+ddcms048 comparesig   10   00  -> 1\r
+ddcms049 comparesig   10   10  -> 0\r
+ddcms050 comparesig   10   20  -> -1\r
+ddcms051 comparesig   20  -20  -> 1\r
+ddcms052 comparesig   20  -10  -> 1\r
+ddcms053 comparesig   20   00  -> 1\r
+ddcms055 comparesig   20   10  -> 1\r
+ddcms056 comparesig   20   20  -> 0\r
+\r
+ddcms061 comparesig  -2.0  -2.0  -> 0\r
+ddcms062 comparesig  -2.0  -1.0  -> -1\r
+ddcms063 comparesig  -2.0   0.0  -> -1\r
+ddcms064 comparesig  -2.0   1.0  -> -1\r
+ddcms065 comparesig  -2.0   2.0  -> -1\r
+ddcms066 comparesig  -1.0  -2.0  -> 1\r
+ddcms067 comparesig  -1.0  -1.0  -> 0\r
+ddcms068 comparesig  -1.0   0.0  -> -1\r
+ddcms069 comparesig  -1.0   1.0  -> -1\r
+ddcms070 comparesig  -1.0   2.0  -> -1\r
+ddcms071 comparesig   0.0  -2.0  -> 1\r
+ddcms072 comparesig   0.0  -1.0  -> 1\r
+ddcms073 comparesig   0.0   0.0  -> 0\r
+ddcms074 comparesig   0.0   1.0  -> -1\r
+ddcms075 comparesig   0.0   2.0  -> -1\r
+ddcms076 comparesig   1.0  -2.0  -> 1\r
+ddcms077 comparesig   1.0  -1.0  -> 1\r
+ddcms078 comparesig   1.0   0.0  -> 1\r
+ddcms079 comparesig   1.0   1.0  -> 0\r
+ddcms080 comparesig   1.0   2.0  -> -1\r
+ddcms081 comparesig   2.0  -2.0  -> 1\r
+ddcms082 comparesig   2.0  -1.0  -> 1\r
+ddcms083 comparesig   2.0   0.0  -> 1\r
+ddcms085 comparesig   2.0   1.0  -> 1\r
+ddcms086 comparesig   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+ddcms090 comparesig  9.999999999999999E+384 9.999999999999999E+384  -> 0\r
+ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384  -> -1\r
+ddcms092 comparesig  9.999999999999999E+384 -9.999999999999999E+384 -> 1\r
+ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0\r
+\r
+-- some differing length/exponent cases\r
+ddcms100 comparesig   7.0    7.0    -> 0\r
+ddcms101 comparesig   7.0    7      -> 0\r
+ddcms102 comparesig   7      7.0    -> 0\r
+ddcms103 comparesig   7E+0   7.0    -> 0\r
+ddcms104 comparesig   70E-1  7.0    -> 0\r
+ddcms105 comparesig   0.7E+1 7      -> 0\r
+ddcms106 comparesig   70E-1  7      -> 0\r
+ddcms107 comparesig   7.0    7E+0   -> 0\r
+ddcms108 comparesig   7.0    70E-1  -> 0\r
+ddcms109 comparesig   7      0.7E+1 -> 0\r
+ddcms110 comparesig   7      70E-1  -> 0\r
+\r
+ddcms120 comparesig   8.0    7.0    -> 1\r
+ddcms121 comparesig   8.0    7      -> 1\r
+ddcms122 comparesig   8      7.0    -> 1\r
+ddcms123 comparesig   8E+0   7.0    -> 1\r
+ddcms124 comparesig   80E-1  7.0    -> 1\r
+ddcms125 comparesig   0.8E+1 7      -> 1\r
+ddcms126 comparesig   80E-1  7      -> 1\r
+ddcms127 comparesig   8.0    7E+0   -> 1\r
+ddcms128 comparesig   8.0    70E-1  -> 1\r
+ddcms129 comparesig   8      0.7E+1  -> 1\r
+ddcms130 comparesig   8      70E-1  -> 1\r
+\r
+ddcms140 comparesig   8.0    9.0    -> -1\r
+ddcms141 comparesig   8.0    9      -> -1\r
+ddcms142 comparesig   8      9.0    -> -1\r
+ddcms143 comparesig   8E+0   9.0    -> -1\r
+ddcms144 comparesig   80E-1  9.0    -> -1\r
+ddcms145 comparesig   0.8E+1 9      -> -1\r
+ddcms146 comparesig   80E-1  9      -> -1\r
+ddcms147 comparesig   8.0    9E+0   -> -1\r
+ddcms148 comparesig   8.0    90E-1  -> -1\r
+ddcms149 comparesig   8      0.9E+1 -> -1\r
+ddcms150 comparesig   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+ddcms200 comparesig  -7.0    7.0    -> -1\r
+ddcms201 comparesig  -7.0    7      -> -1\r
+ddcms202 comparesig  -7      7.0    -> -1\r
+ddcms203 comparesig  -7E+0   7.0    -> -1\r
+ddcms204 comparesig  -70E-1  7.0    -> -1\r
+ddcms205 comparesig  -0.7E+1 7      -> -1\r
+ddcms206 comparesig  -70E-1  7      -> -1\r
+ddcms207 comparesig  -7.0    7E+0   -> -1\r
+ddcms208 comparesig  -7.0    70E-1  -> -1\r
+ddcms209 comparesig  -7      0.7E+1 -> -1\r
+ddcms210 comparesig  -7      70E-1  -> -1\r
+\r
+ddcms220 comparesig  -8.0    7.0    -> -1\r
+ddcms221 comparesig  -8.0    7      -> -1\r
+ddcms222 comparesig  -8      7.0    -> -1\r
+ddcms223 comparesig  -8E+0   7.0    -> -1\r
+ddcms224 comparesig  -80E-1  7.0    -> -1\r
+ddcms225 comparesig  -0.8E+1 7      -> -1\r
+ddcms226 comparesig  -80E-1  7      -> -1\r
+ddcms227 comparesig  -8.0    7E+0   -> -1\r
+ddcms228 comparesig  -8.0    70E-1  -> -1\r
+ddcms229 comparesig  -8      0.7E+1 -> -1\r
+ddcms230 comparesig  -8      70E-1  -> -1\r
+\r
+ddcms240 comparesig  -8.0    9.0    -> -1\r
+ddcms241 comparesig  -8.0    9      -> -1\r
+ddcms242 comparesig  -8      9.0    -> -1\r
+ddcms243 comparesig  -8E+0   9.0    -> -1\r
+ddcms244 comparesig  -80E-1  9.0    -> -1\r
+ddcms245 comparesig  -0.8E+1 9      -> -1\r
+ddcms246 comparesig  -80E-1  9      -> -1\r
+ddcms247 comparesig  -8.0    9E+0   -> -1\r
+ddcms248 comparesig  -8.0    90E-1  -> -1\r
+ddcms249 comparesig  -8      0.9E+1 -> -1\r
+ddcms250 comparesig  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+ddcms300 comparesig   7.0    -7.0    -> 1\r
+ddcms301 comparesig   7.0    -7      -> 1\r
+ddcms302 comparesig   7      -7.0    -> 1\r
+ddcms303 comparesig   7E+0   -7.0    -> 1\r
+ddcms304 comparesig   70E-1  -7.0    -> 1\r
+ddcms305 comparesig   .7E+1  -7      -> 1\r
+ddcms306 comparesig   70E-1  -7      -> 1\r
+ddcms307 comparesig   7.0    -7E+0   -> 1\r
+ddcms308 comparesig   7.0    -70E-1  -> 1\r
+ddcms309 comparesig   7      -.7E+1  -> 1\r
+ddcms310 comparesig   7      -70E-1  -> 1\r
+\r
+ddcms320 comparesig   8.0    -7.0    -> 1\r
+ddcms321 comparesig   8.0    -7      -> 1\r
+ddcms322 comparesig   8      -7.0    -> 1\r
+ddcms323 comparesig   8E+0   -7.0    -> 1\r
+ddcms324 comparesig   80E-1  -7.0    -> 1\r
+ddcms325 comparesig   .8E+1  -7      -> 1\r
+ddcms326 comparesig   80E-1  -7      -> 1\r
+ddcms327 comparesig   8.0    -7E+0   -> 1\r
+ddcms328 comparesig   8.0    -70E-1  -> 1\r
+ddcms329 comparesig   8      -.7E+1  -> 1\r
+ddcms330 comparesig   8      -70E-1  -> 1\r
+\r
+ddcms340 comparesig   8.0    -9.0    -> 1\r
+ddcms341 comparesig   8.0    -9      -> 1\r
+ddcms342 comparesig   8      -9.0    -> 1\r
+ddcms343 comparesig   8E+0   -9.0    -> 1\r
+ddcms344 comparesig   80E-1  -9.0    -> 1\r
+ddcms345 comparesig   .8E+1  -9      -> 1\r
+ddcms346 comparesig   80E-1  -9      -> 1\r
+ddcms347 comparesig   8.0    -9E+0   -> 1\r
+ddcms348 comparesig   8.0    -90E-1  -> 1\r
+ddcms349 comparesig   8      -.9E+1  -> 1\r
+ddcms350 comparesig   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+ddcms400 comparesig   -7.0    -7.0    -> 0\r
+ddcms401 comparesig   -7.0    -7      -> 0\r
+ddcms402 comparesig   -7      -7.0    -> 0\r
+ddcms403 comparesig   -7E+0   -7.0    -> 0\r
+ddcms404 comparesig   -70E-1  -7.0    -> 0\r
+ddcms405 comparesig   -.7E+1  -7      -> 0\r
+ddcms406 comparesig   -70E-1  -7      -> 0\r
+ddcms407 comparesig   -7.0    -7E+0   -> 0\r
+ddcms408 comparesig   -7.0    -70E-1  -> 0\r
+ddcms409 comparesig   -7      -.7E+1  -> 0\r
+ddcms410 comparesig   -7      -70E-1  -> 0\r
+\r
+ddcms420 comparesig   -8.0    -7.0    -> -1\r
+ddcms421 comparesig   -8.0    -7      -> -1\r
+ddcms422 comparesig   -8      -7.0    -> -1\r
+ddcms423 comparesig   -8E+0   -7.0    -> -1\r
+ddcms424 comparesig   -80E-1  -7.0    -> -1\r
+ddcms425 comparesig   -.8E+1  -7      -> -1\r
+ddcms426 comparesig   -80E-1  -7      -> -1\r
+ddcms427 comparesig   -8.0    -7E+0   -> -1\r
+ddcms428 comparesig   -8.0    -70E-1  -> -1\r
+ddcms429 comparesig   -8      -.7E+1  -> -1\r
+ddcms430 comparesig   -8      -70E-1  -> -1\r
+\r
+ddcms440 comparesig   -8.0    -9.0    -> 1\r
+ddcms441 comparesig   -8.0    -9      -> 1\r
+ddcms442 comparesig   -8      -9.0    -> 1\r
+ddcms443 comparesig   -8E+0   -9.0    -> 1\r
+ddcms444 comparesig   -80E-1  -9.0    -> 1\r
+ddcms445 comparesig   -.8E+1  -9      -> 1\r
+ddcms446 comparesig   -80E-1  -9      -> 1\r
+ddcms447 comparesig   -8.0    -9E+0   -> 1\r
+ddcms448 comparesig   -8.0    -90E-1  -> 1\r
+ddcms449 comparesig   -8      -.9E+1  -> 1\r
+ddcms450 comparesig   -8      -90E-1  -> 1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0\r
+ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0\r
+ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0\r
+ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0\r
+ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0\r
+ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0\r
+ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0\r
+ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0\r
+ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0\r
+ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0\r
+ddcms483 comparesig 123.456E-89 123.456E-89 -> 0\r
+ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0\r
+ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0\r
+ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0\r
+ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0\r
+ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0\r
+ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0\r
+ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0\r
+ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0\r
+ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0\r
+ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0\r
+ddcms497 comparesig 123.456E+89 123.456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+ddcms500 comparesig    1     1E-15    -> 1\r
+ddcms501 comparesig    1     1E-14    -> 1\r
+ddcms502 comparesig    1     1E-13    -> 1\r
+ddcms503 comparesig    1     1E-12    -> 1\r
+ddcms504 comparesig    1     1E-11    -> 1\r
+ddcms505 comparesig    1     1E-10    -> 1\r
+ddcms506 comparesig    1     1E-9     -> 1\r
+ddcms507 comparesig    1     1E-8     -> 1\r
+ddcms508 comparesig    1     1E-7     -> 1\r
+ddcms509 comparesig    1     1E-6     -> 1\r
+ddcms510 comparesig    1     1E-5     -> 1\r
+ddcms511 comparesig    1     1E-4     -> 1\r
+ddcms512 comparesig    1     1E-3     -> 1\r
+ddcms513 comparesig    1     1E-2     -> 1\r
+ddcms514 comparesig    1     1E-1     -> 1\r
+ddcms515 comparesig    1     1E-0     -> 0\r
+ddcms516 comparesig    1     1E+1     -> -1\r
+ddcms517 comparesig    1     1E+2     -> -1\r
+ddcms518 comparesig    1     1E+3     -> -1\r
+ddcms519 comparesig    1     1E+4     -> -1\r
+ddcms521 comparesig    1     1E+5     -> -1\r
+ddcms522 comparesig    1     1E+6     -> -1\r
+ddcms523 comparesig    1     1E+7     -> -1\r
+ddcms524 comparesig    1     1E+8     -> -1\r
+ddcms525 comparesig    1     1E+9     -> -1\r
+ddcms526 comparesig    1     1E+10    -> -1\r
+ddcms527 comparesig    1     1E+11    -> -1\r
+ddcms528 comparesig    1     1E+12    -> -1\r
+ddcms529 comparesig    1     1E+13    -> -1\r
+ddcms530 comparesig    1     1E+14    -> -1\r
+ddcms531 comparesig    1     1E+15    -> -1\r
+-- LR swap\r
+ddcms540 comparesig    1E-15  1       -> -1\r
+ddcms541 comparesig    1E-14  1       -> -1\r
+ddcms542 comparesig    1E-13  1       -> -1\r
+ddcms543 comparesig    1E-12  1       -> -1\r
+ddcms544 comparesig    1E-11  1       -> -1\r
+ddcms545 comparesig    1E-10  1       -> -1\r
+ddcms546 comparesig    1E-9   1       -> -1\r
+ddcms547 comparesig    1E-8   1       -> -1\r
+ddcms548 comparesig    1E-7   1       -> -1\r
+ddcms549 comparesig    1E-6   1       -> -1\r
+ddcms550 comparesig    1E-5   1       -> -1\r
+ddcms551 comparesig    1E-4   1       -> -1\r
+ddcms552 comparesig    1E-3   1       -> -1\r
+ddcms553 comparesig    1E-2   1       -> -1\r
+ddcms554 comparesig    1E-1   1       -> -1\r
+ddcms555 comparesig    1E-0   1       ->  0\r
+ddcms556 comparesig    1E+1   1       ->  1\r
+ddcms557 comparesig    1E+2   1       ->  1\r
+ddcms558 comparesig    1E+3   1       ->  1\r
+ddcms559 comparesig    1E+4   1       ->  1\r
+ddcms561 comparesig    1E+5   1       ->  1\r
+ddcms562 comparesig    1E+6   1       ->  1\r
+ddcms563 comparesig    1E+7   1       ->  1\r
+ddcms564 comparesig    1E+8   1       ->  1\r
+ddcms565 comparesig    1E+9   1       ->  1\r
+ddcms566 comparesig    1E+10  1       ->  1\r
+ddcms567 comparesig    1E+11  1       ->  1\r
+ddcms568 comparesig    1E+12  1       ->  1\r
+ddcms569 comparesig    1E+13  1       ->  1\r
+ddcms570 comparesig    1E+14  1       ->  1\r
+ddcms571 comparesig    1E+15  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+ddcms580 comparesig  0.000000987654321     1E-15    -> 1\r
+ddcms581 comparesig  0.000000987654321     1E-14    -> 1\r
+ddcms582 comparesig  0.000000987654321     1E-13    -> 1\r
+ddcms583 comparesig  0.000000987654321     1E-12    -> 1\r
+ddcms584 comparesig  0.000000987654321     1E-11    -> 1\r
+ddcms585 comparesig  0.000000987654321     1E-10    -> 1\r
+ddcms586 comparesig  0.000000987654321     1E-9     -> 1\r
+ddcms587 comparesig  0.000000987654321     1E-8     -> 1\r
+ddcms588 comparesig  0.000000987654321     1E-7     -> 1\r
+ddcms589 comparesig  0.000000987654321     1E-6     -> -1\r
+ddcms590 comparesig  0.000000987654321     1E-5     -> -1\r
+ddcms591 comparesig  0.000000987654321     1E-4     -> -1\r
+ddcms592 comparesig  0.000000987654321     1E-3     -> -1\r
+ddcms593 comparesig  0.000000987654321     1E-2     -> -1\r
+ddcms594 comparesig  0.000000987654321     1E-1     -> -1\r
+ddcms595 comparesig  0.000000987654321     1E-0     -> -1\r
+ddcms596 comparesig  0.000000987654321     1E+1     -> -1\r
+ddcms597 comparesig  0.000000987654321     1E+2     -> -1\r
+ddcms598 comparesig  0.000000987654321     1E+3     -> -1\r
+ddcms599 comparesig  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+ddcms600 comparesig   12            12.2345 -> -1\r
+ddcms601 comparesig   12.0          12.2345 -> -1\r
+ddcms602 comparesig   12.00         12.2345 -> -1\r
+ddcms603 comparesig   12.000        12.2345 -> -1\r
+ddcms604 comparesig   12.0000       12.2345 -> -1\r
+ddcms605 comparesig   12.00000      12.2345 -> -1\r
+ddcms606 comparesig   12.000000     12.2345 -> -1\r
+ddcms607 comparesig   12.0000000    12.2345 -> -1\r
+ddcms608 comparesig   12.00000000   12.2345 -> -1\r
+ddcms609 comparesig   12.000000000  12.2345 -> -1\r
+ddcms610 comparesig   12.1234 12            ->  1\r
+ddcms611 comparesig   12.1234 12.0          ->  1\r
+ddcms612 comparesig   12.1234 12.00         ->  1\r
+ddcms613 comparesig   12.1234 12.000        ->  1\r
+ddcms614 comparesig   12.1234 12.0000       ->  1\r
+ddcms615 comparesig   12.1234 12.00000      ->  1\r
+ddcms616 comparesig   12.1234 12.000000     ->  1\r
+ddcms617 comparesig   12.1234 12.0000000    ->  1\r
+ddcms618 comparesig   12.1234 12.00000000   ->  1\r
+ddcms619 comparesig   12.1234 12.000000000  ->  1\r
+ddcms620 comparesig  -12           -12.2345 ->  1\r
+ddcms621 comparesig  -12.0         -12.2345 ->  1\r
+ddcms622 comparesig  -12.00        -12.2345 ->  1\r
+ddcms623 comparesig  -12.000       -12.2345 ->  1\r
+ddcms624 comparesig  -12.0000      -12.2345 ->  1\r
+ddcms625 comparesig  -12.00000     -12.2345 ->  1\r
+ddcms626 comparesig  -12.000000    -12.2345 ->  1\r
+ddcms627 comparesig  -12.0000000   -12.2345 ->  1\r
+ddcms628 comparesig  -12.00000000  -12.2345 ->  1\r
+ddcms629 comparesig  -12.000000000 -12.2345 ->  1\r
+ddcms630 comparesig  -12.1234 -12           -> -1\r
+ddcms631 comparesig  -12.1234 -12.0         -> -1\r
+ddcms632 comparesig  -12.1234 -12.00        -> -1\r
+ddcms633 comparesig  -12.1234 -12.000       -> -1\r
+ddcms634 comparesig  -12.1234 -12.0000      -> -1\r
+ddcms635 comparesig  -12.1234 -12.00000     -> -1\r
+ddcms636 comparesig  -12.1234 -12.000000    -> -1\r
+ddcms637 comparesig  -12.1234 -12.0000000   -> -1\r
+ddcms638 comparesig  -12.1234 -12.00000000  -> -1\r
+ddcms639 comparesig  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+ddcms640 comparesig   0     0   -> 0\r
+ddcms641 comparesig   0    -0   -> 0\r
+ddcms642 comparesig   0    -0.0 -> 0\r
+ddcms643 comparesig   0     0.0 -> 0\r
+ddcms644 comparesig  -0     0   -> 0\r
+ddcms645 comparesig  -0    -0   -> 0\r
+ddcms646 comparesig  -0    -0.0 -> 0\r
+ddcms647 comparesig  -0     0.0 -> 0\r
+ddcms648 comparesig   0.0   0   -> 0\r
+ddcms649 comparesig   0.0  -0   -> 0\r
+ddcms650 comparesig   0.0  -0.0 -> 0\r
+ddcms651 comparesig   0.0   0.0 -> 0\r
+ddcms652 comparesig  -0.0   0   -> 0\r
+ddcms653 comparesig  -0.0  -0   -> 0\r
+ddcms654 comparesig  -0.0  -0.0 -> 0\r
+ddcms655 comparesig  -0.0   0.0 -> 0\r
+\r
+ddcms656 comparesig  -0E1   0.0 -> 0\r
+ddcms657 comparesig  -0E2   0.0 -> 0\r
+ddcms658 comparesig   0E1   0.0 -> 0\r
+ddcms659 comparesig   0E2   0.0 -> 0\r
+ddcms660 comparesig  -0E1   0   -> 0\r
+ddcms661 comparesig  -0E2   0   -> 0\r
+ddcms662 comparesig   0E1   0   -> 0\r
+ddcms663 comparesig   0E2   0   -> 0\r
+ddcms664 comparesig  -0E1  -0E1 -> 0\r
+ddcms665 comparesig  -0E2  -0E1 -> 0\r
+ddcms666 comparesig   0E1  -0E1 -> 0\r
+ddcms667 comparesig   0E2  -0E1 -> 0\r
+ddcms668 comparesig  -0E1  -0E2 -> 0\r
+ddcms669 comparesig  -0E2  -0E2 -> 0\r
+ddcms670 comparesig   0E1  -0E2 -> 0\r
+ddcms671 comparesig   0E2  -0E2 -> 0\r
+ddcms672 comparesig  -0E1   0E1 -> 0\r
+ddcms673 comparesig  -0E2   0E1 -> 0\r
+ddcms674 comparesig   0E1   0E1 -> 0\r
+ddcms675 comparesig   0E2   0E1 -> 0\r
+ddcms676 comparesig  -0E1   0E2 -> 0\r
+ddcms677 comparesig  -0E2   0E2 -> 0\r
+ddcms678 comparesig   0E1   0E2 -> 0\r
+ddcms679 comparesig   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+ddcms680 comparesig   12    12           -> 0\r
+ddcms681 comparesig   12    12.0         -> 0\r
+ddcms682 comparesig   12    12.00        -> 0\r
+ddcms683 comparesig   12    12.000       -> 0\r
+ddcms684 comparesig   12    12.0000      -> 0\r
+ddcms685 comparesig   12    12.00000     -> 0\r
+ddcms686 comparesig   12    12.000000    -> 0\r
+ddcms687 comparesig   12    12.0000000   -> 0\r
+ddcms688 comparesig   12    12.00000000  -> 0\r
+ddcms689 comparesig   12    12.000000000 -> 0\r
+ddcms690 comparesig   12              12 -> 0\r
+ddcms691 comparesig   12.0            12 -> 0\r
+ddcms692 comparesig   12.00           12 -> 0\r
+ddcms693 comparesig   12.000          12 -> 0\r
+ddcms694 comparesig   12.0000         12 -> 0\r
+ddcms695 comparesig   12.00000        12 -> 0\r
+ddcms696 comparesig   12.000000       12 -> 0\r
+ddcms697 comparesig   12.0000000      12 -> 0\r
+ddcms698 comparesig   12.00000000     12 -> 0\r
+ddcms699 comparesig   12.000000000    12 -> 0\r
+\r
+-- first, second, & last digit\r
+ddcms700 comparesig   1234567890123456 1234567890123455 -> 1\r
+ddcms701 comparesig   1234567890123456 1234567890123456 -> 0\r
+ddcms702 comparesig   1234567890123456 1234567890123457 -> -1\r
+ddcms703 comparesig   1234567890123456 0234567890123456 -> 1\r
+ddcms704 comparesig   1234567890123456 1234567890123456 -> 0\r
+ddcms705 comparesig   1234567890123456 2234567890123456 -> -1\r
+ddcms706 comparesig   1134567890123456 1034567890123456 -> 1\r
+ddcms707 comparesig   1134567890123456 1134567890123456 -> 0\r
+ddcms708 comparesig   1134567890123456 1234567890123456 -> -1\r
+\r
+-- miscellaneous\r
+ddcms721 comparesig 12345678000 1 -> 1\r
+ddcms722 comparesig 1 12345678000 -> -1\r
+ddcms723 comparesig 1234567800  1 -> 1\r
+ddcms724 comparesig 1 1234567800  -> -1\r
+ddcms725 comparesig 1234567890  1 -> 1\r
+ddcms726 comparesig 1 1234567890  -> -1\r
+ddcms727 comparesig 1234567891  1 -> 1\r
+ddcms728 comparesig 1 1234567891  -> -1\r
+ddcms729 comparesig 12345678901 1 -> 1\r
+ddcms730 comparesig 1 12345678901 -> -1\r
+ddcms731 comparesig 1234567896  1 -> 1\r
+ddcms732 comparesig 1 1234567896  -> -1\r
+\r
+-- residue cases at lower precision\r
+ddcms740 comparesig  1  0.9999999  -> 1\r
+ddcms741 comparesig  1  0.999999   -> 1\r
+ddcms742 comparesig  1  0.99999    -> 1\r
+ddcms743 comparesig  1  1.0000     -> 0\r
+ddcms744 comparesig  1  1.00001    -> -1\r
+ddcms745 comparesig  1  1.000001   -> -1\r
+ddcms746 comparesig  1  1.0000001  -> -1\r
+ddcms750 comparesig  0.9999999  1  -> -1\r
+ddcms751 comparesig  0.999999   1  -> -1\r
+ddcms752 comparesig  0.99999    1  -> -1\r
+ddcms753 comparesig  1.0000     1  -> 0\r
+ddcms754 comparesig  1.00001    1  -> 1\r
+ddcms755 comparesig  1.000001   1  -> 1\r
+ddcms756 comparesig  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+ddcms780 comparesig  Inf  -Inf   ->  1\r
+ddcms781 comparesig  Inf  -1000  ->  1\r
+ddcms782 comparesig  Inf  -1     ->  1\r
+ddcms783 comparesig  Inf  -0     ->  1\r
+ddcms784 comparesig  Inf   0     ->  1\r
+ddcms785 comparesig  Inf   1     ->  1\r
+ddcms786 comparesig  Inf   1000  ->  1\r
+ddcms787 comparesig  Inf   Inf   ->  0\r
+ddcms788 comparesig -1000  Inf   -> -1\r
+ddcms789 comparesig -Inf   Inf   -> -1\r
+ddcms790 comparesig -1     Inf   -> -1\r
+ddcms791 comparesig -0     Inf   -> -1\r
+ddcms792 comparesig  0     Inf   -> -1\r
+ddcms793 comparesig  1     Inf   -> -1\r
+ddcms794 comparesig  1000  Inf   -> -1\r
+ddcms795 comparesig  Inf   Inf   ->  0\r
+\r
+ddcms800 comparesig -Inf  -Inf   ->  0\r
+ddcms801 comparesig -Inf  -1000  -> -1\r
+ddcms802 comparesig -Inf  -1     -> -1\r
+ddcms803 comparesig -Inf  -0     -> -1\r
+ddcms804 comparesig -Inf   0     -> -1\r
+ddcms805 comparesig -Inf   1     -> -1\r
+ddcms806 comparesig -Inf   1000  -> -1\r
+ddcms807 comparesig -Inf   Inf   -> -1\r
+ddcms808 comparesig -Inf  -Inf   ->  0\r
+ddcms809 comparesig -1000 -Inf   ->  1\r
+ddcms810 comparesig -1    -Inf   ->  1\r
+ddcms811 comparesig -0    -Inf   ->  1\r
+ddcms812 comparesig  0    -Inf   ->  1\r
+ddcms813 comparesig  1    -Inf   ->  1\r
+ddcms814 comparesig  1000 -Inf   ->  1\r
+ddcms815 comparesig  Inf  -Inf   ->  1\r
+\r
+ddcms821 comparesig  NaN -Inf    ->  NaN  Invalid_operation\r
+ddcms822 comparesig  NaN -1000   ->  NaN  Invalid_operation\r
+ddcms823 comparesig  NaN -1      ->  NaN  Invalid_operation\r
+ddcms824 comparesig  NaN -0      ->  NaN  Invalid_operation\r
+ddcms825 comparesig  NaN  0      ->  NaN  Invalid_operation\r
+ddcms826 comparesig  NaN  1      ->  NaN  Invalid_operation\r
+ddcms827 comparesig  NaN  1000   ->  NaN  Invalid_operation\r
+ddcms828 comparesig  NaN  Inf    ->  NaN  Invalid_operation\r
+ddcms829 comparesig  NaN  NaN    ->  NaN  Invalid_operation\r
+ddcms830 comparesig -Inf  NaN    ->  NaN  Invalid_operation\r
+ddcms831 comparesig -1000 NaN    ->  NaN  Invalid_operation\r
+ddcms832 comparesig -1    NaN    ->  NaN  Invalid_operation\r
+ddcms833 comparesig -0    NaN    ->  NaN  Invalid_operation\r
+ddcms834 comparesig  0    NaN    ->  NaN  Invalid_operation\r
+ddcms835 comparesig  1    NaN    ->  NaN  Invalid_operation\r
+ddcms836 comparesig  1000 NaN    ->  NaN  Invalid_operation\r
+ddcms837 comparesig  Inf  NaN    ->  NaN  Invalid_operation\r
+ddcms838 comparesig -NaN -NaN    -> -NaN  Invalid_operation\r
+ddcms839 comparesig +NaN -NaN    ->  NaN  Invalid_operation\r
+ddcms840 comparesig -NaN +NaN    -> -NaN  Invalid_operation\r
+\r
+ddcms841 comparesig  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddcms842 comparesig  sNaN -1000  ->  NaN  Invalid_operation\r
+ddcms843 comparesig  sNaN -1     ->  NaN  Invalid_operation\r
+ddcms844 comparesig  sNaN -0     ->  NaN  Invalid_operation\r
+ddcms845 comparesig  sNaN  0     ->  NaN  Invalid_operation\r
+ddcms846 comparesig  sNaN  1     ->  NaN  Invalid_operation\r
+ddcms847 comparesig  sNaN  1000  ->  NaN  Invalid_operation\r
+ddcms848 comparesig  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddcms849 comparesig  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddcms850 comparesig  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddcms851 comparesig -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddcms852 comparesig -1000 sNaN   ->  NaN  Invalid_operation\r
+ddcms853 comparesig -1    sNaN   ->  NaN  Invalid_operation\r
+ddcms854 comparesig -0    sNaN   ->  NaN  Invalid_operation\r
+ddcms855 comparesig  0    sNaN   ->  NaN  Invalid_operation\r
+ddcms856 comparesig  1    sNaN   ->  NaN  Invalid_operation\r
+ddcms857 comparesig  1000 sNaN   ->  NaN  Invalid_operation\r
+ddcms858 comparesig  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddcms859 comparesig  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddcms860 comparesig  NaN9 -Inf   ->  NaN9   Invalid_operation\r
+ddcms861 comparesig  NaN8  999   ->  NaN8   Invalid_operation\r
+ddcms862 comparesig  NaN77 Inf   ->  NaN77  Invalid_operation\r
+ddcms863 comparesig -NaN67 NaN5  -> -NaN67  Invalid_operation\r
+ddcms864 comparesig -Inf  -NaN4  -> -NaN4   Invalid_operation\r
+ddcms865 comparesig -999  -NaN33 -> -NaN33  Invalid_operation\r
+ddcms866 comparesig  Inf   NaN2  ->  NaN2   Invalid_operation\r
+ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation\r
+ddcms868 comparesig +NaN41 -NaN42 ->  NaN41 Invalid_operation\r
+ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation\r
+ddcms870 comparesig +NaN41 +NaN42 ->  NaN41 Invalid_operation\r
+\r
+ddcms871 comparesig -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+ddcms872 comparesig  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddcms873 comparesig  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+ddcms874 comparesig  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+ddcms875 comparesig  NaN85  sNaN83  ->  NaN83 Invalid_operation\r
+ddcms876 comparesig -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddcms877 comparesig  088    sNaN81  ->  NaN81 Invalid_operation\r
+ddcms878 comparesig  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+ddcms879 comparesig  NaN   -sNaN89  -> -NaN89 Invalid_operation\r
+\r
+-- wide range\r
+ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1\r
+ddcms881 comparesig 9E+384 +1.23456789012345E-0 ->  1\r
+ddcms882 comparesig +0.100 9E-383               ->  1\r
+ddcms883 comparesig 9E-383 +0.100               -> -1\r
+ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1\r
+ddcms886 comparesig 9E+384 -1.23456789012345E-0 ->  1\r
+ddcms887 comparesig -0.100 9E-383               -> -1\r
+ddcms888 comparesig 9E-383 -0.100               ->  1\r
+\r
+-- signs\r
+ddcms901 comparesig  1e+77  1e+11 ->  1\r
+ddcms902 comparesig  1e+77 -1e+11 ->  1\r
+ddcms903 comparesig -1e+77  1e+11 -> -1\r
+ddcms904 comparesig -1e+77 -1e+11 -> -1\r
+ddcms905 comparesig  1e-77  1e-11 -> -1\r
+ddcms906 comparesig  1e-77 -1e-11 ->  1\r
+ddcms907 comparesig -1e-77  1e-11 -> -1\r
+ddcms908 comparesig -1e-77 -1e-11 ->  1\r
+\r
+-- Null tests\r
+ddcms990 comparesig 10  # -> NaN Invalid_operation\r
+ddcms991 comparesig  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddCompareTotal.decTest b/Lib/test/decimaltestdata/ddCompareTotal.decTest
new file mode 100644 (file)
index 0000000..a8bf477
--- /dev/null
@@ -0,0 +1,706 @@
+------------------------------------------------------------------------\r
+-- ddCompareTotal.decTest -- decDouble comparison using total ordering--\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+-- Similarly, comparetotal will have some radically different paths\r
+-- than compare.\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddcot001 comparetotal  -2  -2  -> 0\r
+ddcot002 comparetotal  -2  -1  -> -1\r
+ddcot003 comparetotal  -2   0  -> -1\r
+ddcot004 comparetotal  -2   1  -> -1\r
+ddcot005 comparetotal  -2   2  -> -1\r
+ddcot006 comparetotal  -1  -2  -> 1\r
+ddcot007 comparetotal  -1  -1  -> 0\r
+ddcot008 comparetotal  -1   0  -> -1\r
+ddcot009 comparetotal  -1   1  -> -1\r
+ddcot010 comparetotal  -1   2  -> -1\r
+ddcot011 comparetotal   0  -2  -> 1\r
+ddcot012 comparetotal   0  -1  -> 1\r
+ddcot013 comparetotal   0   0  -> 0\r
+ddcot014 comparetotal   0   1  -> -1\r
+ddcot015 comparetotal   0   2  -> -1\r
+ddcot016 comparetotal   1  -2  -> 1\r
+ddcot017 comparetotal   1  -1  -> 1\r
+ddcot018 comparetotal   1   0  -> 1\r
+ddcot019 comparetotal   1   1  -> 0\r
+ddcot020 comparetotal   1   2  -> -1\r
+ddcot021 comparetotal   2  -2  -> 1\r
+ddcot022 comparetotal   2  -1  -> 1\r
+ddcot023 comparetotal   2   0  -> 1\r
+ddcot025 comparetotal   2   1  -> 1\r
+ddcot026 comparetotal   2   2  -> 0\r
+\r
+ddcot031 comparetotal  -20  -20  -> 0\r
+ddcot032 comparetotal  -20  -10  -> -1\r
+ddcot033 comparetotal  -20   00  -> -1\r
+ddcot034 comparetotal  -20   10  -> -1\r
+ddcot035 comparetotal  -20   20  -> -1\r
+ddcot036 comparetotal  -10  -20  -> 1\r
+ddcot037 comparetotal  -10  -10  -> 0\r
+ddcot038 comparetotal  -10   00  -> -1\r
+ddcot039 comparetotal  -10   10  -> -1\r
+ddcot040 comparetotal  -10   20  -> -1\r
+ddcot041 comparetotal   00  -20  -> 1\r
+ddcot042 comparetotal   00  -10  -> 1\r
+ddcot043 comparetotal   00   00  -> 0\r
+ddcot044 comparetotal   00   10  -> -1\r
+ddcot045 comparetotal   00   20  -> -1\r
+ddcot046 comparetotal   10  -20  -> 1\r
+ddcot047 comparetotal   10  -10  -> 1\r
+ddcot048 comparetotal   10   00  -> 1\r
+ddcot049 comparetotal   10   10  -> 0\r
+ddcot050 comparetotal   10   20  -> -1\r
+ddcot051 comparetotal   20  -20  -> 1\r
+ddcot052 comparetotal   20  -10  -> 1\r
+ddcot053 comparetotal   20   00  -> 1\r
+ddcot055 comparetotal   20   10  -> 1\r
+ddcot056 comparetotal   20   20  -> 0\r
+\r
+ddcot061 comparetotal  -2.0  -2.0  -> 0\r
+ddcot062 comparetotal  -2.0  -1.0  -> -1\r
+ddcot063 comparetotal  -2.0   0.0  -> -1\r
+ddcot064 comparetotal  -2.0   1.0  -> -1\r
+ddcot065 comparetotal  -2.0   2.0  -> -1\r
+ddcot066 comparetotal  -1.0  -2.0  -> 1\r
+ddcot067 comparetotal  -1.0  -1.0  -> 0\r
+ddcot068 comparetotal  -1.0   0.0  -> -1\r
+ddcot069 comparetotal  -1.0   1.0  -> -1\r
+ddcot070 comparetotal  -1.0   2.0  -> -1\r
+ddcot071 comparetotal   0.0  -2.0  -> 1\r
+ddcot072 comparetotal   0.0  -1.0  -> 1\r
+ddcot073 comparetotal   0.0   0.0  -> 0\r
+ddcot074 comparetotal   0.0   1.0  -> -1\r
+ddcot075 comparetotal   0.0   2.0  -> -1\r
+ddcot076 comparetotal   1.0  -2.0  -> 1\r
+ddcot077 comparetotal   1.0  -1.0  -> 1\r
+ddcot078 comparetotal   1.0   0.0  -> 1\r
+ddcot079 comparetotal   1.0   1.0  -> 0\r
+ddcot080 comparetotal   1.0   2.0  -> -1\r
+ddcot081 comparetotal   2.0  -2.0  -> 1\r
+ddcot082 comparetotal   2.0  -1.0  -> 1\r
+ddcot083 comparetotal   2.0   0.0  -> 1\r
+ddcot085 comparetotal   2.0   1.0  -> 1\r
+ddcot086 comparetotal   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+ddcot090 comparetotal  9.99999999E+384 9.99999999E+384  -> 0\r
+ddcot091 comparetotal -9.99999999E+384 9.99999999E+384  -> -1\r
+ddcot092 comparetotal  9.99999999E+384 -9.99999999E+384 -> 1\r
+ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+ddcot100 comparetotal   7.0    7.0    -> 0\r
+ddcot101 comparetotal   7.0    7      -> -1\r
+ddcot102 comparetotal   7      7.0    -> 1\r
+ddcot103 comparetotal   7E+0   7.0    -> 1\r
+ddcot104 comparetotal   70E-1  7.0    -> 0\r
+ddcot105 comparetotal   0.7E+1 7      -> 0\r
+ddcot106 comparetotal   70E-1  7      -> -1\r
+ddcot107 comparetotal   7.0    7E+0   -> -1\r
+ddcot108 comparetotal   7.0    70E-1  -> 0\r
+ddcot109 comparetotal   7      0.7E+1 -> 0\r
+ddcot110 comparetotal   7      70E-1  -> 1\r
+\r
+ddcot120 comparetotal   8.0    7.0    -> 1\r
+ddcot121 comparetotal   8.0    7      -> 1\r
+ddcot122 comparetotal   8      7.0    -> 1\r
+ddcot123 comparetotal   8E+0   7.0    -> 1\r
+ddcot124 comparetotal   80E-1  7.0    -> 1\r
+ddcot125 comparetotal   0.8E+1 7      -> 1\r
+ddcot126 comparetotal   80E-1  7      -> 1\r
+ddcot127 comparetotal   8.0    7E+0   -> 1\r
+ddcot128 comparetotal   8.0    70E-1  -> 1\r
+ddcot129 comparetotal   8      0.7E+1  -> 1\r
+ddcot130 comparetotal   8      70E-1  -> 1\r
+\r
+ddcot140 comparetotal   8.0    9.0    -> -1\r
+ddcot141 comparetotal   8.0    9      -> -1\r
+ddcot142 comparetotal   8      9.0    -> -1\r
+ddcot143 comparetotal   8E+0   9.0    -> -1\r
+ddcot144 comparetotal   80E-1  9.0    -> -1\r
+ddcot145 comparetotal   0.8E+1 9      -> -1\r
+ddcot146 comparetotal   80E-1  9      -> -1\r
+ddcot147 comparetotal   8.0    9E+0   -> -1\r
+ddcot148 comparetotal   8.0    90E-1  -> -1\r
+ddcot149 comparetotal   8      0.9E+1 -> -1\r
+ddcot150 comparetotal   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+ddcot200 comparetotal  -7.0    7.0    -> -1\r
+ddcot201 comparetotal  -7.0    7      -> -1\r
+ddcot202 comparetotal  -7      7.0    -> -1\r
+ddcot203 comparetotal  -7E+0   7.0    -> -1\r
+ddcot204 comparetotal  -70E-1  7.0    -> -1\r
+ddcot205 comparetotal  -0.7E+1 7      -> -1\r
+ddcot206 comparetotal  -70E-1  7      -> -1\r
+ddcot207 comparetotal  -7.0    7E+0   -> -1\r
+ddcot208 comparetotal  -7.0    70E-1  -> -1\r
+ddcot209 comparetotal  -7      0.7E+1 -> -1\r
+ddcot210 comparetotal  -7      70E-1  -> -1\r
+\r
+ddcot220 comparetotal  -8.0    7.0    -> -1\r
+ddcot221 comparetotal  -8.0    7      -> -1\r
+ddcot222 comparetotal  -8      7.0    -> -1\r
+ddcot223 comparetotal  -8E+0   7.0    -> -1\r
+ddcot224 comparetotal  -80E-1  7.0    -> -1\r
+ddcot225 comparetotal  -0.8E+1 7      -> -1\r
+ddcot226 comparetotal  -80E-1  7      -> -1\r
+ddcot227 comparetotal  -8.0    7E+0   -> -1\r
+ddcot228 comparetotal  -8.0    70E-1  -> -1\r
+ddcot229 comparetotal  -8      0.7E+1 -> -1\r
+ddcot230 comparetotal  -8      70E-1  -> -1\r
+\r
+ddcot240 comparetotal  -8.0    9.0    -> -1\r
+ddcot241 comparetotal  -8.0    9      -> -1\r
+ddcot242 comparetotal  -8      9.0    -> -1\r
+ddcot243 comparetotal  -8E+0   9.0    -> -1\r
+ddcot244 comparetotal  -80E-1  9.0    -> -1\r
+ddcot245 comparetotal  -0.8E+1 9      -> -1\r
+ddcot246 comparetotal  -80E-1  9      -> -1\r
+ddcot247 comparetotal  -8.0    9E+0   -> -1\r
+ddcot248 comparetotal  -8.0    90E-1  -> -1\r
+ddcot249 comparetotal  -8      0.9E+1 -> -1\r
+ddcot250 comparetotal  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+ddcot300 comparetotal   7.0    -7.0    -> 1\r
+ddcot301 comparetotal   7.0    -7      -> 1\r
+ddcot302 comparetotal   7      -7.0    -> 1\r
+ddcot303 comparetotal   7E+0   -7.0    -> 1\r
+ddcot304 comparetotal   70E-1  -7.0    -> 1\r
+ddcot305 comparetotal   .7E+1  -7      -> 1\r
+ddcot306 comparetotal   70E-1  -7      -> 1\r
+ddcot307 comparetotal   7.0    -7E+0   -> 1\r
+ddcot308 comparetotal   7.0    -70E-1  -> 1\r
+ddcot309 comparetotal   7      -.7E+1  -> 1\r
+ddcot310 comparetotal   7      -70E-1  -> 1\r
+\r
+ddcot320 comparetotal   8.0    -7.0    -> 1\r
+ddcot321 comparetotal   8.0    -7      -> 1\r
+ddcot322 comparetotal   8      -7.0    -> 1\r
+ddcot323 comparetotal   8E+0   -7.0    -> 1\r
+ddcot324 comparetotal   80E-1  -7.0    -> 1\r
+ddcot325 comparetotal   .8E+1  -7      -> 1\r
+ddcot326 comparetotal   80E-1  -7      -> 1\r
+ddcot327 comparetotal   8.0    -7E+0   -> 1\r
+ddcot328 comparetotal   8.0    -70E-1  -> 1\r
+ddcot329 comparetotal   8      -.7E+1  -> 1\r
+ddcot330 comparetotal   8      -70E-1  -> 1\r
+\r
+ddcot340 comparetotal   8.0    -9.0    -> 1\r
+ddcot341 comparetotal   8.0    -9      -> 1\r
+ddcot342 comparetotal   8      -9.0    -> 1\r
+ddcot343 comparetotal   8E+0   -9.0    -> 1\r
+ddcot344 comparetotal   80E-1  -9.0    -> 1\r
+ddcot345 comparetotal   .8E+1  -9      -> 1\r
+ddcot346 comparetotal   80E-1  -9      -> 1\r
+ddcot347 comparetotal   8.0    -9E+0   -> 1\r
+ddcot348 comparetotal   8.0    -90E-1  -> 1\r
+ddcot349 comparetotal   8      -.9E+1  -> 1\r
+ddcot350 comparetotal   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+ddcot400 comparetotal   -7.0    -7.0    -> 0\r
+ddcot401 comparetotal   -7.0    -7      -> 1\r
+ddcot402 comparetotal   -7      -7.0    -> -1\r
+ddcot403 comparetotal   -7E+0   -7.0    -> -1\r
+ddcot404 comparetotal   -70E-1  -7.0    -> 0\r
+ddcot405 comparetotal   -.7E+1  -7      -> 0\r
+ddcot406 comparetotal   -70E-1  -7      -> 1\r
+ddcot407 comparetotal   -7.0    -7E+0   -> 1\r
+ddcot408 comparetotal   -7.0    -70E-1  -> 0\r
+ddcot409 comparetotal   -7      -.7E+1  -> 0\r
+ddcot410 comparetotal   -7      -70E-1  -> -1\r
+\r
+ddcot420 comparetotal   -8.0    -7.0    -> -1\r
+ddcot421 comparetotal   -8.0    -7      -> -1\r
+ddcot422 comparetotal   -8      -7.0    -> -1\r
+ddcot423 comparetotal   -8E+0   -7.0    -> -1\r
+ddcot424 comparetotal   -80E-1  -7.0    -> -1\r
+ddcot425 comparetotal   -.8E+1  -7      -> -1\r
+ddcot426 comparetotal   -80E-1  -7      -> -1\r
+ddcot427 comparetotal   -8.0    -7E+0   -> -1\r
+ddcot428 comparetotal   -8.0    -70E-1  -> -1\r
+ddcot429 comparetotal   -8      -.7E+1  -> -1\r
+ddcot430 comparetotal   -8      -70E-1  -> -1\r
+\r
+ddcot440 comparetotal   -8.0    -9.0    -> 1\r
+ddcot441 comparetotal   -8.0    -9      -> 1\r
+ddcot442 comparetotal   -8      -9.0    -> 1\r
+ddcot443 comparetotal   -8E+0   -9.0    -> 1\r
+ddcot444 comparetotal   -80E-1  -9.0    -> 1\r
+ddcot445 comparetotal   -.8E+1  -9      -> 1\r
+ddcot446 comparetotal   -80E-1  -9      -> 1\r
+ddcot447 comparetotal   -8.0    -9E+0   -> 1\r
+ddcot448 comparetotal   -8.0    -90E-1  -> 1\r
+ddcot449 comparetotal   -8      -.9E+1  -> 1\r
+ddcot450 comparetotal   -8      -90E-1  -> 1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1\r
+ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1\r
+ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1\r
+ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1\r
+ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1\r
+ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1\r
+ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1\r
+ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1\r
+ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1\r
+ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1\r
+ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0\r
+ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1\r
+ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1\r
+ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1\r
+ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1\r
+ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1\r
+ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1\r
+ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1\r
+ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1\r
+ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1\r
+ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1\r
+ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+ddcot498 comparetotal    1     1E-17    -> 1\r
+ddcot499 comparetotal    1     1E-16    -> 1\r
+ddcot500 comparetotal    1     1E-15    -> 1\r
+ddcot501 comparetotal    1     1E-14    -> 1\r
+ddcot502 comparetotal    1     1E-13    -> 1\r
+ddcot503 comparetotal    1     1E-12    -> 1\r
+ddcot504 comparetotal    1     1E-11    -> 1\r
+ddcot505 comparetotal    1     1E-10    -> 1\r
+ddcot506 comparetotal    1     1E-9     -> 1\r
+ddcot507 comparetotal    1     1E-8     -> 1\r
+ddcot508 comparetotal    1     1E-7     -> 1\r
+ddcot509 comparetotal    1     1E-6     -> 1\r
+ddcot510 comparetotal    1     1E-5     -> 1\r
+ddcot511 comparetotal    1     1E-4     -> 1\r
+ddcot512 comparetotal    1     1E-3     -> 1\r
+ddcot513 comparetotal    1     1E-2     -> 1\r
+ddcot514 comparetotal    1     1E-1     -> 1\r
+ddcot515 comparetotal    1     1E-0     -> 0\r
+ddcot516 comparetotal    1     1E+1     -> -1\r
+ddcot517 comparetotal    1     1E+2     -> -1\r
+ddcot518 comparetotal    1     1E+3     -> -1\r
+ddcot519 comparetotal    1     1E+4     -> -1\r
+ddcot521 comparetotal    1     1E+5     -> -1\r
+ddcot522 comparetotal    1     1E+6     -> -1\r
+ddcot523 comparetotal    1     1E+7     -> -1\r
+ddcot524 comparetotal    1     1E+8     -> -1\r
+ddcot525 comparetotal    1     1E+9     -> -1\r
+ddcot526 comparetotal    1     1E+10    -> -1\r
+ddcot527 comparetotal    1     1E+11    -> -1\r
+ddcot528 comparetotal    1     1E+12    -> -1\r
+ddcot529 comparetotal    1     1E+13    -> -1\r
+ddcot530 comparetotal    1     1E+14    -> -1\r
+ddcot531 comparetotal    1     1E+15    -> -1\r
+ddcot532 comparetotal    1     1E+16    -> -1\r
+ddcot533 comparetotal    1     1E+17    -> -1\r
+-- LR swap\r
+ddcot538 comparetotal    1E-17  1       -> -1\r
+ddcot539 comparetotal    1E-16  1       -> -1\r
+ddcot540 comparetotal    1E-15  1       -> -1\r
+ddcot541 comparetotal    1E-14  1       -> -1\r
+ddcot542 comparetotal    1E-13  1       -> -1\r
+ddcot543 comparetotal    1E-12  1       -> -1\r
+ddcot544 comparetotal    1E-11  1       -> -1\r
+ddcot545 comparetotal    1E-10  1       -> -1\r
+ddcot546 comparetotal    1E-9   1       -> -1\r
+ddcot547 comparetotal    1E-8   1       -> -1\r
+ddcot548 comparetotal    1E-7   1       -> -1\r
+ddcot549 comparetotal    1E-6   1       -> -1\r
+ddcot550 comparetotal    1E-5   1       -> -1\r
+ddcot551 comparetotal    1E-4   1       -> -1\r
+ddcot552 comparetotal    1E-3   1       -> -1\r
+ddcot553 comparetotal    1E-2   1       -> -1\r
+ddcot554 comparetotal    1E-1   1       -> -1\r
+ddcot555 comparetotal    1E-0   1       ->  0\r
+ddcot556 comparetotal    1E+1   1       ->  1\r
+ddcot557 comparetotal    1E+2   1       ->  1\r
+ddcot558 comparetotal    1E+3   1       ->  1\r
+ddcot559 comparetotal    1E+4   1       ->  1\r
+ddcot561 comparetotal    1E+5   1       ->  1\r
+ddcot562 comparetotal    1E+6   1       ->  1\r
+ddcot563 comparetotal    1E+7   1       ->  1\r
+ddcot564 comparetotal    1E+8   1       ->  1\r
+ddcot565 comparetotal    1E+9   1       ->  1\r
+ddcot566 comparetotal    1E+10  1       ->  1\r
+ddcot567 comparetotal    1E+11  1       ->  1\r
+ddcot568 comparetotal    1E+12  1       ->  1\r
+ddcot569 comparetotal    1E+13  1       ->  1\r
+ddcot570 comparetotal    1E+14  1       ->  1\r
+ddcot571 comparetotal    1E+15  1       ->  1\r
+ddcot572 comparetotal    1E+16  1       ->  1\r
+ddcot573 comparetotal    1E+17  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+ddcot578 comparetotal  0.000000987654321     1E-17    -> 1\r
+ddcot579 comparetotal  0.000000987654321     1E-16    -> 1\r
+ddcot580 comparetotal  0.000000987654321     1E-15    -> 1\r
+ddcot581 comparetotal  0.000000987654321     1E-14    -> 1\r
+ddcot582 comparetotal  0.000000987654321     1E-13    -> 1\r
+ddcot583 comparetotal  0.000000987654321     1E-12    -> 1\r
+ddcot584 comparetotal  0.000000987654321     1E-11    -> 1\r
+ddcot585 comparetotal  0.000000987654321     1E-10    -> 1\r
+ddcot586 comparetotal  0.000000987654321     1E-9     -> 1\r
+ddcot587 comparetotal  0.000000987654321     1E-8     -> 1\r
+ddcot588 comparetotal  0.000000987654321     1E-7     -> 1\r
+ddcot589 comparetotal  0.000000987654321     1E-6     -> -1\r
+ddcot590 comparetotal  0.000000987654321     1E-5     -> -1\r
+ddcot591 comparetotal  0.000000987654321     1E-4     -> -1\r
+ddcot592 comparetotal  0.000000987654321     1E-3     -> -1\r
+ddcot593 comparetotal  0.000000987654321     1E-2     -> -1\r
+ddcot594 comparetotal  0.000000987654321     1E-1     -> -1\r
+ddcot595 comparetotal  0.000000987654321     1E-0     -> -1\r
+ddcot596 comparetotal  0.000000987654321     1E+1     -> -1\r
+ddcot597 comparetotal  0.000000987654321     1E+2     -> -1\r
+ddcot598 comparetotal  0.000000987654321     1E+3     -> -1\r
+ddcot599 comparetotal  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+ddcot600 comparetotal   12            12.2345 -> -1\r
+ddcot601 comparetotal   12.0          12.2345 -> -1\r
+ddcot602 comparetotal   12.00         12.2345 -> -1\r
+ddcot603 comparetotal   12.000        12.2345 -> -1\r
+ddcot604 comparetotal   12.0000       12.2345 -> -1\r
+ddcot605 comparetotal   12.00000      12.2345 -> -1\r
+ddcot606 comparetotal   12.000000     12.2345 -> -1\r
+ddcot607 comparetotal   12.0000000    12.2345 -> -1\r
+ddcot608 comparetotal   12.00000000   12.2345 -> -1\r
+ddcot609 comparetotal   12.000000000  12.2345 -> -1\r
+ddcot610 comparetotal   12.1234 12            ->  1\r
+ddcot611 comparetotal   12.1234 12.0          ->  1\r
+ddcot612 comparetotal   12.1234 12.00         ->  1\r
+ddcot613 comparetotal   12.1234 12.000        ->  1\r
+ddcot614 comparetotal   12.1234 12.0000       ->  1\r
+ddcot615 comparetotal   12.1234 12.00000      ->  1\r
+ddcot616 comparetotal   12.1234 12.000000     ->  1\r
+ddcot617 comparetotal   12.1234 12.0000000    ->  1\r
+ddcot618 comparetotal   12.1234 12.00000000   ->  1\r
+ddcot619 comparetotal   12.1234 12.000000000  ->  1\r
+ddcot620 comparetotal  -12           -12.2345 ->  1\r
+ddcot621 comparetotal  -12.0         -12.2345 ->  1\r
+ddcot622 comparetotal  -12.00        -12.2345 ->  1\r
+ddcot623 comparetotal  -12.000       -12.2345 ->  1\r
+ddcot624 comparetotal  -12.0000      -12.2345 ->  1\r
+ddcot625 comparetotal  -12.00000     -12.2345 ->  1\r
+ddcot626 comparetotal  -12.000000    -12.2345 ->  1\r
+ddcot627 comparetotal  -12.0000000   -12.2345 ->  1\r
+ddcot628 comparetotal  -12.00000000  -12.2345 ->  1\r
+ddcot629 comparetotal  -12.000000000 -12.2345 ->  1\r
+ddcot630 comparetotal  -12.1234 -12           -> -1\r
+ddcot631 comparetotal  -12.1234 -12.0         -> -1\r
+ddcot632 comparetotal  -12.1234 -12.00        -> -1\r
+ddcot633 comparetotal  -12.1234 -12.000       -> -1\r
+ddcot634 comparetotal  -12.1234 -12.0000      -> -1\r
+ddcot635 comparetotal  -12.1234 -12.00000     -> -1\r
+ddcot636 comparetotal  -12.1234 -12.000000    -> -1\r
+ddcot637 comparetotal  -12.1234 -12.0000000   -> -1\r
+ddcot638 comparetotal  -12.1234 -12.00000000  -> -1\r
+ddcot639 comparetotal  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+ddcot640 comparetotal   0     0   -> 0\r
+ddcot641 comparetotal   0    -0   -> 1\r
+ddcot642 comparetotal   0    -0.0 -> 1\r
+ddcot643 comparetotal   0     0.0 -> 1\r
+ddcot644 comparetotal  -0     0   -> -1\r
+ddcot645 comparetotal  -0    -0   -> 0\r
+ddcot646 comparetotal  -0    -0.0 -> -1\r
+ddcot647 comparetotal  -0     0.0 -> -1\r
+ddcot648 comparetotal   0.0   0   -> -1\r
+ddcot649 comparetotal   0.0  -0   -> 1\r
+ddcot650 comparetotal   0.0  -0.0 -> 1\r
+ddcot651 comparetotal   0.0   0.0 -> 0\r
+ddcot652 comparetotal  -0.0   0   -> -1\r
+ddcot653 comparetotal  -0.0  -0   -> 1\r
+ddcot654 comparetotal  -0.0  -0.0 -> 0\r
+ddcot655 comparetotal  -0.0   0.0 -> -1\r
+\r
+ddcot656 comparetotal  -0E1   0.0 -> -1\r
+ddcot657 comparetotal  -0E2   0.0 -> -1\r
+ddcot658 comparetotal   0E1   0.0 -> 1\r
+ddcot659 comparetotal   0E2   0.0 -> 1\r
+ddcot660 comparetotal  -0E1   0   -> -1\r
+ddcot661 comparetotal  -0E2   0   -> -1\r
+ddcot662 comparetotal   0E1   0   -> 1\r
+ddcot663 comparetotal   0E2   0   -> 1\r
+ddcot664 comparetotal  -0E1  -0E1 -> 0\r
+ddcot665 comparetotal  -0E2  -0E1 -> -1\r
+ddcot666 comparetotal   0E1  -0E1 -> 1\r
+ddcot667 comparetotal   0E2  -0E1 -> 1\r
+ddcot668 comparetotal  -0E1  -0E2 -> 1\r
+ddcot669 comparetotal  -0E2  -0E2 -> 0\r
+ddcot670 comparetotal   0E1  -0E2 -> 1\r
+ddcot671 comparetotal   0E2  -0E2 -> 1\r
+ddcot672 comparetotal  -0E1   0E1 -> -1\r
+ddcot673 comparetotal  -0E2   0E1 -> -1\r
+ddcot674 comparetotal   0E1   0E1 -> 0\r
+ddcot675 comparetotal   0E2   0E1 -> 1\r
+ddcot676 comparetotal  -0E1   0E2 -> -1\r
+ddcot677 comparetotal  -0E2   0E2 -> -1\r
+ddcot678 comparetotal   0E1   0E2 -> -1\r
+ddcot679 comparetotal   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+ddcot680 comparetotal   12    12           -> 0\r
+ddcot681 comparetotal   12    12.0         -> 1\r
+ddcot682 comparetotal   12    12.00        -> 1\r
+ddcot683 comparetotal   12    12.000       -> 1\r
+ddcot684 comparetotal   12    12.0000      -> 1\r
+ddcot685 comparetotal   12    12.00000     -> 1\r
+ddcot686 comparetotal   12    12.000000    -> 1\r
+ddcot687 comparetotal   12    12.0000000   -> 1\r
+ddcot688 comparetotal   12    12.00000000  -> 1\r
+ddcot689 comparetotal   12    12.000000000 -> 1\r
+ddcot690 comparetotal   12              12 -> 0\r
+ddcot691 comparetotal   12.0            12 -> -1\r
+ddcot692 comparetotal   12.00           12 -> -1\r
+ddcot693 comparetotal   12.000          12 -> -1\r
+ddcot694 comparetotal   12.0000         12 -> -1\r
+ddcot695 comparetotal   12.00000        12 -> -1\r
+ddcot696 comparetotal   12.000000       12 -> -1\r
+ddcot697 comparetotal   12.0000000      12 -> -1\r
+ddcot698 comparetotal   12.00000000     12 -> -1\r
+ddcot699 comparetotal   12.000000000    12 -> -1\r
+\r
+-- old long operand checks\r
+ddcot701 comparetotal 12345678000  1 ->  1\r
+ddcot702 comparetotal 1 12345678000  -> -1\r
+ddcot703 comparetotal 1234567800   1 ->  1\r
+ddcot704 comparetotal 1 1234567800   -> -1\r
+ddcot705 comparetotal 1234567890   1 ->  1\r
+ddcot706 comparetotal 1 1234567890   -> -1\r
+ddcot707 comparetotal 1234567891   1 ->  1\r
+ddcot708 comparetotal 1 1234567891   -> -1\r
+ddcot709 comparetotal 12345678901  1 ->  1\r
+ddcot710 comparetotal 1 12345678901  -> -1\r
+ddcot711 comparetotal 1234567896   1 ->  1\r
+ddcot712 comparetotal 1 1234567896   -> -1\r
+ddcot713 comparetotal -1234567891  1 -> -1\r
+ddcot714 comparetotal 1 -1234567891  ->  1\r
+ddcot715 comparetotal -12345678901 1 -> -1\r
+ddcot716 comparetotal 1 -12345678901 ->  1\r
+ddcot717 comparetotal -1234567896  1 -> -1\r
+ddcot718 comparetotal 1 -1234567896  ->  1\r
+\r
+-- old residue cases\r
+ddcot740 comparetotal  1  0.9999999  -> 1\r
+ddcot741 comparetotal  1  0.999999   -> 1\r
+ddcot742 comparetotal  1  0.99999    -> 1\r
+ddcot743 comparetotal  1  1.0000     -> 1\r
+ddcot744 comparetotal  1  1.00001    -> -1\r
+ddcot745 comparetotal  1  1.000001   -> -1\r
+ddcot746 comparetotal  1  1.0000001  -> -1\r
+ddcot750 comparetotal  0.9999999  1  -> -1\r
+ddcot751 comparetotal  0.999999   1  -> -1\r
+ddcot752 comparetotal  0.99999    1  -> -1\r
+ddcot753 comparetotal  1.0000     1  -> -1\r
+ddcot754 comparetotal  1.00001    1  -> 1\r
+ddcot755 comparetotal  1.000001   1  -> 1\r
+ddcot756 comparetotal  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+ddcot780 comparetotal  Inf  -Inf   ->  1\r
+ddcot781 comparetotal  Inf  -1000  ->  1\r
+ddcot782 comparetotal  Inf  -1     ->  1\r
+ddcot783 comparetotal  Inf  -0     ->  1\r
+ddcot784 comparetotal  Inf   0     ->  1\r
+ddcot785 comparetotal  Inf   1     ->  1\r
+ddcot786 comparetotal  Inf   1000  ->  1\r
+ddcot787 comparetotal  Inf   Inf   ->  0\r
+ddcot788 comparetotal -1000  Inf   -> -1\r
+ddcot789 comparetotal -Inf   Inf   -> -1\r
+ddcot790 comparetotal -1     Inf   -> -1\r
+ddcot791 comparetotal -0     Inf   -> -1\r
+ddcot792 comparetotal  0     Inf   -> -1\r
+ddcot793 comparetotal  1     Inf   -> -1\r
+ddcot794 comparetotal  1000  Inf   -> -1\r
+ddcot795 comparetotal  Inf   Inf   ->  0\r
+\r
+ddcot800 comparetotal -Inf  -Inf   ->  0\r
+ddcot801 comparetotal -Inf  -1000  -> -1\r
+ddcot802 comparetotal -Inf  -1     -> -1\r
+ddcot803 comparetotal -Inf  -0     -> -1\r
+ddcot804 comparetotal -Inf   0     -> -1\r
+ddcot805 comparetotal -Inf   1     -> -1\r
+ddcot806 comparetotal -Inf   1000  -> -1\r
+ddcot807 comparetotal -Inf   Inf   -> -1\r
+ddcot808 comparetotal -Inf  -Inf   ->  0\r
+ddcot809 comparetotal -1000 -Inf   ->  1\r
+ddcot810 comparetotal -1    -Inf   ->  1\r
+ddcot811 comparetotal -0    -Inf   ->  1\r
+ddcot812 comparetotal  0    -Inf   ->  1\r
+ddcot813 comparetotal  1    -Inf   ->  1\r
+ddcot814 comparetotal  1000 -Inf   ->  1\r
+ddcot815 comparetotal  Inf  -Inf   ->  1\r
+\r
+ddcot821 comparetotal  NaN -Inf    ->  1\r
+ddcot822 comparetotal  NaN -1000   ->  1\r
+ddcot823 comparetotal  NaN -1      ->  1\r
+ddcot824 comparetotal  NaN -0      ->  1\r
+ddcot825 comparetotal  NaN  0      ->  1\r
+ddcot826 comparetotal  NaN  1      ->  1\r
+ddcot827 comparetotal  NaN  1000   ->  1\r
+ddcot828 comparetotal  NaN  Inf    ->  1\r
+ddcot829 comparetotal  NaN  NaN    ->  0\r
+ddcot830 comparetotal -Inf  NaN    ->  -1\r
+ddcot831 comparetotal -1000 NaN    ->  -1\r
+ddcot832 comparetotal -1    NaN    ->  -1\r
+ddcot833 comparetotal -0    NaN    ->  -1\r
+ddcot834 comparetotal  0    NaN    ->  -1\r
+ddcot835 comparetotal  1    NaN    ->  -1\r
+ddcot836 comparetotal  1000 NaN    ->  -1\r
+ddcot837 comparetotal  Inf  NaN    ->  -1\r
+ddcot838 comparetotal -NaN -NaN    ->  0\r
+ddcot839 comparetotal +NaN -NaN    ->  1\r
+ddcot840 comparetotal -NaN +NaN    ->  -1\r
+\r
+ddcot841 comparetotal  sNaN -sNaN  ->  1\r
+ddcot842 comparetotal  sNaN -NaN   ->  1\r
+ddcot843 comparetotal  sNaN -Inf   ->  1\r
+ddcot844 comparetotal  sNaN -1000  ->  1\r
+ddcot845 comparetotal  sNaN -1     ->  1\r
+ddcot846 comparetotal  sNaN -0     ->  1\r
+ddcot847 comparetotal  sNaN  0     ->  1\r
+ddcot848 comparetotal  sNaN  1     ->  1\r
+ddcot849 comparetotal  sNaN  1000  ->  1\r
+ddcot850 comparetotal  sNaN  NaN   ->  -1\r
+ddcot851 comparetotal  sNaN sNaN   ->  0\r
+\r
+ddcot852 comparetotal -sNaN sNaN   ->  -1\r
+ddcot853 comparetotal -NaN  sNaN   ->  -1\r
+ddcot854 comparetotal -Inf  sNaN   ->  -1\r
+ddcot855 comparetotal -1000 sNaN   ->  -1\r
+ddcot856 comparetotal -1    sNaN   ->  -1\r
+ddcot857 comparetotal -0    sNaN   ->  -1\r
+ddcot858 comparetotal  0    sNaN   ->  -1\r
+ddcot859 comparetotal  1    sNaN   ->  -1\r
+ddcot860 comparetotal  1000 sNaN   ->  -1\r
+ddcot861 comparetotal  Inf  sNaN   ->  -1\r
+ddcot862 comparetotal  NaN  sNaN   ->  1\r
+ddcot863 comparetotal  sNaN sNaN   ->  0\r
+\r
+ddcot871 comparetotal  -sNaN -sNaN  ->  0\r
+ddcot872 comparetotal  -sNaN -NaN   ->  1\r
+ddcot873 comparetotal  -sNaN -Inf   ->  -1\r
+ddcot874 comparetotal  -sNaN -1000  ->  -1\r
+ddcot875 comparetotal  -sNaN -1     ->  -1\r
+ddcot876 comparetotal  -sNaN -0     ->  -1\r
+ddcot877 comparetotal  -sNaN  0     ->  -1\r
+ddcot878 comparetotal  -sNaN  1     ->  -1\r
+ddcot879 comparetotal  -sNaN  1000  ->  -1\r
+ddcot880 comparetotal  -sNaN  NaN   ->  -1\r
+ddcot881 comparetotal  -sNaN sNaN   ->  -1\r
+\r
+ddcot882 comparetotal -sNaN -sNaN   ->  0\r
+ddcot883 comparetotal -NaN  -sNaN   ->  -1\r
+ddcot884 comparetotal -Inf  -sNaN   ->  1\r
+ddcot885 comparetotal -1000 -sNaN   ->  1\r
+ddcot886 comparetotal -1    -sNaN   ->  1\r
+ddcot887 comparetotal -0    -sNaN   ->  1\r
+ddcot888 comparetotal  0    -sNaN   ->  1\r
+ddcot889 comparetotal  1    -sNaN   ->  1\r
+ddcot890 comparetotal  1000 -sNaN   ->  1\r
+ddcot891 comparetotal  Inf  -sNaN   ->  1\r
+ddcot892 comparetotal  NaN  -sNaN   ->  1\r
+ddcot893 comparetotal  sNaN -sNaN   ->  1\r
+\r
+-- NaNs with payload\r
+ddcot960 comparetotal  NaN9 -Inf   ->  1\r
+ddcot961 comparetotal  NaN8  999   ->  1\r
+ddcot962 comparetotal  NaN77 Inf   ->  1\r
+ddcot963 comparetotal -NaN67 NaN5  ->  -1\r
+ddcot964 comparetotal -Inf  -NaN4  ->  1\r
+ddcot965 comparetotal -999  -NaN33 ->  1\r
+ddcot966 comparetotal  Inf   NaN2  ->  -1\r
+\r
+ddcot970 comparetotal -NaN41 -NaN42 -> 1\r
+ddcot971 comparetotal +NaN41 -NaN42 -> 1\r
+ddcot972 comparetotal -NaN41 +NaN42 -> -1\r
+ddcot973 comparetotal +NaN41 +NaN42 -> -1\r
+ddcot974 comparetotal -NaN42 -NaN01 -> -1\r
+ddcot975 comparetotal +NaN42 -NaN01 ->  1\r
+ddcot976 comparetotal -NaN42 +NaN01 -> -1\r
+ddcot977 comparetotal +NaN42 +NaN01 ->  1\r
+\r
+ddcot980 comparetotal -sNaN771 -sNaN772 -> 1\r
+ddcot981 comparetotal +sNaN771 -sNaN772 -> 1\r
+ddcot982 comparetotal -sNaN771 +sNaN772 -> -1\r
+ddcot983 comparetotal +sNaN771 +sNaN772 -> -1\r
+ddcot984 comparetotal -sNaN772 -sNaN771 -> -1\r
+ddcot985 comparetotal +sNaN772 -sNaN771 ->  1\r
+ddcot986 comparetotal -sNaN772 +sNaN771 -> -1\r
+ddcot987 comparetotal +sNaN772 +sNaN771 ->  1\r
+\r
+ddcot991 comparetotal -sNaN99 -Inf    -> -1\r
+ddcot992 comparetotal  sNaN98 -11     ->  1\r
+ddcot993 comparetotal  sNaN97  NaN    -> -1\r
+ddcot994 comparetotal  sNaN16 sNaN94  -> -1\r
+ddcot995 comparetotal  NaN85  sNaN83  ->  1\r
+ddcot996 comparetotal -Inf    sNaN92  -> -1\r
+ddcot997 comparetotal  088    sNaN81  -> -1\r
+ddcot998 comparetotal  Inf    sNaN90  -> -1\r
+ddcot999 comparetotal  NaN   -sNaN89  ->  1\r
+\r
+-- spread zeros\r
+ddcot1110 comparetotal   0E-383  0       -> -1\r
+ddcot1111 comparetotal   0E-383 -0       ->  1\r
+ddcot1112 comparetotal  -0E-383  0       -> -1\r
+ddcot1113 comparetotal  -0E-383 -0       ->  1\r
+ddcot1114 comparetotal   0E-383  0E+384  -> -1\r
+ddcot1115 comparetotal   0E-383 -0E+384  ->  1\r
+ddcot1116 comparetotal  -0E-383  0E+384  -> -1\r
+ddcot1117 comparetotal  -0E-383 -0E+384  ->  1\r
+ddcot1118 comparetotal   0       0E+384  -> -1\r
+ddcot1119 comparetotal   0      -0E+384  ->  1\r
+ddcot1120 comparetotal  -0       0E+384  -> -1\r
+ddcot1121 comparetotal  -0      -0E+384  ->  1\r
+\r
+ddcot1130 comparetotal   0E+384  0       ->  1\r
+ddcot1131 comparetotal   0E+384 -0       ->  1\r
+ddcot1132 comparetotal  -0E+384  0       -> -1\r
+ddcot1133 comparetotal  -0E+384 -0       -> -1\r
+ddcot1134 comparetotal   0E+384  0E-383  ->  1\r
+ddcot1135 comparetotal   0E+384 -0E-383  ->  1\r
+ddcot1136 comparetotal  -0E+384  0E-383  -> -1\r
+ddcot1137 comparetotal  -0E+384 -0E-383  -> -1\r
+ddcot1138 comparetotal   0       0E-383  ->  1\r
+ddcot1139 comparetotal   0      -0E-383  ->  1\r
+ddcot1140 comparetotal  -0       0E-383  -> -1\r
+ddcot1141 comparetotal  -0      -0E-383  -> -1\r
+\r
+-- Null tests\r
+ddcot9990 comparetotal 10  # -> NaN Invalid_operation\r
+ddcot9991 comparetotal  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddCompareTotalMag.decTest b/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
new file mode 100644 (file)
index 0000000..b19cf64
--- /dev/null
@@ -0,0 +1,706 @@
+------------------------------------------------------------------------\r
+-- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+-- Similarly, comparetotal will have some radically different paths\r
+-- than compare.\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddctm001 comparetotmag  -2  -2   ->   0\r
+ddctm002 comparetotmag  -2  -1   ->   1\r
+ddctm003 comparetotmag  -2   0   ->   1\r
+ddctm004 comparetotmag  -2   1   ->   1\r
+ddctm005 comparetotmag  -2   2   ->   0\r
+ddctm006 comparetotmag  -1  -2   ->  -1\r
+ddctm007 comparetotmag  -1  -1   ->   0\r
+ddctm008 comparetotmag  -1   0   ->   1\r
+ddctm009 comparetotmag  -1   1   ->   0\r
+ddctm010 comparetotmag  -1   2   ->  -1\r
+ddctm011 comparetotmag   0  -2   ->  -1\r
+ddctm012 comparetotmag   0  -1   ->  -1\r
+ddctm013 comparetotmag   0   0   ->   0\r
+ddctm014 comparetotmag   0   1   ->  -1\r
+ddctm015 comparetotmag   0   2   ->  -1\r
+ddctm016 comparetotmag   1  -2   ->  -1\r
+ddctm017 comparetotmag   1  -1   ->   0\r
+ddctm018 comparetotmag   1   0   ->   1\r
+ddctm019 comparetotmag   1   1   ->   0\r
+ddctm020 comparetotmag   1   2   ->  -1\r
+ddctm021 comparetotmag   2  -2   ->   0\r
+ddctm022 comparetotmag   2  -1   ->   1\r
+ddctm023 comparetotmag   2   0   ->   1\r
+ddctm025 comparetotmag   2   1   ->   1\r
+ddctm026 comparetotmag   2   2   ->   0\r
+\r
+ddctm031 comparetotmag  -20  -20   ->   0\r
+ddctm032 comparetotmag  -20  -10   ->   1\r
+ddctm033 comparetotmag  -20   00   ->   1\r
+ddctm034 comparetotmag  -20   10   ->   1\r
+ddctm035 comparetotmag  -20   20   ->   0\r
+ddctm036 comparetotmag  -10  -20   ->  -1\r
+ddctm037 comparetotmag  -10  -10   ->   0\r
+ddctm038 comparetotmag  -10   00   ->   1\r
+ddctm039 comparetotmag  -10   10   ->   0\r
+ddctm040 comparetotmag  -10   20   ->  -1\r
+ddctm041 comparetotmag   00  -20   ->  -1\r
+ddctm042 comparetotmag   00  -10   ->  -1\r
+ddctm043 comparetotmag   00   00   ->   0\r
+ddctm044 comparetotmag   00   10   ->  -1\r
+ddctm045 comparetotmag   00   20   ->  -1\r
+ddctm046 comparetotmag   10  -20   ->  -1\r
+ddctm047 comparetotmag   10  -10   ->   0\r
+ddctm048 comparetotmag   10   00   ->   1\r
+ddctm049 comparetotmag   10   10   ->   0\r
+ddctm050 comparetotmag   10   20   ->  -1\r
+ddctm051 comparetotmag   20  -20   ->   0\r
+ddctm052 comparetotmag   20  -10   ->   1\r
+ddctm053 comparetotmag   20   00   ->   1\r
+ddctm055 comparetotmag   20   10   ->   1\r
+ddctm056 comparetotmag   20   20   ->   0\r
+\r
+ddctm061 comparetotmag  -2.0  -2.0   ->   0\r
+ddctm062 comparetotmag  -2.0  -1.0   ->   1\r
+ddctm063 comparetotmag  -2.0   0.0   ->   1\r
+ddctm064 comparetotmag  -2.0   1.0   ->   1\r
+ddctm065 comparetotmag  -2.0   2.0   ->   0\r
+ddctm066 comparetotmag  -1.0  -2.0   ->  -1\r
+ddctm067 comparetotmag  -1.0  -1.0   ->   0\r
+ddctm068 comparetotmag  -1.0   0.0   ->   1\r
+ddctm069 comparetotmag  -1.0   1.0   ->   0\r
+ddctm070 comparetotmag  -1.0   2.0   ->  -1\r
+ddctm071 comparetotmag   0.0  -2.0   ->  -1\r
+ddctm072 comparetotmag   0.0  -1.0   ->  -1\r
+ddctm073 comparetotmag   0.0   0.0   ->   0\r
+ddctm074 comparetotmag   0.0   1.0   ->  -1\r
+ddctm075 comparetotmag   0.0   2.0   ->  -1\r
+ddctm076 comparetotmag   1.0  -2.0   ->  -1\r
+ddctm077 comparetotmag   1.0  -1.0   ->   0\r
+ddctm078 comparetotmag   1.0   0.0   ->   1\r
+ddctm079 comparetotmag   1.0   1.0   ->   0\r
+ddctm080 comparetotmag   1.0   2.0   ->  -1\r
+ddctm081 comparetotmag   2.0  -2.0   ->   0\r
+ddctm082 comparetotmag   2.0  -1.0   ->   1\r
+ddctm083 comparetotmag   2.0   0.0   ->   1\r
+ddctm085 comparetotmag   2.0   1.0   ->   1\r
+ddctm086 comparetotmag   2.0   2.0   ->   0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+ddctm090 comparetotmag  9.99999999E+384 9.99999999E+384   ->   0\r
+ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384   ->   0\r
+ddctm092 comparetotmag  9.99999999E+384 -9.99999999E+384  ->   0\r
+ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384  ->   0\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+ddctm100 comparetotmag   7.0    7.0     ->   0\r
+ddctm101 comparetotmag   7.0    7       ->  -1\r
+ddctm102 comparetotmag   7      7.0     ->   1\r
+ddctm103 comparetotmag   7E+0   7.0     ->   1\r
+ddctm104 comparetotmag   70E-1  7.0     ->   0\r
+ddctm105 comparetotmag   0.7E+1 7       ->   0\r
+ddctm106 comparetotmag   70E-1  7       ->  -1\r
+ddctm107 comparetotmag   7.0    7E+0    ->  -1\r
+ddctm108 comparetotmag   7.0    70E-1   ->   0\r
+ddctm109 comparetotmag   7      0.7E+1  ->   0\r
+ddctm110 comparetotmag   7      70E-1   ->   1\r
+\r
+ddctm120 comparetotmag   8.0    7.0     ->   1\r
+ddctm121 comparetotmag   8.0    7       ->   1\r
+ddctm122 comparetotmag   8      7.0     ->   1\r
+ddctm123 comparetotmag   8E+0   7.0     ->   1\r
+ddctm124 comparetotmag   80E-1  7.0     ->   1\r
+ddctm125 comparetotmag   0.8E+1 7       ->   1\r
+ddctm126 comparetotmag   80E-1  7       ->   1\r
+ddctm127 comparetotmag   8.0    7E+0    ->   1\r
+ddctm128 comparetotmag   8.0    70E-1   ->   1\r
+ddctm129 comparetotmag   8      0.7E+1   ->   1\r
+ddctm130 comparetotmag   8      70E-1   ->   1\r
+\r
+ddctm140 comparetotmag   8.0    9.0     ->  -1\r
+ddctm141 comparetotmag   8.0    9       ->  -1\r
+ddctm142 comparetotmag   8      9.0     ->  -1\r
+ddctm143 comparetotmag   8E+0   9.0     ->  -1\r
+ddctm144 comparetotmag   80E-1  9.0     ->  -1\r
+ddctm145 comparetotmag   0.8E+1 9       ->  -1\r
+ddctm146 comparetotmag   80E-1  9       ->  -1\r
+ddctm147 comparetotmag   8.0    9E+0    ->  -1\r
+ddctm148 comparetotmag   8.0    90E-1   ->  -1\r
+ddctm149 comparetotmag   8      0.9E+1  ->  -1\r
+ddctm150 comparetotmag   8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes -+ ..\r
+ddctm200 comparetotmag  -7.0    7.0     ->   0\r
+ddctm201 comparetotmag  -7.0    7       ->  -1\r
+ddctm202 comparetotmag  -7      7.0     ->   1\r
+ddctm203 comparetotmag  -7E+0   7.0     ->   1\r
+ddctm204 comparetotmag  -70E-1  7.0     ->   0\r
+ddctm205 comparetotmag  -0.7E+1 7       ->   0\r
+ddctm206 comparetotmag  -70E-1  7       ->  -1\r
+ddctm207 comparetotmag  -7.0    7E+0    ->  -1\r
+ddctm208 comparetotmag  -7.0    70E-1   ->   0\r
+ddctm209 comparetotmag  -7      0.7E+1  ->   0\r
+ddctm210 comparetotmag  -7      70E-1   ->   1\r
+\r
+ddctm220 comparetotmag  -8.0    7.0     ->   1\r
+ddctm221 comparetotmag  -8.0    7       ->   1\r
+ddctm222 comparetotmag  -8      7.0     ->   1\r
+ddctm223 comparetotmag  -8E+0   7.0     ->   1\r
+ddctm224 comparetotmag  -80E-1  7.0     ->   1\r
+ddctm225 comparetotmag  -0.8E+1 7       ->   1\r
+ddctm226 comparetotmag  -80E-1  7       ->   1\r
+ddctm227 comparetotmag  -8.0    7E+0    ->   1\r
+ddctm228 comparetotmag  -8.0    70E-1   ->   1\r
+ddctm229 comparetotmag  -8      0.7E+1  ->   1\r
+ddctm230 comparetotmag  -8      70E-1   ->   1\r
+\r
+ddctm240 comparetotmag  -8.0    9.0     ->  -1\r
+ddctm241 comparetotmag  -8.0    9       ->  -1\r
+ddctm242 comparetotmag  -8      9.0     ->  -1\r
+ddctm243 comparetotmag  -8E+0   9.0     ->  -1\r
+ddctm244 comparetotmag  -80E-1  9.0     ->  -1\r
+ddctm245 comparetotmag  -0.8E+1 9       ->  -1\r
+ddctm246 comparetotmag  -80E-1  9       ->  -1\r
+ddctm247 comparetotmag  -8.0    9E+0    ->  -1\r
+ddctm248 comparetotmag  -8.0    90E-1   ->  -1\r
+ddctm249 comparetotmag  -8      0.9E+1  ->  -1\r
+ddctm250 comparetotmag  -8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes +- ..\r
+ddctm300 comparetotmag   7.0    -7.0     ->   0\r
+ddctm301 comparetotmag   7.0    -7       ->  -1\r
+ddctm302 comparetotmag   7      -7.0     ->   1\r
+ddctm303 comparetotmag   7E+0   -7.0     ->   1\r
+ddctm304 comparetotmag   70E-1  -7.0     ->   0\r
+ddctm305 comparetotmag   .7E+1  -7       ->   0\r
+ddctm306 comparetotmag   70E-1  -7       ->  -1\r
+ddctm307 comparetotmag   7.0    -7E+0    ->  -1\r
+ddctm308 comparetotmag   7.0    -70E-1   ->   0\r
+ddctm309 comparetotmag   7      -.7E+1   ->   0\r
+ddctm310 comparetotmag   7      -70E-1   ->   1\r
+\r
+ddctm320 comparetotmag   8.0    -7.0     ->   1\r
+ddctm321 comparetotmag   8.0    -7       ->   1\r
+ddctm322 comparetotmag   8      -7.0     ->   1\r
+ddctm323 comparetotmag   8E+0   -7.0     ->   1\r
+ddctm324 comparetotmag   80E-1  -7.0     ->   1\r
+ddctm325 comparetotmag   .8E+1  -7       ->   1\r
+ddctm326 comparetotmag   80E-1  -7       ->   1\r
+ddctm327 comparetotmag   8.0    -7E+0    ->   1\r
+ddctm328 comparetotmag   8.0    -70E-1   ->   1\r
+ddctm329 comparetotmag   8      -.7E+1   ->   1\r
+ddctm330 comparetotmag   8      -70E-1   ->   1\r
+\r
+ddctm340 comparetotmag   8.0    -9.0     ->  -1\r
+ddctm341 comparetotmag   8.0    -9       ->  -1\r
+ddctm342 comparetotmag   8      -9.0     ->  -1\r
+ddctm343 comparetotmag   8E+0   -9.0     ->  -1\r
+ddctm344 comparetotmag   80E-1  -9.0     ->  -1\r
+ddctm345 comparetotmag   .8E+1  -9       ->  -1\r
+ddctm346 comparetotmag   80E-1  -9       ->  -1\r
+ddctm347 comparetotmag   8.0    -9E+0    ->  -1\r
+ddctm348 comparetotmag   8.0    -90E-1   ->  -1\r
+ddctm349 comparetotmag   8      -.9E+1   ->  -1\r
+ddctm350 comparetotmag   8      -90E-1   ->  -1\r
+\r
+-- and again, with sign changes -- ..\r
+ddctm400 comparetotmag   -7.0    -7.0     ->   0\r
+ddctm401 comparetotmag   -7.0    -7       ->  -1\r
+ddctm402 comparetotmag   -7      -7.0     ->   1\r
+ddctm403 comparetotmag   -7E+0   -7.0     ->   1\r
+ddctm404 comparetotmag   -70E-1  -7.0     ->   0\r
+ddctm405 comparetotmag   -.7E+1  -7       ->   0\r
+ddctm406 comparetotmag   -70E-1  -7       ->  -1\r
+ddctm407 comparetotmag   -7.0    -7E+0    ->  -1\r
+ddctm408 comparetotmag   -7.0    -70E-1   ->   0\r
+ddctm409 comparetotmag   -7      -.7E+1   ->   0\r
+ddctm410 comparetotmag   -7      -70E-1   ->   1\r
+\r
+ddctm420 comparetotmag   -8.0    -7.0     ->   1\r
+ddctm421 comparetotmag   -8.0    -7       ->   1\r
+ddctm422 comparetotmag   -8      -7.0     ->   1\r
+ddctm423 comparetotmag   -8E+0   -7.0     ->   1\r
+ddctm424 comparetotmag   -80E-1  -7.0     ->   1\r
+ddctm425 comparetotmag   -.8E+1  -7       ->   1\r
+ddctm426 comparetotmag   -80E-1  -7       ->   1\r
+ddctm427 comparetotmag   -8.0    -7E+0    ->   1\r
+ddctm428 comparetotmag   -8.0    -70E-1   ->   1\r
+ddctm429 comparetotmag   -8      -.7E+1   ->   1\r
+ddctm430 comparetotmag   -8      -70E-1   ->   1\r
+\r
+ddctm440 comparetotmag   -8.0    -9.0     ->  -1\r
+ddctm441 comparetotmag   -8.0    -9       ->  -1\r
+ddctm442 comparetotmag   -8      -9.0     ->  -1\r
+ddctm443 comparetotmag   -8E+0   -9.0     ->  -1\r
+ddctm444 comparetotmag   -80E-1  -9.0     ->  -1\r
+ddctm445 comparetotmag   -.8E+1  -9       ->  -1\r
+ddctm446 comparetotmag   -80E-1  -9       ->  -1\r
+ddctm447 comparetotmag   -8.0    -9E+0    ->  -1\r
+ddctm448 comparetotmag   -8.0    -90E-1   ->  -1\r
+ddctm449 comparetotmag   -8      -.9E+1   ->  -1\r
+ddctm450 comparetotmag   -8      -90E-1   ->  -1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89  ->  -1\r
+ddctm474 comparetotmag 123.456000000000E+89 123.456E+89  ->  -1\r
+ddctm475 comparetotmag 123.45600000000E-89 123.456E-89  ->  -1\r
+ddctm476 comparetotmag 123.4560000000E+89 123.456E+89  ->  -1\r
+ddctm477 comparetotmag 123.456000000E-89 123.456E-89  ->  -1\r
+ddctm478 comparetotmag 123.45600000E+89 123.456E+89  ->  -1\r
+ddctm479 comparetotmag 123.4560000E-89 123.456E-89  ->  -1\r
+ddctm480 comparetotmag 123.456000E+89 123.456E+89  ->  -1\r
+ddctm481 comparetotmag 123.45600E-89 123.456E-89  ->  -1\r
+ddctm482 comparetotmag 123.4560E+89 123.456E+89  ->  -1\r
+ddctm483 comparetotmag 123.456E-89 123.456E-89  ->   0\r
+ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89  ->   1\r
+ddctm488 comparetotmag 123.456E-89 123.456000000000E-89  ->   1\r
+ddctm489 comparetotmag 123.456E+89 123.45600000000E+89  ->   1\r
+ddctm490 comparetotmag 123.456E-89 123.4560000000E-89  ->   1\r
+ddctm491 comparetotmag 123.456E+89 123.456000000E+89  ->   1\r
+ddctm492 comparetotmag 123.456E-89 123.45600000E-89  ->   1\r
+ddctm493 comparetotmag 123.456E+89 123.4560000E+89  ->   1\r
+ddctm494 comparetotmag 123.456E-89 123.456000E-89  ->   1\r
+ddctm495 comparetotmag 123.456E+89 123.45600E+89  ->   1\r
+ddctm496 comparetotmag 123.456E-89 123.4560E-89  ->   1\r
+ddctm497 comparetotmag 123.456E+89 123.456E+89  ->   0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+ddctm498 comparetotmag    1     1E-17     ->   1\r
+ddctm499 comparetotmag    1     1E-16     ->   1\r
+ddctm500 comparetotmag    1     1E-15     ->   1\r
+ddctm501 comparetotmag    1     1E-14     ->   1\r
+ddctm502 comparetotmag    1     1E-13     ->   1\r
+ddctm503 comparetotmag    1     1E-12     ->   1\r
+ddctm504 comparetotmag    1     1E-11     ->   1\r
+ddctm505 comparetotmag    1     1E-10     ->   1\r
+ddctm506 comparetotmag    1     1E-9      ->   1\r
+ddctm507 comparetotmag    1     1E-8      ->   1\r
+ddctm508 comparetotmag    1     1E-7      ->   1\r
+ddctm509 comparetotmag    1     1E-6      ->   1\r
+ddctm510 comparetotmag    1     1E-5      ->   1\r
+ddctm511 comparetotmag    1     1E-4      ->   1\r
+ddctm512 comparetotmag    1     1E-3      ->   1\r
+ddctm513 comparetotmag    1     1E-2      ->   1\r
+ddctm514 comparetotmag    1     1E-1      ->   1\r
+ddctm515 comparetotmag    1     1E-0      ->   0\r
+ddctm516 comparetotmag    1     1E+1      ->  -1\r
+ddctm517 comparetotmag    1     1E+2      ->  -1\r
+ddctm518 comparetotmag    1     1E+3      ->  -1\r
+ddctm519 comparetotmag    1     1E+4      ->  -1\r
+ddctm521 comparetotmag    1     1E+5      ->  -1\r
+ddctm522 comparetotmag    1     1E+6      ->  -1\r
+ddctm523 comparetotmag    1     1E+7      ->  -1\r
+ddctm524 comparetotmag    1     1E+8      ->  -1\r
+ddctm525 comparetotmag    1     1E+9      ->  -1\r
+ddctm526 comparetotmag    1     1E+10     ->  -1\r
+ddctm527 comparetotmag    1     1E+11     ->  -1\r
+ddctm528 comparetotmag    1     1E+12     ->  -1\r
+ddctm529 comparetotmag    1     1E+13     ->  -1\r
+ddctm530 comparetotmag    1     1E+14     ->  -1\r
+ddctm531 comparetotmag    1     1E+15     ->  -1\r
+ddctm532 comparetotmag    1     1E+16     ->  -1\r
+ddctm533 comparetotmag    1     1E+17     ->  -1\r
+-- LR swap\r
+ddctm538 comparetotmag    1E-17  1        ->  -1\r
+ddctm539 comparetotmag    1E-16  1        ->  -1\r
+ddctm540 comparetotmag    1E-15  1        ->  -1\r
+ddctm541 comparetotmag    1E-14  1        ->  -1\r
+ddctm542 comparetotmag    1E-13  1        ->  -1\r
+ddctm543 comparetotmag    1E-12  1        ->  -1\r
+ddctm544 comparetotmag    1E-11  1        ->  -1\r
+ddctm545 comparetotmag    1E-10  1        ->  -1\r
+ddctm546 comparetotmag    1E-9   1        ->  -1\r
+ddctm547 comparetotmag    1E-8   1        ->  -1\r
+ddctm548 comparetotmag    1E-7   1        ->  -1\r
+ddctm549 comparetotmag    1E-6   1        ->  -1\r
+ddctm550 comparetotmag    1E-5   1        ->  -1\r
+ddctm551 comparetotmag    1E-4   1        ->  -1\r
+ddctm552 comparetotmag    1E-3   1        ->  -1\r
+ddctm553 comparetotmag    1E-2   1        ->  -1\r
+ddctm554 comparetotmag    1E-1   1        ->  -1\r
+ddctm555 comparetotmag    1E-0   1        ->   0\r
+ddctm556 comparetotmag    1E+1   1        ->   1\r
+ddctm557 comparetotmag    1E+2   1        ->   1\r
+ddctm558 comparetotmag    1E+3   1        ->   1\r
+ddctm559 comparetotmag    1E+4   1        ->   1\r
+ddctm561 comparetotmag    1E+5   1        ->   1\r
+ddctm562 comparetotmag    1E+6   1        ->   1\r
+ddctm563 comparetotmag    1E+7   1        ->   1\r
+ddctm564 comparetotmag    1E+8   1        ->   1\r
+ddctm565 comparetotmag    1E+9   1        ->   1\r
+ddctm566 comparetotmag    1E+10  1        ->   1\r
+ddctm567 comparetotmag    1E+11  1        ->   1\r
+ddctm568 comparetotmag    1E+12  1        ->   1\r
+ddctm569 comparetotmag    1E+13  1        ->   1\r
+ddctm570 comparetotmag    1E+14  1        ->   1\r
+ddctm571 comparetotmag    1E+15  1        ->   1\r
+ddctm572 comparetotmag    1E+16  1        ->   1\r
+ddctm573 comparetotmag    1E+17  1        ->   1\r
+-- similar with a useful coefficient, one side only\r
+ddctm578 comparetotmag  0.000000987654321     1E-17     ->   1\r
+ddctm579 comparetotmag  0.000000987654321     1E-16     ->   1\r
+ddctm580 comparetotmag  0.000000987654321     1E-15     ->   1\r
+ddctm581 comparetotmag  0.000000987654321     1E-14     ->   1\r
+ddctm582 comparetotmag  0.000000987654321     1E-13     ->   1\r
+ddctm583 comparetotmag  0.000000987654321     1E-12     ->   1\r
+ddctm584 comparetotmag  0.000000987654321     1E-11     ->   1\r
+ddctm585 comparetotmag  0.000000987654321     1E-10     ->   1\r
+ddctm586 comparetotmag  0.000000987654321     1E-9      ->   1\r
+ddctm587 comparetotmag  0.000000987654321     1E-8      ->   1\r
+ddctm588 comparetotmag  0.000000987654321     1E-7      ->   1\r
+ddctm589 comparetotmag  0.000000987654321     1E-6      ->  -1\r
+ddctm590 comparetotmag  0.000000987654321     1E-5      ->  -1\r
+ddctm591 comparetotmag  0.000000987654321     1E-4      ->  -1\r
+ddctm592 comparetotmag  0.000000987654321     1E-3      ->  -1\r
+ddctm593 comparetotmag  0.000000987654321     1E-2      ->  -1\r
+ddctm594 comparetotmag  0.000000987654321     1E-1      ->  -1\r
+ddctm595 comparetotmag  0.000000987654321     1E-0      ->  -1\r
+ddctm596 comparetotmag  0.000000987654321     1E+1      ->  -1\r
+ddctm597 comparetotmag  0.000000987654321     1E+2      ->  -1\r
+ddctm598 comparetotmag  0.000000987654321     1E+3      ->  -1\r
+ddctm599 comparetotmag  0.000000987654321     1E+4      ->  -1\r
+\r
+-- check some unit-y traps\r
+ddctm600 comparetotmag   12            12.2345  ->  -1\r
+ddctm601 comparetotmag   12.0          12.2345  ->  -1\r
+ddctm602 comparetotmag   12.00         12.2345  ->  -1\r
+ddctm603 comparetotmag   12.000        12.2345  ->  -1\r
+ddctm604 comparetotmag   12.0000       12.2345  ->  -1\r
+ddctm605 comparetotmag   12.00000      12.2345  ->  -1\r
+ddctm606 comparetotmag   12.000000     12.2345  ->  -1\r
+ddctm607 comparetotmag   12.0000000    12.2345  ->  -1\r
+ddctm608 comparetotmag   12.00000000   12.2345  ->  -1\r
+ddctm609 comparetotmag   12.000000000  12.2345  ->  -1\r
+ddctm610 comparetotmag   12.1234 12             ->   1\r
+ddctm611 comparetotmag   12.1234 12.0           ->   1\r
+ddctm612 comparetotmag   12.1234 12.00          ->   1\r
+ddctm613 comparetotmag   12.1234 12.000         ->   1\r
+ddctm614 comparetotmag   12.1234 12.0000        ->   1\r
+ddctm615 comparetotmag   12.1234 12.00000       ->   1\r
+ddctm616 comparetotmag   12.1234 12.000000      ->   1\r
+ddctm617 comparetotmag   12.1234 12.0000000     ->   1\r
+ddctm618 comparetotmag   12.1234 12.00000000    ->   1\r
+ddctm619 comparetotmag   12.1234 12.000000000   ->   1\r
+ddctm620 comparetotmag  -12           -12.2345  ->  -1\r
+ddctm621 comparetotmag  -12.0         -12.2345  ->  -1\r
+ddctm622 comparetotmag  -12.00        -12.2345  ->  -1\r
+ddctm623 comparetotmag  -12.000       -12.2345  ->  -1\r
+ddctm624 comparetotmag  -12.0000      -12.2345  ->  -1\r
+ddctm625 comparetotmag  -12.00000     -12.2345  ->  -1\r
+ddctm626 comparetotmag  -12.000000    -12.2345  ->  -1\r
+ddctm627 comparetotmag  -12.0000000   -12.2345  ->  -1\r
+ddctm628 comparetotmag  -12.00000000  -12.2345  ->  -1\r
+ddctm629 comparetotmag  -12.000000000 -12.2345  ->  -1\r
+ddctm630 comparetotmag  -12.1234 -12            ->   1\r
+ddctm631 comparetotmag  -12.1234 -12.0          ->   1\r
+ddctm632 comparetotmag  -12.1234 -12.00         ->   1\r
+ddctm633 comparetotmag  -12.1234 -12.000        ->   1\r
+ddctm634 comparetotmag  -12.1234 -12.0000       ->   1\r
+ddctm635 comparetotmag  -12.1234 -12.00000      ->   1\r
+ddctm636 comparetotmag  -12.1234 -12.000000     ->   1\r
+ddctm637 comparetotmag  -12.1234 -12.0000000    ->   1\r
+ddctm638 comparetotmag  -12.1234 -12.00000000   ->   1\r
+ddctm639 comparetotmag  -12.1234 -12.000000000  ->   1\r
+\r
+-- extended zeros\r
+ddctm640 comparetotmag   0     0    ->   0\r
+ddctm641 comparetotmag   0    -0    ->   0\r
+ddctm642 comparetotmag   0    -0.0  ->   1\r
+ddctm643 comparetotmag   0     0.0  ->   1\r
+ddctm644 comparetotmag  -0     0    ->   0\r
+ddctm645 comparetotmag  -0    -0    ->   0\r
+ddctm646 comparetotmag  -0    -0.0  ->   1\r
+ddctm647 comparetotmag  -0     0.0  ->   1\r
+ddctm648 comparetotmag   0.0   0    ->  -1\r
+ddctm649 comparetotmag   0.0  -0    ->  -1\r
+ddctm650 comparetotmag   0.0  -0.0  ->   0\r
+ddctm651 comparetotmag   0.0   0.0  ->   0\r
+ddctm652 comparetotmag  -0.0   0    ->  -1\r
+ddctm653 comparetotmag  -0.0  -0    ->  -1\r
+ddctm654 comparetotmag  -0.0  -0.0  ->   0\r
+ddctm655 comparetotmag  -0.0   0.0  ->   0\r
+\r
+ddctm656 comparetotmag  -0E1   0.0  ->   1\r
+ddctm657 comparetotmag  -0E2   0.0  ->   1\r
+ddctm658 comparetotmag   0E1   0.0  ->   1\r
+ddctm659 comparetotmag   0E2   0.0  ->   1\r
+ddctm660 comparetotmag  -0E1   0    ->   1\r
+ddctm661 comparetotmag  -0E2   0    ->   1\r
+ddctm662 comparetotmag   0E1   0    ->   1\r
+ddctm663 comparetotmag   0E2   0    ->   1\r
+ddctm664 comparetotmag  -0E1  -0E1  ->   0\r
+ddctm665 comparetotmag  -0E2  -0E1  ->   1\r
+ddctm666 comparetotmag   0E1  -0E1  ->   0\r
+ddctm667 comparetotmag   0E2  -0E1  ->   1\r
+ddctm668 comparetotmag  -0E1  -0E2  ->  -1\r
+ddctm669 comparetotmag  -0E2  -0E2  ->   0\r
+ddctm670 comparetotmag   0E1  -0E2  ->  -1\r
+ddctm671 comparetotmag   0E2  -0E2  ->   0\r
+ddctm672 comparetotmag  -0E1   0E1  ->   0\r
+ddctm673 comparetotmag  -0E2   0E1  ->   1\r
+ddctm674 comparetotmag   0E1   0E1  ->   0\r
+ddctm675 comparetotmag   0E2   0E1  ->   1\r
+ddctm676 comparetotmag  -0E1   0E2  ->  -1\r
+ddctm677 comparetotmag  -0E2   0E2  ->   0\r
+ddctm678 comparetotmag   0E1   0E2  ->  -1\r
+ddctm679 comparetotmag   0E2   0E2  ->   0\r
+\r
+-- trailing zeros; unit-y\r
+ddctm680 comparetotmag   12    12            ->   0\r
+ddctm681 comparetotmag   12    12.0          ->   1\r
+ddctm682 comparetotmag   12    12.00         ->   1\r
+ddctm683 comparetotmag   12    12.000        ->   1\r
+ddctm684 comparetotmag   12    12.0000       ->   1\r
+ddctm685 comparetotmag   12    12.00000      ->   1\r
+ddctm686 comparetotmag   12    12.000000     ->   1\r
+ddctm687 comparetotmag   12    12.0000000    ->   1\r
+ddctm688 comparetotmag   12    12.00000000   ->   1\r
+ddctm689 comparetotmag   12    12.000000000  ->   1\r
+ddctm690 comparetotmag   12              12  ->   0\r
+ddctm691 comparetotmag   12.0            12  ->  -1\r
+ddctm692 comparetotmag   12.00           12  ->  -1\r
+ddctm693 comparetotmag   12.000          12  ->  -1\r
+ddctm694 comparetotmag   12.0000         12  ->  -1\r
+ddctm695 comparetotmag   12.00000        12  ->  -1\r
+ddctm696 comparetotmag   12.000000       12  ->  -1\r
+ddctm697 comparetotmag   12.0000000      12  ->  -1\r
+ddctm698 comparetotmag   12.00000000     12  ->  -1\r
+ddctm699 comparetotmag   12.000000000    12  ->  -1\r
+\r
+-- old long operand checks\r
+ddctm701 comparetotmag 12345678000  1  ->   1\r
+ddctm702 comparetotmag 1 12345678000   ->  -1\r
+ddctm703 comparetotmag 1234567800   1  ->   1\r
+ddctm704 comparetotmag 1 1234567800    ->  -1\r
+ddctm705 comparetotmag 1234567890   1  ->   1\r
+ddctm706 comparetotmag 1 1234567890    ->  -1\r
+ddctm707 comparetotmag 1234567891   1  ->   1\r
+ddctm708 comparetotmag 1 1234567891    ->  -1\r
+ddctm709 comparetotmag 12345678901  1  ->   1\r
+ddctm710 comparetotmag 1 12345678901   ->  -1\r
+ddctm711 comparetotmag 1234567896   1  ->   1\r
+ddctm712 comparetotmag 1 1234567896    ->  -1\r
+ddctm713 comparetotmag -1234567891  1  ->   1\r
+ddctm714 comparetotmag 1 -1234567891   ->  -1\r
+ddctm715 comparetotmag -12345678901 1  ->   1\r
+ddctm716 comparetotmag 1 -12345678901  ->  -1\r
+ddctm717 comparetotmag -1234567896  1  ->   1\r
+ddctm718 comparetotmag 1 -1234567896   ->  -1\r
+\r
+-- old residue cases\r
+ddctm740 comparetotmag  1  0.9999999   ->   1\r
+ddctm741 comparetotmag  1  0.999999    ->   1\r
+ddctm742 comparetotmag  1  0.99999     ->   1\r
+ddctm743 comparetotmag  1  1.0000      ->   1\r
+ddctm744 comparetotmag  1  1.00001     ->  -1\r
+ddctm745 comparetotmag  1  1.000001    ->  -1\r
+ddctm746 comparetotmag  1  1.0000001   ->  -1\r
+ddctm750 comparetotmag  0.9999999  1   ->  -1\r
+ddctm751 comparetotmag  0.999999   1   ->  -1\r
+ddctm752 comparetotmag  0.99999    1   ->  -1\r
+ddctm753 comparetotmag  1.0000     1   ->  -1\r
+ddctm754 comparetotmag  1.00001    1   ->   1\r
+ddctm755 comparetotmag  1.000001   1   ->   1\r
+ddctm756 comparetotmag  1.0000001  1   ->   1\r
+\r
+-- Specials\r
+ddctm780 comparetotmag  Inf  -Inf   ->  0\r
+ddctm781 comparetotmag  Inf  -1000  ->  1\r
+ddctm782 comparetotmag  Inf  -1     ->  1\r
+ddctm783 comparetotmag  Inf  -0     ->  1\r
+ddctm784 comparetotmag  Inf   0     ->  1\r
+ddctm785 comparetotmag  Inf   1     ->  1\r
+ddctm786 comparetotmag  Inf   1000  ->  1\r
+ddctm787 comparetotmag  Inf   Inf   ->  0\r
+ddctm788 comparetotmag -1000  Inf   -> -1\r
+ddctm789 comparetotmag -Inf   Inf   ->  0\r
+ddctm790 comparetotmag -1     Inf   -> -1\r
+ddctm791 comparetotmag -0     Inf   -> -1\r
+ddctm792 comparetotmag  0     Inf   -> -1\r
+ddctm793 comparetotmag  1     Inf   -> -1\r
+ddctm794 comparetotmag  1000  Inf   -> -1\r
+ddctm795 comparetotmag  Inf   Inf   ->  0\r
+\r
+ddctm800 comparetotmag -Inf  -Inf   ->  0\r
+ddctm801 comparetotmag -Inf  -1000  ->  1\r
+ddctm802 comparetotmag -Inf  -1     ->  1\r
+ddctm803 comparetotmag -Inf  -0     ->  1\r
+ddctm804 comparetotmag -Inf   0     ->  1\r
+ddctm805 comparetotmag -Inf   1     ->  1\r
+ddctm806 comparetotmag -Inf   1000  ->  1\r
+ddctm807 comparetotmag -Inf   Inf   ->  0\r
+ddctm808 comparetotmag -Inf  -Inf   ->  0\r
+ddctm809 comparetotmag -1000 -Inf   -> -1\r
+ddctm810 comparetotmag -1    -Inf   -> -1\r
+ddctm811 comparetotmag -0    -Inf   -> -1\r
+ddctm812 comparetotmag  0    -Inf   -> -1\r
+ddctm813 comparetotmag  1    -Inf   -> -1\r
+ddctm814 comparetotmag  1000 -Inf   -> -1\r
+ddctm815 comparetotmag  Inf  -Inf   ->  0\r
+\r
+ddctm821 comparetotmag  NaN -Inf    ->  1\r
+ddctm822 comparetotmag  NaN -1000   ->  1\r
+ddctm823 comparetotmag  NaN -1      ->  1\r
+ddctm824 comparetotmag  NaN -0      ->  1\r
+ddctm825 comparetotmag  NaN  0      ->  1\r
+ddctm826 comparetotmag  NaN  1      ->  1\r
+ddctm827 comparetotmag  NaN  1000   ->  1\r
+ddctm828 comparetotmag  NaN  Inf    ->  1\r
+ddctm829 comparetotmag  NaN  NaN    ->  0\r
+ddctm830 comparetotmag -Inf  NaN    ->  -1\r
+ddctm831 comparetotmag -1000 NaN    ->  -1\r
+ddctm832 comparetotmag -1    NaN    ->  -1\r
+ddctm833 comparetotmag -0    NaN    ->  -1\r
+ddctm834 comparetotmag  0    NaN    ->  -1\r
+ddctm835 comparetotmag  1    NaN    ->  -1\r
+ddctm836 comparetotmag  1000 NaN    ->  -1\r
+ddctm837 comparetotmag  Inf  NaN    ->  -1\r
+ddctm838 comparetotmag -NaN -NaN    ->  0\r
+ddctm839 comparetotmag +NaN -NaN    ->  0\r
+ddctm840 comparetotmag -NaN +NaN    ->  0\r
+\r
+ddctm841 comparetotmag  sNaN -sNaN  ->  0\r
+ddctm842 comparetotmag  sNaN -NaN   ->  -1\r
+ddctm843 comparetotmag  sNaN -Inf   ->  1\r
+ddctm844 comparetotmag  sNaN -1000  ->  1\r
+ddctm845 comparetotmag  sNaN -1     ->  1\r
+ddctm846 comparetotmag  sNaN -0     ->  1\r
+ddctm847 comparetotmag  sNaN  0     ->  1\r
+ddctm848 comparetotmag  sNaN  1     ->  1\r
+ddctm849 comparetotmag  sNaN  1000  ->  1\r
+ddctm850 comparetotmag  sNaN  NaN   ->  -1\r
+ddctm851 comparetotmag  sNaN sNaN   ->  0\r
+\r
+ddctm852 comparetotmag -sNaN sNaN   ->  0\r
+ddctm853 comparetotmag -NaN  sNaN   ->  1\r
+ddctm854 comparetotmag -Inf  sNaN   ->  -1\r
+ddctm855 comparetotmag -1000 sNaN   ->  -1\r
+ddctm856 comparetotmag -1    sNaN   ->  -1\r
+ddctm857 comparetotmag -0    sNaN   ->  -1\r
+ddctm858 comparetotmag  0    sNaN   ->  -1\r
+ddctm859 comparetotmag  1    sNaN   ->  -1\r
+ddctm860 comparetotmag  1000 sNaN   ->  -1\r
+ddctm861 comparetotmag  Inf  sNaN   ->  -1\r
+ddctm862 comparetotmag  NaN  sNaN   ->  1\r
+ddctm863 comparetotmag  sNaN sNaN   ->  0\r
+\r
+ddctm871 comparetotmag  -sNaN -sNaN  ->  0\r
+ddctm872 comparetotmag  -sNaN -NaN   ->  -1\r
+ddctm873 comparetotmag  -sNaN -Inf   ->  1\r
+ddctm874 comparetotmag  -sNaN -1000  ->  1\r
+ddctm875 comparetotmag  -sNaN -1     ->  1\r
+ddctm876 comparetotmag  -sNaN -0     ->  1\r
+ddctm877 comparetotmag  -sNaN  0     ->  1\r
+ddctm878 comparetotmag  -sNaN  1     ->  1\r
+ddctm879 comparetotmag  -sNaN  1000  ->  1\r
+ddctm880 comparetotmag  -sNaN  NaN   ->  -1\r
+ddctm881 comparetotmag  -sNaN sNaN   ->  0\r
+\r
+ddctm882 comparetotmag -sNaN -sNaN   ->  0\r
+ddctm883 comparetotmag -NaN  -sNaN   ->  1\r
+ddctm884 comparetotmag -Inf  -sNaN   ->  -1\r
+ddctm885 comparetotmag -1000 -sNaN   ->  -1\r
+ddctm886 comparetotmag -1    -sNaN   ->  -1\r
+ddctm887 comparetotmag -0    -sNaN   ->  -1\r
+ddctm888 comparetotmag  0    -sNaN   ->  -1\r
+ddctm889 comparetotmag  1    -sNaN   ->  -1\r
+ddctm890 comparetotmag  1000 -sNaN   ->  -1\r
+ddctm891 comparetotmag  Inf  -sNaN   ->  -1\r
+ddctm892 comparetotmag  NaN  -sNaN   ->  1\r
+ddctm893 comparetotmag  sNaN -sNaN   ->  0\r
+\r
+-- NaNs with payload\r
+ddctm960 comparetotmag  NaN9 -Inf   ->  1\r
+ddctm961 comparetotmag  NaN8  999   ->  1\r
+ddctm962 comparetotmag  NaN77 Inf   ->  1\r
+ddctm963 comparetotmag -NaN67 NaN5  ->  1\r
+ddctm964 comparetotmag -Inf  -NaN4  ->  -1\r
+ddctm965 comparetotmag -999  -NaN33 ->  -1\r
+ddctm966 comparetotmag  Inf   NaN2  ->  -1\r
+\r
+ddctm970 comparetotmag -NaN41 -NaN42 -> -1\r
+ddctm971 comparetotmag +NaN41 -NaN42 -> -1\r
+ddctm972 comparetotmag -NaN41 +NaN42 -> -1\r
+ddctm973 comparetotmag +NaN41 +NaN42 -> -1\r
+ddctm974 comparetotmag -NaN42 -NaN01 ->  1\r
+ddctm975 comparetotmag +NaN42 -NaN01 ->  1\r
+ddctm976 comparetotmag -NaN42 +NaN01 ->  1\r
+ddctm977 comparetotmag +NaN42 +NaN01 ->  1\r
+\r
+ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1\r
+ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1\r
+ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1\r
+ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1\r
+ddctm984 comparetotmag -sNaN772 -sNaN771 ->  1\r
+ddctm985 comparetotmag +sNaN772 -sNaN771 ->  1\r
+ddctm986 comparetotmag -sNaN772 +sNaN771 ->  1\r
+ddctm987 comparetotmag +sNaN772 +sNaN771 ->  1\r
+\r
+ddctm991 comparetotmag -sNaN99 -Inf    ->  1\r
+ddctm992 comparetotmag  sNaN98 -11     ->  1\r
+ddctm993 comparetotmag  sNaN97  NaN    -> -1\r
+ddctm994 comparetotmag  sNaN16 sNaN94  -> -1\r
+ddctm995 comparetotmag  NaN85  sNaN83  ->  1\r
+ddctm996 comparetotmag -Inf    sNaN92  -> -1\r
+ddctm997 comparetotmag  088    sNaN81  -> -1\r
+ddctm998 comparetotmag  Inf    sNaN90  -> -1\r
+ddctm999 comparetotmag  NaN   -sNaN89  ->  1\r
+\r
+-- spread zeros\r
+ddctm1110 comparetotmag   0E-383  0        ->  -1\r
+ddctm1111 comparetotmag   0E-383 -0        ->  -1\r
+ddctm1112 comparetotmag  -0E-383  0        ->  -1\r
+ddctm1113 comparetotmag  -0E-383 -0        ->  -1\r
+ddctm1114 comparetotmag   0E-383  0E+384   ->  -1\r
+ddctm1115 comparetotmag   0E-383 -0E+384   ->  -1\r
+ddctm1116 comparetotmag  -0E-383  0E+384   ->  -1\r
+ddctm1117 comparetotmag  -0E-383 -0E+384   ->  -1\r
+ddctm1118 comparetotmag   0       0E+384   ->  -1\r
+ddctm1119 comparetotmag   0      -0E+384   ->  -1\r
+ddctm1120 comparetotmag  -0       0E+384   ->  -1\r
+ddctm1121 comparetotmag  -0      -0E+384   ->  -1\r
+\r
+ddctm1130 comparetotmag   0E+384  0        ->   1\r
+ddctm1131 comparetotmag   0E+384 -0        ->   1\r
+ddctm1132 comparetotmag  -0E+384  0        ->   1\r
+ddctm1133 comparetotmag  -0E+384 -0        ->   1\r
+ddctm1134 comparetotmag   0E+384  0E-383   ->   1\r
+ddctm1135 comparetotmag   0E+384 -0E-383   ->   1\r
+ddctm1136 comparetotmag  -0E+384  0E-383   ->   1\r
+ddctm1137 comparetotmag  -0E+384 -0E-383   ->   1\r
+ddctm1138 comparetotmag   0       0E-383   ->   1\r
+ddctm1139 comparetotmag   0      -0E-383   ->   1\r
+ddctm1140 comparetotmag  -0       0E-383   ->   1\r
+ddctm1141 comparetotmag  -0      -0E-383   ->   1\r
+\r
+-- Null tests\r
+ddctm9990 comparetotmag 10  # -> NaN Invalid_operation\r
+ddctm9991 comparetotmag  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddCopy.decTest b/Lib/test/decimaltestdata/ddCopy.decTest
new file mode 100644 (file)
index 0000000..49c6824
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- ddCopy.decTest -- quiet decDouble copy                             --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddcpy001 copy       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+ddcpy011 copy  Infinity    -> Infinity\r
+ddcpy012 copy  -Infinity   -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddcpy021 copy         NaN  -> NaN\r
+ddcpy022 copy        -NaN  -> -NaN\r
+ddcpy023 copy        sNaN  -> sNaN\r
+ddcpy024 copy       -sNaN  -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+ddcpy031 copy       NaN10  -> NaN10\r
+ddcpy032 copy      -NaN10  -> -NaN10\r
+ddcpy033 copy      sNaN10  -> sNaN10\r
+ddcpy034 copy     -sNaN10  -> -sNaN10\r
+ddcpy035 copy       NaN7   -> NaN7\r
+ddcpy036 copy      -NaN7   -> -NaN7\r
+ddcpy037 copy      sNaN101 -> sNaN101\r
+ddcpy038 copy     -sNaN101 -> -sNaN101\r
+\r
+-- finites\r
+ddcpy101 copy          7   -> 7\r
+ddcpy102 copy         -7   -> -7\r
+ddcpy103 copy         75   -> 75\r
+ddcpy104 copy        -75   -> -75\r
+ddcpy105 copy       7.50   -> 7.50\r
+ddcpy106 copy      -7.50   -> -7.50\r
+ddcpy107 copy       7.500  -> 7.500\r
+ddcpy108 copy      -7.500  -> -7.500\r
+\r
+-- zeros\r
+ddcpy111 copy          0   -> 0\r
+ddcpy112 copy         -0   -> -0\r
+ddcpy113 copy       0E+4   -> 0E+4\r
+ddcpy114 copy      -0E+4   -> -0E+4\r
+ddcpy115 copy     0.0000   -> 0.0000\r
+ddcpy116 copy    -0.0000   -> -0.0000\r
+ddcpy117 copy      0E-141  -> 0E-141\r
+ddcpy118 copy     -0E-141  -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddcpy121 copy  2682682682682682         -> 2682682682682682\r
+ddcpy122 copy  -2682682682682682        -> -2682682682682682\r
+ddcpy123 copy  1341341341341341         -> 1341341341341341\r
+ddcpy124 copy  -1341341341341341        -> -1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddcpy131 copy  9.999999999999999E+384   -> 9.999999999999999E+384\r
+ddcpy132 copy  1E-383                   -> 1E-383\r
+ddcpy133 copy  1.000000000000000E-383   -> 1.000000000000000E-383\r
+ddcpy134 copy  1E-398                   -> 1E-398\r
+\r
+ddcpy135 copy  -1E-398                  -> -1E-398\r
+ddcpy136 copy  -1.000000000000000E-383  -> -1.000000000000000E-383\r
+ddcpy137 copy  -1E-383                  -> -1E-383\r
+ddcpy138 copy  -9.999999999999999E+384  -> -9.999999999999999E+384\r
diff --git a/Lib/test/decimaltestdata/ddCopyAbs.decTest b/Lib/test/decimaltestdata/ddCopyAbs.decTest
new file mode 100644 (file)
index 0000000..b65f063
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddcpa001 copyabs       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+ddcpa011 copyabs  Infinity    -> Infinity\r
+ddcpa012 copyabs  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddcpa021 copyabs         NaN  -> NaN\r
+ddcpa022 copyabs        -NaN  -> NaN\r
+ddcpa023 copyabs        sNaN  -> sNaN\r
+ddcpa024 copyabs       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+ddcpa031 copyabs       NaN10  -> NaN10\r
+ddcpa032 copyabs      -NaN15  -> NaN15\r
+ddcpa033 copyabs      sNaN15  -> sNaN15\r
+ddcpa034 copyabs     -sNaN10  -> sNaN10\r
+ddcpa035 copyabs       NaN7   -> NaN7\r
+ddcpa036 copyabs      -NaN7   -> NaN7\r
+ddcpa037 copyabs      sNaN101 -> sNaN101\r
+ddcpa038 copyabs     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+ddcpa101 copyabs          7   -> 7\r
+ddcpa102 copyabs         -7   -> 7\r
+ddcpa103 copyabs         75   -> 75\r
+ddcpa104 copyabs        -75   -> 75\r
+ddcpa105 copyabs       7.10   -> 7.10\r
+ddcpa106 copyabs      -7.10   -> 7.10\r
+ddcpa107 copyabs       7.500  -> 7.500\r
+ddcpa108 copyabs      -7.500  -> 7.500\r
+\r
+-- zeros\r
+ddcpa111 copyabs          0   -> 0\r
+ddcpa112 copyabs         -0   -> 0\r
+ddcpa113 copyabs       0E+6   -> 0E+6\r
+ddcpa114 copyabs      -0E+6   -> 0E+6\r
+ddcpa115 copyabs     0.0000   -> 0.0000\r
+ddcpa116 copyabs    -0.0000   -> 0.0000\r
+ddcpa117 copyabs      0E-141  -> 0E-141\r
+ddcpa118 copyabs     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddcpa121 copyabs  2682682682682682         -> 2682682682682682\r
+ddcpa122 copyabs  -2682682682682682        -> 2682682682682682\r
+ddcpa123 copyabs  1341341341341341         -> 1341341341341341\r
+ddcpa124 copyabs  -1341341341341341        -> 1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddcpa131 copyabs  9.999999999999999E+384   -> 9.999999999999999E+384\r
+ddcpa132 copyabs  1E-383                   -> 1E-383\r
+ddcpa133 copyabs  1.000000000000000E-383   -> 1.000000000000000E-383\r
+ddcpa134 copyabs  1E-398                   -> 1E-398\r
+\r
+ddcpa135 copyabs  -1E-398                  -> 1E-398\r
+ddcpa136 copyabs  -1.000000000000000E-383  -> 1.000000000000000E-383\r
+ddcpa137 copyabs  -1E-383                  -> 1E-383\r
+ddcpa138 copyabs  -9.999999999999999E+384  -> 9.999999999999999E+384\r
diff --git a/Lib/test/decimaltestdata/ddCopyNegate.decTest b/Lib/test/decimaltestdata/ddCopyNegate.decTest
new file mode 100644 (file)
index 0000000..b111c9b
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- ddCopyNegate.decTest -- quiet decDouble copy and negate            --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddcpn001 copynegate       +7.50  -> -7.50\r
+\r
+-- Infinities\r
+ddcpn011 copynegate  Infinity    -> -Infinity\r
+ddcpn012 copynegate  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddcpn021 copynegate         NaN  -> -NaN\r
+ddcpn022 copynegate        -NaN  -> NaN\r
+ddcpn023 copynegate        sNaN  -> -sNaN\r
+ddcpn024 copynegate       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+ddcpn031 copynegate       NaN13  -> -NaN13\r
+ddcpn032 copynegate      -NaN13  -> NaN13\r
+ddcpn033 copynegate      sNaN13  -> -sNaN13\r
+ddcpn034 copynegate     -sNaN13  -> sNaN13\r
+ddcpn035 copynegate       NaN70  -> -NaN70\r
+ddcpn036 copynegate      -NaN70  -> NaN70\r
+ddcpn037 copynegate      sNaN101 -> -sNaN101\r
+ddcpn038 copynegate     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+ddcpn101 copynegate          7   -> -7\r
+ddcpn102 copynegate         -7   -> 7\r
+ddcpn103 copynegate         75   -> -75\r
+ddcpn104 copynegate        -75   -> 75\r
+ddcpn105 copynegate       7.50   -> -7.50\r
+ddcpn106 copynegate      -7.50   -> 7.50\r
+ddcpn107 copynegate       7.500  -> -7.500\r
+ddcpn108 copynegate      -7.500  -> 7.500\r
+\r
+-- zeros\r
+ddcpn111 copynegate          0   -> -0\r
+ddcpn112 copynegate         -0   -> 0\r
+ddcpn113 copynegate       0E+4   -> -0E+4\r
+ddcpn114 copynegate      -0E+4   -> 0E+4\r
+ddcpn115 copynegate     0.0000   -> -0.0000\r
+ddcpn116 copynegate    -0.0000   -> 0.0000\r
+ddcpn117 copynegate      0E-141  -> -0E-141\r
+ddcpn118 copynegate     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddcpn121 copynegate  2682682682682682         -> -2682682682682682\r
+ddcpn122 copynegate  -2682682682682682        -> 2682682682682682\r
+ddcpn123 copynegate  1341341341341341         -> -1341341341341341\r
+ddcpn124 copynegate  -1341341341341341        -> 1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddcpn131 copynegate  9.999999999999999E+384   -> -9.999999999999999E+384\r
+ddcpn132 copynegate  1E-383                   -> -1E-383\r
+ddcpn133 copynegate  1.000000000000000E-383   -> -1.000000000000000E-383\r
+ddcpn134 copynegate  1E-398                   -> -1E-398\r
+\r
+ddcpn135 copynegate  -1E-398                  -> 1E-398\r
+ddcpn136 copynegate  -1.000000000000000E-383  -> 1.000000000000000E-383\r
+ddcpn137 copynegate  -1E-383                  -> 1E-383\r
+ddcpn138 copynegate  -9.999999999999999E+384  -> 9.999999999999999E+384\r
diff --git a/Lib/test/decimaltestdata/ddCopySign.decTest b/Lib/test/decimaltestdata/ddCopySign.decTest
new file mode 100644 (file)
index 0000000..7c83416
--- /dev/null
@@ -0,0 +1,175 @@
+------------------------------------------------------------------------\r
+-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs      --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddcps001 copysign       +7.50     11 -> 7.50\r
+\r
+-- Infinities\r
+ddcps011 copysign  Infinity       11 -> Infinity\r
+ddcps012 copysign  -Infinity      11 -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddcps021 copysign         NaN     11 -> NaN\r
+ddcps022 copysign        -NaN     11 -> NaN\r
+ddcps023 copysign        sNaN     11 -> sNaN\r
+ddcps024 copysign       -sNaN     11 -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+ddcps031 copysign       NaN10     11 -> NaN10\r
+ddcps032 copysign      -NaN10     11 -> NaN10\r
+ddcps033 copysign      sNaN10     11 -> sNaN10\r
+ddcps034 copysign     -sNaN10     11 -> sNaN10\r
+ddcps035 copysign       NaN7      11 -> NaN7\r
+ddcps036 copysign      -NaN7      11 -> NaN7\r
+ddcps037 copysign      sNaN101    11 -> sNaN101\r
+ddcps038 copysign     -sNaN101    11 -> sNaN101\r
+\r
+-- finites\r
+ddcps101 copysign          7      11 -> 7\r
+ddcps102 copysign         -7      11 -> 7\r
+ddcps103 copysign         75      11 -> 75\r
+ddcps104 copysign        -75      11 -> 75\r
+ddcps105 copysign       7.50      11 -> 7.50\r
+ddcps106 copysign      -7.50      11 -> 7.50\r
+ddcps107 copysign       7.500     11 -> 7.500\r
+ddcps108 copysign      -7.500     11 -> 7.500\r
+\r
+-- zeros\r
+ddcps111 copysign          0      11 -> 0\r
+ddcps112 copysign         -0      11 -> 0\r
+ddcps113 copysign       0E+4      11 -> 0E+4\r
+ddcps114 copysign      -0E+4      11 -> 0E+4\r
+ddcps115 copysign     0.0000      11 -> 0.0000\r
+ddcps116 copysign    -0.0000      11 -> 0.0000\r
+ddcps117 copysign      0E-141     11 -> 0E-141\r
+ddcps118 copysign     -0E-141     11 -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddcps121 copysign  2682682682682682            11 -> 2682682682682682\r
+ddcps122 copysign  -2682682682682682           11 -> 2682682682682682\r
+ddcps123 copysign  1341341341341341            11 -> 1341341341341341\r
+ddcps124 copysign  -1341341341341341           11 -> 1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddcps131 copysign  9.999999999999999E+384      11 -> 9.999999999999999E+384\r
+ddcps132 copysign  1E-383                      11 -> 1E-383\r
+ddcps133 copysign  1.000000000000000E-383      11 -> 1.000000000000000E-383\r
+ddcps134 copysign  1E-398                      11 -> 1E-398\r
+\r
+ddcps135 copysign  -1E-398                     11 -> 1E-398\r
+ddcps136 copysign  -1.000000000000000E-383     11 -> 1.000000000000000E-383\r
+ddcps137 copysign  -1E-383                     11 -> 1E-383\r
+ddcps138 copysign  -9.999999999999999E+384     11 -> 9.999999999999999E+384\r
+\r
+-- repeat with negative RHS\r
+\r
+-- Infinities\r
+ddcps211 copysign  Infinity       -34 -> -Infinity\r
+ddcps212 copysign  -Infinity      -34 -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddcps221 copysign         NaN     -34 -> -NaN\r
+ddcps222 copysign        -NaN     -34 -> -NaN\r
+ddcps223 copysign        sNaN     -34 -> -sNaN\r
+ddcps224 copysign       -sNaN     -34 -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+ddcps231 copysign       NaN10     -34 -> -NaN10\r
+ddcps232 copysign      -NaN10     -34 -> -NaN10\r
+ddcps233 copysign      sNaN10     -34 -> -sNaN10\r
+ddcps234 copysign     -sNaN10     -34 -> -sNaN10\r
+ddcps235 copysign       NaN7      -34 -> -NaN7\r
+ddcps236 copysign      -NaN7      -34 -> -NaN7\r
+ddcps237 copysign      sNaN101    -34 -> -sNaN101\r
+ddcps238 copysign     -sNaN101    -34 -> -sNaN101\r
+\r
+-- finites\r
+ddcps301 copysign          7      -34 -> -7\r
+ddcps302 copysign         -7      -34 -> -7\r
+ddcps303 copysign         75      -34 -> -75\r
+ddcps304 copysign        -75      -34 -> -75\r
+ddcps305 copysign       7.50      -34 -> -7.50\r
+ddcps306 copysign      -7.50      -34 -> -7.50\r
+ddcps307 copysign       7.500     -34 -> -7.500\r
+ddcps308 copysign      -7.500     -34 -> -7.500\r
+\r
+-- zeros\r
+ddcps311 copysign          0      -34 -> -0\r
+ddcps312 copysign         -0      -34 -> -0\r
+ddcps313 copysign       0E+4      -34 -> -0E+4\r
+ddcps314 copysign      -0E+4      -34 -> -0E+4\r
+ddcps315 copysign     0.0000      -34 -> -0.0000\r
+ddcps316 copysign    -0.0000      -34 -> -0.0000\r
+ddcps317 copysign      0E-141     -34 -> -0E-141\r
+ddcps318 copysign     -0E-141     -34 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddcps321 copysign  2682682682682682            -34 -> -2682682682682682\r
+ddcps322 copysign  -2682682682682682           -34 -> -2682682682682682\r
+ddcps323 copysign  1341341341341341            -34 -> -1341341341341341\r
+ddcps324 copysign  -1341341341341341           -34 -> -1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddcps331 copysign  9.999999999999999E+384      -34 -> -9.999999999999999E+384\r
+ddcps332 copysign  1E-383                      -34 -> -1E-383\r
+ddcps333 copysign  1.000000000000000E-383      -34 -> -1.000000000000000E-383\r
+ddcps334 copysign  1E-398                      -34 -> -1E-398\r
+\r
+ddcps335 copysign  -1E-398                     -34 -> -1E-398\r
+ddcps336 copysign  -1.000000000000000E-383     -34 -> -1.000000000000000E-383\r
+ddcps337 copysign  -1E-383                     -34 -> -1E-383\r
+ddcps338 copysign  -9.999999999999999E+384     -34 -> -9.999999999999999E+384\r
+\r
+-- Other kinds of RHS\r
+ddcps401 copysign          701    -34 -> -701\r
+ddcps402 copysign         -720    -34 -> -720\r
+ddcps403 copysign          701    -0  -> -701\r
+ddcps404 copysign         -720    -0  -> -720\r
+ddcps405 copysign          701    +0  ->  701\r
+ddcps406 copysign         -720    +0  ->  720\r
+ddcps407 copysign          701    +34 ->  701\r
+ddcps408 copysign         -720    +34 ->  720\r
+\r
+ddcps413 copysign          701    -Inf  -> -701\r
+ddcps414 copysign         -720    -Inf  -> -720\r
+ddcps415 copysign          701    +Inf  ->  701\r
+ddcps416 copysign         -720    +Inf  ->  720\r
+\r
+ddcps420 copysign          701    -NaN  -> -701\r
+ddcps421 copysign         -720    -NaN  -> -720\r
+ddcps422 copysign          701    +NaN  ->  701\r
+ddcps423 copysign         -720    +NaN  ->  720\r
+ddcps425 copysign         -720    +NaN8 ->  720\r
+\r
+ddcps426 copysign          701    -sNaN  -> -701\r
+ddcps427 copysign         -720    -sNaN  -> -720\r
+ddcps428 copysign          701    +sNaN  ->  701\r
+ddcps429 copysign         -720    +sNaN  ->  720\r
+ddcps430 copysign         -720    +sNaN3 ->  720\r
+\r
diff --git a/Lib/test/decimaltestdata/ddDivide.decTest b/Lib/test/decimaltestdata/ddDivide.decTest
new file mode 100644 (file)
index 0000000..1a953f7
--- /dev/null
@@ -0,0 +1,854 @@
+------------------------------------------------------------------------\r
+-- ddDivide.decTest -- decDouble division                             --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dddiv001 divide  1     1    ->  1\r
+dddiv002 divide  2     1    ->  2\r
+dddiv003 divide  1     2    ->  0.5\r
+dddiv004 divide  2     2    ->  1\r
+dddiv005 divide  0     1    ->  0\r
+dddiv006 divide  0     2    ->  0\r
+dddiv007 divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv008 divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv009 divide  3     3    ->  1\r
+\r
+dddiv010 divide  2.4   1    ->  2.4\r
+dddiv011 divide  2.4   -1   ->  -2.4\r
+dddiv012 divide  -2.4  1    ->  -2.4\r
+dddiv013 divide  -2.4  -1   ->  2.4\r
+dddiv014 divide  2.40  1    ->  2.40\r
+dddiv015 divide  2.400 1    ->  2.400\r
+dddiv016 divide  2.4   2    ->  1.2\r
+dddiv017 divide  2.400 2    ->  1.200\r
+dddiv018 divide  2.    2    ->  1\r
+dddiv019 divide  20    20   ->  1\r
+\r
+dddiv020 divide  187   187    ->  1\r
+dddiv021 divide  5     2      ->  2.5\r
+dddiv022 divide  50    20     ->  2.5\r
+dddiv023 divide  500   200    ->  2.5\r
+dddiv024 divide  50.0  20.0   ->  2.5\r
+dddiv025 divide  5.00  2.00   ->  2.5\r
+dddiv026 divide  5     2.0    ->  2.5\r
+dddiv027 divide  5     2.000  ->  2.5\r
+dddiv028 divide  5     0.20   ->  25\r
+dddiv029 divide  5     0.200  ->  25\r
+dddiv030 divide  10    1      ->  10\r
+dddiv031 divide  100   1      ->  100\r
+dddiv032 divide  1000  1      ->  1000\r
+dddiv033 divide  1000  100    ->  10\r
+\r
+dddiv035 divide  1     2      ->  0.5\r
+dddiv036 divide  1     4      ->  0.25\r
+dddiv037 divide  1     8      ->  0.125\r
+dddiv038 divide  1     16     ->  0.0625\r
+dddiv039 divide  1     32     ->  0.03125\r
+dddiv040 divide  1     64     ->  0.015625\r
+dddiv041 divide  1    -2      ->  -0.5\r
+dddiv042 divide  1    -4      ->  -0.25\r
+dddiv043 divide  1    -8      ->  -0.125\r
+dddiv044 divide  1    -16     ->  -0.0625\r
+dddiv045 divide  1    -32     ->  -0.03125\r
+dddiv046 divide  1    -64     ->  -0.015625\r
+dddiv047 divide -1     2      ->  -0.5\r
+dddiv048 divide -1     4      ->  -0.25\r
+dddiv049 divide -1     8      ->  -0.125\r
+dddiv050 divide -1     16     ->  -0.0625\r
+dddiv051 divide -1     32     ->  -0.03125\r
+dddiv052 divide -1     64     ->  -0.015625\r
+dddiv053 divide -1    -2      ->  0.5\r
+dddiv054 divide -1    -4      ->  0.25\r
+dddiv055 divide -1    -8      ->  0.125\r
+dddiv056 divide -1    -16     ->  0.0625\r
+dddiv057 divide -1    -32     ->  0.03125\r
+dddiv058 divide -1    -64     ->  0.015625\r
+\r
+-- bcdTime\r
+dddiv060 divide  1 7                   -> 0.1428571428571429 Inexact Rounded\r
+dddiv061 divide 1.2345678  1.9876543   -> 0.6211179680490717 Inexact Rounded\r
+\r
+--               1234567890123456\r
+dddiv071 divide  9999999999999999 1  ->  9999999999999999\r
+dddiv072 divide  999999999999999  1  ->  999999999999999\r
+dddiv073 divide  99999999999999   1  ->  99999999999999\r
+dddiv074 divide  9999999999999    1  ->  9999999999999\r
+dddiv075 divide  999999999999     1  ->  999999999999\r
+dddiv076 divide  99999999999      1  ->  99999999999\r
+dddiv077 divide  9999999999       1  ->  9999999999\r
+dddiv078 divide  999999999        1  ->  999999999\r
+dddiv079 divide  99999999         1  ->  99999999\r
+dddiv080 divide  9999999          1  ->  9999999\r
+dddiv081 divide  999999           1  ->  999999\r
+dddiv082 divide  99999            1  ->  99999\r
+dddiv083 divide  9999             1  ->  9999\r
+dddiv084 divide  999              1  ->  999\r
+dddiv085 divide  99               1  ->  99\r
+dddiv086 divide  9                1  ->  9\r
+\r
+dddiv090 divide  0.            1    ->  0\r
+dddiv091 divide  .0            1    ->  0.0\r
+dddiv092 divide  0.00          1    ->  0.00\r
+dddiv093 divide  0.00E+9       1    ->  0E+7\r
+dddiv094 divide  0.0000E-50    1    ->  0E-54\r
+\r
+dddiv095 divide  1            1E-8  ->  1E+8\r
+dddiv096 divide  1            1E-9  ->  1E+9\r
+dddiv097 divide  1            1E-10 ->  1E+10\r
+dddiv098 divide  1            1E-11 ->  1E+11\r
+dddiv099 divide  1            1E-12 ->  1E+12\r
+\r
+dddiv100 divide  1  1   -> 1\r
+dddiv101 divide  1  2   -> 0.5\r
+dddiv102 divide  1  3   -> 0.3333333333333333 Inexact Rounded\r
+dddiv103 divide  1  4   -> 0.25\r
+dddiv104 divide  1  5   -> 0.2\r
+dddiv105 divide  1  6   -> 0.1666666666666667 Inexact Rounded\r
+dddiv106 divide  1  7   -> 0.1428571428571429 Inexact Rounded\r
+dddiv107 divide  1  8   -> 0.125\r
+dddiv108 divide  1  9   -> 0.1111111111111111 Inexact Rounded\r
+dddiv109 divide  1  10  -> 0.1\r
+dddiv110 divide  1  1   -> 1\r
+dddiv111 divide  2  1   -> 2\r
+dddiv112 divide  3  1   -> 3\r
+dddiv113 divide  4  1   -> 4\r
+dddiv114 divide  5  1   -> 5\r
+dddiv115 divide  6  1   -> 6\r
+dddiv116 divide  7  1   -> 7\r
+dddiv117 divide  8  1   -> 8\r
+dddiv118 divide  9  1   -> 9\r
+dddiv119 divide  10 1   -> 10\r
+\r
+dddiv120 divide  3E+1 0.001  -> 3E+4\r
+dddiv121 divide  2.200 2     -> 1.100\r
+\r
+dddiv130 divide  12345  4.999  ->  2469.493898779756    Inexact Rounded\r
+dddiv131 divide  12345  4.99   ->  2473.947895791583    Inexact Rounded\r
+dddiv132 divide  12345  4.9    ->  2519.387755102041    Inexact Rounded\r
+dddiv133 divide  12345  5      ->  2469\r
+dddiv134 divide  12345  5.1    ->  2420.588235294118    Inexact Rounded\r
+dddiv135 divide  12345  5.01   ->  2464.071856287425    Inexact Rounded\r
+dddiv136 divide  12345  5.001  ->  2468.506298740252    Inexact Rounded\r
+\r
+-- test possibly imprecise results\r
+dddiv220 divide 391   597 ->  0.6549413735343384  Inexact Rounded\r
+dddiv221 divide 391  -597 -> -0.6549413735343384  Inexact Rounded\r
+dddiv222 divide -391  597 -> -0.6549413735343384  Inexact Rounded\r
+dddiv223 divide -391 -597 ->  0.6549413735343384  Inexact Rounded\r
+\r
+-- test some cases that are close to exponent overflow\r
+dddiv270 divide 1 1e384                  -> 1E-384                 Subnormal\r
+dddiv271 divide 1 0.9e384                -> 1.11111111111111E-384  Rounded Inexact Subnormal Underflow\r
+dddiv272 divide 1 0.99e384               -> 1.01010101010101E-384  Rounded Inexact Subnormal Underflow\r
+dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384  Rounded Inexact Subnormal Underflow\r
+dddiv274 divide 9e384    1               -> 9.000000000000000E+384 Clamped\r
+dddiv275 divide 9.9e384  1               -> 9.900000000000000E+384 Clamped\r
+dddiv276 divide 9.99e384 1               -> 9.990000000000000E+384 Clamped\r
+dddiv277 divide 9.999999999999999e384 1  -> 9.999999999999999E+384\r
+\r
+-- Divide into 0 tests\r
+dddiv301 divide    0    7     -> 0\r
+dddiv302 divide    0    7E-5  -> 0E+5\r
+dddiv303 divide    0    7E-1  -> 0E+1\r
+dddiv304 divide    0    7E+1  -> 0.0\r
+dddiv305 divide    0    7E+5  -> 0.00000\r
+dddiv306 divide    0    7E+6  -> 0.000000\r
+dddiv307 divide    0    7E+7  -> 0E-7\r
+dddiv308 divide    0   70E-5  -> 0E+5\r
+dddiv309 divide    0   70E-1  -> 0E+1\r
+dddiv310 divide    0   70E+0  -> 0\r
+dddiv311 divide    0   70E+1  -> 0.0\r
+dddiv312 divide    0   70E+5  -> 0.00000\r
+dddiv313 divide    0   70E+6  -> 0.000000\r
+dddiv314 divide    0   70E+7  -> 0E-7\r
+dddiv315 divide    0  700E-5  -> 0E+5\r
+dddiv316 divide    0  700E-1  -> 0E+1\r
+dddiv317 divide    0  700E+0  -> 0\r
+dddiv318 divide    0  700E+1  -> 0.0\r
+dddiv319 divide    0  700E+5  -> 0.00000\r
+dddiv320 divide    0  700E+6  -> 0.000000\r
+dddiv321 divide    0  700E+7  -> 0E-7\r
+dddiv322 divide    0  700E+77 -> 0E-77\r
+\r
+dddiv331 divide 0E-3    7E-5  -> 0E+2\r
+dddiv332 divide 0E-3    7E-1  -> 0.00\r
+dddiv333 divide 0E-3    7E+1  -> 0.0000\r
+dddiv334 divide 0E-3    7E+5  -> 0E-8\r
+dddiv335 divide 0E-1    7E-5  -> 0E+4\r
+dddiv336 divide 0E-1    7E-1  -> 0\r
+dddiv337 divide 0E-1    7E+1  -> 0.00\r
+dddiv338 divide 0E-1    7E+5  -> 0.000000\r
+dddiv339 divide 0E+1    7E-5  -> 0E+6\r
+dddiv340 divide 0E+1    7E-1  -> 0E+2\r
+dddiv341 divide 0E+1    7E+1  -> 0\r
+dddiv342 divide 0E+1    7E+5  -> 0.0000\r
+dddiv343 divide 0E+3    7E-5  -> 0E+8\r
+dddiv344 divide 0E+3    7E-1  -> 0E+4\r
+dddiv345 divide 0E+3    7E+1  -> 0E+2\r
+dddiv346 divide 0E+3    7E+5  -> 0.00\r
+\r
+-- These were 'input rounding'\r
+dddiv441 divide 12345678000 1 -> 12345678000\r
+dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded\r
+dddiv443 divide 1234567800  1 -> 1234567800\r
+dddiv444 divide 1 1234567800  -> 8.100000664200054E-10 Inexact Rounded\r
+dddiv445 divide 1234567890  1 -> 1234567890\r
+dddiv446 divide 1 1234567890  -> 8.100000073710001E-10 Inexact Rounded\r
+dddiv447 divide 1234567891  1 -> 1234567891\r
+dddiv448 divide 1 1234567891  -> 8.100000067149001E-10 Inexact Rounded\r
+dddiv449 divide 12345678901 1 -> 12345678901\r
+dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded\r
+dddiv451 divide 1234567896  1 -> 1234567896\r
+dddiv452 divide 1 1234567896  -> 8.100000034344000E-10 Inexact Rounded\r
+\r
+-- high-lows\r
+dddiv453 divide 1e+1   1    ->   1E+1\r
+dddiv454 divide 1e+1   1.0  ->   1E+1\r
+dddiv455 divide 1e+1   1.00 ->   1E+1\r
+dddiv456 divide 1e+2   2    ->   5E+1\r
+dddiv457 divide 1e+2   2.0  ->   5E+1\r
+dddiv458 divide 1e+2   2.00 ->   5E+1\r
+\r
+-- some from IEEE discussions\r
+dddiv460 divide 3e0      2e0     -> 1.5\r
+dddiv461 divide 30e-1    2e0     -> 1.5\r
+dddiv462 divide 300e-2   2e0     -> 1.50\r
+dddiv464 divide 3000e-3  2e0     -> 1.500\r
+dddiv465 divide 3e0      20e-1   -> 1.5\r
+dddiv466 divide 30e-1    20e-1   -> 1.5\r
+dddiv467 divide 300e-2   20e-1   -> 1.5\r
+dddiv468 divide 3000e-3  20e-1   -> 1.50\r
+dddiv469 divide 3e0      200e-2  -> 1.5\r
+dddiv470 divide 30e-1    200e-2  -> 1.5\r
+dddiv471 divide 300e-2   200e-2  -> 1.5\r
+dddiv472 divide 3000e-3  200e-2  -> 1.5\r
+dddiv473 divide 3e0      2000e-3 -> 1.5\r
+dddiv474 divide 30e-1    2000e-3 -> 1.5\r
+dddiv475 divide 300e-2   2000e-3 -> 1.5\r
+dddiv476 divide 3000e-3  2000e-3 -> 1.5\r
+\r
+-- some reciprocals\r
+dddiv480 divide 1        1.0E+33 -> 1E-33\r
+dddiv481 divide 1        10E+33  -> 1E-34\r
+dddiv482 divide 1        1.0E-33 -> 1E+33\r
+dddiv483 divide 1        10E-33  -> 1E+32\r
+\r
+-- RMS discussion table\r
+dddiv484 divide 0e5     1e3 ->   0E+2\r
+dddiv485 divide 0e5     2e3 ->   0E+2\r
+dddiv486 divide 0e5    10e2 ->   0E+3\r
+dddiv487 divide 0e5    20e2 ->   0E+3\r
+dddiv488 divide 0e5   100e1 ->   0E+4\r
+dddiv489 divide 0e5   200e1 ->   0E+4\r
+\r
+dddiv491 divide 1e5     1e3 ->   1E+2\r
+dddiv492 divide 1e5     2e3 ->   5E+1\r
+dddiv493 divide 1e5    10e2 ->   1E+2\r
+dddiv494 divide 1e5    20e2 ->   5E+1\r
+dddiv495 divide 1e5   100e1 ->   1E+2\r
+dddiv496 divide 1e5   200e1 ->   5E+1\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+dddiv497  divide  0E+380 1000E-13  -> 0E+369 Clamped\r
+dddiv498  divide  0E-390 1000E+13  -> 0E-398 Clamped\r
+\r
+rounding:    half_up\r
+\r
+-- focus on trailing zeros issues\r
+dddiv500 divide  1      9.9    ->  0.1010101010101010  Inexact Rounded\r
+dddiv501 divide  1      9.09   ->  0.1100110011001100  Inexact Rounded\r
+dddiv502 divide  1      9.009  ->  0.1110001110001110  Inexact Rounded\r
+\r
+dddiv511 divide 1         2    -> 0.5\r
+dddiv512 divide 1.0       2    -> 0.5\r
+dddiv513 divide 1.00      2    -> 0.50\r
+dddiv514 divide 1.000     2    -> 0.500\r
+dddiv515 divide 1.0000    2    -> 0.5000\r
+dddiv516 divide 1.00000   2    -> 0.50000\r
+dddiv517 divide 1.000000  2    -> 0.500000\r
+dddiv518 divide 1.0000000 2    -> 0.5000000\r
+dddiv519 divide 1.00      2.00 -> 0.5\r
+\r
+dddiv521 divide 2    1         -> 2\r
+dddiv522 divide 2    1.0       -> 2\r
+dddiv523 divide 2    1.00      -> 2\r
+dddiv524 divide 2    1.000     -> 2\r
+dddiv525 divide 2    1.0000    -> 2\r
+dddiv526 divide 2    1.00000   -> 2\r
+dddiv527 divide 2    1.000000  -> 2\r
+dddiv528 divide 2    1.0000000 -> 2\r
+dddiv529 divide 2.00 1.00      -> 2\r
+\r
+dddiv530 divide  2.40   2      ->  1.20\r
+dddiv531 divide  2.40   4      ->  0.60\r
+dddiv532 divide  2.40  10      ->  0.24\r
+dddiv533 divide  2.40   2.0    ->  1.2\r
+dddiv534 divide  2.40   4.0    ->  0.6\r
+dddiv535 divide  2.40  10.0    ->  0.24\r
+dddiv536 divide  2.40   2.00   ->  1.2\r
+dddiv537 divide  2.40   4.00   ->  0.6\r
+dddiv538 divide  2.40  10.00   ->  0.24\r
+dddiv539 divide  0.9    0.1    ->  9\r
+dddiv540 divide  0.9    0.01   ->  9E+1\r
+dddiv541 divide  0.9    0.001  ->  9E+2\r
+dddiv542 divide  5      2      ->  2.5\r
+dddiv543 divide  5      2.0    ->  2.5\r
+dddiv544 divide  5      2.00   ->  2.5\r
+dddiv545 divide  5      20     ->  0.25\r
+dddiv546 divide  5      20.0   ->  0.25\r
+dddiv547 divide  2.400  2      ->  1.200\r
+dddiv548 divide  2.400  2.0    ->  1.20\r
+dddiv549 divide  2.400  2.400  ->  1\r
+\r
+dddiv550 divide  240    1      ->  240\r
+dddiv551 divide  240    10     ->  24\r
+dddiv552 divide  240    100    ->  2.4\r
+dddiv553 divide  240    1000   ->  0.24\r
+dddiv554 divide  2400   1      ->  2400\r
+dddiv555 divide  2400   10     ->  240\r
+dddiv556 divide  2400   100    ->  24\r
+dddiv557 divide  2400   1000   ->  2.4\r
+\r
+-- +ve exponent\r
+dddiv600 divide  2.4E+9     2  ->  1.2E+9\r
+dddiv601 divide  2.40E+9    2  ->  1.20E+9\r
+dddiv602 divide  2.400E+9   2  ->  1.200E+9\r
+dddiv603 divide  2.4000E+9  2  ->  1.2000E+9\r
+dddiv604 divide  24E+8      2  ->  1.2E+9\r
+dddiv605 divide  240E+7     2  ->  1.20E+9\r
+dddiv606 divide  2400E+6    2  ->  1.200E+9\r
+dddiv607 divide  24000E+5   2  ->  1.2000E+9\r
+\r
+-- more zeros, etc.\r
+dddiv731 divide 5.00 1E-3    -> 5.00E+3\r
+dddiv732 divide 00.00 0.000  -> NaN Division_undefined\r
+dddiv733 divide 00.00 0E-3   -> NaN Division_undefined\r
+dddiv734 divide  0    -0     -> NaN Division_undefined\r
+dddiv735 divide -0     0     -> NaN Division_undefined\r
+dddiv736 divide -0    -0     -> NaN Division_undefined\r
+\r
+dddiv741 divide  0    -1     -> -0\r
+dddiv742 divide -0    -1     ->  0\r
+dddiv743 divide  0     1     ->  0\r
+dddiv744 divide -0     1     -> -0\r
+dddiv745 divide -1     0     -> -Infinity Division_by_zero\r
+dddiv746 divide -1    -0     ->  Infinity Division_by_zero\r
+dddiv747 divide  1     0     ->  Infinity Division_by_zero\r
+dddiv748 divide  1    -0     -> -Infinity Division_by_zero\r
+\r
+dddiv751 divide  0.0  -1     -> -0.0\r
+dddiv752 divide -0.0  -1     ->  0.0\r
+dddiv753 divide  0.0   1     ->  0.0\r
+dddiv754 divide -0.0   1     -> -0.0\r
+dddiv755 divide -1.0   0     -> -Infinity Division_by_zero\r
+dddiv756 divide -1.0  -0     ->  Infinity Division_by_zero\r
+dddiv757 divide  1.0   0     ->  Infinity Division_by_zero\r
+dddiv758 divide  1.0  -0     -> -Infinity Division_by_zero\r
+\r
+dddiv761 divide  0    -1.0   -> -0E+1\r
+dddiv762 divide -0    -1.0   ->  0E+1\r
+dddiv763 divide  0     1.0   ->  0E+1\r
+dddiv764 divide -0     1.0   -> -0E+1\r
+dddiv765 divide -1     0.0   -> -Infinity Division_by_zero\r
+dddiv766 divide -1    -0.0   ->  Infinity Division_by_zero\r
+dddiv767 divide  1     0.0   ->  Infinity Division_by_zero\r
+dddiv768 divide  1    -0.0   -> -Infinity Division_by_zero\r
+\r
+dddiv771 divide  0.0  -1.0   -> -0\r
+dddiv772 divide -0.0  -1.0   ->  0\r
+dddiv773 divide  0.0   1.0   ->  0\r
+dddiv774 divide -0.0   1.0   -> -0\r
+dddiv775 divide -1.0   0.0   -> -Infinity Division_by_zero\r
+dddiv776 divide -1.0  -0.0   ->  Infinity Division_by_zero\r
+dddiv777 divide  1.0   0.0   ->  Infinity Division_by_zero\r
+dddiv778 divide  1.0  -0.0   -> -Infinity Division_by_zero\r
+\r
+-- Specials\r
+dddiv780 divide  Inf  -Inf   ->  NaN Invalid_operation\r
+dddiv781 divide  Inf  -1000  -> -Infinity\r
+dddiv782 divide  Inf  -1     -> -Infinity\r
+dddiv783 divide  Inf  -0     -> -Infinity\r
+dddiv784 divide  Inf   0     ->  Infinity\r
+dddiv785 divide  Inf   1     ->  Infinity\r
+dddiv786 divide  Inf   1000  ->  Infinity\r
+dddiv787 divide  Inf   Inf   ->  NaN Invalid_operation\r
+dddiv788 divide -1000  Inf   -> -0E-398 Clamped\r
+dddiv789 divide -Inf   Inf   ->  NaN Invalid_operation\r
+dddiv790 divide -1     Inf   -> -0E-398 Clamped\r
+dddiv791 divide -0     Inf   -> -0E-398 Clamped\r
+dddiv792 divide  0     Inf   ->  0E-398 Clamped\r
+dddiv793 divide  1     Inf   ->  0E-398 Clamped\r
+dddiv794 divide  1000  Inf   ->  0E-398 Clamped\r
+dddiv795 divide  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dddiv800 divide -Inf  -Inf   ->  NaN Invalid_operation\r
+dddiv801 divide -Inf  -1000  ->  Infinity\r
+dddiv802 divide -Inf  -1     ->  Infinity\r
+dddiv803 divide -Inf  -0     ->  Infinity\r
+dddiv804 divide -Inf   0     -> -Infinity\r
+dddiv805 divide -Inf   1     -> -Infinity\r
+dddiv806 divide -Inf   1000  -> -Infinity\r
+dddiv807 divide -Inf   Inf   ->  NaN Invalid_operation\r
+dddiv808 divide -1000  Inf   -> -0E-398 Clamped\r
+dddiv809 divide -Inf  -Inf   ->  NaN Invalid_operation\r
+dddiv810 divide -1    -Inf   ->  0E-398 Clamped\r
+dddiv811 divide -0    -Inf   ->  0E-398 Clamped\r
+dddiv812 divide  0    -Inf   -> -0E-398 Clamped\r
+dddiv813 divide  1    -Inf   -> -0E-398 Clamped\r
+dddiv814 divide  1000 -Inf   -> -0E-398 Clamped\r
+dddiv815 divide  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dddiv821 divide  NaN -Inf    ->  NaN\r
+dddiv822 divide  NaN -1000   ->  NaN\r
+dddiv823 divide  NaN -1      ->  NaN\r
+dddiv824 divide  NaN -0      ->  NaN\r
+dddiv825 divide  NaN  0      ->  NaN\r
+dddiv826 divide  NaN  1      ->  NaN\r
+dddiv827 divide  NaN  1000   ->  NaN\r
+dddiv828 divide  NaN  Inf    ->  NaN\r
+dddiv829 divide  NaN  NaN    ->  NaN\r
+dddiv830 divide -Inf  NaN    ->  NaN\r
+dddiv831 divide -1000 NaN    ->  NaN\r
+dddiv832 divide -1    NaN    ->  NaN\r
+dddiv833 divide -0    NaN    ->  NaN\r
+dddiv834 divide  0    NaN    ->  NaN\r
+dddiv835 divide  1    NaN    ->  NaN\r
+dddiv836 divide  1000 NaN    ->  NaN\r
+dddiv837 divide  Inf  NaN    ->  NaN\r
+\r
+dddiv841 divide  sNaN -Inf   ->  NaN  Invalid_operation\r
+dddiv842 divide  sNaN -1000  ->  NaN  Invalid_operation\r
+dddiv843 divide  sNaN -1     ->  NaN  Invalid_operation\r
+dddiv844 divide  sNaN -0     ->  NaN  Invalid_operation\r
+dddiv845 divide  sNaN  0     ->  NaN  Invalid_operation\r
+dddiv846 divide  sNaN  1     ->  NaN  Invalid_operation\r
+dddiv847 divide  sNaN  1000  ->  NaN  Invalid_operation\r
+dddiv848 divide  sNaN  NaN   ->  NaN  Invalid_operation\r
+dddiv849 divide  sNaN sNaN   ->  NaN  Invalid_operation\r
+dddiv850 divide  NaN  sNaN   ->  NaN  Invalid_operation\r
+dddiv851 divide -Inf  sNaN   ->  NaN  Invalid_operation\r
+dddiv852 divide -1000 sNaN   ->  NaN  Invalid_operation\r
+dddiv853 divide -1    sNaN   ->  NaN  Invalid_operation\r
+dddiv854 divide -0    sNaN   ->  NaN  Invalid_operation\r
+dddiv855 divide  0    sNaN   ->  NaN  Invalid_operation\r
+dddiv856 divide  1    sNaN   ->  NaN  Invalid_operation\r
+dddiv857 divide  1000 sNaN   ->  NaN  Invalid_operation\r
+dddiv858 divide  Inf  sNaN   ->  NaN  Invalid_operation\r
+dddiv859 divide  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dddiv861 divide  NaN9 -Inf   ->  NaN9\r
+dddiv862 divide  NaN8  1000  ->  NaN8\r
+dddiv863 divide  NaN7  Inf   ->  NaN7\r
+dddiv864 divide  NaN6  NaN5  ->  NaN6\r
+dddiv865 divide -Inf   NaN4  ->  NaN4\r
+dddiv866 divide -1000  NaN3  ->  NaN3\r
+dddiv867 divide  Inf   NaN2  ->  NaN2\r
+\r
+dddiv871 divide  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dddiv872 divide  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dddiv873 divide  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dddiv874 divide  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dddiv875 divide  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dddiv876 divide -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dddiv877 divide  0      sNaN91  ->  NaN91 Invalid_operation\r
+dddiv878 divide  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dddiv879 divide  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+dddiv881 divide  -NaN9  -Inf   ->  -NaN9\r
+dddiv882 divide  -NaN8   1000  ->  -NaN8\r
+dddiv883 divide  -NaN7   Inf   ->  -NaN7\r
+dddiv884 divide  -NaN6  -NaN5  ->  -NaN6\r
+dddiv885 divide  -Inf   -NaN4  ->  -NaN4\r
+dddiv886 divide  -1000  -NaN3  ->  -NaN3\r
+dddiv887 divide   Inf   -NaN2  ->  -NaN2\r
+\r
+dddiv891 divide -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dddiv892 divide -sNaN98 -1      -> -NaN98 Invalid_operation\r
+dddiv893 divide -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation\r
+dddiv895 divide -NaN95  -sNaN93 -> -NaN93 Invalid_operation\r
+dddiv896 divide -Inf    -sNaN92 -> -NaN92 Invalid_operation\r
+dddiv897 divide  0      -sNaN91 -> -NaN91 Invalid_operation\r
+dddiv898 divide  Inf    -sNaN90 -> -NaN90 Invalid_operation\r
+dddiv899 divide -NaN    -sNaN89 -> -NaN89 Invalid_operation\r
+\r
+-- Various flavours of divide by 0\r
+dddiv901 divide    0       0   ->  NaN Division_undefined\r
+dddiv902 divide    0.0E5   0   ->  NaN Division_undefined\r
+dddiv903 divide    0.000   0   ->  NaN Division_undefined\r
+dddiv904 divide    0.0001  0   ->  Infinity Division_by_zero\r
+dddiv905 divide    0.01    0   ->  Infinity Division_by_zero\r
+dddiv906 divide    0.1     0   ->  Infinity Division_by_zero\r
+dddiv907 divide    1       0   ->  Infinity Division_by_zero\r
+dddiv908 divide    1       0.0 ->  Infinity Division_by_zero\r
+dddiv909 divide   10       0.0 ->  Infinity Division_by_zero\r
+dddiv910 divide   1E+100   0.0 ->  Infinity Division_by_zero\r
+dddiv911 divide   1E+100   0   ->  Infinity Division_by_zero\r
+\r
+dddiv921 divide   -0.0001  0   -> -Infinity Division_by_zero\r
+dddiv922 divide   -0.01    0   -> -Infinity Division_by_zero\r
+dddiv923 divide   -0.1     0   -> -Infinity Division_by_zero\r
+dddiv924 divide   -1       0   -> -Infinity Division_by_zero\r
+dddiv925 divide   -1       0.0 -> -Infinity Division_by_zero\r
+dddiv926 divide  -10       0.0 -> -Infinity Division_by_zero\r
+dddiv927 divide  -1E+100   0.0 -> -Infinity Division_by_zero\r
+dddiv928 divide  -1E+100   0   -> -Infinity Division_by_zero\r
+\r
+dddiv931 divide    0.0001 -0   -> -Infinity Division_by_zero\r
+dddiv932 divide    0.01   -0   -> -Infinity Division_by_zero\r
+dddiv933 divide    0.1    -0   -> -Infinity Division_by_zero\r
+dddiv934 divide    1      -0   -> -Infinity Division_by_zero\r
+dddiv935 divide    1      -0.0 -> -Infinity Division_by_zero\r
+dddiv936 divide   10      -0.0 -> -Infinity Division_by_zero\r
+dddiv937 divide   1E+100  -0.0 -> -Infinity Division_by_zero\r
+dddiv938 divide   1E+100  -0   -> -Infinity Division_by_zero\r
+\r
+dddiv941 divide   -0.0001 -0   ->  Infinity Division_by_zero\r
+dddiv942 divide   -0.01   -0   ->  Infinity Division_by_zero\r
+dddiv943 divide   -0.1    -0   ->  Infinity Division_by_zero\r
+dddiv944 divide   -1      -0   ->  Infinity Division_by_zero\r
+dddiv945 divide   -1      -0.0 ->  Infinity Division_by_zero\r
+dddiv946 divide  -10      -0.0 ->  Infinity Division_by_zero\r
+dddiv947 divide  -1E+100  -0.0 ->  Infinity Division_by_zero\r
+dddiv948 divide  -1E+100  -0   ->  Infinity Division_by_zero\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+dddiv1021  divide 1E0          1E0 -> 1\r
+dddiv1022  divide 1E0          2E0 -> 0.5\r
+dddiv1023  divide 1E0          3E0 -> 0.3333333333333333 Inexact Rounded\r
+dddiv1024  divide 100E-2   1000E-3 -> 1\r
+dddiv1025  divide 24E-1        2E0 -> 1.2\r
+dddiv1026  divide 2400E-3      2E0 -> 1.200\r
+dddiv1027  divide 5E0          2E0 -> 2.5\r
+dddiv1028  divide 5E0        20E-1 -> 2.5\r
+dddiv1029  divide 5E0      2000E-3 -> 2.5\r
+dddiv1030  divide 5E0         2E-1 -> 25\r
+dddiv1031  divide 5E0        20E-2 -> 25\r
+dddiv1032  divide 480E-2       3E0 -> 1.60\r
+dddiv1033  divide 47E-1        2E0 -> 2.35\r
+\r
+-- ECMAScript bad examples\r
+rounding:    half_down\r
+dddiv1040  divide 5 9  -> 0.5555555555555556 Inexact Rounded\r
+rounding:    half_even\r
+dddiv1041  divide 6 11 -> 0.5454545454545455 Inexact Rounded\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+dddiv1051 divide  1e+277  1e-311 ->  Infinity Overflow Inexact Rounded\r
+dddiv1052 divide  1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded\r
+dddiv1053 divide -1e+277  1e-311 -> -Infinity Overflow Inexact Rounded\r
+dddiv1054 divide -1e+277 -1e-311 ->  Infinity Overflow Inexact Rounded\r
+dddiv1055 divide  1e-277  1e+311 ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1056 divide  1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1057 divide -1e-277  1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1058 divide -1e-277 -1e+311 ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal\r
+dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal\r
+dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal\r
+dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal\r
+dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal\r
+dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal\r
+dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal\r
+dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381  Clamped\r
+dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382  Clamped\r
+dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383  Clamped\r
+dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384  Clamped\r
+dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded\r
+dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded\r
+dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded\r
+dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded\r
+dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded\r
+dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded\r
+\r
+dddiv1101 divide  1.0000E-394  1     -> 1.0000E-394 Subnormal\r
+dddiv1102 divide  1.000E-394   1e+1  -> 1.000E-395  Subnormal\r
+dddiv1103 divide  1.00E-394    1e+2  -> 1.00E-396   Subnormal\r
+dddiv1104 divide  1.0E-394     1e+3  -> 1.0E-397    Subnormal\r
+dddiv1105 divide  1.0E-394     1e+4  -> 1E-398     Subnormal Rounded\r
+dddiv1106 divide  1.3E-394     1e+4  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1107 divide  1.5E-394     1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1108 divide  1.7E-394     1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1109 divide  2.3E-394     1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1110 divide  2.5E-394     1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1111 divide  2.7E-394     1e+4  -> 3E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1112 divide  1.49E-394    1e+4  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1113 divide  1.50E-394    1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1114 divide  1.51E-394    1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1115 divide  2.49E-394    1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1116 divide  2.50E-394    1e+4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1117 divide  2.51E-394    1e+4  -> 3E-398     Underflow Subnormal Inexact Rounded\r
+\r
+dddiv1118 divide  1E-394       1e+4  -> 1E-398     Subnormal\r
+dddiv1119 divide  3E-394       1e+5  -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1120 divide  5E-394       1e+5  -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1121 divide  7E-394       1e+5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1122 divide  9E-394       1e+5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+dddiv1123 divide  9.9E-394     1e+5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+\r
+dddiv1124 divide  1E-394      -1e+4  -> -1E-398    Subnormal\r
+dddiv1125 divide  3E-394      -1e+5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1126 divide -5E-394       1e+5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1127 divide  7E-394      -1e+5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+dddiv1128 divide -9E-394       1e+5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+dddiv1129 divide  9.9E-394    -1e+5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+dddiv1130 divide  3.0E-394    -1e+5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dddiv1131 divide  1.0E-199     1e+200 -> 0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+dddiv1132 divide  1.0E-199     1e+199 -> 1E-398    Subnormal Rounded\r
+dddiv1133 divide  1.0E-199     1e+198 -> 1.0E-397  Subnormal\r
+dddiv1134 divide  2.0E-199     2e+198 -> 1.0E-397  Subnormal\r
+dddiv1135 divide  4.0E-199     4e+198 -> 1.0E-397  Subnormal\r
+dddiv1136 divide 10.0E-199    10e+198 -> 1.0E-397  Subnormal\r
+dddiv1137 divide 30.0E-199    30e+198 -> 1.0E-397  Subnormal\r
+\r
+-- randoms\r
+dddiv2010  divide  -3.303226714900711E-35   8.796578842713183E+73   ->  -3.755126594058783E-109 Inexact Rounded\r
+dddiv2011  divide   933153327821073.6       68782181090246.25       ->   13.56678885475763 Inexact Rounded\r
+dddiv2012  divide   5.04752436057906E-72   -8.179481771238642E+64   ->  -6.170958627632835E-137 Inexact Rounded\r
+dddiv2013  divide  -3707613309582318        3394911196503.048       ->  -1092.109070010836 Inexact Rounded\r
+dddiv2014  divide   99689.0555190461       -4.735208553891464       ->  -21052.72753765411 Inexact Rounded\r
+dddiv2015  divide  -1447915775613329        269750797.8184875       ->  -5367605.164925653 Inexact Rounded\r
+dddiv2016  divide  -9.394881304225258E-19  -830585.0252671636       ->   1.131116143251358E-24 Inexact Rounded\r
+dddiv2017  divide  -1.056283432738934       88.58754555124013       ->  -0.01192361100159352 Inexact Rounded\r
+dddiv2018  divide   5763220933343.081       689089567025052.1       ->   0.008363529516524456 Inexact Rounded\r
+dddiv2019  divide   873819.122103216        9.740612494523300E-49   ->   8.970884763093948E+53 Inexact Rounded\r
+dddiv2020  divide   8022914.838533576       6178.566801742713       ->   1298.507420243583 Inexact Rounded\r
+dddiv2021  divide   203982.7605650363      -2158.283639053435       ->  -94.51156320422168 Inexact Rounded\r
+dddiv2022  divide   803.6310547013030       7101143795399.238       ->   1.131692411611166E-10 Inexact Rounded\r
+dddiv2023  divide   9.251697842123399E-82  -1.342350220606119E-7    ->  -6.892163982321936E-75 Inexact Rounded\r
+dddiv2024  divide  -1.980600645637992E-53  -5.474262753214457E+77   ->   3.618022617703168E-131 Inexact Rounded\r
+dddiv2025  divide  -210.0322996351690      -8.580951835872843E+80   ->   2.447657365434971E-79 Inexact Rounded\r
+dddiv2026  divide  -1.821980314020370E+85  -3.018915267138165       ->   6.035215144503042E+84 Inexact Rounded\r
+dddiv2027  divide  -772264503601.1047       5.158258271408988E-86   ->  -1.497141986630614E+97 Inexact Rounded\r
+dddiv2028  divide  -767.0532415847106       2.700027228028939E-59   ->  -2.840909282772941E+61 Inexact Rounded\r
+dddiv2029  divide   496724.8548250093       7.32700588163100E+66    ->   6.779370220929013E-62 Inexact Rounded\r
+dddiv2030  divide  -304232651447703.9      -108.9730808657440       ->   2791814721862.565 Inexact Rounded\r
+dddiv2031  divide  -7.233817192699405E+42  -5711302004.149411       ->   1.266579352211430E+33 Inexact Rounded\r
+dddiv2032  divide  -9.999221444912745E+96   4010569406446197        ->  -2.493217404202250E+81 Inexact Rounded\r
+dddiv2033  divide  -1837272.061937622       8.356322838066762       ->  -219866.0939196882 Inexact Rounded\r
+dddiv2034  divide   2168.517555606529       209.1910258615061       ->   10.36620737756784 Inexact Rounded\r
+dddiv2035  divide  -1.884389790576371E+88   2.95181953870583E+20    ->  -6.383824505079828E+67 Inexact Rounded\r
+dddiv2036  divide   732263.6037438196       961222.3634446889       ->   0.7618045850698269 Inexact Rounded\r
+dddiv2037  divide  -813461419.0348336       5.376293753809143E+84   ->  -1.513052404285927E-76 Inexact Rounded\r
+dddiv2038  divide  -45562133508108.50      -9.776843494690107E+51   ->   4.660208945029519E-39 Inexact Rounded\r
+dddiv2039  divide  -6.489393172441016E+80  -9101965.097852113       ->   7.129661674897421E+73 Inexact Rounded\r
+dddiv2040  divide   3.694576237117349E+93   6683512.012622003       ->   5.527896456443912E+86 Inexact Rounded\r
+dddiv2041  divide  -2.252877726403272E+19  -7451913256.181367       ->   3023220546.125531 Inexact Rounded\r
+dddiv2042  divide   518303.1989111842       50.01587020474133       ->   10362.77479107123 Inexact Rounded\r
+dddiv2043  divide   2.902087881880103E+24   33.32400992305702       ->   8.708699488989578E+22 Inexact Rounded\r
+dddiv2044  divide   549619.4559510557       1660824845196338        ->   3.309316196351104E-10 Inexact Rounded\r
+dddiv2045  divide  -6775670774684043        8292152023.077262       ->  -817118.4941891062 Inexact Rounded\r
+dddiv2046  divide  -77.50923921524079      -5.636882655425815E+74   ->   1.375037302588405E-73 Inexact Rounded\r
+dddiv2047  divide  -2.984889459605149E-10  -88106156784122.99       ->   3.387833005721384E-24 Inexact Rounded\r
+dddiv2048  divide   0.949517293997085       44767115.96450998       ->   2.121015110175589E-8 Inexact Rounded\r
+dddiv2049  divide  -2760937211.084521      -1087015876975408        ->   0.000002539923537057024 Inexact Rounded\r
+dddiv2050  divide   28438351.85030536      -4.209397904088624E-47   ->  -6.755919135770688E+53 Inexact Rounded\r
+dddiv2051  divide  -85562731.6820956       -7.166045442530185E+45   ->   1.194002080621542E-38 Inexact Rounded\r
+dddiv2052  divide   2533802852165.25        7154.119606235955       ->   354173957.3317501 Inexact Rounded\r
+dddiv2053  divide  -8858831346851.474       97.59734208801716       ->  -90769186509.83577 Inexact Rounded\r
+dddiv2054  divide   176783629801387.5       840073263.3109817       ->   210438.3480848206 Inexact Rounded\r
+dddiv2055  divide  -493506471796175.6       79733894790822.03       ->  -6.189418854940746 Inexact Rounded\r
+dddiv2056  divide   790.1682542103445       829.9449370367435       ->   0.9520731062371214 Inexact Rounded\r
+dddiv2057  divide  -8920459838.583164      -4767.889187899214       ->   1870945.294035581 Inexact Rounded\r
+dddiv2058  divide   53536687164422.1        53137.5007032689        ->   1007512330.385698 Inexact Rounded\r
+dddiv2059  divide   4.051532311146561E-74  -2.343089768972261E+94   ->  -1.729140882606332E-168 Inexact Rounded\r
+dddiv2060  divide  -14847758778636.88       3.062543516383807E-43   ->  -4.848178874587497E+55 Inexact Rounded\r
+\r
+-- Division probably has pre-rounding, so need to test rounding\r
+-- explicitly rather than assume included through other tests;\r
+-- tests include simple rounding and also the tricky cases of sticky\r
+-- bits following two zeros\r
+--\r
+--   1/99999 gives 0.0000100001000010000100001000010000100001\r
+--                       1234567890123456\r
+--\r
+--   1/999999 gives 0.000001000001000001000001000001000001000001\r
+--                         1234567890123456\r
+\r
+rounding: ceiling\r
+dddiv3001  divide  1     3    ->  0.3333333333333334 Inexact Rounded\r
+dddiv3002  divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv3003  divide  1 99999    ->  0.00001000010000100002  Inexact Rounded\r
+dddiv3004  divide  1 999999   ->  0.000001000001000001001 Inexact Rounded\r
+\r
+rounding: floor\r
+dddiv3011  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3012  divide  2     3    ->  0.6666666666666666 Inexact Rounded\r
+dddiv3013  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3014  divide  1 999999   ->  0.000001000001000001000 Inexact Rounded\r
+\r
+rounding: up\r
+dddiv3021  divide  1     3    ->  0.3333333333333334 Inexact Rounded\r
+dddiv3022  divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv3023  divide  1 99999    ->  0.00001000010000100002  Inexact Rounded\r
+dddiv3024  divide  1 999999   ->  0.000001000001000001001 Inexact Rounded\r
+\r
+rounding: down\r
+dddiv3031  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3032  divide  2     3    ->  0.6666666666666666 Inexact Rounded\r
+dddiv3033  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3034  divide  1 999999   ->  0.000001000001000001000 Inexact Rounded\r
+\r
+rounding: half_up\r
+dddiv3041  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3042  divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv3043  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3044  divide  1 999999   ->  0.000001000001000001000 Inexact Rounded\r
+\r
+rounding: half_down\r
+dddiv3051  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3052  divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv3053  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3054  divide  1 999999   ->  0.000001000001000001000 Inexact Rounded\r
+\r
+rounding: half_even\r
+dddiv3061  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3062  divide  2     3    ->  0.6666666666666667 Inexact Rounded\r
+dddiv3063  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3064  divide  1 999999   ->  0.000001000001000001000 Inexact Rounded\r
+\r
+rounding: 05up\r
+dddiv3071  divide  1     3    ->  0.3333333333333333 Inexact Rounded\r
+dddiv3072  divide  2     3    ->  0.6666666666666666 Inexact Rounded\r
+dddiv3073  divide  1 99999    ->  0.00001000010000100001  Inexact Rounded\r
+dddiv3074  divide  1 999999   ->  0.000001000001000001001 Inexact Rounded\r
+\r
+-- random divide tests with result near 1\r
+rounding: half_even\r
+dddiv4001 divide  3195385192916917   3195385192946695  ->  0.9999999999906809  Inexact Rounded\r
+dddiv4002 divide  1393723067526993   1393723067519475  ->  1.000000000005394  Inexact Rounded\r
+dddiv4003 divide   759985543702302    759985543674015  ->  1.000000000037220  Inexact Rounded\r
+dddiv4004 divide  9579158456027302   9579158456036864  ->  0.9999999999990018  Inexact Rounded\r
+dddiv4005 divide  7079398299143569   7079398299156904  ->  0.9999999999981164  Inexact Rounded\r
+dddiv4006 divide  6636169255366598   6636169255336386  ->  1.000000000004553  Inexact Rounded\r
+dddiv4007 divide  6964813971340090   6964813971321554  ->  1.000000000002661  Inexact Rounded\r
+dddiv4008 divide  4182275225480784   4182275225454009  ->  1.000000000006402  Inexact Rounded\r
+dddiv4009 divide  9228325124938029   9228325124918730  ->  1.000000000002091  Inexact Rounded\r
+dddiv4010 divide  3428346338630192   3428346338609843  ->  1.000000000005936  Inexact Rounded\r
+dddiv4011 divide  2143511550722893   2143511550751754  ->  0.9999999999865356  Inexact Rounded\r
+dddiv4012 divide  1672732924396785   1672732924401811  ->  0.9999999999969953  Inexact Rounded\r
+dddiv4013 divide  4190714611948216   4190714611948664  ->  0.9999999999998931  Inexact Rounded\r
+dddiv4014 divide  3942254800848877   3942254800814556  ->  1.000000000008706  Inexact Rounded\r
+dddiv4015 divide  2854459826952334   2854459826960762  ->  0.9999999999970474  Inexact Rounded\r
+dddiv4016 divide  2853258953664731   2853258953684471  ->  0.9999999999930816  Inexact Rounded\r
+dddiv4017 divide  9453512638125978   9453512638146425  ->  0.9999999999978371  Inexact Rounded\r
+dddiv4018 divide   339476633940369    339476633912887  ->  1.000000000080954  Inexact Rounded\r
+dddiv4019 divide  4542181492688467   4542181492697735  ->  0.9999999999979596  Inexact Rounded\r
+dddiv4020 divide  7312600192399197   7312600192395424  ->  1.000000000000516  Inexact Rounded\r
+dddiv4021 divide  1811674985570111   1811674985603935  ->  0.9999999999813300  Inexact Rounded\r
+dddiv4022 divide  1706462639003481   1706462639017740  ->  0.9999999999916441  Inexact Rounded\r
+dddiv4023 divide  6697052654940368   6697052654934110  ->  1.000000000000934  Inexact Rounded\r
+dddiv4024 divide  5015283664277539   5015283664310719  ->  0.9999999999933842  Inexact Rounded\r
+dddiv4025 divide  2359501561537464   2359501561502464  ->  1.000000000014834  Inexact Rounded\r
+dddiv4026 divide  2669850227909157   2669850227901548  ->  1.000000000002850  Inexact Rounded\r
+dddiv4027 divide  9329725546974648   9329725547002445  ->  0.9999999999970206  Inexact Rounded\r
+dddiv4028 divide  3228562867071248   3228562867106206  ->  0.9999999999891723  Inexact Rounded\r
+dddiv4029 divide  4862226644921175   4862226644909380  ->  1.000000000002426  Inexact Rounded\r
+dddiv4030 divide  1022267997054529   1022267997071329  ->  0.9999999999835660  Inexact Rounded\r
+dddiv4031 divide  1048777482023719   1048777482000948  ->  1.000000000021712  Inexact Rounded\r
+dddiv4032 divide  9980113777337098   9980113777330539  ->  1.000000000000657  Inexact Rounded\r
+dddiv4033 divide  7506839167963908   7506839167942901  ->  1.000000000002798  Inexact Rounded\r
+dddiv4034 divide   231119751977860    231119751962453  ->  1.000000000066662  Inexact Rounded\r
+dddiv4035 divide  4034903664762962   4034903664795526  ->  0.9999999999919294  Inexact Rounded\r
+dddiv4036 divide  5700122152274696   5700122152251386  ->  1.000000000004089  Inexact Rounded\r
+dddiv4037 divide  6869599590293110   6869599590293495  ->  0.9999999999999440  Inexact Rounded\r
+dddiv4038 divide  5576281960092797   5576281960105579  ->  0.9999999999977078  Inexact Rounded\r
+dddiv4039 divide  2304844888381318   2304844888353073  ->  1.000000000012255  Inexact Rounded\r
+dddiv4040 divide  3265933651656452   3265933651682779  ->  0.9999999999919389  Inexact Rounded\r
+dddiv4041 divide  5235714985079914   5235714985066131  ->  1.000000000002632  Inexact Rounded\r
+dddiv4042 divide  5578481572827551   5578481572822945  ->  1.000000000000826  Inexact Rounded\r
+dddiv4043 divide  4909616081396134   4909616081373076  ->  1.000000000004696  Inexact Rounded\r
+dddiv4044 divide   636447224349537    636447224338757  ->  1.000000000016938  Inexact Rounded\r
+dddiv4045 divide  1539373428396640   1539373428364727  ->  1.000000000020731  Inexact Rounded\r
+dddiv4046 divide  2028786707377893   2028786707378866  ->  0.9999999999995204  Inexact Rounded\r
+dddiv4047 divide   137643260486222    137643260487419  ->  0.9999999999913036  Inexact Rounded\r
+dddiv4048 divide   247451519746765    247451519752267  ->  0.9999999999777653  Inexact Rounded\r
+dddiv4049 divide  7877858475022054   7877858474999794  ->  1.000000000002826  Inexact Rounded\r
+dddiv4050 divide  7333242694766258   7333242694744628  ->  1.000000000002950  Inexact Rounded\r
+dddiv4051 divide   124051503698592    124051503699397  ->  0.9999999999935108  Inexact Rounded\r
+dddiv4052 divide  8944737432385188   8944737432406860  ->  0.9999999999975771  Inexact Rounded\r
+dddiv4053 divide  9883948923406874   9883948923424843  ->  0.9999999999981820  Inexact Rounded\r
+dddiv4054 divide  6829178741654284   6829178741671973  ->  0.9999999999974098  Inexact Rounded\r
+dddiv4055 divide  7342752479768122   7342752479793385  ->  0.9999999999965595  Inexact Rounded\r
+dddiv4056 divide  8066426579008783   8066426578977563  ->  1.000000000003870  Inexact Rounded\r
+dddiv4057 divide  8992775071383295   8992775071352712  ->  1.000000000003401  Inexact Rounded\r
+dddiv4058 divide  5485011755545641   5485011755543611  ->  1.000000000000370  Inexact Rounded\r
+dddiv4059 divide  5779983054353918   5779983054365300  ->  0.9999999999980308  Inexact Rounded\r
+dddiv4060 divide  9502265102713774   9502265102735208  ->  0.9999999999977443  Inexact Rounded\r
+dddiv4061 divide  2109558399130981   2109558399116281  ->  1.000000000006968  Inexact Rounded\r
+dddiv4062 divide  5296182636350471   5296182636351521  ->  0.9999999999998017  Inexact Rounded\r
+dddiv4063 divide  1440019225591883   1440019225601844  ->  0.9999999999930827  Inexact Rounded\r
+dddiv4064 divide  8182110791881341   8182110791847174  ->  1.000000000004176  Inexact Rounded\r
+dddiv4065 divide   489098235512060    489098235534516  ->  0.9999999999540869  Inexact Rounded\r
+dddiv4066 divide  6475687084782038   6475687084756089  ->  1.000000000004007  Inexact Rounded\r
+dddiv4067 divide  8094348555736948   8094348555759236  ->  0.9999999999972465  Inexact Rounded\r
+dddiv4068 divide  1982766816291543   1982766816309463  ->  0.9999999999909621  Inexact Rounded\r
+dddiv4069 divide  9277314300113251   9277314300084467  ->  1.000000000003103  Inexact Rounded\r
+dddiv4070 divide  4335532959318934   4335532959293167  ->  1.000000000005943  Inexact Rounded\r
+dddiv4071 divide  7767113032981348   7767113032968132  ->  1.000000000001702  Inexact Rounded\r
+dddiv4072 divide  1578548053342868   1578548053370448  ->  0.9999999999825282  Inexact Rounded\r
+dddiv4073 divide  3790420686666898   3790420686636315  ->  1.000000000008068  Inexact Rounded\r
+dddiv4074 divide   871682421955147    871682421976441  ->  0.9999999999755714  Inexact Rounded\r
+dddiv4075 divide   744141054479940    744141054512329  ->  0.9999999999564746  Inexact Rounded\r
+dddiv4076 divide  8956824183670735   8956824183641741  ->  1.000000000003237  Inexact Rounded\r
+dddiv4077 divide  8337291694485682   8337291694451193  ->  1.000000000004137  Inexact Rounded\r
+dddiv4078 divide  4107775944683669   4107775944657097  ->  1.000000000006469  Inexact Rounded\r
+dddiv4079 divide  8691900057964648   8691900057997555  ->  0.9999999999962141  Inexact Rounded\r
+dddiv4080 divide  2229528520536462   2229528520502337  ->  1.000000000015306  Inexact Rounded\r
+dddiv4081 divide   398442083774322    398442083746273  ->  1.000000000070397  Inexact Rounded\r
+dddiv4082 divide  5319819776808759   5319819776838313  ->  0.9999999999944445  Inexact Rounded\r
+dddiv4083 divide  7710491299066855   7710491299041858  ->  1.000000000003242  Inexact Rounded\r
+dddiv4084 divide  9083231296087266   9083231296058160  ->  1.000000000003204  Inexact Rounded\r
+dddiv4085 divide  3566873574904559   3566873574890328  ->  1.000000000003990  Inexact Rounded\r
+dddiv4086 divide   596343290550525    596343290555614  ->  0.9999999999914663  Inexact Rounded\r
+dddiv4087 divide   278227925093192    278227925068104  ->  1.000000000090171  Inexact Rounded\r
+dddiv4088 divide  3292902958490649   3292902958519881  ->  0.9999999999911227  Inexact Rounded\r
+dddiv4089 divide  5521871364245881   5521871364229536  ->  1.000000000002960  Inexact Rounded\r
+dddiv4090 divide  2406505602883617   2406505602857997  ->  1.000000000010646  Inexact Rounded\r
+dddiv4091 divide  7741146984869208   7741146984867255  ->  1.000000000000252  Inexact Rounded\r
+dddiv4092 divide  4576041832414909   4576041832405102  ->  1.000000000002143  Inexact Rounded\r
+dddiv4093 divide  9183756982878057   9183756982901934  ->  0.9999999999974001  Inexact Rounded\r
+dddiv4094 divide  6215736513855159   6215736513870342  ->  0.9999999999975573  Inexact Rounded\r
+dddiv4095 divide   248554968534533    248554968551417  ->  0.9999999999320714  Inexact Rounded\r
+dddiv4096 divide   376314165668645    376314165659755  ->  1.000000000023624  Inexact Rounded\r
+dddiv4097 divide  5513569249809718   5513569249808906  ->  1.000000000000147  Inexact Rounded\r
+dddiv4098 divide  3367992242167904   3367992242156228  ->  1.000000000003467  Inexact Rounded\r
+dddiv4099 divide  6134869538966967   6134869538985986  ->  0.9999999999968999  Inexact Rounded\r
+\r
+-- Null tests\r
+dddiv9998 divide 10  # -> NaN Invalid_operation\r
+dddiv9999 divide  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddDivideInt.decTest b/Lib/test/decimaltestdata/ddDivideInt.decTest
new file mode 100644 (file)
index 0000000..782fe8d
--- /dev/null
@@ -0,0 +1,449 @@
+------------------------------------------------------------------------\r
+-- ddDivideInt.decTest -- decDouble integer division                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+dddvi001 divideint  1     1    ->  1\r
+dddvi002 divideint  2     1    ->  2\r
+dddvi003 divideint  1     2    ->  0\r
+dddvi004 divideint  2     2    ->  1\r
+dddvi005 divideint  0     1    ->  0\r
+dddvi006 divideint  0     2    ->  0\r
+dddvi007 divideint  1     3    ->  0\r
+dddvi008 divideint  2     3    ->  0\r
+dddvi009 divideint  3     3    ->  1\r
+\r
+dddvi010 divideint  2.4   1    ->  2\r
+dddvi011 divideint  2.4   -1   ->  -2\r
+dddvi012 divideint  -2.4  1    ->  -2\r
+dddvi013 divideint  -2.4  -1   ->  2\r
+dddvi014 divideint  2.40  1    ->  2\r
+dddvi015 divideint  2.400 1    ->  2\r
+dddvi016 divideint  2.4   2    ->  1\r
+dddvi017 divideint  2.400 2    ->  1\r
+dddvi018 divideint  2.    2    ->  1\r
+dddvi019 divideint  20    20   ->  1\r
+\r
+dddvi020 divideint  187   187  ->  1\r
+dddvi021 divideint  5     2    ->  2\r
+dddvi022 divideint  5     2.0    ->  2\r
+dddvi023 divideint  5     2.000  ->  2\r
+dddvi024 divideint  5     0.200  ->  25\r
+dddvi025 divideint  5     0.200  ->  25\r
+\r
+dddvi030 divideint  1     2      ->  0\r
+dddvi031 divideint  1     4      ->  0\r
+dddvi032 divideint  1     8      ->  0\r
+dddvi033 divideint  1     16     ->  0\r
+dddvi034 divideint  1     32     ->  0\r
+dddvi035 divideint  1     64     ->  0\r
+dddvi040 divideint  1    -2      -> -0\r
+dddvi041 divideint  1    -4      -> -0\r
+dddvi042 divideint  1    -8      -> -0\r
+dddvi043 divideint  1    -16     -> -0\r
+dddvi044 divideint  1    -32     -> -0\r
+dddvi045 divideint  1    -64     -> -0\r
+dddvi050 divideint -1     2      -> -0\r
+dddvi051 divideint -1     4      -> -0\r
+dddvi052 divideint -1     8      -> -0\r
+dddvi053 divideint -1     16     -> -0\r
+dddvi054 divideint -1     32     -> -0\r
+dddvi055 divideint -1     64     -> -0\r
+dddvi060 divideint -1    -2      ->  0\r
+dddvi061 divideint -1    -4      ->  0\r
+dddvi062 divideint -1    -8      ->  0\r
+dddvi063 divideint -1    -16     ->  0\r
+dddvi064 divideint -1    -32     ->  0\r
+dddvi065 divideint -1    -64     ->  0\r
+\r
+-- similar with powers of ten\r
+dddvi160 divideint  1     1         ->  1\r
+dddvi161 divideint  1     10        ->  0\r
+dddvi162 divideint  1     100       ->  0\r
+dddvi163 divideint  1     1000      ->  0\r
+dddvi164 divideint  1     10000     ->  0\r
+dddvi165 divideint  1     100000    ->  0\r
+dddvi166 divideint  1     1000000   ->  0\r
+dddvi167 divideint  1     10000000  ->  0\r
+dddvi168 divideint  1     100000000 ->  0\r
+dddvi170 divideint  1    -1         -> -1\r
+dddvi171 divideint  1    -10        -> -0\r
+dddvi172 divideint  1    -100       -> -0\r
+dddvi173 divideint  1    -1000      -> -0\r
+dddvi174 divideint  1    -10000     -> -0\r
+dddvi175 divideint  1    -100000    -> -0\r
+dddvi176 divideint  1    -1000000   -> -0\r
+dddvi177 divideint  1    -10000000  -> -0\r
+dddvi178 divideint  1    -100000000 -> -0\r
+dddvi180 divideint -1     1         -> -1\r
+dddvi181 divideint -1     10        -> -0\r
+dddvi182 divideint -1     100       -> -0\r
+dddvi183 divideint -1     1000      -> -0\r
+dddvi184 divideint -1     10000     -> -0\r
+dddvi185 divideint -1     100000    -> -0\r
+dddvi186 divideint -1     1000000   -> -0\r
+dddvi187 divideint -1     10000000  -> -0\r
+dddvi188 divideint -1     100000000 -> -0\r
+dddvi190 divideint -1    -1         ->  1\r
+dddvi191 divideint -1    -10        ->  0\r
+dddvi192 divideint -1    -100       ->  0\r
+dddvi193 divideint -1    -1000      ->  0\r
+dddvi194 divideint -1    -10000     ->  0\r
+dddvi195 divideint -1    -100000    ->  0\r
+dddvi196 divideint -1    -1000000   ->  0\r
+dddvi197 divideint -1    -10000000  ->  0\r
+dddvi198 divideint -1    -100000000 ->  0\r
+\r
+-- some long operand (at p=9) cases\r
+dddvi070 divideint  999999999     1  ->  999999999\r
+dddvi071 divideint  999999999.4   1  ->  999999999\r
+dddvi072 divideint  999999999.5   1  ->  999999999\r
+dddvi073 divideint  999999999.9   1  ->  999999999\r
+dddvi074 divideint  999999999.999 1  ->  999999999\r
+\r
+dddvi090 divideint  0.            1    ->  0\r
+dddvi091 divideint  .0            1    ->  0\r
+dddvi092 divideint  0.00          1    ->  0\r
+dddvi093 divideint  0.00E+9       1    ->  0\r
+dddvi094 divideint  0.0000E-50    1    ->  0\r
+\r
+dddvi100 divideint  1  1   -> 1\r
+dddvi101 divideint  1  2   -> 0\r
+dddvi102 divideint  1  3   -> 0\r
+dddvi103 divideint  1  4   -> 0\r
+dddvi104 divideint  1  5   -> 0\r
+dddvi105 divideint  1  6   -> 0\r
+dddvi106 divideint  1  7   -> 0\r
+dddvi107 divideint  1  8   -> 0\r
+dddvi108 divideint  1  9   -> 0\r
+dddvi109 divideint  1  10  -> 0\r
+dddvi110 divideint  1  1   -> 1\r
+dddvi111 divideint  2  1   -> 2\r
+dddvi112 divideint  3  1   -> 3\r
+dddvi113 divideint  4  1   -> 4\r
+dddvi114 divideint  5  1   -> 5\r
+dddvi115 divideint  6  1   -> 6\r
+dddvi116 divideint  7  1   -> 7\r
+dddvi117 divideint  8  1   -> 8\r
+dddvi118 divideint  9  1   -> 9\r
+dddvi119 divideint  10 1   -> 10\r
+\r
+-- from DiagBigDecimal\r
+dddvi131 divideint  101.3   1     ->  101\r
+dddvi132 divideint  101.0   1     ->  101\r
+dddvi133 divideint  101.3   3     ->  33\r
+dddvi134 divideint  101.0   3     ->  33\r
+dddvi135 divideint  2.4     1     ->  2\r
+dddvi136 divideint  2.400   1     ->  2\r
+dddvi137 divideint  18      18    ->  1\r
+dddvi138 divideint  1120    1000  ->  1\r
+dddvi139 divideint  2.4     2     ->  1\r
+dddvi140 divideint  2.400   2     ->  1\r
+dddvi141 divideint  0.5     2.000 ->  0\r
+dddvi142 divideint  8.005   7     ->  1\r
+dddvi143 divideint  5       2     ->  2\r
+dddvi144 divideint  0       2     ->  0\r
+dddvi145 divideint  0.00    2     ->  0\r
+\r
+-- Others\r
+dddvi150 divideint  12345  4.999  ->  2469\r
+dddvi151 divideint  12345  4.99   ->  2473\r
+dddvi152 divideint  12345  4.9    ->  2519\r
+dddvi153 divideint  12345  5      ->  2469\r
+dddvi154 divideint  12345  5.1    ->  2420\r
+dddvi155 divideint  12345  5.01   ->  2464\r
+dddvi156 divideint  12345  5.001  ->  2468\r
+dddvi157 divideint    101  7.6    ->  13\r
+\r
+-- Various flavours of divideint by 0\r
+dddvi201 divideint  0      0   -> NaN Division_undefined\r
+dddvi202 divideint  0.0E5  0   -> NaN Division_undefined\r
+dddvi203 divideint  0.000  0   -> NaN Division_undefined\r
+dddvi204 divideint  0.0001 0   -> Infinity Division_by_zero\r
+dddvi205 divideint  0.01   0   -> Infinity Division_by_zero\r
+dddvi206 divideint  0.1    0   -> Infinity Division_by_zero\r
+dddvi207 divideint  1      0   -> Infinity Division_by_zero\r
+dddvi208 divideint  1      0.0 -> Infinity Division_by_zero\r
+dddvi209 divideint 10      0.0 -> Infinity Division_by_zero\r
+dddvi210 divideint 1E+100  0.0 -> Infinity Division_by_zero\r
+dddvi211 divideint 1E+380  0   -> Infinity Division_by_zero\r
+dddvi214 divideint  -0.0001 0   -> -Infinity Division_by_zero\r
+dddvi215 divideint  -0.01   0   -> -Infinity Division_by_zero\r
+dddvi216 divideint  -0.1    0   -> -Infinity Division_by_zero\r
+dddvi217 divideint  -1      0   -> -Infinity Division_by_zero\r
+dddvi218 divideint  -1      0.0 -> -Infinity Division_by_zero\r
+dddvi219 divideint -10      0.0 -> -Infinity Division_by_zero\r
+dddvi220 divideint -1E+100  0.0 -> -Infinity Division_by_zero\r
+dddvi221 divideint -1E+380  0   -> -Infinity Division_by_zero\r
+\r
+-- test some cases that are close to exponent overflow\r
+dddvi270 divideint 1 1e384          -> 0\r
+dddvi271 divideint 1 0.9e384        -> 0\r
+dddvi272 divideint 1 0.99e384       -> 0\r
+dddvi273 divideint 1 0.9999999999999999e384       -> 0\r
+dddvi274 divideint 9e384    1       -> NaN Division_impossible\r
+dddvi275 divideint 9.9e384  1       -> NaN Division_impossible\r
+dddvi276 divideint 9.99e384 1       -> NaN Division_impossible\r
+dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible\r
+\r
+dddvi280 divideint 0.1 9e-383       -> NaN Division_impossible\r
+dddvi281 divideint 0.1 99e-383      -> NaN Division_impossible\r
+dddvi282 divideint 0.1 999e-383     -> NaN Division_impossible\r
+dddvi283 divideint 0.1 9e-382       -> NaN Division_impossible\r
+dddvi284 divideint 0.1 99e-382      -> NaN Division_impossible\r
+\r
+-- GD edge cases: lhs smaller than rhs but more digits\r
+dddvi301  divideint  0.9      2      ->  0\r
+dddvi302  divideint  0.9      2.0    ->  0\r
+dddvi303  divideint  0.9      2.1    ->  0\r
+dddvi304  divideint  0.9      2.00   ->  0\r
+dddvi305  divideint  0.9      2.01   ->  0\r
+dddvi306  divideint  0.12     1      ->  0\r
+dddvi307  divideint  0.12     1.0    ->  0\r
+dddvi308  divideint  0.12     1.00   ->  0\r
+dddvi309  divideint  0.12     1.0    ->  0\r
+dddvi310  divideint  0.12     1.00   ->  0\r
+dddvi311  divideint  0.12     2      ->  0\r
+dddvi312  divideint  0.12     2.0    ->  0\r
+dddvi313  divideint  0.12     2.1    ->  0\r
+dddvi314  divideint  0.12     2.00   ->  0\r
+dddvi315  divideint  0.12     2.01   ->  0\r
+\r
+-- edge cases of impossible\r
+dddvi330  divideint  1234567890123456  10    ->  123456789012345\r
+dddvi331  divideint  1234567890123456   1    ->  1234567890123456\r
+dddvi332  divideint  1234567890123456   0.1  ->  NaN Division_impossible\r
+dddvi333  divideint  1234567890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- overflow and underflow tests [from divide]\r
+dddvi1051 divideint  1e+277  1e-311 ->  NaN Division_impossible\r
+dddvi1052 divideint  1e+277 -1e-311 ->  NaN Division_impossible\r
+dddvi1053 divideint -1e+277  1e-311 ->  NaN Division_impossible\r
+dddvi1054 divideint -1e+277 -1e-311 ->  NaN Division_impossible\r
+dddvi1055 divideint  1e-277  1e+311 ->  0\r
+dddvi1056 divideint  1e-277 -1e+311 -> -0\r
+dddvi1057 divideint -1e-277  1e+311 -> -0\r
+dddvi1058 divideint -1e-277 -1e+311 ->  0\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dddvi1060 divideint 1e-291 1e+101 -> 0\r
+dddvi1061 divideint 1e-291 1e+102 -> 0\r
+dddvi1062 divideint 1e-291 1e+103 -> 0\r
+dddvi1063 divideint 1e-291 1e+104 -> 0\r
+dddvi1064 divideint 1e-291 1e+105 -> 0\r
+dddvi1065 divideint 1e-291 1e+106 -> 0\r
+dddvi1066 divideint 1e-291 1e+107 -> 0\r
+dddvi1067 divideint 1e-291 1e+108 -> 0\r
+dddvi1068 divideint 1e-291 1e+109 -> 0\r
+dddvi1069 divideint 1e-291 1e+110 -> 0\r
+\r
+dddvi1101 divideint  1.0000E-394  1     -> 0\r
+dddvi1102 divideint  1.000E-394   1e+1  -> 0\r
+dddvi1103 divideint  1.00E-394    1e+2  -> 0\r
+\r
+dddvi1118 divideint  1E-394       1e+4  -> 0\r
+dddvi1119 divideint  3E-394      -1e+5  -> -0\r
+dddvi1120 divideint  5E-394       1e+5  -> 0\r
+\r
+dddvi1124 divideint  1E-394      -1e+4  -> -0\r
+dddvi1130 divideint  3.0E-394    -1e+5  -> -0\r
+\r
+dddvi1131 divideint  1.0E-199     1e+200 -> 0\r
+dddvi1132 divideint  1.0E-199     1e+199 -> 0\r
+dddvi1133 divideint  1.0E-199     1e+198 -> 0\r
+dddvi1134 divideint  2.0E-199     2e+198 -> 0\r
+dddvi1135 divideint  4.0E-199     4e+198 -> 0\r
+\r
+-- long operand checks\r
+dddvi401 divideint 12345678000 100 -> 123456780\r
+dddvi402 divideint 1 12345678000   -> 0\r
+dddvi403 divideint 1234567800  10  -> 123456780\r
+dddvi404 divideint 1 1234567800    -> 0\r
+dddvi405 divideint 1234567890  10  -> 123456789\r
+dddvi406 divideint 1 1234567890    -> 0\r
+dddvi407 divideint 1234567891  10  -> 123456789\r
+dddvi408 divideint 1 1234567891    -> 0\r
+dddvi409 divideint 12345678901 100 -> 123456789\r
+dddvi410 divideint 1 12345678901   -> 0\r
+dddvi411 divideint 1234567896  10  -> 123456789\r
+dddvi412 divideint 1 1234567896    -> 0\r
+dddvi413 divideint 12345678948 100 -> 123456789\r
+dddvi414 divideint 12345678949 100 -> 123456789\r
+dddvi415 divideint 12345678950 100 -> 123456789\r
+dddvi416 divideint 12345678951 100 -> 123456789\r
+dddvi417 divideint 12345678999 100 -> 123456789\r
+dddvi441 divideint 12345678000 1 -> 12345678000\r
+dddvi442 divideint 1 12345678000 -> 0\r
+dddvi443 divideint 1234567800  1 -> 1234567800\r
+dddvi444 divideint 1 1234567800  -> 0\r
+dddvi445 divideint 1234567890  1 -> 1234567890\r
+dddvi446 divideint 1 1234567890  -> 0\r
+dddvi447 divideint 1234567891  1 -> 1234567891\r
+dddvi448 divideint 1 1234567891  -> 0\r
+dddvi449 divideint 12345678901 1 -> 12345678901\r
+dddvi450 divideint 1 12345678901 -> 0\r
+dddvi451 divideint 1234567896  1 -> 1234567896\r
+dddvi452 divideint 1 1234567896  -> 0\r
+\r
+-- more zeros, etc.\r
+dddvi531 divideint 5.00 1E-3    -> 5000\r
+dddvi532 divideint 00.00 0.000  -> NaN Division_undefined\r
+dddvi533 divideint 00.00 0E-3   -> NaN Division_undefined\r
+dddvi534 divideint  0    -0     -> NaN Division_undefined\r
+dddvi535 divideint -0     0     -> NaN Division_undefined\r
+dddvi536 divideint -0    -0     -> NaN Division_undefined\r
+\r
+dddvi541 divideint  0    -1     -> -0\r
+dddvi542 divideint -0    -1     ->  0\r
+dddvi543 divideint  0     1     ->  0\r
+dddvi544 divideint -0     1     -> -0\r
+dddvi545 divideint -1     0     -> -Infinity Division_by_zero\r
+dddvi546 divideint -1    -0     ->  Infinity Division_by_zero\r
+dddvi547 divideint  1     0     ->  Infinity Division_by_zero\r
+dddvi548 divideint  1    -0     -> -Infinity Division_by_zero\r
+\r
+dddvi551 divideint  0.0  -1     -> -0\r
+dddvi552 divideint -0.0  -1     ->  0\r
+dddvi553 divideint  0.0   1     ->  0\r
+dddvi554 divideint -0.0   1     -> -0\r
+dddvi555 divideint -1.0   0     -> -Infinity Division_by_zero\r
+dddvi556 divideint -1.0  -0     ->  Infinity Division_by_zero\r
+dddvi557 divideint  1.0   0     ->  Infinity Division_by_zero\r
+dddvi558 divideint  1.0  -0     -> -Infinity Division_by_zero\r
+\r
+dddvi561 divideint  0    -1.0   -> -0\r
+dddvi562 divideint -0    -1.0   ->  0\r
+dddvi563 divideint  0     1.0   ->  0\r
+dddvi564 divideint -0     1.0   -> -0\r
+dddvi565 divideint -1     0.0   -> -Infinity Division_by_zero\r
+dddvi566 divideint -1    -0.0   ->  Infinity Division_by_zero\r
+dddvi567 divideint  1     0.0   ->  Infinity Division_by_zero\r
+dddvi568 divideint  1    -0.0   -> -Infinity Division_by_zero\r
+\r
+dddvi571 divideint  0.0  -1.0   -> -0\r
+dddvi572 divideint -0.0  -1.0   ->  0\r
+dddvi573 divideint  0.0   1.0   ->  0\r
+dddvi574 divideint -0.0   1.0   -> -0\r
+dddvi575 divideint -1.0   0.0   -> -Infinity Division_by_zero\r
+dddvi576 divideint -1.0  -0.0   ->  Infinity Division_by_zero\r
+dddvi577 divideint  1.0   0.0   ->  Infinity Division_by_zero\r
+dddvi578 divideint  1.0  -0.0   -> -Infinity Division_by_zero\r
+\r
+-- Specials\r
+dddvi580 divideint  Inf  -Inf   ->  NaN Invalid_operation\r
+dddvi581 divideint  Inf  -1000  -> -Infinity\r
+dddvi582 divideint  Inf  -1     -> -Infinity\r
+dddvi583 divideint  Inf  -0     -> -Infinity\r
+dddvi584 divideint  Inf   0     ->  Infinity\r
+dddvi585 divideint  Inf   1     ->  Infinity\r
+dddvi586 divideint  Inf   1000  ->  Infinity\r
+dddvi587 divideint  Inf   Inf   ->  NaN Invalid_operation\r
+dddvi588 divideint -1000  Inf   -> -0\r
+dddvi589 divideint -Inf   Inf   ->  NaN Invalid_operation\r
+dddvi590 divideint -1     Inf   -> -0\r
+dddvi591 divideint -0     Inf   -> -0\r
+dddvi592 divideint  0     Inf   ->  0\r
+dddvi593 divideint  1     Inf   ->  0\r
+dddvi594 divideint  1000  Inf   ->  0\r
+dddvi595 divideint  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dddvi600 divideint -Inf  -Inf   ->  NaN Invalid_operation\r
+dddvi601 divideint -Inf  -1000  ->  Infinity\r
+dddvi602 divideint -Inf  -1     ->  Infinity\r
+dddvi603 divideint -Inf  -0     ->  Infinity\r
+dddvi604 divideint -Inf   0     -> -Infinity\r
+dddvi605 divideint -Inf   1     -> -Infinity\r
+dddvi606 divideint -Inf   1000  -> -Infinity\r
+dddvi607 divideint -Inf   Inf   ->  NaN Invalid_operation\r
+dddvi608 divideint -1000  Inf   -> -0\r
+dddvi609 divideint -Inf  -Inf   ->  NaN Invalid_operation\r
+dddvi610 divideint -1    -Inf   ->  0\r
+dddvi611 divideint -0    -Inf   ->  0\r
+dddvi612 divideint  0    -Inf   -> -0\r
+dddvi613 divideint  1    -Inf   -> -0\r
+dddvi614 divideint  1000 -Inf   -> -0\r
+dddvi615 divideint  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dddvi621 divideint  NaN -Inf    ->  NaN\r
+dddvi622 divideint  NaN -1000   ->  NaN\r
+dddvi623 divideint  NaN -1      ->  NaN\r
+dddvi624 divideint  NaN -0      ->  NaN\r
+dddvi625 divideint  NaN  0      ->  NaN\r
+dddvi626 divideint  NaN  1      ->  NaN\r
+dddvi627 divideint  NaN  1000   ->  NaN\r
+dddvi628 divideint  NaN  Inf    ->  NaN\r
+dddvi629 divideint  NaN  NaN    ->  NaN\r
+dddvi630 divideint -Inf  NaN    ->  NaN\r
+dddvi631 divideint -1000 NaN    ->  NaN\r
+dddvi632 divideint -1    NaN    ->  NaN\r
+dddvi633 divideint -0    NaN    ->  NaN\r
+dddvi634 divideint  0    NaN    ->  NaN\r
+dddvi635 divideint  1    NaN    ->  NaN\r
+dddvi636 divideint  1000 NaN    ->  NaN\r
+dddvi637 divideint  Inf  NaN    ->  NaN\r
+\r
+dddvi641 divideint  sNaN -Inf   ->  NaN  Invalid_operation\r
+dddvi642 divideint  sNaN -1000  ->  NaN  Invalid_operation\r
+dddvi643 divideint  sNaN -1     ->  NaN  Invalid_operation\r
+dddvi644 divideint  sNaN -0     ->  NaN  Invalid_operation\r
+dddvi645 divideint  sNaN  0     ->  NaN  Invalid_operation\r
+dddvi646 divideint  sNaN  1     ->  NaN  Invalid_operation\r
+dddvi647 divideint  sNaN  1000  ->  NaN  Invalid_operation\r
+dddvi648 divideint  sNaN  NaN   ->  NaN  Invalid_operation\r
+dddvi649 divideint  sNaN sNaN   ->  NaN  Invalid_operation\r
+dddvi650 divideint  NaN  sNaN   ->  NaN  Invalid_operation\r
+dddvi651 divideint -Inf  sNaN   ->  NaN  Invalid_operation\r
+dddvi652 divideint -1000 sNaN   ->  NaN  Invalid_operation\r
+dddvi653 divideint -1    sNaN   ->  NaN  Invalid_operation\r
+dddvi654 divideint -0    sNaN   ->  NaN  Invalid_operation\r
+dddvi655 divideint  0    sNaN   ->  NaN  Invalid_operation\r
+dddvi656 divideint  1    sNaN   ->  NaN  Invalid_operation\r
+dddvi657 divideint  1000 sNaN   ->  NaN  Invalid_operation\r
+dddvi658 divideint  Inf  sNaN   ->  NaN  Invalid_operation\r
+dddvi659 divideint  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dddvi661 divideint  NaN9 -Inf   ->  NaN9\r
+dddvi662 divideint  NaN8  1000  ->  NaN8\r
+dddvi663 divideint  NaN7  Inf   ->  NaN7\r
+dddvi664 divideint -NaN6  NaN5  -> -NaN6\r
+dddvi665 divideint -Inf   NaN4  ->  NaN4\r
+dddvi666 divideint -1000  NaN3  ->  NaN3\r
+dddvi667 divideint  Inf  -NaN2  -> -NaN2\r
+\r
+dddvi671 divideint -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dddvi672 divideint  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dddvi673 divideint  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dddvi674 divideint  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dddvi675 divideint  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dddvi676 divideint -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dddvi677 divideint  0      sNaN91  ->  NaN91 Invalid_operation\r
+dddvi678 divideint  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dddvi679 divideint  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- Null tests\r
+dddvi900 divideint  10  # -> NaN Invalid_operation\r
+dddvi901 divideint   # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddEncode.decTest b/Lib/test/decimaltestdata/ddEncode.decTest
new file mode 100644 (file)
index 0000000..16264fc
--- /dev/null
@@ -0,0 +1,487 @@
+------------------------------------------------------------------------\r
+-- ddEncode.decTest -- decimal eight-byte format testcases            --\r
+-- Copyright (c) IBM Corporation, 2000, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+-- [Previously called decimal64.decTest]\r
+version: 2.56\r
+\r
+-- This set of tests is for the eight-byte concrete representation.\r
+-- Its characteristics are:\r
+--\r
+--  1 bit  sign\r
+--  5 bits combination field\r
+--  8 bits exponent continuation\r
+-- 50 bits coefficient continuation\r
+--\r
+-- Total exponent length 10 bits\r
+-- Total coefficient length 54 bits (16 digits)\r
+--\r
+-- Elimit =  767 (maximum encoded exponent)\r
+-- Emax   =  384 (largest exponent value)\r
+-- Emin   = -383 (smallest exponent value)\r
+-- bias   =  398 (subtracted from encoded exponent) = -Etiny\r
+\r
+-- The testcases here have only exactly representable data on the\r
+-- 'left-hand-side'; rounding from strings is tested in 'base'\r
+-- testcase groups.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   16\r
+rounding:    half_up\r
+maxExponent: 384\r
+minExponent: -383\r
+\r
+-- General testcases\r
+-- (mostly derived from the Strawman 4 document and examples)\r
+dece001 apply   #A2300000000003D0 -> -7.50\r
+dece002 apply   -7.50             -> #A2300000000003D0\r
+-- derivative canonical plain strings\r
+dece003 apply   #A23c0000000003D0 -> -7.50E+3\r
+dece004 apply   -7.50E+3          -> #A23c0000000003D0\r
+dece005 apply   #A2380000000003D0 -> -750\r
+dece006 apply   -750              -> #A2380000000003D0\r
+dece007 apply   #A2340000000003D0 -> -75.0\r
+dece008 apply   -75.0             -> #A2340000000003D0\r
+dece009 apply   #A22c0000000003D0 -> -0.750\r
+dece010 apply   -0.750            -> #A22c0000000003D0\r
+dece011 apply   #A2280000000003D0 -> -0.0750\r
+dece012 apply   -0.0750           -> #A2280000000003D0\r
+dece013 apply   #A2200000000003D0 -> -0.000750\r
+dece014 apply   -0.000750         -> #A2200000000003D0\r
+dece015 apply   #A2180000000003D0 -> -0.00000750\r
+dece016 apply   -0.00000750       -> #A2180000000003D0\r
+dece017 apply   #A2140000000003D0 -> -7.50E-7\r
+dece018 apply   -7.50E-7          -> #A2140000000003D0\r
+\r
+-- Normality\r
+dece020 apply   1234567890123456   -> #263934b9c1e28e56\r
+dece021 apply  -1234567890123456   -> #a63934b9c1e28e56\r
+dece022 apply   1234.567890123456  -> #260934b9c1e28e56\r
+dece023 apply  #260934b9c1e28e56   -> 1234.567890123456\r
+dece024 apply   1111111111111111   -> #2638912449124491\r
+dece025 apply   9999999999999999   -> #6e38ff3fcff3fcff\r
+\r
+-- Nmax and similar\r
+dece031 apply   9999999999999999E+369   -> #77fcff3fcff3fcff\r
+dece032 apply   9.999999999999999E+384  -> #77fcff3fcff3fcff\r
+dece033 apply   #77fcff3fcff3fcff       -> 9.999999999999999E+384\r
+dece034 apply   1.234567890123456E+384  -> #47fd34b9c1e28e56\r
+dece035 apply   #47fd34b9c1e28e56       -> 1.234567890123456E+384\r
+-- fold-downs (more below)\r
+dece036 apply   1.23E+384               -> #47fd300000000000 Clamped\r
+dece037 apply   #47fd300000000000       -> 1.230000000000000E+384\r
+decd038 apply   1E+384                  -> #47fc000000000000 Clamped\r
+decd039 apply   #47fc000000000000       -> 1.000000000000000E+384\r
+\r
+decd051 apply   12345                   -> #22380000000049c5\r
+decd052 apply   #22380000000049c5       -> 12345\r
+decd053 apply   1234                    -> #2238000000000534\r
+decd054 apply   #2238000000000534       -> 1234\r
+decd055 apply   123                     -> #22380000000000a3\r
+decd056 apply   #22380000000000a3       -> 123\r
+decd057 apply   12                      -> #2238000000000012\r
+decd058 apply   #2238000000000012       -> 12\r
+decd059 apply   1                       -> #2238000000000001\r
+decd060 apply   #2238000000000001       -> 1\r
+decd061 apply   1.23                    -> #22300000000000a3\r
+decd062 apply   #22300000000000a3       -> 1.23\r
+decd063 apply   123.45                  -> #22300000000049c5\r
+decd064 apply   #22300000000049c5       -> 123.45\r
+\r
+-- Nmin and below\r
+decd071 apply   1E-383                  -> #003c000000000001\r
+decd072 apply   #003c000000000001       -> 1E-383\r
+decd073 apply   1.000000000000000E-383  -> #0400000000000000\r
+decd074 apply   #0400000000000000       -> 1.000000000000000E-383\r
+decd075 apply   1.000000000000001E-383  -> #0400000000000001\r
+decd076 apply   #0400000000000001       -> 1.000000000000001E-383\r
+\r
+decd077 apply   0.100000000000000E-383  -> #0000800000000000      Subnormal\r
+decd078 apply   #0000800000000000       -> 1.00000000000000E-384  Subnormal\r
+decd079 apply   0.000000000000010E-383  -> #0000000000000010      Subnormal\r
+decd080 apply   #0000000000000010       -> 1.0E-397               Subnormal\r
+decd081 apply   0.00000000000001E-383   -> #0004000000000001      Subnormal\r
+decd082 apply   #0004000000000001       -> 1E-397                 Subnormal\r
+decd083 apply   0.000000000000001E-383  -> #0000000000000001      Subnormal\r
+decd084 apply   #0000000000000001       -> 1E-398                 Subnormal\r
+-- next is smallest all-nines\r
+decd085 apply   9999999999999999E-398   -> #6400ff3fcff3fcff\r
+decd086 apply   #6400ff3fcff3fcff       -> 9.999999999999999E-383\r
+-- and a problematic divide result\r
+decd088 apply   1.111111111111111E-383  -> #0400912449124491\r
+decd089 apply   #0400912449124491       -> 1.111111111111111E-383\r
+\r
+-- forties\r
+decd090 apply        40                -> #2238000000000040\r
+decd091 apply        39.99             -> #2230000000000cff\r
+\r
+-- underflows cannot be tested as all LHS exact\r
+\r
+-- Same again, negatives\r
+-- Nmax and similar\r
+decd122 apply  -9.999999999999999E+384  -> #f7fcff3fcff3fcff\r
+decd123 apply   #f7fcff3fcff3fcff       -> -9.999999999999999E+384\r
+decd124 apply  -1.234567890123456E+384  -> #c7fd34b9c1e28e56\r
+decd125 apply   #c7fd34b9c1e28e56       -> -1.234567890123456E+384\r
+-- fold-downs (more below)\r
+decd130 apply  -1.23E+384               -> #c7fd300000000000 Clamped\r
+decd131 apply   #c7fd300000000000       -> -1.230000000000000E+384\r
+decd132 apply  -1E+384                  -> #c7fc000000000000 Clamped\r
+decd133 apply   #c7fc000000000000       -> -1.000000000000000E+384\r
+\r
+-- overflows\r
+decd151 apply  -12345                   -> #a2380000000049c5\r
+decd152 apply   #a2380000000049c5       -> -12345\r
+decd153 apply  -1234                    -> #a238000000000534\r
+decd154 apply   #a238000000000534       -> -1234\r
+decd155 apply  -123                     -> #a2380000000000a3\r
+decd156 apply   #a2380000000000a3       -> -123\r
+decd157 apply  -12                      -> #a238000000000012\r
+decd158 apply   #a238000000000012       -> -12\r
+decd159 apply  -1                       -> #a238000000000001\r
+decd160 apply   #a238000000000001       -> -1\r
+decd161 apply  -1.23                    -> #a2300000000000a3\r
+decd162 apply   #a2300000000000a3       -> -1.23\r
+decd163 apply  -123.45                  -> #a2300000000049c5\r
+decd164 apply   #a2300000000049c5       -> -123.45\r
+\r
+-- Nmin and below\r
+decd171 apply  -1E-383                  -> #803c000000000001\r
+decd172 apply   #803c000000000001       -> -1E-383\r
+decd173 apply  -1.000000000000000E-383  -> #8400000000000000\r
+decd174 apply   #8400000000000000       -> -1.000000000000000E-383\r
+decd175 apply  -1.000000000000001E-383  -> #8400000000000001\r
+decd176 apply   #8400000000000001       -> -1.000000000000001E-383\r
+\r
+decd177 apply  -0.100000000000000E-383  -> #8000800000000000       Subnormal\r
+decd178 apply   #8000800000000000       -> -1.00000000000000E-384  Subnormal\r
+decd179 apply  -0.000000000000010E-383  -> #8000000000000010       Subnormal\r
+decd180 apply   #8000000000000010       -> -1.0E-397               Subnormal\r
+decd181 apply  -0.00000000000001E-383   -> #8004000000000001       Subnormal\r
+decd182 apply   #8004000000000001       -> -1E-397                 Subnormal\r
+decd183 apply  -0.000000000000001E-383  -> #8000000000000001       Subnormal\r
+decd184 apply   #8000000000000001       -> -1E-398                 Subnormal\r
+-- next is smallest all-nines\r
+decd185 apply   -9999999999999999E-398   -> #e400ff3fcff3fcff\r
+decd186 apply   #e400ff3fcff3fcff       -> -9.999999999999999E-383\r
+-- and a tricky subnormal\r
+decd187 apply   1.11111111111524E-384    -> #00009124491246a4      Subnormal\r
+decd188 apply   #00009124491246a4        -> 1.11111111111524E-384  Subnormal\r
+\r
+-- near-underflows\r
+decd189 apply   -1e-398                 -> #8000000000000001  Subnormal\r
+decd190 apply   -1.0e-398               -> #8000000000000001  Subnormal Rounded\r
+\r
+-- zeros\r
+decd401 apply   0E-500                  -> #0000000000000000  Clamped\r
+decd402 apply   0E-400                  -> #0000000000000000  Clamped\r
+decd403 apply   0E-398                  -> #0000000000000000\r
+decd404 apply   #0000000000000000       -> 0E-398\r
+decd405 apply   0.000000000000000E-383  -> #0000000000000000\r
+decd406 apply   #0000000000000000       -> 0E-398\r
+decd407 apply   0E-2                    -> #2230000000000000\r
+decd408 apply   #2230000000000000       -> 0.00\r
+decd409 apply   0                       -> #2238000000000000\r
+decd410 apply   #2238000000000000       -> 0\r
+decd411 apply   0E+3                    -> #2244000000000000\r
+decd412 apply   #2244000000000000       -> 0E+3\r
+decd413 apply   0E+369                  -> #43fc000000000000\r
+decd414 apply   #43fc000000000000       -> 0E+369\r
+-- clamped zeros...\r
+decd415 apply   0E+370                  -> #43fc000000000000  Clamped\r
+decd416 apply   #43fc000000000000       -> 0E+369\r
+decd417 apply   0E+384                  -> #43fc000000000000  Clamped\r
+decd418 apply   #43fc000000000000       -> 0E+369\r
+decd419 apply   0E+400                  -> #43fc000000000000  Clamped\r
+decd420 apply   #43fc000000000000       -> 0E+369\r
+decd421 apply   0E+500                  -> #43fc000000000000  Clamped\r
+decd422 apply   #43fc000000000000       -> 0E+369\r
+\r
+-- negative zeros\r
+decd431 apply   -0E-400                 -> #8000000000000000  Clamped\r
+decd432 apply   -0E-400                 -> #8000000000000000  Clamped\r
+decd433 apply   -0E-398                 -> #8000000000000000\r
+decd434 apply   #8000000000000000       -> -0E-398\r
+decd435 apply   -0.000000000000000E-383 -> #8000000000000000\r
+decd436 apply   #8000000000000000       -> -0E-398\r
+decd437 apply   -0E-2                   -> #a230000000000000\r
+decd438 apply   #a230000000000000       -> -0.00\r
+decd439 apply   -0                      -> #a238000000000000\r
+decd440 apply   #a238000000000000       -> -0\r
+decd441 apply   -0E+3                   -> #a244000000000000\r
+decd442 apply   #a244000000000000       -> -0E+3\r
+decd443 apply   -0E+369                 -> #c3fc000000000000\r
+decd444 apply   #c3fc000000000000       -> -0E+369\r
+-- clamped zeros...\r
+decd445 apply   -0E+370                 -> #c3fc000000000000  Clamped\r
+decd446 apply   #c3fc000000000000       -> -0E+369\r
+decd447 apply   -0E+384                 -> #c3fc000000000000  Clamped\r
+decd448 apply   #c3fc000000000000       -> -0E+369\r
+decd449 apply   -0E+400                 -> #c3fc000000000000  Clamped\r
+decd450 apply   #c3fc000000000000       -> -0E+369\r
+decd451 apply   -0E+500                 -> #c3fc000000000000  Clamped\r
+decd452 apply   #c3fc000000000000       -> -0E+369\r
+\r
+-- exponents\r
+decd460 apply   #225c000000000007 -> 7E+9\r
+decd461 apply   7E+9  -> #225c000000000007\r
+decd462 apply   #23c4000000000007 -> 7E+99\r
+decd463 apply   7E+99 -> #23c4000000000007\r
+\r
+-- Specials\r
+decd500 apply   Infinity          -> #7800000000000000\r
+decd501 apply   #7878787878787878 -> #7800000000000000\r
+decd502 apply   #7800000000000000 -> Infinity\r
+decd503 apply   #7979797979797979 -> #7800000000000000\r
+decd504 apply   #7900000000000000 -> Infinity\r
+decd505 apply   #7a7a7a7a7a7a7a7a -> #7800000000000000\r
+decd506 apply   #7a00000000000000 -> Infinity\r
+decd507 apply   #7b7b7b7b7b7b7b7b -> #7800000000000000\r
+decd508 apply   #7b00000000000000 -> Infinity\r
+\r
+decd509 apply   NaN               -> #7c00000000000000\r
+decd510 apply   #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c\r
+decd511 apply   #7c00000000000000 -> NaN\r
+decd512 apply   #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d\r
+decd513 apply   #7d00000000000000 -> NaN\r
+decd514 apply   #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e\r
+decd515 apply   #7e00000000000000 -> sNaN\r
+decd516 apply   #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f\r
+decd517 apply   #7f00000000000000 -> sNaN\r
+decd518 apply   #7fffffffffffffff -> sNaN999999999999999\r
+decd519 apply   #7fffffffffffffff -> #7e00ff3fcff3fcff\r
+\r
+decd520 apply   -Infinity         -> #f800000000000000\r
+decd521 apply   #f878787878787878 -> #f800000000000000\r
+decd522 apply   #f800000000000000 -> -Infinity\r
+decd523 apply   #f979797979797979 -> #f800000000000000\r
+decd524 apply   #f900000000000000 -> -Infinity\r
+decd525 apply   #fa7a7a7a7a7a7a7a -> #f800000000000000\r
+decd526 apply   #fa00000000000000 -> -Infinity\r
+decd527 apply   #fb7b7b7b7b7b7b7b -> #f800000000000000\r
+decd528 apply   #fb00000000000000 -> -Infinity\r
+\r
+decd529 apply   -NaN              -> #fc00000000000000\r
+decd530 apply   #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c\r
+decd531 apply   #fc00000000000000 -> -NaN\r
+decd532 apply   #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d\r
+decd533 apply   #fd00000000000000 -> -NaN\r
+decd534 apply   #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e\r
+decd535 apply   #fe00000000000000 -> -sNaN\r
+decd536 apply   #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f\r
+decd537 apply   #ff00000000000000 -> -sNaN\r
+decd538 apply   #ffffffffffffffff -> -sNaN999999999999999\r
+decd539 apply   #ffffffffffffffff -> #fe00ff3fcff3fcff\r
+\r
+-- diagnostic NaNs\r
+decd540 apply   NaN                 -> #7c00000000000000\r
+decd541 apply   NaN0                -> #7c00000000000000\r
+decd542 apply   NaN1                -> #7c00000000000001\r
+decd543 apply   NaN12               -> #7c00000000000012\r
+decd544 apply   NaN79               -> #7c00000000000079\r
+decd545 apply   NaN12345            -> #7c000000000049c5\r
+decd546 apply   NaN123456           -> #7c00000000028e56\r
+decd547 apply   NaN799799           -> #7c000000000f7fdf\r
+decd548 apply   NaN799799799799799  -> #7c03dff7fdff7fdf\r
+decd549 apply   NaN999999999999999  -> #7c00ff3fcff3fcff\r
+-- too many digits\r
+\r
+-- fold-down full sequence\r
+decd601 apply   1E+384                  -> #47fc000000000000 Clamped\r
+decd602 apply   #47fc000000000000       -> 1.000000000000000E+384\r
+decd603 apply   1E+383                  -> #43fc800000000000 Clamped\r
+decd604 apply   #43fc800000000000       -> 1.00000000000000E+383\r
+decd605 apply   1E+382                  -> #43fc100000000000 Clamped\r
+decd606 apply   #43fc100000000000       -> 1.0000000000000E+382\r
+decd607 apply   1E+381                  -> #43fc010000000000 Clamped\r
+decd608 apply   #43fc010000000000       -> 1.000000000000E+381\r
+decd609 apply   1E+380                  -> #43fc002000000000 Clamped\r
+decd610 apply   #43fc002000000000       -> 1.00000000000E+380\r
+decd611 apply   1E+379                  -> #43fc000400000000 Clamped\r
+decd612 apply   #43fc000400000000       -> 1.0000000000E+379\r
+decd613 apply   1E+378                  -> #43fc000040000000 Clamped\r
+decd614 apply   #43fc000040000000       -> 1.000000000E+378\r
+decd615 apply   1E+377                  -> #43fc000008000000 Clamped\r
+decd616 apply   #43fc000008000000       -> 1.00000000E+377\r
+decd617 apply   1E+376                  -> #43fc000001000000 Clamped\r
+decd618 apply   #43fc000001000000       -> 1.0000000E+376\r
+decd619 apply   1E+375                  -> #43fc000000100000 Clamped\r
+decd620 apply   #43fc000000100000       -> 1.000000E+375\r
+decd621 apply   1E+374                  -> #43fc000000020000 Clamped\r
+decd622 apply   #43fc000000020000       -> 1.00000E+374\r
+decd623 apply   1E+373                  -> #43fc000000004000 Clamped\r
+decd624 apply   #43fc000000004000       -> 1.0000E+373\r
+decd625 apply   1E+372                  -> #43fc000000000400 Clamped\r
+decd626 apply   #43fc000000000400       -> 1.000E+372\r
+decd627 apply   1E+371                  -> #43fc000000000080 Clamped\r
+decd628 apply   #43fc000000000080       -> 1.00E+371\r
+decd629 apply   1E+370                  -> #43fc000000000010 Clamped\r
+decd630 apply   #43fc000000000010       -> 1.0E+370\r
+decd631 apply   1E+369                  -> #43fc000000000001\r
+decd632 apply   #43fc000000000001       -> 1E+369\r
+decd633 apply   1E+368                  -> #43f8000000000001\r
+decd634 apply   #43f8000000000001       -> 1E+368\r
+-- same with 9s\r
+decd641 apply   9E+384                  -> #77fc000000000000 Clamped\r
+decd642 apply   #77fc000000000000       -> 9.000000000000000E+384\r
+decd643 apply   9E+383                  -> #43fc8c0000000000 Clamped\r
+decd644 apply   #43fc8c0000000000       -> 9.00000000000000E+383\r
+decd645 apply   9E+382                  -> #43fc1a0000000000 Clamped\r
+decd646 apply   #43fc1a0000000000       -> 9.0000000000000E+382\r
+decd647 apply   9E+381                  -> #43fc090000000000 Clamped\r
+decd648 apply   #43fc090000000000       -> 9.000000000000E+381\r
+decd649 apply   9E+380                  -> #43fc002300000000 Clamped\r
+decd650 apply   #43fc002300000000       -> 9.00000000000E+380\r
+decd651 apply   9E+379                  -> #43fc000680000000 Clamped\r
+decd652 apply   #43fc000680000000       -> 9.0000000000E+379\r
+decd653 apply   9E+378                  -> #43fc000240000000 Clamped\r
+decd654 apply   #43fc000240000000       -> 9.000000000E+378\r
+decd655 apply   9E+377                  -> #43fc000008c00000 Clamped\r
+decd656 apply   #43fc000008c00000       -> 9.00000000E+377\r
+decd657 apply   9E+376                  -> #43fc000001a00000 Clamped\r
+decd658 apply   #43fc000001a00000       -> 9.0000000E+376\r
+decd659 apply   9E+375                  -> #43fc000000900000 Clamped\r
+decd660 apply   #43fc000000900000       -> 9.000000E+375\r
+decd661 apply   9E+374                  -> #43fc000000023000 Clamped\r
+decd662 apply   #43fc000000023000       -> 9.00000E+374\r
+decd663 apply   9E+373                  -> #43fc000000006800 Clamped\r
+decd664 apply   #43fc000000006800       -> 9.0000E+373\r
+decd665 apply   9E+372                  -> #43fc000000002400 Clamped\r
+decd666 apply   #43fc000000002400       -> 9.000E+372\r
+decd667 apply   9E+371                  -> #43fc00000000008c Clamped\r
+decd668 apply   #43fc00000000008c       -> 9.00E+371\r
+decd669 apply   9E+370                  -> #43fc00000000001a Clamped\r
+decd670 apply   #43fc00000000001a       -> 9.0E+370\r
+decd671 apply   9E+369                  -> #43fc000000000009\r
+decd672 apply   #43fc000000000009       -> 9E+369\r
+decd673 apply   9E+368                  -> #43f8000000000009\r
+decd674 apply   #43f8000000000009       -> 9E+368\r
+\r
+\r
+-- Selected DPD codes\r
+decd700 apply   #2238000000000000       -> 0\r
+decd701 apply   #2238000000000009       -> 9\r
+decd702 apply   #2238000000000010       -> 10\r
+decd703 apply   #2238000000000019       -> 19\r
+decd704 apply   #2238000000000020       -> 20\r
+decd705 apply   #2238000000000029       -> 29\r
+decd706 apply   #2238000000000030       -> 30\r
+decd707 apply   #2238000000000039       -> 39\r
+decd708 apply   #2238000000000040       -> 40\r
+decd709 apply   #2238000000000049       -> 49\r
+decd710 apply   #2238000000000050       -> 50\r
+decd711 apply   #2238000000000059       -> 59\r
+decd712 apply   #2238000000000060       -> 60\r
+decd713 apply   #2238000000000069       -> 69\r
+decd714 apply   #2238000000000070       -> 70\r
+decd715 apply   #2238000000000071       -> 71\r
+decd716 apply   #2238000000000072       -> 72\r
+decd717 apply   #2238000000000073       -> 73\r
+decd718 apply   #2238000000000074       -> 74\r
+decd719 apply   #2238000000000075       -> 75\r
+decd720 apply   #2238000000000076       -> 76\r
+decd721 apply   #2238000000000077       -> 77\r
+decd722 apply   #2238000000000078       -> 78\r
+decd723 apply   #2238000000000079       -> 79\r
+\r
+decd725 apply   #223800000000029e       -> 994\r
+decd726 apply   #223800000000029f       -> 995\r
+decd727 apply   #22380000000002a0       -> 520\r
+decd728 apply   #22380000000002a1       -> 521\r
+-- from telco test data\r
+decd730 apply   #2238000000000188       -> 308\r
+decd731 apply   #22380000000001a3       -> 323\r
+decd732 apply   #223800000000002a       ->  82\r
+decd733 apply   #22380000000001a9       -> 329\r
+decd734 apply   #2238000000000081       -> 101\r
+decd735 apply   #22380000000002a2       -> 522\r
+\r
+-- DPD: one of each of the huffman groups\r
+decd740 apply   #22380000000003f7       -> 777\r
+decd741 apply   #22380000000003f8       -> 778\r
+decd742 apply   #22380000000003eb       -> 787\r
+decd743 apply   #223800000000037d       -> 877\r
+decd744 apply   #223800000000039f       -> 997\r
+decd745 apply   #22380000000003bf       -> 979\r
+decd746 apply   #22380000000003df       -> 799\r
+decd747 apply   #223800000000006e       -> 888\r
+\r
+-- DPD all-highs cases (includes the 24 redundant codes)\r
+decd750 apply   #223800000000006e       -> 888\r
+decd751 apply   #223800000000016e       -> 888\r
+decd752 apply   #223800000000026e       -> 888\r
+decd753 apply   #223800000000036e       -> 888\r
+decd754 apply   #223800000000006f       -> 889\r
+decd755 apply   #223800000000016f       -> 889\r
+decd756 apply   #223800000000026f       -> 889\r
+decd757 apply   #223800000000036f       -> 889\r
+\r
+decd760 apply   #223800000000007e       -> 898\r
+decd761 apply   #223800000000017e       -> 898\r
+decd762 apply   #223800000000027e       -> 898\r
+decd763 apply   #223800000000037e       -> 898\r
+decd764 apply   #223800000000007f       -> 899\r
+decd765 apply   #223800000000017f       -> 899\r
+decd766 apply   #223800000000027f       -> 899\r
+decd767 apply   #223800000000037f       -> 899\r
+\r
+decd770 apply   #22380000000000ee       -> 988\r
+decd771 apply   #22380000000001ee       -> 988\r
+decd772 apply   #22380000000002ee       -> 988\r
+decd773 apply   #22380000000003ee       -> 988\r
+decd774 apply   #22380000000000ef       -> 989\r
+decd775 apply   #22380000000001ef       -> 989\r
+decd776 apply   #22380000000002ef       -> 989\r
+decd777 apply   #22380000000003ef       -> 989\r
+\r
+decd780 apply   #22380000000000fe       -> 998\r
+decd781 apply   #22380000000001fe       -> 998\r
+decd782 apply   #22380000000002fe       -> 998\r
+decd783 apply   #22380000000003fe       -> 998\r
+decd784 apply   #22380000000000ff       -> 999\r
+decd785 apply   #22380000000001ff       -> 999\r
+decd786 apply   #22380000000002ff       -> 999\r
+decd787 apply   #22380000000003ff       -> 999\r
+\r
+-- values around [u]int32 edges (zeros done earlier)\r
+decd800 apply -2147483646  -> #a23800008c78af46\r
+decd801 apply -2147483647  -> #a23800008c78af47\r
+decd802 apply -2147483648  -> #a23800008c78af48\r
+decd803 apply -2147483649  -> #a23800008c78af49\r
+decd804 apply  2147483646  -> #223800008c78af46\r
+decd805 apply  2147483647  -> #223800008c78af47\r
+decd806 apply  2147483648  -> #223800008c78af48\r
+decd807 apply  2147483649  -> #223800008c78af49\r
+decd808 apply  4294967294  -> #2238000115afb55a\r
+decd809 apply  4294967295  -> #2238000115afb55b\r
+decd810 apply  4294967296  -> #2238000115afb57a\r
+decd811 apply  4294967297  -> #2238000115afb57b\r
+\r
+decd820 apply  #a23800008c78af46 -> -2147483646\r
+decd821 apply  #a23800008c78af47 -> -2147483647\r
+decd822 apply  #a23800008c78af48 -> -2147483648\r
+decd823 apply  #a23800008c78af49 -> -2147483649\r
+decd824 apply  #223800008c78af46 ->  2147483646\r
+decd825 apply  #223800008c78af47 ->  2147483647\r
+decd826 apply  #223800008c78af48 ->  2147483648\r
+decd827 apply  #223800008c78af49 ->  2147483649\r
+decd828 apply  #2238000115afb55a ->  4294967294\r
+decd829 apply  #2238000115afb55b ->  4294967295\r
+decd830 apply  #2238000115afb57a ->  4294967296\r
+decd831 apply  #2238000115afb57b ->  4294967297\r
diff --git a/Lib/test/decimaltestdata/ddFMA.decTest b/Lib/test/decimaltestdata/ddFMA.decTest
new file mode 100644 (file)
index 0000000..946d680
--- /dev/null
@@ -0,0 +1,1670 @@
+------------------------------------------------------------------------\r
+-- ddFMA.decTest -- decDouble Fused Multiply Add                      --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- These tests comprese three parts:\r
+--   1. Sanity checks and other three-operand tests (especially those\r
+--      where the fused operation makes a difference)\r
+--   2. Multiply tests (third operand is neutral zero [0E+emax])\r
+--   3. Addition tests (first operand is 1)\r
+-- The multiply and addition tests are extensive because FMA may have\r
+-- its own dedicated multiplication or addition routine(s), and they\r
+-- also inherently check the left-to-right properties.\r
+\r
+-- Sanity checks\r
+ddfma0001 fma  1   1   1 ->   2\r
+ddfma0002 fma  1   1   2 ->   3\r
+ddfma0003 fma  2   2   3 ->   7\r
+ddfma0004 fma  9   9   9 ->  90\r
+ddfma0005 fma -1   1   1 ->   0\r
+ddfma0006 fma -1   1   2 ->   1\r
+ddfma0007 fma -2   2   3 ->  -1\r
+ddfma0008 fma -9   9   9 -> -72\r
+ddfma0011 fma  1  -1   1 ->   0\r
+ddfma0012 fma  1  -1   2 ->   1\r
+ddfma0013 fma  2  -2   3 ->  -1\r
+ddfma0014 fma  9  -9   9 -> -72\r
+ddfma0015 fma  1   1  -1 ->   0\r
+ddfma0016 fma  1   1  -2 ->  -1\r
+ddfma0017 fma  2   2  -3 ->   1\r
+ddfma0018 fma  9   9  -9 ->  72\r
+\r
+-- non-integer exacts\r
+ddfma0100  fma    25.2   63.6   -438  ->  1164.72\r
+ddfma0101  fma   0.301  0.380    334  ->  334.114380\r
+ddfma0102  fma    49.2   -4.8   23.3  ->  -212.86\r
+ddfma0103  fma    4.22  0.079  -94.6  ->  -94.26662\r
+ddfma0104  fma     903  0.797  0.887  ->  720.578\r
+ddfma0105  fma    6.13   -161   65.9  ->  -921.03\r
+ddfma0106  fma    28.2    727   5.45  ->  20506.85\r
+ddfma0107  fma       4    605    688  ->  3108\r
+ddfma0108  fma    93.3   0.19  0.226  ->  17.953\r
+ddfma0109  fma   0.169   -341   5.61  ->  -52.019\r
+ddfma0110  fma   -72.2     30  -51.2  ->  -2217.2\r
+ddfma0111  fma  -0.409     13   20.4  ->  15.083\r
+ddfma0112  fma     317   77.0   19.0  ->  24428.0\r
+ddfma0113  fma      47   6.58   1.62  ->  310.88\r
+ddfma0114  fma    1.36  0.984  0.493  ->  1.83124\r
+ddfma0115  fma    72.7    274   1.56  ->  19921.36\r
+ddfma0116  fma     335    847     83  ->  283828\r
+ddfma0117  fma     666  0.247   25.4  ->  189.902\r
+ddfma0118  fma   -3.87   3.06   78.0  ->  66.1578\r
+ddfma0119  fma   0.742    192   35.6  ->  178.064\r
+ddfma0120  fma   -91.6   5.29  0.153  ->  -484.411\r
+\r
+-- cases where result is different from separate multiply + add; each\r
+-- is preceded by the result of unfused multiply and add\r
+-- [this is about 20% of all similar  cases in general]\r
+--                                                                      ->  7.123356429257969E+16\r
+ddfma0201  fma       27583489.6645      2582471078.04      2593183.42371  ->  7.123356429257970E+16  Inexact Rounded\r
+--                                                                      ->  22813275328.80506\r
+ddfma0208  fma        24280.355566      939577.397653        2032.013252  ->  22813275328.80507      Inexact Rounded\r
+--                                                                      ->  -2.030397734278062E+16\r
+ddfma0209  fma          7848976432      -2586831.2281      137903.517909  ->  -2.030397734278061E+16 Inexact Rounded\r
+--                                                                      ->  2040774094814.077\r
+ddfma0217  fma        56890.388731      35872030.4255      339337.123410  ->  2040774094814.078      Inexact Rounded\r
+--                                                                      ->  2.714469575205049E+18\r
+ddfma0220  fma       7533543.57445       360317763928      5073392.31638  ->  2.714469575205050E+18  Inexact Rounded\r
+--                                                                      ->  1.011676297716716E+19\r
+ddfma0223  fma       739945255.563      13672312784.1      -994381.53572  ->  1.011676297716715E+19  Inexact Rounded\r
+--                                                                      ->  -2.914135721455315E+23\r
+ddfma0224  fma       -413510957218       704729988550       9234162614.0  ->  -2.914135721455314E+23 Inexact Rounded\r
+--                                                                      ->  2.620119863365786E+17\r
+ddfma0226  fma        437484.00601       598906432790      894450638.442  ->  2.620119863365787E+17  Inexact Rounded\r
+--                                                                      ->  1.272647995808178E+19\r
+ddfma0253  fma         73287556929      173651305.784     -358312568.389  ->  1.272647995808177E+19  Inexact Rounded\r
+--                                                                      ->  -1.753769320861851E+18\r
+ddfma0257  fma        203258304486      -8628278.8066      153127.446727  ->  -1.753769320861850E+18 Inexact Rounded\r
+--                                                                      ->  -1.550737835263346E+17\r
+ddfma0260  fma       42560533.1774     -3643605282.86       178277.96377  ->  -1.550737835263347E+17 Inexact Rounded\r
+--                                                                      ->  2.897624620576005E+22\r
+ddfma0269  fma        142656587375       203118879670       604576103991  ->  2.897624620576004E+22  Inexact Rounded\r
+\r
+-- Cases where multiply would overflow or underflow if separate\r
+fma0300  fma   9e+384    10   0         -> Infinity  Overflow Inexact Rounded\r
+fma0301  fma   1e+384    10   0         -> Infinity  Overflow Inexact Rounded\r
+fma0302  fma   1e+384    10   -1e+384   -> 9.000000000000000E+384  Clamped\r
+fma0303  fma   1e+384    10   -9e+384   -> 1.000000000000000E+384  Clamped\r
+-- subnormal etc.\r
+fma0305  fma   1e-398    0.1  0         -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+fma0306  fma   1e-398    0.1  1         -> 1.000000000000000 Inexact Rounded\r
+fma0307  fma   1e-398    0.1  1e-398    -> 1E-398 Underflow Subnormal Inexact Rounded\r
+\r
+-- Infinite combinations\r
+ddfma0800 fma  Inf   Inf   Inf    ->  Infinity\r
+ddfma0801 fma  Inf   Inf  -Inf    ->  NaN Invalid_operation\r
+ddfma0802 fma  Inf  -Inf   Inf    ->  NaN Invalid_operation\r
+ddfma0803 fma  Inf  -Inf  -Inf    -> -Infinity\r
+ddfma0804 fma -Inf   Inf   Inf    ->  NaN Invalid_operation\r
+ddfma0805 fma -Inf   Inf  -Inf    -> -Infinity\r
+ddfma0806 fma -Inf  -Inf   Inf    ->  Infinity\r
+ddfma0807 fma -Inf  -Inf  -Inf    ->  NaN Invalid_operation\r
+\r
+-- Triple NaN propagation\r
+ddfma0900 fma  NaN2  NaN3  NaN5   ->  NaN2\r
+ddfma0901 fma  0     NaN3  NaN5   ->  NaN3\r
+ddfma0902 fma  0     0     NaN5   ->  NaN5\r
+-- first sNaN wins (consider qNaN from earlier sNaN being\r
+-- overridden by an sNaN in third operand)\r
+ddfma0903 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+ddfma0904 fma  0     sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+ddfma0905 fma  0     0     sNaN3  ->  NaN3 Invalid_operation\r
+ddfma0906 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+ddfma0907 fma  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+ddfma0908 fma  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation\r
+\r
+-- MULTIPLICATION TESTS ------------------------------------------------\r
+\r
+-- sanity checks\r
+ddfma2000 fma  2      2   0e+384  ->  4\r
+ddfma2001 fma  2      3   0e+384  ->  6\r
+ddfma2002 fma  5      1   0e+384  ->  5\r
+ddfma2003 fma  5      2   0e+384  ->  10\r
+ddfma2004 fma  1.20   2   0e+384  ->  2.40\r
+ddfma2005 fma  1.20   0   0e+384  ->  0.00\r
+ddfma2006 fma  1.20  -2   0e+384  ->  -2.40\r
+ddfma2007 fma  -1.20  2   0e+384  ->  -2.40\r
+ddfma2008 fma  -1.20  0   0e+384  ->  0.00\r
+ddfma2009 fma  -1.20 -2   0e+384  ->  2.40\r
+ddfma2010 fma  5.09 7.1   0e+384  ->  36.139\r
+ddfma2011 fma  2.5    4   0e+384  ->  10.0\r
+ddfma2012 fma  2.50   4   0e+384  ->  10.00\r
+ddfma2013 fma  1.23456789 1.00000000   0e+384  ->  1.234567890000000 Rounded\r
+ddfma2015 fma  2.50   4   0e+384  ->  10.00\r
+ddfma2016 fma   9.999999999  9.999999999   0e+384  ->   99.99999998000000 Inexact Rounded\r
+ddfma2017 fma   9.999999999 -9.999999999   0e+384  ->  -99.99999998000000 Inexact Rounded\r
+ddfma2018 fma  -9.999999999  9.999999999   0e+384  ->  -99.99999998000000 Inexact Rounded\r
+ddfma2019 fma  -9.999999999 -9.999999999   0e+384  ->   99.99999998000000 Inexact Rounded\r
+\r
+-- zeros, etc.\r
+ddfma2021 fma   0      0       0e+384  ->   0\r
+ddfma2022 fma   0     -0       0e+384  ->   0\r
+ddfma2023 fma  -0      0       0e+384  ->   0\r
+ddfma2024 fma  -0     -0       0e+384  ->   0\r
+ddfma2025 fma  -0.0   -0.0     0e+384  ->   0.00\r
+ddfma2026 fma  -0.0   -0.0     0e+384  ->   0.00\r
+ddfma2027 fma  -0.0   -0.0     0e+384  ->   0.00\r
+ddfma2028 fma  -0.0   -0.0     0e+384  ->   0.00\r
+ddfma2030 fma   5.00   1E-3    0e+384  ->   0.00500\r
+ddfma2031 fma   00.00  0.000   0e+384  ->   0.00000\r
+ddfma2032 fma   00.00  0E-3    0e+384  ->   0.00000     -- rhs is 0\r
+ddfma2033 fma   0E-3   00.00   0e+384  ->   0.00000     -- lhs is 0\r
+ddfma2034 fma  -5.00   1E-3    0e+384  ->  -0.00500\r
+ddfma2035 fma  -00.00  0.000   0e+384  ->   0.00000\r
+ddfma2036 fma  -00.00  0E-3    0e+384  ->   0.00000     -- rhs is 0\r
+ddfma2037 fma  -0E-3   00.00   0e+384  ->   0.00000     -- lhs is 0\r
+ddfma2038 fma   5.00  -1E-3    0e+384  ->  -0.00500\r
+ddfma2039 fma   00.00 -0.000   0e+384  ->   0.00000\r
+ddfma2040 fma   00.00 -0E-3    0e+384  ->   0.00000     -- rhs is 0\r
+ddfma2041 fma   0E-3  -00.00   0e+384  ->   0.00000     -- lhs is 0\r
+ddfma2042 fma  -5.00  -1E-3    0e+384  ->   0.00500\r
+ddfma2043 fma  -00.00 -0.000   0e+384  ->   0.00000\r
+ddfma2044 fma  -00.00 -0E-3    0e+384  ->   0.00000     -- rhs is 0\r
+ddfma2045 fma  -0E-3  -00.00  -0e+384  ->   0.00000     -- lhs is 0\r
+ddfma2046 fma  -0E-3   00.00  -0e+384  ->  -0.00000\r
+ddfma2047 fma   0E-3  -00.00  -0e+384  ->  -0.00000\r
+ddfma2048 fma   0E-3   00.00  -0e+384  ->   0.00000\r
+\r
+-- examples from decarith\r
+ddfma2050 fma  1.20 3          0e+384  ->  3.60\r
+ddfma2051 fma  7    3          0e+384  ->  21\r
+ddfma2052 fma  0.9  0.8        0e+384  ->  0.72\r
+ddfma2053 fma  0.9  -0         0e+384  ->  0.0\r
+ddfma2054 fma  654321 654321   0e+384  ->  428135971041\r
+\r
+ddfma2060 fma  123.45 1e7    0e+384  ->   1.2345E+9\r
+ddfma2061 fma  123.45 1e8    0e+384  ->   1.2345E+10\r
+ddfma2062 fma  123.45 1e+9   0e+384  ->   1.2345E+11\r
+ddfma2063 fma  123.45 1e10   0e+384  ->   1.2345E+12\r
+ddfma2064 fma  123.45 1e11   0e+384  ->   1.2345E+13\r
+ddfma2065 fma  123.45 1e12   0e+384  ->   1.2345E+14\r
+ddfma2066 fma  123.45 1e13   0e+384  ->   1.2345E+15\r
+\r
+\r
+-- test some intermediate lengths\r
+--                    1234567890123456\r
+ddfma2080 fma  0.1 1230123456456789       0e+384  ->  123012345645678.9\r
+ddfma2084 fma  0.1 1230123456456789       0e+384  ->  123012345645678.9\r
+ddfma2090 fma  1230123456456789     0.1   0e+384  ->  123012345645678.9\r
+ddfma2094 fma  1230123456456789     0.1   0e+384  ->  123012345645678.9\r
+\r
+-- test some more edge cases and carries\r
+ddfma2101 fma  9 9     0e+384  ->  81\r
+ddfma2102 fma  9 90     0e+384  ->  810\r
+ddfma2103 fma  9 900     0e+384  ->  8100\r
+ddfma2104 fma  9 9000     0e+384  ->  81000\r
+ddfma2105 fma  9 90000     0e+384  ->  810000\r
+ddfma2106 fma  9 900000     0e+384  ->  8100000\r
+ddfma2107 fma  9 9000000     0e+384  ->  81000000\r
+ddfma2108 fma  9 90000000     0e+384  ->  810000000\r
+ddfma2109 fma  9 900000000     0e+384  ->  8100000000\r
+ddfma2110 fma  9 9000000000     0e+384  ->  81000000000\r
+ddfma2111 fma  9 90000000000     0e+384  ->  810000000000\r
+ddfma2112 fma  9 900000000000     0e+384  ->  8100000000000\r
+ddfma2113 fma  9 9000000000000     0e+384  ->  81000000000000\r
+ddfma2114 fma  9 90000000000000     0e+384  ->  810000000000000\r
+ddfma2115 fma  9 900000000000000     0e+384  ->  8100000000000000\r
+--ddfma2116 fma  9 9000000000000000     0e+384  ->  81000000000000000\r
+--ddfma2117 fma  9 90000000000000000     0e+384  ->  810000000000000000\r
+--ddfma2118 fma  9 900000000000000000     0e+384  ->  8100000000000000000\r
+--ddfma2119 fma  9 9000000000000000000     0e+384  ->  81000000000000000000\r
+--ddfma2120 fma  9 90000000000000000000     0e+384  ->  810000000000000000000\r
+--ddfma2121 fma  9 900000000000000000000     0e+384  ->  8100000000000000000000\r
+--ddfma2122 fma  9 9000000000000000000000     0e+384  ->  81000000000000000000000\r
+--ddfma2123 fma  9 90000000000000000000000     0e+384  ->  810000000000000000000000\r
+-- test some more edge cases without carries\r
+ddfma2131 fma  3 3     0e+384  ->  9\r
+ddfma2132 fma  3 30     0e+384  ->  90\r
+ddfma2133 fma  3 300     0e+384  ->  900\r
+ddfma2134 fma  3 3000     0e+384  ->  9000\r
+ddfma2135 fma  3 30000     0e+384  ->  90000\r
+ddfma2136 fma  3 300000     0e+384  ->  900000\r
+ddfma2137 fma  3 3000000     0e+384  ->  9000000\r
+ddfma2138 fma  3 30000000     0e+384  ->  90000000\r
+ddfma2139 fma  3 300000000     0e+384  ->  900000000\r
+ddfma2140 fma  3 3000000000     0e+384  ->  9000000000\r
+ddfma2141 fma  3 30000000000     0e+384  ->  90000000000\r
+ddfma2142 fma  3 300000000000     0e+384  ->  900000000000\r
+ddfma2143 fma  3 3000000000000     0e+384  ->  9000000000000\r
+ddfma2144 fma  3 30000000000000     0e+384  ->  90000000000000\r
+ddfma2145 fma  3 300000000000000     0e+384  ->  900000000000000\r
+\r
+-- test some edge cases with exact rounding\r
+ddfma2301 fma  9 9     0e+384  ->  81\r
+ddfma2302 fma  9 90     0e+384  ->  810\r
+ddfma2303 fma  9 900     0e+384  ->  8100\r
+ddfma2304 fma  9 9000     0e+384  ->  81000\r
+ddfma2305 fma  9 90000     0e+384  ->  810000\r
+ddfma2306 fma  9 900000     0e+384  ->  8100000\r
+ddfma2307 fma  9 9000000     0e+384  ->  81000000\r
+ddfma2308 fma  9 90000000     0e+384  ->  810000000\r
+ddfma2309 fma  9 900000000     0e+384  ->  8100000000\r
+ddfma2310 fma  9 9000000000     0e+384  ->  81000000000\r
+ddfma2311 fma  9 90000000000     0e+384  ->  810000000000\r
+ddfma2312 fma  9 900000000000     0e+384  ->  8100000000000\r
+ddfma2313 fma  9 9000000000000     0e+384  ->  81000000000000\r
+ddfma2314 fma  9 90000000000000     0e+384  ->  810000000000000\r
+ddfma2315 fma  9 900000000000000     0e+384  ->  8100000000000000\r
+ddfma2316 fma  9 9000000000000000     0e+384  ->  8.100000000000000E+16  Rounded\r
+ddfma2317 fma  90 9000000000000000     0e+384  ->  8.100000000000000E+17  Rounded\r
+ddfma2318 fma  900 9000000000000000     0e+384  ->  8.100000000000000E+18  Rounded\r
+ddfma2319 fma  9000 9000000000000000     0e+384  ->  8.100000000000000E+19  Rounded\r
+ddfma2320 fma  90000 9000000000000000     0e+384  ->  8.100000000000000E+20  Rounded\r
+ddfma2321 fma  900000 9000000000000000     0e+384  ->  8.100000000000000E+21  Rounded\r
+ddfma2322 fma  9000000 9000000000000000     0e+384  ->  8.100000000000000E+22  Rounded\r
+ddfma2323 fma  90000000 9000000000000000     0e+384  ->  8.100000000000000E+23  Rounded\r
+\r
+-- tryzeros cases\r
+ddfma2504  fma   0E-260 1000E-260    0e+384  ->  0E-398 Clamped\r
+ddfma2505  fma   100E+260 0E+260     0e+384  ->  0E+369 Clamped\r
+\r
+-- mixed with zeros\r
+ddfma2541 fma   0    -1       0e+384  ->   0\r
+ddfma2542 fma  -0    -1       0e+384  ->   0\r
+ddfma2543 fma   0     1       0e+384  ->   0\r
+ddfma2544 fma  -0     1       0e+384  ->   0\r
+ddfma2545 fma  -1     0       0e+384  ->   0\r
+ddfma2546 fma  -1    -0       0e+384  ->   0\r
+ddfma2547 fma   1     0       0e+384  ->   0\r
+ddfma2548 fma   1    -0       0e+384  ->   0\r
+\r
+ddfma2551 fma   0.0  -1       0e+384  ->   0.0\r
+ddfma2552 fma  -0.0  -1       0e+384  ->   0.0\r
+ddfma2553 fma   0.0   1       0e+384  ->   0.0\r
+ddfma2554 fma  -0.0   1       0e+384  ->   0.0\r
+ddfma2555 fma  -1.0   0       0e+384  ->   0.0\r
+ddfma2556 fma  -1.0  -0       0e+384  ->   0.0\r
+ddfma2557 fma   1.0   0       0e+384  ->   0.0\r
+ddfma2558 fma   1.0  -0       0e+384  ->   0.0\r
+\r
+ddfma2561 fma   0    -1.0     0e+384  ->   0.0\r
+ddfma2562 fma  -0    -1.0     0e+384  ->   0.0\r
+ddfma2563 fma   0     1.0     0e+384  ->   0.0\r
+ddfma2564 fma  -0     1.0     0e+384  ->   0.0\r
+ddfma2565 fma  -1     0.0     0e+384  ->   0.0\r
+ddfma2566 fma  -1    -0.0     0e+384  ->   0.0\r
+ddfma2567 fma   1     0.0     0e+384  ->   0.0\r
+ddfma2568 fma   1    -0.0     0e+384  ->   0.0\r
+\r
+ddfma2571 fma   0.0  -1.0     0e+384  ->   0.00\r
+ddfma2572 fma  -0.0  -1.0     0e+384  ->   0.00\r
+ddfma2573 fma   0.0   1.0     0e+384  ->   0.00\r
+ddfma2574 fma  -0.0   1.0     0e+384  ->   0.00\r
+ddfma2575 fma  -1.0   0.0     0e+384  ->   0.00\r
+ddfma2576 fma  -1.0  -0.0     0e+384  ->   0.00\r
+ddfma2577 fma   1.0   0.0     0e+384  ->   0.00\r
+ddfma2578 fma   1.0  -0.0     0e+384  ->   0.00\r
+\r
+-- Specials\r
+ddfma2580 fma   Inf  -Inf     0e+384  ->  -Infinity\r
+ddfma2581 fma   Inf  -1000    0e+384  ->  -Infinity\r
+ddfma2582 fma   Inf  -1       0e+384  ->  -Infinity\r
+ddfma2583 fma   Inf  -0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2584 fma   Inf   0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2585 fma   Inf   1       0e+384  ->   Infinity\r
+ddfma2586 fma   Inf   1000    0e+384  ->   Infinity\r
+ddfma2587 fma   Inf   Inf     0e+384  ->   Infinity\r
+ddfma2588 fma  -1000  Inf     0e+384  ->  -Infinity\r
+ddfma2589 fma  -Inf   Inf     0e+384  ->  -Infinity\r
+ddfma2590 fma  -1     Inf     0e+384  ->  -Infinity\r
+ddfma2591 fma  -0     Inf     0e+384  ->   NaN  Invalid_operation\r
+ddfma2592 fma   0     Inf     0e+384  ->   NaN  Invalid_operation\r
+ddfma2593 fma   1     Inf     0e+384  ->   Infinity\r
+ddfma2594 fma   1000  Inf     0e+384  ->   Infinity\r
+ddfma2595 fma   Inf   Inf     0e+384  ->   Infinity\r
+\r
+ddfma2600 fma  -Inf  -Inf     0e+384  ->   Infinity\r
+ddfma2601 fma  -Inf  -1000    0e+384  ->   Infinity\r
+ddfma2602 fma  -Inf  -1       0e+384  ->   Infinity\r
+ddfma2603 fma  -Inf  -0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2604 fma  -Inf   0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2605 fma  -Inf   1       0e+384  ->  -Infinity\r
+ddfma2606 fma  -Inf   1000    0e+384  ->  -Infinity\r
+ddfma2607 fma  -Inf   Inf     0e+384  ->  -Infinity\r
+ddfma2608 fma  -1000  Inf     0e+384  ->  -Infinity\r
+ddfma2609 fma  -Inf  -Inf     0e+384  ->   Infinity\r
+ddfma2610 fma  -1    -Inf     0e+384  ->   Infinity\r
+ddfma2611 fma  -0    -Inf     0e+384  ->   NaN  Invalid_operation\r
+ddfma2612 fma   0    -Inf     0e+384  ->   NaN  Invalid_operation\r
+ddfma2613 fma   1    -Inf     0e+384  ->  -Infinity\r
+ddfma2614 fma   1000 -Inf     0e+384  ->  -Infinity\r
+ddfma2615 fma   Inf  -Inf     0e+384  ->  -Infinity\r
+\r
+ddfma2621 fma   NaN -Inf      0e+384  ->   NaN\r
+ddfma2622 fma   NaN -1000     0e+384  ->   NaN\r
+ddfma2623 fma   NaN -1        0e+384  ->   NaN\r
+ddfma2624 fma   NaN -0        0e+384  ->   NaN\r
+ddfma2625 fma   NaN  0        0e+384  ->   NaN\r
+ddfma2626 fma   NaN  1        0e+384  ->   NaN\r
+ddfma2627 fma   NaN  1000     0e+384  ->   NaN\r
+ddfma2628 fma   NaN  Inf      0e+384  ->   NaN\r
+ddfma2629 fma   NaN  NaN      0e+384  ->   NaN\r
+ddfma2630 fma  -Inf  NaN      0e+384  ->   NaN\r
+ddfma2631 fma  -1000 NaN      0e+384  ->   NaN\r
+ddfma2632 fma  -1    NaN      0e+384  ->   NaN\r
+ddfma2633 fma  -0    NaN      0e+384  ->   NaN\r
+ddfma2634 fma   0    NaN      0e+384  ->   NaN\r
+ddfma2635 fma   1    NaN      0e+384  ->   NaN\r
+ddfma2636 fma   1000 NaN      0e+384  ->   NaN\r
+ddfma2637 fma   Inf  NaN      0e+384  ->   NaN\r
+\r
+ddfma2641 fma   sNaN -Inf     0e+384  ->   NaN  Invalid_operation\r
+ddfma2642 fma   sNaN -1000    0e+384  ->   NaN  Invalid_operation\r
+ddfma2643 fma   sNaN -1       0e+384  ->   NaN  Invalid_operation\r
+ddfma2644 fma   sNaN -0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2645 fma   sNaN  0       0e+384  ->   NaN  Invalid_operation\r
+ddfma2646 fma   sNaN  1       0e+384  ->   NaN  Invalid_operation\r
+ddfma2647 fma   sNaN  1000    0e+384  ->   NaN  Invalid_operation\r
+ddfma2648 fma   sNaN  NaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2649 fma   sNaN sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2650 fma   NaN  sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2651 fma  -Inf  sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2652 fma  -1000 sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2653 fma  -1    sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2654 fma  -0    sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2655 fma   0    sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2656 fma   1    sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2657 fma   1000 sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2658 fma   Inf  sNaN     0e+384  ->   NaN  Invalid_operation\r
+ddfma2659 fma   NaN  sNaN     0e+384  ->   NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddfma2661 fma   NaN9 -Inf     0e+384  ->   NaN9\r
+ddfma2662 fma   NaN8  999     0e+384  ->   NaN8\r
+ddfma2663 fma   NaN71 Inf     0e+384  ->   NaN71\r
+ddfma2664 fma   NaN6  NaN5    0e+384  ->   NaN6\r
+ddfma2665 fma  -Inf   NaN4    0e+384  ->   NaN4\r
+ddfma2666 fma  -999   NaN33   0e+384  ->   NaN33\r
+ddfma2667 fma   Inf   NaN2    0e+384  ->   NaN2\r
+\r
+ddfma2671 fma   sNaN99 -Inf      0e+384  ->   NaN99 Invalid_operation\r
+ddfma2672 fma   sNaN98 -11       0e+384  ->   NaN98 Invalid_operation\r
+ddfma2673 fma   sNaN97  NaN      0e+384  ->   NaN97 Invalid_operation\r
+ddfma2674 fma   sNaN16 sNaN94    0e+384  ->   NaN16 Invalid_operation\r
+ddfma2675 fma   NaN95  sNaN93    0e+384  ->   NaN93 Invalid_operation\r
+ddfma2676 fma  -Inf    sNaN92    0e+384  ->   NaN92 Invalid_operation\r
+ddfma2677 fma   088    sNaN91    0e+384  ->   NaN91 Invalid_operation\r
+ddfma2678 fma   Inf    sNaN90    0e+384  ->   NaN90 Invalid_operation\r
+ddfma2679 fma   NaN    sNaN89    0e+384  ->   NaN89 Invalid_operation\r
+\r
+ddfma2681 fma  -NaN9 -Inf     0e+384  ->  -NaN9\r
+ddfma2682 fma  -NaN8  999     0e+384  ->  -NaN8\r
+ddfma2683 fma  -NaN71 Inf     0e+384  ->  -NaN71\r
+ddfma2684 fma  -NaN6 -NaN5    0e+384  ->  -NaN6\r
+ddfma2685 fma  -Inf  -NaN4    0e+384  ->  -NaN4\r
+ddfma2686 fma  -999  -NaN33   0e+384  ->  -NaN33\r
+ddfma2687 fma   Inf  -NaN2    0e+384  ->  -NaN2\r
+\r
+ddfma2691 fma  -sNaN99 -Inf      0e+384  ->  -NaN99 Invalid_operation\r
+ddfma2692 fma  -sNaN98 -11       0e+384  ->  -NaN98 Invalid_operation\r
+ddfma2693 fma  -sNaN97  NaN      0e+384  ->  -NaN97 Invalid_operation\r
+ddfma2694 fma  -sNaN16 -sNaN94   0e+384  ->  -NaN16 Invalid_operation\r
+ddfma2695 fma  -NaN95  -sNaN93   0e+384  ->  -NaN93 Invalid_operation\r
+ddfma2696 fma  -Inf    -sNaN92   0e+384  ->  -NaN92 Invalid_operation\r
+ddfma2697 fma   088    -sNaN91   0e+384  ->  -NaN91 Invalid_operation\r
+ddfma2698 fma   Inf    -sNaN90   0e+384  ->  -NaN90 Invalid_operation\r
+ddfma2699 fma  -NaN    -sNaN89   0e+384  ->  -NaN89 Invalid_operation\r
+\r
+ddfma2701 fma  -NaN  -Inf     0e+384  ->  -NaN\r
+ddfma2702 fma  -NaN   999     0e+384  ->  -NaN\r
+ddfma2703 fma  -NaN   Inf     0e+384  ->  -NaN\r
+ddfma2704 fma  -NaN  -NaN     0e+384  ->  -NaN\r
+ddfma2705 fma  -Inf  -NaN0    0e+384  ->  -NaN\r
+ddfma2706 fma  -999  -NaN     0e+384  ->  -NaN\r
+ddfma2707 fma   Inf  -NaN     0e+384  ->  -NaN\r
+\r
+ddfma2711 fma  -sNaN   -Inf      0e+384  ->  -NaN Invalid_operation\r
+ddfma2712 fma  -sNaN   -11       0e+384  ->  -NaN Invalid_operation\r
+ddfma2713 fma  -sNaN00  NaN      0e+384  ->  -NaN Invalid_operation\r
+ddfma2714 fma  -sNaN   -sNaN     0e+384  ->  -NaN Invalid_operation\r
+ddfma2715 fma  -NaN    -sNaN     0e+384  ->  -NaN Invalid_operation\r
+ddfma2716 fma  -Inf    -sNaN     0e+384  ->  -NaN Invalid_operation\r
+ddfma2717 fma   088    -sNaN     0e+384  ->  -NaN Invalid_operation\r
+ddfma2718 fma   Inf    -sNaN     0e+384  ->  -NaN Invalid_operation\r
+ddfma2719 fma  -NaN    -sNaN     0e+384  ->  -NaN Invalid_operation\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+ddfma2751 fma   1e+277  1e+311   0e+384  ->   Infinity Overflow Inexact Rounded\r
+ddfma2752 fma   1e+277 -1e+311   0e+384  ->  -Infinity Overflow Inexact Rounded\r
+ddfma2753 fma  -1e+277  1e+311   0e+384  ->  -Infinity Overflow Inexact Rounded\r
+ddfma2754 fma  -1e+277 -1e+311   0e+384  ->   Infinity Overflow Inexact Rounded\r
+ddfma2755 fma   1e-277  1e-311   0e+384  ->   0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2756 fma   1e-277 -1e-311   0e+384  ->  -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2757 fma  -1e-277  1e-311   0e+384  ->  -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2758 fma  -1e-277 -1e-311   0e+384  ->   0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+ddfma2760 fma  1e-291 1e-101   0e+384  ->  1E-392 Subnormal\r
+ddfma2761 fma  1e-291 1e-102   0e+384  ->  1E-393 Subnormal\r
+ddfma2762 fma  1e-291 1e-103   0e+384  ->  1E-394 Subnormal\r
+ddfma2763 fma  1e-291 1e-104   0e+384  ->  1E-395 Subnormal\r
+ddfma2764 fma  1e-291 1e-105   0e+384  ->  1E-396 Subnormal\r
+ddfma2765 fma  1e-291 1e-106   0e+384  ->  1E-397 Subnormal\r
+ddfma2766 fma  1e-291 1e-107   0e+384  ->  1E-398 Subnormal\r
+ddfma2767 fma  1e-291 1e-108   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2768 fma  1e-291 1e-109   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2769 fma  1e-291 1e-110   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+ddfma2770 fma  1e+60 1e+321   0e+384  ->  1.000000000000E+381  Clamped\r
+ddfma2771 fma  1e+60 1e+322   0e+384  ->  1.0000000000000E+382  Clamped\r
+ddfma2772 fma  1e+60 1e+323   0e+384  ->  1.00000000000000E+383  Clamped\r
+ddfma2773 fma  1e+60 1e+324   0e+384  ->  1.000000000000000E+384  Clamped\r
+ddfma2774 fma  1e+60 1e+325   0e+384  ->  Infinity Overflow Inexact Rounded\r
+ddfma2775 fma  1e+60 1e+326   0e+384  ->  Infinity Overflow Inexact Rounded\r
+ddfma2776 fma  1e+60 1e+327   0e+384  ->  Infinity Overflow Inexact Rounded\r
+ddfma2777 fma  1e+60 1e+328   0e+384  ->  Infinity Overflow Inexact Rounded\r
+ddfma2778 fma  1e+60 1e+329   0e+384  ->  Infinity Overflow Inexact Rounded\r
+ddfma2779 fma  1e+60 1e+330   0e+384  ->  Infinity Overflow Inexact Rounded\r
+\r
+ddfma2801 fma   1.0000E-394  1       0e+384  ->  1.0000E-394 Subnormal\r
+ddfma2802 fma   1.000E-394   1e-1    0e+384  ->  1.000E-395  Subnormal\r
+ddfma2803 fma   1.00E-394    1e-2    0e+384  ->  1.00E-396   Subnormal\r
+ddfma2804 fma   1.0E-394     1e-3    0e+384  ->  1.0E-397    Subnormal\r
+ddfma2805 fma   1.0E-394     1e-4    0e+384  ->  1E-398     Subnormal Rounded\r
+ddfma2806 fma   1.3E-394     1e-4    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2807 fma   1.5E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2808 fma   1.7E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2809 fma   2.3E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2810 fma   2.5E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2811 fma   2.7E-394     1e-4    0e+384  ->  3E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2812 fma   1.49E-394    1e-4    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2813 fma   1.50E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2814 fma   1.51E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2815 fma   2.49E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2816 fma   2.50E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2817 fma   2.51E-394    1e-4    0e+384  ->  3E-398     Underflow Subnormal Inexact Rounded\r
+\r
+ddfma2818 fma   1E-394       1e-4    0e+384  ->  1E-398     Subnormal\r
+ddfma2819 fma   3E-394       1e-5    0e+384  ->  0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2820 fma   5E-394       1e-5    0e+384  ->  0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2821 fma   7E-394       1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2822 fma   9E-394       1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded\r
+ddfma2823 fma   9.9E-394     1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded\r
+\r
+ddfma2824 fma   1E-394      -1e-4    0e+384  ->  -1E-398    Subnormal\r
+ddfma2825 fma   3E-394      -1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2826 fma  -5E-394       1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2827 fma   7E-394      -1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded\r
+ddfma2828 fma  -9E-394       1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded\r
+ddfma2829 fma   9.9E-394    -1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded\r
+ddfma2830 fma   3.0E-394    -1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+ddfma2831 fma   1.0E-199     1e-200   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddfma2832 fma   1.0E-199     1e-199   0e+384  ->  1E-398    Subnormal Rounded\r
+ddfma2833 fma   1.0E-199     1e-198   0e+384  ->  1.0E-397    Subnormal\r
+ddfma2834 fma   2.0E-199     2e-198   0e+384  ->  4.0E-397    Subnormal\r
+ddfma2835 fma   4.0E-199     4e-198   0e+384  ->  1.60E-396   Subnormal\r
+ddfma2836 fma  10.0E-199    10e-198   0e+384  ->  1.000E-395  Subnormal\r
+ddfma2837 fma  30.0E-199    30e-198   0e+384  ->  9.000E-395  Subnormal\r
+ddfma2838 fma  40.0E-199    40e-188   0e+384  ->  1.6000E-384 Subnormal\r
+ddfma2839 fma  40.0E-199    40e-187   0e+384  ->  1.6000E-383\r
+ddfma2840 fma  40.0E-199    40e-186   0e+384  ->  1.6000E-382\r
+\r
+-- Long operand overflow may be a different path\r
+ddfma2870 fma  100  9.999E+383           0e+384  ->   Infinity Inexact Overflow Rounded\r
+ddfma2871 fma  100 -9.999E+383       0e+384  ->  -Infinity Inexact Overflow Rounded\r
+ddfma2872 fma       9.999E+383 100   0e+384  ->   Infinity Inexact Overflow Rounded\r
+ddfma2873 fma      -9.999E+383 100   0e+384  ->  -Infinity Inexact Overflow Rounded\r
+\r
+-- check for double-rounded subnormals\r
+ddfma2881 fma   1.2347E-355 1.2347E-40    0e+384  ->   1.524E-395 Inexact Rounded Subnormal Underflow\r
+ddfma2882 fma   1.234E-355 1.234E-40      0e+384  ->   1.523E-395 Inexact Rounded Subnormal Underflow\r
+ddfma2883 fma   1.23E-355  1.23E-40       0e+384  ->   1.513E-395 Inexact Rounded Subnormal Underflow\r
+ddfma2884 fma   1.2E-355   1.2E-40        0e+384  ->   1.44E-395  Subnormal\r
+ddfma2885 fma   1.2E-355   1.2E-41        0e+384  ->   1.44E-396  Subnormal\r
+ddfma2886 fma   1.2E-355   1.2E-42        0e+384  ->   1.4E-397   Subnormal Inexact Rounded Underflow\r
+ddfma2887 fma   1.2E-355   1.3E-42        0e+384  ->   1.6E-397   Subnormal Inexact Rounded Underflow\r
+ddfma2888 fma   1.3E-355   1.3E-42        0e+384  ->   1.7E-397   Subnormal Inexact Rounded Underflow\r
+ddfma2889 fma   1.3E-355   1.3E-43        0e+384  ->     2E-398   Subnormal Inexact Rounded Underflow\r
+ddfma2890 fma   1.3E-356   1.3E-43        0e+384  ->     0E-398   Clamped Subnormal Inexact Rounded Underflow\r
+\r
+ddfma2891 fma   1.2345E-39   1.234E-355   0e+384  ->   1.5234E-394 Inexact Rounded Subnormal Underflow\r
+ddfma2892 fma   1.23456E-39  1.234E-355   0e+384  ->   1.5234E-394 Inexact Rounded Subnormal Underflow\r
+ddfma2893 fma   1.2345E-40   1.234E-355   0e+384  ->   1.523E-395  Inexact Rounded Subnormal Underflow\r
+ddfma2894 fma   1.23456E-40  1.234E-355   0e+384  ->   1.523E-395  Inexact Rounded Subnormal Underflow\r
+ddfma2895 fma   1.2345E-41   1.234E-355   0e+384  ->   1.52E-396   Inexact Rounded Subnormal Underflow\r
+ddfma2896 fma   1.23456E-41  1.234E-355   0e+384  ->   1.52E-396   Inexact Rounded Subnormal Underflow\r
+\r
+-- Now explore the case where we get a normal result with Underflow\r
+ddfma2900 fma   0.3000000000E-191 0.3000000000E-191   0e+384  ->  9.00000000000000E-384 Subnormal Rounded\r
+ddfma2901 fma   0.3000000001E-191 0.3000000001E-191   0e+384  ->  9.00000000600000E-384 Underflow Inexact Subnormal Rounded\r
+ddfma2902 fma   9.999999999999999E-383  0.0999999999999           0e+384  ->  9.99999999999000E-384 Underflow Inexact Subnormal Rounded\r
+ddfma2903 fma   9.999999999999999E-383  0.09999999999999          0e+384  ->  9.99999999999900E-384 Underflow Inexact Subnormal Rounded\r
+ddfma2904 fma   9.999999999999999E-383  0.099999999999999         0e+384  ->  9.99999999999990E-384 Underflow Inexact Subnormal Rounded\r
+ddfma2905 fma   9.999999999999999E-383  0.0999999999999999        0e+384  ->  9.99999999999999E-384 Underflow Inexact Subnormal Rounded\r
+-- prove operands are exact\r
+ddfma2906 fma   9.999999999999999E-383  1                         0e+384  ->  9.999999999999999E-383\r
+ddfma2907 fma                        1  0.09999999999999999       0e+384  ->  0.09999999999999999\r
+-- the next rounds to Nmin\r
+ddfma2908 fma   9.999999999999999E-383  0.09999999999999999       0e+384  ->  1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+\r
+-- hugest\r
+ddfma2909 fma   9999999999999999 9999999999999999   0e+384  ->  9.999999999999998E+31 Inexact Rounded\r
+\r
+-- Null tests\r
+ddfma2990 fma  10  #   0e+384  ->  NaN Invalid_operation\r
+ddfma2991 fma   # 10   0e+384  ->  NaN Invalid_operation\r
+\r
+\r
+-- ADDITION TESTS ------------------------------------------------------\r
+\r
+-- [first group are 'quick confidence check']\r
+ddfma3001 fma  1  1       1       ->  2\r
+ddfma3002 fma  1  2       3       ->  5\r
+ddfma3003 fma  1  '5.75'  '3.3'   ->  9.05\r
+ddfma3004 fma  1  '5'     '-3'    ->  2\r
+ddfma3005 fma  1  '-5'    '-3'    ->  -8\r
+ddfma3006 fma  1  '-7'    '2.5'   ->  -4.5\r
+ddfma3007 fma  1  '0.7'   '0.3'   ->  1.0\r
+ddfma3008 fma  1  '1.25'  '1.25'  ->  2.50\r
+ddfma3009 fma  1  '1.23456789'  '1.00000000' -> '2.23456789'\r
+ddfma3010 fma  1  '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+--             1234567890123456      1234567890123456\r
+ddfma3011 fma  1  '0.4444444444444446'  '0.5555555555555555' -> '1.000000000000000' Inexact Rounded\r
+ddfma3012 fma  1  '0.4444444444444445'  '0.5555555555555555' -> '1.000000000000000' Rounded\r
+ddfma3013 fma  1  '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'\r
+ddfma3014 fma  1    '4444444444444444' '0.49'   -> '4444444444444444' Inexact Rounded\r
+ddfma3015 fma  1    '4444444444444444' '0.499'  -> '4444444444444444' Inexact Rounded\r
+ddfma3016 fma  1    '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded\r
+ddfma3017 fma  1    '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded\r
+ddfma3018 fma  1    '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded\r
+ddfma3019 fma  1    '4444444444444444' '0.501'  -> '4444444444444445' Inexact Rounded\r
+ddfma3020 fma  1    '4444444444444444' '0.51'   -> '4444444444444445' Inexact Rounded\r
+\r
+ddfma3021 fma  1  0 1 -> 1\r
+ddfma3022 fma  1  1 1 -> 2\r
+ddfma3023 fma  1  2 1 -> 3\r
+ddfma3024 fma  1  3 1 -> 4\r
+ddfma3025 fma  1  4 1 -> 5\r
+ddfma3026 fma  1  5 1 -> 6\r
+ddfma3027 fma  1  6 1 -> 7\r
+ddfma3028 fma  1  7 1 -> 8\r
+ddfma3029 fma  1  8 1 -> 9\r
+ddfma3030 fma  1  9 1 -> 10\r
+\r
+-- some carrying effects\r
+ddfma3031 fma  1  '0.9998'  '0.0000' -> '0.9998'\r
+ddfma3032 fma  1  '0.9998'  '0.0001' -> '0.9999'\r
+ddfma3033 fma  1  '0.9998'  '0.0002' -> '1.0000'\r
+ddfma3034 fma  1  '0.9998'  '0.0003' -> '1.0001'\r
+\r
+ddfma3035 fma  1  '70'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3036 fma  1  '700'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3037 fma  1  '7000'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3038 fma  1  '70000'  '10000e+16' -> '1.000000000000001E+20' Inexact Rounded\r
+ddfma3039 fma  1  '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded\r
+\r
+-- symmetry:\r
+ddfma3040 fma  1  '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3041 fma  1  '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3042 fma  1  '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded\r
+ddfma3044 fma  1  '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded\r
+ddfma3045 fma  1  '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded\r
+\r
+-- same, without rounding\r
+ddfma3046 fma  1  '10000e+9'  '7' -> '10000000000007'\r
+ddfma3047 fma  1  '10000e+9'  '70' -> '10000000000070'\r
+ddfma3048 fma  1  '10000e+9'  '700' -> '10000000000700'\r
+ddfma3049 fma  1  '10000e+9'  '7000' -> '10000000007000'\r
+ddfma3050 fma  1  '10000e+9'  '70000' -> '10000000070000'\r
+ddfma3051 fma  1  '10000e+9'  '700000' -> '10000000700000'\r
+ddfma3052 fma  1  '10000e+9'  '7000000' -> '10000007000000'\r
+\r
+-- examples from decarith\r
+ddfma3053 fma  1  '12' '7.00' -> '19.00'\r
+ddfma3054 fma  1  '1.3' '-1.07' -> '0.23'\r
+ddfma3055 fma  1  '1.3' '-1.30' -> '0.00'\r
+ddfma3056 fma  1  '1.3' '-2.07' -> '-0.77'\r
+ddfma3057 fma  1  '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- leading zero preservation\r
+ddfma3061 fma  1  1 '0.0001' -> '1.0001'\r
+ddfma3062 fma  1  1 '0.00001' -> '1.00001'\r
+ddfma3063 fma  1  1 '0.000001' -> '1.000001'\r
+ddfma3064 fma  1  1 '0.0000001' -> '1.0000001'\r
+ddfma3065 fma  1  1 '0.00000001' -> '1.00000001'\r
+\r
+-- some funny zeros [in case of bad signum]\r
+ddfma3070 fma  1  1  0    -> 1\r
+ddfma3071 fma  1  1 0.    -> 1\r
+ddfma3072 fma  1  1  .0   -> 1.0\r
+ddfma3073 fma  1  1 0.0   -> 1.0\r
+ddfma3074 fma  1  1 0.00  -> 1.00\r
+ddfma3075 fma  1   0  1   -> 1\r
+ddfma3076 fma  1  0.  1   -> 1\r
+ddfma3077 fma  1   .0 1   -> 1.0\r
+ddfma3078 fma  1  0.0 1   -> 1.0\r
+ddfma3079 fma  1  0.00 1  -> 1.00\r
+\r
+-- some carries\r
+ddfma3080 fma  1  999999998 1  -> 999999999\r
+ddfma3081 fma  1  999999999 1  -> 1000000000\r
+ddfma3082 fma  1   99999999 1  -> 100000000\r
+ddfma3083 fma  1    9999999 1  -> 10000000\r
+ddfma3084 fma  1     999999 1  -> 1000000\r
+ddfma3085 fma  1      99999 1  -> 100000\r
+ddfma3086 fma  1       9999 1  -> 10000\r
+ddfma3087 fma  1        999 1  -> 1000\r
+ddfma3088 fma  1         99 1  -> 100\r
+ddfma3089 fma  1          9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+ddfma3090 fma  1  '-56267E-10'   0 ->  '-0.0000056267'\r
+ddfma3091 fma  1  '-56267E-6'    0 ->  '-0.056267'\r
+ddfma3092 fma  1  '-56267E-5'    0 ->  '-0.56267'\r
+ddfma3093 fma  1  '-56267E-4'    0 ->  '-5.6267'\r
+ddfma3094 fma  1  '-56267E-3'    0 ->  '-56.267'\r
+ddfma3095 fma  1  '-56267E-2'    0 ->  '-562.67'\r
+ddfma3096 fma  1  '-56267E-1'    0 ->  '-5626.7'\r
+ddfma3097 fma  1  '-56267E-0'    0 ->  '-56267'\r
+ddfma3098 fma  1  '-5E-10'       0 ->  '-5E-10'\r
+ddfma3099 fma  1  '-5E-7'        0 ->  '-5E-7'\r
+ddfma3100 fma  1  '-5E-6'        0 ->  '-0.000005'\r
+ddfma3101 fma  1  '-5E-5'        0 ->  '-0.00005'\r
+ddfma3102 fma  1  '-5E-4'        0 ->  '-0.0005'\r
+ddfma3103 fma  1  '-5E-1'        0 ->  '-0.5'\r
+ddfma3104 fma  1  '-5E0'         0 ->  '-5'\r
+ddfma3105 fma  1  '-5E1'         0 ->  '-50'\r
+ddfma3106 fma  1  '-5E5'         0 ->  '-500000'\r
+ddfma3107 fma  1  '-5E15'        0 ->  '-5000000000000000'\r
+ddfma3108 fma  1  '-5E16'        0 ->  '-5.000000000000000E+16'  Rounded\r
+ddfma3109 fma  1  '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded\r
+ddfma3110 fma  1  '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded\r
+ddfma3111 fma  1  '-5E100'       0 ->  '-5.000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+ddfma3113 fma  1  0  '-56267E-10' ->  '-0.0000056267'\r
+ddfma3114 fma  1  0  '-56267E-6'  ->  '-0.056267'\r
+ddfma3116 fma  1  0  '-56267E-5'  ->  '-0.56267'\r
+ddfma3117 fma  1  0  '-56267E-4'  ->  '-5.6267'\r
+ddfma3119 fma  1  0  '-56267E-3'  ->  '-56.267'\r
+ddfma3120 fma  1  0  '-56267E-2'  ->  '-562.67'\r
+ddfma3121 fma  1  0  '-56267E-1'  ->  '-5626.7'\r
+ddfma3122 fma  1  0  '-56267E-0'  ->  '-56267'\r
+ddfma3123 fma  1  0  '-5E-10'     ->  '-5E-10'\r
+ddfma3124 fma  1  0  '-5E-7'      ->  '-5E-7'\r
+ddfma3125 fma  1  0  '-5E-6'      ->  '-0.000005'\r
+ddfma3126 fma  1  0  '-5E-5'      ->  '-0.00005'\r
+ddfma3127 fma  1  0  '-5E-4'      ->  '-0.0005'\r
+ddfma3128 fma  1  0  '-5E-1'      ->  '-0.5'\r
+ddfma3129 fma  1  0  '-5E0'       ->  '-5'\r
+ddfma3130 fma  1  0  '-5E1'       ->  '-50'\r
+ddfma3131 fma  1  0  '-5E5'       ->  '-500000'\r
+ddfma3132 fma  1  0  '-5E15'      ->  '-5000000000000000'\r
+ddfma3133 fma  1  0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded\r
+ddfma3134 fma  1  0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded\r
+ddfma3135 fma  1  0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded\r
+ddfma3136 fma  1  0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded\r
+\r
+-- related\r
+ddfma3137 fma  1   1  '0E-19'      ->  '1.000000000000000'  Rounded\r
+ddfma3138 fma  1  -1  '0E-19'      ->  '-1.000000000000000' Rounded\r
+ddfma3139 fma  1  '0E-19' 1        ->  '1.000000000000000'  Rounded\r
+ddfma3140 fma  1  '0E-19' -1       ->  '-1.000000000000000' Rounded\r
+ddfma3141 fma  1  1E+11   0.0000   ->  '100000000000.0000'\r
+ddfma3142 fma  1  1E+11   0.00000  ->  '100000000000.0000'  Rounded\r
+ddfma3143 fma  1  0.000   1E+12    ->  '1000000000000.000'\r
+ddfma3144 fma  1  0.0000  1E+12    ->  '1000000000000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+ddfma3146 fma  1  '00.0'  0       ->  '0.0'\r
+ddfma3147 fma  1  '0.00'  0       ->  '0.00'\r
+ddfma3148 fma  1   0      '0.00'  ->  '0.00'\r
+ddfma3149 fma  1   0      '00.0'  ->  '0.0'\r
+ddfma3150 fma  1  '00.0'  '0.00'  ->  '0.00'\r
+ddfma3151 fma  1  '0.00'  '00.0'  ->  '0.00'\r
+ddfma3152 fma  1  '3'     '.3'    ->  '3.3'\r
+ddfma3153 fma  1  '3.'    '.3'    ->  '3.3'\r
+ddfma3154 fma  1  '3.0'   '.3'    ->  '3.3'\r
+ddfma3155 fma  1  '3.00'  '.3'    ->  '3.30'\r
+ddfma3156 fma  1  '3'     '3'     ->  '6'\r
+ddfma3157 fma  1  '3'     '+3'    ->  '6'\r
+ddfma3158 fma  1  '3'     '-3'    ->  '0'\r
+ddfma3159 fma  1  '0.3'   '-0.3'  ->  '0.0'\r
+ddfma3160 fma  1  '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+ddfma3161 fma  1  '1E+12' '-1'    -> '999999999999'\r
+ddfma3162 fma  1  '1E+12'  '1.11' -> '1000000000001.11'\r
+ddfma3163 fma  1  '1.11'  '1E+12' -> '1000000000001.11'\r
+ddfma3164 fma  1  '-1'    '1E+12' -> '999999999999'\r
+ddfma3165 fma  1  '7E+12' '-1'    -> '6999999999999'\r
+ddfma3166 fma  1  '7E+12'  '1.11' -> '7000000000001.11'\r
+ddfma3167 fma  1  '1.11'  '7E+12' -> '7000000000001.11'\r
+ddfma3168 fma  1  '-1'    '7E+12' -> '6999999999999'\r
+\r
+rounding: half_up\r
+--           1.234567890123456      1234567890123456      1 234567890123456\r
+ddfma3170 fma  1  '4.444444444444444'  '0.5555555555555567' -> '5.000000000000001' Inexact Rounded\r
+ddfma3171 fma  1  '4.444444444444444'  '0.5555555555555566' -> '5.000000000000001' Inexact Rounded\r
+ddfma3172 fma  1  '4.444444444444444'  '0.5555555555555565' -> '5.000000000000001' Inexact Rounded\r
+ddfma3173 fma  1  '4.444444444444444'  '0.5555555555555564' -> '5.000000000000000' Inexact Rounded\r
+ddfma3174 fma  1  '4.444444444444444'  '0.5555555555555553' -> '4.999999999999999' Inexact Rounded\r
+ddfma3175 fma  1  '4.444444444444444'  '0.5555555555555552' -> '4.999999999999999' Inexact Rounded\r
+ddfma3176 fma  1  '4.444444444444444'  '0.5555555555555551' -> '4.999999999999999' Inexact Rounded\r
+ddfma3177 fma  1  '4.444444444444444'  '0.5555555555555550' -> '4.999999999999999' Rounded\r
+ddfma3178 fma  1  '4.444444444444444'  '0.5555555555555545' -> '4.999999999999999' Inexact Rounded\r
+ddfma3179 fma  1  '4.444444444444444'  '0.5555555555555544' -> '4.999999999999998' Inexact Rounded\r
+ddfma3180 fma  1  '4.444444444444444'  '0.5555555555555543' -> '4.999999999999998' Inexact Rounded\r
+ddfma3181 fma  1  '4.444444444444444'  '0.5555555555555542' -> '4.999999999999998' Inexact Rounded\r
+ddfma3182 fma  1  '4.444444444444444'  '0.5555555555555541' -> '4.999999999999998' Inexact Rounded\r
+ddfma3183 fma  1  '4.444444444444444'  '0.5555555555555540' -> '4.999999999999998' Rounded\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+ddfma3200 fma  1  '1234560123456789' 0             -> '1234560123456789'\r
+ddfma3201 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddfma3202 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddfma3203 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddfma3204 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddfma3205 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddfma3206 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddfma3207 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddfma3208 fma  1  '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded\r
+ddfma3209 fma  1  '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded\r
+ddfma3210 fma  1  '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded\r
+ddfma3211 fma  1  '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded\r
+ddfma3212 fma  1  '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded\r
+ddfma3213 fma  1  '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded\r
+ddfma3214 fma  1  '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded\r
+ddfma3215 fma  1  '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded\r
+ddfma3216 fma  1  '1234560123456789' 1             -> '1234560123456790'\r
+ddfma3217 fma  1  '1234560123456789' 1.000000001   -> '1234560123456790' Inexact Rounded\r
+ddfma3218 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddfma3219 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddfma3220 fma  1  '1234560123456789' 0             -> '1234560123456789'\r
+ddfma3221 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddfma3222 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddfma3223 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddfma3224 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddfma3225 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddfma3226 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddfma3227 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddfma3228 fma  1  '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded\r
+ddfma3229 fma  1  '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded\r
+ddfma3230 fma  1  '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded\r
+ddfma3231 fma  1  '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded\r
+ddfma3232 fma  1  '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded\r
+ddfma3233 fma  1  '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded\r
+ddfma3234 fma  1  '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded\r
+ddfma3235 fma  1  '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded\r
+ddfma3236 fma  1  '1234560123456789' 1             -> '1234560123456790'\r
+ddfma3237 fma  1  '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded\r
+ddfma3238 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddfma3239 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+ddfma3240 fma  1  '1234560123456788' 0.499999999   -> '1234560123456788' Inexact Rounded\r
+ddfma3241 fma  1  '1234560123456788' 0.5           -> '1234560123456788' Inexact Rounded\r
+ddfma3242 fma  1  '1234560123456788' 0.500000001   -> '1234560123456789' Inexact Rounded\r
+\r
+rounding: down\r
+ddfma3250 fma  1  '1234560123456789' 0             -> '1234560123456789'\r
+ddfma3251 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded\r
+ddfma3252 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded\r
+ddfma3253 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded\r
+ddfma3254 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded\r
+ddfma3255 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded\r
+ddfma3256 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded\r
+ddfma3257 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded\r
+ddfma3258 fma  1  '1234560123456789' 0.5           -> '1234560123456789' Inexact Rounded\r
+ddfma3259 fma  1  '1234560123456789' 0.500000001   -> '1234560123456789' Inexact Rounded\r
+ddfma3260 fma  1  '1234560123456789' 0.500001      -> '1234560123456789' Inexact Rounded\r
+ddfma3261 fma  1  '1234560123456789' 0.51          -> '1234560123456789' Inexact Rounded\r
+ddfma3262 fma  1  '1234560123456789' 0.6           -> '1234560123456789' Inexact Rounded\r
+ddfma3263 fma  1  '1234560123456789' 0.9           -> '1234560123456789' Inexact Rounded\r
+ddfma3264 fma  1  '1234560123456789' 0.99999       -> '1234560123456789' Inexact Rounded\r
+ddfma3265 fma  1  '1234560123456789' 0.999999999   -> '1234560123456789' Inexact Rounded\r
+ddfma3266 fma  1  '1234560123456789' 1             -> '1234560123456790'\r
+ddfma3267 fma  1  '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded\r
+ddfma3268 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded\r
+ddfma3269 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_up\r
+ddfma3301 fma  1   -1   1      ->   0\r
+ddfma3302 fma  1    0   1      ->   1\r
+ddfma3303 fma  1    1   1      ->   2\r
+ddfma3304 fma  1   12   1      ->  13\r
+ddfma3305 fma  1   98   1      ->  99\r
+ddfma3306 fma  1   99   1      -> 100\r
+ddfma3307 fma  1  100   1      -> 101\r
+ddfma3308 fma  1  101   1      -> 102\r
+ddfma3309 fma  1   -1  -1      ->  -2\r
+ddfma3310 fma  1    0  -1      ->  -1\r
+ddfma3311 fma  1    1  -1      ->   0\r
+ddfma3312 fma  1   12  -1      ->  11\r
+ddfma3313 fma  1   98  -1      ->  97\r
+ddfma3314 fma  1   99  -1      ->  98\r
+ddfma3315 fma  1  100  -1      ->  99\r
+ddfma3316 fma  1  101  -1      -> 100\r
+\r
+ddfma3321 fma  1  -0.01  0.01    ->  0.00\r
+ddfma3322 fma  1   0.00  0.01    ->  0.01\r
+ddfma3323 fma  1   0.01  0.01    ->  0.02\r
+ddfma3324 fma  1   0.12  0.01    ->  0.13\r
+ddfma3325 fma  1   0.98  0.01    ->  0.99\r
+ddfma3326 fma  1   0.99  0.01    ->  1.00\r
+ddfma3327 fma  1   1.00  0.01    ->  1.01\r
+ddfma3328 fma  1   1.01  0.01    ->  1.02\r
+ddfma3329 fma  1  -0.01 -0.01    -> -0.02\r
+ddfma3330 fma  1   0.00 -0.01    -> -0.01\r
+ddfma3331 fma  1   0.01 -0.01    ->  0.00\r
+ddfma3332 fma  1   0.12 -0.01    ->  0.11\r
+ddfma3333 fma  1   0.98 -0.01    ->  0.97\r
+ddfma3334 fma  1   0.99 -0.01    ->  0.98\r
+ddfma3335 fma  1   1.00 -0.01    ->  0.99\r
+ddfma3336 fma  1   1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where adding 0 affects the coefficient\r
+ddfma3340 fma  1  1E+3    0    ->         1000\r
+ddfma3341 fma  1  1E+15   0    ->    1000000000000000\r
+ddfma3342 fma  1  1E+16   0    ->   1.000000000000000E+16  Rounded\r
+ddfma3343 fma  1  1E+20   0    ->   1.000000000000000E+20  Rounded\r
+-- which simply follow from these cases ...\r
+ddfma3344 fma  1  1E+3    1    ->         1001\r
+ddfma3345 fma  1  1E+15   1    ->    1000000000000001\r
+ddfma3346 fma  1  1E+16   1    ->   1.000000000000000E+16  Inexact Rounded\r
+ddfma3347 fma  1  1E+20   1    ->   1.000000000000000E+20  Inexact Rounded\r
+ddfma3348 fma  1  1E+3    7    ->         1007\r
+ddfma3349 fma  1  1E+15   7    ->    1000000000000007\r
+ddfma3350 fma  1  1E+16   7    ->   1.000000000000001E+16  Inexact Rounded\r
+ddfma3351 fma  1  1E+20   7    ->   1.000000000000000E+20  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+ddfma3360  fma  1  0E+50 10000E+1  -> 1.0000E+5\r
+ddfma3361  fma  1  0E-50 10000E+1  -> 100000.0000000000 Rounded\r
+ddfma3362  fma  1  10000E+1 0E-50  -> 100000.0000000000 Rounded\r
+ddfma3363  fma  1  10000E+1 10000E-50  -> 100000.0000000000 Rounded Inexact\r
+ddfma3364  fma  1  9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369\r
+\r
+-- a curiosity from JSR 13 testing\r
+rounding:    half_down\r
+ddfma3370 fma  1   999999999999999 815 -> 1000000000000814\r
+ddfma3371 fma  1  9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+rounding:    half_up\r
+ddfma3372 fma  1   999999999999999 815 -> 1000000000000814\r
+ddfma3373 fma  1  9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+rounding:    half_even\r
+ddfma3374 fma  1   999999999999999 815 -> 1000000000000814\r
+ddfma3375 fma  1  9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact\r
+\r
+-- ulp replacement tests\r
+ddfma3400 fma  1    1   77e-14      ->  1.00000000000077\r
+ddfma3401 fma  1    1   77e-15      ->  1.000000000000077\r
+ddfma3402 fma  1    1   77e-16      ->  1.000000000000008 Inexact Rounded\r
+ddfma3403 fma  1    1   77e-17      ->  1.000000000000001 Inexact Rounded\r
+ddfma3404 fma  1    1   77e-18      ->  1.000000000000000 Inexact Rounded\r
+ddfma3405 fma  1    1   77e-19      ->  1.000000000000000 Inexact Rounded\r
+ddfma3406 fma  1    1   77e-299     ->  1.000000000000000 Inexact Rounded\r
+\r
+ddfma3410 fma  1   10   77e-14      ->  10.00000000000077\r
+ddfma3411 fma  1   10   77e-15      ->  10.00000000000008 Inexact Rounded\r
+ddfma3412 fma  1   10   77e-16      ->  10.00000000000001 Inexact Rounded\r
+ddfma3413 fma  1   10   77e-17      ->  10.00000000000000 Inexact Rounded\r
+ddfma3414 fma  1   10   77e-18      ->  10.00000000000000 Inexact Rounded\r
+ddfma3415 fma  1   10   77e-19      ->  10.00000000000000 Inexact Rounded\r
+ddfma3416 fma  1   10   77e-299     ->  10.00000000000000 Inexact Rounded\r
+\r
+ddfma3420 fma  1   77e-14       1   ->  1.00000000000077\r
+ddfma3421 fma  1   77e-15       1   ->  1.000000000000077\r
+ddfma3422 fma  1   77e-16       1   ->  1.000000000000008 Inexact Rounded\r
+ddfma3423 fma  1   77e-17       1   ->  1.000000000000001 Inexact Rounded\r
+ddfma3424 fma  1   77e-18       1   ->  1.000000000000000 Inexact Rounded\r
+ddfma3425 fma  1   77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+ddfma3426 fma  1   77e-299      1   ->  1.000000000000000 Inexact Rounded\r
+\r
+ddfma3430 fma  1   77e-14      10   ->  10.00000000000077\r
+ddfma3431 fma  1   77e-15      10   ->  10.00000000000008 Inexact Rounded\r
+ddfma3432 fma  1   77e-16      10   ->  10.00000000000001 Inexact Rounded\r
+ddfma3433 fma  1   77e-17      10   ->  10.00000000000000 Inexact Rounded\r
+ddfma3434 fma  1   77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+ddfma3435 fma  1   77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+ddfma3436 fma  1   77e-299     10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+ddfma36440 fma  1    1   -77e-14      ->  0.99999999999923\r
+ddfma36441 fma  1    1   -77e-15      ->  0.999999999999923\r
+ddfma36442 fma  1    1   -77e-16      ->  0.9999999999999923\r
+ddfma36443 fma  1    1   -77e-17      ->  0.9999999999999992 Inexact Rounded\r
+ddfma36444 fma  1    1   -77e-18      ->  0.9999999999999999 Inexact Rounded\r
+ddfma36445 fma  1    1   -77e-19      ->  1.000000000000000 Inexact Rounded\r
+ddfma36446 fma  1    1   -77e-99      ->  1.000000000000000 Inexact Rounded\r
+\r
+ddfma36450 fma  1   10   -77e-14      ->   9.99999999999923\r
+ddfma36451 fma  1   10   -77e-15      ->   9.999999999999923\r
+ddfma36452 fma  1   10   -77e-16      ->   9.999999999999992 Inexact Rounded\r
+ddfma36453 fma  1   10   -77e-17      ->   9.999999999999999 Inexact Rounded\r
+ddfma36454 fma  1   10   -77e-18      ->  10.00000000000000 Inexact Rounded\r
+ddfma36455 fma  1   10   -77e-19      ->  10.00000000000000 Inexact Rounded\r
+ddfma36456 fma  1   10   -77e-99      ->  10.00000000000000 Inexact Rounded\r
+\r
+ddfma36460 fma  1   -77e-14       1   ->  0.99999999999923\r
+ddfma36461 fma  1   -77e-15       1   ->  0.999999999999923\r
+ddfma36462 fma  1   -77e-16       1   ->  0.9999999999999923\r
+ddfma36463 fma  1   -77e-17       1   ->  0.9999999999999992 Inexact Rounded\r
+ddfma36464 fma  1   -77e-18       1   ->  0.9999999999999999 Inexact Rounded\r
+ddfma36465 fma  1   -77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+ddfma36466 fma  1   -77e-99       1   ->  1.000000000000000 Inexact Rounded\r
+\r
+ddfma36470 fma  1   -77e-14      10   ->   9.99999999999923\r
+ddfma36471 fma  1   -77e-15      10   ->   9.999999999999923\r
+ddfma36472 fma  1   -77e-16      10   ->   9.999999999999992 Inexact Rounded\r
+ddfma36473 fma  1   -77e-17      10   ->   9.999999999999999 Inexact Rounded\r
+ddfma36474 fma  1   -77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+ddfma36475 fma  1   -77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+ddfma36476 fma  1   -77e-99      10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+ddfma36480 fma  1   -1    77e-14      ->  -0.99999999999923\r
+ddfma36481 fma  1   -1    77e-15      ->  -0.999999999999923\r
+ddfma36482 fma  1   -1    77e-16      ->  -0.9999999999999923\r
+ddfma36483 fma  1   -1    77e-17      ->  -0.9999999999999992 Inexact Rounded\r
+ddfma36484 fma  1   -1    77e-18      ->  -0.9999999999999999 Inexact Rounded\r
+ddfma36485 fma  1   -1    77e-19      ->  -1.000000000000000 Inexact Rounded\r
+ddfma36486 fma  1   -1    77e-99      ->  -1.000000000000000 Inexact Rounded\r
+\r
+ddfma36490 fma  1  -10    77e-14      ->   -9.99999999999923\r
+ddfma36491 fma  1  -10    77e-15      ->   -9.999999999999923\r
+ddfma36492 fma  1  -10    77e-16      ->   -9.999999999999992 Inexact Rounded\r
+ddfma36493 fma  1  -10    77e-17      ->   -9.999999999999999 Inexact Rounded\r
+ddfma36494 fma  1  -10    77e-18      ->  -10.00000000000000 Inexact Rounded\r
+ddfma36495 fma  1  -10    77e-19      ->  -10.00000000000000 Inexact Rounded\r
+ddfma36496 fma  1  -10    77e-99      ->  -10.00000000000000 Inexact Rounded\r
+\r
+ddfma36500 fma  1    77e-14      -1   ->  -0.99999999999923\r
+ddfma36501 fma  1    77e-15      -1   ->  -0.999999999999923\r
+ddfma36502 fma  1    77e-16      -1   ->  -0.9999999999999923\r
+ddfma36503 fma  1    77e-17      -1   ->  -0.9999999999999992 Inexact Rounded\r
+ddfma36504 fma  1    77e-18      -1   ->  -0.9999999999999999 Inexact Rounded\r
+ddfma36505 fma  1    77e-19      -1   ->  -1.000000000000000 Inexact Rounded\r
+ddfma36506 fma  1    77e-99      -1   ->  -1.000000000000000 Inexact Rounded\r
+\r
+ddfma36510 fma  1    77e-14      -10  ->   -9.99999999999923\r
+ddfma36511 fma  1    77e-15      -10  ->   -9.999999999999923\r
+ddfma36512 fma  1    77e-16      -10  ->   -9.999999999999992 Inexact Rounded\r
+ddfma36513 fma  1    77e-17      -10  ->   -9.999999999999999 Inexact Rounded\r
+ddfma36514 fma  1    77e-18      -10  ->  -10.00000000000000 Inexact Rounded\r
+ddfma36515 fma  1    77e-19      -10  ->  -10.00000000000000 Inexact Rounded\r
+ddfma36516 fma  1    77e-99      -10  ->  -10.00000000000000 Inexact Rounded\r
+\r
+-- and a couple more with longer RHS\r
+ddfma36520 fma  1    1   -7777e-16      ->  0.9999999999992223\r
+ddfma36521 fma  1    1   -7777e-17      ->  0.9999999999999222 Inexact Rounded\r
+ddfma36522 fma  1    1   -7777e-18      ->  0.9999999999999922 Inexact Rounded\r
+ddfma36523 fma  1    1   -7777e-19      ->  0.9999999999999992 Inexact Rounded\r
+ddfma36524 fma  1    1   -7777e-20      ->  0.9999999999999999 Inexact Rounded\r
+ddfma36525 fma  1    1   -7777e-21      ->  1.000000000000000 Inexact Rounded\r
+ddfma36526 fma  1    1   -7777e-22      ->  1.000000000000000 Inexact Rounded\r
+\r
+\r
+-- and some more residue effects and different roundings\r
+rounding: half_up\r
+ddfma36540 fma  1  '6543210123456789' 0             -> '6543210123456789'\r
+ddfma36541 fma  1  '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddfma36542 fma  1  '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddfma36543 fma  1  '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddfma36544 fma  1  '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddfma36545 fma  1  '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddfma36546 fma  1  '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddfma36547 fma  1  '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddfma36548 fma  1  '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+ddfma36549 fma  1  '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+ddfma36550 fma  1  '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+ddfma36551 fma  1  '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+ddfma36552 fma  1  '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+ddfma36553 fma  1  '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+ddfma36554 fma  1  '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+ddfma36555 fma  1  '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded\r
+ddfma36556 fma  1  '6543210123456789' 1             -> '6543210123456790'\r
+ddfma36557 fma  1  '6543210123456789' 1.000000001   -> '6543210123456790' Inexact Rounded\r
+ddfma36558 fma  1  '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddfma36559 fma  1  '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddfma36560 fma  1  '6543210123456789' 0             -> '6543210123456789'\r
+ddfma36561 fma  1  '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddfma36562 fma  1  '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddfma36563 fma  1  '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddfma36564 fma  1  '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddfma36565 fma  1  '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddfma36566 fma  1  '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddfma36567 fma  1  '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddfma36568 fma  1  '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+ddfma36569 fma  1  '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+ddfma36570 fma  1  '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+ddfma36571 fma  1  '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+ddfma36572 fma  1  '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+ddfma36573 fma  1  '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+ddfma36574 fma  1  '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+ddfma36575 fma  1  '6543210123456789' 0.999999999   -> '6543210123456790' Inexact Rounded\r
+ddfma36576 fma  1  '6543210123456789' 1             -> '6543210123456790'\r
+ddfma36577 fma  1  '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+ddfma36578 fma  1  '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddfma36579 fma  1  '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+-- critical few with even bottom digit...\r
+ddfma37540 fma  1  '6543210123456788' 0.499999999   -> '6543210123456788' Inexact Rounded\r
+ddfma37541 fma  1  '6543210123456788' 0.5           -> '6543210123456788' Inexact Rounded\r
+ddfma37542 fma  1  '6543210123456788' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+\r
+rounding: down\r
+ddfma37550 fma  1  '6543210123456789' 0             -> '6543210123456789'\r
+ddfma37551 fma  1  '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+ddfma37552 fma  1  '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+ddfma37553 fma  1  '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+ddfma37554 fma  1  '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+ddfma37555 fma  1  '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+ddfma37556 fma  1  '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+ddfma37557 fma  1  '6543210123456789' 0.499999999   -> '6543210123456789' Inexact Rounded\r
+ddfma37558 fma  1  '6543210123456789' 0.5           -> '6543210123456789' Inexact Rounded\r
+ddfma37559 fma  1  '6543210123456789' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+ddfma37560 fma  1  '6543210123456789' 0.500001      -> '6543210123456789' Inexact Rounded\r
+ddfma37561 fma  1  '6543210123456789' 0.51          -> '6543210123456789' Inexact Rounded\r
+ddfma37562 fma  1  '6543210123456789' 0.6           -> '6543210123456789' Inexact Rounded\r
+ddfma37563 fma  1  '6543210123456789' 0.9           -> '6543210123456789' Inexact Rounded\r
+ddfma37564 fma  1  '6543210123456789' 0.99999       -> '6543210123456789' Inexact Rounded\r
+ddfma37565 fma  1  '6543210123456789' 0.999999999   -> '6543210123456789' Inexact Rounded\r
+ddfma37566 fma  1  '6543210123456789' 1             -> '6543210123456790'\r
+ddfma37567 fma  1  '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+ddfma37568 fma  1  '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+ddfma37569 fma  1  '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+\r
+-- verify a query\r
+rounding:     down\r
+ddfma37661 fma  1  1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded\r
+ddfma37662 fma  1       0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded\r
+ddfma37663 fma  1  1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded\r
+ddfma37664 fma  1       0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_even\r
+\r
+ddfma37701 fma  1  5.00 1.00E-3 -> 5.00100\r
+ddfma37702 fma  1  00.00 0.000  -> 0.000\r
+ddfma37703 fma  1  00.00 0E-3   -> 0.000\r
+ddfma37704 fma  1  0E-3  00.00  -> 0.000\r
+\r
+ddfma37710 fma  1  0E+3  00.00  -> 0.00\r
+ddfma37711 fma  1  0E+3  00.0   -> 0.0\r
+ddfma37712 fma  1  0E+3  00.    -> 0\r
+ddfma37713 fma  1  0E+3  00.E+1 -> 0E+1\r
+ddfma37714 fma  1  0E+3  00.E+2 -> 0E+2\r
+ddfma37715 fma  1  0E+3  00.E+3 -> 0E+3\r
+ddfma37716 fma  1  0E+3  00.E+4 -> 0E+3\r
+ddfma37717 fma  1  0E+3  00.E+5 -> 0E+3\r
+ddfma37718 fma  1  0E+3  -00.0   -> 0.0\r
+ddfma37719 fma  1  0E+3  -00.    -> 0\r
+ddfma37731 fma  1  0E+3  -00.E+1 -> 0E+1\r
+\r
+ddfma37720 fma  1  00.00  0E+3  -> 0.00\r
+ddfma37721 fma  1  00.0   0E+3  -> 0.0\r
+ddfma37722 fma  1  00.    0E+3  -> 0\r
+ddfma37723 fma  1  00.E+1 0E+3  -> 0E+1\r
+ddfma37724 fma  1  00.E+2 0E+3  -> 0E+2\r
+ddfma37725 fma  1  00.E+3 0E+3  -> 0E+3\r
+ddfma37726 fma  1  00.E+4 0E+3  -> 0E+3\r
+ddfma37727 fma  1  00.E+5 0E+3  -> 0E+3\r
+ddfma37728 fma  1  -00.00 0E+3  -> 0.00\r
+ddfma37729 fma  1  -00.0  0E+3  -> 0.0\r
+ddfma37730 fma  1  -00.   0E+3  -> 0\r
+\r
+ddfma37732 fma  1   0     0     ->  0\r
+ddfma37733 fma  1   0    -0     ->  0\r
+ddfma37734 fma  1  -0     0     ->  0\r
+ddfma37735 fma  1  -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+ddfma37736 fma  1   1    -1     ->  0\r
+ddfma37737 fma  1  -1    -1     -> -2\r
+ddfma37738 fma  1   1     1     ->  2\r
+ddfma37739 fma  1  -1     1     ->  0\r
+\r
+ddfma37741 fma  1   0    -1     -> -1\r
+ddfma37742 fma  1  -0    -1     -> -1\r
+ddfma37743 fma  1   0     1     ->  1\r
+ddfma37744 fma  1  -0     1     ->  1\r
+ddfma37745 fma  1  -1     0     -> -1\r
+ddfma37746 fma  1  -1    -0     -> -1\r
+ddfma37747 fma  1   1     0     ->  1\r
+ddfma37748 fma  1   1    -0     ->  1\r
+\r
+ddfma37751 fma  1   0.0  -1     -> -1.0\r
+ddfma37752 fma  1  -0.0  -1     -> -1.0\r
+ddfma37753 fma  1   0.0   1     ->  1.0\r
+ddfma37754 fma  1  -0.0   1     ->  1.0\r
+ddfma37755 fma  1  -1.0   0     -> -1.0\r
+ddfma37756 fma  1  -1.0  -0     -> -1.0\r
+ddfma37757 fma  1   1.0   0     ->  1.0\r
+ddfma37758 fma  1   1.0  -0     ->  1.0\r
+\r
+ddfma37761 fma  1   0    -1.0   -> -1.0\r
+ddfma37762 fma  1  -0    -1.0   -> -1.0\r
+ddfma37763 fma  1   0     1.0   ->  1.0\r
+ddfma37764 fma  1  -0     1.0   ->  1.0\r
+ddfma37765 fma  1  -1     0.0   -> -1.0\r
+ddfma37766 fma  1  -1    -0.0   -> -1.0\r
+ddfma37767 fma  1   1     0.0   ->  1.0\r
+ddfma37768 fma  1   1    -0.0   ->  1.0\r
+\r
+ddfma37771 fma  1   0.0  -1.0   -> -1.0\r
+ddfma37772 fma  1  -0.0  -1.0   -> -1.0\r
+ddfma37773 fma  1   0.0   1.0   ->  1.0\r
+ddfma37774 fma  1  -0.0   1.0   ->  1.0\r
+ddfma37775 fma  1  -1.0   0.0   -> -1.0\r
+ddfma37776 fma  1  -1.0  -0.0   -> -1.0\r
+ddfma37777 fma  1   1.0   0.0   ->  1.0\r
+ddfma37778 fma  1   1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+ddfma37780 fma  1  -Inf  -Inf   -> -Infinity\r
+ddfma37781 fma  1  -Inf  -1000  -> -Infinity\r
+ddfma37782 fma  1  -Inf  -1     -> -Infinity\r
+ddfma37783 fma  1  -Inf  -0     -> -Infinity\r
+ddfma37784 fma  1  -Inf   0     -> -Infinity\r
+ddfma37785 fma  1  -Inf   1     -> -Infinity\r
+ddfma37786 fma  1  -Inf   1000  -> -Infinity\r
+ddfma37787 fma  1  -1000 -Inf   -> -Infinity\r
+ddfma37788 fma  1  -Inf  -Inf   -> -Infinity\r
+ddfma37789 fma  1  -1    -Inf   -> -Infinity\r
+ddfma37790 fma  1  -0    -Inf   -> -Infinity\r
+ddfma37791 fma  1   0    -Inf   -> -Infinity\r
+ddfma37792 fma  1   1    -Inf   -> -Infinity\r
+ddfma37793 fma  1   1000 -Inf   -> -Infinity\r
+ddfma37794 fma  1   Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+ddfma37800 fma  1   Inf  -Inf   ->  NaN  Invalid_operation\r
+ddfma37801 fma  1   Inf  -1000  ->  Infinity\r
+ddfma37802 fma  1   Inf  -1     ->  Infinity\r
+ddfma37803 fma  1   Inf  -0     ->  Infinity\r
+ddfma37804 fma  1   Inf   0     ->  Infinity\r
+ddfma37805 fma  1   Inf   1     ->  Infinity\r
+ddfma37806 fma  1   Inf   1000  ->  Infinity\r
+ddfma37807 fma  1   Inf   Inf   ->  Infinity\r
+ddfma37808 fma  1  -1000  Inf   ->  Infinity\r
+ddfma37809 fma  1  -Inf   Inf   ->  NaN  Invalid_operation\r
+ddfma37810 fma  1  -1     Inf   ->  Infinity\r
+ddfma37811 fma  1  -0     Inf   ->  Infinity\r
+ddfma37812 fma  1   0     Inf   ->  Infinity\r
+ddfma37813 fma  1   1     Inf   ->  Infinity\r
+ddfma37814 fma  1   1000  Inf   ->  Infinity\r
+ddfma37815 fma  1   Inf   Inf   ->  Infinity\r
+\r
+ddfma37821 fma  1   NaN -Inf    ->  NaN\r
+ddfma37822 fma  1   NaN -1000   ->  NaN\r
+ddfma37823 fma  1   NaN -1      ->  NaN\r
+ddfma37824 fma  1   NaN -0      ->  NaN\r
+ddfma37825 fma  1   NaN  0      ->  NaN\r
+ddfma37826 fma  1   NaN  1      ->  NaN\r
+ddfma37827 fma  1   NaN  1000   ->  NaN\r
+ddfma37828 fma  1   NaN  Inf    ->  NaN\r
+ddfma37829 fma  1   NaN  NaN    ->  NaN\r
+ddfma37830 fma  1  -Inf  NaN    ->  NaN\r
+ddfma37831 fma  1  -1000 NaN    ->  NaN\r
+ddfma37832 fma  1  -1    NaN    ->  NaN\r
+ddfma37833 fma  1  -0    NaN    ->  NaN\r
+ddfma37834 fma  1   0    NaN    ->  NaN\r
+ddfma37835 fma  1   1    NaN    ->  NaN\r
+ddfma37836 fma  1   1000 NaN    ->  NaN\r
+ddfma37837 fma  1   Inf  NaN    ->  NaN\r
+\r
+ddfma37841 fma  1   sNaN -Inf   ->  NaN  Invalid_operation\r
+ddfma37842 fma  1   sNaN -1000  ->  NaN  Invalid_operation\r
+ddfma37843 fma  1   sNaN -1     ->  NaN  Invalid_operation\r
+ddfma37844 fma  1   sNaN -0     ->  NaN  Invalid_operation\r
+ddfma37845 fma  1   sNaN  0     ->  NaN  Invalid_operation\r
+ddfma37846 fma  1   sNaN  1     ->  NaN  Invalid_operation\r
+ddfma37847 fma  1   sNaN  1000  ->  NaN  Invalid_operation\r
+ddfma37848 fma  1   sNaN  NaN   ->  NaN  Invalid_operation\r
+ddfma37849 fma  1   sNaN sNaN   ->  NaN  Invalid_operation\r
+ddfma37850 fma  1   NaN  sNaN   ->  NaN  Invalid_operation\r
+ddfma37851 fma  1  -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddfma37852 fma  1  -1000 sNaN   ->  NaN  Invalid_operation\r
+ddfma37853 fma  1  -1    sNaN   ->  NaN  Invalid_operation\r
+ddfma37854 fma  1  -0    sNaN   ->  NaN  Invalid_operation\r
+ddfma37855 fma  1   0    sNaN   ->  NaN  Invalid_operation\r
+ddfma37856 fma  1   1    sNaN   ->  NaN  Invalid_operation\r
+ddfma37857 fma  1   1000 sNaN   ->  NaN  Invalid_operation\r
+ddfma37858 fma  1   Inf  sNaN   ->  NaN  Invalid_operation\r
+ddfma37859 fma  1   NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddfma37861 fma  1   NaN1   -Inf    ->  NaN1\r
+ddfma37862 fma  1  +NaN2   -1000   ->  NaN2\r
+ddfma37863 fma  1   NaN3    1000   ->  NaN3\r
+ddfma37864 fma  1   NaN4    Inf    ->  NaN4\r
+ddfma37865 fma  1   NaN5   +NaN6   ->  NaN5\r
+ddfma37866 fma  1  -Inf     NaN7   ->  NaN7\r
+ddfma37867 fma  1  -1000    NaN8   ->  NaN8\r
+ddfma37868 fma  1   1000    NaN9   ->  NaN9\r
+ddfma37869 fma  1   Inf    +NaN10  ->  NaN10\r
+ddfma37871 fma  1   sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+ddfma37872 fma  1   sNaN12  -1000  ->  NaN12  Invalid_operation\r
+ddfma37873 fma  1   sNaN13   1000  ->  NaN13  Invalid_operation\r
+ddfma37874 fma  1   sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+ddfma37875 fma  1   sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+ddfma37876 fma  1   NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+ddfma37877 fma  1  -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+ddfma37878 fma  1  -1000    sNaN21 ->  NaN21  Invalid_operation\r
+ddfma37879 fma  1   1000    sNaN22 ->  NaN22  Invalid_operation\r
+ddfma37880 fma  1   Inf     sNaN23 ->  NaN23  Invalid_operation\r
+ddfma37881 fma  1  +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+ddfma37882 fma  1  -NaN26    NaN28 -> -NaN26\r
+ddfma37883 fma  1  -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+ddfma37884 fma  1   1000    -NaN30 -> -NaN30\r
+ddfma37885 fma  1   1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Here we explore near the boundary of rounding a subnormal to Nmin\r
+ddfma37575 fma  1   1E-383 -1E-398 ->  9.99999999999999E-384  Subnormal\r
+ddfma37576 fma  1  -1E-383 +1E-398 -> -9.99999999999999E-384  Subnormal\r
+\r
+-- check overflow edge case\r
+--               1234567890123456\r
+ddfma37972 apply   9.999999999999999E+384         -> 9.999999999999999E+384\r
+ddfma37973 fma  1      9.999999999999999E+384  1      -> 9.999999999999999E+384 Inexact Rounded\r
+ddfma37974 fma  1       9999999999999999E+369  1      -> 9.999999999999999E+384 Inexact Rounded\r
+ddfma37975 fma  1       9999999999999999E+369  1E+369  -> Infinity Overflow Inexact Rounded\r
+ddfma37976 fma  1       9999999999999999E+369  9E+368  -> Infinity Overflow Inexact Rounded\r
+ddfma37977 fma  1       9999999999999999E+369  8E+368  -> Infinity Overflow Inexact Rounded\r
+ddfma37978 fma  1       9999999999999999E+369  7E+368  -> Infinity Overflow Inexact Rounded\r
+ddfma37979 fma  1       9999999999999999E+369  6E+368  -> Infinity Overflow Inexact Rounded\r
+ddfma37980 fma  1       9999999999999999E+369  5E+368  -> Infinity Overflow Inexact Rounded\r
+ddfma37981 fma  1       9999999999999999E+369  4E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddfma37982 fma  1       9999999999999999E+369  3E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddfma37983 fma  1       9999999999999999E+369  2E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+ddfma37984 fma  1       9999999999999999E+369  1E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+\r
+ddfma37985 apply  -9.999999999999999E+384         -> -9.999999999999999E+384\r
+ddfma37986 fma  1     -9.999999999999999E+384 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+ddfma37987 fma  1      -9999999999999999E+369 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+ddfma37988 fma  1      -9999999999999999E+369 -1E+369  -> -Infinity Overflow Inexact Rounded\r
+ddfma37989 fma  1      -9999999999999999E+369 -9E+368  -> -Infinity Overflow Inexact Rounded\r
+ddfma37990 fma  1      -9999999999999999E+369 -8E+368  -> -Infinity Overflow Inexact Rounded\r
+ddfma37991 fma  1      -9999999999999999E+369 -7E+368  -> -Infinity Overflow Inexact Rounded\r
+ddfma37992 fma  1      -9999999999999999E+369 -6E+368  -> -Infinity Overflow Inexact Rounded\r
+ddfma37993 fma  1      -9999999999999999E+369 -5E+368  -> -Infinity Overflow Inexact Rounded\r
+ddfma37994 fma  1      -9999999999999999E+369 -4E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddfma37995 fma  1      -9999999999999999E+369 -3E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddfma37996 fma  1      -9999999999999999E+369 -2E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+ddfma37997 fma  1      -9999999999999999E+369 -1E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+\r
+-- And for round down full and subnormal results\r
+rounding:     down\r
+ddfma371100 fma  1  1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact\r
+ddfma371101 fma  1  1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact\r
+ddfma371103 fma  1    +1 -1e-383    -> 0.9999999999999999  Rounded Inexact\r
+ddfma371104 fma  1  1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact\r
+ddfma371105 fma  1  1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact\r
+ddfma371106 fma  1  1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact\r
+ddfma371107 fma  1  1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact\r
+ddfma371108 fma  1  1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact\r
+ddfma371109 fma  1  1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+ddfma371110 fma  1  -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact\r
+ddfma371111 fma  1  -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact\r
+ddfma371113 fma  1     -1 +1e-383   -> -0.9999999999999999  Rounded Inexact\r
+ddfma371114 fma  1  -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact\r
+ddfma371115 fma  1  -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact\r
+ddfma371116 fma  1  -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact\r
+ddfma371117 fma  1  -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact\r
+ddfma371118 fma  1  -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact\r
+ddfma371119 fma  1  -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+rounding:     half_even\r
+\r
+ddfma371300 fma  1  1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371310 fma  1  1E16  -0.51                ->  9999999999999999      Inexact Rounded\r
+ddfma371311 fma  1  1E16  -0.501               ->  9999999999999999      Inexact Rounded\r
+ddfma371312 fma  1  1E16  -0.5001              ->  9999999999999999      Inexact Rounded\r
+ddfma371313 fma  1  1E16  -0.50001             ->  9999999999999999      Inexact Rounded\r
+ddfma371314 fma  1  1E16  -0.500001            ->  9999999999999999      Inexact Rounded\r
+ddfma371315 fma  1  1E16  -0.5000001           ->  9999999999999999      Inexact Rounded\r
+ddfma371316 fma  1  1E16  -0.50000001          ->  9999999999999999      Inexact Rounded\r
+ddfma371317 fma  1  1E16  -0.500000001         ->  9999999999999999      Inexact Rounded\r
+ddfma371318 fma  1  1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded\r
+ddfma371319 fma  1  1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded\r
+ddfma371320 fma  1  1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded\r
+ddfma371321 fma  1  1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded\r
+ddfma371322 fma  1  1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded\r
+ddfma371323 fma  1  1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded\r
+ddfma371324 fma  1  1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded\r
+ddfma371325 fma  1  1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371326 fma  1  1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371327 fma  1  1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371328 fma  1  1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371329 fma  1  1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371330 fma  1  1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371331 fma  1  1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371332 fma  1  1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371333 fma  1  1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371334 fma  1  1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371335 fma  1  1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371336 fma  1  1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371337 fma  1  1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371338 fma  1  1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371339 fma  1  1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+ddfma371340 fma  1  1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded\r
+ddfma371341 fma  1  1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded\r
+\r
+ddfma371349 fma  1  9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded\r
+ddfma371350 fma  1  9999999999999999 0.49                ->  9999999999999999      Inexact Rounded\r
+ddfma371351 fma  1  9999999999999999 0.499               ->  9999999999999999      Inexact Rounded\r
+ddfma371352 fma  1  9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded\r
+ddfma371353 fma  1  9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded\r
+ddfma371354 fma  1  9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded\r
+ddfma371355 fma  1  9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded\r
+ddfma371356 fma  1  9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded\r
+ddfma371357 fma  1  9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded\r
+ddfma371358 fma  1  9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded\r
+ddfma371359 fma  1  9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded\r
+ddfma371360 fma  1  9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded\r
+ddfma371361 fma  1  9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded\r
+ddfma371362 fma  1  9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded\r
+ddfma371363 fma  1  9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded\r
+ddfma371364 fma  1  9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded\r
+ddfma371365 fma  1  9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371367 fma  1  9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371368 fma  1  9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371369 fma  1  9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371370 fma  1  9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371371 fma  1  9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371372 fma  1  9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371373 fma  1  9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371374 fma  1  9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371375 fma  1  9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371376 fma  1  9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371377 fma  1  9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371378 fma  1  9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371379 fma  1  9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371380 fma  1  9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371381 fma  1  9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371382 fma  1  9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371383 fma  1  9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371384 fma  1  9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371385 fma  1  9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371386 fma  1  9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371387 fma  1  9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371388 fma  1  9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371389 fma  1  9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371390 fma  1  9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371391 fma  1  9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371392 fma  1  9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371393 fma  1  9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371394 fma  1  9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371395 fma  1  9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded\r
+ddfma371396 fma  1  9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+ddfma371420 fma  1   0 1.123456789012345     -> 1.123456789012345\r
+ddfma371421 fma  1   0 1.123456789012345E-1  -> 0.1123456789012345\r
+ddfma371422 fma  1   0 1.123456789012345E-2  -> 0.01123456789012345\r
+ddfma371423 fma  1   0 1.123456789012345E-3  -> 0.001123456789012345\r
+ddfma371424 fma  1   0 1.123456789012345E-4  -> 0.0001123456789012345\r
+ddfma371425 fma  1   0 1.123456789012345E-5  -> 0.00001123456789012345\r
+ddfma371426 fma  1   0 1.123456789012345E-6  -> 0.000001123456789012345\r
+ddfma371427 fma  1   0 1.123456789012345E-7  -> 1.123456789012345E-7\r
+ddfma371428 fma  1   0 1.123456789012345E-8  -> 1.123456789012345E-8\r
+ddfma371429 fma  1   0 1.123456789012345E-9  -> 1.123456789012345E-9\r
+ddfma371430 fma  1   0 1.123456789012345E-10 -> 1.123456789012345E-10\r
+ddfma371431 fma  1   0 1.123456789012345E-11 -> 1.123456789012345E-11\r
+ddfma371432 fma  1   0 1.123456789012345E-12 -> 1.123456789012345E-12\r
+ddfma371433 fma  1   0 1.123456789012345E-13 -> 1.123456789012345E-13\r
+ddfma371434 fma  1   0 1.123456789012345E-14 -> 1.123456789012345E-14\r
+ddfma371435 fma  1   0 1.123456789012345E-15 -> 1.123456789012345E-15\r
+ddfma371436 fma  1   0 1.123456789012345E-16 -> 1.123456789012345E-16\r
+ddfma371437 fma  1   0 1.123456789012345E-17 -> 1.123456789012345E-17\r
+ddfma371438 fma  1   0 1.123456789012345E-18 -> 1.123456789012345E-18\r
+ddfma371439 fma  1   0 1.123456789012345E-19 -> 1.123456789012345E-19\r
+\r
+-- same, reversed 0\r
+ddfma371440 fma  1  1.123456789012345     0 -> 1.123456789012345\r
+ddfma371441 fma  1  1.123456789012345E-1  0 -> 0.1123456789012345\r
+ddfma371442 fma  1  1.123456789012345E-2  0 -> 0.01123456789012345\r
+ddfma371443 fma  1  1.123456789012345E-3  0 -> 0.001123456789012345\r
+ddfma371444 fma  1  1.123456789012345E-4  0 -> 0.0001123456789012345\r
+ddfma371445 fma  1  1.123456789012345E-5  0 -> 0.00001123456789012345\r
+ddfma371446 fma  1  1.123456789012345E-6  0 -> 0.000001123456789012345\r
+ddfma371447 fma  1  1.123456789012345E-7  0 -> 1.123456789012345E-7\r
+ddfma371448 fma  1  1.123456789012345E-8  0 -> 1.123456789012345E-8\r
+ddfma371449 fma  1  1.123456789012345E-9  0 -> 1.123456789012345E-9\r
+ddfma371450 fma  1  1.123456789012345E-10 0 -> 1.123456789012345E-10\r
+ddfma371451 fma  1  1.123456789012345E-11 0 -> 1.123456789012345E-11\r
+ddfma371452 fma  1  1.123456789012345E-12 0 -> 1.123456789012345E-12\r
+ddfma371453 fma  1  1.123456789012345E-13 0 -> 1.123456789012345E-13\r
+ddfma371454 fma  1  1.123456789012345E-14 0 -> 1.123456789012345E-14\r
+ddfma371455 fma  1  1.123456789012345E-15 0 -> 1.123456789012345E-15\r
+ddfma371456 fma  1  1.123456789012345E-16 0 -> 1.123456789012345E-16\r
+ddfma371457 fma  1  1.123456789012345E-17 0 -> 1.123456789012345E-17\r
+ddfma371458 fma  1  1.123456789012345E-18 0 -> 1.123456789012345E-18\r
+ddfma371459 fma  1  1.123456789012345E-19 0 -> 1.123456789012345E-19\r
+\r
+-- same, Es on the 0\r
+ddfma371460 fma  1  1.123456789012345  0E-0   -> 1.123456789012345\r
+ddfma371461 fma  1  1.123456789012345  0E-1   -> 1.123456789012345\r
+ddfma371462 fma  1  1.123456789012345  0E-2   -> 1.123456789012345\r
+ddfma371463 fma  1  1.123456789012345  0E-3   -> 1.123456789012345\r
+ddfma371464 fma  1  1.123456789012345  0E-4   -> 1.123456789012345\r
+ddfma371465 fma  1  1.123456789012345  0E-5   -> 1.123456789012345\r
+ddfma371466 fma  1  1.123456789012345  0E-6   -> 1.123456789012345\r
+ddfma371467 fma  1  1.123456789012345  0E-7   -> 1.123456789012345\r
+ddfma371468 fma  1  1.123456789012345  0E-8   -> 1.123456789012345\r
+ddfma371469 fma  1  1.123456789012345  0E-9   -> 1.123456789012345\r
+ddfma371470 fma  1  1.123456789012345  0E-10  -> 1.123456789012345\r
+ddfma371471 fma  1  1.123456789012345  0E-11  -> 1.123456789012345\r
+ddfma371472 fma  1  1.123456789012345  0E-12  -> 1.123456789012345\r
+ddfma371473 fma  1  1.123456789012345  0E-13  -> 1.123456789012345\r
+ddfma371474 fma  1  1.123456789012345  0E-14  -> 1.123456789012345\r
+ddfma371475 fma  1  1.123456789012345  0E-15  -> 1.123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+ddfma371476 fma  1  1.123456789012345  0E-16  -> 1.123456789012345 Rounded\r
+ddfma371477 fma  1  1.123456789012345  0E-17  -> 1.123456789012345 Rounded\r
+ddfma371478 fma  1  1.123456789012345  0E-18  -> 1.123456789012345 Rounded\r
+ddfma371479 fma  1  1.123456789012345  0E-19  -> 1.123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+ddfma371500 fma  1   0        0E-19  ->  0E-19\r
+ddfma371501 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371502 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371503 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371511 fma  1  -11      11    ->  0\r
+ddfma371512 fma  1   11     -11    ->  0\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+ddfma371520 fma  1   0        0E-19  ->  0E-19\r
+ddfma371521 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371522 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371523 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371531 fma  1  -11      11    ->  0\r
+ddfma371532 fma  1   11     -11    ->  0\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+ddfma371540 fma  1   0        0E-19  ->  0E-19\r
+ddfma371541 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371542 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371543 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371551 fma  1  -11      11    ->  0\r
+ddfma371552 fma  1   11     -11    ->  0\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+ddfma371560 fma  1   0        0E-19  ->  0E-19\r
+ddfma371561 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371562 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371563 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371571 fma  1  -11      11    ->  0\r
+ddfma371572 fma  1   11     -11    ->  0\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+ddfma371580 fma  1   0        0E-19  ->  0E-19\r
+ddfma371581 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371582 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371583 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371591 fma  1  -11      11    ->  0\r
+ddfma371592 fma  1   11     -11    ->  0\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+ddfma371600 fma  1   0        0E-19  ->  0E-19\r
+ddfma371601 fma  1  -0        0E-19  ->  0E-19\r
+ddfma371602 fma  1   0       -0E-19  ->  0E-19\r
+ddfma371603 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371611 fma  1  -11      11    ->  0\r
+ddfma371612 fma  1   11     -11    ->  0\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+ddfma371620 fma  1   0        0E-19  ->  0E-19\r
+ddfma371621 fma  1  -0        0E-19  -> -0E-19           -- *\r
+ddfma371622 fma  1   0       -0E-19  -> -0E-19           -- *\r
+ddfma371623 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+ddfma371631 fma  1  -11      11    ->  -0                -- *\r
+ddfma371632 fma  1   11     -11    ->  -0                -- *\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+ddfma371701 fma  1  130E-2    120E-2    -> 2.50\r
+ddfma371702 fma  1  130E-2    12E-1     -> 2.50\r
+ddfma371703 fma  1  130E-2    1E0       -> 2.30\r
+ddfma371704 fma  1  1E2       1E4       -> 1.01E+4\r
+ddfma371705 fma  1  130E-2   -120E-2 -> 0.10\r
+ddfma371706 fma  1  130E-2   -12E-1  -> 0.10\r
+ddfma371707 fma  1  130E-2   -1E0    -> 0.30\r
+ddfma371708 fma  1  1E2      -1E4    -> -9.9E+3\r
+\r
+-- Gappy coefficients; check residue handling even with full coefficient gap\r
+rounding: half_even\r
+\r
+ddfma375001 fma  1  1234567890123456 1      -> 1234567890123457\r
+ddfma375002 fma  1  1234567890123456 0.6    -> 1234567890123457  Inexact Rounded\r
+ddfma375003 fma  1  1234567890123456 0.06   -> 1234567890123456  Inexact Rounded\r
+ddfma375004 fma  1  1234567890123456 6E-3   -> 1234567890123456  Inexact Rounded\r
+ddfma375005 fma  1  1234567890123456 6E-4   -> 1234567890123456  Inexact Rounded\r
+ddfma375006 fma  1  1234567890123456 6E-5   -> 1234567890123456  Inexact Rounded\r
+ddfma375007 fma  1  1234567890123456 6E-6   -> 1234567890123456  Inexact Rounded\r
+ddfma375008 fma  1  1234567890123456 6E-7   -> 1234567890123456  Inexact Rounded\r
+ddfma375009 fma  1  1234567890123456 6E-8   -> 1234567890123456  Inexact Rounded\r
+ddfma375010 fma  1  1234567890123456 6E-9   -> 1234567890123456  Inexact Rounded\r
+ddfma375011 fma  1  1234567890123456 6E-10  -> 1234567890123456  Inexact Rounded\r
+ddfma375012 fma  1  1234567890123456 6E-11  -> 1234567890123456  Inexact Rounded\r
+ddfma375013 fma  1  1234567890123456 6E-12  -> 1234567890123456  Inexact Rounded\r
+ddfma375014 fma  1  1234567890123456 6E-13  -> 1234567890123456  Inexact Rounded\r
+ddfma375015 fma  1  1234567890123456 6E-14  -> 1234567890123456  Inexact Rounded\r
+ddfma375016 fma  1  1234567890123456 6E-15  -> 1234567890123456  Inexact Rounded\r
+ddfma375017 fma  1  1234567890123456 6E-16  -> 1234567890123456  Inexact Rounded\r
+ddfma375018 fma  1  1234567890123456 6E-17  -> 1234567890123456  Inexact Rounded\r
+ddfma375019 fma  1  1234567890123456 6E-18  -> 1234567890123456  Inexact Rounded\r
+ddfma375020 fma  1  1234567890123456 6E-19  -> 1234567890123456  Inexact Rounded\r
+ddfma375021 fma  1  1234567890123456 6E-20  -> 1234567890123456  Inexact Rounded\r
+\r
+-- widening second argument at gap\r
+ddfma375030 fma  1  12345678 1                       -> 12345679\r
+ddfma375031 fma  1  12345678 0.1                     -> 12345678.1\r
+ddfma375032 fma  1  12345678 0.12                    -> 12345678.12\r
+ddfma375033 fma  1  12345678 0.123                   -> 12345678.123\r
+ddfma375034 fma  1  12345678 0.1234                  -> 12345678.1234\r
+ddfma375035 fma  1  12345678 0.12345                 -> 12345678.12345\r
+ddfma375036 fma  1  12345678 0.123456                -> 12345678.123456\r
+ddfma375037 fma  1  12345678 0.1234567               -> 12345678.1234567\r
+ddfma375038 fma  1  12345678 0.12345678              -> 12345678.12345678\r
+ddfma375039 fma  1  12345678 0.123456789             -> 12345678.12345679 Inexact Rounded\r
+ddfma375040 fma  1  12345678 0.123456785             -> 12345678.12345678 Inexact Rounded\r
+ddfma375041 fma  1  12345678 0.1234567850            -> 12345678.12345678 Inexact Rounded\r
+ddfma375042 fma  1  12345678 0.1234567851            -> 12345678.12345679 Inexact Rounded\r
+ddfma375043 fma  1  12345678 0.12345678501           -> 12345678.12345679 Inexact Rounded\r
+ddfma375044 fma  1  12345678 0.123456785001          -> 12345678.12345679 Inexact Rounded\r
+ddfma375045 fma  1  12345678 0.1234567850001         -> 12345678.12345679 Inexact Rounded\r
+ddfma375046 fma  1  12345678 0.12345678500001        -> 12345678.12345679 Inexact Rounded\r
+ddfma375047 fma  1  12345678 0.123456785000001       -> 12345678.12345679 Inexact Rounded\r
+ddfma375048 fma  1  12345678 0.1234567850000001      -> 12345678.12345679 Inexact Rounded\r
+ddfma375049 fma  1  12345678 0.1234567850000000      -> 12345678.12345678 Inexact Rounded\r
+--                               90123456\r
+rounding: half_even\r
+ddfma375050 fma  1  12345678 0.0234567750000000      -> 12345678.02345678 Inexact Rounded\r
+ddfma375051 fma  1  12345678 0.0034567750000000      -> 12345678.00345678 Inexact Rounded\r
+ddfma375052 fma  1  12345678 0.0004567750000000      -> 12345678.00045678 Inexact Rounded\r
+ddfma375053 fma  1  12345678 0.0000567750000000      -> 12345678.00005678 Inexact Rounded\r
+ddfma375054 fma  1  12345678 0.0000067750000000      -> 12345678.00000678 Inexact Rounded\r
+ddfma375055 fma  1  12345678 0.0000007750000000      -> 12345678.00000078 Inexact Rounded\r
+ddfma375056 fma  1  12345678 0.0000000750000000      -> 12345678.00000008 Inexact Rounded\r
+ddfma375057 fma  1  12345678 0.0000000050000000      -> 12345678.00000000 Inexact Rounded\r
+ddfma375060 fma  1  12345678 0.0234567750000001      -> 12345678.02345678 Inexact Rounded\r
+ddfma375061 fma  1  12345678 0.0034567750000001      -> 12345678.00345678 Inexact Rounded\r
+ddfma375062 fma  1  12345678 0.0004567750000001      -> 12345678.00045678 Inexact Rounded\r
+ddfma375063 fma  1  12345678 0.0000567750000001      -> 12345678.00005678 Inexact Rounded\r
+ddfma375064 fma  1  12345678 0.0000067750000001      -> 12345678.00000678 Inexact Rounded\r
+ddfma375065 fma  1  12345678 0.0000007750000001      -> 12345678.00000078 Inexact Rounded\r
+ddfma375066 fma  1  12345678 0.0000000750000001      -> 12345678.00000008 Inexact Rounded\r
+ddfma375067 fma  1  12345678 0.0000000050000001      -> 12345678.00000001 Inexact Rounded\r
+-- far-out residues (full coefficient gap is 16+15 digits)\r
+rounding: up\r
+ddfma375070 fma  1  12345678 1E-8                    -> 12345678.00000001\r
+ddfma375071 fma  1  12345678 1E-9                    -> 12345678.00000001 Inexact Rounded\r
+ddfma375072 fma  1  12345678 1E-10                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375073 fma  1  12345678 1E-11                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375074 fma  1  12345678 1E-12                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375075 fma  1  12345678 1E-13                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375076 fma  1  12345678 1E-14                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375077 fma  1  12345678 1E-15                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375078 fma  1  12345678 1E-16                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375079 fma  1  12345678 1E-17                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375080 fma  1  12345678 1E-18                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375081 fma  1  12345678 1E-19                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375082 fma  1  12345678 1E-20                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375083 fma  1  12345678 1E-25                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375084 fma  1  12345678 1E-30                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375085 fma  1  12345678 1E-31                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375086 fma  1  12345678 1E-32                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375087 fma  1  12345678 1E-33                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375088 fma  1  12345678 1E-34                   -> 12345678.00000001 Inexact Rounded\r
+ddfma375089 fma  1  12345678 1E-35                   -> 12345678.00000001 Inexact Rounded\r
+\r
+-- Null tests\r
+ddfma39990 fma  1  10  # -> NaN Invalid_operation\r
+ddfma39991 fma  1   # 10 -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddInvert.decTest b/Lib/test/decimaltestdata/ddInvert.decTest
new file mode 100644 (file)
index 0000000..2697f59
--- /dev/null
@@ -0,0 +1,202 @@
+------------------------------------------------------------------------\r
+-- ddInvert.decTest -- digitwise logical INVERT for decDoubles        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+ddinv001 invert             0 -> 1111111111111111\r
+ddinv002 invert             1 -> 1111111111111110\r
+ddinv003 invert            10 -> 1111111111111101\r
+ddinv004 invert     111111111 -> 1111111000000000\r
+ddinv005 invert     000000000 -> 1111111111111111\r
+-- and at msd and msd-1\r
+ddinv007 invert 0000000000000000 ->   1111111111111111\r
+ddinv008 invert 1000000000000000 ->    111111111111111\r
+ddinv009 invert 0000000000000000 ->   1111111111111111\r
+ddinv010 invert 0100000000000000 ->   1011111111111111\r
+ddinv011 invert 0111111111111111 ->   1000000000000000\r
+ddinv012 invert 1111111111111111 ->                  0\r
+ddinv013 invert 0011111111111111 ->   1100000000000000\r
+ddinv014 invert 0111111111111111 ->   1000000000000000\r
+\r
+-- Various lengths\r
+--             123456789         1234567890123456\r
+ddinv021 invert 111111111     ->  1111111000000000\r
+ddinv022 invert 111111111111  ->  1111000000000000\r
+ddinv023 invert  11111111     ->  1111111100000000\r
+ddinv025 invert   1111111     ->  1111111110000000\r
+ddinv026 invert    111111     ->  1111111111000000\r
+ddinv027 invert     11111     ->  1111111111100000\r
+ddinv028 invert      1111     ->  1111111111110000\r
+ddinv029 invert       111     ->  1111111111111000\r
+ddinv031 invert        11     ->  1111111111111100\r
+ddinv032 invert         1     ->  1111111111111110\r
+ddinv033 invert 111111111111  ->  1111000000000000\r
+ddinv034 invert 11111111111   ->  1111100000000000\r
+ddinv035 invert 1111111111    ->  1111110000000000\r
+ddinv036 invert 111111111     ->  1111111000000000\r
+\r
+ddinv040 invert 011111111   ->  1111111100000000\r
+ddinv041 invert 101111111   ->  1111111010000000\r
+ddinv042 invert 110111111   ->  1111111001000000\r
+ddinv043 invert 111011111   ->  1111111000100000\r
+ddinv044 invert 111101111   ->  1111111000010000\r
+ddinv045 invert 111110111   ->  1111111000001000\r
+ddinv046 invert 111111011   ->  1111111000000100\r
+ddinv047 invert 111111101   ->  1111111000000010\r
+ddinv048 invert 111111110   ->  1111111000000001\r
+ddinv049 invert 011111011   ->  1111111100000100\r
+ddinv050 invert 101111101   ->  1111111010000010\r
+ddinv051 invert 110111110   ->  1111111001000001\r
+ddinv052 invert 111011101   ->  1111111000100010\r
+ddinv053 invert 111101011   ->  1111111000010100\r
+ddinv054 invert 111110111   ->  1111111000001000\r
+ddinv055 invert 111101011   ->  1111111000010100\r
+ddinv056 invert 111011101   ->  1111111000100010\r
+ddinv057 invert 110111110   ->  1111111001000001\r
+ddinv058 invert 101111101   ->  1111111010000010\r
+ddinv059 invert 011111011   ->  1111111100000100\r
+\r
+ddinv080 invert 1000000011111111   ->   111111100000000\r
+ddinv081 invert 0100000101111111   ->  1011111010000000\r
+ddinv082 invert 0010000110111111   ->  1101111001000000\r
+ddinv083 invert 0001000111011111   ->  1110111000100000\r
+ddinv084 invert 0000100111101111   ->  1111011000010000\r
+ddinv085 invert 0000010111110111   ->  1111101000001000\r
+ddinv086 invert 0000001111111011   ->  1111110000000100\r
+ddinv087 invert 0000010111111101   ->  1111101000000010\r
+ddinv088 invert 0000100111111110   ->  1111011000000001\r
+ddinv089 invert 0001000011111011   ->  1110111100000100\r
+ddinv090 invert 0010000101111101   ->  1101111010000010\r
+ddinv091 invert 0100000110111110   ->  1011111001000001\r
+ddinv092 invert 1000000111011101   ->   111111000100010\r
+ddinv093 invert 0100000111101011   ->  1011111000010100\r
+ddinv094 invert 0010000111110111   ->  1101111000001000\r
+ddinv095 invert 0001000111101011   ->  1110111000010100\r
+ddinv096 invert 0000100111011101   ->  1111011000100010\r
+ddinv097 invert 0000010110111110   ->  1111101001000001\r
+ddinv098 invert 0000001101111101   ->  1111110010000010\r
+ddinv099 invert 0000010011111011   ->  1111101100000100\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+ddinv220 invert 111111112   ->  NaN Invalid_operation\r
+ddinv221 invert 333333333   ->  NaN Invalid_operation\r
+ddinv222 invert 555555555   ->  NaN Invalid_operation\r
+ddinv223 invert 777777777   ->  NaN Invalid_operation\r
+ddinv224 invert 999999999   ->  NaN Invalid_operation\r
+ddinv225 invert 222222222   ->  NaN Invalid_operation\r
+ddinv226 invert 444444444   ->  NaN Invalid_operation\r
+ddinv227 invert 666666666   ->  NaN Invalid_operation\r
+ddinv228 invert 888888888   ->  NaN Invalid_operation\r
+ddinv229 invert 999999999   ->  NaN Invalid_operation\r
+ddinv230 invert 999999999   ->  NaN Invalid_operation\r
+ddinv231 invert 999999999   ->  NaN Invalid_operation\r
+ddinv232 invert 999999999   ->  NaN Invalid_operation\r
+-- a few randoms\r
+ddinv240 invert  567468689  ->  NaN Invalid_operation\r
+ddinv241 invert  567367689  ->  NaN Invalid_operation\r
+ddinv242 invert -631917772  ->  NaN Invalid_operation\r
+ddinv243 invert -756253257  ->  NaN Invalid_operation\r
+ddinv244 invert  835590149  ->  NaN Invalid_operation\r
+-- test MSD\r
+ddinv250 invert  2000000000000000  ->  NaN Invalid_operation\r
+ddinv251 invert  3000000000000000  ->  NaN Invalid_operation\r
+ddinv252 invert  4000000000000000  ->  NaN Invalid_operation\r
+ddinv253 invert  5000000000000000  ->  NaN Invalid_operation\r
+ddinv254 invert  6000000000000000  ->  NaN Invalid_operation\r
+ddinv255 invert  7000000000000000  ->  NaN Invalid_operation\r
+ddinv256 invert  8000000000000000  ->  NaN Invalid_operation\r
+ddinv257 invert  9000000000000000  ->  NaN Invalid_operation\r
+-- test MSD-1\r
+ddinv270 invert  0200001000000000  ->  NaN Invalid_operation\r
+ddinv271 invert  0300000100000000  ->  NaN Invalid_operation\r
+ddinv272 invert  0400000010000000  ->  NaN Invalid_operation\r
+ddinv273 invert  0500000001000000  ->  NaN Invalid_operation\r
+ddinv274 invert  1600000000100000  ->  NaN Invalid_operation\r
+ddinv275 invert  1700000000010000  ->  NaN Invalid_operation\r
+ddinv276 invert  1800000000001000  ->  NaN Invalid_operation\r
+ddinv277 invert  1900000000000100  ->  NaN Invalid_operation\r
+-- test LSD\r
+ddinv280 invert  0010000000000002  ->  NaN Invalid_operation\r
+ddinv281 invert  0001000000000003  ->  NaN Invalid_operation\r
+ddinv282 invert  0000100000000004  ->  NaN Invalid_operation\r
+ddinv283 invert  0000010000000005  ->  NaN Invalid_operation\r
+ddinv284 invert  1000001000000006  ->  NaN Invalid_operation\r
+ddinv285 invert  1000000100000007  ->  NaN Invalid_operation\r
+ddinv286 invert  1000000010000008  ->  NaN Invalid_operation\r
+ddinv287 invert  1000000001000009  ->  NaN Invalid_operation\r
+-- test Middie\r
+ddinv288 invert  0010000020000000  ->  NaN Invalid_operation\r
+ddinv289 invert  0001000030000001  ->  NaN Invalid_operation\r
+ddinv290 invert  0000100040000010  ->  NaN Invalid_operation\r
+ddinv291 invert  0000010050000100  ->  NaN Invalid_operation\r
+ddinv292 invert  1000001060001000  ->  NaN Invalid_operation\r
+ddinv293 invert  1000000170010000  ->  NaN Invalid_operation\r
+ddinv294 invert  1000000080100000  ->  NaN Invalid_operation\r
+ddinv295 invert  1000000091000000  ->  NaN Invalid_operation\r
+-- sign\r
+ddinv296 invert -1000000001000000  ->  NaN Invalid_operation\r
+ddinv299 invert  1000000001000000  ->  111111110111111\r
+\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+ddinv341 invert  9.99999999E+299   -> NaN Invalid_operation\r
+ddinv342 invert  1E-299            -> NaN Invalid_operation\r
+ddinv343 invert  1.00000000E-299   -> NaN Invalid_operation\r
+ddinv344 invert  1E-207            -> NaN Invalid_operation\r
+ddinv345 invert  -1E-207           -> NaN Invalid_operation\r
+ddinv346 invert  -1.00000000E-299  -> NaN Invalid_operation\r
+ddinv347 invert  -1E-299           -> NaN Invalid_operation\r
+ddinv348 invert  -9.99999999E+299  -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+ddinv361 invert  1.0               -> NaN Invalid_operation\r
+ddinv362 invert  1E+1              -> NaN Invalid_operation\r
+ddinv363 invert  0.0               -> NaN Invalid_operation\r
+ddinv364 invert  0E+1              -> NaN Invalid_operation\r
+ddinv365 invert  9.9               -> NaN Invalid_operation\r
+ddinv366 invert  9E+1              -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+ddinv788 invert -Inf     -> NaN  Invalid_operation\r
+ddinv794 invert  Inf     -> NaN  Invalid_operation\r
+ddinv821 invert  NaN     -> NaN  Invalid_operation\r
+ddinv841 invert  sNaN    -> NaN  Invalid_operation\r
+-- propagating NaNs\r
+ddinv861 invert  NaN1    -> NaN Invalid_operation\r
+ddinv862 invert +NaN2    -> NaN Invalid_operation\r
+ddinv863 invert  NaN3    -> NaN Invalid_operation\r
+ddinv864 invert  NaN4    -> NaN Invalid_operation\r
+ddinv865 invert  NaN5    -> NaN Invalid_operation\r
+ddinv871 invert  sNaN11  -> NaN Invalid_operation\r
+ddinv872 invert  sNaN12  -> NaN Invalid_operation\r
+ddinv873 invert  sNaN13  -> NaN Invalid_operation\r
+ddinv874 invert  sNaN14  -> NaN Invalid_operation\r
+ddinv875 invert  sNaN15  -> NaN Invalid_operation\r
+ddinv876 invert  NaN16   -> NaN Invalid_operation\r
+ddinv881 invert +NaN25   -> NaN Invalid_operation\r
+ddinv882 invert -NaN26   -> NaN Invalid_operation\r
+ddinv883 invert -sNaN27  -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddLogB.decTest b/Lib/test/decimaltestdata/ddLogB.decTest
new file mode 100644 (file)
index 0000000..f18fd5e
--- /dev/null
@@ -0,0 +1,159 @@
+------------------------------------------------------------------------\r
+-- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles  --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- basics\r
+ddlogb000 logb  0                 -> -Infinity  Division_by_zero\r
+ddlogb001 logb  1E-398            -> -398\r
+ddlogb002 logb  1E-383            -> -383\r
+ddlogb003 logb  0.001             -> -3\r
+ddlogb004 logb  0.03              -> -2\r
+ddlogb005 logb  1                 ->  0\r
+ddlogb006 logb  2                 ->  0\r
+ddlogb007 logb  2.5               ->  0\r
+ddlogb008 logb  2.500             ->  0\r
+ddlogb009 logb  10                ->  1\r
+ddlogb010 logb  70                ->  1\r
+ddlogb011 logb  100               ->  2\r
+ddlogb012 logb  333               ->  2\r
+ddlogb013 logb  9E+384            ->  384\r
+ddlogb014 logb +Infinity          ->  Infinity\r
+\r
+-- negatives appear to be treated as positives\r
+ddlogb021 logb -0                 -> -Infinity  Division_by_zero\r
+ddlogb022 logb -1E-398            -> -398\r
+ddlogb023 logb -9E-383            -> -383\r
+ddlogb024 logb -0.001             -> -3\r
+ddlogb025 logb -1                 ->  0\r
+ddlogb026 logb -2                 ->  0\r
+ddlogb027 logb -10                ->  1\r
+ddlogb028 logb -70                ->  1\r
+ddlogb029 logb -100               ->  2\r
+ddlogb030 logb -9E+384            ->  384\r
+ddlogb031 logb -Infinity          ->  Infinity\r
+\r
+-- zeros\r
+ddlogb111 logb          0   -> -Infinity  Division_by_zero\r
+ddlogb112 logb         -0   -> -Infinity  Division_by_zero\r
+ddlogb113 logb       0E+4   -> -Infinity  Division_by_zero\r
+ddlogb114 logb      -0E+4   -> -Infinity  Division_by_zero\r
+ddlogb115 logb     0.0000   -> -Infinity  Division_by_zero\r
+ddlogb116 logb    -0.0000   -> -Infinity  Division_by_zero\r
+ddlogb117 logb      0E-141  -> -Infinity  Division_by_zero\r
+ddlogb118 logb     -0E-141  -> -Infinity  Division_by_zero\r
+\r
+-- full coefficients, alternating bits\r
+ddlogb121 logb   268268268        -> 8\r
+ddlogb122 logb  -268268268        -> 8\r
+ddlogb123 logb   134134134        -> 8\r
+ddlogb124 logb  -134134134        -> 8\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddlogb131 logb  9.999999999999999E+384   ->  384\r
+ddlogb132 logb  1E-383                   -> -383\r
+ddlogb133 logb  1.000000000000000E-383   -> -383\r
+ddlogb134 logb  1E-398                   -> -398\r
+\r
+ddlogb135 logb  -1E-398                  -> -398\r
+ddlogb136 logb  -1.000000000000000E-383  -> -383\r
+ddlogb137 logb  -1E-383                  -> -383\r
+ddlogb138 logb  -9.999999999999999E+384  ->  384\r
+\r
+-- ones\r
+ddlogb0061 logb  1                 ->   0\r
+ddlogb0062 logb  1.0               ->   0\r
+ddlogb0063 logb  1.000000000000000 ->   0\r
+\r
+-- notable cases -- exact powers of 10\r
+ddlogb1100 logb 1             -> 0\r
+ddlogb1101 logb 10            -> 1\r
+ddlogb1102 logb 100           -> 2\r
+ddlogb1103 logb 1000          -> 3\r
+ddlogb1104 logb 10000         -> 4\r
+ddlogb1105 logb 100000        -> 5\r
+ddlogb1106 logb 1000000       -> 6\r
+ddlogb1107 logb 10000000      -> 7\r
+ddlogb1108 logb 100000000     -> 8\r
+ddlogb1109 logb 1000000000    -> 9\r
+ddlogb1110 logb 10000000000   -> 10\r
+ddlogb1111 logb 100000000000  -> 11\r
+ddlogb1112 logb 1000000000000 -> 12\r
+ddlogb1113 logb 0.00000000001 -> -11\r
+ddlogb1114 logb 0.0000000001 -> -10\r
+ddlogb1115 logb 0.000000001 -> -9\r
+ddlogb1116 logb 0.00000001 -> -8\r
+ddlogb1117 logb 0.0000001 -> -7\r
+ddlogb1118 logb 0.000001 -> -6\r
+ddlogb1119 logb 0.00001 -> -5\r
+ddlogb1120 logb 0.0001 -> -4\r
+ddlogb1121 logb 0.001 -> -3\r
+ddlogb1122 logb 0.01 -> -2\r
+ddlogb1123 logb 0.1 -> -1\r
+ddlogb1124 logb 1E-99  -> -99\r
+ddlogb1125 logb 1E-100 -> -100\r
+ddlogb1127 logb 1E-299 -> -299\r
+ddlogb1126 logb 1E-383 -> -383\r
+\r
+-- suggestions from Ilan Nehama\r
+ddlogb1400 logb 10E-3    -> -2\r
+ddlogb1401 logb 10E-2    -> -1\r
+ddlogb1402 logb 100E-2   ->  0\r
+ddlogb1403 logb 1000E-2  ->  1\r
+ddlogb1404 logb 10000E-2 ->  2\r
+ddlogb1405 logb 10E-1    ->  0\r
+ddlogb1406 logb 100E-1   ->  1\r
+ddlogb1407 logb 1000E-1  ->  2\r
+ddlogb1408 logb 10000E-1 ->  3\r
+ddlogb1409 logb 10E0     ->  1\r
+ddlogb1410 logb 100E0    ->  2\r
+ddlogb1411 logb 1000E0   ->  3\r
+ddlogb1412 logb 10000E0  ->  4\r
+ddlogb1413 logb 10E1     ->  2\r
+ddlogb1414 logb 100E1    ->  3\r
+ddlogb1415 logb 1000E1   ->  4\r
+ddlogb1416 logb 10000E1  ->  5\r
+ddlogb1417 logb 10E2     ->  3\r
+ddlogb1418 logb 100E2    ->  4\r
+ddlogb1419 logb 1000E2   ->  5\r
+ddlogb1420 logb 10000E2  ->  6\r
+\r
+-- special values\r
+ddlogb820  logb   Infinity ->   Infinity\r
+ddlogb821  logb   0        ->  -Infinity Division_by_zero\r
+ddlogb822  logb   NaN      ->   NaN\r
+ddlogb823  logb   sNaN     ->   NaN     Invalid_operation\r
+-- propagating NaNs\r
+ddlogb824  logb   sNaN123  ->   NaN123  Invalid_operation\r
+ddlogb825  logb   -sNaN321 ->  -NaN321  Invalid_operation\r
+ddlogb826  logb   NaN456   ->   NaN456\r
+ddlogb827  logb   -NaN654  ->  -NaN654\r
+ddlogb828  logb   NaN1     ->   NaN1\r
+\r
+-- Null test\r
+ddlogb900  logb #   -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddMax.decTest b/Lib/test/decimaltestdata/ddMax.decTest
new file mode 100644 (file)
index 0000000..5fe600f
--- /dev/null
@@ -0,0 +1,322 @@
+------------------------------------------------------------------------\r
+-- ddMax.decTest -- decDouble maxnum                                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddmax001 max  -2  -2  -> -2\r
+ddmax002 max  -2  -1  -> -1\r
+ddmax003 max  -2   0  ->  0\r
+ddmax004 max  -2   1  ->  1\r
+ddmax005 max  -2   2  ->  2\r
+ddmax006 max  -1  -2  -> -1\r
+ddmax007 max  -1  -1  -> -1\r
+ddmax008 max  -1   0  ->  0\r
+ddmax009 max  -1   1  ->  1\r
+ddmax010 max  -1   2  ->  2\r
+ddmax011 max   0  -2  ->  0\r
+ddmax012 max   0  -1  ->  0\r
+ddmax013 max   0   0  ->  0\r
+ddmax014 max   0   1  ->  1\r
+ddmax015 max   0   2  ->  2\r
+ddmax016 max   1  -2  ->  1\r
+ddmax017 max   1  -1  ->  1\r
+ddmax018 max   1   0  ->  1\r
+ddmax019 max   1   1  ->  1\r
+ddmax020 max   1   2  ->  2\r
+ddmax021 max   2  -2  ->  2\r
+ddmax022 max   2  -1  ->  2\r
+ddmax023 max   2   0  ->  2\r
+ddmax025 max   2   1  ->  2\r
+ddmax026 max   2   2  ->  2\r
+\r
+-- extended zeros\r
+ddmax030 max   0     0   ->  0\r
+ddmax031 max   0    -0   ->  0\r
+ddmax032 max   0    -0.0 ->  0\r
+ddmax033 max   0     0.0 ->  0\r
+ddmax034 max  -0     0   ->  0    -- note: -0 = 0, but 0 chosen\r
+ddmax035 max  -0    -0   -> -0\r
+ddmax036 max  -0    -0.0 -> -0.0\r
+ddmax037 max  -0     0.0 ->  0.0\r
+ddmax038 max   0.0   0   ->  0\r
+ddmax039 max   0.0  -0   ->  0.0\r
+ddmax040 max   0.0  -0.0 ->  0.0\r
+ddmax041 max   0.0   0.0 ->  0.0\r
+ddmax042 max  -0.0   0   ->  0\r
+ddmax043 max  -0.0  -0   -> -0.0\r
+ddmax044 max  -0.0  -0.0 -> -0.0\r
+ddmax045 max  -0.0   0.0 ->  0.0\r
+\r
+ddmax050 max  -0E1   0E1 ->  0E+1\r
+ddmax051 max  -0E2   0E2 ->  0E+2\r
+ddmax052 max  -0E2   0E1 ->  0E+1\r
+ddmax053 max  -0E1   0E2 ->  0E+2\r
+ddmax054 max   0E1  -0E1 ->  0E+1\r
+ddmax055 max   0E2  -0E2 ->  0E+2\r
+ddmax056 max   0E2  -0E1 ->  0E+2\r
+ddmax057 max   0E1  -0E2 ->  0E+1\r
+\r
+ddmax058 max   0E1   0E1 ->  0E+1\r
+ddmax059 max   0E2   0E2 ->  0E+2\r
+ddmax060 max   0E2   0E1 ->  0E+2\r
+ddmax061 max   0E1   0E2 ->  0E+2\r
+ddmax062 max  -0E1  -0E1 -> -0E+1\r
+ddmax063 max  -0E2  -0E2 -> -0E+2\r
+ddmax064 max  -0E2  -0E1 -> -0E+1\r
+ddmax065 max  -0E1  -0E2 -> -0E+1\r
+\r
+-- Specials\r
+ddmax090 max  Inf  -Inf   ->  Infinity\r
+ddmax091 max  Inf  -1000  ->  Infinity\r
+ddmax092 max  Inf  -1     ->  Infinity\r
+ddmax093 max  Inf  -0     ->  Infinity\r
+ddmax094 max  Inf   0     ->  Infinity\r
+ddmax095 max  Inf   1     ->  Infinity\r
+ddmax096 max  Inf   1000  ->  Infinity\r
+ddmax097 max  Inf   Inf   ->  Infinity\r
+ddmax098 max -1000  Inf   ->  Infinity\r
+ddmax099 max -Inf   Inf   ->  Infinity\r
+ddmax100 max -1     Inf   ->  Infinity\r
+ddmax101 max -0     Inf   ->  Infinity\r
+ddmax102 max  0     Inf   ->  Infinity\r
+ddmax103 max  1     Inf   ->  Infinity\r
+ddmax104 max  1000  Inf   ->  Infinity\r
+ddmax105 max  Inf   Inf   ->  Infinity\r
+\r
+ddmax120 max -Inf  -Inf   -> -Infinity\r
+ddmax121 max -Inf  -1000  -> -1000\r
+ddmax122 max -Inf  -1     -> -1\r
+ddmax123 max -Inf  -0     -> -0\r
+ddmax124 max -Inf   0     ->  0\r
+ddmax125 max -Inf   1     ->  1\r
+ddmax126 max -Inf   1000  ->  1000\r
+ddmax127 max -Inf   Inf   ->  Infinity\r
+ddmax128 max -Inf  -Inf   ->  -Infinity\r
+ddmax129 max -1000 -Inf   ->  -1000\r
+ddmax130 max -1    -Inf   ->  -1\r
+ddmax131 max -0    -Inf   ->  -0\r
+ddmax132 max  0    -Inf   ->  0\r
+ddmax133 max  1    -Inf   ->  1\r
+ddmax134 max  1000 -Inf   ->  1000\r
+ddmax135 max  Inf  -Inf   ->  Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+ddmax141 max  NaN -Inf    -> -Infinity\r
+ddmax142 max  NaN -1000   -> -1000\r
+ddmax143 max  NaN -1      -> -1\r
+ddmax144 max  NaN -0      -> -0\r
+ddmax145 max  NaN  0      ->  0\r
+ddmax146 max  NaN  1      ->  1\r
+ddmax147 max  NaN  1000   ->  1000\r
+ddmax148 max  NaN  Inf    ->  Infinity\r
+ddmax149 max  NaN  NaN    ->  NaN\r
+ddmax150 max -Inf  NaN    -> -Infinity\r
+ddmax151 max -1000 NaN    -> -1000\r
+ddmax152 max -1    NaN    -> -1\r
+ddmax153 max -0    NaN    -> -0\r
+ddmax154 max  0    NaN    ->  0\r
+ddmax155 max  1    NaN    ->  1\r
+ddmax156 max  1000 NaN    ->  1000\r
+ddmax157 max  Inf  NaN    ->  Infinity\r
+\r
+ddmax161 max  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddmax162 max  sNaN -1000  ->  NaN  Invalid_operation\r
+ddmax163 max  sNaN -1     ->  NaN  Invalid_operation\r
+ddmax164 max  sNaN -0     ->  NaN  Invalid_operation\r
+ddmax165 max  sNaN  0     ->  NaN  Invalid_operation\r
+ddmax166 max  sNaN  1     ->  NaN  Invalid_operation\r
+ddmax167 max  sNaN  1000  ->  NaN  Invalid_operation\r
+ddmax168 max  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddmax169 max  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddmax170 max  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddmax171 max -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmax172 max -1000 sNaN   ->  NaN  Invalid_operation\r
+ddmax173 max -1    sNaN   ->  NaN  Invalid_operation\r
+ddmax174 max -0    sNaN   ->  NaN  Invalid_operation\r
+ddmax175 max  0    sNaN   ->  NaN  Invalid_operation\r
+ddmax176 max  1    sNaN   ->  NaN  Invalid_operation\r
+ddmax177 max  1000 sNaN   ->  NaN  Invalid_operation\r
+ddmax178 max  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmax179 max  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddmax181 max  NaN9  -Inf   -> -Infinity\r
+ddmax182 max  NaN8     9   ->  9\r
+ddmax183 max -NaN7   Inf   ->  Infinity\r
+\r
+ddmax184 max -NaN1   NaN11 -> -NaN1\r
+ddmax185 max  NaN2   NaN12 ->  NaN2\r
+ddmax186 max -NaN13 -NaN7  -> -NaN13\r
+ddmax187 max  NaN14 -NaN5  ->  NaN14\r
+\r
+ddmax188 max -Inf    NaN4  -> -Infinity\r
+ddmax189 max -9     -NaN3  -> -9\r
+ddmax190 max  Inf    NaN2  ->  Infinity\r
+\r
+ddmax191 max  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddmax192 max  sNaN98 -1      ->  NaN98 Invalid_operation\r
+ddmax193 max -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+ddmax194 max  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+ddmax195 max  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddmax196 max -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddmax197 max  0      sNaN91  ->  NaN91 Invalid_operation\r
+ddmax198 max  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+ddmax199 max  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- old rounding checks\r
+ddmax221 max 12345678000 1  -> 12345678000\r
+ddmax222 max 1 12345678000  -> 12345678000\r
+ddmax223 max 1234567800  1  -> 1234567800\r
+ddmax224 max 1 1234567800   -> 1234567800\r
+ddmax225 max 1234567890  1  -> 1234567890\r
+ddmax226 max 1 1234567890   -> 1234567890\r
+ddmax227 max 1234567891  1  -> 1234567891\r
+ddmax228 max 1 1234567891   -> 1234567891\r
+ddmax229 max 12345678901 1  -> 12345678901\r
+ddmax230 max 1 12345678901  -> 12345678901\r
+ddmax231 max 1234567896  1  -> 1234567896\r
+ddmax232 max 1 1234567896   -> 1234567896\r
+ddmax233 max -1234567891  1 -> 1\r
+ddmax234 max 1 -1234567891  -> 1\r
+ddmax235 max -12345678901 1 -> 1\r
+ddmax236 max 1 -12345678901 -> 1\r
+ddmax237 max -1234567896  1 -> 1\r
+ddmax238 max 1 -1234567896  -> 1\r
+\r
+-- from examples\r
+ddmax280 max '3'   '2'  ->  '3'\r
+ddmax281 max '-10' '3'  ->  '3'\r
+ddmax282 max '1.0' '1'  ->  '1'\r
+ddmax283 max '1' '1.0'  ->  '1'\r
+ddmax284 max '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+ddmax401 max  Inf    1.1     ->  Infinity\r
+ddmax402 max  1.1    1       ->  1.1\r
+ddmax403 max  1      1.0     ->  1\r
+ddmax404 max  1.0    0.1     ->  1.0\r
+ddmax405 max  0.1    0.10    ->  0.1\r
+ddmax406 max  0.10   0.100   ->  0.10\r
+ddmax407 max  0.10   0       ->  0.10\r
+ddmax408 max  0      0.0     ->  0\r
+ddmax409 max  0.0   -0       ->  0.0\r
+ddmax410 max  0.0   -0.0     ->  0.0\r
+ddmax411 max  0.00  -0.0     ->  0.00\r
+ddmax412 max  0.0   -0.00    ->  0.0\r
+ddmax413 max  0     -0.0     ->  0\r
+ddmax414 max  0     -0       ->  0\r
+ddmax415 max -0.0   -0       -> -0.0\r
+ddmax416 max -0     -0.100   -> -0\r
+ddmax417 max -0.100 -0.10    -> -0.100\r
+ddmax418 max -0.10  -0.1     -> -0.10\r
+ddmax419 max -0.1   -1.0     -> -0.1\r
+ddmax420 max -1.0   -1       -> -1.0\r
+ddmax421 max -1     -1.1     -> -1\r
+ddmax423 max -1.1   -Inf     -> -1.1\r
+-- same with operands reversed\r
+ddmax431 max  1.1    Inf     ->  Infinity\r
+ddmax432 max  1      1.1     ->  1.1\r
+ddmax433 max  1.0    1       ->  1\r
+ddmax434 max  0.1    1.0     ->  1.0\r
+ddmax435 max  0.10   0.1     ->  0.1\r
+ddmax436 max  0.100  0.10    ->  0.10\r
+ddmax437 max  0      0.10    ->  0.10\r
+ddmax438 max  0.0    0       ->  0\r
+ddmax439 max -0      0.0     ->  0.0\r
+ddmax440 max -0.0    0.0     ->  0.0\r
+ddmax441 max -0.0    0.00    ->  0.00\r
+ddmax442 max -0.00   0.0     ->  0.0\r
+ddmax443 max -0.0    0       ->  0\r
+ddmax444 max -0      0       ->  0\r
+ddmax445 max -0     -0.0     -> -0.0\r
+ddmax446 max -0.100 -0       -> -0\r
+ddmax447 max -0.10  -0.100   -> -0.100\r
+ddmax448 max -0.1   -0.10    -> -0.10\r
+ddmax449 max -1.0   -0.1     -> -0.1\r
+ddmax450 max -1     -1.0     -> -1.0\r
+ddmax451 max -1.1   -1       -> -1\r
+ddmax453 max -Inf   -1.1     -> -1.1\r
+-- largies\r
+ddmax460 max  1000   1E+3    ->  1E+3\r
+ddmax461 max  1E+3   1000    ->  1E+3\r
+ddmax462 max  1000  -1E+3    ->  1000\r
+ddmax463 max  1E+3  -1000    ->  1E+3\r
+ddmax464 max -1000   1E+3    ->  1E+3\r
+ddmax465 max -1E+3   1000    ->  1000\r
+ddmax466 max -1000  -1E+3    -> -1000\r
+ddmax467 max -1E+3  -1000    -> -1000\r
+\r
+-- misalignment traps for little-endian\r
+ddmax471 max      1.0       0.1  -> 1.0\r
+ddmax472 max      0.1       1.0  -> 1.0\r
+ddmax473 max     10.0       0.1  -> 10.0\r
+ddmax474 max      0.1      10.0  -> 10.0\r
+ddmax475 max      100       1.0  -> 100\r
+ddmax476 max      1.0       100  -> 100\r
+ddmax477 max     1000      10.0  -> 1000\r
+ddmax478 max     10.0      1000  -> 1000\r
+ddmax479 max    10000     100.0  -> 10000\r
+ddmax480 max    100.0     10000  -> 10000\r
+ddmax481 max   100000    1000.0  -> 100000\r
+ddmax482 max   1000.0    100000  -> 100000\r
+ddmax483 max  1000000   10000.0  -> 1000000\r
+ddmax484 max  10000.0   1000000  -> 1000000\r
+\r
+-- subnormals\r
+ddmax510 max  1.00E-383       0  ->   1.00E-383\r
+ddmax511 max  0.1E-383        0  ->   1E-384    Subnormal\r
+ddmax512 max  0.10E-383       0  ->   1.0E-384  Subnormal\r
+ddmax513 max  0.100E-383      0  ->   1.00E-384 Subnormal\r
+ddmax514 max  0.01E-383       0  ->   1E-385    Subnormal\r
+ddmax515 max  0.999E-383      0  ->   9.99E-384 Subnormal\r
+ddmax516 max  0.099E-383      0  ->   9.9E-385  Subnormal\r
+ddmax517 max  0.009E-383      0  ->   9E-386    Subnormal\r
+ddmax518 max  0.001E-383      0  ->   1E-386    Subnormal\r
+ddmax519 max  0.0009E-383     0  ->   9E-387    Subnormal\r
+ddmax520 max  0.0001E-383     0  ->   1E-387    Subnormal\r
+\r
+ddmax530 max -1.00E-383       0  ->   0\r
+ddmax531 max -0.1E-383        0  ->   0\r
+ddmax532 max -0.10E-383       0  ->   0\r
+ddmax533 max -0.100E-383      0  ->   0\r
+ddmax534 max -0.01E-383       0  ->   0\r
+ddmax535 max -0.999E-383      0  ->   0\r
+ddmax536 max -0.099E-383      0  ->   0\r
+ddmax537 max -0.009E-383      0  ->   0\r
+ddmax538 max -0.001E-383      0  ->   0\r
+ddmax539 max -0.0009E-383     0  ->   0\r
+ddmax540 max -0.0001E-383     0  ->   0\r
+\r
+-- Null tests\r
+ddmax900 max 10  #  -> NaN Invalid_operation\r
+ddmax901 max  # 10  -> NaN Invalid_operation\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddMaxMag.decTest b/Lib/test/decimaltestdata/ddMaxMag.decTest
new file mode 100644 (file)
index 0000000..dbabc99
--- /dev/null
@@ -0,0 +1,304 @@
+------------------------------------------------------------------------\r
+-- ddMaxMag.decTest -- decDouble maxnummag                            --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddmxg001 maxmag  -2  -2  -> -2\r
+ddmxg002 maxmag  -2  -1  -> -2\r
+ddmxg003 maxmag  -2   0  -> -2\r
+ddmxg004 maxmag  -2   1  -> -2\r
+ddmxg005 maxmag  -2   2  ->  2\r
+ddmxg006 maxmag  -1  -2  -> -2\r
+ddmxg007 maxmag  -1  -1  -> -1\r
+ddmxg008 maxmag  -1   0  -> -1\r
+ddmxg009 maxmag  -1   1  ->  1\r
+ddmxg010 maxmag  -1   2  ->  2\r
+ddmxg011 maxmag   0  -2  -> -2\r
+ddmxg012 maxmag   0  -1  -> -1\r
+ddmxg013 maxmag   0   0  ->  0\r
+ddmxg014 maxmag   0   1  ->  1\r
+ddmxg015 maxmag   0   2  ->  2\r
+ddmxg016 maxmag   1  -2  -> -2\r
+ddmxg017 maxmag   1  -1  ->  1\r
+ddmxg018 maxmag   1   0  ->  1\r
+ddmxg019 maxmag   1   1  ->  1\r
+ddmxg020 maxmag   1   2  ->  2\r
+ddmxg021 maxmag   2  -2  ->  2\r
+ddmxg022 maxmag   2  -1  ->  2\r
+ddmxg023 maxmag   2   0  ->  2\r
+ddmxg025 maxmag   2   1  ->  2\r
+ddmxg026 maxmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+ddmxg030 maxmag   0     0   ->  0\r
+ddmxg031 maxmag   0    -0   ->  0\r
+ddmxg032 maxmag   0    -0.0 ->  0\r
+ddmxg033 maxmag   0     0.0 ->  0\r
+ddmxg034 maxmag  -0     0   ->  0    -- note: -0 = 0, but 0 chosen\r
+ddmxg035 maxmag  -0    -0   -> -0\r
+ddmxg036 maxmag  -0    -0.0 -> -0.0\r
+ddmxg037 maxmag  -0     0.0 ->  0.0\r
+ddmxg038 maxmag   0.0   0   ->  0\r
+ddmxg039 maxmag   0.0  -0   ->  0.0\r
+ddmxg040 maxmag   0.0  -0.0 ->  0.0\r
+ddmxg041 maxmag   0.0   0.0 ->  0.0\r
+ddmxg042 maxmag  -0.0   0   ->  0\r
+ddmxg043 maxmag  -0.0  -0   -> -0.0\r
+ddmxg044 maxmag  -0.0  -0.0 -> -0.0\r
+ddmxg045 maxmag  -0.0   0.0 ->  0.0\r
+\r
+ddmxg050 maxmag  -0E1   0E1 ->  0E+1\r
+ddmxg051 maxmag  -0E2   0E2 ->  0E+2\r
+ddmxg052 maxmag  -0E2   0E1 ->  0E+1\r
+ddmxg053 maxmag  -0E1   0E2 ->  0E+2\r
+ddmxg054 maxmag   0E1  -0E1 ->  0E+1\r
+ddmxg055 maxmag   0E2  -0E2 ->  0E+2\r
+ddmxg056 maxmag   0E2  -0E1 ->  0E+2\r
+ddmxg057 maxmag   0E1  -0E2 ->  0E+1\r
+\r
+ddmxg058 maxmag   0E1   0E1 ->  0E+1\r
+ddmxg059 maxmag   0E2   0E2 ->  0E+2\r
+ddmxg060 maxmag   0E2   0E1 ->  0E+2\r
+ddmxg061 maxmag   0E1   0E2 ->  0E+2\r
+ddmxg062 maxmag  -0E1  -0E1 -> -0E+1\r
+ddmxg063 maxmag  -0E2  -0E2 -> -0E+2\r
+ddmxg064 maxmag  -0E2  -0E1 -> -0E+1\r
+ddmxg065 maxmag  -0E1  -0E2 -> -0E+1\r
+\r
+-- Specials\r
+ddmxg090 maxmag  Inf  -Inf   ->  Infinity\r
+ddmxg091 maxmag  Inf  -1000  ->  Infinity\r
+ddmxg092 maxmag  Inf  -1     ->  Infinity\r
+ddmxg093 maxmag  Inf  -0     ->  Infinity\r
+ddmxg094 maxmag  Inf   0     ->  Infinity\r
+ddmxg095 maxmag  Inf   1     ->  Infinity\r
+ddmxg096 maxmag  Inf   1000  ->  Infinity\r
+ddmxg097 maxmag  Inf   Inf   ->  Infinity\r
+ddmxg098 maxmag -1000  Inf   ->  Infinity\r
+ddmxg099 maxmag -Inf   Inf   ->  Infinity\r
+ddmxg100 maxmag -1     Inf   ->  Infinity\r
+ddmxg101 maxmag -0     Inf   ->  Infinity\r
+ddmxg102 maxmag  0     Inf   ->  Infinity\r
+ddmxg103 maxmag  1     Inf   ->  Infinity\r
+ddmxg104 maxmag  1000  Inf   ->  Infinity\r
+ddmxg105 maxmag  Inf   Inf   ->  Infinity\r
+\r
+ddmxg120 maxmag -Inf  -Inf   -> -Infinity\r
+ddmxg121 maxmag -Inf  -1000  -> -Infinity\r
+ddmxg122 maxmag -Inf  -1     -> -Infinity\r
+ddmxg123 maxmag -Inf  -0     -> -Infinity\r
+ddmxg124 maxmag -Inf   0     -> -Infinity\r
+ddmxg125 maxmag -Inf   1     -> -Infinity\r
+ddmxg126 maxmag -Inf   1000  -> -Infinity\r
+ddmxg127 maxmag -Inf   Inf   ->  Infinity\r
+ddmxg128 maxmag -Inf  -Inf   ->  -Infinity\r
+ddmxg129 maxmag -1000 -Inf   -> -Infinity\r
+ddmxg130 maxmag -1    -Inf   -> -Infinity\r
+ddmxg131 maxmag -0    -Inf   -> -Infinity\r
+ddmxg132 maxmag  0    -Inf   -> -Infinity\r
+ddmxg133 maxmag  1    -Inf   -> -Infinity\r
+ddmxg134 maxmag  1000 -Inf   -> -Infinity\r
+ddmxg135 maxmag  Inf  -Inf   ->  Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+ddmxg141 maxmag  NaN -Inf    -> -Infinity\r
+ddmxg142 maxmag  NaN -1000   -> -1000\r
+ddmxg143 maxmag  NaN -1      -> -1\r
+ddmxg144 maxmag  NaN -0      -> -0\r
+ddmxg145 maxmag  NaN  0      ->  0\r
+ddmxg146 maxmag  NaN  1      ->  1\r
+ddmxg147 maxmag  NaN  1000   ->  1000\r
+ddmxg148 maxmag  NaN  Inf    ->  Infinity\r
+ddmxg149 maxmag  NaN  NaN    ->  NaN\r
+ddmxg150 maxmag -Inf  NaN    -> -Infinity\r
+ddmxg151 maxmag -1000 NaN    -> -1000\r
+ddmxg152 maxmag -1    NaN    -> -1\r
+ddmxg153 maxmag -0    NaN    -> -0\r
+ddmxg154 maxmag  0    NaN    ->  0\r
+ddmxg155 maxmag  1    NaN    ->  1\r
+ddmxg156 maxmag  1000 NaN    ->  1000\r
+ddmxg157 maxmag  Inf  NaN    ->  Infinity\r
+\r
+ddmxg161 maxmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddmxg162 maxmag  sNaN -1000  ->  NaN  Invalid_operation\r
+ddmxg163 maxmag  sNaN -1     ->  NaN  Invalid_operation\r
+ddmxg164 maxmag  sNaN -0     ->  NaN  Invalid_operation\r
+ddmxg165 maxmag  sNaN  0     ->  NaN  Invalid_operation\r
+ddmxg166 maxmag  sNaN  1     ->  NaN  Invalid_operation\r
+ddmxg167 maxmag  sNaN  1000  ->  NaN  Invalid_operation\r
+ddmxg168 maxmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddmxg169 maxmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddmxg170 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddmxg171 maxmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmxg172 maxmag -1000 sNaN   ->  NaN  Invalid_operation\r
+ddmxg173 maxmag -1    sNaN   ->  NaN  Invalid_operation\r
+ddmxg174 maxmag -0    sNaN   ->  NaN  Invalid_operation\r
+ddmxg175 maxmag  0    sNaN   ->  NaN  Invalid_operation\r
+ddmxg176 maxmag  1    sNaN   ->  NaN  Invalid_operation\r
+ddmxg177 maxmag  1000 sNaN   ->  NaN  Invalid_operation\r
+ddmxg178 maxmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmxg179 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddmxg181 maxmag  NaN9  -Inf   -> -Infinity\r
+ddmxg182 maxmag  NaN8     9   ->  9\r
+ddmxg183 maxmag -NaN7   Inf   ->  Infinity\r
+\r
+ddmxg184 maxmag -NaN1   NaN11 -> -NaN1\r
+ddmxg185 maxmag  NaN2   NaN12 ->  NaN2\r
+ddmxg186 maxmag -NaN13 -NaN7  -> -NaN13\r
+ddmxg187 maxmag  NaN14 -NaN5  ->  NaN14\r
+\r
+ddmxg188 maxmag -Inf    NaN4  -> -Infinity\r
+ddmxg189 maxmag -9     -NaN3  -> -9\r
+ddmxg190 maxmag  Inf    NaN2  ->  Infinity\r
+\r
+ddmxg191 maxmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddmxg192 maxmag  sNaN98 -1      ->  NaN98 Invalid_operation\r
+ddmxg193 maxmag -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+ddmxg194 maxmag  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+ddmxg195 maxmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddmxg196 maxmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddmxg197 maxmag  0      sNaN91  ->  NaN91 Invalid_operation\r
+ddmxg198 maxmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+ddmxg199 maxmag  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- old rounding checks\r
+ddmxg221 maxmag 12345678000 1  -> 12345678000\r
+ddmxg222 maxmag 1 12345678000  -> 12345678000\r
+ddmxg223 maxmag 1234567800  1  -> 1234567800\r
+ddmxg224 maxmag 1 1234567800   -> 1234567800\r
+ddmxg225 maxmag 1234567890  1  -> 1234567890\r
+ddmxg226 maxmag 1 1234567890   -> 1234567890\r
+ddmxg227 maxmag 1234567891  1  -> 1234567891\r
+ddmxg228 maxmag 1 1234567891   -> 1234567891\r
+ddmxg229 maxmag 12345678901 1  -> 12345678901\r
+ddmxg230 maxmag 1 12345678901  -> 12345678901\r
+ddmxg231 maxmag 1234567896  1  -> 1234567896\r
+ddmxg232 maxmag 1 1234567896   -> 1234567896\r
+ddmxg233 maxmag -1234567891  1 -> -1234567891\r
+ddmxg234 maxmag 1 -1234567891  -> -1234567891\r
+ddmxg235 maxmag -12345678901 1 -> -12345678901\r
+ddmxg236 maxmag 1 -12345678901 -> -12345678901\r
+ddmxg237 maxmag -1234567896  1 -> -1234567896\r
+ddmxg238 maxmag 1 -1234567896  -> -1234567896\r
+\r
+-- from examples\r
+ddmxg280 maxmag '3'   '2'  ->  '3'\r
+ddmxg281 maxmag '-10' '3'  ->  '-10'\r
+ddmxg282 maxmag '1.0' '1'  ->  '1'\r
+ddmxg283 maxmag '1' '1.0'  ->  '1'\r
+ddmxg284 maxmag '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+ddmxg401 maxmag  Inf    1.1     ->  Infinity\r
+ddmxg402 maxmag  1.1    1       ->  1.1\r
+ddmxg403 maxmag  1      1.0     ->  1\r
+ddmxg404 maxmag  1.0    0.1     ->  1.0\r
+ddmxg405 maxmag  0.1    0.10    ->  0.1\r
+ddmxg406 maxmag  0.10   0.100   ->  0.10\r
+ddmxg407 maxmag  0.10   0       ->  0.10\r
+ddmxg408 maxmag  0      0.0     ->  0\r
+ddmxg409 maxmag  0.0   -0       ->  0.0\r
+ddmxg410 maxmag  0.0   -0.0     ->  0.0\r
+ddmxg411 maxmag  0.00  -0.0     ->  0.00\r
+ddmxg412 maxmag  0.0   -0.00    ->  0.0\r
+ddmxg413 maxmag  0     -0.0     ->  0\r
+ddmxg414 maxmag  0     -0       ->  0\r
+ddmxg415 maxmag -0.0   -0       -> -0.0\r
+ddmxg416 maxmag -0     -0.100   -> -0.100\r
+ddmxg417 maxmag -0.100 -0.10    -> -0.100\r
+ddmxg418 maxmag -0.10  -0.1     -> -0.10\r
+ddmxg419 maxmag -0.1   -1.0     -> -1.0\r
+ddmxg420 maxmag -1.0   -1       -> -1.0\r
+ddmxg421 maxmag -1     -1.1     -> -1.1\r
+ddmxg423 maxmag -1.1   -Inf     -> -Infinity\r
+-- same with operands reversed\r
+ddmxg431 maxmag  1.1    Inf     ->  Infinity\r
+ddmxg432 maxmag  1      1.1     ->  1.1\r
+ddmxg433 maxmag  1.0    1       ->  1\r
+ddmxg434 maxmag  0.1    1.0     ->  1.0\r
+ddmxg435 maxmag  0.10   0.1     ->  0.1\r
+ddmxg436 maxmag  0.100  0.10    ->  0.10\r
+ddmxg437 maxmag  0      0.10    ->  0.10\r
+ddmxg438 maxmag  0.0    0       ->  0\r
+ddmxg439 maxmag -0      0.0     ->  0.0\r
+ddmxg440 maxmag -0.0    0.0     ->  0.0\r
+ddmxg441 maxmag -0.0    0.00    ->  0.00\r
+ddmxg442 maxmag -0.00   0.0     ->  0.0\r
+ddmxg443 maxmag -0.0    0       ->  0\r
+ddmxg444 maxmag -0      0       ->  0\r
+ddmxg445 maxmag -0     -0.0     -> -0.0\r
+ddmxg446 maxmag -0.100 -0       -> -0.100\r
+ddmxg447 maxmag -0.10  -0.100   -> -0.100\r
+ddmxg448 maxmag -0.1   -0.10    -> -0.10\r
+ddmxg449 maxmag -1.0   -0.1     -> -1.0\r
+ddmxg450 maxmag -1     -1.0     -> -1.0\r
+ddmxg451 maxmag -1.1   -1       -> -1.1\r
+ddmxg453 maxmag -Inf   -1.1     -> -Infinity\r
+-- largies\r
+ddmxg460 maxmag  1000   1E+3    ->  1E+3\r
+ddmxg461 maxmag  1E+3   1000    ->  1E+3\r
+ddmxg462 maxmag  1000  -1E+3    ->  1000\r
+ddmxg463 maxmag  1E+3  -1000    ->  1E+3\r
+ddmxg464 maxmag -1000   1E+3    ->  1E+3\r
+ddmxg465 maxmag -1E+3   1000    ->  1000\r
+ddmxg466 maxmag -1000  -1E+3    -> -1000\r
+ddmxg467 maxmag -1E+3  -1000    -> -1000\r
+\r
+-- subnormals\r
+ddmxg510 maxmag  1.00E-383       0  ->   1.00E-383\r
+ddmxg511 maxmag  0.1E-383        0  ->   1E-384    Subnormal\r
+ddmxg512 maxmag  0.10E-383       0  ->   1.0E-384  Subnormal\r
+ddmxg513 maxmag  0.100E-383      0  ->   1.00E-384 Subnormal\r
+ddmxg514 maxmag  0.01E-383       0  ->   1E-385    Subnormal\r
+ddmxg515 maxmag  0.999E-383      0  ->   9.99E-384 Subnormal\r
+ddmxg516 maxmag  0.099E-383      0  ->   9.9E-385  Subnormal\r
+ddmxg517 maxmag  0.009E-383      0  ->   9E-386    Subnormal\r
+ddmxg518 maxmag  0.001E-383      0  ->   1E-386    Subnormal\r
+ddmxg519 maxmag  0.0009E-383     0  ->   9E-387    Subnormal\r
+ddmxg520 maxmag  0.0001E-383     0  ->   1E-387    Subnormal\r
+\r
+ddmxg530 maxmag -1.00E-383       0  ->  -1.00E-383\r
+ddmxg531 maxmag -0.1E-383        0  ->  -1E-384    Subnormal\r
+ddmxg532 maxmag -0.10E-383       0  ->  -1.0E-384  Subnormal\r
+ddmxg533 maxmag -0.100E-383      0  ->  -1.00E-384 Subnormal\r
+ddmxg534 maxmag -0.01E-383       0  ->  -1E-385    Subnormal\r
+ddmxg535 maxmag -0.999E-383      0  ->  -9.99E-384 Subnormal\r
+ddmxg536 maxmag -0.099E-383      0  ->  -9.9E-385  Subnormal\r
+ddmxg537 maxmag -0.009E-383      0  ->  -9E-386    Subnormal\r
+ddmxg538 maxmag -0.001E-383      0  ->  -1E-386    Subnormal\r
+ddmxg539 maxmag -0.0009E-383     0  ->  -9E-387    Subnormal\r
+ddmxg540 maxmag -0.0001E-383     0  ->  -1E-387    Subnormal\r
+\r
+-- Null tests\r
+ddmxg900 maxmag 10  #  -> NaN Invalid_operation\r
+ddmxg901 maxmag  # 10  -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddMin.decTest b/Lib/test/decimaltestdata/ddMin.decTest
new file mode 100644 (file)
index 0000000..4ba27f7
--- /dev/null
@@ -0,0 +1,309 @@
+------------------------------------------------------------------------\r
+-- ddMin.decTest -- decDouble minnum                                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddmin001 min  -2  -2  -> -2\r
+ddmin002 min  -2  -1  -> -2\r
+ddmin003 min  -2   0  -> -2\r
+ddmin004 min  -2   1  -> -2\r
+ddmin005 min  -2   2  -> -2\r
+ddmin006 min  -1  -2  -> -2\r
+ddmin007 min  -1  -1  -> -1\r
+ddmin008 min  -1   0  -> -1\r
+ddmin009 min  -1   1  -> -1\r
+ddmin010 min  -1   2  -> -1\r
+ddmin011 min   0  -2  -> -2\r
+ddmin012 min   0  -1  -> -1\r
+ddmin013 min   0   0  ->  0\r
+ddmin014 min   0   1  ->  0\r
+ddmin015 min   0   2  ->  0\r
+ddmin016 min   1  -2  -> -2\r
+ddmin017 min   1  -1  -> -1\r
+ddmin018 min   1   0  ->  0\r
+ddmin019 min   1   1  ->  1\r
+ddmin020 min   1   2  ->  1\r
+ddmin021 min   2  -2  -> -2\r
+ddmin022 min   2  -1  -> -1\r
+ddmin023 min   2   0  ->  0\r
+ddmin025 min   2   1  ->  1\r
+ddmin026 min   2   2  ->  2\r
+\r
+-- extended zeros\r
+ddmin030 min   0     0   ->  0\r
+ddmin031 min   0    -0   -> -0\r
+ddmin032 min   0    -0.0 -> -0.0\r
+ddmin033 min   0     0.0 ->  0.0\r
+ddmin034 min  -0     0   -> -0\r
+ddmin035 min  -0    -0   -> -0\r
+ddmin036 min  -0    -0.0 -> -0\r
+ddmin037 min  -0     0.0 -> -0\r
+ddmin038 min   0.0   0   ->  0.0\r
+ddmin039 min   0.0  -0   -> -0\r
+ddmin040 min   0.0  -0.0 -> -0.0\r
+ddmin041 min   0.0   0.0 ->  0.0\r
+ddmin042 min  -0.0   0   -> -0.0\r
+ddmin043 min  -0.0  -0   -> -0\r
+ddmin044 min  -0.0  -0.0 -> -0.0\r
+ddmin045 min  -0.0   0.0 -> -0.0\r
+\r
+ddmin046 min   0E1  -0E1 -> -0E+1\r
+ddmin047 min  -0E1   0E2 -> -0E+1\r
+ddmin048 min   0E2   0E1 ->  0E+1\r
+ddmin049 min   0E1   0E2 ->  0E+1\r
+ddmin050 min  -0E3  -0E2 -> -0E+3\r
+ddmin051 min  -0E2  -0E3 -> -0E+3\r
+\r
+-- Specials\r
+ddmin090 min  Inf  -Inf   -> -Infinity\r
+ddmin091 min  Inf  -1000  -> -1000\r
+ddmin092 min  Inf  -1     -> -1\r
+ddmin093 min  Inf  -0     -> -0\r
+ddmin094 min  Inf   0     ->  0\r
+ddmin095 min  Inf   1     ->  1\r
+ddmin096 min  Inf   1000  ->  1000\r
+ddmin097 min  Inf   Inf   ->  Infinity\r
+ddmin098 min -1000  Inf   -> -1000\r
+ddmin099 min -Inf   Inf   -> -Infinity\r
+ddmin100 min -1     Inf   -> -1\r
+ddmin101 min -0     Inf   -> -0\r
+ddmin102 min  0     Inf   ->  0\r
+ddmin103 min  1     Inf   ->  1\r
+ddmin104 min  1000  Inf   ->  1000\r
+ddmin105 min  Inf   Inf   ->  Infinity\r
+\r
+ddmin120 min -Inf  -Inf   -> -Infinity\r
+ddmin121 min -Inf  -1000  -> -Infinity\r
+ddmin122 min -Inf  -1     -> -Infinity\r
+ddmin123 min -Inf  -0     -> -Infinity\r
+ddmin124 min -Inf   0     -> -Infinity\r
+ddmin125 min -Inf   1     -> -Infinity\r
+ddmin126 min -Inf   1000  -> -Infinity\r
+ddmin127 min -Inf   Inf   -> -Infinity\r
+ddmin128 min -Inf  -Inf   -> -Infinity\r
+ddmin129 min -1000 -Inf   -> -Infinity\r
+ddmin130 min -1    -Inf   -> -Infinity\r
+ddmin131 min -0    -Inf   -> -Infinity\r
+ddmin132 min  0    -Inf   -> -Infinity\r
+ddmin133 min  1    -Inf   -> -Infinity\r
+ddmin134 min  1000 -Inf   -> -Infinity\r
+ddmin135 min  Inf  -Inf   -> -Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+ddmin141 min  NaN -Inf    ->  -Infinity\r
+ddmin142 min  NaN -1000   ->  -1000\r
+ddmin143 min  NaN -1      ->  -1\r
+ddmin144 min  NaN -0      ->  -0\r
+ddmin145 min  NaN  0      ->  0\r
+ddmin146 min  NaN  1      ->  1\r
+ddmin147 min  NaN  1000   ->  1000\r
+ddmin148 min  NaN  Inf    ->  Infinity\r
+ddmin149 min  NaN  NaN    ->  NaN\r
+ddmin150 min -Inf  NaN    -> -Infinity\r
+ddmin151 min -1000 NaN    -> -1000\r
+ddmin152 min -1   -NaN    -> -1\r
+ddmin153 min -0    NaN    -> -0\r
+ddmin154 min  0   -NaN    ->  0\r
+ddmin155 min  1    NaN    ->  1\r
+ddmin156 min  1000 NaN    ->  1000\r
+ddmin157 min  Inf  NaN    ->  Infinity\r
+\r
+ddmin161 min  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddmin162 min  sNaN -1000  ->  NaN  Invalid_operation\r
+ddmin163 min  sNaN -1     ->  NaN  Invalid_operation\r
+ddmin164 min  sNaN -0     ->  NaN  Invalid_operation\r
+ddmin165 min -sNaN  0     -> -NaN  Invalid_operation\r
+ddmin166 min -sNaN  1     -> -NaN  Invalid_operation\r
+ddmin167 min  sNaN  1000  ->  NaN  Invalid_operation\r
+ddmin168 min  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddmin169 min  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddmin170 min  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddmin171 min -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmin172 min -1000 sNaN   ->  NaN  Invalid_operation\r
+ddmin173 min -1    sNaN   ->  NaN  Invalid_operation\r
+ddmin174 min -0    sNaN   ->  NaN  Invalid_operation\r
+ddmin175 min  0    sNaN   ->  NaN  Invalid_operation\r
+ddmin176 min  1    sNaN   ->  NaN  Invalid_operation\r
+ddmin177 min  1000 sNaN   ->  NaN  Invalid_operation\r
+ddmin178 min  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmin179 min  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddmin181 min  NaN9   -Inf   -> -Infinity\r
+ddmin182 min -NaN8    9990  ->  9990\r
+ddmin183 min  NaN71   Inf   ->  Infinity\r
+\r
+ddmin184 min  NaN1    NaN54 ->  NaN1\r
+ddmin185 min  NaN22  -NaN53 ->  NaN22\r
+ddmin186 min -NaN3    NaN6  -> -NaN3\r
+ddmin187 min -NaN44   NaN7  -> -NaN44\r
+\r
+ddmin188 min -Inf     NaN41 -> -Infinity\r
+ddmin189 min -9999   -NaN33 -> -9999\r
+ddmin190 min  Inf     NaN2  ->  Infinity\r
+\r
+ddmin191 min  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddmin192 min  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddmin193 min -sNaN97  NaN8   -> -NaN97 Invalid_operation\r
+ddmin194 min  sNaN69 sNaN94  ->  NaN69 Invalid_operation\r
+ddmin195 min  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddmin196 min -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddmin197 min  088    sNaN91  ->  NaN91 Invalid_operation\r
+ddmin198 min  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+ddmin199 min  NaN    sNaN86  ->  NaN86 Invalid_operation\r
+\r
+-- old rounding checks\r
+ddmin221 min -12345678000 1  -> -12345678000\r
+ddmin222 min 1 -12345678000  -> -12345678000\r
+ddmin223 min -1234567800  1  -> -1234567800\r
+ddmin224 min 1 -1234567800   -> -1234567800\r
+ddmin225 min -1234567890  1  -> -1234567890\r
+ddmin226 min 1 -1234567890   -> -1234567890\r
+ddmin227 min -1234567891  1  -> -1234567891\r
+ddmin228 min 1 -1234567891   -> -1234567891\r
+ddmin229 min -12345678901 1  -> -12345678901\r
+ddmin230 min 1 -12345678901  -> -12345678901\r
+ddmin231 min -1234567896  1  -> -1234567896\r
+ddmin232 min 1 -1234567896   -> -1234567896\r
+ddmin233 min 1234567891  1   -> 1\r
+ddmin234 min 1 1234567891    -> 1\r
+ddmin235 min 12345678901 1   -> 1\r
+ddmin236 min 1 12345678901   -> 1\r
+ddmin237 min 1234567896  1   -> 1\r
+ddmin238 min 1 1234567896    -> 1\r
+\r
+-- from examples\r
+ddmin280 min '3'   '2'  ->  '2'\r
+ddmin281 min '-10' '3'  ->  '-10'\r
+ddmin282 min '1.0' '1'  ->  '1.0'\r
+ddmin283 min '1' '1.0'  ->  '1.0'\r
+ddmin284 min '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+ddmin401 min  Inf    1.1     ->  1.1\r
+ddmin402 min  1.1    1       ->  1\r
+ddmin403 min  1      1.0     ->  1.0\r
+ddmin404 min  1.0    0.1     ->  0.1\r
+ddmin405 min  0.1    0.10    ->  0.10\r
+ddmin406 min  0.10   0.100   ->  0.100\r
+ddmin407 min  0.10   0       ->  0\r
+ddmin408 min  0      0.0     ->  0.0\r
+ddmin409 min  0.0   -0       -> -0\r
+ddmin410 min  0.0   -0.0     -> -0.0\r
+ddmin411 min  0.00  -0.0     -> -0.0\r
+ddmin412 min  0.0   -0.00    -> -0.00\r
+ddmin413 min  0     -0.0     -> -0.0\r
+ddmin414 min  0     -0       -> -0\r
+ddmin415 min -0.0   -0       -> -0\r
+ddmin416 min -0     -0.100   -> -0.100\r
+ddmin417 min -0.100 -0.10    -> -0.10\r
+ddmin418 min -0.10  -0.1     -> -0.1\r
+ddmin419 min -0.1   -1.0     -> -1.0\r
+ddmin420 min -1.0   -1       -> -1\r
+ddmin421 min -1     -1.1     -> -1.1\r
+ddmin423 min -1.1   -Inf     -> -Infinity\r
+-- same with operands reversed\r
+ddmin431 min  1.1    Inf     ->  1.1\r
+ddmin432 min  1      1.1     ->  1\r
+ddmin433 min  1.0    1       ->  1.0\r
+ddmin434 min  0.1    1.0     ->  0.1\r
+ddmin435 min  0.10   0.1     ->  0.10\r
+ddmin436 min  0.100  0.10    ->  0.100\r
+ddmin437 min  0      0.10    ->  0\r
+ddmin438 min  0.0    0       ->  0.0\r
+ddmin439 min -0      0.0     -> -0\r
+ddmin440 min -0.0    0.0     -> -0.0\r
+ddmin441 min -0.0    0.00    -> -0.0\r
+ddmin442 min -0.00   0.0     -> -0.00\r
+ddmin443 min -0.0    0       -> -0.0\r
+ddmin444 min -0      0       -> -0\r
+ddmin445 min -0     -0.0     -> -0\r
+ddmin446 min -0.100 -0       -> -0.100\r
+ddmin447 min -0.10  -0.100   -> -0.10\r
+ddmin448 min -0.1   -0.10    -> -0.1\r
+ddmin449 min -1.0   -0.1     -> -1.0\r
+ddmin450 min -1     -1.0     -> -1\r
+ddmin451 min -1.1   -1       -> -1.1\r
+ddmin453 min -Inf   -1.1     -> -Infinity\r
+-- largies\r
+ddmin460 min  1000   1E+3    ->  1000\r
+ddmin461 min  1E+3   1000    ->  1000\r
+ddmin462 min  1000  -1E+3    -> -1E+3\r
+ddmin463 min  1E+3  -384    -> -384\r
+ddmin464 min -384   1E+3    -> -384\r
+ddmin465 min -1E+3   1000    -> -1E+3\r
+ddmin466 min -384  -1E+3    -> -1E+3\r
+ddmin467 min -1E+3  -384    -> -1E+3\r
+\r
+-- misalignment traps for little-endian\r
+ddmin471 min      1.0       0.1  -> 0.1\r
+ddmin472 min      0.1       1.0  -> 0.1\r
+ddmin473 min     10.0       0.1  -> 0.1\r
+ddmin474 min      0.1      10.0  -> 0.1\r
+ddmin475 min      100       1.0  -> 1.0\r
+ddmin476 min      1.0       100  -> 1.0\r
+ddmin477 min     1000      10.0  -> 10.0\r
+ddmin478 min     10.0      1000  -> 10.0\r
+ddmin479 min    10000     100.0  -> 100.0\r
+ddmin480 min    100.0     10000  -> 100.0\r
+ddmin481 min   100000    1000.0  -> 1000.0\r
+ddmin482 min   1000.0    100000  -> 1000.0\r
+ddmin483 min  1000000   10000.0  -> 10000.0\r
+ddmin484 min  10000.0   1000000  -> 10000.0\r
+\r
+-- subnormals\r
+ddmin510 min  1.00E-383       0  ->   0\r
+ddmin511 min  0.1E-383        0  ->   0\r
+ddmin512 min  0.10E-383       0  ->   0\r
+ddmin513 min  0.100E-383      0  ->   0\r
+ddmin514 min  0.01E-383       0  ->   0\r
+ddmin515 min  0.999E-383      0  ->   0\r
+ddmin516 min  0.099E-383      0  ->   0\r
+ddmin517 min  0.009E-383      0  ->   0\r
+ddmin518 min  0.001E-383      0  ->   0\r
+ddmin519 min  0.0009E-383     0  ->   0\r
+ddmin520 min  0.0001E-383     0  ->   0\r
+\r
+ddmin530 min -1.00E-383       0  ->  -1.00E-383\r
+ddmin531 min -0.1E-383        0  ->  -1E-384    Subnormal\r
+ddmin532 min -0.10E-383       0  ->  -1.0E-384  Subnormal\r
+ddmin533 min -0.100E-383      0  ->  -1.00E-384 Subnormal\r
+ddmin534 min -0.01E-383       0  ->  -1E-385    Subnormal\r
+ddmin535 min -0.999E-383      0  ->  -9.99E-384 Subnormal\r
+ddmin536 min -0.099E-383      0  ->  -9.9E-385  Subnormal\r
+ddmin537 min -0.009E-383      0  ->  -9E-386    Subnormal\r
+ddmin538 min -0.001E-383      0  ->  -1E-386    Subnormal\r
+ddmin539 min -0.0009E-383     0  ->  -9E-387    Subnormal\r
+ddmin540 min -0.0001E-383     0  ->  -1E-387    Subnormal\r
+\r
+\r
+-- Null tests\r
+ddmin900 min 10  # -> NaN Invalid_operation\r
+ddmin901 min  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddMinMag.decTest b/Lib/test/decimaltestdata/ddMinMag.decTest
new file mode 100644 (file)
index 0000000..cc5ccec
--- /dev/null
@@ -0,0 +1,293 @@
+------------------------------------------------------------------------\r
+-- ddMinMag.decTest -- decDouble minnummag                            --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddmng001 minmag  -2  -2  -> -2\r
+ddmng002 minmag  -2  -1  -> -1\r
+ddmng003 minmag  -2   0  ->  0\r
+ddmng004 minmag  -2   1  ->  1\r
+ddmng005 minmag  -2   2  -> -2\r
+ddmng006 minmag  -1  -2  -> -1\r
+ddmng007 minmag  -1  -1  -> -1\r
+ddmng008 minmag  -1   0  ->  0\r
+ddmng009 minmag  -1   1  -> -1\r
+ddmng010 minmag  -1   2  -> -1\r
+ddmng011 minmag   0  -2  ->  0\r
+ddmng012 minmag   0  -1  ->  0\r
+ddmng013 minmag   0   0  ->  0\r
+ddmng014 minmag   0   1  ->  0\r
+ddmng015 minmag   0   2  ->  0\r
+ddmng016 minmag   1  -2  ->  1\r
+ddmng017 minmag   1  -1  -> -1\r
+ddmng018 minmag   1   0  ->  0\r
+ddmng019 minmag   1   1  ->  1\r
+ddmng020 minmag   1   2  ->  1\r
+ddmng021 minmag   2  -2  -> -2\r
+ddmng022 minmag   2  -1  -> -1\r
+ddmng023 minmag   2   0  ->  0\r
+ddmng025 minmag   2   1  ->  1\r
+ddmng026 minmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+ddmng030 minmag   0     0   ->  0\r
+ddmng031 minmag   0    -0   -> -0\r
+ddmng032 minmag   0    -0.0 -> -0.0\r
+ddmng033 minmag   0     0.0 ->  0.0\r
+ddmng034 minmag  -0     0   -> -0\r
+ddmng035 minmag  -0    -0   -> -0\r
+ddmng036 minmag  -0    -0.0 -> -0\r
+ddmng037 minmag  -0     0.0 -> -0\r
+ddmng038 minmag   0.0   0   ->  0.0\r
+ddmng039 minmag   0.0  -0   -> -0\r
+ddmng040 minmag   0.0  -0.0 -> -0.0\r
+ddmng041 minmag   0.0   0.0 ->  0.0\r
+ddmng042 minmag  -0.0   0   -> -0.0\r
+ddmng043 minmag  -0.0  -0   -> -0\r
+ddmng044 minmag  -0.0  -0.0 -> -0.0\r
+ddmng045 minmag  -0.0   0.0 -> -0.0\r
+\r
+ddmng046 minmag   0E1  -0E1 -> -0E+1\r
+ddmng047 minmag  -0E1   0E2 -> -0E+1\r
+ddmng048 minmag   0E2   0E1 ->  0E+1\r
+ddmng049 minmag   0E1   0E2 ->  0E+1\r
+ddmng050 minmag  -0E3  -0E2 -> -0E+3\r
+ddmng051 minmag  -0E2  -0E3 -> -0E+3\r
+\r
+-- Specials\r
+ddmng090 minmag  Inf  -Inf   -> -Infinity\r
+ddmng091 minmag  Inf  -1000  -> -1000\r
+ddmng092 minmag  Inf  -1     -> -1\r
+ddmng093 minmag  Inf  -0     -> -0\r
+ddmng094 minmag  Inf   0     ->  0\r
+ddmng095 minmag  Inf   1     ->  1\r
+ddmng096 minmag  Inf   1000  ->  1000\r
+ddmng097 minmag  Inf   Inf   ->  Infinity\r
+ddmng098 minmag -1000  Inf   -> -1000\r
+ddmng099 minmag -Inf   Inf   -> -Infinity\r
+ddmng100 minmag -1     Inf   -> -1\r
+ddmng101 minmag -0     Inf   -> -0\r
+ddmng102 minmag  0     Inf   ->  0\r
+ddmng103 minmag  1     Inf   ->  1\r
+ddmng104 minmag  1000  Inf   ->  1000\r
+ddmng105 minmag  Inf   Inf   ->  Infinity\r
+\r
+ddmng120 minmag -Inf  -Inf   -> -Infinity\r
+ddmng121 minmag -Inf  -1000  -> -1000\r
+ddmng122 minmag -Inf  -1     -> -1\r
+ddmng123 minmag -Inf  -0     -> -0\r
+ddmng124 minmag -Inf   0     ->  0\r
+ddmng125 minmag -Inf   1     ->  1\r
+ddmng126 minmag -Inf   1000  ->  1000\r
+ddmng127 minmag -Inf   Inf   -> -Infinity\r
+ddmng128 minmag -Inf  -Inf   -> -Infinity\r
+ddmng129 minmag -1000 -Inf   -> -1000\r
+ddmng130 minmag -1    -Inf   -> -1\r
+ddmng131 minmag -0    -Inf   -> -0\r
+ddmng132 minmag  0    -Inf   ->  0\r
+ddmng133 minmag  1    -Inf   ->  1\r
+ddmng134 minmag  1000 -Inf   ->  1000\r
+ddmng135 minmag  Inf  -Inf   -> -Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+ddmng141 minmag  NaN -Inf    ->  -Infinity\r
+ddmng142 minmag  NaN -1000   ->  -1000\r
+ddmng143 minmag  NaN -1      ->  -1\r
+ddmng144 minmag  NaN -0      ->  -0\r
+ddmng145 minmag  NaN  0      ->  0\r
+ddmng146 minmag  NaN  1      ->  1\r
+ddmng147 minmag  NaN  1000   ->  1000\r
+ddmng148 minmag  NaN  Inf    ->  Infinity\r
+ddmng149 minmag  NaN  NaN    ->  NaN\r
+ddmng150 minmag -Inf  NaN    -> -Infinity\r
+ddmng151 minmag -1000 NaN    -> -1000\r
+ddmng152 minmag -1   -NaN    -> -1\r
+ddmng153 minmag -0    NaN    -> -0\r
+ddmng154 minmag  0   -NaN    ->  0\r
+ddmng155 minmag  1    NaN    ->  1\r
+ddmng156 minmag  1000 NaN    ->  1000\r
+ddmng157 minmag  Inf  NaN    ->  Infinity\r
+\r
+ddmng161 minmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddmng162 minmag  sNaN -1000  ->  NaN  Invalid_operation\r
+ddmng163 minmag  sNaN -1     ->  NaN  Invalid_operation\r
+ddmng164 minmag  sNaN -0     ->  NaN  Invalid_operation\r
+ddmng165 minmag -sNaN  0     -> -NaN  Invalid_operation\r
+ddmng166 minmag -sNaN  1     -> -NaN  Invalid_operation\r
+ddmng167 minmag  sNaN  1000  ->  NaN  Invalid_operation\r
+ddmng168 minmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddmng169 minmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddmng170 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddmng171 minmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmng172 minmag -1000 sNaN   ->  NaN  Invalid_operation\r
+ddmng173 minmag -1    sNaN   ->  NaN  Invalid_operation\r
+ddmng174 minmag -0    sNaN   ->  NaN  Invalid_operation\r
+ddmng175 minmag  0    sNaN   ->  NaN  Invalid_operation\r
+ddmng176 minmag  1    sNaN   ->  NaN  Invalid_operation\r
+ddmng177 minmag  1000 sNaN   ->  NaN  Invalid_operation\r
+ddmng178 minmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmng179 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddmng181 minmag  NaN9   -Inf   -> -Infinity\r
+ddmng182 minmag -NaN8    9990  ->  9990\r
+ddmng183 minmag  NaN71   Inf   ->  Infinity\r
+\r
+ddmng184 minmag  NaN1    NaN54 ->  NaN1\r
+ddmng185 minmag  NaN22  -NaN53 ->  NaN22\r
+ddmng186 minmag -NaN3    NaN6  -> -NaN3\r
+ddmng187 minmag -NaN44   NaN7  -> -NaN44\r
+\r
+ddmng188 minmag -Inf     NaN41 -> -Infinity\r
+ddmng189 minmag -9999   -NaN33 -> -9999\r
+ddmng190 minmag  Inf     NaN2  ->  Infinity\r
+\r
+ddmng191 minmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddmng192 minmag  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddmng193 minmag -sNaN97  NaN8   -> -NaN97 Invalid_operation\r
+ddmng194 minmag  sNaN69 sNaN94  ->  NaN69 Invalid_operation\r
+ddmng195 minmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddmng196 minmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddmng197 minmag  088    sNaN91  ->  NaN91 Invalid_operation\r
+ddmng198 minmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+ddmng199 minmag  NaN    sNaN86  ->  NaN86 Invalid_operation\r
+\r
+-- old rounding checks\r
+ddmng221 minmag -12345678000 1  -> 1\r
+ddmng222 minmag 1 -12345678000  -> 1\r
+ddmng223 minmag -1234567800  1  -> 1\r
+ddmng224 minmag 1 -1234567800   -> 1\r
+ddmng225 minmag -1234567890  1  -> 1\r
+ddmng226 minmag 1 -1234567890   -> 1\r
+ddmng227 minmag -1234567891  1  -> 1\r
+ddmng228 minmag 1 -1234567891   -> 1\r
+ddmng229 minmag -12345678901 1  -> 1\r
+ddmng230 minmag 1 -12345678901  -> 1\r
+ddmng231 minmag -1234567896  1  -> 1\r
+ddmng232 minmag 1 -1234567896   -> 1\r
+ddmng233 minmag 1234567891  1   -> 1\r
+ddmng234 minmag 1 1234567891    -> 1\r
+ddmng235 minmag 12345678901 1   -> 1\r
+ddmng236 minmag 1 12345678901   -> 1\r
+ddmng237 minmag 1234567896  1   -> 1\r
+ddmng238 minmag 1 1234567896    -> 1\r
+\r
+-- from examples\r
+ddmng280 minmag '3'   '2'  ->  '2'\r
+ddmng281 minmag '-10' '3'  ->  '3'\r
+ddmng282 minmag '1.0' '1'  ->  '1.0'\r
+ddmng283 minmag '1' '1.0'  ->  '1.0'\r
+ddmng284 minmag '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+ddmng401 minmag  Inf    1.1     ->  1.1\r
+ddmng402 minmag  1.1    1       ->  1\r
+ddmng403 minmag  1      1.0     ->  1.0\r
+ddmng404 minmag  1.0    0.1     ->  0.1\r
+ddmng405 minmag  0.1    0.10    ->  0.10\r
+ddmng406 minmag  0.10   0.100   ->  0.100\r
+ddmng407 minmag  0.10   0       ->  0\r
+ddmng408 minmag  0      0.0     ->  0.0\r
+ddmng409 minmag  0.0   -0       -> -0\r
+ddmng410 minmag  0.0   -0.0     -> -0.0\r
+ddmng411 minmag  0.00  -0.0     -> -0.0\r
+ddmng412 minmag  0.0   -0.00    -> -0.00\r
+ddmng413 minmag  0     -0.0     -> -0.0\r
+ddmng414 minmag  0     -0       -> -0\r
+ddmng415 minmag -0.0   -0       -> -0\r
+ddmng416 minmag -0     -0.100   -> -0\r
+ddmng417 minmag -0.100 -0.10    -> -0.10\r
+ddmng418 minmag -0.10  -0.1     -> -0.1\r
+ddmng419 minmag -0.1   -1.0     -> -0.1\r
+ddmng420 minmag -1.0   -1       -> -1\r
+ddmng421 minmag -1     -1.1     -> -1\r
+ddmng423 minmag -1.1   -Inf     -> -1.1\r
+-- same with operands reversed\r
+ddmng431 minmag  1.1    Inf     ->  1.1\r
+ddmng432 minmag  1      1.1     ->  1\r
+ddmng433 minmag  1.0    1       ->  1.0\r
+ddmng434 minmag  0.1    1.0     ->  0.1\r
+ddmng435 minmag  0.10   0.1     ->  0.10\r
+ddmng436 minmag  0.100  0.10    ->  0.100\r
+ddmng437 minmag  0      0.10    ->  0\r
+ddmng438 minmag  0.0    0       ->  0.0\r
+ddmng439 minmag -0      0.0     -> -0\r
+ddmng440 minmag -0.0    0.0     -> -0.0\r
+ddmng441 minmag -0.0    0.00    -> -0.0\r
+ddmng442 minmag -0.00   0.0     -> -0.00\r
+ddmng443 minmag -0.0    0       -> -0.0\r
+ddmng444 minmag -0      0       -> -0\r
+ddmng445 minmag -0     -0.0     -> -0\r
+ddmng446 minmag -0.100 -0       -> -0\r
+ddmng447 minmag -0.10  -0.100   -> -0.10\r
+ddmng448 minmag -0.1   -0.10    -> -0.1\r
+ddmng449 minmag -1.0   -0.1     -> -0.1\r
+ddmng450 minmag -1     -1.0     -> -1\r
+ddmng451 minmag -1.1   -1       -> -1\r
+ddmng453 minmag -Inf   -1.1     -> -1.1\r
+-- largies\r
+ddmng460 minmag  1000   1E+3    ->  1000\r
+ddmng461 minmag  1E+3   1000    ->  1000\r
+ddmng462 minmag  1000  -1E+3    -> -1E+3\r
+ddmng463 minmag  1E+3   -384    -> -384\r
+ddmng464 minmag -384    1E+3    -> -384\r
+ddmng465 minmag -1E+3   1000    -> -1E+3\r
+ddmng466 minmag -384   -1E+3    -> -384\r
+ddmng467 minmag -1E+3   -384    -> -384\r
+\r
+-- subnormals\r
+ddmng510 minmag  1.00E-383       0  ->   0\r
+ddmng511 minmag  0.1E-383        0  ->   0\r
+ddmng512 minmag  0.10E-383       0  ->   0\r
+ddmng513 minmag  0.100E-383      0  ->   0\r
+ddmng514 minmag  0.01E-383       0  ->   0\r
+ddmng515 minmag  0.999E-383      0  ->   0\r
+ddmng516 minmag  0.099E-383      0  ->   0\r
+ddmng517 minmag  0.009E-383      0  ->   0\r
+ddmng518 minmag  0.001E-383      0  ->   0\r
+ddmng519 minmag  0.0009E-383     0  ->   0\r
+ddmng520 minmag  0.0001E-383     0  ->   0\r
+\r
+ddmng530 minmag -1.00E-383       0  ->   0\r
+ddmng531 minmag -0.1E-383        0  ->   0\r
+ddmng532 minmag -0.10E-383       0  ->   0\r
+ddmng533 minmag -0.100E-383      0  ->   0\r
+ddmng534 minmag -0.01E-383       0  ->   0\r
+ddmng535 minmag -0.999E-383      0  ->   0\r
+ddmng536 minmag -0.099E-383      0  ->   0\r
+ddmng537 minmag -0.009E-383      0  ->   0\r
+ddmng538 minmag -0.001E-383      0  ->   0\r
+ddmng539 minmag -0.0009E-383     0  ->   0\r
+ddmng540 minmag -0.0001E-383     0  ->   0\r
+\r
+\r
+-- Null tests\r
+ddmng900 minmag 10  # -> NaN Invalid_operation\r
+ddmng901 minmag  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddMinus.decTest b/Lib/test/decimaltestdata/ddMinus.decTest
new file mode 100644 (file)
index 0000000..9fe196b
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- ddMinus.decTest -- decDouble 0-x                                   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddmns001 minus       +7.50  -> -7.50\r
+\r
+-- Infinities\r
+ddmns011 minus  Infinity    -> -Infinity\r
+ddmns012 minus  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddmns021 minus         NaN  -> NaN\r
+ddmns022 minus        -NaN  -> -NaN\r
+ddmns023 minus        sNaN  -> NaN  Invalid_operation\r
+ddmns024 minus       -sNaN  -> -NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+ddmns031 minus       NaN13  -> NaN13\r
+ddmns032 minus      -NaN13  -> -NaN13\r
+ddmns033 minus      sNaN13  -> NaN13   Invalid_operation\r
+ddmns034 minus     -sNaN13  -> -NaN13  Invalid_operation\r
+ddmns035 minus       NaN70  -> NaN70\r
+ddmns036 minus      -NaN70  -> -NaN70\r
+ddmns037 minus      sNaN101 -> NaN101  Invalid_operation\r
+ddmns038 minus     -sNaN101 -> -NaN101 Invalid_operation\r
+\r
+-- finites\r
+ddmns101 minus          7   -> -7\r
+ddmns102 minus         -7   -> 7\r
+ddmns103 minus         75   -> -75\r
+ddmns104 minus        -75   -> 75\r
+ddmns105 minus       7.50   -> -7.50\r
+ddmns106 minus      -7.50   -> 7.50\r
+ddmns107 minus       7.500  -> -7.500\r
+ddmns108 minus      -7.500  -> 7.500\r
+\r
+-- zeros\r
+ddmns111 minus          0   -> 0\r
+ddmns112 minus         -0   -> 0\r
+ddmns113 minus       0E+4   -> 0E+4\r
+ddmns114 minus      -0E+4   -> 0E+4\r
+ddmns115 minus     0.0000   -> 0.0000\r
+ddmns116 minus    -0.0000   -> 0.0000\r
+ddmns117 minus      0E-141  -> 0E-141\r
+ddmns118 minus     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddmns121 minus  2682682682682682         -> -2682682682682682\r
+ddmns122 minus  -2682682682682682        -> 2682682682682682\r
+ddmns123 minus  1341341341341341         -> -1341341341341341\r
+ddmns124 minus  -1341341341341341        -> 1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddmns131 minus  9.999999999999999E+384   -> -9.999999999999999E+384\r
+ddmns132 minus  1E-383                   -> -1E-383\r
+ddmns133 minus  1.000000000000000E-383   -> -1.000000000000000E-383\r
+ddmns134 minus  1E-398                   -> -1E-398 Subnormal\r
+\r
+ddmns135 minus  -1E-398                  -> 1E-398 Subnormal\r
+ddmns136 minus  -1.000000000000000E-383  -> 1.000000000000000E-383\r
+ddmns137 minus  -1E-383                  -> 1E-383\r
+ddmns138 minus  -9.999999999999999E+384  -> 9.999999999999999E+384\r
diff --git a/Lib/test/decimaltestdata/ddMultiply.decTest b/Lib/test/decimaltestdata/ddMultiply.decTest
new file mode 100644 (file)
index 0000000..01e0ffe
--- /dev/null
@@ -0,0 +1,463 @@
+------------------------------------------------------------------------\r
+-- ddMultiply.decTest -- decDouble multiplication                     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decDoubles only; all arguments are\r
+-- representable in a decDouble\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddmul000 multiply 2      2 -> 4\r
+ddmul001 multiply 2      3 -> 6\r
+ddmul002 multiply 5      1 -> 5\r
+ddmul003 multiply 5      2 -> 10\r
+ddmul004 multiply 1.20   2 -> 2.40\r
+ddmul005 multiply 1.20   0 -> 0.00\r
+ddmul006 multiply 1.20  -2 -> -2.40\r
+ddmul007 multiply -1.20  2 -> -2.40\r
+ddmul008 multiply -1.20  0 -> -0.00\r
+ddmul009 multiply -1.20 -2 -> 2.40\r
+ddmul010 multiply 5.09 7.1 -> 36.139\r
+ddmul011 multiply 2.5    4 -> 10.0\r
+ddmul012 multiply 2.50   4 -> 10.00\r
+ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded\r
+ddmul015 multiply 2.50   4 -> 10.00\r
+ddmul016 multiply  9.999999999  9.999999999 ->  99.99999998000000 Inexact Rounded\r
+ddmul017 multiply  9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded\r
+ddmul018 multiply -9.999999999  9.999999999 -> -99.99999998000000 Inexact Rounded\r
+ddmul019 multiply -9.999999999 -9.999999999 ->  99.99999998000000 Inexact Rounded\r
+\r
+-- zeros, etc.\r
+ddmul021 multiply  0      0     ->  0\r
+ddmul022 multiply  0     -0     -> -0\r
+ddmul023 multiply -0      0     -> -0\r
+ddmul024 multiply -0     -0     ->  0\r
+ddmul025 multiply -0.0   -0.0   ->  0.00\r
+ddmul026 multiply -0.0   -0.0   ->  0.00\r
+ddmul027 multiply -0.0   -0.0   ->  0.00\r
+ddmul028 multiply -0.0   -0.0   ->  0.00\r
+ddmul030 multiply  5.00   1E-3  ->  0.00500\r
+ddmul031 multiply  00.00  0.000 ->  0.00000\r
+ddmul032 multiply  00.00  0E-3  ->  0.00000     -- rhs is 0\r
+ddmul033 multiply  0E-3   00.00 ->  0.00000     -- lhs is 0\r
+ddmul034 multiply -5.00   1E-3  -> -0.00500\r
+ddmul035 multiply -00.00  0.000 -> -0.00000\r
+ddmul036 multiply -00.00  0E-3  -> -0.00000     -- rhs is 0\r
+ddmul037 multiply -0E-3   00.00 -> -0.00000     -- lhs is 0\r
+ddmul038 multiply  5.00  -1E-3  -> -0.00500\r
+ddmul039 multiply  00.00 -0.000 -> -0.00000\r
+ddmul040 multiply  00.00 -0E-3  -> -0.00000     -- rhs is 0\r
+ddmul041 multiply  0E-3  -00.00 -> -0.00000     -- lhs is 0\r
+ddmul042 multiply -5.00  -1E-3  ->  0.00500\r
+ddmul043 multiply -00.00 -0.000 ->  0.00000\r
+ddmul044 multiply -00.00 -0E-3  ->  0.00000     -- rhs is 0\r
+ddmul045 multiply -0E-3  -00.00 ->  0.00000     -- lhs is 0\r
+\r
+-- examples from decarith\r
+ddmul050 multiply 1.20 3        -> 3.60\r
+ddmul051 multiply 7    3        -> 21\r
+ddmul052 multiply 0.9  0.8      -> 0.72\r
+ddmul053 multiply 0.9  -0       -> -0.0\r
+ddmul054 multiply 654321 654321 -> 428135971041\r
+\r
+ddmul060 multiply 123.45 1e7  ->  1.2345E+9\r
+ddmul061 multiply 123.45 1e8  ->  1.2345E+10\r
+ddmul062 multiply 123.45 1e+9 ->  1.2345E+11\r
+ddmul063 multiply 123.45 1e10 ->  1.2345E+12\r
+ddmul064 multiply 123.45 1e11 ->  1.2345E+13\r
+ddmul065 multiply 123.45 1e12 ->  1.2345E+14\r
+ddmul066 multiply 123.45 1e13 ->  1.2345E+15\r
+\r
+\r
+-- test some intermediate lengths\r
+--                    1234567890123456\r
+ddmul080 multiply 0.1 1230123456456789     -> 123012345645678.9\r
+ddmul084 multiply 0.1 1230123456456789     -> 123012345645678.9\r
+ddmul090 multiply 1230123456456789     0.1 -> 123012345645678.9\r
+ddmul094 multiply 1230123456456789     0.1 -> 123012345645678.9\r
+\r
+-- test some more edge cases and carries\r
+ddmul101 multiply 9 9   -> 81\r
+ddmul102 multiply 9 90   -> 810\r
+ddmul103 multiply 9 900   -> 8100\r
+ddmul104 multiply 9 9000   -> 81000\r
+ddmul105 multiply 9 90000   -> 810000\r
+ddmul106 multiply 9 900000   -> 8100000\r
+ddmul107 multiply 9 9000000   -> 81000000\r
+ddmul108 multiply 9 90000000   -> 810000000\r
+ddmul109 multiply 9 900000000   -> 8100000000\r
+ddmul110 multiply 9 9000000000   -> 81000000000\r
+ddmul111 multiply 9 90000000000   -> 810000000000\r
+ddmul112 multiply 9 900000000000   -> 8100000000000\r
+ddmul113 multiply 9 9000000000000   -> 81000000000000\r
+ddmul114 multiply 9 90000000000000   -> 810000000000000\r
+ddmul115 multiply 9 900000000000000   -> 8100000000000000\r
+--ddmul116 multiply 9 9000000000000000   -> 81000000000000000\r
+--ddmul117 multiply 9 90000000000000000   -> 810000000000000000\r
+--ddmul118 multiply 9 900000000000000000   -> 8100000000000000000\r
+--ddmul119 multiply 9 9000000000000000000   -> 81000000000000000000\r
+--ddmul120 multiply 9 90000000000000000000   -> 810000000000000000000\r
+--ddmul121 multiply 9 900000000000000000000   -> 8100000000000000000000\r
+--ddmul122 multiply 9 9000000000000000000000   -> 81000000000000000000000\r
+--ddmul123 multiply 9 90000000000000000000000   -> 810000000000000000000000\r
+-- test some more edge cases without carries\r
+ddmul131 multiply 3 3   -> 9\r
+ddmul132 multiply 3 30   -> 90\r
+ddmul133 multiply 3 300   -> 900\r
+ddmul134 multiply 3 3000   -> 9000\r
+ddmul135 multiply 3 30000   -> 90000\r
+ddmul136 multiply 3 300000   -> 900000\r
+ddmul137 multiply 3 3000000   -> 9000000\r
+ddmul138 multiply 3 30000000   -> 90000000\r
+ddmul139 multiply 3 300000000   -> 900000000\r
+ddmul140 multiply 3 3000000000   -> 9000000000\r
+ddmul141 multiply 3 30000000000   -> 90000000000\r
+ddmul142 multiply 3 300000000000   -> 900000000000\r
+ddmul143 multiply 3 3000000000000   -> 9000000000000\r
+ddmul144 multiply 3 30000000000000   -> 90000000000000\r
+ddmul145 multiply 3 300000000000000   -> 900000000000000\r
+\r
+-- test some edge cases with exact rounding\r
+ddmul301 multiply 9 9   -> 81\r
+ddmul302 multiply 9 90   -> 810\r
+ddmul303 multiply 9 900   -> 8100\r
+ddmul304 multiply 9 9000   -> 81000\r
+ddmul305 multiply 9 90000   -> 810000\r
+ddmul306 multiply 9 900000   -> 8100000\r
+ddmul307 multiply 9 9000000   -> 81000000\r
+ddmul308 multiply 9 90000000   -> 810000000\r
+ddmul309 multiply 9 900000000   -> 8100000000\r
+ddmul310 multiply 9 9000000000   -> 81000000000\r
+ddmul311 multiply 9 90000000000   -> 810000000000\r
+ddmul312 multiply 9 900000000000   -> 8100000000000\r
+ddmul313 multiply 9 9000000000000   -> 81000000000000\r
+ddmul314 multiply 9 90000000000000   -> 810000000000000\r
+ddmul315 multiply 9 900000000000000   -> 8100000000000000\r
+ddmul316 multiply 9 9000000000000000   -> 8.100000000000000E+16  Rounded\r
+ddmul317 multiply 90 9000000000000000   -> 8.100000000000000E+17  Rounded\r
+ddmul318 multiply 900 9000000000000000   -> 8.100000000000000E+18  Rounded\r
+ddmul319 multiply 9000 9000000000000000   -> 8.100000000000000E+19  Rounded\r
+ddmul320 multiply 90000 9000000000000000   -> 8.100000000000000E+20  Rounded\r
+ddmul321 multiply 900000 9000000000000000   -> 8.100000000000000E+21  Rounded\r
+ddmul322 multiply 9000000 9000000000000000   -> 8.100000000000000E+22  Rounded\r
+ddmul323 multiply 90000000 9000000000000000   -> 8.100000000000000E+23  Rounded\r
+\r
+-- tryzeros cases\r
+ddmul504  multiply  0E-260 1000E-260  -> 0E-398 Clamped\r
+ddmul505  multiply  100E+260 0E+260   -> 0E+369 Clamped\r
+\r
+-- mixed with zeros\r
+ddmul541 multiply  0    -1     -> -0\r
+ddmul542 multiply -0    -1     ->  0\r
+ddmul543 multiply  0     1     ->  0\r
+ddmul544 multiply -0     1     -> -0\r
+ddmul545 multiply -1     0     -> -0\r
+ddmul546 multiply -1    -0     ->  0\r
+ddmul547 multiply  1     0     ->  0\r
+ddmul548 multiply  1    -0     -> -0\r
+\r
+ddmul551 multiply  0.0  -1     -> -0.0\r
+ddmul552 multiply -0.0  -1     ->  0.0\r
+ddmul553 multiply  0.0   1     ->  0.0\r
+ddmul554 multiply -0.0   1     -> -0.0\r
+ddmul555 multiply -1.0   0     -> -0.0\r
+ddmul556 multiply -1.0  -0     ->  0.0\r
+ddmul557 multiply  1.0   0     ->  0.0\r
+ddmul558 multiply  1.0  -0     -> -0.0\r
+\r
+ddmul561 multiply  0    -1.0   -> -0.0\r
+ddmul562 multiply -0    -1.0   ->  0.0\r
+ddmul563 multiply  0     1.0   ->  0.0\r
+ddmul564 multiply -0     1.0   -> -0.0\r
+ddmul565 multiply -1     0.0   -> -0.0\r
+ddmul566 multiply -1    -0.0   ->  0.0\r
+ddmul567 multiply  1     0.0   ->  0.0\r
+ddmul568 multiply  1    -0.0   -> -0.0\r
+\r
+ddmul571 multiply  0.0  -1.0   -> -0.00\r
+ddmul572 multiply -0.0  -1.0   ->  0.00\r
+ddmul573 multiply  0.0   1.0   ->  0.00\r
+ddmul574 multiply -0.0   1.0   -> -0.00\r
+ddmul575 multiply -1.0   0.0   -> -0.00\r
+ddmul576 multiply -1.0  -0.0   ->  0.00\r
+ddmul577 multiply  1.0   0.0   ->  0.00\r
+ddmul578 multiply  1.0  -0.0   -> -0.00\r
+\r
+\r
+-- Specials\r
+ddmul580 multiply  Inf  -Inf   -> -Infinity\r
+ddmul581 multiply  Inf  -1000  -> -Infinity\r
+ddmul582 multiply  Inf  -1     -> -Infinity\r
+ddmul583 multiply  Inf  -0     ->  NaN  Invalid_operation\r
+ddmul584 multiply  Inf   0     ->  NaN  Invalid_operation\r
+ddmul585 multiply  Inf   1     ->  Infinity\r
+ddmul586 multiply  Inf   1000  ->  Infinity\r
+ddmul587 multiply  Inf   Inf   ->  Infinity\r
+ddmul588 multiply -1000  Inf   -> -Infinity\r
+ddmul589 multiply -Inf   Inf   -> -Infinity\r
+ddmul590 multiply -1     Inf   -> -Infinity\r
+ddmul591 multiply -0     Inf   ->  NaN  Invalid_operation\r
+ddmul592 multiply  0     Inf   ->  NaN  Invalid_operation\r
+ddmul593 multiply  1     Inf   ->  Infinity\r
+ddmul594 multiply  1000  Inf   ->  Infinity\r
+ddmul595 multiply  Inf   Inf   ->  Infinity\r
+\r
+ddmul600 multiply -Inf  -Inf   ->  Infinity\r
+ddmul601 multiply -Inf  -1000  ->  Infinity\r
+ddmul602 multiply -Inf  -1     ->  Infinity\r
+ddmul603 multiply -Inf  -0     ->  NaN  Invalid_operation\r
+ddmul604 multiply -Inf   0     ->  NaN  Invalid_operation\r
+ddmul605 multiply -Inf   1     -> -Infinity\r
+ddmul606 multiply -Inf   1000  -> -Infinity\r
+ddmul607 multiply -Inf   Inf   -> -Infinity\r
+ddmul608 multiply -1000  Inf   -> -Infinity\r
+ddmul609 multiply -Inf  -Inf   ->  Infinity\r
+ddmul610 multiply -1    -Inf   ->  Infinity\r
+ddmul611 multiply -0    -Inf   ->  NaN  Invalid_operation\r
+ddmul612 multiply  0    -Inf   ->  NaN  Invalid_operation\r
+ddmul613 multiply  1    -Inf   -> -Infinity\r
+ddmul614 multiply  1000 -Inf   -> -Infinity\r
+ddmul615 multiply  Inf  -Inf   -> -Infinity\r
+\r
+ddmul621 multiply  NaN -Inf    ->  NaN\r
+ddmul622 multiply  NaN -1000   ->  NaN\r
+ddmul623 multiply  NaN -1      ->  NaN\r
+ddmul624 multiply  NaN -0      ->  NaN\r
+ddmul625 multiply  NaN  0      ->  NaN\r
+ddmul626 multiply  NaN  1      ->  NaN\r
+ddmul627 multiply  NaN  1000   ->  NaN\r
+ddmul628 multiply  NaN  Inf    ->  NaN\r
+ddmul629 multiply  NaN  NaN    ->  NaN\r
+ddmul630 multiply -Inf  NaN    ->  NaN\r
+ddmul631 multiply -1000 NaN    ->  NaN\r
+ddmul632 multiply -1    NaN    ->  NaN\r
+ddmul633 multiply -0    NaN    ->  NaN\r
+ddmul634 multiply  0    NaN    ->  NaN\r
+ddmul635 multiply  1    NaN    ->  NaN\r
+ddmul636 multiply  1000 NaN    ->  NaN\r
+ddmul637 multiply  Inf  NaN    ->  NaN\r
+\r
+ddmul641 multiply  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddmul642 multiply  sNaN -1000  ->  NaN  Invalid_operation\r
+ddmul643 multiply  sNaN -1     ->  NaN  Invalid_operation\r
+ddmul644 multiply  sNaN -0     ->  NaN  Invalid_operation\r
+ddmul645 multiply  sNaN  0     ->  NaN  Invalid_operation\r
+ddmul646 multiply  sNaN  1     ->  NaN  Invalid_operation\r
+ddmul647 multiply  sNaN  1000  ->  NaN  Invalid_operation\r
+ddmul648 multiply  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddmul649 multiply  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddmul650 multiply  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddmul651 multiply -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmul652 multiply -1000 sNaN   ->  NaN  Invalid_operation\r
+ddmul653 multiply -1    sNaN   ->  NaN  Invalid_operation\r
+ddmul654 multiply -0    sNaN   ->  NaN  Invalid_operation\r
+ddmul655 multiply  0    sNaN   ->  NaN  Invalid_operation\r
+ddmul656 multiply  1    sNaN   ->  NaN  Invalid_operation\r
+ddmul657 multiply  1000 sNaN   ->  NaN  Invalid_operation\r
+ddmul658 multiply  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddmul659 multiply  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddmul661 multiply  NaN9 -Inf   ->  NaN9\r
+ddmul662 multiply  NaN8  999   ->  NaN8\r
+ddmul663 multiply  NaN71 Inf   ->  NaN71\r
+ddmul664 multiply  NaN6  NaN5  ->  NaN6\r
+ddmul665 multiply -Inf   NaN4  ->  NaN4\r
+ddmul666 multiply -999   NaN33 ->  NaN33\r
+ddmul667 multiply  Inf   NaN2  ->  NaN2\r
+\r
+ddmul671 multiply  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddmul672 multiply  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddmul673 multiply  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+ddmul674 multiply  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+ddmul675 multiply  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddmul676 multiply -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddmul677 multiply  088    sNaN91  ->  NaN91 Invalid_operation\r
+ddmul678 multiply  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+ddmul679 multiply  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+ddmul681 multiply -NaN9 -Inf   -> -NaN9\r
+ddmul682 multiply -NaN8  999   -> -NaN8\r
+ddmul683 multiply -NaN71 Inf   -> -NaN71\r
+ddmul684 multiply -NaN6 -NaN5  -> -NaN6\r
+ddmul685 multiply -Inf  -NaN4  -> -NaN4\r
+ddmul686 multiply -999  -NaN33 -> -NaN33\r
+ddmul687 multiply  Inf  -NaN2  -> -NaN2\r
+\r
+ddmul691 multiply -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+ddmul692 multiply -sNaN98 -11     -> -NaN98 Invalid_operation\r
+ddmul693 multiply -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation\r
+ddmul695 multiply -NaN95  -sNaN93 -> -NaN93 Invalid_operation\r
+ddmul696 multiply -Inf    -sNaN92 -> -NaN92 Invalid_operation\r
+ddmul697 multiply  088    -sNaN91 -> -NaN91 Invalid_operation\r
+ddmul698 multiply  Inf    -sNaN90 -> -NaN90 Invalid_operation\r
+ddmul699 multiply -NaN    -sNaN89 -> -NaN89 Invalid_operation\r
+\r
+ddmul701 multiply -NaN  -Inf   -> -NaN\r
+ddmul702 multiply -NaN   999   -> -NaN\r
+ddmul703 multiply -NaN   Inf   -> -NaN\r
+ddmul704 multiply -NaN  -NaN   -> -NaN\r
+ddmul705 multiply -Inf  -NaN0  -> -NaN\r
+ddmul706 multiply -999  -NaN   -> -NaN\r
+ddmul707 multiply  Inf  -NaN   -> -NaN\r
+\r
+ddmul711 multiply -sNaN   -Inf    -> -NaN Invalid_operation\r
+ddmul712 multiply -sNaN   -11     -> -NaN Invalid_operation\r
+ddmul713 multiply -sNaN00  NaN    -> -NaN Invalid_operation\r
+ddmul714 multiply -sNaN   -sNaN   -> -NaN Invalid_operation\r
+ddmul715 multiply -NaN    -sNaN   -> -NaN Invalid_operation\r
+ddmul716 multiply -Inf    -sNaN   -> -NaN Invalid_operation\r
+ddmul717 multiply  088    -sNaN   -> -NaN Invalid_operation\r
+ddmul718 multiply  Inf    -sNaN   -> -NaN Invalid_operation\r
+ddmul719 multiply -NaN    -sNaN   -> -NaN Invalid_operation\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+ddmul751 multiply  1e+277  1e+311 ->  Infinity Overflow Inexact Rounded\r
+ddmul752 multiply  1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded\r
+ddmul753 multiply -1e+277  1e+311 -> -Infinity Overflow Inexact Rounded\r
+ddmul754 multiply -1e+277 -1e+311 ->  Infinity Overflow Inexact Rounded\r
+ddmul755 multiply  1e-277  1e-311 ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul756 multiply  1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul757 multiply -1e-277  1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul758 multiply -1e-277 -1e-311 ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal\r
+ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal\r
+ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal\r
+ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal\r
+ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal\r
+ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal\r
+ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal\r
+ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381  Clamped\r
+ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382  Clamped\r
+ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383  Clamped\r
+ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384  Clamped\r
+ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded\r
+ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded\r
+ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded\r
+ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded\r
+ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded\r
+ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded\r
+\r
+ddmul801 multiply  1.0000E-394  1     -> 1.0000E-394 Subnormal\r
+ddmul802 multiply  1.000E-394   1e-1  -> 1.000E-395  Subnormal\r
+ddmul803 multiply  1.00E-394    1e-2  -> 1.00E-396   Subnormal\r
+ddmul804 multiply  1.0E-394     1e-3  -> 1.0E-397    Subnormal\r
+ddmul805 multiply  1.0E-394     1e-4  -> 1E-398     Subnormal Rounded\r
+ddmul806 multiply  1.3E-394     1e-4  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddmul807 multiply  1.5E-394     1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul808 multiply  1.7E-394     1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul809 multiply  2.3E-394     1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul810 multiply  2.5E-394     1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul811 multiply  2.7E-394     1e-4  -> 3E-398     Underflow Subnormal Inexact Rounded\r
+ddmul812 multiply  1.49E-394    1e-4  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddmul813 multiply  1.50E-394    1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul814 multiply  1.51E-394    1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul815 multiply  2.49E-394    1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul816 multiply  2.50E-394    1e-4  -> 2E-398     Underflow Subnormal Inexact Rounded\r
+ddmul817 multiply  2.51E-394    1e-4  -> 3E-398     Underflow Subnormal Inexact Rounded\r
+\r
+ddmul818 multiply  1E-394       1e-4  -> 1E-398     Subnormal\r
+ddmul819 multiply  3E-394       1e-5  -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddmul820 multiply  5E-394       1e-5  -> 0E-398     Underflow Subnormal Inexact Rounded Clamped\r
+ddmul821 multiply  7E-394       1e-5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddmul822 multiply  9E-394       1e-5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+ddmul823 multiply  9.9E-394     1e-5  -> 1E-398     Underflow Subnormal Inexact Rounded\r
+\r
+ddmul824 multiply  1E-394      -1e-4  -> -1E-398    Subnormal\r
+ddmul825 multiply  3E-394      -1e-5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+ddmul826 multiply -5E-394       1e-5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+ddmul827 multiply  7E-394      -1e-5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+ddmul828 multiply -9E-394       1e-5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+ddmul829 multiply  9.9E-394    -1e-5  -> -1E-398    Underflow Subnormal Inexact Rounded\r
+ddmul830 multiply  3.0E-394    -1e-5  -> -0E-398    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+ddmul831 multiply  1.0E-199     1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddmul832 multiply  1.0E-199     1e-199 -> 1E-398    Subnormal Rounded\r
+ddmul833 multiply  1.0E-199     1e-198 -> 1.0E-397    Subnormal\r
+ddmul834 multiply  2.0E-199     2e-198 -> 4.0E-397    Subnormal\r
+ddmul835 multiply  4.0E-199     4e-198 -> 1.60E-396   Subnormal\r
+ddmul836 multiply 10.0E-199    10e-198 -> 1.000E-395  Subnormal\r
+ddmul837 multiply 30.0E-199    30e-198 -> 9.000E-395  Subnormal\r
+ddmul838 multiply 40.0E-199    40e-188 -> 1.6000E-384 Subnormal\r
+ddmul839 multiply 40.0E-199    40e-187 -> 1.6000E-383\r
+ddmul840 multiply 40.0E-199    40e-186 -> 1.6000E-382\r
+\r
+-- Long operand overflow may be a different path\r
+ddmul870 multiply 100  9.999E+383         ->  Infinity Inexact Overflow Rounded\r
+ddmul871 multiply 100 -9.999E+383     -> -Infinity Inexact Overflow Rounded\r
+ddmul872 multiply      9.999E+383 100 ->  Infinity Inexact Overflow Rounded\r
+ddmul873 multiply     -9.999E+383 100 -> -Infinity Inexact Overflow Rounded\r
+\r
+-- check for double-rounded subnormals\r
+ddmul881 multiply  1.2347E-355 1.2347E-40  ->  1.524E-395 Inexact Rounded Subnormal Underflow\r
+ddmul882 multiply  1.234E-355 1.234E-40    ->  1.523E-395 Inexact Rounded Subnormal Underflow\r
+ddmul883 multiply  1.23E-355  1.23E-40     ->  1.513E-395 Inexact Rounded Subnormal Underflow\r
+ddmul884 multiply  1.2E-355   1.2E-40      ->  1.44E-395  Subnormal\r
+ddmul885 multiply  1.2E-355   1.2E-41      ->  1.44E-396  Subnormal\r
+ddmul886 multiply  1.2E-355   1.2E-42      ->  1.4E-397   Subnormal Inexact Rounded Underflow\r
+ddmul887 multiply  1.2E-355   1.3E-42      ->  1.6E-397   Subnormal Inexact Rounded Underflow\r
+ddmul888 multiply  1.3E-355   1.3E-42      ->  1.7E-397   Subnormal Inexact Rounded Underflow\r
+ddmul889 multiply  1.3E-355   1.3E-43      ->    2E-398   Subnormal Inexact Rounded Underflow\r
+ddmul890 multiply  1.3E-356   1.3E-43      ->    0E-398   Clamped Subnormal Inexact Rounded Underflow\r
+\r
+ddmul891 multiply  1.2345E-39   1.234E-355 ->  1.5234E-394 Inexact Rounded Subnormal Underflow\r
+ddmul892 multiply  1.23456E-39  1.234E-355 ->  1.5234E-394 Inexact Rounded Subnormal Underflow\r
+ddmul893 multiply  1.2345E-40   1.234E-355 ->  1.523E-395  Inexact Rounded Subnormal Underflow\r
+ddmul894 multiply  1.23456E-40  1.234E-355 ->  1.523E-395  Inexact Rounded Subnormal Underflow\r
+ddmul895 multiply  1.2345E-41   1.234E-355 ->  1.52E-396   Inexact Rounded Subnormal Underflow\r
+ddmul896 multiply  1.23456E-41  1.234E-355 ->  1.52E-396   Inexact Rounded Subnormal Underflow\r
+\r
+-- Now explore the case where we get a normal result with Underflow\r
+--                                                        1 234567890123456\r
+ddmul900 multiply  0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded\r
+ddmul901 multiply  0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded\r
+ddmul902 multiply  9.999999999999999E-383  0.0999999999999         -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded\r
+ddmul903 multiply  9.999999999999999E-383  0.09999999999999        -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded\r
+ddmul904 multiply  9.999999999999999E-383  0.099999999999999       -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded\r
+ddmul905 multiply  9.999999999999999E-383  0.0999999999999999      -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded\r
+-- prove operands are exact\r
+ddmul906 multiply  9.999999999999999E-383  1                       -> 9.999999999999999E-383\r
+ddmul907 multiply                       1  0.09999999999999999     -> 0.09999999999999999\r
+-- the next rounds to Nmin\r
+ddmul908 multiply  9.999999999999999E-383  0.09999999999999999     -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+\r
+-- hugest\r
+ddmul909 multiply  9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded\r
+\r
+-- Null tests\r
+ddmul990 multiply 10  # -> NaN Invalid_operation\r
+ddmul991 multiply  # 10 -> NaN Invalid_operation\r
+\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/ddNextMinus.decTest b/Lib/test/decimaltestdata/ddNextMinus.decTest
new file mode 100644 (file)
index 0000000..97c3b09
--- /dev/null
@@ -0,0 +1,126 @@
+------------------------------------------------------------------------\r
+-- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddnextm001 nextminus  0.9999999999999995 ->   0.9999999999999994\r
+ddnextm002 nextminus  0.9999999999999996 ->   0.9999999999999995\r
+ddnextm003 nextminus  0.9999999999999997 ->   0.9999999999999996\r
+ddnextm004 nextminus  0.9999999999999998 ->   0.9999999999999997\r
+ddnextm005 nextminus  0.9999999999999999 ->   0.9999999999999998\r
+ddnextm006 nextminus  1.000000000000000  ->   0.9999999999999999\r
+ddnextm007 nextminus  1.0         ->   0.9999999999999999\r
+ddnextm008 nextminus  1           ->   0.9999999999999999\r
+ddnextm009 nextminus  1.000000000000001  ->   1.000000000000000\r
+ddnextm010 nextminus  1.000000000000002  ->   1.000000000000001\r
+ddnextm011 nextminus  1.000000000000003  ->   1.000000000000002\r
+ddnextm012 nextminus  1.000000000000004  ->   1.000000000000003\r
+ddnextm013 nextminus  1.000000000000005  ->   1.000000000000004\r
+ddnextm014 nextminus  1.000000000000006  ->   1.000000000000005\r
+ddnextm015 nextminus  1.000000000000007  ->   1.000000000000006\r
+ddnextm016 nextminus  1.000000000000008  ->   1.000000000000007\r
+ddnextm017 nextminus  1.000000000000009  ->   1.000000000000008\r
+ddnextm018 nextminus  1.000000000000010  ->   1.000000000000009\r
+ddnextm019 nextminus  1.000000000000011  ->   1.000000000000010\r
+ddnextm020 nextminus  1.000000000000012  ->   1.000000000000011\r
+\r
+ddnextm021 nextminus -0.9999999999999995 ->  -0.9999999999999996\r
+ddnextm022 nextminus -0.9999999999999996 ->  -0.9999999999999997\r
+ddnextm023 nextminus -0.9999999999999997 ->  -0.9999999999999998\r
+ddnextm024 nextminus -0.9999999999999998 ->  -0.9999999999999999\r
+ddnextm025 nextminus -0.9999999999999999 ->  -1.000000000000000\r
+ddnextm026 nextminus -1.000000000000000  ->  -1.000000000000001\r
+ddnextm027 nextminus -1.0         ->  -1.000000000000001\r
+ddnextm028 nextminus -1           ->  -1.000000000000001\r
+ddnextm029 nextminus -1.000000000000001  ->  -1.000000000000002\r
+ddnextm030 nextminus -1.000000000000002  ->  -1.000000000000003\r
+ddnextm031 nextminus -1.000000000000003  ->  -1.000000000000004\r
+ddnextm032 nextminus -1.000000000000004  ->  -1.000000000000005\r
+ddnextm033 nextminus -1.000000000000005  ->  -1.000000000000006\r
+ddnextm034 nextminus -1.000000000000006  ->  -1.000000000000007\r
+ddnextm035 nextminus -1.000000000000007  ->  -1.000000000000008\r
+ddnextm036 nextminus -1.000000000000008  ->  -1.000000000000009\r
+ddnextm037 nextminus -1.000000000000009  ->  -1.000000000000010\r
+ddnextm038 nextminus -1.000000000000010  ->  -1.000000000000011\r
+ddnextm039 nextminus -1.000000000000011  ->  -1.000000000000012\r
+\r
+-- ultra-tiny inputs\r
+ddnextm062 nextminus  1E-398         ->   0E-398\r
+ddnextm065 nextminus -1E-398         ->  -2E-398\r
+\r
+-- Zeros\r
+ddnextm100 nextminus -0           -> -1E-398\r
+ddnextm101 nextminus  0           -> -1E-398\r
+ddnextm102 nextminus  0.00        -> -1E-398\r
+ddnextm103 nextminus -0.00        -> -1E-398\r
+ddnextm104 nextminus  0E-300      -> -1E-398\r
+ddnextm105 nextminus  0E+300      -> -1E-398\r
+ddnextm106 nextminus  0E+30000    -> -1E-398\r
+ddnextm107 nextminus -0E+30000    -> -1E-398\r
+\r
+-- specials\r
+ddnextm150 nextminus   Inf    ->  9.999999999999999E+384\r
+ddnextm151 nextminus  -Inf    -> -Infinity\r
+ddnextm152 nextminus   NaN    ->  NaN\r
+ddnextm153 nextminus  sNaN    ->  NaN   Invalid_operation\r
+ddnextm154 nextminus   NaN77  ->  NaN77\r
+ddnextm155 nextminus  sNaN88  ->  NaN88 Invalid_operation\r
+ddnextm156 nextminus  -NaN    -> -NaN\r
+ddnextm157 nextminus -sNaN    -> -NaN   Invalid_operation\r
+ddnextm158 nextminus  -NaN77  -> -NaN77\r
+ddnextm159 nextminus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+ddnextm170 nextminus  9.999999999999999E+384   -> 9.999999999999998E+384\r
+ddnextm171 nextminus  9.999999999999998E+384   -> 9.999999999999997E+384\r
+ddnextm172 nextminus  1E-383                   -> 9.99999999999999E-384\r
+ddnextm173 nextminus  1.000000000000000E-383   -> 9.99999999999999E-384\r
+ddnextm174 nextminus  9E-398                   -> 8E-398\r
+ddnextm175 nextminus  9.9E-397                 -> 9.8E-397\r
+ddnextm176 nextminus  9.99999999999E-387       -> 9.99999999998E-387\r
+ddnextm177 nextminus  9.99999999999999E-384    -> 9.99999999999998E-384\r
+ddnextm178 nextminus  9.99999999999998E-384    -> 9.99999999999997E-384\r
+ddnextm179 nextminus  9.99999999999997E-384    -> 9.99999999999996E-384\r
+ddnextm180 nextminus  0E-398                   -> -1E-398\r
+ddnextm181 nextminus  1E-398                   -> 0E-398\r
+ddnextm182 nextminus  2E-398                   -> 1E-398\r
+\r
+ddnextm183 nextminus  -0E-398                  -> -1E-398\r
+ddnextm184 nextminus  -1E-398                  -> -2E-398\r
+ddnextm185 nextminus  -2E-398                  -> -3E-398\r
+ddnextm186 nextminus  -10E-398                 -> -1.1E-397\r
+ddnextm187 nextminus  -100E-398                -> -1.01E-396\r
+ddnextm188 nextminus  -100000E-398             -> -1.00001E-393\r
+ddnextm189 nextminus  -1.00000000000E-383      -> -1.000000000000001E-383\r
+ddnextm190 nextminus  -1.000000000000000E-383  -> -1.000000000000001E-383\r
+ddnextm191 nextminus  -1E-383                  -> -1.000000000000001E-383\r
+ddnextm192 nextminus  -9.999999999999998E+384  -> -9.999999999999999E+384\r
+ddnextm193 nextminus  -9.999999999999999E+384  -> -Infinity\r
+\r
+-- Null tests\r
+ddnextm900 nextminus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddNextPlus.decTest b/Lib/test/decimaltestdata/ddNextPlus.decTest
new file mode 100644 (file)
index 0000000..d01f3c3
--- /dev/null
@@ -0,0 +1,124 @@
+------------------------------------------------------------------------\r
+-- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddnextp001 nextplus  0.9999999999999995 ->   0.9999999999999996\r
+ddnextp002 nextplus  0.9999999999999996 ->   0.9999999999999997\r
+ddnextp003 nextplus  0.9999999999999997 ->   0.9999999999999998\r
+ddnextp004 nextplus  0.9999999999999998 ->   0.9999999999999999\r
+ddnextp005 nextplus  0.9999999999999999 ->   1.000000000000000\r
+ddnextp006 nextplus  1.000000000000000  ->   1.000000000000001\r
+ddnextp007 nextplus  1.0         ->   1.000000000000001\r
+ddnextp008 nextplus  1           ->   1.000000000000001\r
+ddnextp009 nextplus  1.000000000000001  ->   1.000000000000002\r
+ddnextp010 nextplus  1.000000000000002  ->   1.000000000000003\r
+ddnextp011 nextplus  1.000000000000003  ->   1.000000000000004\r
+ddnextp012 nextplus  1.000000000000004  ->   1.000000000000005\r
+ddnextp013 nextplus  1.000000000000005  ->   1.000000000000006\r
+ddnextp014 nextplus  1.000000000000006  ->   1.000000000000007\r
+ddnextp015 nextplus  1.000000000000007  ->   1.000000000000008\r
+ddnextp016 nextplus  1.000000000000008  ->   1.000000000000009\r
+ddnextp017 nextplus  1.000000000000009  ->   1.000000000000010\r
+ddnextp018 nextplus  1.000000000000010  ->   1.000000000000011\r
+ddnextp019 nextplus  1.000000000000011  ->   1.000000000000012\r
+\r
+ddnextp021 nextplus -0.9999999999999995 ->  -0.9999999999999994\r
+ddnextp022 nextplus -0.9999999999999996 ->  -0.9999999999999995\r
+ddnextp023 nextplus -0.9999999999999997 ->  -0.9999999999999996\r
+ddnextp024 nextplus -0.9999999999999998 ->  -0.9999999999999997\r
+ddnextp025 nextplus -0.9999999999999999 ->  -0.9999999999999998\r
+ddnextp026 nextplus -1.000000000000000  ->  -0.9999999999999999\r
+ddnextp027 nextplus -1.0         ->  -0.9999999999999999\r
+ddnextp028 nextplus -1           ->  -0.9999999999999999\r
+ddnextp029 nextplus -1.000000000000001  ->  -1.000000000000000\r
+ddnextp030 nextplus -1.000000000000002  ->  -1.000000000000001\r
+ddnextp031 nextplus -1.000000000000003  ->  -1.000000000000002\r
+ddnextp032 nextplus -1.000000000000004  ->  -1.000000000000003\r
+ddnextp033 nextplus -1.000000000000005  ->  -1.000000000000004\r
+ddnextp034 nextplus -1.000000000000006  ->  -1.000000000000005\r
+ddnextp035 nextplus -1.000000000000007  ->  -1.000000000000006\r
+ddnextp036 nextplus -1.000000000000008  ->  -1.000000000000007\r
+ddnextp037 nextplus -1.000000000000009  ->  -1.000000000000008\r
+ddnextp038 nextplus -1.000000000000010  ->  -1.000000000000009\r
+ddnextp039 nextplus -1.000000000000011  ->  -1.000000000000010\r
+ddnextp040 nextplus -1.000000000000012  ->  -1.000000000000011\r
+\r
+-- Zeros\r
+ddnextp100 nextplus  0           ->  1E-398\r
+ddnextp101 nextplus  0.00        ->  1E-398\r
+ddnextp102 nextplus  0E-300      ->  1E-398\r
+ddnextp103 nextplus  0E+300      ->  1E-398\r
+ddnextp104 nextplus  0E+30000    ->  1E-398\r
+ddnextp105 nextplus -0           ->  1E-398\r
+ddnextp106 nextplus -0.00        ->  1E-398\r
+ddnextp107 nextplus -0E-300      ->  1E-398\r
+ddnextp108 nextplus -0E+300      ->  1E-398\r
+ddnextp109 nextplus -0E+30000    ->  1E-398\r
+\r
+-- specials\r
+ddnextp150 nextplus   Inf    ->  Infinity\r
+ddnextp151 nextplus  -Inf    -> -9.999999999999999E+384\r
+ddnextp152 nextplus   NaN    ->  NaN\r
+ddnextp153 nextplus  sNaN    ->  NaN   Invalid_operation\r
+ddnextp154 nextplus   NaN77  ->  NaN77\r
+ddnextp155 nextplus  sNaN88  ->  NaN88 Invalid_operation\r
+ddnextp156 nextplus  -NaN    -> -NaN\r
+ddnextp157 nextplus -sNaN    -> -NaN   Invalid_operation\r
+ddnextp158 nextplus  -NaN77  -> -NaN77\r
+ddnextp159 nextplus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+ddnextp170 nextplus  -9.999999999999999E+384  -> -9.999999999999998E+384\r
+ddnextp171 nextplus  -9.999999999999998E+384  -> -9.999999999999997E+384\r
+ddnextp172 nextplus  -1E-383                  -> -9.99999999999999E-384\r
+ddnextp173 nextplus  -1.000000000000000E-383  -> -9.99999999999999E-384\r
+ddnextp174 nextplus  -9E-398                  -> -8E-398\r
+ddnextp175 nextplus  -9.9E-397                -> -9.8E-397\r
+ddnextp176 nextplus  -9.99999999999E-387      -> -9.99999999998E-387\r
+ddnextp177 nextplus  -9.99999999999999E-384   -> -9.99999999999998E-384\r
+ddnextp178 nextplus  -9.99999999999998E-384   -> -9.99999999999997E-384\r
+ddnextp179 nextplus  -9.99999999999997E-384   -> -9.99999999999996E-384\r
+ddnextp180 nextplus  -0E-398                  ->  1E-398\r
+ddnextp181 nextplus  -1E-398                  -> -0E-398\r
+ddnextp182 nextplus  -2E-398                  -> -1E-398\r
+\r
+ddnextp183 nextplus   0E-398                  ->  1E-398\r
+ddnextp184 nextplus   1E-398                  ->  2E-398\r
+ddnextp185 nextplus   2E-398                  ->  3E-398\r
+ddnextp186 nextplus   10E-398                 ->  1.1E-397\r
+ddnextp187 nextplus   100E-398                ->  1.01E-396\r
+ddnextp188 nextplus   100000E-398             ->  1.00001E-393\r
+ddnextp189 nextplus   1.00000000000E-383      ->  1.000000000000001E-383\r
+ddnextp190 nextplus   1.000000000000000E-383  ->  1.000000000000001E-383\r
+ddnextp191 nextplus   1E-383                  ->  1.000000000000001E-383\r
+ddnextp192 nextplus   9.999999999999998E+384  ->  9.999999999999999E+384\r
+ddnextp193 nextplus   9.999999999999999E+384  ->  Infinity\r
+\r
+-- Null tests\r
+ddnextp900 nextplus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddNextToward.decTest b/Lib/test/decimaltestdata/ddNextToward.decTest
new file mode 100644 (file)
index 0000000..e00751b
--- /dev/null
@@ -0,0 +1,374 @@
+------------------------------------------------------------------------\r
+-- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check with a scattering of numerics\r
+ddnextt001 nexttoward   10    10   ->  10\r
+ddnextt002 nexttoward  -10   -10   -> -10\r
+ddnextt003 nexttoward   1     10   ->  1.000000000000001\r
+ddnextt004 nexttoward   1    -10   ->  0.9999999999999999\r
+ddnextt005 nexttoward  -1     10   -> -0.9999999999999999\r
+ddnextt006 nexttoward  -1    -10   -> -1.000000000000001\r
+ddnextt007 nexttoward   0     10   ->  1E-398       Underflow Subnormal Inexact Rounded\r
+ddnextt008 nexttoward   0    -10   -> -1E-398       Underflow Subnormal Inexact Rounded\r
+ddnextt009 nexttoward   9.999999999999999E+384 +Infinity ->  Infinity Overflow Inexact Rounded\r
+ddnextt010 nexttoward  -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded\r
+ddnextt011 nexttoward       9.999999999999999  10  ->  10.00000000000000\r
+ddnextt012 nexttoward   10  9.999999999999999      ->  9.999999999999999\r
+ddnextt013 nexttoward      -9.999999999999999 -10  -> -10.00000000000000\r
+ddnextt014 nexttoward  -10 -9.999999999999999      -> -9.999999999999999\r
+ddnextt015 nexttoward       9.999999999999998  10  ->  9.999999999999999\r
+ddnextt016 nexttoward   10  9.999999999999998      ->  9.999999999999999\r
+ddnextt017 nexttoward      -9.999999999999998 -10  -> -9.999999999999999\r
+ddnextt018 nexttoward  -10 -9.999999999999998      -> -9.999999999999999\r
+\r
+------- lhs=rhs\r
+-- finites\r
+ddnextt101 nexttoward          7       7 ->  7\r
+ddnextt102 nexttoward         -7      -7 -> -7\r
+ddnextt103 nexttoward         75      75 ->  75\r
+ddnextt104 nexttoward        -75     -75 -> -75\r
+ddnextt105 nexttoward       7.50     7.5 ->  7.50\r
+ddnextt106 nexttoward      -7.50   -7.50 -> -7.50\r
+ddnextt107 nexttoward       7.500 7.5000 ->  7.500\r
+ddnextt108 nexttoward      -7.500   -7.5 -> -7.500\r
+\r
+-- zeros\r
+ddnextt111 nexttoward          0       0 ->  0\r
+ddnextt112 nexttoward         -0      -0 -> -0\r
+ddnextt113 nexttoward       0E+4       0 ->  0E+4\r
+ddnextt114 nexttoward      -0E+4      -0 -> -0E+4\r
+ddnextt115 nexttoward     0.00000000000   0.000000000000 ->  0E-11\r
+ddnextt116 nexttoward    -0.00000000000  -0.00           -> -0E-11\r
+ddnextt117 nexttoward      0E-141      0 ->  0E-141\r
+ddnextt118 nexttoward     -0E-141   -000 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddnextt121 nexttoward   268268268    268268268 ->   268268268\r
+ddnextt122 nexttoward  -268268268   -268268268 ->  -268268268\r
+ddnextt123 nexttoward   134134134    134134134 ->   134134134\r
+ddnextt124 nexttoward  -134134134   -134134134 ->  -134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddnextt131 nexttoward  9.999999999999999E+384  9.999999999999999E+384   ->   9.999999999999999E+384\r
+ddnextt132 nexttoward  1E-383           1E-383            ->   1E-383\r
+ddnextt133 nexttoward  1.000000000000000E-383  1.000000000000000E-383   ->   1.000000000000000E-383\r
+ddnextt134 nexttoward  1E-398           1E-398            ->   1E-398\r
+\r
+ddnextt135 nexttoward  -1E-398          -1E-398           ->  -1E-398\r
+ddnextt136 nexttoward  -1.000000000000000E-383 -1.000000000000000E-383  ->  -1.000000000000000E-383\r
+ddnextt137 nexttoward  -1E-383          -1E-383           ->  -1E-383\r
+ddnextt138 nexttoward  -9.999999999999999E+384 -9.999999999999999E+384  ->  -9.999999999999999E+384\r
+\r
+------- lhs<rhs\r
+ddnextt201 nexttoward  0.9999999999999995 Infinity ->   0.9999999999999996\r
+ddnextt202 nexttoward  0.9999999999999996 Infinity ->   0.9999999999999997\r
+ddnextt203 nexttoward  0.9999999999999997 Infinity ->   0.9999999999999998\r
+ddnextt204 nexttoward  0.9999999999999998 Infinity ->   0.9999999999999999\r
+ddnextt205 nexttoward  0.9999999999999999 Infinity ->   1.000000000000000\r
+ddnextt206 nexttoward  1.000000000000000  Infinity ->   1.000000000000001\r
+ddnextt207 nexttoward  1.0         Infinity ->   1.000000000000001\r
+ddnextt208 nexttoward  1           Infinity ->   1.000000000000001\r
+ddnextt209 nexttoward  1.000000000000001  Infinity ->   1.000000000000002\r
+ddnextt210 nexttoward  1.000000000000002  Infinity ->   1.000000000000003\r
+ddnextt211 nexttoward  1.000000000000003  Infinity ->   1.000000000000004\r
+ddnextt212 nexttoward  1.000000000000004  Infinity ->   1.000000000000005\r
+ddnextt213 nexttoward  1.000000000000005  Infinity ->   1.000000000000006\r
+ddnextt214 nexttoward  1.000000000000006  Infinity ->   1.000000000000007\r
+ddnextt215 nexttoward  1.000000000000007  Infinity ->   1.000000000000008\r
+ddnextt216 nexttoward  1.000000000000008  Infinity ->   1.000000000000009\r
+ddnextt217 nexttoward  1.000000000000009  Infinity ->   1.000000000000010\r
+ddnextt218 nexttoward  1.000000000000010  Infinity ->   1.000000000000011\r
+ddnextt219 nexttoward  1.000000000000011  Infinity ->   1.000000000000012\r
+\r
+ddnextt221 nexttoward -0.9999999999999995 Infinity ->  -0.9999999999999994\r
+ddnextt222 nexttoward -0.9999999999999996 Infinity ->  -0.9999999999999995\r
+ddnextt223 nexttoward -0.9999999999999997 Infinity ->  -0.9999999999999996\r
+ddnextt224 nexttoward -0.9999999999999998 Infinity ->  -0.9999999999999997\r
+ddnextt225 nexttoward -0.9999999999999999 Infinity ->  -0.9999999999999998\r
+ddnextt226 nexttoward -1.000000000000000  Infinity ->  -0.9999999999999999\r
+ddnextt227 nexttoward -1.0         Infinity ->  -0.9999999999999999\r
+ddnextt228 nexttoward -1           Infinity ->  -0.9999999999999999\r
+ddnextt229 nexttoward -1.000000000000001  Infinity ->  -1.000000000000000\r
+ddnextt230 nexttoward -1.000000000000002  Infinity ->  -1.000000000000001\r
+ddnextt231 nexttoward -1.000000000000003  Infinity ->  -1.000000000000002\r
+ddnextt232 nexttoward -1.000000000000004  Infinity ->  -1.000000000000003\r
+ddnextt233 nexttoward -1.000000000000005  Infinity ->  -1.000000000000004\r
+ddnextt234 nexttoward -1.000000000000006  Infinity ->  -1.000000000000005\r
+ddnextt235 nexttoward -1.000000000000007  Infinity ->  -1.000000000000006\r
+ddnextt236 nexttoward -1.000000000000008  Infinity ->  -1.000000000000007\r
+ddnextt237 nexttoward -1.000000000000009  Infinity ->  -1.000000000000008\r
+ddnextt238 nexttoward -1.000000000000010  Infinity ->  -1.000000000000009\r
+ddnextt239 nexttoward -1.000000000000011  Infinity ->  -1.000000000000010\r
+ddnextt240 nexttoward -1.000000000000012  Infinity ->  -1.000000000000011\r
+\r
+-- Zeros\r
+ddnextt300 nexttoward  0           Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt301 nexttoward  0.00        Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt302 nexttoward  0E-300      Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt303 nexttoward  0E+300      Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt304 nexttoward  0E+30000    Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt305 nexttoward -0           Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt306 nexttoward -0.00        Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt307 nexttoward -0E-300      Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt308 nexttoward -0E+300      Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+ddnextt309 nexttoward -0E+30000    Infinity ->  1E-398              Underflow Subnormal Inexact Rounded\r
+\r
+-- specials\r
+ddnextt350 nexttoward   Inf    Infinity ->  Infinity\r
+ddnextt351 nexttoward  -Inf    Infinity -> -9.999999999999999E+384\r
+ddnextt352 nexttoward   NaN    Infinity ->  NaN\r
+ddnextt353 nexttoward  sNaN    Infinity ->  NaN   Invalid_operation\r
+ddnextt354 nexttoward   NaN77  Infinity ->  NaN77\r
+ddnextt355 nexttoward  sNaN88  Infinity ->  NaN88 Invalid_operation\r
+ddnextt356 nexttoward  -NaN    Infinity -> -NaN\r
+ddnextt357 nexttoward -sNaN    Infinity -> -NaN   Invalid_operation\r
+ddnextt358 nexttoward  -NaN77  Infinity -> -NaN77\r
+ddnextt359 nexttoward -sNaN88  Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+ddnextt370 nexttoward  -9.999999999999999E+384  Infinity  -> -9.999999999999998E+384\r
+ddnextt371 nexttoward  -9.999999999999998E+384  Infinity  -> -9.999999999999997E+384\r
+ddnextt372 nexttoward  -1E-383                  Infinity  -> -9.99999999999999E-384  Underflow Subnormal Inexact Rounded\r
+ddnextt373 nexttoward  -1.000000000000000E-383  Infinity  -> -9.99999999999999E-384  Underflow Subnormal Inexact Rounded\r
+ddnextt374 nexttoward  -9E-398                  Infinity  -> -8E-398                 Underflow Subnormal Inexact Rounded\r
+ddnextt375 nexttoward  -9.9E-397                Infinity  -> -9.8E-397               Underflow Subnormal Inexact Rounded\r
+ddnextt376 nexttoward  -9.99999999999E-387      Infinity  -> -9.99999999998E-387     Underflow Subnormal Inexact Rounded\r
+ddnextt377 nexttoward  -9.99999999999999E-384   Infinity  -> -9.99999999999998E-384  Underflow Subnormal Inexact Rounded\r
+ddnextt378 nexttoward  -9.99999999999998E-384   Infinity  -> -9.99999999999997E-384  Underflow Subnormal Inexact Rounded\r
+ddnextt379 nexttoward  -9.99999999999997E-384   Infinity  -> -9.99999999999996E-384  Underflow Subnormal Inexact Rounded\r
+ddnextt380 nexttoward  -0E-398                  Infinity  ->  1E-398                 Underflow Subnormal Inexact Rounded\r
+ddnextt381 nexttoward  -1E-398                  Infinity  -> -0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddnextt382 nexttoward  -2E-398                  Infinity  -> -1E-398                 Underflow Subnormal Inexact Rounded\r
+\r
+ddnextt383 nexttoward   0E-398                  Infinity  ->  1E-398                 Underflow Subnormal Inexact Rounded\r
+ddnextt384 nexttoward   1E-398                  Infinity  ->  2E-398                 Underflow Subnormal Inexact Rounded\r
+ddnextt385 nexttoward   2E-398                  Infinity  ->  3E-398                 Underflow Subnormal Inexact Rounded\r
+ddnextt386 nexttoward   10E-398                 Infinity  ->  1.1E-397               Underflow Subnormal Inexact Rounded\r
+ddnextt387 nexttoward   100E-398                Infinity  ->  1.01E-396              Underflow Subnormal Inexact Rounded\r
+ddnextt388 nexttoward   100000E-398             Infinity  ->  1.00001E-393           Underflow Subnormal Inexact Rounded\r
+ddnextt389 nexttoward   1.00000000000E-383      Infinity  ->  1.000000000000001E-383\r
+ddnextt390 nexttoward   1.000000000000000E-383  Infinity  ->  1.000000000000001E-383\r
+ddnextt391 nexttoward   1E-383                  Infinity  ->  1.000000000000001E-383\r
+ddnextt392 nexttoward   9.999999999999997E+384  Infinity  ->  9.999999999999998E+384\r
+ddnextt393 nexttoward   9.999999999999998E+384  Infinity  ->  9.999999999999999E+384\r
+ddnextt394 nexttoward   9.999999999999999E+384  Infinity  ->  Infinity               Overflow Inexact Rounded\r
+\r
+------- lhs>rhs\r
+ddnextt401 nexttoward  0.9999999999999995  -Infinity ->   0.9999999999999994\r
+ddnextt402 nexttoward  0.9999999999999996  -Infinity ->   0.9999999999999995\r
+ddnextt403 nexttoward  0.9999999999999997  -Infinity ->   0.9999999999999996\r
+ddnextt404 nexttoward  0.9999999999999998  -Infinity ->   0.9999999999999997\r
+ddnextt405 nexttoward  0.9999999999999999  -Infinity ->   0.9999999999999998\r
+ddnextt406 nexttoward  1.000000000000000   -Infinity ->   0.9999999999999999\r
+ddnextt407 nexttoward  1.0          -Infinity ->   0.9999999999999999\r
+ddnextt408 nexttoward  1            -Infinity ->   0.9999999999999999\r
+ddnextt409 nexttoward  1.000000000000001   -Infinity ->   1.000000000000000\r
+ddnextt410 nexttoward  1.000000000000002   -Infinity ->   1.000000000000001\r
+ddnextt411 nexttoward  1.000000000000003   -Infinity ->   1.000000000000002\r
+ddnextt412 nexttoward  1.000000000000004   -Infinity ->   1.000000000000003\r
+ddnextt413 nexttoward  1.000000000000005   -Infinity ->   1.000000000000004\r
+ddnextt414 nexttoward  1.000000000000006   -Infinity ->   1.000000000000005\r
+ddnextt415 nexttoward  1.000000000000007   -Infinity ->   1.000000000000006\r
+ddnextt416 nexttoward  1.000000000000008   -Infinity ->   1.000000000000007\r
+ddnextt417 nexttoward  1.000000000000009   -Infinity ->   1.000000000000008\r
+ddnextt418 nexttoward  1.000000000000010   -Infinity ->   1.000000000000009\r
+ddnextt419 nexttoward  1.000000000000011   -Infinity ->   1.000000000000010\r
+ddnextt420 nexttoward  1.000000000000012   -Infinity ->   1.000000000000011\r
+\r
+ddnextt421 nexttoward -0.9999999999999995  -Infinity ->  -0.9999999999999996\r
+ddnextt422 nexttoward -0.9999999999999996  -Infinity ->  -0.9999999999999997\r
+ddnextt423 nexttoward -0.9999999999999997  -Infinity ->  -0.9999999999999998\r
+ddnextt424 nexttoward -0.9999999999999998  -Infinity ->  -0.9999999999999999\r
+ddnextt425 nexttoward -0.9999999999999999  -Infinity ->  -1.000000000000000\r
+ddnextt426 nexttoward -1.000000000000000   -Infinity ->  -1.000000000000001\r
+ddnextt427 nexttoward -1.0          -Infinity ->  -1.000000000000001\r
+ddnextt428 nexttoward -1            -Infinity ->  -1.000000000000001\r
+ddnextt429 nexttoward -1.000000000000001   -Infinity ->  -1.000000000000002\r
+ddnextt430 nexttoward -1.000000000000002   -Infinity ->  -1.000000000000003\r
+ddnextt431 nexttoward -1.000000000000003   -Infinity ->  -1.000000000000004\r
+ddnextt432 nexttoward -1.000000000000004   -Infinity ->  -1.000000000000005\r
+ddnextt433 nexttoward -1.000000000000005   -Infinity ->  -1.000000000000006\r
+ddnextt434 nexttoward -1.000000000000006   -Infinity ->  -1.000000000000007\r
+ddnextt435 nexttoward -1.000000000000007   -Infinity ->  -1.000000000000008\r
+ddnextt436 nexttoward -1.000000000000008   -Infinity ->  -1.000000000000009\r
+ddnextt437 nexttoward -1.000000000000009   -Infinity ->  -1.000000000000010\r
+ddnextt438 nexttoward -1.000000000000010   -Infinity ->  -1.000000000000011\r
+ddnextt439 nexttoward -1.000000000000011   -Infinity ->  -1.000000000000012\r
+\r
+-- Zeros\r
+ddnextt500 nexttoward -0            -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt501 nexttoward  0            -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt502 nexttoward  0.00         -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt503 nexttoward -0.00         -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt504 nexttoward  0E-300       -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt505 nexttoward  0E+300       -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt506 nexttoward  0E+30000     -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+ddnextt507 nexttoward -0E+30000     -Infinity -> -1E-398         Underflow Subnormal Inexact Rounded\r
+\r
+-- specials\r
+ddnextt550 nexttoward   Inf     -Infinity ->  9.999999999999999E+384\r
+ddnextt551 nexttoward  -Inf     -Infinity -> -Infinity\r
+ddnextt552 nexttoward   NaN     -Infinity ->  NaN\r
+ddnextt553 nexttoward  sNaN     -Infinity ->  NaN   Invalid_operation\r
+ddnextt554 nexttoward   NaN77   -Infinity ->  NaN77\r
+ddnextt555 nexttoward  sNaN88   -Infinity ->  NaN88 Invalid_operation\r
+ddnextt556 nexttoward  -NaN     -Infinity -> -NaN\r
+ddnextt557 nexttoward -sNaN     -Infinity -> -NaN   Invalid_operation\r
+ddnextt558 nexttoward  -NaN77   -Infinity -> -NaN77\r
+ddnextt559 nexttoward -sNaN88   -Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+ddnextt670 nexttoward  9.999999999999999E+384   -Infinity  -> 9.999999999999998E+384\r
+ddnextt671 nexttoward  9.999999999999998E+384   -Infinity  -> 9.999999999999997E+384\r
+ddnextt672 nexttoward  1E-383                   -Infinity  -> 9.99999999999999E-384   Underflow Subnormal  Inexact Rounded\r
+ddnextt673 nexttoward  1.000000000000000E-383   -Infinity  -> 9.99999999999999E-384   Underflow Subnormal  Inexact Rounded\r
+ddnextt674 nexttoward  9E-398                   -Infinity  -> 8E-398                  Underflow Subnormal  Inexact Rounded\r
+ddnextt675 nexttoward  9.9E-397                 -Infinity  -> 9.8E-397                Underflow Subnormal  Inexact Rounded\r
+ddnextt676 nexttoward  9.99999999999E-387       -Infinity  -> 9.99999999998E-387      Underflow Subnormal  Inexact Rounded\r
+ddnextt677 nexttoward  9.99999999999999E-384    -Infinity  -> 9.99999999999998E-384   Underflow Subnormal  Inexact Rounded\r
+ddnextt678 nexttoward  9.99999999999998E-384    -Infinity  -> 9.99999999999997E-384   Underflow Subnormal  Inexact Rounded\r
+ddnextt679 nexttoward  9.99999999999997E-384    -Infinity  -> 9.99999999999996E-384   Underflow Subnormal  Inexact Rounded\r
+ddnextt680 nexttoward  0E-398                   -Infinity  -> -1E-398                 Underflow Subnormal  Inexact Rounded\r
+ddnextt681 nexttoward  1E-398                   -Infinity  -> 0E-398                  Underflow Subnormal  Inexact Rounded Clamped\r
+ddnextt682 nexttoward  2E-398                   -Infinity  -> 1E-398                  Underflow Subnormal  Inexact Rounded\r
+\r
+ddnextt683 nexttoward  -0E-398                  -Infinity  -> -1E-398                 Underflow Subnormal  Inexact Rounded\r
+ddnextt684 nexttoward  -1E-398                  -Infinity  -> -2E-398                 Underflow Subnormal  Inexact Rounded\r
+ddnextt685 nexttoward  -2E-398                  -Infinity  -> -3E-398                 Underflow Subnormal  Inexact Rounded\r
+ddnextt686 nexttoward  -10E-398                 -Infinity  -> -1.1E-397               Underflow Subnormal  Inexact Rounded\r
+ddnextt687 nexttoward  -100E-398                -Infinity  -> -1.01E-396              Underflow Subnormal  Inexact Rounded\r
+ddnextt688 nexttoward  -100000E-398             -Infinity  -> -1.00001E-393           Underflow Subnormal  Inexact Rounded\r
+ddnextt689 nexttoward  -1.00000000000E-383      -Infinity  -> -1.000000000000001E-383\r
+ddnextt690 nexttoward  -1.000000000000000E-383  -Infinity  -> -1.000000000000001E-383\r
+ddnextt691 nexttoward  -1E-383                  -Infinity  -> -1.000000000000001E-383\r
+ddnextt692 nexttoward  -9.999999999999998E+384  -Infinity  -> -9.999999999999999E+384\r
+ddnextt693 nexttoward  -9.999999999999999E+384  -Infinity  -> -Infinity               Overflow Inexact Rounded\r
+\r
+------- Specials\r
+ddnextt780 nexttoward -Inf  -Inf   -> -Infinity\r
+ddnextt781 nexttoward -Inf  -1000  -> -9.999999999999999E+384\r
+ddnextt782 nexttoward -Inf  -1     -> -9.999999999999999E+384\r
+ddnextt783 nexttoward -Inf  -0     -> -9.999999999999999E+384\r
+ddnextt784 nexttoward -Inf   0     -> -9.999999999999999E+384\r
+ddnextt785 nexttoward -Inf   1     -> -9.999999999999999E+384\r
+ddnextt786 nexttoward -Inf   1000  -> -9.999999999999999E+384\r
+ddnextt787 nexttoward -1000 -Inf   -> -1000.000000000001\r
+ddnextt788 nexttoward -Inf  -Inf   -> -Infinity\r
+ddnextt789 nexttoward -1    -Inf   -> -1.000000000000001\r
+ddnextt790 nexttoward -0    -Inf   -> -1E-398           Underflow Subnormal Inexact Rounded\r
+ddnextt791 nexttoward  0    -Inf   -> -1E-398           Underflow Subnormal Inexact Rounded\r
+ddnextt792 nexttoward  1    -Inf   ->  0.9999999999999999\r
+ddnextt793 nexttoward  1000 -Inf   ->  999.9999999999999\r
+ddnextt794 nexttoward  Inf  -Inf   ->  9.999999999999999E+384\r
+\r
+ddnextt800 nexttoward  Inf  -Inf   ->  9.999999999999999E+384\r
+ddnextt801 nexttoward  Inf  -1000  ->  9.999999999999999E+384\r
+ddnextt802 nexttoward  Inf  -1     ->  9.999999999999999E+384\r
+ddnextt803 nexttoward  Inf  -0     ->  9.999999999999999E+384\r
+ddnextt804 nexttoward  Inf   0     ->  9.999999999999999E+384\r
+ddnextt805 nexttoward  Inf   1     ->  9.999999999999999E+384\r
+ddnextt806 nexttoward  Inf   1000  ->  9.999999999999999E+384\r
+ddnextt807 nexttoward  Inf   Inf   ->  Infinity\r
+ddnextt808 nexttoward -1000  Inf   -> -999.9999999999999\r
+ddnextt809 nexttoward -Inf   Inf   -> -9.999999999999999E+384\r
+ddnextt810 nexttoward -1     Inf   -> -0.9999999999999999\r
+ddnextt811 nexttoward -0     Inf   ->  1E-398           Underflow Subnormal Inexact Rounded\r
+ddnextt812 nexttoward  0     Inf   ->  1E-398           Underflow Subnormal Inexact Rounded\r
+ddnextt813 nexttoward  1     Inf   ->  1.000000000000001\r
+ddnextt814 nexttoward  1000  Inf   ->  1000.000000000001\r
+ddnextt815 nexttoward  Inf   Inf   ->  Infinity\r
+\r
+ddnextt821 nexttoward  NaN -Inf    ->  NaN\r
+ddnextt822 nexttoward  NaN -1000   ->  NaN\r
+ddnextt823 nexttoward  NaN -1      ->  NaN\r
+ddnextt824 nexttoward  NaN -0      ->  NaN\r
+ddnextt825 nexttoward  NaN  0      ->  NaN\r
+ddnextt826 nexttoward  NaN  1      ->  NaN\r
+ddnextt827 nexttoward  NaN  1000   ->  NaN\r
+ddnextt828 nexttoward  NaN  Inf    ->  NaN\r
+ddnextt829 nexttoward  NaN  NaN    ->  NaN\r
+ddnextt830 nexttoward -Inf  NaN    ->  NaN\r
+ddnextt831 nexttoward -1000 NaN    ->  NaN\r
+ddnextt832 nexttoward -1    NaN    ->  NaN\r
+ddnextt833 nexttoward -0    NaN    ->  NaN\r
+ddnextt834 nexttoward  0    NaN    ->  NaN\r
+ddnextt835 nexttoward  1    NaN    ->  NaN\r
+ddnextt836 nexttoward  1000 NaN    ->  NaN\r
+ddnextt837 nexttoward  Inf  NaN    ->  NaN\r
+\r
+ddnextt841 nexttoward  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddnextt842 nexttoward  sNaN -1000  ->  NaN  Invalid_operation\r
+ddnextt843 nexttoward  sNaN -1     ->  NaN  Invalid_operation\r
+ddnextt844 nexttoward  sNaN -0     ->  NaN  Invalid_operation\r
+ddnextt845 nexttoward  sNaN  0     ->  NaN  Invalid_operation\r
+ddnextt846 nexttoward  sNaN  1     ->  NaN  Invalid_operation\r
+ddnextt847 nexttoward  sNaN  1000  ->  NaN  Invalid_operation\r
+ddnextt848 nexttoward  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddnextt849 nexttoward  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddnextt850 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddnextt851 nexttoward -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddnextt852 nexttoward -1000 sNaN   ->  NaN  Invalid_operation\r
+ddnextt853 nexttoward -1    sNaN   ->  NaN  Invalid_operation\r
+ddnextt854 nexttoward -0    sNaN   ->  NaN  Invalid_operation\r
+ddnextt855 nexttoward  0    sNaN   ->  NaN  Invalid_operation\r
+ddnextt856 nexttoward  1    sNaN   ->  NaN  Invalid_operation\r
+ddnextt857 nexttoward  1000 sNaN   ->  NaN  Invalid_operation\r
+ddnextt858 nexttoward  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddnextt859 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddnextt861 nexttoward  NaN1   -Inf    ->  NaN1\r
+ddnextt862 nexttoward +NaN2   -1000   ->  NaN2\r
+ddnextt863 nexttoward  NaN3    1000   ->  NaN3\r
+ddnextt864 nexttoward  NaN4    Inf    ->  NaN4\r
+ddnextt865 nexttoward  NaN5   +NaN6   ->  NaN5\r
+ddnextt866 nexttoward -Inf     NaN7   ->  NaN7\r
+ddnextt867 nexttoward -1000    NaN8   ->  NaN8\r
+ddnextt868 nexttoward  1000    NaN9   ->  NaN9\r
+ddnextt869 nexttoward  Inf    +NaN10  ->  NaN10\r
+ddnextt871 nexttoward  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+ddnextt872 nexttoward  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+ddnextt873 nexttoward  sNaN13   1000  ->  NaN13  Invalid_operation\r
+ddnextt874 nexttoward  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+ddnextt875 nexttoward  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+ddnextt876 nexttoward  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+ddnextt877 nexttoward -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+ddnextt878 nexttoward -1000    sNaN21 ->  NaN21  Invalid_operation\r
+ddnextt879 nexttoward  1000    sNaN22 ->  NaN22  Invalid_operation\r
+ddnextt880 nexttoward  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+ddnextt881 nexttoward +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+ddnextt882 nexttoward -NaN26    NaN28 -> -NaN26\r
+ddnextt883 nexttoward -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+ddnextt884 nexttoward  1000    -NaN30 -> -NaN30\r
+ddnextt885 nexttoward  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Null tests\r
+ddnextt900 nexttoward 1  # -> NaN Invalid_operation\r
+ddnextt901 nexttoward #  1 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddOr.decTest b/Lib/test/decimaltestdata/ddOr.decTest
new file mode 100644 (file)
index 0000000..3a8cdd6
--- /dev/null
@@ -0,0 +1,292 @@
+------------------------------------------------------------------------\r
+-- ddOr.decTest -- digitwise logical OR for decDoubles                --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+ddor001 or             0    0 ->    0\r
+ddor002 or             0    1 ->    1\r
+ddor003 or             1    0 ->    1\r
+ddor004 or             1    1 ->    1\r
+ddor005 or          1100 1010 -> 1110\r
+-- and at msd and msd-1\r
+ddor006 or 0000000000000000 0000000000000000 ->           0\r
+ddor007 or 0000000000000000 1000000000000000 ->   1000000000000000\r
+ddor008 or 1000000000000000 0000000000000000 ->   1000000000000000\r
+ddor009 or 1000000000000000 1000000000000000 ->   1000000000000000\r
+ddor010 or 0000000000000000 0000000000000000 ->           0\r
+ddor011 or 0000000000000000 0100000000000000 ->    100000000000000\r
+ddor012 or 0100000000000000 0000000000000000 ->    100000000000000\r
+ddor013 or 0100000000000000 0100000000000000 ->    100000000000000\r
+\r
+-- Various lengths\r
+--         1234567890123456     1234567890123456 1234567890123456\r
+ddor020 or 1111111111111111     1111111111111111  ->  1111111111111111\r
+ddor021 or  111111111111111      111111111111111  ->   111111111111111\r
+ddor022 or   11111111111111       11111111111111  ->    11111111111111\r
+ddor023 or    1111111111111        1111111111111  ->     1111111111111\r
+ddor024 or     111111111111         111111111111  ->      111111111111\r
+ddor025 or      11111111111          11111111111  ->       11111111111\r
+ddor026 or       1111111111           1111111111  ->        1111111111\r
+ddor027 or        111111111            111111111  ->         111111111\r
+ddor028 or         11111111             11111111  ->          11111111\r
+ddor029 or          1111111              1111111  ->           1111111\r
+ddor030 or           111111               111111  ->            111111\r
+ddor031 or            11111                11111  ->             11111\r
+ddor032 or             1111                 1111  ->              1111\r
+ddor033 or              111                  111  ->               111\r
+ddor034 or               11                   11  ->                11\r
+ddor035 or                1                    1  ->                 1\r
+ddor036 or                0                    0  ->                 0\r
+\r
+ddor042 or  111111110000000     1111111110000000  ->  1111111110000000\r
+ddor043 or   11111110000000     1000000100000000  ->  1011111110000000\r
+ddor044 or    1111110000000     1000001000000000  ->  1001111110000000\r
+ddor045 or     111110000000     1000010000000000  ->  1000111110000000\r
+ddor046 or      11110000000     1000100000000000  ->  1000111110000000\r
+ddor047 or       1110000000     1001000000000000  ->  1001001110000000\r
+ddor048 or        110000000     1010000000000000  ->  1010000110000000\r
+ddor049 or         10000000     1100000000000000  ->  1100000010000000\r
+\r
+ddor090 or 011111111  111101111  ->  111111111\r
+ddor091 or 101111111  111101111  ->  111111111\r
+ddor092 or 110111111  111101111  ->  111111111\r
+ddor093 or 111011111  111101111  ->  111111111\r
+ddor094 or 111101111  111101111  ->  111101111\r
+ddor095 or 111110111  111101111  ->  111111111\r
+ddor096 or 111111011  111101111  ->  111111111\r
+ddor097 or 111111101  111101111  ->  111111111\r
+ddor098 or 111111110  111101111  ->  111111111\r
+\r
+ddor100 or 111101111  011111111  ->  111111111\r
+ddor101 or 111101111  101111111  ->  111111111\r
+ddor102 or 111101111  110111111  ->  111111111\r
+ddor103 or 111101111  111011111  ->  111111111\r
+ddor104 or 111101111  111101111  ->  111101111\r
+ddor105 or 111101111  111110111  ->  111111111\r
+ddor106 or 111101111  111111011  ->  111111111\r
+ddor107 or 111101111  111111101  ->  111111111\r
+ddor108 or 111101111  111111110  ->  111111111\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+ddor220 or 111111112  111111111  ->  NaN Invalid_operation\r
+ddor221 or 333333333  333333333  ->  NaN Invalid_operation\r
+ddor222 or 555555555  555555555  ->  NaN Invalid_operation\r
+ddor223 or 777777777  777777777  ->  NaN Invalid_operation\r
+ddor224 or 999999999  999999999  ->  NaN Invalid_operation\r
+ddor225 or 222222222  999999999  ->  NaN Invalid_operation\r
+ddor226 or 444444444  999999999  ->  NaN Invalid_operation\r
+ddor227 or 666666666  999999999  ->  NaN Invalid_operation\r
+ddor228 or 888888888  999999999  ->  NaN Invalid_operation\r
+ddor229 or 999999999  222222222  ->  NaN Invalid_operation\r
+ddor230 or 999999999  444444444  ->  NaN Invalid_operation\r
+ddor231 or 999999999  666666666  ->  NaN Invalid_operation\r
+ddor232 or 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+ddor240 or  567468689 -934981942 ->  NaN Invalid_operation\r
+ddor241 or  567367689  934981942 ->  NaN Invalid_operation\r
+ddor242 or -631917772 -706014634 ->  NaN Invalid_operation\r
+ddor243 or -756253257  138579234 ->  NaN Invalid_operation\r
+ddor244 or  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+ddor250 or  2000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddor251 or  7000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddor252 or  8000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddor253 or  9000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddor254 or  2000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddor255 or  7000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddor256 or  8000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddor257 or  9000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddor258 or  1000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddor259 or  1000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddor260 or  1000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddor261 or  1000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+ddor262 or  0000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddor263 or  0000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddor264 or  0000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddor265 or  0000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+ddor270 or  0200001000000000 1000100000000010 ->  NaN Invalid_operation\r
+ddor271 or  0700000100000000 1000010000000100 ->  NaN Invalid_operation\r
+ddor272 or  0800000010000000 1000001000001000 ->  NaN Invalid_operation\r
+ddor273 or  0900000001000000 1000000100010000 ->  NaN Invalid_operation\r
+ddor274 or  1000000000100000 0200000010100000 ->  NaN Invalid_operation\r
+ddor275 or  1000000000010000 0700000001000000 ->  NaN Invalid_operation\r
+ddor276 or  1000000000001000 0800000010100000 ->  NaN Invalid_operation\r
+ddor277 or  1000000000000100 0900000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+ddor280 or  0010000000000002 1000000100000001 ->  NaN Invalid_operation\r
+ddor281 or  0001000000000007 1000001000000011 ->  NaN Invalid_operation\r
+ddor282 or  0000100000000008 1000010000000001 ->  NaN Invalid_operation\r
+ddor283 or  0000010000000009 1000100000000001 ->  NaN Invalid_operation\r
+ddor284 or  1000001000000000 0001000000000002 ->  NaN Invalid_operation\r
+ddor285 or  1000000100000000 0010000000000007 ->  NaN Invalid_operation\r
+ddor286 or  1000000010000000 0100000000000008 ->  NaN Invalid_operation\r
+ddor287 or  1000000001000000 1000000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+ddor288 or  0010000020000000 1000001000000000 ->  NaN Invalid_operation\r
+ddor289 or  0001000070000001 1000000100000000 ->  NaN Invalid_operation\r
+ddor290 or  0000100080000010 1000000010000000 ->  NaN Invalid_operation\r
+ddor291 or  0000010090000100 1000000001000000 ->  NaN Invalid_operation\r
+ddor292 or  1000001000001000 0000000020100000 ->  NaN Invalid_operation\r
+ddor293 or  1000000100010000 0000000070010000 ->  NaN Invalid_operation\r
+ddor294 or  1000000010100000 0000000080001000 ->  NaN Invalid_operation\r
+ddor295 or  1000000001000000 0000000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+ddor296 or -1000000001000000 -0000010000000100 ->  NaN Invalid_operation\r
+ddor297 or -1000000001000000  0000000010000100 ->  NaN Invalid_operation\r
+ddor298 or  1000000001000000 -0000001000000100 ->  NaN Invalid_operation\r
+ddor299 or  1000000001000000  0000000011000100 ->  1000000011000100\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+ddor331 or  2   9.99999999E+199     -> NaN Invalid_operation\r
+ddor332 or  3   1E-199              -> NaN Invalid_operation\r
+ddor333 or  4   1.00000000E-199     -> NaN Invalid_operation\r
+ddor334 or  5   1E-100              -> NaN Invalid_operation\r
+ddor335 or  6   -1E-100             -> NaN Invalid_operation\r
+ddor336 or  7   -1.00000000E-199    -> NaN Invalid_operation\r
+ddor337 or  8   -1E-199             -> NaN Invalid_operation\r
+ddor338 or  9   -9.99999999E+199    -> NaN Invalid_operation\r
+ddor341 or  9.99999999E+299     -18 -> NaN Invalid_operation\r
+ddor342 or  1E-299               01 -> NaN Invalid_operation\r
+ddor343 or  1.00000000E-299     -18 -> NaN Invalid_operation\r
+ddor344 or  1E-100               18 -> NaN Invalid_operation\r
+ddor345 or  -1E-100             -10 -> NaN Invalid_operation\r
+ddor346 or  -1.00000000E-299     18 -> NaN Invalid_operation\r
+ddor347 or  -1E-299              10 -> NaN Invalid_operation\r
+ddor348 or  -9.99999999E+299    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+ddor361 or  1.0                  1  -> NaN Invalid_operation\r
+ddor362 or  1E+1                 1  -> NaN Invalid_operation\r
+ddor363 or  0.0                  1  -> NaN Invalid_operation\r
+ddor364 or  0E+1                 1  -> NaN Invalid_operation\r
+ddor365 or  9.9                  1  -> NaN Invalid_operation\r
+ddor366 or  9E+1                 1  -> NaN Invalid_operation\r
+ddor371 or  0 1.0                   -> NaN Invalid_operation\r
+ddor372 or  0 1E+1                  -> NaN Invalid_operation\r
+ddor373 or  0 0.0                   -> NaN Invalid_operation\r
+ddor374 or  0 0E+1                  -> NaN Invalid_operation\r
+ddor375 or  0 9.9                   -> NaN Invalid_operation\r
+ddor376 or  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+ddor780 or -Inf  -Inf   -> NaN Invalid_operation\r
+ddor781 or -Inf  -1000  -> NaN Invalid_operation\r
+ddor782 or -Inf  -1     -> NaN Invalid_operation\r
+ddor783 or -Inf  -0     -> NaN Invalid_operation\r
+ddor784 or -Inf   0     -> NaN Invalid_operation\r
+ddor785 or -Inf   1     -> NaN Invalid_operation\r
+ddor786 or -Inf   1000  -> NaN Invalid_operation\r
+ddor787 or -1000 -Inf   -> NaN Invalid_operation\r
+ddor788 or -Inf  -Inf   -> NaN Invalid_operation\r
+ddor789 or -1    -Inf   -> NaN Invalid_operation\r
+ddor790 or -0    -Inf   -> NaN Invalid_operation\r
+ddor791 or  0    -Inf   -> NaN Invalid_operation\r
+ddor792 or  1    -Inf   -> NaN Invalid_operation\r
+ddor793 or  1000 -Inf   -> NaN Invalid_operation\r
+ddor794 or  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+ddor800 or  Inf  -Inf   -> NaN Invalid_operation\r
+ddor801 or  Inf  -1000  -> NaN Invalid_operation\r
+ddor802 or  Inf  -1     -> NaN Invalid_operation\r
+ddor803 or  Inf  -0     -> NaN Invalid_operation\r
+ddor804 or  Inf   0     -> NaN Invalid_operation\r
+ddor805 or  Inf   1     -> NaN Invalid_operation\r
+ddor806 or  Inf   1000  -> NaN Invalid_operation\r
+ddor807 or  Inf   Inf   -> NaN Invalid_operation\r
+ddor808 or -1000  Inf   -> NaN Invalid_operation\r
+ddor809 or -Inf   Inf   -> NaN Invalid_operation\r
+ddor810 or -1     Inf   -> NaN Invalid_operation\r
+ddor811 or -0     Inf   -> NaN Invalid_operation\r
+ddor812 or  0     Inf   -> NaN Invalid_operation\r
+ddor813 or  1     Inf   -> NaN Invalid_operation\r
+ddor814 or  1000  Inf   -> NaN Invalid_operation\r
+ddor815 or  Inf   Inf   -> NaN Invalid_operation\r
+\r
+ddor821 or  NaN -Inf    -> NaN Invalid_operation\r
+ddor822 or  NaN -1000   -> NaN Invalid_operation\r
+ddor823 or  NaN -1      -> NaN Invalid_operation\r
+ddor824 or  NaN -0      -> NaN Invalid_operation\r
+ddor825 or  NaN  0      -> NaN Invalid_operation\r
+ddor826 or  NaN  1      -> NaN Invalid_operation\r
+ddor827 or  NaN  1000   -> NaN Invalid_operation\r
+ddor828 or  NaN  Inf    -> NaN Invalid_operation\r
+ddor829 or  NaN  NaN    -> NaN Invalid_operation\r
+ddor830 or -Inf  NaN    -> NaN Invalid_operation\r
+ddor831 or -1000 NaN    -> NaN Invalid_operation\r
+ddor832 or -1    NaN    -> NaN Invalid_operation\r
+ddor833 or -0    NaN    -> NaN Invalid_operation\r
+ddor834 or  0    NaN    -> NaN Invalid_operation\r
+ddor835 or  1    NaN    -> NaN Invalid_operation\r
+ddor836 or  1000 NaN    -> NaN Invalid_operation\r
+ddor837 or  Inf  NaN    -> NaN Invalid_operation\r
+\r
+ddor841 or  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddor842 or  sNaN -1000  ->  NaN  Invalid_operation\r
+ddor843 or  sNaN -1     ->  NaN  Invalid_operation\r
+ddor844 or  sNaN -0     ->  NaN  Invalid_operation\r
+ddor845 or  sNaN  0     ->  NaN  Invalid_operation\r
+ddor846 or  sNaN  1     ->  NaN  Invalid_operation\r
+ddor847 or  sNaN  1000  ->  NaN  Invalid_operation\r
+ddor848 or  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddor849 or  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddor850 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddor851 or -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddor852 or -1000 sNaN   ->  NaN  Invalid_operation\r
+ddor853 or -1    sNaN   ->  NaN  Invalid_operation\r
+ddor854 or -0    sNaN   ->  NaN  Invalid_operation\r
+ddor855 or  0    sNaN   ->  NaN  Invalid_operation\r
+ddor856 or  1    sNaN   ->  NaN  Invalid_operation\r
+ddor857 or  1000 sNaN   ->  NaN  Invalid_operation\r
+ddor858 or  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddor859 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddor861 or  NaN1   -Inf    -> NaN Invalid_operation\r
+ddor862 or +NaN2   -1000   -> NaN Invalid_operation\r
+ddor863 or  NaN3    1000   -> NaN Invalid_operation\r
+ddor864 or  NaN4    Inf    -> NaN Invalid_operation\r
+ddor865 or  NaN5   +NaN6   -> NaN Invalid_operation\r
+ddor866 or -Inf     NaN7   -> NaN Invalid_operation\r
+ddor867 or -1000    NaN8   -> NaN Invalid_operation\r
+ddor868 or  1000    NaN9   -> NaN Invalid_operation\r
+ddor869 or  Inf    +NaN10  -> NaN Invalid_operation\r
+ddor871 or  sNaN11  -Inf   -> NaN Invalid_operation\r
+ddor872 or  sNaN12  -1000  -> NaN Invalid_operation\r
+ddor873 or  sNaN13   1000  -> NaN Invalid_operation\r
+ddor874 or  sNaN14   NaN17 -> NaN Invalid_operation\r
+ddor875 or  sNaN15  sNaN18 -> NaN Invalid_operation\r
+ddor876 or  NaN16   sNaN19 -> NaN Invalid_operation\r
+ddor877 or -Inf    +sNaN20 -> NaN Invalid_operation\r
+ddor878 or -1000    sNaN21 -> NaN Invalid_operation\r
+ddor879 or  1000    sNaN22 -> NaN Invalid_operation\r
+ddor880 or  Inf     sNaN23 -> NaN Invalid_operation\r
+ddor881 or +NaN25  +sNaN24 -> NaN Invalid_operation\r
+ddor882 or -NaN26    NaN28 -> NaN Invalid_operation\r
+ddor883 or -sNaN27  sNaN29 -> NaN Invalid_operation\r
+ddor884 or  1000    -NaN30 -> NaN Invalid_operation\r
+ddor885 or  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddPlus.decTest b/Lib/test/decimaltestdata/ddPlus.decTest
new file mode 100644 (file)
index 0000000..962a656
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- ddPlus.decTest -- decDouble 0+x                                    --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddpls001 plus       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+ddpls011 plus  Infinity    -> Infinity\r
+ddpls012 plus  -Infinity   -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddpls021 plus         NaN  -> NaN\r
+ddpls022 plus        -NaN  -> -NaN\r
+ddpls023 plus        sNaN  -> NaN  Invalid_operation\r
+ddpls024 plus       -sNaN  -> -NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+ddpls031 plus       NaN13  -> NaN13\r
+ddpls032 plus      -NaN13  -> -NaN13\r
+ddpls033 plus      sNaN13  -> NaN13   Invalid_operation\r
+ddpls034 plus     -sNaN13  -> -NaN13  Invalid_operation\r
+ddpls035 plus       NaN70  -> NaN70\r
+ddpls036 plus      -NaN70  -> -NaN70\r
+ddpls037 plus      sNaN101 -> NaN101  Invalid_operation\r
+ddpls038 plus     -sNaN101 -> -NaN101 Invalid_operation\r
+\r
+-- finites\r
+ddpls101 plus          7   -> 7\r
+ddpls102 plus         -7   -> -7\r
+ddpls103 plus         75   -> 75\r
+ddpls104 plus        -75   -> -75\r
+ddpls105 plus       7.50   -> 7.50\r
+ddpls106 plus      -7.50   -> -7.50\r
+ddpls107 plus       7.500  -> 7.500\r
+ddpls108 plus      -7.500  -> -7.500\r
+\r
+-- zeros\r
+ddpls111 plus          0   -> 0\r
+ddpls112 plus         -0   -> 0\r
+ddpls113 plus       0E+4   -> 0E+4\r
+ddpls114 plus      -0E+4   -> 0E+4\r
+ddpls115 plus     0.0000   -> 0.0000\r
+ddpls116 plus    -0.0000   -> 0.0000\r
+ddpls117 plus      0E-141  -> 0E-141\r
+ddpls118 plus     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+ddpls121 plus  2682682682682682         -> 2682682682682682\r
+ddpls122 plus  -2682682682682682        -> -2682682682682682\r
+ddpls123 plus  1341341341341341         -> 1341341341341341\r
+ddpls124 plus  -1341341341341341        -> -1341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddpls131 plus  9.999999999999999E+384   -> 9.999999999999999E+384\r
+ddpls132 plus  1E-383                   -> 1E-383\r
+ddpls133 plus  1.000000000000000E-383   -> 1.000000000000000E-383\r
+ddpls134 plus  1E-398                   -> 1E-398 Subnormal\r
+\r
+ddpls135 plus  -1E-398                  -> -1E-398 Subnormal\r
+ddpls136 plus  -1.000000000000000E-383  -> -1.000000000000000E-383\r
+ddpls137 plus  -1E-383                  -> -1E-383\r
+ddpls138 plus  -9.999999999999999E+384  -> -9.999999999999999E+384\r
diff --git a/Lib/test/decimaltestdata/ddQuantize.decTest b/Lib/test/decimaltestdata/ddQuantize.decTest
new file mode 100644 (file)
index 0000000..234db92
--- /dev/null
@@ -0,0 +1,825 @@
+------------------------------------------------------------------------\r
+-- ddQuantize.decTest -- decDouble quantize operation                 --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Most of the tests here assume a "regular pattern", where the\r
+-- sign and coefficient are +1.\r
+-- 2004.03.15 Underflow for quantize is suppressed\r
+-- 2005.06.08 More extensive tests for 'does not fit'\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+ddqua001 quantize 0       1e0   -> 0\r
+ddqua002 quantize 1       1e0   -> 1\r
+ddqua003 quantize 0.1    1e+2   -> 0E+2 Inexact Rounded\r
+ddqua005 quantize 0.1    1e+1   -> 0E+1 Inexact Rounded\r
+ddqua006 quantize 0.1     1e0   -> 0 Inexact Rounded\r
+ddqua007 quantize 0.1    1e-1   -> 0.1\r
+ddqua008 quantize 0.1    1e-2   -> 0.10\r
+ddqua009 quantize 0.1    1e-3   -> 0.100\r
+ddqua010 quantize 0.9    1e+2   -> 0E+2 Inexact Rounded\r
+ddqua011 quantize 0.9    1e+1   -> 0E+1 Inexact Rounded\r
+ddqua012 quantize 0.9    1e+0   -> 1 Inexact Rounded\r
+ddqua013 quantize 0.9    1e-1   -> 0.9\r
+ddqua014 quantize 0.9    1e-2   -> 0.90\r
+ddqua015 quantize 0.9    1e-3   -> 0.900\r
+-- negatives\r
+ddqua021 quantize -0      1e0   -> -0\r
+ddqua022 quantize -1      1e0   -> -1\r
+ddqua023 quantize -0.1   1e+2   -> -0E+2 Inexact Rounded\r
+ddqua025 quantize -0.1   1e+1   -> -0E+1 Inexact Rounded\r
+ddqua026 quantize -0.1    1e0   -> -0 Inexact Rounded\r
+ddqua027 quantize -0.1   1e-1   -> -0.1\r
+ddqua028 quantize -0.1   1e-2   -> -0.10\r
+ddqua029 quantize -0.1   1e-3   -> -0.100\r
+ddqua030 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded\r
+ddqua031 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded\r
+ddqua032 quantize -0.9   1e+0   -> -1 Inexact Rounded\r
+ddqua033 quantize -0.9   1e-1   -> -0.9\r
+ddqua034 quantize -0.9   1e-2   -> -0.90\r
+ddqua035 quantize -0.9   1e-3   -> -0.900\r
+ddqua036 quantize -0.5   1e+2   -> -0E+2 Inexact Rounded\r
+ddqua037 quantize -0.5   1e+1   -> -0E+1 Inexact Rounded\r
+ddqua038 quantize -0.5   1e+0   -> -0 Inexact Rounded\r
+ddqua039 quantize -0.5   1e-1   -> -0.5\r
+ddqua040 quantize -0.5   1e-2   -> -0.50\r
+ddqua041 quantize -0.5   1e-3   -> -0.500\r
+ddqua042 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded\r
+ddqua043 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded\r
+ddqua044 quantize -0.9   1e+0   -> -1 Inexact Rounded\r
+ddqua045 quantize -0.9   1e-1   -> -0.9\r
+ddqua046 quantize -0.9   1e-2   -> -0.90\r
+ddqua047 quantize -0.9   1e-3   -> -0.900\r
+\r
+-- examples from Specification\r
+ddqua060 quantize 2.17   0.001  -> 2.170\r
+ddqua061 quantize 2.17   0.01   -> 2.17\r
+ddqua062 quantize 2.17   0.1    -> 2.2 Inexact Rounded\r
+ddqua063 quantize 2.17   1e+0   -> 2 Inexact Rounded\r
+ddqua064 quantize 2.17   1e+1   -> 0E+1 Inexact Rounded\r
+ddqua065 quantize -Inf    Inf   -> -Infinity\r
+ddqua066 quantize 2       Inf   -> NaN Invalid_operation\r
+ddqua067 quantize -0.1    1     -> -0 Inexact Rounded\r
+ddqua068 quantize -0      1e+5     -> -0E+5\r
+ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation\r
+ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation\r
+ddqua071 quantize 217    1e-1   -> 217.0\r
+ddqua072 quantize 217    1e+0   -> 217\r
+ddqua073 quantize 217    1e+1   -> 2.2E+2 Inexact Rounded\r
+ddqua074 quantize 217    1e+2   -> 2E+2 Inexact Rounded\r
+\r
+-- general tests ..\r
+ddqua089 quantize 12     1e+4   -> 0E+4 Inexact Rounded\r
+ddqua090 quantize 12     1e+3   -> 0E+3 Inexact Rounded\r
+ddqua091 quantize 12     1e+2   -> 0E+2 Inexact Rounded\r
+ddqua092 quantize 12     1e+1   -> 1E+1 Inexact Rounded\r
+ddqua093 quantize 1.2345 1e-2   -> 1.23 Inexact Rounded\r
+ddqua094 quantize 1.2355 1e-2   -> 1.24 Inexact Rounded\r
+ddqua095 quantize 1.2345 1e-6   -> 1.234500\r
+ddqua096 quantize 9.9999 1e-2   -> 10.00 Inexact Rounded\r
+ddqua097 quantize 0.0001 1e-2   -> 0.00 Inexact Rounded\r
+ddqua098 quantize 0.001  1e-2   -> 0.00 Inexact Rounded\r
+ddqua099 quantize 0.009  1e-2   -> 0.01 Inexact Rounded\r
+ddqua100 quantize 92     1e+2   -> 1E+2 Inexact Rounded\r
+\r
+ddqua101 quantize -1      1e0   ->  -1\r
+ddqua102 quantize -1     1e-1   ->  -1.0\r
+ddqua103 quantize -1     1e-2   ->  -1.00\r
+ddqua104 quantize  0      1e0   ->  0\r
+ddqua105 quantize  0     1e-1   ->  0.0\r
+ddqua106 quantize  0     1e-2   ->  0.00\r
+ddqua107 quantize  0.00   1e0   ->  0\r
+ddqua108 quantize  0     1e+1   ->  0E+1\r
+ddqua109 quantize  0     1e+2   ->  0E+2\r
+ddqua110 quantize +1      1e0   ->  1\r
+ddqua111 quantize +1     1e-1   ->  1.0\r
+ddqua112 quantize +1     1e-2   ->  1.00\r
+\r
+ddqua120 quantize   1.04  1e-3 ->  1.040\r
+ddqua121 quantize   1.04  1e-2 ->  1.04\r
+ddqua122 quantize   1.04  1e-1 ->  1.0 Inexact Rounded\r
+ddqua123 quantize   1.04   1e0 ->  1 Inexact Rounded\r
+ddqua124 quantize   1.05  1e-3 ->  1.050\r
+ddqua125 quantize   1.05  1e-2 ->  1.05\r
+ddqua126 quantize   1.05  1e-1 ->  1.0 Inexact Rounded\r
+ddqua131 quantize   1.05   1e0 ->  1 Inexact Rounded\r
+ddqua132 quantize   1.06  1e-3 ->  1.060\r
+ddqua133 quantize   1.06  1e-2 ->  1.06\r
+ddqua134 quantize   1.06  1e-1 ->  1.1 Inexact Rounded\r
+ddqua135 quantize   1.06   1e0 ->  1 Inexact Rounded\r
+\r
+ddqua140 quantize   -10    1e-2  ->  -10.00\r
+ddqua141 quantize   +1     1e-2  ->  1.00\r
+ddqua142 quantize   +10    1e-2  ->  10.00\r
+ddqua143 quantize   1E+17  1e-2  ->  NaN Invalid_operation\r
+ddqua144 quantize   1E-17  1e-2  ->  0.00 Inexact Rounded\r
+ddqua145 quantize   1E-3   1e-2  ->  0.00 Inexact Rounded\r
+ddqua146 quantize   1E-2   1e-2  ->  0.01\r
+ddqua147 quantize   1E-1   1e-2  ->  0.10\r
+ddqua148 quantize   0E-17  1e-2  ->  0.00\r
+\r
+ddqua150 quantize   1.0600 1e-5 ->  1.06000\r
+ddqua151 quantize   1.0600 1e-4 ->  1.0600\r
+ddqua152 quantize   1.0600 1e-3 ->  1.060 Rounded\r
+ddqua153 quantize   1.0600 1e-2 ->  1.06 Rounded\r
+ddqua154 quantize   1.0600 1e-1 ->  1.1 Inexact Rounded\r
+ddqua155 quantize   1.0600  1e0 ->  1 Inexact Rounded\r
+\r
+-- a couple where rounding was different in base tests\r
+rounding:    half_up\r
+ddqua157 quantize -0.5   1e+0   -> -1 Inexact Rounded\r
+ddqua158 quantize   1.05  1e-1 ->  1.1 Inexact Rounded\r
+ddqua159 quantize   1.06   1e0 ->  1 Inexact Rounded\r
+rounding:    half_even\r
+\r
+-- base tests with non-1 coefficients\r
+ddqua161 quantize 0      -9e0   -> 0\r
+ddqua162 quantize 1      -7e0   -> 1\r
+ddqua163 quantize 0.1   -1e+2   -> 0E+2 Inexact Rounded\r
+ddqua165 quantize 0.1    0e+1   -> 0E+1 Inexact Rounded\r
+ddqua166 quantize 0.1     2e0   -> 0 Inexact Rounded\r
+ddqua167 quantize 0.1    3e-1   -> 0.1\r
+ddqua168 quantize 0.1   44e-2   -> 0.10\r
+ddqua169 quantize 0.1  555e-3   -> 0.100\r
+ddqua170 quantize 0.9 6666e+2   -> 0E+2 Inexact Rounded\r
+ddqua171 quantize 0.9 -777e+1   -> 0E+1 Inexact Rounded\r
+ddqua172 quantize 0.9  -88e+0   -> 1 Inexact Rounded\r
+ddqua173 quantize 0.9   -9e-1   -> 0.9\r
+ddqua174 quantize 0.9    0e-2   -> 0.90\r
+ddqua175 quantize 0.9  1.1e-3   -> 0.9000\r
+-- negatives\r
+ddqua181 quantize -0    1.1e0   -> -0.0\r
+ddqua182 quantize -1     -1e0   -> -1\r
+ddqua183 quantize -0.1  11e+2   -> -0E+2 Inexact Rounded\r
+ddqua185 quantize -0.1 111e+1   -> -0E+1 Inexact Rounded\r
+ddqua186 quantize -0.1   71e0   -> -0 Inexact Rounded\r
+ddqua187 quantize -0.1 -91e-1   -> -0.1\r
+ddqua188 quantize -0.1 -.1e-2   -> -0.100\r
+ddqua189 quantize -0.1  -1e-3   -> -0.100\r
+ddqua190 quantize -0.9   0e+2   -> -0E+2 Inexact Rounded\r
+ddqua191 quantize -0.9  -0e+1   -> -0E+1 Inexact Rounded\r
+ddqua192 quantize -0.9 -10e+0   -> -1 Inexact Rounded\r
+ddqua193 quantize -0.9 100e-1   -> -0.9\r
+ddqua194 quantize -0.9 999e-2   -> -0.90\r
+\r
+-- +ve exponents ..\r
+ddqua201 quantize   -1   1e+0 ->  -1\r
+ddqua202 quantize   -1   1e+1 ->  -0E+1 Inexact Rounded\r
+ddqua203 quantize   -1   1e+2 ->  -0E+2 Inexact Rounded\r
+ddqua204 quantize    0   1e+0 ->  0\r
+ddqua205 quantize    0   1e+1 ->  0E+1\r
+ddqua206 quantize    0   1e+2 ->  0E+2\r
+ddqua207 quantize   +1   1e+0 ->  1\r
+ddqua208 quantize   +1   1e+1 ->  0E+1 Inexact Rounded\r
+ddqua209 quantize   +1   1e+2 ->  0E+2 Inexact Rounded\r
+\r
+ddqua220 quantize   1.04 1e+3 ->  0E+3 Inexact Rounded\r
+ddqua221 quantize   1.04 1e+2 ->  0E+2 Inexact Rounded\r
+ddqua222 quantize   1.04 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua223 quantize   1.04 1e+0 ->  1 Inexact Rounded\r
+ddqua224 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded\r
+ddqua225 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded\r
+ddqua226 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua227 quantize   1.05 1e+0 ->  1 Inexact Rounded\r
+ddqua228 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded\r
+ddqua229 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded\r
+ddqua230 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua231 quantize   1.05 1e+0 ->  1 Inexact Rounded\r
+ddqua232 quantize   1.06 1e+3 ->  0E+3 Inexact Rounded\r
+ddqua233 quantize   1.06 1e+2 ->  0E+2 Inexact Rounded\r
+ddqua234 quantize   1.06 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua235 quantize   1.06 1e+0 ->  1 Inexact Rounded\r
+\r
+ddqua240 quantize   -10   1e+1  ->  -1E+1 Rounded\r
+ddqua241 quantize   +1    1e+1  ->  0E+1 Inexact Rounded\r
+ddqua242 quantize   +10   1e+1  ->  1E+1 Rounded\r
+ddqua243 quantize   1E+1  1e+1  ->  1E+1          -- underneath this is E+1\r
+ddqua244 quantize   1E+2  1e+1  ->  1.0E+2        -- underneath this is E+1\r
+ddqua245 quantize   1E+3  1e+1  ->  1.00E+3       -- underneath this is E+1\r
+ddqua246 quantize   1E+4  1e+1  ->  1.000E+4      -- underneath this is E+1\r
+ddqua247 quantize   1E+5  1e+1  ->  1.0000E+5     -- underneath this is E+1\r
+ddqua248 quantize   1E+6  1e+1  ->  1.00000E+6    -- underneath this is E+1\r
+ddqua249 quantize   1E+7  1e+1  ->  1.000000E+7   -- underneath this is E+1\r
+ddqua250 quantize   1E+8  1e+1  ->  1.0000000E+8  -- underneath this is E+1\r
+ddqua251 quantize   1E+9  1e+1  ->  1.00000000E+9 -- underneath this is E+1\r
+-- next one tries to add 9 zeros\r
+ddqua252 quantize   1E+17 1e+1  ->  NaN Invalid_operation\r
+ddqua253 quantize   1E-17 1e+1  ->  0E+1 Inexact Rounded\r
+ddqua254 quantize   1E-2  1e+1  ->  0E+1 Inexact Rounded\r
+ddqua255 quantize   0E-17 1e+1  ->  0E+1\r
+ddqua256 quantize  -0E-17 1e+1  -> -0E+1\r
+ddqua257 quantize  -0E-1  1e+1  -> -0E+1\r
+ddqua258 quantize  -0     1e+1  -> -0E+1\r
+ddqua259 quantize  -0E+1  1e+1  -> -0E+1\r
+\r
+ddqua260 quantize   -10   1e+2  ->  -0E+2 Inexact Rounded\r
+ddqua261 quantize   +1    1e+2  ->  0E+2 Inexact Rounded\r
+ddqua262 quantize   +10   1e+2  ->  0E+2 Inexact Rounded\r
+ddqua263 quantize   1E+1  1e+2  ->  0E+2 Inexact Rounded\r
+ddqua264 quantize   1E+2  1e+2  ->  1E+2\r
+ddqua265 quantize   1E+3  1e+2  ->  1.0E+3\r
+ddqua266 quantize   1E+4  1e+2  ->  1.00E+4\r
+ddqua267 quantize   1E+5  1e+2  ->  1.000E+5\r
+ddqua268 quantize   1E+6  1e+2  ->  1.0000E+6\r
+ddqua269 quantize   1E+7  1e+2  ->  1.00000E+7\r
+ddqua270 quantize   1E+8  1e+2  ->  1.000000E+8\r
+ddqua271 quantize   1E+9  1e+2  ->  1.0000000E+9\r
+ddqua272 quantize   1E+10 1e+2  ->  1.00000000E+10\r
+ddqua273 quantize   1E-10 1e+2  ->  0E+2 Inexact Rounded\r
+ddqua274 quantize   1E-2  1e+2  ->  0E+2 Inexact Rounded\r
+ddqua275 quantize   0E-10 1e+2  ->  0E+2\r
+\r
+ddqua280 quantize   -10   1e+3  ->  -0E+3 Inexact Rounded\r
+ddqua281 quantize   +1    1e+3  ->  0E+3 Inexact Rounded\r
+ddqua282 quantize   +10   1e+3  ->  0E+3 Inexact Rounded\r
+ddqua283 quantize   1E+1  1e+3  ->  0E+3 Inexact Rounded\r
+ddqua284 quantize   1E+2  1e+3  ->  0E+3 Inexact Rounded\r
+ddqua285 quantize   1E+3  1e+3  ->  1E+3\r
+ddqua286 quantize   1E+4  1e+3  ->  1.0E+4\r
+ddqua287 quantize   1E+5  1e+3  ->  1.00E+5\r
+ddqua288 quantize   1E+6  1e+3  ->  1.000E+6\r
+ddqua289 quantize   1E+7  1e+3  ->  1.0000E+7\r
+ddqua290 quantize   1E+8  1e+3  ->  1.00000E+8\r
+ddqua291 quantize   1E+9  1e+3  ->  1.000000E+9\r
+ddqua292 quantize   1E+10 1e+3  ->  1.0000000E+10\r
+ddqua293 quantize   1E-10 1e+3  ->  0E+3 Inexact Rounded\r
+ddqua294 quantize   1E-2  1e+3  ->  0E+3 Inexact Rounded\r
+ddqua295 quantize   0E-10 1e+3  ->  0E+3\r
+\r
+-- round up from below [sign wrong in JIT compiler once]\r
+ddqua300 quantize   0.0078 1e-5 ->  0.00780\r
+ddqua301 quantize   0.0078 1e-4 ->  0.0078\r
+ddqua302 quantize   0.0078 1e-3 ->  0.008 Inexact Rounded\r
+ddqua303 quantize   0.0078 1e-2 ->  0.01 Inexact Rounded\r
+ddqua304 quantize   0.0078 1e-1 ->  0.0 Inexact Rounded\r
+ddqua305 quantize   0.0078  1e0 ->  0 Inexact Rounded\r
+ddqua306 quantize   0.0078 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua307 quantize   0.0078 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+ddqua310 quantize  -0.0078 1e-5 -> -0.00780\r
+ddqua311 quantize  -0.0078 1e-4 -> -0.0078\r
+ddqua312 quantize  -0.0078 1e-3 -> -0.008 Inexact Rounded\r
+ddqua313 quantize  -0.0078 1e-2 -> -0.01 Inexact Rounded\r
+ddqua314 quantize  -0.0078 1e-1 -> -0.0 Inexact Rounded\r
+ddqua315 quantize  -0.0078  1e0 -> -0 Inexact Rounded\r
+ddqua316 quantize  -0.0078 1e+1 -> -0E+1 Inexact Rounded\r
+ddqua317 quantize  -0.0078 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+ddqua320 quantize   0.078 1e-5 ->  0.07800\r
+ddqua321 quantize   0.078 1e-4 ->  0.0780\r
+ddqua322 quantize   0.078 1e-3 ->  0.078\r
+ddqua323 quantize   0.078 1e-2 ->  0.08 Inexact Rounded\r
+ddqua324 quantize   0.078 1e-1 ->  0.1 Inexact Rounded\r
+ddqua325 quantize   0.078  1e0 ->  0 Inexact Rounded\r
+ddqua326 quantize   0.078 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua327 quantize   0.078 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+ddqua330 quantize  -0.078 1e-5 -> -0.07800\r
+ddqua331 quantize  -0.078 1e-4 -> -0.0780\r
+ddqua332 quantize  -0.078 1e-3 -> -0.078\r
+ddqua333 quantize  -0.078 1e-2 -> -0.08 Inexact Rounded\r
+ddqua334 quantize  -0.078 1e-1 -> -0.1 Inexact Rounded\r
+ddqua335 quantize  -0.078  1e0 -> -0 Inexact Rounded\r
+ddqua336 quantize  -0.078 1e+1 -> -0E+1 Inexact Rounded\r
+ddqua337 quantize  -0.078 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+ddqua340 quantize   0.78 1e-5 ->  0.78000\r
+ddqua341 quantize   0.78 1e-4 ->  0.7800\r
+ddqua342 quantize   0.78 1e-3 ->  0.780\r
+ddqua343 quantize   0.78 1e-2 ->  0.78\r
+ddqua344 quantize   0.78 1e-1 ->  0.8 Inexact Rounded\r
+ddqua345 quantize   0.78  1e0 ->  1 Inexact Rounded\r
+ddqua346 quantize   0.78 1e+1 ->  0E+1 Inexact Rounded\r
+ddqua347 quantize   0.78 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+ddqua350 quantize  -0.78 1e-5 -> -0.78000\r
+ddqua351 quantize  -0.78 1e-4 -> -0.7800\r
+ddqua352 quantize  -0.78 1e-3 -> -0.780\r
+ddqua353 quantize  -0.78 1e-2 -> -0.78\r
+ddqua354 quantize  -0.78 1e-1 -> -0.8 Inexact Rounded\r
+ddqua355 quantize  -0.78  1e0 -> -1 Inexact Rounded\r
+ddqua356 quantize  -0.78 1e+1 -> -0E+1 Inexact Rounded\r
+ddqua357 quantize  -0.78 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+ddqua360 quantize   7.8 1e-5 ->  7.80000\r
+ddqua361 quantize   7.8 1e-4 ->  7.8000\r
+ddqua362 quantize   7.8 1e-3 ->  7.800\r
+ddqua363 quantize   7.8 1e-2 ->  7.80\r
+ddqua364 quantize   7.8 1e-1 ->  7.8\r
+ddqua365 quantize   7.8  1e0 ->  8 Inexact Rounded\r
+ddqua366 quantize   7.8 1e+1 ->  1E+1 Inexact Rounded\r
+ddqua367 quantize   7.8 1e+2 ->  0E+2 Inexact Rounded\r
+ddqua368 quantize   7.8 1e+3 ->  0E+3 Inexact Rounded\r
+\r
+ddqua370 quantize  -7.8 1e-5 -> -7.80000\r
+ddqua371 quantize  -7.8 1e-4 -> -7.8000\r
+ddqua372 quantize  -7.8 1e-3 -> -7.800\r
+ddqua373 quantize  -7.8 1e-2 -> -7.80\r
+ddqua374 quantize  -7.8 1e-1 -> -7.8\r
+ddqua375 quantize  -7.8  1e0 -> -8 Inexact Rounded\r
+ddqua376 quantize  -7.8 1e+1 -> -1E+1 Inexact Rounded\r
+ddqua377 quantize  -7.8 1e+2 -> -0E+2 Inexact Rounded\r
+ddqua378 quantize  -7.8 1e+3 -> -0E+3 Inexact Rounded\r
+\r
+-- some individuals\r
+ddqua380 quantize   1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded\r
+ddqua381 quantize   12345673523645.06 1e-2 -> 12345673523645.06\r
+ddqua382 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation\r
+ddqua383 quantize   1234567352364506  1e-2 -> NaN Invalid_operation\r
+ddqua384 quantize  -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded\r
+ddqua385 quantize  -12345673523645.06 1e-2 -> -12345673523645.06\r
+ddqua386 quantize  -123456735236450.6 1e-2 -> NaN Invalid_operation\r
+ddqua387 quantize  -1234567352364506  1e-2 -> NaN Invalid_operation\r
+\r
+rounding: down\r
+ddqua389 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation\r
+-- ? should that one instead have been:\r
+-- ddqua389 quantize   123456735236450.6 1e-2 -> NaN Invalid_operation\r
+rounding: half_up\r
+\r
+-- and a few more from e-mail discussions\r
+ddqua391 quantize  12345678912.34567  1e-3 -> 12345678912.346   Inexact Rounded\r
+ddqua392 quantize  123456789123.4567  1e-3 -> 123456789123.457  Inexact Rounded\r
+ddqua393 quantize  1234567891234.567  1e-3 -> 1234567891234.567\r
+ddqua394 quantize  12345678912345.67  1e-3 -> NaN Invalid_operation\r
+ddqua395 quantize  123456789123456.7  1e-3 -> NaN Invalid_operation\r
+ddqua396 quantize  1234567891234567.  1e-3 -> NaN Invalid_operation\r
+\r
+-- some 9999 round-up cases\r
+ddqua400 quantize   9.999        1e-5  ->  9.99900\r
+ddqua401 quantize   9.999        1e-4  ->  9.9990\r
+ddqua402 quantize   9.999        1e-3  ->  9.999\r
+ddqua403 quantize   9.999        1e-2  -> 10.00     Inexact Rounded\r
+ddqua404 quantize   9.999        1e-1  -> 10.0      Inexact Rounded\r
+ddqua405 quantize   9.999         1e0  -> 10        Inexact Rounded\r
+ddqua406 quantize   9.999         1e1  -> 1E+1      Inexact Rounded\r
+ddqua407 quantize   9.999         1e2  -> 0E+2      Inexact Rounded\r
+\r
+ddqua410 quantize   0.999        1e-5  ->  0.99900\r
+ddqua411 quantize   0.999        1e-4  ->  0.9990\r
+ddqua412 quantize   0.999        1e-3  ->  0.999\r
+ddqua413 quantize   0.999        1e-2  ->  1.00     Inexact Rounded\r
+ddqua414 quantize   0.999        1e-1  ->  1.0      Inexact Rounded\r
+ddqua415 quantize   0.999         1e0  ->  1        Inexact Rounded\r
+ddqua416 quantize   0.999         1e1  -> 0E+1      Inexact Rounded\r
+\r
+ddqua420 quantize   0.0999       1e-5  ->  0.09990\r
+ddqua421 quantize   0.0999       1e-4  ->  0.0999\r
+ddqua422 quantize   0.0999       1e-3  ->  0.100    Inexact Rounded\r
+ddqua423 quantize   0.0999       1e-2  ->  0.10     Inexact Rounded\r
+ddqua424 quantize   0.0999       1e-1  ->  0.1      Inexact Rounded\r
+ddqua425 quantize   0.0999        1e0  ->  0        Inexact Rounded\r
+ddqua426 quantize   0.0999        1e1  -> 0E+1      Inexact Rounded\r
+\r
+ddqua430 quantize   0.00999      1e-5  ->  0.00999\r
+ddqua431 quantize   0.00999      1e-4  ->  0.0100   Inexact Rounded\r
+ddqua432 quantize   0.00999      1e-3  ->  0.010    Inexact Rounded\r
+ddqua433 quantize   0.00999      1e-2  ->  0.01     Inexact Rounded\r
+ddqua434 quantize   0.00999      1e-1  ->  0.0      Inexact Rounded\r
+ddqua435 quantize   0.00999       1e0  ->  0        Inexact Rounded\r
+ddqua436 quantize   0.00999       1e1  -> 0E+1      Inexact Rounded\r
+\r
+ddqua440 quantize   0.000999     1e-5  ->  0.00100  Inexact Rounded\r
+ddqua441 quantize   0.000999     1e-4  ->  0.0010   Inexact Rounded\r
+ddqua442 quantize   0.000999     1e-3  ->  0.001    Inexact Rounded\r
+ddqua443 quantize   0.000999     1e-2  ->  0.00     Inexact Rounded\r
+ddqua444 quantize   0.000999     1e-1  ->  0.0      Inexact Rounded\r
+ddqua445 quantize   0.000999      1e0  ->  0        Inexact Rounded\r
+ddqua446 quantize   0.000999      1e1  -> 0E+1      Inexact Rounded\r
+\r
+ddqua1001 quantize  0.000        0.001 ->  0.000\r
+ddqua1002 quantize  0.001        0.001 ->  0.001\r
+ddqua1003 quantize  0.0012       0.001 ->  0.001     Inexact Rounded\r
+ddqua1004 quantize  0.0018       0.001 ->  0.002     Inexact Rounded\r
+ddqua1005 quantize  0.501        0.001 ->  0.501\r
+ddqua1006 quantize  0.5012       0.001 ->  0.501     Inexact Rounded\r
+ddqua1007 quantize  0.5018       0.001 ->  0.502     Inexact Rounded\r
+ddqua1008 quantize  0.999        0.001 ->  0.999\r
+\r
+ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded\r
+ddqua482 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded\r
+ddqua483 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded\r
+ddqua484 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded\r
+ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded\r
+ddqua486 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded\r
+-- a potential double-round\r
+ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded\r
+ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded\r
+\r
+ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded\r
+ddqua492 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded\r
+ddqua493 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded\r
+ddqua494 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded\r
+ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded\r
+ddqua496 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded\r
+ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded\r
+ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded\r
+\r
+-- Zeros\r
+ddqua500 quantize   0     1e1 ->  0E+1\r
+ddqua501 quantize   0     1e0 ->  0\r
+ddqua502 quantize   0    1e-1 ->  0.0\r
+ddqua503 quantize   0.0  1e-1 ->  0.0\r
+ddqua504 quantize   0.0   1e0 ->  0\r
+ddqua505 quantize   0.0  1e+1 ->  0E+1\r
+ddqua506 quantize   0E+1 1e-1 ->  0.0\r
+ddqua507 quantize   0E+1  1e0 ->  0\r
+ddqua508 quantize   0E+1 1e+1 ->  0E+1\r
+ddqua509 quantize  -0     1e1 -> -0E+1\r
+ddqua510 quantize  -0     1e0 -> -0\r
+ddqua511 quantize  -0    1e-1 -> -0.0\r
+ddqua512 quantize  -0.0  1e-1 -> -0.0\r
+ddqua513 quantize  -0.0   1e0 -> -0\r
+ddqua514 quantize  -0.0  1e+1 -> -0E+1\r
+ddqua515 quantize  -0E+1 1e-1 -> -0.0\r
+ddqua516 quantize  -0E+1  1e0 -> -0\r
+ddqua517 quantize  -0E+1 1e+1 -> -0E+1\r
+\r
+-- Suspicious RHS values\r
+ddqua520 quantize   1.234    1e359 -> 0E+359 Inexact Rounded\r
+ddqua521 quantize 123.456    1e359 -> 0E+359 Inexact Rounded\r
+ddqua522 quantize   1.234    1e359 -> 0E+359 Inexact Rounded\r
+ddqua523 quantize 123.456    1e359 -> 0E+359 Inexact Rounded\r
+-- next four are "won't fit" overfl\r
+ddqua526 quantize   1.234   1e-299 -> NaN Invalid_operation\r
+ddqua527 quantize 123.456   1e-299 -> NaN Invalid_operation\r
+ddqua528 quantize   1.234   1e-299 -> NaN Invalid_operation\r
+ddqua529 quantize 123.456   1e-299 -> NaN Invalid_operation\r
+\r
+ddqua532 quantize   1.234E+299    1e299 -> 1E+299    Inexact Rounded\r
+ddqua533 quantize   1.234E+298    1e299 -> 0E+299    Inexact Rounded\r
+ddqua534 quantize   1.234         1e299 -> 0E+299    Inexact Rounded\r
+ddqua537 quantize   0            1e-299 -> 0E-299\r
+-- next two are "won't fit" overflows\r
+ddqua538 quantize   1.234        1e-299 -> NaN Invalid_operation\r
+ddqua539 quantize   1.234        1e-300 -> NaN Invalid_operation\r
+-- [more below]\r
+\r
+-- Specials\r
+ddqua580 quantize  Inf    -Inf   ->  Infinity\r
+ddqua581 quantize  Inf  1e-299   ->  NaN  Invalid_operation\r
+ddqua582 quantize  Inf  1e-1     ->  NaN  Invalid_operation\r
+ddqua583 quantize  Inf   1e0     ->  NaN  Invalid_operation\r
+ddqua584 quantize  Inf   1e1     ->  NaN  Invalid_operation\r
+ddqua585 quantize  Inf   1e299   ->  NaN  Invalid_operation\r
+ddqua586 quantize  Inf     Inf   ->  Infinity\r
+ddqua587 quantize -1000    Inf   ->  NaN  Invalid_operation\r
+ddqua588 quantize -Inf     Inf   ->  -Infinity\r
+ddqua589 quantize -1       Inf   ->  NaN  Invalid_operation\r
+ddqua590 quantize  0       Inf   ->  NaN  Invalid_operation\r
+ddqua591 quantize  1       Inf   ->  NaN  Invalid_operation\r
+ddqua592 quantize  1000    Inf   ->  NaN  Invalid_operation\r
+ddqua593 quantize  Inf     Inf   ->  Infinity\r
+ddqua594 quantize  Inf  1e-0     ->  NaN  Invalid_operation\r
+ddqua595 quantize -0       Inf   ->  NaN  Invalid_operation\r
+\r
+ddqua600 quantize -Inf    -Inf   ->  -Infinity\r
+ddqua601 quantize -Inf  1e-299   ->  NaN  Invalid_operation\r
+ddqua602 quantize -Inf  1e-1     ->  NaN  Invalid_operation\r
+ddqua603 quantize -Inf   1e0     ->  NaN  Invalid_operation\r
+ddqua604 quantize -Inf   1e1     ->  NaN  Invalid_operation\r
+ddqua605 quantize -Inf   1e299   ->  NaN  Invalid_operation\r
+ddqua606 quantize -Inf     Inf   ->  -Infinity\r
+ddqua607 quantize -1000    Inf   ->  NaN  Invalid_operation\r
+ddqua608 quantize -Inf    -Inf   ->  -Infinity\r
+ddqua609 quantize -1      -Inf   ->  NaN  Invalid_operation\r
+ddqua610 quantize  0      -Inf   ->  NaN  Invalid_operation\r
+ddqua611 quantize  1      -Inf   ->  NaN  Invalid_operation\r
+ddqua612 quantize  1000   -Inf   ->  NaN  Invalid_operation\r
+ddqua613 quantize  Inf    -Inf   ->  Infinity\r
+ddqua614 quantize -Inf  1e-0     ->  NaN  Invalid_operation\r
+ddqua615 quantize -0      -Inf   ->  NaN  Invalid_operation\r
+\r
+ddqua621 quantize  NaN   -Inf    ->  NaN\r
+ddqua622 quantize  NaN 1e-299    ->  NaN\r
+ddqua623 quantize  NaN 1e-1      ->  NaN\r
+ddqua624 quantize  NaN  1e0      ->  NaN\r
+ddqua625 quantize  NaN  1e1      ->  NaN\r
+ddqua626 quantize  NaN  1e299    ->  NaN\r
+ddqua627 quantize  NaN    Inf    ->  NaN\r
+ddqua628 quantize  NaN    NaN    ->  NaN\r
+ddqua629 quantize -Inf    NaN    ->  NaN\r
+ddqua630 quantize -1000   NaN    ->  NaN\r
+ddqua631 quantize -1      NaN    ->  NaN\r
+ddqua632 quantize  0      NaN    ->  NaN\r
+ddqua633 quantize  1      NaN    ->  NaN\r
+ddqua634 quantize  1000   NaN    ->  NaN\r
+ddqua635 quantize  Inf    NaN    ->  NaN\r
+ddqua636 quantize  NaN 1e-0      ->  NaN\r
+ddqua637 quantize -0      NaN    ->  NaN\r
+\r
+ddqua641 quantize  sNaN   -Inf   ->  NaN  Invalid_operation\r
+ddqua642 quantize  sNaN 1e-299   ->  NaN  Invalid_operation\r
+ddqua643 quantize  sNaN 1e-1     ->  NaN  Invalid_operation\r
+ddqua644 quantize  sNaN  1e0     ->  NaN  Invalid_operation\r
+ddqua645 quantize  sNaN  1e1     ->  NaN  Invalid_operation\r
+ddqua646 quantize  sNaN  1e299   ->  NaN  Invalid_operation\r
+ddqua647 quantize  sNaN    NaN   ->  NaN  Invalid_operation\r
+ddqua648 quantize  sNaN   sNaN   ->  NaN  Invalid_operation\r
+ddqua649 quantize  NaN    sNaN   ->  NaN  Invalid_operation\r
+ddqua650 quantize -Inf    sNaN   ->  NaN  Invalid_operation\r
+ddqua651 quantize -1000   sNaN   ->  NaN  Invalid_operation\r
+ddqua652 quantize -1      sNaN   ->  NaN  Invalid_operation\r
+ddqua653 quantize  0      sNaN   ->  NaN  Invalid_operation\r
+ddqua654 quantize  1      sNaN   ->  NaN  Invalid_operation\r
+ddqua655 quantize  1000   sNaN   ->  NaN  Invalid_operation\r
+ddqua656 quantize  Inf    sNaN   ->  NaN  Invalid_operation\r
+ddqua657 quantize  NaN    sNaN   ->  NaN  Invalid_operation\r
+ddqua658 quantize  sNaN 1e-0     ->  NaN  Invalid_operation\r
+ddqua659 quantize -0      sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddqua661 quantize  NaN9 -Inf   ->  NaN9\r
+ddqua662 quantize  NaN8  919   ->  NaN8\r
+ddqua663 quantize  NaN71 Inf   ->  NaN71\r
+ddqua664 quantize  NaN6  NaN5  ->  NaN6\r
+ddqua665 quantize -Inf   NaN4  ->  NaN4\r
+ddqua666 quantize -919   NaN31 ->  NaN31\r
+ddqua667 quantize  Inf   NaN2  ->  NaN2\r
+\r
+ddqua671 quantize  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+ddqua672 quantize  sNaN98 -11     ->  NaN98 Invalid_operation\r
+ddqua673 quantize  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+ddqua674 quantize  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+ddqua675 quantize  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+ddqua676 quantize -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+ddqua677 quantize  088    sNaN91  ->  NaN91 Invalid_operation\r
+ddqua678 quantize  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+ddqua679 quantize  NaN    sNaN88  ->  NaN88 Invalid_operation\r
+\r
+ddqua681 quantize -NaN9 -Inf   -> -NaN9\r
+ddqua682 quantize -NaN8  919   -> -NaN8\r
+ddqua683 quantize -NaN71 Inf   -> -NaN71\r
+ddqua684 quantize -NaN6 -NaN5  -> -NaN6\r
+ddqua685 quantize -Inf  -NaN4  -> -NaN4\r
+ddqua686 quantize -919  -NaN31 -> -NaN31\r
+ddqua687 quantize  Inf  -NaN2  -> -NaN2\r
+\r
+ddqua691 quantize -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+ddqua692 quantize -sNaN98 -11     -> -NaN98 Invalid_operation\r
+ddqua693 quantize -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+ddqua694 quantize -sNaN16 sNaN94  -> -NaN16 Invalid_operation\r
+ddqua695 quantize -NaN95 -sNaN93  -> -NaN93 Invalid_operation\r
+ddqua696 quantize -Inf   -sNaN92  -> -NaN92 Invalid_operation\r
+ddqua697 quantize  088   -sNaN91  -> -NaN91 Invalid_operation\r
+ddqua698 quantize  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+ddqua699 quantize  NaN   -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- subnormals and underflow\r
+ddqua710 quantize  1.00E-383    1e-383  ->   1E-383    Rounded\r
+ddqua711 quantize  0.1E-383    2e-384  ->   1E-384   Subnormal\r
+ddqua712 quantize  0.10E-383   3e-384  ->   1E-384   Subnormal Rounded\r
+ddqua713 quantize  0.100E-383  4e-384  ->   1E-384   Subnormal Rounded\r
+ddqua714 quantize  0.01E-383   5e-385  ->   1E-385   Subnormal\r
+-- next is rounded to Emin\r
+ddqua715 quantize  0.999E-383   1e-383  ->   1E-383    Inexact Rounded\r
+ddqua716 quantize  0.099E-383 10e-384  ->   1E-384   Inexact Rounded Subnormal\r
+\r
+ddqua717 quantize  0.009E-383  1e-385  ->   1E-385   Inexact Rounded Subnormal\r
+ddqua718 quantize  0.001E-383  1e-385  ->   0E-385   Inexact Rounded\r
+ddqua719 quantize  0.0009E-383 1e-385  ->   0E-385   Inexact Rounded\r
+ddqua720 quantize  0.0001E-383 1e-385  ->   0E-385   Inexact Rounded\r
+\r
+ddqua730 quantize -1.00E-383   1e-383  ->  -1E-383     Rounded\r
+ddqua731 quantize -0.1E-383    1e-383  ->  -0E-383     Rounded Inexact\r
+ddqua732 quantize -0.10E-383   1e-383  ->  -0E-383     Rounded Inexact\r
+ddqua733 quantize -0.100E-383  1e-383  ->  -0E-383     Rounded Inexact\r
+ddqua734 quantize -0.01E-383   1e-383  ->  -0E-383     Inexact Rounded\r
+-- next is rounded to Emin\r
+ddqua735 quantize -0.999E-383 90e-383  ->  -1E-383     Inexact Rounded\r
+ddqua736 quantize -0.099E-383 -1e-383  ->  -0E-383     Inexact Rounded\r
+ddqua737 quantize -0.009E-383 -1e-383  ->  -0E-383     Inexact Rounded\r
+ddqua738 quantize -0.001E-383 -0e-383  ->  -0E-383     Inexact Rounded\r
+ddqua739 quantize -0.0001E-383 0e-383  ->  -0E-383     Inexact Rounded\r
+\r
+ddqua740 quantize -1.00E-383   1e-384 ->  -1.0E-383   Rounded\r
+ddqua741 quantize -0.1E-383    1e-384 ->  -1E-384    Subnormal\r
+ddqua742 quantize -0.10E-383   1e-384 ->  -1E-384    Subnormal Rounded\r
+ddqua743 quantize -0.100E-383  1e-384 ->  -1E-384    Subnormal Rounded\r
+ddqua744 quantize -0.01E-383   1e-384 ->  -0E-384    Inexact Rounded\r
+-- next is rounded to Emin\r
+ddqua745 quantize -0.999E-383  1e-384 ->  -1.0E-383   Inexact Rounded\r
+ddqua746 quantize -0.099E-383  1e-384 ->  -1E-384    Inexact Rounded Subnormal\r
+ddqua747 quantize -0.009E-383  1e-384 ->  -0E-384    Inexact Rounded\r
+ddqua748 quantize -0.001E-383  1e-384 ->  -0E-384    Inexact Rounded\r
+ddqua749 quantize -0.0001E-383 1e-384 ->  -0E-384    Inexact Rounded\r
+\r
+ddqua750 quantize -1.00E-383   1e-385 ->  -1.00E-383\r
+ddqua751 quantize -0.1E-383    1e-385 ->  -1.0E-384  Subnormal\r
+ddqua752 quantize -0.10E-383   1e-385 ->  -1.0E-384  Subnormal\r
+ddqua753 quantize -0.100E-383  1e-385 ->  -1.0E-384  Subnormal Rounded\r
+ddqua754 quantize -0.01E-383   1e-385 ->  -1E-385    Subnormal\r
+-- next is rounded to Emin\r
+ddqua755 quantize -0.999E-383  1e-385 ->  -1.00E-383  Inexact Rounded\r
+ddqua756 quantize -0.099E-383  1e-385 ->  -1.0E-384  Inexact Rounded Subnormal\r
+ddqua757 quantize -0.009E-383  1e-385 ->  -1E-385    Inexact Rounded Subnormal\r
+ddqua758 quantize -0.001E-383  1e-385 ->  -0E-385    Inexact Rounded\r
+ddqua759 quantize -0.0001E-383 1e-385 ->  -0E-385    Inexact Rounded\r
+\r
+ddqua760 quantize -1.00E-383   1e-386 ->  -1.000E-383\r
+ddqua761 quantize -0.1E-383    1e-386 ->  -1.00E-384  Subnormal\r
+ddqua762 quantize -0.10E-383   1e-386 ->  -1.00E-384  Subnormal\r
+ddqua763 quantize -0.100E-383  1e-386 ->  -1.00E-384  Subnormal\r
+ddqua764 quantize -0.01E-383   1e-386 ->  -1.0E-385   Subnormal\r
+ddqua765 quantize -0.999E-383  1e-386 ->  -9.99E-384  Subnormal\r
+ddqua766 quantize -0.099E-383  1e-386 ->  -9.9E-385   Subnormal\r
+ddqua767 quantize -0.009E-383  1e-386 ->  -9E-386     Subnormal\r
+ddqua768 quantize -0.001E-383  1e-386 ->  -1E-386     Subnormal\r
+ddqua769 quantize -0.0001E-383 1e-386 ->  -0E-386     Inexact Rounded\r
+\r
+-- More from Fung Lee\r
+ddqua1021 quantize  8.666666666666000E+384  1.000000000000000E+384 ->  8.666666666666000E+384\r
+ddqua1022 quantize -8.666666666666000E+384  1.000000000000000E+384 -> -8.666666666666000E+384\r
+ddqua1027 quantize 8.666666666666000E+323  1E+31    -> NaN Invalid_operation\r
+ddqua1030 quantize 8.66666666E+3           1E+3     -> 9E+3 Inexact Rounded\r
+\r
+-- Int and uInt32 edge values for testing conversions\r
+ddqua1040 quantize -2147483646     0 -> -2147483646\r
+ddqua1041 quantize -2147483647     0 -> -2147483647\r
+ddqua1042 quantize -2147483648     0 -> -2147483648\r
+ddqua1043 quantize -2147483649     0 -> -2147483649\r
+ddqua1044 quantize  2147483646     0 ->  2147483646\r
+ddqua1045 quantize  2147483647     0 ->  2147483647\r
+ddqua1046 quantize  2147483648     0 ->  2147483648\r
+ddqua1047 quantize  2147483649     0 ->  2147483649\r
+ddqua1048 quantize  4294967294     0 ->  4294967294\r
+ddqua1049 quantize  4294967295     0 ->  4294967295\r
+ddqua1050 quantize  4294967296     0 ->  4294967296\r
+ddqua1051 quantize  4294967297     0 ->  4294967297\r
+\r
+-- Rounding swathe\r
+rounding: half_even\r
+ddqua1100 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1101 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+ddqua1102 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+ddqua1103 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+ddqua1104 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+ddqua1105 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+ddqua1106 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+ddqua1107 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+ddqua1108 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+ddqua1109 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: half_up\r
+ddqua1200 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1201 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+ddqua1202 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+ddqua1203 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+ddqua1204 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+ddqua1205 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+ddqua1206 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+ddqua1207 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+ddqua1208 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+ddqua1209 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: half_down\r
+ddqua1300 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1301 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+ddqua1302 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+ddqua1303 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+ddqua1304 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+ddqua1305 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+ddqua1306 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+ddqua1307 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+ddqua1308 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+ddqua1309 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: up\r
+ddqua1400 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1401 quantize  1.2301    1.00    ->  1.24  Inexact Rounded\r
+ddqua1402 quantize  1.2310    1.00    ->  1.24  Inexact Rounded\r
+ddqua1403 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+ddqua1404 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+ddqua1405 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+ddqua1406 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+ddqua1407 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+ddqua1408 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+ddqua1409 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+ddqua1411 quantize -1.2399    1.00    -> -1.24  Inexact Rounded\r
+\r
+rounding: down\r
+ddqua1500 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1501 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+ddqua1502 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+ddqua1503 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+ddqua1504 quantize  1.2351    1.00    ->  1.23  Inexact Rounded\r
+ddqua1505 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+ddqua1506 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+ddqua1507 quantize  1.2360    1.00    ->  1.23  Inexact Rounded\r
+ddqua1508 quantize  1.2370    1.00    ->  1.23  Inexact Rounded\r
+ddqua1509 quantize  1.2399    1.00    ->  1.23  Inexact Rounded\r
+ddqua1511 quantize -1.2399    1.00    -> -1.23  Inexact Rounded\r
+\r
+rounding: ceiling\r
+ddqua1600 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1601 quantize  1.2301    1.00    ->  1.24  Inexact Rounded\r
+ddqua1602 quantize  1.2310    1.00    ->  1.24  Inexact Rounded\r
+ddqua1603 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+ddqua1604 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+ddqua1605 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+ddqua1606 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+ddqua1607 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+ddqua1608 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+ddqua1609 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+ddqua1611 quantize -1.2399    1.00    -> -1.23  Inexact Rounded\r
+\r
+rounding: floor\r
+ddqua1700 quantize  1.2300    1.00    ->  1.23  Rounded\r
+ddqua1701 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+ddqua1702 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+ddqua1703 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+ddqua1704 quantize  1.2351    1.00    ->  1.23  Inexact Rounded\r
+ddqua1705 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+ddqua1706 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+ddqua1707 quantize  1.2360    1.00    ->  1.23  Inexact Rounded\r
+ddqua1708 quantize  1.2370    1.00    ->  1.23  Inexact Rounded\r
+ddqua1709 quantize  1.2399    1.00    ->  1.23  Inexact Rounded\r
+ddqua1711 quantize -1.2399    1.00    -> -1.24  Inexact Rounded\r
+\r
+rounding: 05up\r
+ddqua1800 quantize  1.2000    1.00    ->  1.20  Rounded\r
+ddqua1801 quantize  1.2001    1.00    ->  1.21  Inexact Rounded\r
+ddqua1802 quantize  1.2010    1.00    ->  1.21  Inexact Rounded\r
+ddqua1803 quantize  1.2050    1.00    ->  1.21  Inexact Rounded\r
+ddqua1804 quantize  1.2051    1.00    ->  1.21  Inexact Rounded\r
+ddqua1807 quantize  1.2060    1.00    ->  1.21  Inexact Rounded\r
+ddqua1808 quantize  1.2070    1.00    ->  1.21  Inexact Rounded\r
+ddqua1809 quantize  1.2099    1.00    ->  1.21  Inexact Rounded\r
+ddqua1811 quantize -1.2099    1.00    -> -1.21  Inexact Rounded\r
+\r
+ddqua1900 quantize  1.2100    1.00    ->  1.21  Rounded\r
+ddqua1901 quantize  1.2101    1.00    ->  1.21  Inexact Rounded\r
+ddqua1902 quantize  1.2110    1.00    ->  1.21  Inexact Rounded\r
+ddqua1903 quantize  1.2150    1.00    ->  1.21  Inexact Rounded\r
+ddqua1904 quantize  1.2151    1.00    ->  1.21  Inexact Rounded\r
+ddqua1907 quantize  1.2160    1.00    ->  1.21  Inexact Rounded\r
+ddqua1908 quantize  1.2170    1.00    ->  1.21  Inexact Rounded\r
+ddqua1909 quantize  1.2199    1.00    ->  1.21  Inexact Rounded\r
+ddqua1911 quantize -1.2199    1.00    -> -1.21  Inexact Rounded\r
+\r
+ddqua2000 quantize  1.2400    1.00    ->  1.24  Rounded\r
+ddqua2001 quantize  1.2401    1.00    ->  1.24  Inexact Rounded\r
+ddqua2002 quantize  1.2410    1.00    ->  1.24  Inexact Rounded\r
+ddqua2003 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+ddqua2004 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+ddqua2007 quantize  1.2460    1.00    ->  1.24  Inexact Rounded\r
+ddqua2008 quantize  1.2470    1.00    ->  1.24  Inexact Rounded\r
+ddqua2009 quantize  1.2499    1.00    ->  1.24  Inexact Rounded\r
+ddqua2011 quantize -1.2499    1.00    -> -1.24  Inexact Rounded\r
+\r
+ddqua2100 quantize  1.2500    1.00    ->  1.25  Rounded\r
+ddqua2101 quantize  1.2501    1.00    ->  1.26  Inexact Rounded\r
+ddqua2102 quantize  1.2510    1.00    ->  1.26  Inexact Rounded\r
+ddqua2103 quantize  1.2550    1.00    ->  1.26  Inexact Rounded\r
+ddqua2104 quantize  1.2551    1.00    ->  1.26  Inexact Rounded\r
+ddqua2107 quantize  1.2560    1.00    ->  1.26  Inexact Rounded\r
+ddqua2108 quantize  1.2570    1.00    ->  1.26  Inexact Rounded\r
+ddqua2109 quantize  1.2599    1.00    ->  1.26  Inexact Rounded\r
+ddqua2111 quantize -1.2599    1.00    -> -1.26  Inexact Rounded\r
+\r
+ddqua2200 quantize  1.2600    1.00    ->  1.26  Rounded\r
+ddqua2201 quantize  1.2601    1.00    ->  1.26  Inexact Rounded\r
+ddqua2202 quantize  1.2610    1.00    ->  1.26  Inexact Rounded\r
+ddqua2203 quantize  1.2650    1.00    ->  1.26  Inexact Rounded\r
+ddqua2204 quantize  1.2651    1.00    ->  1.26  Inexact Rounded\r
+ddqua2207 quantize  1.2660    1.00    ->  1.26  Inexact Rounded\r
+ddqua2208 quantize  1.2670    1.00    ->  1.26  Inexact Rounded\r
+ddqua2209 quantize  1.2699    1.00    ->  1.26  Inexact Rounded\r
+ddqua2211 quantize -1.2699    1.00    -> -1.26  Inexact Rounded\r
+\r
+ddqua2300 quantize  1.2900    1.00    ->  1.29  Rounded\r
+ddqua2301 quantize  1.2901    1.00    ->  1.29  Inexact Rounded\r
+ddqua2302 quantize  1.2910    1.00    ->  1.29  Inexact Rounded\r
+ddqua2303 quantize  1.2950    1.00    ->  1.29  Inexact Rounded\r
+ddqua2304 quantize  1.2951    1.00    ->  1.29  Inexact Rounded\r
+ddqua2307 quantize  1.2960    1.00    ->  1.29  Inexact Rounded\r
+ddqua2308 quantize  1.2970    1.00    ->  1.29  Inexact Rounded\r
+ddqua2309 quantize  1.2999    1.00    ->  1.29  Inexact Rounded\r
+ddqua2311 quantize -1.2999    1.00    -> -1.29  Inexact Rounded\r
+\r
+-- Null tests\r
+rounding:    half_even\r
+ddqua998 quantize 10    # -> NaN Invalid_operation\r
+ddqua999 quantize  # 1e10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddReduce.decTest b/Lib/test/decimaltestdata/ddReduce.decTest
new file mode 100644 (file)
index 0000000..71c82e1
--- /dev/null
@@ -0,0 +1,182 @@
+------------------------------------------------------------------------\r
+-- ddReduce.decTest -- remove trailing zeros from a decDouble         --\r
+-- Copyright (c) IBM Corporation, 2003, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddred001 reduce '1'      -> '1'\r
+ddred002 reduce '-1'     -> '-1'\r
+ddred003 reduce '1.00'   -> '1'\r
+ddred004 reduce '-1.00'  -> '-1'\r
+ddred005 reduce '0'      -> '0'\r
+ddred006 reduce '0.00'   -> '0'\r
+ddred007 reduce '00.0'   -> '0'\r
+ddred008 reduce '00.00'  -> '0'\r
+ddred009 reduce '00'     -> '0'\r
+ddred010 reduce '0E+1'   -> '0'\r
+ddred011 reduce '0E+5'   -> '0'\r
+\r
+ddred012 reduce '-2'     -> '-2'\r
+ddred013 reduce '2'      -> '2'\r
+ddred014 reduce '-2.00'  -> '-2'\r
+ddred015 reduce '2.00'   -> '2'\r
+ddred016 reduce '-0'     -> '-0'\r
+ddred017 reduce '-0.00'  -> '-0'\r
+ddred018 reduce '-00.0'  -> '-0'\r
+ddred019 reduce '-00.00' -> '-0'\r
+ddred020 reduce '-00'    -> '-0'\r
+ddred021 reduce '-0E+5'   -> '-0'\r
+ddred022 reduce '-0E+1'  -> '-0'\r
+\r
+ddred030 reduce '+0.1'            -> '0.1'\r
+ddred031 reduce '-0.1'            -> '-0.1'\r
+ddred032 reduce '+0.01'           -> '0.01'\r
+ddred033 reduce '-0.01'           -> '-0.01'\r
+ddred034 reduce '+0.001'          -> '0.001'\r
+ddred035 reduce '-0.001'          -> '-0.001'\r
+ddred036 reduce '+0.000001'       -> '0.000001'\r
+ddred037 reduce '-0.000001'       -> '-0.000001'\r
+ddred038 reduce '+0.000000000001' -> '1E-12'\r
+ddred039 reduce '-0.000000000001' -> '-1E-12'\r
+\r
+ddred041 reduce 1.1        -> 1.1\r
+ddred042 reduce 1.10       -> 1.1\r
+ddred043 reduce 1.100      -> 1.1\r
+ddred044 reduce 1.110      -> 1.11\r
+ddred045 reduce -1.1       -> -1.1\r
+ddred046 reduce -1.10      -> -1.1\r
+ddred047 reduce -1.100     -> -1.1\r
+ddred048 reduce -1.110     -> -1.11\r
+ddred049 reduce 9.9        -> 9.9\r
+ddred050 reduce 9.90       -> 9.9\r
+ddred051 reduce 9.900      -> 9.9\r
+ddred052 reduce 9.990      -> 9.99\r
+ddred053 reduce -9.9       -> -9.9\r
+ddred054 reduce -9.90      -> -9.9\r
+ddred055 reduce -9.900     -> -9.9\r
+ddred056 reduce -9.990     -> -9.99\r
+\r
+-- some trailing fractional zeros with zeros in units\r
+ddred060 reduce  10.0        -> 1E+1\r
+ddred061 reduce  10.00       -> 1E+1\r
+ddred062 reduce  100.0       -> 1E+2\r
+ddred063 reduce  100.00      -> 1E+2\r
+ddred064 reduce  1.1000E+3   -> 1.1E+3\r
+ddred065 reduce  1.10000E+3  -> 1.1E+3\r
+ddred066 reduce -10.0        -> -1E+1\r
+ddred067 reduce -10.00       -> -1E+1\r
+ddred068 reduce -100.0       -> -1E+2\r
+ddred069 reduce -100.00      -> -1E+2\r
+ddred070 reduce -1.1000E+3   -> -1.1E+3\r
+ddred071 reduce -1.10000E+3  -> -1.1E+3\r
+\r
+-- some insignificant trailing zeros with positive exponent\r
+ddred080 reduce  10E+1       -> 1E+2\r
+ddred081 reduce  100E+1      -> 1E+3\r
+ddred082 reduce  1.0E+2      -> 1E+2\r
+ddred083 reduce  1.0E+3      -> 1E+3\r
+ddred084 reduce  1.1E+3      -> 1.1E+3\r
+ddred085 reduce  1.00E+3     -> 1E+3\r
+ddred086 reduce  1.10E+3     -> 1.1E+3\r
+ddred087 reduce -10E+1       -> -1E+2\r
+ddred088 reduce -100E+1      -> -1E+3\r
+ddred089 reduce -1.0E+2      -> -1E+2\r
+ddred090 reduce -1.0E+3      -> -1E+3\r
+ddred091 reduce -1.1E+3      -> -1.1E+3\r
+ddred092 reduce -1.00E+3     -> -1E+3\r
+ddred093 reduce -1.10E+3     -> -1.1E+3\r
+\r
+-- some significant trailing zeros, were we to be trimming\r
+ddred100 reduce  11          -> 11\r
+ddred101 reduce  10          -> 1E+1\r
+ddred102 reduce  10.         -> 1E+1\r
+ddred103 reduce  1.1E+1      -> 11\r
+ddred104 reduce  1.0E+1      -> 1E+1\r
+ddred105 reduce  1.10E+2     -> 1.1E+2\r
+ddred106 reduce  1.00E+2     -> 1E+2\r
+ddred107 reduce  1.100E+3    -> 1.1E+3\r
+ddred108 reduce  1.000E+3    -> 1E+3\r
+ddred109 reduce  1.000000E+6 -> 1E+6\r
+ddred110 reduce -11          -> -11\r
+ddred111 reduce -10          -> -1E+1\r
+ddred112 reduce -10.         -> -1E+1\r
+ddred113 reduce -1.1E+1      -> -11\r
+ddred114 reduce -1.0E+1      -> -1E+1\r
+ddred115 reduce -1.10E+2     -> -1.1E+2\r
+ddred116 reduce -1.00E+2     -> -1E+2\r
+ddred117 reduce -1.100E+3    -> -1.1E+3\r
+ddred118 reduce -1.000E+3    -> -1E+3\r
+ddred119 reduce -1.00000E+5  -> -1E+5\r
+ddred120 reduce -1.000000E+6 -> -1E+6\r
+ddred121 reduce -10.00000E+6 -> -1E+7\r
+ddred122 reduce -100.0000E+6 -> -1E+8\r
+ddred123 reduce -1000.000E+6 -> -1E+9\r
+ddred124 reduce -10000.00E+6 -> -1E+10\r
+ddred125 reduce -100000.0E+6 -> -1E+11\r
+ddred126 reduce -1000000.E+6 -> -1E+12\r
+\r
+-- examples from decArith\r
+ddred140 reduce '2.1'     ->  '2.1'\r
+ddred141 reduce '-2.0'    ->  '-2'\r
+ddred142 reduce '1.200'   ->  '1.2'\r
+ddred143 reduce '-120'    ->  '-1.2E+2'\r
+ddred144 reduce '120.00'  ->  '1.2E+2'\r
+ddred145 reduce '0.00'    ->  '0'\r
+\r
+-- Nmax, Nmin, Ntiny\r
+-- note origami effect on some of these\r
+ddred151 reduce  9.999999999999999E+384   -> 9.999999999999999E+384\r
+ddred152 reduce  9.999999000000000E+380   -> 9.99999900000E+380\r
+ddred153 reduce  9.999999999990000E+384   -> 9.999999999990000E+384\r
+ddred154 reduce  1E-383                   -> 1E-383\r
+ddred155 reduce  1.000000000000000E-383   -> 1E-383\r
+ddred156 reduce  2.000E-395               -> 2E-395   Subnormal\r
+ddred157 reduce  1E-398                   -> 1E-398   Subnormal\r
+\r
+ddred161 reduce  -1E-398                  -> -1E-398  Subnormal\r
+ddred162 reduce  -2.000E-395              -> -2E-395  Subnormal\r
+ddred163 reduce  -1.000000000000000E-383  -> -1E-383\r
+ddred164 reduce  -1E-383                  -> -1E-383\r
+ddred165 reduce  -9.999999000000000E+380  -> -9.99999900000E+380\r
+ddred166 reduce  -9.999999999990000E+384  -> -9.999999999990000E+384\r
+ddred167 reduce  -9.999999999999990E+384  -> -9.999999999999990E+384\r
+ddred168 reduce  -9.999999999999999E+384  -> -9.999999999999999E+384\r
+ddred169 reduce  -9.999999999999990E+384  -> -9.999999999999990E+384\r
+\r
+\r
+-- specials (reduce does not affect payload)\r
+ddred820 reduce 'Inf'    -> 'Infinity'\r
+ddred821 reduce '-Inf'   -> '-Infinity'\r
+ddred822 reduce   NaN    ->  NaN\r
+ddred823 reduce  sNaN    ->  NaN    Invalid_operation\r
+ddred824 reduce   NaN101 ->  NaN101\r
+ddred825 reduce  sNaN010 ->  NaN10  Invalid_operation\r
+ddred827 reduce  -NaN    -> -NaN\r
+ddred828 reduce -sNaN    -> -NaN    Invalid_operation\r
+ddred829 reduce  -NaN101 -> -NaN101\r
+ddred830 reduce -sNaN010 -> -NaN10  Invalid_operation\r
+\r
+-- Null test\r
+ddred900 reduce  # -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddRemainder.decTest b/Lib/test/decimaltestdata/ddRemainder.decTest
new file mode 100644 (file)
index 0000000..c7ea762
--- /dev/null
@@ -0,0 +1,587 @@
+------------------------------------------------------------------------\r
+-- ddRemainder.decTest -- decDouble remainder                         --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks (as base, above)\r
+ddrem001 remainder  1     1    ->  0\r
+ddrem002 remainder  2     1    ->  0\r
+ddrem003 remainder  1     2    ->  1\r
+ddrem004 remainder  2     2    ->  0\r
+ddrem005 remainder  0     1    ->  0\r
+ddrem006 remainder  0     2    ->  0\r
+ddrem007 remainder  1     3    ->  1\r
+ddrem008 remainder  2     3    ->  2\r
+ddrem009 remainder  3     3    ->  0\r
+\r
+ddrem010 remainder  2.4   1    ->  0.4\r
+ddrem011 remainder  2.4   -1   ->  0.4\r
+ddrem012 remainder  -2.4  1    ->  -0.4\r
+ddrem013 remainder  -2.4  -1   ->  -0.4\r
+ddrem014 remainder  2.40  1    ->  0.40\r
+ddrem015 remainder  2.400 1    ->  0.400\r
+ddrem016 remainder  2.4   2    ->  0.4\r
+ddrem017 remainder  2.400 2    ->  0.400\r
+ddrem018 remainder  2.    2    ->  0\r
+ddrem019 remainder  20    20   ->  0\r
+\r
+ddrem020 remainder  187   187    ->  0\r
+ddrem021 remainder  5     2      ->  1\r
+ddrem022 remainder  5     2.0    ->  1.0\r
+ddrem023 remainder  5     2.000  ->  1.000\r
+ddrem024 remainder  5     0.200  ->  0.000\r
+ddrem025 remainder  5     0.200  ->  0.000\r
+\r
+ddrem030 remainder  1     2      ->  1\r
+ddrem031 remainder  1     4      ->  1\r
+ddrem032 remainder  1     8      ->  1\r
+\r
+ddrem033 remainder  1     16     ->  1\r
+ddrem034 remainder  1     32     ->  1\r
+ddrem035 remainder  1     64     ->  1\r
+ddrem040 remainder  1    -2      ->  1\r
+ddrem041 remainder  1    -4      ->  1\r
+ddrem042 remainder  1    -8      ->  1\r
+ddrem043 remainder  1    -16     ->  1\r
+ddrem044 remainder  1    -32     ->  1\r
+ddrem045 remainder  1    -64     ->  1\r
+ddrem050 remainder -1     2      ->  -1\r
+ddrem051 remainder -1     4      ->  -1\r
+ddrem052 remainder -1     8      ->  -1\r
+ddrem053 remainder -1     16     ->  -1\r
+ddrem054 remainder -1     32     ->  -1\r
+ddrem055 remainder -1     64     ->  -1\r
+ddrem060 remainder -1    -2      ->  -1\r
+ddrem061 remainder -1    -4      ->  -1\r
+ddrem062 remainder -1    -8      ->  -1\r
+ddrem063 remainder -1    -16     ->  -1\r
+ddrem064 remainder -1    -32     ->  -1\r
+ddrem065 remainder -1    -64     ->  -1\r
+\r
+ddrem066 remainder  999999999     1  -> 0\r
+ddrem067 remainder  999999999.4   1  -> 0.4\r
+ddrem068 remainder  999999999.5   1  -> 0.5\r
+ddrem069 remainder  999999999.9   1  -> 0.9\r
+ddrem070 remainder  999999999.999 1  -> 0.999\r
+ddrem071 remainder  999999.999999 1  -> 0.999999\r
+ddrem072 remainder  9             1  -> 0\r
+ddrem073 remainder  9999999999999999 1  -> 0\r
+ddrem074 remainder  9999999999999999 2  -> 1\r
+ddrem075 remainder  9999999999999999 3  -> 0\r
+ddrem076 remainder  9999999999999999 4  -> 3\r
+\r
+ddrem080 remainder  0.            1  -> 0\r
+ddrem081 remainder  .0            1  -> 0.0\r
+ddrem082 remainder  0.00          1  -> 0.00\r
+ddrem083 remainder  0.00E+9       1  -> 0\r
+ddrem084 remainder  0.00E+3       1  -> 0\r
+ddrem085 remainder  0.00E+2       1  -> 0\r
+ddrem086 remainder  0.00E+1       1  -> 0.0\r
+ddrem087 remainder  0.00E+0       1  -> 0.00\r
+ddrem088 remainder  0.00E-0       1  -> 0.00\r
+ddrem089 remainder  0.00E-1       1  -> 0.000\r
+ddrem090 remainder  0.00E-2       1  -> 0.0000\r
+ddrem091 remainder  0.00E-3       1  -> 0.00000\r
+ddrem092 remainder  0.00E-4       1  -> 0.000000\r
+ddrem093 remainder  0.00E-5       1  -> 0E-7\r
+ddrem094 remainder  0.00E-6       1  -> 0E-8\r
+ddrem095 remainder  0.0000E-50    1  -> 0E-54\r
+\r
+-- Various flavours of remainder by 0\r
+ddrem101 remainder  0       0   -> NaN Division_undefined\r
+ddrem102 remainder  0      -0   -> NaN Division_undefined\r
+ddrem103 remainder -0       0   -> NaN Division_undefined\r
+ddrem104 remainder -0      -0   -> NaN Division_undefined\r
+ddrem105 remainder  0.0E5   0   -> NaN Division_undefined\r
+ddrem106 remainder  0.000   0   -> NaN Division_undefined\r
+-- [Some think this next group should be Division_by_zero exception, but\r
+-- IEEE 854 is explicit that it is Invalid operation .. for\r
+-- remainder-near, anyway]\r
+ddrem107 remainder  0.0001  0   -> NaN Invalid_operation\r
+ddrem108 remainder  0.01    0   -> NaN Invalid_operation\r
+ddrem109 remainder  0.1     0   -> NaN Invalid_operation\r
+ddrem110 remainder  1       0   -> NaN Invalid_operation\r
+ddrem111 remainder  1       0.0 -> NaN Invalid_operation\r
+ddrem112 remainder 10       0.0 -> NaN Invalid_operation\r
+ddrem113 remainder 1E+100   0.0 -> NaN Invalid_operation\r
+ddrem114 remainder 1E+380   0   -> NaN Invalid_operation\r
+ddrem115 remainder  0.0001 -0   -> NaN Invalid_operation\r
+ddrem116 remainder  0.01   -0   -> NaN Invalid_operation\r
+ddrem119 remainder  0.1    -0   -> NaN Invalid_operation\r
+ddrem120 remainder  1      -0   -> NaN Invalid_operation\r
+ddrem121 remainder  1      -0.0 -> NaN Invalid_operation\r
+ddrem122 remainder 10      -0.0 -> NaN Invalid_operation\r
+ddrem123 remainder 1E+100  -0.0 -> NaN Invalid_operation\r
+ddrem124 remainder 1E+384  -0   -> NaN Invalid_operation\r
+-- and zeros on left\r
+ddrem130 remainder  0      1   ->  0\r
+ddrem131 remainder  0     -1   ->  0\r
+ddrem132 remainder  0.0    1   ->  0.0\r
+ddrem133 remainder  0.0   -1   ->  0.0\r
+ddrem134 remainder -0      1   -> -0\r
+ddrem135 remainder -0     -1   -> -0\r
+ddrem136 remainder -0.0    1   -> -0.0\r
+ddrem137 remainder -0.0   -1   -> -0.0\r
+\r
+-- 0.5ers\r
+ddrem143 remainder   0.5  2     ->  0.5\r
+ddrem144 remainder   0.5  2.1   ->  0.5\r
+ddrem145 remainder   0.5  2.01  ->  0.50\r
+ddrem146 remainder   0.5  2.001 ->  0.500\r
+ddrem147 remainder   0.50 2     ->  0.50\r
+ddrem148 remainder   0.50 2.01  ->  0.50\r
+ddrem149 remainder   0.50 2.001 ->  0.500\r
+\r
+-- steadies\r
+ddrem150 remainder  1  1   -> 0\r
+ddrem151 remainder  1  2   -> 1\r
+ddrem152 remainder  1  3   -> 1\r
+ddrem153 remainder  1  4   -> 1\r
+ddrem154 remainder  1  5   -> 1\r
+ddrem155 remainder  1  6   -> 1\r
+ddrem156 remainder  1  7   -> 1\r
+ddrem157 remainder  1  8   -> 1\r
+ddrem158 remainder  1  9   -> 1\r
+ddrem159 remainder  1  10  -> 1\r
+ddrem160 remainder  1  1   -> 0\r
+ddrem161 remainder  2  1   -> 0\r
+ddrem162 remainder  3  1   -> 0\r
+ddrem163 remainder  4  1   -> 0\r
+ddrem164 remainder  5  1   -> 0\r
+ddrem165 remainder  6  1   -> 0\r
+ddrem166 remainder  7  1   -> 0\r
+ddrem167 remainder  8  1   -> 0\r
+ddrem168 remainder  9  1   -> 0\r
+ddrem169 remainder  10 1   -> 0\r
+\r
+-- some differences from remainderNear\r
+ddrem171 remainder   0.4  1.020 ->  0.400\r
+ddrem172 remainder   0.50 1.020 ->  0.500\r
+ddrem173 remainder   0.51 1.020 ->  0.510\r
+ddrem174 remainder   0.52 1.020 ->  0.520\r
+ddrem175 remainder   0.6  1.020 ->  0.600\r
+\r
+-- More flavours of remainder by 0\r
+ddrem201 remainder  0      0   -> NaN Division_undefined\r
+ddrem202 remainder  0.0E5  0   -> NaN Division_undefined\r
+ddrem203 remainder  0.000  0   -> NaN Division_undefined\r
+ddrem204 remainder  0.0001 0   -> NaN Invalid_operation\r
+ddrem205 remainder  0.01   0   -> NaN Invalid_operation\r
+ddrem206 remainder  0.1    0   -> NaN Invalid_operation\r
+ddrem207 remainder  1      0   -> NaN Invalid_operation\r
+ddrem208 remainder  1      0.0 -> NaN Invalid_operation\r
+ddrem209 remainder 10      0.0 -> NaN Invalid_operation\r
+ddrem210 remainder 1E+100  0.0 -> NaN Invalid_operation\r
+ddrem211 remainder 1E+380  0   -> NaN Invalid_operation\r
+\r
+-- some differences from remainderNear\r
+ddrem231 remainder  -0.4  1.020 -> -0.400\r
+ddrem232 remainder  -0.50 1.020 -> -0.500\r
+ddrem233 remainder  -0.51 1.020 -> -0.510\r
+ddrem234 remainder  -0.52 1.020 -> -0.520\r
+ddrem235 remainder  -0.6  1.020 -> -0.600\r
+\r
+-- high Xs\r
+ddrem240 remainder  1E+2  1.00  ->  0.00\r
+\r
+-- ddrem3xx are from DiagBigDecimal\r
+ddrem301 remainder   1    3     ->  1\r
+ddrem302 remainder   5    5     ->  0\r
+ddrem303 remainder   13   10    ->  3\r
+ddrem304 remainder   13   50    ->  13\r
+ddrem305 remainder   13   100   ->  13\r
+ddrem306 remainder   13   1000  ->  13\r
+ddrem307 remainder   .13    1   ->  0.13\r
+ddrem308 remainder   0.133  1   ->  0.133\r
+ddrem309 remainder   0.1033 1   ->  0.1033\r
+ddrem310 remainder   1.033  1   ->  0.033\r
+ddrem311 remainder   10.33  1   ->  0.33\r
+ddrem312 remainder   10.33 10   ->  0.33\r
+ddrem313 remainder   103.3  1   ->  0.3\r
+ddrem314 remainder   133   10   ->  3\r
+ddrem315 remainder   1033  10   ->  3\r
+ddrem316 remainder   1033  50   ->  33\r
+ddrem317 remainder   101.0  3   ->  2.0\r
+ddrem318 remainder   102.0  3   ->  0.0\r
+ddrem319 remainder   103.0  3   ->  1.0\r
+ddrem320 remainder   2.40   1   ->  0.40\r
+ddrem321 remainder   2.400  1   ->  0.400\r
+ddrem322 remainder   2.4    1   ->  0.4\r
+ddrem323 remainder   2.4    2   ->  0.4\r
+ddrem324 remainder   2.400  2   ->  0.400\r
+ddrem325 remainder   1   0.3    ->  0.1\r
+ddrem326 remainder   1   0.30   ->  0.10\r
+ddrem327 remainder   1   0.300  ->  0.100\r
+ddrem328 remainder   1   0.3000 ->  0.1000\r
+ddrem329 remainder   1.0    0.3 ->  0.1\r
+ddrem330 remainder   1.00   0.3 ->  0.10\r
+ddrem331 remainder   1.000  0.3 ->  0.100\r
+ddrem332 remainder   1.0000 0.3 ->  0.1000\r
+ddrem333 remainder   0.5  2     ->  0.5\r
+ddrem334 remainder   0.5  2.1   ->  0.5\r
+ddrem335 remainder   0.5  2.01  ->  0.50\r
+ddrem336 remainder   0.5  2.001 ->  0.500\r
+ddrem337 remainder   0.50 2     ->  0.50\r
+ddrem338 remainder   0.50 2.01  ->  0.50\r
+ddrem339 remainder   0.50 2.001 ->  0.500\r
+\r
+ddrem340 remainder   0.5   0.5000001    ->  0.5000000\r
+ddrem341 remainder   0.5   0.50000001    ->  0.50000000\r
+ddrem342 remainder   0.5   0.500000001    ->  0.500000000\r
+ddrem343 remainder   0.5   0.5000000001    ->  0.5000000000\r
+ddrem344 remainder   0.5   0.50000000001    ->  0.50000000000\r
+ddrem345 remainder   0.5   0.4999999    ->  1E-7\r
+ddrem346 remainder   0.5   0.49999999    ->  1E-8\r
+ddrem347 remainder   0.5   0.499999999    ->  1E-9\r
+ddrem348 remainder   0.5   0.4999999999    ->  1E-10\r
+ddrem349 remainder   0.5   0.49999999999    ->  1E-11\r
+ddrem350 remainder   0.5   0.499999999999    ->  1E-12\r
+\r
+ddrem351 remainder   0.03  7  ->  0.03\r
+ddrem352 remainder   5   2    ->  1\r
+ddrem353 remainder   4.1   2    ->  0.1\r
+ddrem354 remainder   4.01   2    ->  0.01\r
+ddrem355 remainder   4.001   2    ->  0.001\r
+ddrem356 remainder   4.0001   2    ->  0.0001\r
+ddrem357 remainder   4.00001   2    ->  0.00001\r
+ddrem358 remainder   4.000001   2    ->  0.000001\r
+ddrem359 remainder   4.0000001   2    ->  1E-7\r
+\r
+ddrem360 remainder   1.2   0.7345 ->  0.4655\r
+ddrem361 remainder   0.8   12     ->  0.8\r
+ddrem362 remainder   0.8   0.2    ->  0.0\r
+ddrem363 remainder   0.8   0.3    ->  0.2\r
+ddrem364 remainder   0.800   12   ->  0.800\r
+ddrem365 remainder   0.800   1.7  ->  0.800\r
+ddrem366 remainder   2.400   2    ->  0.400\r
+\r
+ddrem371 remainder   2.400  2        ->  0.400\r
+\r
+ddrem381 remainder 12345  1         ->  0\r
+ddrem382 remainder 12345  1.0001    ->  0.7657\r
+ddrem383 remainder 12345  1.001     ->  0.668\r
+ddrem384 remainder 12345  1.01      ->  0.78\r
+ddrem385 remainder 12345  1.1       ->  0.8\r
+ddrem386 remainder 12355  4         ->  3\r
+ddrem387 remainder 12345  4         ->  1\r
+ddrem388 remainder 12355  4.0001    ->  2.6912\r
+ddrem389 remainder 12345  4.0001    ->  0.6914\r
+ddrem390 remainder 12345  4.9       ->  1.9\r
+ddrem391 remainder 12345  4.99      ->  4.73\r
+ddrem392 remainder 12345  4.999     ->  2.469\r
+ddrem393 remainder 12345  4.9999    ->  0.2469\r
+ddrem394 remainder 12345  5         ->  0\r
+ddrem395 remainder 12345  5.0001    ->  4.7532\r
+ddrem396 remainder 12345  5.001     ->  2.532\r
+ddrem397 remainder 12345  5.01      ->  0.36\r
+ddrem398 remainder 12345  5.1       ->  3.0\r
+\r
+-- the nasty division-by-1 cases\r
+ddrem401 remainder   0.5         1   ->  0.5\r
+ddrem402 remainder   0.55        1   ->  0.55\r
+ddrem403 remainder   0.555       1   ->  0.555\r
+ddrem404 remainder   0.5555      1   ->  0.5555\r
+ddrem405 remainder   0.55555     1   ->  0.55555\r
+ddrem406 remainder   0.555555    1   ->  0.555555\r
+ddrem407 remainder   0.5555555   1   ->  0.5555555\r
+ddrem408 remainder   0.55555555  1   ->  0.55555555\r
+ddrem409 remainder   0.555555555 1   ->  0.555555555\r
+\r
+-- folddowns\r
+ddrem421 remainder   1E+384       1  ->   NaN Division_impossible\r
+ddrem422 remainder   1E+384  1E+383  ->   0E+369 Clamped\r
+ddrem423 remainder   1E+384  2E+383  ->   0E+369 Clamped\r
+ddrem424 remainder   1E+384  3E+383  ->   1.00000000000000E+383 Clamped\r
+ddrem425 remainder   1E+384  4E+383  ->   2.00000000000000E+383 Clamped\r
+ddrem426 remainder   1E+384  5E+383  ->   0E+369 Clamped\r
+ddrem427 remainder   1E+384  6E+383  ->   4.00000000000000E+383 Clamped\r
+ddrem428 remainder   1E+384  7E+383  ->   3.00000000000000E+383 Clamped\r
+ddrem429 remainder   1E+384  8E+383  ->   2.00000000000000E+383 Clamped\r
+ddrem430 remainder   1E+384  9E+383  ->   1.00000000000000E+383 Clamped\r
+-- tinies\r
+ddrem431 remainder   1E-397  1E-398  ->   0E-398\r
+ddrem432 remainder   1E-397  2E-398  ->   0E-398\r
+ddrem433 remainder   1E-397  3E-398  ->   1E-398 Subnormal\r
+ddrem434 remainder   1E-397  4E-398  ->   2E-398 Subnormal\r
+ddrem435 remainder   1E-397  5E-398  ->   0E-398\r
+ddrem436 remainder   1E-397  6E-398  ->   4E-398 Subnormal\r
+ddrem437 remainder   1E-397  7E-398  ->   3E-398 Subnormal\r
+ddrem438 remainder   1E-397  8E-398  ->   2E-398 Subnormal\r
+ddrem439 remainder   1E-397  9E-398  ->   1E-398 Subnormal\r
+ddrem440 remainder   1E-397 10E-398  ->   0E-398\r
+ddrem441 remainder   1E-397 11E-398  -> 1.0E-397 Subnormal\r
+ddrem442 remainder 100E-397 11E-398  -> 1.0E-397 Subnormal\r
+ddrem443 remainder 100E-397 20E-398  ->   0E-398\r
+ddrem444 remainder 100E-397 21E-398  -> 1.3E-397 Subnormal\r
+ddrem445 remainder 100E-397 30E-398  -> 1.0E-397 Subnormal\r
+\r
+-- zero signs\r
+ddrem650 remainder  1  1 ->  0\r
+ddrem651 remainder -1  1 -> -0\r
+ddrem652 remainder  1 -1 ->  0\r
+ddrem653 remainder -1 -1 -> -0\r
+ddrem654 remainder  0  1 ->  0\r
+ddrem655 remainder -0  1 -> -0\r
+ddrem656 remainder  0 -1 ->  0\r
+ddrem657 remainder -0 -1 -> -0\r
+ddrem658 remainder  0.00  1  ->  0.00\r
+ddrem659 remainder -0.00  1  -> -0.00\r
+\r
+-- Specials\r
+ddrem680 remainder  Inf  -Inf   ->  NaN Invalid_operation\r
+ddrem681 remainder  Inf  -1000  ->  NaN Invalid_operation\r
+ddrem682 remainder  Inf  -1     ->  NaN Invalid_operation\r
+ddrem683 remainder  Inf   0     ->  NaN Invalid_operation\r
+ddrem684 remainder  Inf  -0     ->  NaN Invalid_operation\r
+ddrem685 remainder  Inf   1     ->  NaN Invalid_operation\r
+ddrem686 remainder  Inf   1000  ->  NaN Invalid_operation\r
+ddrem687 remainder  Inf   Inf   ->  NaN Invalid_operation\r
+ddrem688 remainder -1000  Inf   -> -1000\r
+ddrem689 remainder -Inf   Inf   ->  NaN Invalid_operation\r
+ddrem691 remainder -1     Inf   -> -1\r
+ddrem692 remainder  0     Inf   ->  0\r
+ddrem693 remainder -0     Inf   -> -0\r
+ddrem694 remainder  1     Inf   ->  1\r
+ddrem695 remainder  1000  Inf   ->  1000\r
+ddrem696 remainder  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+ddrem700 remainder -Inf  -Inf   ->  NaN Invalid_operation\r
+ddrem701 remainder -Inf  -1000  ->  NaN Invalid_operation\r
+ddrem702 remainder -Inf  -1     ->  NaN Invalid_operation\r
+ddrem703 remainder -Inf  -0     ->  NaN Invalid_operation\r
+ddrem704 remainder -Inf   0     ->  NaN Invalid_operation\r
+ddrem705 remainder -Inf   1     ->  NaN Invalid_operation\r
+ddrem706 remainder -Inf   1000  ->  NaN Invalid_operation\r
+ddrem707 remainder -Inf   Inf   ->  NaN Invalid_operation\r
+ddrem708 remainder -Inf  -Inf   ->  NaN Invalid_operation\r
+ddrem709 remainder -1000  Inf   -> -1000\r
+ddrem710 remainder -1    -Inf   -> -1\r
+ddrem711 remainder -0    -Inf   -> -0\r
+ddrem712 remainder  0    -Inf   ->  0\r
+ddrem713 remainder  1    -Inf   ->  1\r
+ddrem714 remainder  1000 -Inf   ->  1000\r
+ddrem715 remainder  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+ddrem721 remainder  NaN -Inf    ->  NaN\r
+ddrem722 remainder  NaN -1000   ->  NaN\r
+ddrem723 remainder  NaN -1      ->  NaN\r
+ddrem724 remainder  NaN -0      ->  NaN\r
+ddrem725 remainder -NaN  0      -> -NaN\r
+ddrem726 remainder  NaN  1      ->  NaN\r
+ddrem727 remainder  NaN  1000   ->  NaN\r
+ddrem728 remainder  NaN  Inf    ->  NaN\r
+ddrem729 remainder  NaN -NaN    ->  NaN\r
+ddrem730 remainder -Inf  NaN    ->  NaN\r
+ddrem731 remainder -1000 NaN    ->  NaN\r
+ddrem732 remainder -1    NaN    ->  NaN\r
+ddrem733 remainder -0   -NaN    -> -NaN\r
+ddrem734 remainder  0    NaN    ->  NaN\r
+ddrem735 remainder  1   -NaN    -> -NaN\r
+ddrem736 remainder  1000 NaN    ->  NaN\r
+ddrem737 remainder  Inf  NaN    ->  NaN\r
+\r
+ddrem741 remainder  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddrem742 remainder  sNaN -1000  ->  NaN  Invalid_operation\r
+ddrem743 remainder -sNaN -1     -> -NaN  Invalid_operation\r
+ddrem744 remainder  sNaN -0     ->  NaN  Invalid_operation\r
+ddrem745 remainder  sNaN  0     ->  NaN  Invalid_operation\r
+ddrem746 remainder  sNaN  1     ->  NaN  Invalid_operation\r
+ddrem747 remainder  sNaN  1000  ->  NaN  Invalid_operation\r
+ddrem749 remainder  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddrem750 remainder  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddrem751 remainder  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddrem752 remainder -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddrem753 remainder -1000 sNaN   ->  NaN  Invalid_operation\r
+ddrem754 remainder -1    sNaN   ->  NaN  Invalid_operation\r
+ddrem755 remainder -0    sNaN   ->  NaN  Invalid_operation\r
+ddrem756 remainder  0    sNaN   ->  NaN  Invalid_operation\r
+ddrem757 remainder  1    sNaN   ->  NaN  Invalid_operation\r
+ddrem758 remainder  1000 sNaN   ->  NaN  Invalid_operation\r
+ddrem759 remainder  Inf -sNaN   -> -NaN  Invalid_operation\r
+\r
+-- propaging NaNs\r
+ddrem760 remainder  NaN1   NaN7   ->  NaN1\r
+ddrem761 remainder sNaN2   NaN8   ->  NaN2 Invalid_operation\r
+ddrem762 remainder  NaN3  sNaN9   ->  NaN9 Invalid_operation\r
+ddrem763 remainder sNaN4  sNaN10  ->  NaN4 Invalid_operation\r
+ddrem764 remainder    15   NaN11  ->  NaN11\r
+ddrem765 remainder  NaN6   NaN12  ->  NaN6\r
+ddrem766 remainder  Inf    NaN13  ->  NaN13\r
+ddrem767 remainder  NaN14  -Inf   ->  NaN14\r
+ddrem768 remainder    0    NaN15  ->  NaN15\r
+ddrem769 remainder  NaN16   -0    ->  NaN16\r
+\r
+-- edge cases of impossible\r
+ddrem770  remainder  1234567890123456  10    ->  6\r
+ddrem771  remainder  1234567890123456   1    ->  0\r
+ddrem772  remainder  1234567890123456   0.1  ->  NaN Division_impossible\r
+ddrem773  remainder  1234567890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- long operand checks\r
+ddrem801 remainder 12345678000 100 -> 0\r
+ddrem802 remainder 1 12345678000   -> 1\r
+ddrem803 remainder 1234567800  10  -> 0\r
+ddrem804 remainder 1 1234567800    -> 1\r
+ddrem805 remainder 1234567890  10  -> 0\r
+ddrem806 remainder 1 1234567890    -> 1\r
+ddrem807 remainder 1234567891  10  -> 1\r
+ddrem808 remainder 1 1234567891    -> 1\r
+ddrem809 remainder 12345678901 100 -> 1\r
+ddrem810 remainder 1 12345678901   -> 1\r
+ddrem811 remainder 1234567896  10  -> 6\r
+ddrem812 remainder 1 1234567896    -> 1\r
+\r
+ddrem821 remainder 12345678000 100 -> 0\r
+ddrem822 remainder 1 12345678000   -> 1\r
+ddrem823 remainder 1234567800  10  -> 0\r
+ddrem824 remainder 1 1234567800    -> 1\r
+ddrem825 remainder 1234567890  10  -> 0\r
+ddrem826 remainder 1 1234567890    -> 1\r
+ddrem827 remainder 1234567891  10  -> 1\r
+ddrem828 remainder 1 1234567891    -> 1\r
+ddrem829 remainder 12345678901 100 -> 1\r
+ddrem830 remainder 1 12345678901   -> 1\r
+ddrem831 remainder 1234567896  10  -> 6\r
+ddrem832 remainder 1 1234567896    -> 1\r
+\r
+-- from divideint\r
+ddrem840 remainder  100000000.0   1  ->  0.0\r
+ddrem841 remainder  100000000.4   1  ->  0.4\r
+ddrem842 remainder  100000000.5   1  ->  0.5\r
+ddrem843 remainder  100000000.9   1  ->  0.9\r
+ddrem844 remainder  100000000.999 1  ->  0.999\r
+ddrem850 remainder  100000003     5  ->  3\r
+ddrem851 remainder  10000003      5  ->  3\r
+ddrem852 remainder  1000003       5  ->  3\r
+ddrem853 remainder  100003        5  ->  3\r
+ddrem854 remainder  10003         5  ->  3\r
+ddrem855 remainder  1003          5  ->  3\r
+ddrem856 remainder  103           5  ->  3\r
+ddrem857 remainder  13            5  ->  3\r
+ddrem858 remainder  1             5  ->  1\r
+\r
+-- Vladimir's cases         1234567890123456\r
+ddrem860 remainder 123.0e1 1000000000000000  -> 1230\r
+ddrem861 remainder 1230    1000000000000000  -> 1230\r
+ddrem862 remainder 12.3e2  1000000000000000  -> 1230\r
+ddrem863 remainder 1.23e3  1000000000000000  -> 1230\r
+ddrem864 remainder 123e1   1000000000000000  -> 1230\r
+ddrem870 remainder 123e1    1000000000000000 -> 1230\r
+ddrem871 remainder 123e1     100000000000000 -> 1230\r
+ddrem872 remainder 123e1      10000000000000 -> 1230\r
+ddrem873 remainder 123e1       1000000000000 -> 1230\r
+ddrem874 remainder 123e1        100000000000 -> 1230\r
+ddrem875 remainder 123e1         10000000000 -> 1230\r
+ddrem876 remainder 123e1          1000000000 -> 1230\r
+ddrem877 remainder 123e1           100000000 -> 1230\r
+ddrem878 remainder 1230            100000000 -> 1230\r
+ddrem879 remainder 123e1            10000000 -> 1230\r
+ddrem880 remainder 123e1             1000000 -> 1230\r
+ddrem881 remainder 123e1              100000 -> 1230\r
+ddrem882 remainder 123e1               10000 -> 1230\r
+ddrem883 remainder 123e1                1000 ->  230\r
+ddrem884 remainder 123e1                 100 ->   30\r
+ddrem885 remainder 123e1                  10 ->    0\r
+ddrem886 remainder 123e1                   1 ->    0\r
+\r
+ddrem890 remainder 123e1    2000000000000000 -> 1230\r
+ddrem891 remainder 123e1     200000000000000 -> 1230\r
+ddrem892 remainder 123e1      20000000000000 -> 1230\r
+ddrem893 remainder 123e1       2000000000000 -> 1230\r
+ddrem894 remainder 123e1        200000000000 -> 1230\r
+ddrem895 remainder 123e1         20000000000 -> 1230\r
+ddrem896 remainder 123e1          2000000000 -> 1230\r
+ddrem897 remainder 123e1           200000000 -> 1230\r
+ddrem899 remainder 123e1            20000000 -> 1230\r
+ddrem900 remainder 123e1             2000000 -> 1230\r
+ddrem901 remainder 123e1              200000 -> 1230\r
+ddrem902 remainder 123e1               20000 -> 1230\r
+ddrem903 remainder 123e1                2000 -> 1230\r
+ddrem904 remainder 123e1                 200 ->   30\r
+ddrem905 remainder 123e1                  20 ->   10\r
+ddrem906 remainder 123e1                   2 ->    0\r
+\r
+ddrem910 remainder 123e1    5000000000000000 -> 1230\r
+ddrem911 remainder 123e1     500000000000000 -> 1230\r
+ddrem912 remainder 123e1      50000000000000 -> 1230\r
+ddrem913 remainder 123e1       5000000000000 -> 1230\r
+ddrem914 remainder 123e1        500000000000 -> 1230\r
+ddrem915 remainder 123e1         50000000000 -> 1230\r
+ddrem916 remainder 123e1          5000000000 -> 1230\r
+ddrem917 remainder 123e1           500000000 -> 1230\r
+ddrem919 remainder 123e1            50000000 -> 1230\r
+ddrem920 remainder 123e1             5000000 -> 1230\r
+ddrem921 remainder 123e1              500000 -> 1230\r
+ddrem922 remainder 123e1               50000 -> 1230\r
+ddrem923 remainder 123e1                5000 -> 1230\r
+ddrem924 remainder 123e1                 500 ->  230\r
+ddrem925 remainder 123e1                  50 ->   30\r
+ddrem926 remainder 123e1                   5 ->    0\r
+\r
+ddrem930 remainder 123e1    9000000000000000 -> 1230\r
+ddrem931 remainder 123e1     900000000000000 -> 1230\r
+ddrem932 remainder 123e1      90000000000000 -> 1230\r
+ddrem933 remainder 123e1       9000000000000 -> 1230\r
+ddrem934 remainder 123e1        900000000000 -> 1230\r
+ddrem935 remainder 123e1         90000000000 -> 1230\r
+ddrem936 remainder 123e1          9000000000 -> 1230\r
+ddrem937 remainder 123e1           900000000 -> 1230\r
+ddrem939 remainder 123e1            90000000 -> 1230\r
+ddrem940 remainder 123e1             9000000 -> 1230\r
+ddrem941 remainder 123e1              900000 -> 1230\r
+ddrem942 remainder 123e1               90000 -> 1230\r
+ddrem943 remainder 123e1                9000 -> 1230\r
+ddrem944 remainder 123e1                 900 ->  330\r
+ddrem945 remainder 123e1                  90 ->   60\r
+ddrem946 remainder 123e1                   9 ->    6\r
+\r
+ddrem950 remainder 123e1   1000000000000000 -> 1230\r
+ddrem961 remainder 123e1   2999999999999999 -> 1230\r
+ddrem962 remainder 123e1   3999999999999999 -> 1230\r
+ddrem963 remainder 123e1   4999999999999999 -> 1230\r
+ddrem964 remainder 123e1   5999999999999999 -> 1230\r
+ddrem965 remainder 123e1   6999999999999999 -> 1230\r
+ddrem966 remainder 123e1   7999999999999999 -> 1230\r
+ddrem967 remainder 123e1   8999999999999999 -> 1230\r
+ddrem968 remainder 123e1   9999999999999999 -> 1230\r
+ddrem969 remainder 123e1   9876543210987654 -> 1230\r
+\r
+ddrem980 remainder 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally\r
+\r
+-- overflow and underflow tests [from divide]\r
+ddrem1051 remainder  1e+277  1e-311 ->  NaN Division_impossible\r
+ddrem1052 remainder  1e+277 -1e-311 ->  NaN Division_impossible\r
+ddrem1053 remainder -1e+277  1e-311 ->  NaN Division_impossible\r
+ddrem1054 remainder -1e+277 -1e-311 ->  NaN Division_impossible\r
+ddrem1055 remainder  1e-277  1e+311 ->  1E-277\r
+ddrem1056 remainder  1e-277 -1e+311 ->  1E-277\r
+ddrem1057 remainder -1e-277  1e+311 -> -1E-277\r
+ddrem1058 remainder -1e-277 -1e+311 -> -1E-277\r
+\r
+-- Null tests\r
+ddrem1000 remainder 10  # -> NaN Invalid_operation\r
+ddrem1001 remainder  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddRemainderNear.decTest b/Lib/test/decimaltestdata/ddRemainderNear.decTest
new file mode 100644 (file)
index 0000000..1f3bafd
--- /dev/null
@@ -0,0 +1,615 @@
+------------------------------------------------------------------------\r
+-- ddRemainderNear.decTest -- decDouble remainder-near                --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- sanity checks (as base, above)\r
+ddrmn001 remaindernear  1     1    ->  0\r
+ddrmn002 remaindernear  2     1    ->  0\r
+ddrmn003 remaindernear  1     2    ->  1\r
+ddrmn004 remaindernear  2     2    ->  0\r
+ddrmn005 remaindernear  0     1    ->  0\r
+ddrmn006 remaindernear  0     2    ->  0\r
+ddrmn007 remaindernear  1     3    ->  1\r
+ddrmn008 remaindernear  2     3    -> -1\r
+ddrmn009 remaindernear  3     3    ->  0\r
+\r
+ddrmn010 remaindernear  2.4   1    ->  0.4\r
+ddrmn011 remaindernear  2.4   -1   ->  0.4\r
+ddrmn012 remaindernear  -2.4  1    ->  -0.4\r
+ddrmn013 remaindernear  -2.4  -1   ->  -0.4\r
+ddrmn014 remaindernear  2.40  1    ->  0.40\r
+ddrmn015 remaindernear  2.400 1    ->  0.400\r
+ddrmn016 remaindernear  2.4   2    ->  0.4\r
+ddrmn017 remaindernear  2.400 2    ->  0.400\r
+ddrmn018 remaindernear  2.    2    ->  0\r
+ddrmn019 remaindernear  20    20   ->  0\r
+\r
+ddrmn020 remaindernear  187   187    ->  0\r
+ddrmn021 remaindernear  5     2      ->  1\r
+ddrmn022 remaindernear  5     2.0    ->  1.0\r
+ddrmn023 remaindernear  5     2.000  ->  1.000\r
+ddrmn024 remaindernear  5     0.200  ->  0.000\r
+ddrmn025 remaindernear  5     0.200  ->  0.000\r
+\r
+ddrmn030 remaindernear  1     2      ->  1\r
+ddrmn031 remaindernear  1     4      ->  1\r
+ddrmn032 remaindernear  1     8      ->  1\r
+\r
+ddrmn033 remaindernear  1     16     ->  1\r
+ddrmn034 remaindernear  1     32     ->  1\r
+ddrmn035 remaindernear  1     64     ->  1\r
+ddrmn040 remaindernear  1    -2      ->  1\r
+ddrmn041 remaindernear  1    -4      ->  1\r
+ddrmn042 remaindernear  1    -8      ->  1\r
+ddrmn043 remaindernear  1    -16     ->  1\r
+ddrmn044 remaindernear  1    -32     ->  1\r
+ddrmn045 remaindernear  1    -64     ->  1\r
+ddrmn050 remaindernear -1     2      ->  -1\r
+ddrmn051 remaindernear -1     4      ->  -1\r
+ddrmn052 remaindernear -1     8      ->  -1\r
+ddrmn053 remaindernear -1     16     ->  -1\r
+ddrmn054 remaindernear -1     32     ->  -1\r
+ddrmn055 remaindernear -1     64     ->  -1\r
+ddrmn060 remaindernear -1    -2      ->  -1\r
+ddrmn061 remaindernear -1    -4      ->  -1\r
+ddrmn062 remaindernear -1    -8      ->  -1\r
+ddrmn063 remaindernear -1    -16     ->  -1\r
+ddrmn064 remaindernear -1    -32     ->  -1\r
+ddrmn065 remaindernear -1    -64     ->  -1\r
+\r
+ddrmn066 remaindernear          9.9   1  -> -0.1\r
+ddrmn067 remaindernear         99.7   1  -> -0.3\r
+ddrmn068 remaindernear  999999999     1  -> 0\r
+ddrmn069 remaindernear  999999999.4   1  -> 0.4\r
+ddrmn070 remaindernear  999999999.5   1  -> -0.5\r
+ddrmn071 remaindernear  999999999.9   1  -> -0.1\r
+ddrmn072 remaindernear  999999999.999 1  -> -0.001\r
+ddrmn073 remaindernear  999999.999999 1  -> -0.000001\r
+ddrmn074 remaindernear  9             1  -> 0\r
+ddrmn075 remaindernear  9999999999999999 1  -> 0\r
+ddrmn076 remaindernear  9999999999999999 2  -> -1\r
+ddrmn077 remaindernear  9999999999999999 3  -> 0\r
+ddrmn078 remaindernear  9999999999999999 4  -> -1\r
+\r
+ddrmn080 remaindernear  0.            1  -> 0\r
+ddrmn081 remaindernear  .0            1  -> 0.0\r
+ddrmn082 remaindernear  0.00          1  -> 0.00\r
+ddrmn083 remaindernear  0.00E+9       1  -> 0\r
+ddrmn084 remaindernear  0.00E+3       1  -> 0\r
+ddrmn085 remaindernear  0.00E+2       1  -> 0\r
+ddrmn086 remaindernear  0.00E+1       1  -> 0.0\r
+ddrmn087 remaindernear  0.00E+0       1  -> 0.00\r
+ddrmn088 remaindernear  0.00E-0       1  -> 0.00\r
+ddrmn089 remaindernear  0.00E-1       1  -> 0.000\r
+ddrmn090 remaindernear  0.00E-2       1  -> 0.0000\r
+ddrmn091 remaindernear  0.00E-3       1  -> 0.00000\r
+ddrmn092 remaindernear  0.00E-4       1  -> 0.000000\r
+ddrmn093 remaindernear  0.00E-5       1  -> 0E-7\r
+ddrmn094 remaindernear  0.00E-6       1  -> 0E-8\r
+ddrmn095 remaindernear  0.0000E-50    1  -> 0E-54\r
+\r
+-- Various flavours of remaindernear by 0\r
+ddrmn101 remaindernear  0       0   -> NaN Division_undefined\r
+ddrmn102 remaindernear  0      -0   -> NaN Division_undefined\r
+ddrmn103 remaindernear -0       0   -> NaN Division_undefined\r
+ddrmn104 remaindernear -0      -0   -> NaN Division_undefined\r
+ddrmn105 remaindernear  0.0E5   0   -> NaN Division_undefined\r
+ddrmn106 remaindernear  0.000   0   -> NaN Division_undefined\r
+-- [Some think this next group should be Division_by_zero exception, but\r
+-- IEEE 854 is explicit that it is Invalid operation .. for\r
+-- remainder-near, anyway]\r
+ddrmn107 remaindernear  0.0001  0   -> NaN Invalid_operation\r
+ddrmn108 remaindernear  0.01    0   -> NaN Invalid_operation\r
+ddrmn109 remaindernear  0.1     0   -> NaN Invalid_operation\r
+ddrmn110 remaindernear  1       0   -> NaN Invalid_operation\r
+ddrmn111 remaindernear  1       0.0 -> NaN Invalid_operation\r
+ddrmn112 remaindernear 10       0.0 -> NaN Invalid_operation\r
+ddrmn113 remaindernear 1E+100   0.0 -> NaN Invalid_operation\r
+ddrmn114 remaindernear 1E+380   0   -> NaN Invalid_operation\r
+ddrmn115 remaindernear  0.0001 -0   -> NaN Invalid_operation\r
+ddrmn116 remaindernear  0.01   -0   -> NaN Invalid_operation\r
+ddrmn119 remaindernear  0.1    -0   -> NaN Invalid_operation\r
+ddrmn120 remaindernear  1      -0   -> NaN Invalid_operation\r
+ddrmn121 remaindernear  1      -0.0 -> NaN Invalid_operation\r
+ddrmn122 remaindernear 10      -0.0 -> NaN Invalid_operation\r
+ddrmn123 remaindernear 1E+100  -0.0 -> NaN Invalid_operation\r
+ddrmn124 remaindernear 1E+384  -0   -> NaN Invalid_operation\r
+-- and zeros on left\r
+ddrmn130 remaindernear  0      1   ->  0\r
+ddrmn131 remaindernear  0     -1   ->  0\r
+ddrmn132 remaindernear  0.0    1   ->  0.0\r
+ddrmn133 remaindernear  0.0   -1   ->  0.0\r
+ddrmn134 remaindernear -0      1   -> -0\r
+ddrmn135 remaindernear -0     -1   -> -0\r
+ddrmn136 remaindernear -0.0    1   -> -0.0\r
+ddrmn137 remaindernear -0.0   -1   -> -0.0\r
+\r
+-- 0.5ers\r
+ddrmn143 remaindernear   0.5  2     ->  0.5\r
+ddrmn144 remaindernear   0.5  2.1   ->  0.5\r
+ddrmn145 remaindernear   0.5  2.01  ->  0.50\r
+ddrmn146 remaindernear   0.5  2.001 ->  0.500\r
+ddrmn147 remaindernear   0.50 2     ->  0.50\r
+ddrmn148 remaindernear   0.50 2.01  ->  0.50\r
+ddrmn149 remaindernear   0.50 2.001 ->  0.500\r
+\r
+-- steadies\r
+ddrmn150 remaindernear  1  1   -> 0\r
+ddrmn151 remaindernear  1  2   -> 1\r
+ddrmn152 remaindernear  1  3   -> 1\r
+ddrmn153 remaindernear  1  4   -> 1\r
+ddrmn154 remaindernear  1  5   -> 1\r
+ddrmn155 remaindernear  1  6   -> 1\r
+ddrmn156 remaindernear  1  7   -> 1\r
+ddrmn157 remaindernear  1  8   -> 1\r
+ddrmn158 remaindernear  1  9   -> 1\r
+ddrmn159 remaindernear  1  10  -> 1\r
+ddrmn160 remaindernear  1  1   -> 0\r
+ddrmn161 remaindernear  2  1   -> 0\r
+ddrmn162 remaindernear  3  1   -> 0\r
+ddrmn163 remaindernear  4  1   -> 0\r
+ddrmn164 remaindernear  5  1   -> 0\r
+ddrmn165 remaindernear  6  1   -> 0\r
+ddrmn166 remaindernear  7  1   -> 0\r
+ddrmn167 remaindernear  8  1   -> 0\r
+ddrmn168 remaindernear  9  1   -> 0\r
+ddrmn169 remaindernear  10 1   -> 0\r
+\r
+-- some differences from remainder\r
+ddrmn171 remaindernear   0.4  1.020 ->  0.400\r
+ddrmn172 remaindernear   0.50 1.020 ->  0.500\r
+ddrmn173 remaindernear   0.51 1.020 ->  0.510\r
+ddrmn174 remaindernear   0.52 1.020 -> -0.500\r
+ddrmn175 remaindernear   0.6  1.020 -> -0.420\r
+\r
+-- More flavours of remaindernear by 0\r
+ddrmn201 remaindernear  0      0   -> NaN Division_undefined\r
+ddrmn202 remaindernear  0.0E5  0   -> NaN Division_undefined\r
+ddrmn203 remaindernear  0.000  0   -> NaN Division_undefined\r
+ddrmn204 remaindernear  0.0001 0   -> NaN Invalid_operation\r
+ddrmn205 remaindernear  0.01   0   -> NaN Invalid_operation\r
+ddrmn206 remaindernear  0.1    0   -> NaN Invalid_operation\r
+ddrmn207 remaindernear  1      0   -> NaN Invalid_operation\r
+ddrmn208 remaindernear  1      0.0 -> NaN Invalid_operation\r
+ddrmn209 remaindernear 10      0.0 -> NaN Invalid_operation\r
+ddrmn210 remaindernear 1E+100  0.0 -> NaN Invalid_operation\r
+ddrmn211 remaindernear 1E+380  0   -> NaN Invalid_operation\r
+\r
+-- tests from the extended specification\r
+ddrmn221 remaindernear 2.1     3   -> -0.9\r
+ddrmn222 remaindernear  10     6   -> -2\r
+ddrmn223 remaindernear  10     3   ->  1\r
+ddrmn224 remaindernear -10     3   -> -1\r
+ddrmn225 remaindernear  10.2   1   -> 0.2\r
+ddrmn226 remaindernear  10     0.3 -> 0.1\r
+ddrmn227 remaindernear   3.6   1.3 -> -0.3\r
+\r
+-- some differences from remainder\r
+ddrmn231 remaindernear  -0.4  1.020 -> -0.400\r
+ddrmn232 remaindernear  -0.50 1.020 -> -0.500\r
+ddrmn233 remaindernear  -0.51 1.020 -> -0.510\r
+ddrmn234 remaindernear  -0.52 1.020 ->  0.500\r
+ddrmn235 remaindernear  -0.6  1.020 ->  0.420\r
+\r
+-- high Xs\r
+ddrmn240 remaindernear  1E+2  1.00  ->  0.00\r
+\r
+-- ddrmn3xx are from DiagBigDecimal\r
+ddrmn301 remaindernear   1    3     ->  1\r
+ddrmn302 remaindernear   5    5     ->  0\r
+ddrmn303 remaindernear   13   10    ->  3\r
+ddrmn304 remaindernear   13   50    ->  13\r
+ddrmn305 remaindernear   13   100   ->  13\r
+ddrmn306 remaindernear   13   1000  ->  13\r
+ddrmn307 remaindernear   .13    1   ->  0.13\r
+ddrmn308 remaindernear   0.133  1   ->  0.133\r
+ddrmn309 remaindernear   0.1033 1   ->  0.1033\r
+ddrmn310 remaindernear   1.033  1   ->  0.033\r
+ddrmn311 remaindernear   10.33  1   ->  0.33\r
+ddrmn312 remaindernear   10.33 10   ->  0.33\r
+ddrmn313 remaindernear   103.3  1   ->  0.3\r
+ddrmn314 remaindernear   133   10   ->  3\r
+ddrmn315 remaindernear   1033  10   ->  3\r
+ddrmn316 remaindernear   1033  50   -> -17\r
+ddrmn317 remaindernear   101.0  3   -> -1.0\r
+ddrmn318 remaindernear   102.0  3   ->  0.0\r
+ddrmn319 remaindernear   103.0  3   ->  1.0\r
+ddrmn320 remaindernear   2.40   1   ->  0.40\r
+ddrmn321 remaindernear   2.400  1   ->  0.400\r
+ddrmn322 remaindernear   2.4    1   ->  0.4\r
+ddrmn323 remaindernear   2.4    2   ->  0.4\r
+ddrmn324 remaindernear   2.400  2   ->  0.400\r
+ddrmn325 remaindernear   1   0.3    ->  0.1\r
+ddrmn326 remaindernear   1   0.30   ->  0.10\r
+ddrmn327 remaindernear   1   0.300  ->  0.100\r
+ddrmn328 remaindernear   1   0.3000 ->  0.1000\r
+ddrmn329 remaindernear   1.0    0.3 ->  0.1\r
+ddrmn330 remaindernear   1.00   0.3 ->  0.10\r
+ddrmn331 remaindernear   1.000  0.3 ->  0.100\r
+ddrmn332 remaindernear   1.0000 0.3 ->  0.1000\r
+ddrmn333 remaindernear   0.5  2     ->  0.5\r
+ddrmn334 remaindernear   0.5  2.1   ->  0.5\r
+ddrmn335 remaindernear   0.5  2.01  ->  0.50\r
+ddrmn336 remaindernear   0.5  2.001 ->  0.500\r
+ddrmn337 remaindernear   0.50 2     ->  0.50\r
+ddrmn338 remaindernear   0.50 2.01  ->  0.50\r
+ddrmn339 remaindernear   0.50 2.001 ->  0.500\r
+\r
+ddrmn340 remaindernear   0.5   0.5000001    ->  -1E-7\r
+ddrmn341 remaindernear   0.5   0.50000001    ->  -1E-8\r
+ddrmn342 remaindernear   0.5   0.500000001    ->  -1E-9\r
+ddrmn343 remaindernear   0.5   0.5000000001    ->  -1E-10\r
+ddrmn344 remaindernear   0.5   0.50000000001    ->  -1E-11\r
+ddrmn345 remaindernear   0.5   0.4999999    ->  1E-7\r
+ddrmn346 remaindernear   0.5   0.49999999    ->  1E-8\r
+ddrmn347 remaindernear   0.5   0.499999999    ->  1E-9\r
+ddrmn348 remaindernear   0.5   0.4999999999    ->  1E-10\r
+ddrmn349 remaindernear   0.5   0.49999999999    ->  1E-11\r
+ddrmn350 remaindernear   0.5   0.499999999999    ->  1E-12\r
+\r
+ddrmn351 remaindernear   0.03  7  ->  0.03\r
+ddrmn352 remaindernear   5   2    ->  1\r
+ddrmn353 remaindernear   4.1   2    ->  0.1\r
+ddrmn354 remaindernear   4.01   2    ->  0.01\r
+ddrmn355 remaindernear   4.001   2    ->  0.001\r
+ddrmn356 remaindernear   4.0001   2    ->  0.0001\r
+ddrmn357 remaindernear   4.00001   2    ->  0.00001\r
+ddrmn358 remaindernear   4.000001   2    ->  0.000001\r
+ddrmn359 remaindernear   4.0000001   2    ->  1E-7\r
+\r
+ddrmn360 remaindernear   1.2   0.7345 -> -0.2690\r
+ddrmn361 remaindernear   0.8   12     ->  0.8\r
+ddrmn362 remaindernear   0.8   0.2    ->  0.0\r
+ddrmn363 remaindernear   0.8   0.3    -> -0.1\r
+ddrmn364 remaindernear   0.800   12   ->  0.800\r
+ddrmn365 remaindernear   0.800   1.7  ->  0.800\r
+ddrmn366 remaindernear   2.400   2    ->  0.400\r
+\r
+-- round to even\r
+ddrmn371 remaindernear   121     2    ->  1\r
+ddrmn372 remaindernear   122     2    ->  0\r
+ddrmn373 remaindernear   123     2    -> -1\r
+ddrmn374 remaindernear   124     2    ->  0\r
+ddrmn375 remaindernear   125     2    ->  1\r
+ddrmn376 remaindernear   126     2    ->  0\r
+ddrmn377 remaindernear   127     2    -> -1\r
+\r
+ddrmn381 remaindernear 12345  1         ->  0\r
+ddrmn382 remaindernear 12345  1.0001    -> -0.2344\r
+ddrmn383 remaindernear 12345  1.001     -> -0.333\r
+ddrmn384 remaindernear 12345  1.01      -> -0.23\r
+ddrmn385 remaindernear 12345  1.1       -> -0.3\r
+ddrmn386 remaindernear 12355  4         -> -1\r
+ddrmn387 remaindernear 12345  4         ->  1\r
+ddrmn388 remaindernear 12355  4.0001    -> -1.3089\r
+ddrmn389 remaindernear 12345  4.0001    ->  0.6914\r
+ddrmn390 remaindernear 12345  4.9       ->  1.9\r
+ddrmn391 remaindernear 12345  4.99      -> -0.26\r
+ddrmn392 remaindernear 12345  4.999     ->  2.469\r
+ddrmn393 remaindernear 12345  4.9999    ->  0.2469\r
+ddrmn394 remaindernear 12345  5         ->  0\r
+ddrmn395 remaindernear 12345  5.0001    -> -0.2469\r
+ddrmn396 remaindernear 12345  5.001     -> -2.469\r
+ddrmn397 remaindernear 12345  5.01      ->  0.36\r
+ddrmn398 remaindernear 12345  5.1       -> -2.1\r
+\r
+-- the nasty division-by-1 cases\r
+ddrmn401 remaindernear   0.4         1   ->  0.4\r
+ddrmn402 remaindernear   0.45        1   ->  0.45\r
+ddrmn403 remaindernear   0.455       1   ->  0.455\r
+ddrmn404 remaindernear   0.4555      1   ->  0.4555\r
+ddrmn405 remaindernear   0.45555     1   ->  0.45555\r
+ddrmn406 remaindernear   0.455555    1   ->  0.455555\r
+ddrmn407 remaindernear   0.4555555   1   ->  0.4555555\r
+ddrmn408 remaindernear   0.45555555  1   ->  0.45555555\r
+ddrmn409 remaindernear   0.455555555 1   ->  0.455555555\r
+-- with spill... [412 exercises sticktab loop]\r
+ddrmn411 remaindernear   0.5         1   ->  0.5\r
+ddrmn412 remaindernear   0.55        1   -> -0.45\r
+ddrmn413 remaindernear   0.555       1   -> -0.445\r
+ddrmn414 remaindernear   0.5555      1   -> -0.4445\r
+ddrmn415 remaindernear   0.55555     1   -> -0.44445\r
+ddrmn416 remaindernear   0.555555    1   -> -0.444445\r
+ddrmn417 remaindernear   0.5555555   1   -> -0.4444445\r
+ddrmn418 remaindernear   0.55555555  1   -> -0.44444445\r
+ddrmn419 remaindernear   0.555555555 1   -> -0.444444445\r
+\r
+-- folddowns\r
+ddrmn421 remaindernear   1E+384       1  ->   NaN Division_impossible\r
+ddrmn422 remaindernear   1E+384  1E+383  ->   0E+369 Clamped\r
+ddrmn423 remaindernear   1E+384  2E+383  ->   0E+369 Clamped\r
+ddrmn424 remaindernear   1E+384  3E+383  ->   1.00000000000000E+383 Clamped\r
+ddrmn425 remaindernear   1E+384  4E+383  ->   2.00000000000000E+383 Clamped\r
+ddrmn426 remaindernear   1E+384  5E+383  ->   0E+369 Clamped\r
+ddrmn427 remaindernear   1E+384  6E+383  ->  -2.00000000000000E+383 Clamped\r
+ddrmn428 remaindernear   1E+384  7E+383  ->   3.00000000000000E+383 Clamped\r
+ddrmn429 remaindernear   1E+384  8E+383  ->   2.00000000000000E+383 Clamped\r
+ddrmn430 remaindernear   1E+384  9E+383  ->   1.00000000000000E+383 Clamped\r
+-- tinies\r
+ddrmn431 remaindernear   1E-397  1E-398  ->   0E-398\r
+ddrmn432 remaindernear   1E-397  2E-398  ->   0E-398\r
+ddrmn433 remaindernear   1E-397  3E-398  ->   1E-398 Subnormal\r
+ddrmn434 remaindernear   1E-397  4E-398  ->   2E-398 Subnormal\r
+ddrmn435 remaindernear   1E-397  5E-398  ->   0E-398\r
+ddrmn436 remaindernear   1E-397  6E-398  ->  -2E-398 Subnormal\r
+ddrmn437 remaindernear   1E-397  7E-398  ->   3E-398 Subnormal\r
+ddrmn438 remaindernear   1E-397  8E-398  ->   2E-398 Subnormal\r
+ddrmn439 remaindernear   1E-397  9E-398  ->   1E-398 Subnormal\r
+ddrmn440 remaindernear   1E-397 10E-398  ->   0E-398\r
+ddrmn441 remaindernear   1E-397 11E-398  ->  -1E-398 Subnormal\r
+ddrmn442 remaindernear 100E-397 11E-398  ->  -1E-398 Subnormal\r
+ddrmn443 remaindernear 100E-397 20E-398  ->   0E-398\r
+ddrmn444 remaindernear 100E-397 21E-398  ->  -8E-398 Subnormal\r
+ddrmn445 remaindernear 100E-397 30E-398  -> 1.0E-397 Subnormal\r
+\r
+-- zero signs\r
+ddrmn650 remaindernear  1  1 ->  0\r
+ddrmn651 remaindernear -1  1 -> -0\r
+ddrmn652 remaindernear  1 -1 ->  0\r
+ddrmn653 remaindernear -1 -1 -> -0\r
+ddrmn654 remaindernear  0  1 ->  0\r
+ddrmn655 remaindernear -0  1 -> -0\r
+ddrmn656 remaindernear  0 -1 ->  0\r
+ddrmn657 remaindernear -0 -1 -> -0\r
+ddrmn658 remaindernear  0.00  1  ->  0.00\r
+ddrmn659 remaindernear -0.00  1  -> -0.00\r
+\r
+-- Specials\r
+ddrmn680 remaindernear  Inf  -Inf   ->  NaN Invalid_operation\r
+ddrmn681 remaindernear  Inf  -1000  ->  NaN Invalid_operation\r
+ddrmn682 remaindernear  Inf  -1     ->  NaN Invalid_operation\r
+ddrmn683 remaindernear  Inf   0     ->  NaN Invalid_operation\r
+ddrmn684 remaindernear  Inf  -0     ->  NaN Invalid_operation\r
+ddrmn685 remaindernear  Inf   1     ->  NaN Invalid_operation\r
+ddrmn686 remaindernear  Inf   1000  ->  NaN Invalid_operation\r
+ddrmn687 remaindernear  Inf   Inf   ->  NaN Invalid_operation\r
+ddrmn688 remaindernear -1000  Inf   -> -1000\r
+ddrmn689 remaindernear -Inf   Inf   ->  NaN Invalid_operation\r
+ddrmn691 remaindernear -1     Inf   -> -1\r
+ddrmn692 remaindernear  0     Inf   ->  0\r
+ddrmn693 remaindernear -0     Inf   -> -0\r
+ddrmn694 remaindernear  1     Inf   ->  1\r
+ddrmn695 remaindernear  1000  Inf   ->  1000\r
+ddrmn696 remaindernear  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+ddrmn700 remaindernear -Inf  -Inf   ->  NaN Invalid_operation\r
+ddrmn701 remaindernear -Inf  -1000  ->  NaN Invalid_operation\r
+ddrmn702 remaindernear -Inf  -1     ->  NaN Invalid_operation\r
+ddrmn703 remaindernear -Inf  -0     ->  NaN Invalid_operation\r
+ddrmn704 remaindernear -Inf   0     ->  NaN Invalid_operation\r
+ddrmn705 remaindernear -Inf   1     ->  NaN Invalid_operation\r
+ddrmn706 remaindernear -Inf   1000  ->  NaN Invalid_operation\r
+ddrmn707 remaindernear -Inf   Inf   ->  NaN Invalid_operation\r
+ddrmn708 remaindernear -Inf  -Inf   ->  NaN Invalid_operation\r
+ddrmn709 remaindernear -1000  Inf   -> -1000\r
+ddrmn710 remaindernear -1    -Inf   -> -1\r
+ddrmn711 remaindernear -0    -Inf   -> -0\r
+ddrmn712 remaindernear  0    -Inf   ->  0\r
+ddrmn713 remaindernear  1    -Inf   ->  1\r
+ddrmn714 remaindernear  1000 -Inf   ->  1000\r
+ddrmn715 remaindernear  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+ddrmn721 remaindernear  NaN -Inf    ->  NaN\r
+ddrmn722 remaindernear  NaN -1000   ->  NaN\r
+ddrmn723 remaindernear  NaN -1      ->  NaN\r
+ddrmn724 remaindernear  NaN -0      ->  NaN\r
+ddrmn725 remaindernear -NaN  0      -> -NaN\r
+ddrmn726 remaindernear  NaN  1      ->  NaN\r
+ddrmn727 remaindernear  NaN  1000   ->  NaN\r
+ddrmn728 remaindernear  NaN  Inf    ->  NaN\r
+ddrmn729 remaindernear  NaN -NaN    ->  NaN\r
+ddrmn730 remaindernear -Inf  NaN    ->  NaN\r
+ddrmn731 remaindernear -1000 NaN    ->  NaN\r
+ddrmn732 remaindernear -1    NaN    ->  NaN\r
+ddrmn733 remaindernear -0   -NaN    -> -NaN\r
+ddrmn734 remaindernear  0    NaN    ->  NaN\r
+ddrmn735 remaindernear  1   -NaN    -> -NaN\r
+ddrmn736 remaindernear  1000 NaN    ->  NaN\r
+ddrmn737 remaindernear  Inf  NaN    ->  NaN\r
+\r
+ddrmn741 remaindernear  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddrmn742 remaindernear  sNaN -1000  ->  NaN  Invalid_operation\r
+ddrmn743 remaindernear -sNaN -1     -> -NaN  Invalid_operation\r
+ddrmn744 remaindernear  sNaN -0     ->  NaN  Invalid_operation\r
+ddrmn745 remaindernear  sNaN  0     ->  NaN  Invalid_operation\r
+ddrmn746 remaindernear  sNaN  1     ->  NaN  Invalid_operation\r
+ddrmn747 remaindernear  sNaN  1000  ->  NaN  Invalid_operation\r
+ddrmn749 remaindernear  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddrmn750 remaindernear  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddrmn751 remaindernear  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddrmn752 remaindernear -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddrmn753 remaindernear -1000 sNaN   ->  NaN  Invalid_operation\r
+ddrmn754 remaindernear -1    sNaN   ->  NaN  Invalid_operation\r
+ddrmn755 remaindernear -0    sNaN   ->  NaN  Invalid_operation\r
+ddrmn756 remaindernear  0    sNaN   ->  NaN  Invalid_operation\r
+ddrmn757 remaindernear  1    sNaN   ->  NaN  Invalid_operation\r
+ddrmn758 remaindernear  1000 sNaN   ->  NaN  Invalid_operation\r
+ddrmn759 remaindernear  Inf -sNaN   -> -NaN  Invalid_operation\r
+\r
+-- propaging NaNs\r
+ddrmn760 remaindernear  NaN1   NaN7   ->  NaN1\r
+ddrmn761 remaindernear sNaN2   NaN8   ->  NaN2 Invalid_operation\r
+ddrmn762 remaindernear  NaN3  sNaN9   ->  NaN9 Invalid_operation\r
+ddrmn763 remaindernear sNaN4  sNaN10  ->  NaN4 Invalid_operation\r
+ddrmn764 remaindernear    15   NaN11  ->  NaN11\r
+ddrmn765 remaindernear  NaN6   NaN12  ->  NaN6\r
+ddrmn766 remaindernear  Inf    NaN13  ->  NaN13\r
+ddrmn767 remaindernear  NaN14  -Inf   ->  NaN14\r
+ddrmn768 remaindernear    0    NaN15  ->  NaN15\r
+ddrmn769 remaindernear  NaN16   -0    ->  NaN16\r
+\r
+-- edge cases of impossible\r
+ddrmn770  remaindernear  1234567890123456  10    -> -4\r
+ddrmn771  remaindernear  1234567890123456   1    ->  0\r
+ddrmn772  remaindernear  1234567890123456   0.1  ->  NaN Division_impossible\r
+ddrmn773  remaindernear  1234567890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- long operand checks\r
+ddrmn801 remaindernear 12345678000 100 -> 0\r
+ddrmn802 remaindernear 1 12345678000   -> 1\r
+ddrmn803 remaindernear 1234567800  10  -> 0\r
+ddrmn804 remaindernear 1 1234567800    -> 1\r
+ddrmn805 remaindernear 1234567890  10  -> 0\r
+ddrmn806 remaindernear 1 1234567890    -> 1\r
+ddrmn807 remaindernear 1234567891  10  -> 1\r
+ddrmn808 remaindernear 1 1234567891    -> 1\r
+ddrmn809 remaindernear 12345678901 100 -> 1\r
+ddrmn810 remaindernear 1 12345678901   -> 1\r
+ddrmn811 remaindernear 1234567896  10  -> -4\r
+ddrmn812 remaindernear 1 1234567896    -> 1\r
+\r
+ddrmn821 remaindernear 12345678000 100 -> 0\r
+ddrmn822 remaindernear 1 12345678000   -> 1\r
+ddrmn823 remaindernear 1234567800  10  -> 0\r
+ddrmn824 remaindernear 1 1234567800    -> 1\r
+ddrmn825 remaindernear 1234567890  10  -> 0\r
+ddrmn826 remaindernear 1 1234567890    -> 1\r
+ddrmn827 remaindernear 1234567891  10  -> 1\r
+ddrmn828 remaindernear 1 1234567891    -> 1\r
+ddrmn829 remaindernear 12345678901 100 -> 1\r
+ddrmn830 remaindernear 1 12345678901   -> 1\r
+ddrmn831 remaindernear 1234567896  10  -> -4\r
+ddrmn832 remaindernear 1 1234567896    -> 1\r
+\r
+-- from divideint\r
+ddrmn840 remaindernear  100000000.0   1  ->  0.0\r
+ddrmn841 remaindernear  100000000.4   1  ->  0.4\r
+ddrmn842 remaindernear  100000000.5   1  ->  0.5\r
+ddrmn843 remaindernear  100000000.9   1  -> -0.1\r
+ddrmn844 remaindernear  100000000.999 1  -> -0.001\r
+ddrmn850 remaindernear  100000003     5  -> -2\r
+ddrmn851 remaindernear  10000003      5  -> -2\r
+ddrmn852 remaindernear  1000003       5  -> -2\r
+ddrmn853 remaindernear  100003        5  -> -2\r
+ddrmn854 remaindernear  10003         5  -> -2\r
+ddrmn855 remaindernear  1003          5  -> -2\r
+ddrmn856 remaindernear  103           5  -> -2\r
+ddrmn857 remaindernear  13            5  -> -2\r
+ddrmn858 remaindernear  1             5  ->  1\r
+\r
+-- Vladimir's cases         1234567890123456\r
+ddrmn860 remaindernear 123.0e1 1000000000000000  -> 1230\r
+ddrmn861 remaindernear 1230    1000000000000000  -> 1230\r
+ddrmn862 remaindernear 12.3e2  1000000000000000  -> 1230\r
+ddrmn863 remaindernear 1.23e3  1000000000000000  -> 1230\r
+ddrmn864 remaindernear 123e1   1000000000000000  -> 1230\r
+ddrmn870 remaindernear 123e1    1000000000000000 -> 1230\r
+ddrmn871 remaindernear 123e1     100000000000000 -> 1230\r
+ddrmn872 remaindernear 123e1      10000000000000 -> 1230\r
+ddrmn873 remaindernear 123e1       1000000000000 -> 1230\r
+ddrmn874 remaindernear 123e1        100000000000 -> 1230\r
+ddrmn875 remaindernear 123e1         10000000000 -> 1230\r
+ddrmn876 remaindernear 123e1          1000000000 -> 1230\r
+ddrmn877 remaindernear 123e1           100000000 -> 1230\r
+ddrmn878 remaindernear 1230            100000000 -> 1230\r
+ddrmn879 remaindernear 123e1            10000000 -> 1230\r
+ddrmn880 remaindernear 123e1             1000000 -> 1230\r
+ddrmn881 remaindernear 123e1              100000 -> 1230\r
+ddrmn882 remaindernear 123e1               10000 -> 1230\r
+ddrmn883 remaindernear 123e1                1000 ->  230\r
+ddrmn884 remaindernear 123e1                 100 ->   30\r
+ddrmn885 remaindernear 123e1                  10 ->    0\r
+ddrmn886 remaindernear 123e1                   1 ->    0\r
+\r
+ddrmn890 remaindernear 123e1    2000000000000000 -> 1230\r
+ddrmn891 remaindernear 123e1     200000000000000 -> 1230\r
+ddrmn892 remaindernear 123e1      20000000000000 -> 1230\r
+ddrmn893 remaindernear 123e1       2000000000000 -> 1230\r
+ddrmn894 remaindernear 123e1        200000000000 -> 1230\r
+ddrmn895 remaindernear 123e1         20000000000 -> 1230\r
+ddrmn896 remaindernear 123e1          2000000000 -> 1230\r
+ddrmn897 remaindernear 123e1           200000000 -> 1230\r
+ddrmn899 remaindernear 123e1            20000000 -> 1230\r
+ddrmn900 remaindernear 123e1             2000000 -> 1230\r
+ddrmn901 remaindernear 123e1              200000 -> 1230\r
+ddrmn902 remaindernear 123e1               20000 -> 1230\r
+ddrmn903 remaindernear 123e1                2000 -> -770\r
+ddrmn904 remaindernear 123e1                 200 ->   30\r
+ddrmn905 remaindernear 123e1                  20 ->  -10\r
+ddrmn906 remaindernear 123e1                   2 ->    0\r
+\r
+ddrmn910 remaindernear 123e1    5000000000000000 -> 1230\r
+ddrmn911 remaindernear 123e1     500000000000000 -> 1230\r
+ddrmn912 remaindernear 123e1      50000000000000 -> 1230\r
+ddrmn913 remaindernear 123e1       5000000000000 -> 1230\r
+ddrmn914 remaindernear 123e1        500000000000 -> 1230\r
+ddrmn915 remaindernear 123e1         50000000000 -> 1230\r
+ddrmn916 remaindernear 123e1          5000000000 -> 1230\r
+ddrmn917 remaindernear 123e1           500000000 -> 1230\r
+ddrmn919 remaindernear 123e1            50000000 -> 1230\r
+ddrmn920 remaindernear 123e1             5000000 -> 1230\r
+ddrmn921 remaindernear 123e1              500000 -> 1230\r
+ddrmn922 remaindernear 123e1               50000 -> 1230\r
+ddrmn923 remaindernear 123e1                5000 -> 1230\r
+ddrmn924 remaindernear 123e1                 500 ->  230\r
+ddrmn925 remaindernear 123e1                  50 ->  -20\r
+ddrmn926 remaindernear 123e1                   5 ->    0\r
+\r
+ddrmn930 remaindernear 123e1    9000000000000000 -> 1230\r
+ddrmn931 remaindernear 123e1     900000000000000 -> 1230\r
+ddrmn932 remaindernear 123e1      90000000000000 -> 1230\r
+ddrmn933 remaindernear 123e1       9000000000000 -> 1230\r
+ddrmn934 remaindernear 123e1        900000000000 -> 1230\r
+ddrmn935 remaindernear 123e1         90000000000 -> 1230\r
+ddrmn936 remaindernear 123e1          9000000000 -> 1230\r
+ddrmn937 remaindernear 123e1           900000000 -> 1230\r
+ddrmn939 remaindernear 123e1            90000000 -> 1230\r
+ddrmn940 remaindernear 123e1             9000000 -> 1230\r
+ddrmn941 remaindernear 123e1              900000 -> 1230\r
+ddrmn942 remaindernear 123e1               90000 -> 1230\r
+ddrmn943 remaindernear 123e1                9000 -> 1230\r
+ddrmn944 remaindernear 123e1                 900 ->  330\r
+ddrmn945 remaindernear 123e1                  90 ->  -30\r
+ddrmn946 remaindernear 123e1                   9 ->   -3\r
+\r
+ddrmn950 remaindernear 123e1   1000000000000000 -> 1230\r
+ddrmn961 remaindernear 123e1   2999999999999999 -> 1230\r
+ddrmn962 remaindernear 123e1   3999999999999999 -> 1230\r
+ddrmn963 remaindernear 123e1   4999999999999999 -> 1230\r
+ddrmn964 remaindernear 123e1   5999999999999999 -> 1230\r
+ddrmn965 remaindernear 123e1   6999999999999999 -> 1230\r
+ddrmn966 remaindernear 123e1   7999999999999999 -> 1230\r
+ddrmn967 remaindernear 123e1   8999999999999999 -> 1230\r
+ddrmn968 remaindernear 123e1   9999999999999999 -> 1230\r
+ddrmn969 remaindernear 123e1   9876543210987654 -> 1230\r
+\r
+ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally\r
+\r
+-- overflow and underflow tests [from divide]\r
+ddrmn1051 remaindernear  1e+277  1e-311 ->  NaN Division_impossible\r
+ddrmn1052 remaindernear  1e+277 -1e-311 ->  NaN Division_impossible\r
+ddrmn1053 remaindernear -1e+277  1e-311 ->  NaN Division_impossible\r
+ddrmn1054 remaindernear -1e+277 -1e-311 ->  NaN Division_impossible\r
+ddrmn1055 remaindernear  1e-277  1e+311 ->  1E-277\r
+ddrmn1056 remaindernear  1e-277 -1e+311 ->  1E-277\r
+ddrmn1057 remaindernear -1e-277  1e+311 -> -1E-277\r
+ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277\r
+\r
+-- Null tests\r
+ddrmn1000 remaindernear 10  # -> NaN Invalid_operation\r
+ddrmn1001 remaindernear  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/ddRotate.decTest b/Lib/test/decimaltestdata/ddRotate.decTest
new file mode 100644 (file)
index 0000000..473f2f6
--- /dev/null
@@ -0,0 +1,262 @@
+------------------------------------------------------------------------\r
+-- ddRotate.decTest -- rotate a decDouble coefficient left or right   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddrot001 rotate                 0    0  ->  0\r
+ddrot002 rotate                 0    2  ->  0\r
+ddrot003 rotate                 1    2  ->  100\r
+ddrot004 rotate                 1   15  ->  1000000000000000\r
+ddrot005 rotate                 1   16  ->  1\r
+ddrot006 rotate                 1   -1  ->  1000000000000000\r
+ddrot007 rotate                 0   -2  ->  0\r
+ddrot008 rotate  1234567890123456   -1  ->  6123456789012345\r
+ddrot009 rotate  1234567890123456   -15 ->  2345678901234561\r
+ddrot010 rotate  1234567890123456   -16 ->  1234567890123456\r
+ddrot011 rotate  9934567890123456   -15 ->  9345678901234569\r
+ddrot012 rotate  9934567890123456   -16 ->  9934567890123456\r
+\r
+-- rhs must be an integer\r
+ddrot015 rotate        1    1.5    -> NaN Invalid_operation\r
+ddrot016 rotate        1    1.0    -> NaN Invalid_operation\r
+ddrot017 rotate        1    0.1    -> NaN Invalid_operation\r
+ddrot018 rotate        1    0.0    -> NaN Invalid_operation\r
+ddrot019 rotate        1    1E+1   -> NaN Invalid_operation\r
+ddrot020 rotate        1    1E+99  -> NaN Invalid_operation\r
+ddrot021 rotate        1    Inf    -> NaN Invalid_operation\r
+ddrot022 rotate        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+ddrot025 rotate        1    -1000  -> NaN Invalid_operation\r
+ddrot026 rotate        1    -17    -> NaN Invalid_operation\r
+ddrot027 rotate        1     17    -> NaN Invalid_operation\r
+ddrot028 rotate        1     1000  -> NaN Invalid_operation\r
+\r
+-- full pattern\r
+ddrot030 rotate  1234567890123456         -16  -> 1234567890123456\r
+ddrot031 rotate  1234567890123456         -15  -> 2345678901234561\r
+ddrot032 rotate  1234567890123456         -14  -> 3456789012345612\r
+ddrot033 rotate  1234567890123456         -13  -> 4567890123456123\r
+ddrot034 rotate  1234567890123456         -12  -> 5678901234561234\r
+ddrot035 rotate  1234567890123456         -11  -> 6789012345612345\r
+ddrot036 rotate  1234567890123456         -10  -> 7890123456123456\r
+ddrot037 rotate  1234567890123456         -9   -> 8901234561234567\r
+ddrot038 rotate  1234567890123456         -8   -> 9012345612345678\r
+ddrot039 rotate  1234567890123456         -7   ->  123456123456789\r
+ddrot040 rotate  1234567890123456         -6   -> 1234561234567890\r
+ddrot041 rotate  1234567890123456         -5   -> 2345612345678901\r
+ddrot042 rotate  1234567890123456         -4   -> 3456123456789012\r
+ddrot043 rotate  1234567890123456         -3   -> 4561234567890123\r
+ddrot044 rotate  1234567890123456         -2   -> 5612345678901234\r
+ddrot045 rotate  1234567890123456         -1   -> 6123456789012345\r
+ddrot046 rotate  1234567890123456         -0   -> 1234567890123456\r
+\r
+ddrot047 rotate  1234567890123456         +0   -> 1234567890123456\r
+ddrot048 rotate  1234567890123456         +1   -> 2345678901234561\r
+ddrot049 rotate  1234567890123456         +2   -> 3456789012345612\r
+ddrot050 rotate  1234567890123456         +3   -> 4567890123456123\r
+ddrot051 rotate  1234567890123456         +4   -> 5678901234561234\r
+ddrot052 rotate  1234567890123456         +5   -> 6789012345612345\r
+ddrot053 rotate  1234567890123456         +6   -> 7890123456123456\r
+ddrot054 rotate  1234567890123456         +7   -> 8901234561234567\r
+ddrot055 rotate  1234567890123456         +8   -> 9012345612345678\r
+ddrot056 rotate  1234567890123456         +9   ->  123456123456789\r
+ddrot057 rotate  1234567890123456         +10  -> 1234561234567890\r
+ddrot058 rotate  1234567890123456         +11  -> 2345612345678901\r
+ddrot059 rotate  1234567890123456         +12  -> 3456123456789012\r
+ddrot060 rotate  1234567890123456         +13  -> 4561234567890123\r
+ddrot061 rotate  1234567890123456         +14  -> 5612345678901234\r
+ddrot062 rotate  1234567890123456         +15  -> 6123456789012345\r
+ddrot063 rotate  1234567890123456         +16  -> 1234567890123456\r
+\r
+-- zeros\r
+ddrot070 rotate  0E-10              +9   ->   0E-10\r
+ddrot071 rotate  0E-10              -9   ->   0E-10\r
+ddrot072 rotate  0.000              +9   ->   0.000\r
+ddrot073 rotate  0.000              -9   ->   0.000\r
+ddrot074 rotate  0E+10              +9   ->   0E+10\r
+ddrot075 rotate  0E+10              -9   ->   0E+10\r
+ddrot076 rotate -0E-10              +9   ->  -0E-10\r
+ddrot077 rotate -0E-10              -9   ->  -0E-10\r
+ddrot078 rotate -0.000              +9   ->  -0.000\r
+ddrot079 rotate -0.000              -9   ->  -0.000\r
+ddrot080 rotate -0E+10              +9   ->  -0E+10\r
+ddrot081 rotate -0E+10              -9   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddrot141 rotate  9.999999999999999E+384     -1  -> 9.999999999999999E+384\r
+ddrot142 rotate  9.999999999999999E+384     -15 -> 9.999999999999999E+384\r
+ddrot143 rotate  9.999999999999999E+384      1  -> 9.999999999999999E+384\r
+ddrot144 rotate  9.999999999999999E+384      15 -> 9.999999999999999E+384\r
+ddrot145 rotate  1E-383                     -1  -> 1.000000000000000E-368\r
+ddrot146 rotate  1E-383                     -15 -> 1.0E-382\r
+ddrot147 rotate  1E-383                      1  -> 1.0E-382\r
+ddrot148 rotate  1E-383                      15 -> 1.000000000000000E-368\r
+ddrot151 rotate  1.000000000000000E-383     -1  -> 1.00000000000000E-384\r
+ddrot152 rotate  1.000000000000000E-383     -15 -> 1E-398\r
+ddrot153 rotate  1.000000000000000E-383      1  -> 1E-398\r
+ddrot154 rotate  1.000000000000000E-383      15 -> 1.00000000000000E-384\r
+ddrot155 rotate  9.000000000000000E-383     -1  -> 9.00000000000000E-384\r
+ddrot156 rotate  9.000000000000000E-383     -15 -> 9E-398\r
+ddrot157 rotate  9.000000000000000E-383      1  -> 9E-398\r
+ddrot158 rotate  9.000000000000000E-383      15 -> 9.00000000000000E-384\r
+ddrot160 rotate  1E-398                     -1  -> 1.000000000000000E-383\r
+ddrot161 rotate  1E-398                     -15 -> 1.0E-397\r
+ddrot162 rotate  1E-398                      1  -> 1.0E-397\r
+ddrot163 rotate  1E-398                      15 -> 1.000000000000000E-383\r
+--  negatives\r
+ddrot171 rotate -9.999999999999999E+384     -1  -> -9.999999999999999E+384\r
+ddrot172 rotate -9.999999999999999E+384     -15 -> -9.999999999999999E+384\r
+ddrot173 rotate -9.999999999999999E+384      1  -> -9.999999999999999E+384\r
+ddrot174 rotate -9.999999999999999E+384      15 -> -9.999999999999999E+384\r
+ddrot175 rotate -1E-383                     -1  -> -1.000000000000000E-368\r
+ddrot176 rotate -1E-383                     -15 -> -1.0E-382\r
+ddrot177 rotate -1E-383                      1  -> -1.0E-382\r
+ddrot178 rotate -1E-383                      15 -> -1.000000000000000E-368\r
+ddrot181 rotate -1.000000000000000E-383     -1  -> -1.00000000000000E-384\r
+ddrot182 rotate -1.000000000000000E-383     -15 -> -1E-398\r
+ddrot183 rotate -1.000000000000000E-383      1  -> -1E-398\r
+ddrot184 rotate -1.000000000000000E-383      15 -> -1.00000000000000E-384\r
+ddrot185 rotate -9.000000000000000E-383     -1  -> -9.00000000000000E-384\r
+ddrot186 rotate -9.000000000000000E-383     -15 -> -9E-398\r
+ddrot187 rotate -9.000000000000000E-383      1  -> -9E-398\r
+ddrot188 rotate -9.000000000000000E-383      15 -> -9.00000000000000E-384\r
+ddrot190 rotate -1E-398                     -1  -> -1.000000000000000E-383\r
+ddrot191 rotate -1E-398                     -15 -> -1.0E-397\r
+ddrot192 rotate -1E-398                      1  -> -1.0E-397\r
+ddrot193 rotate -1E-398                      15 -> -1.000000000000000E-383\r
+\r
+-- more negatives (of sanities)\r
+ddrot201 rotate                -0    0  -> -0\r
+ddrot202 rotate                -0    2  -> -0\r
+ddrot203 rotate                -1    2  -> -100\r
+ddrot204 rotate                -1   15  -> -1000000000000000\r
+ddrot205 rotate                -1   16  -> -1\r
+ddrot206 rotate                -1   -1  -> -1000000000000000\r
+ddrot207 rotate                -0   -2  -> -0\r
+ddrot208 rotate -1234567890123456   -1  -> -6123456789012345\r
+ddrot209 rotate -1234567890123456   -15 -> -2345678901234561\r
+ddrot210 rotate -1234567890123456   -16 -> -1234567890123456\r
+ddrot211 rotate -9934567890123456   -15 -> -9345678901234569\r
+ddrot212 rotate -9934567890123456   -16 -> -9934567890123456\r
+\r
+\r
+-- Specials; NaNs are handled as usual\r
+ddrot781 rotate -Inf  -8     -> -Infinity\r
+ddrot782 rotate -Inf  -1     -> -Infinity\r
+ddrot783 rotate -Inf  -0     -> -Infinity\r
+ddrot784 rotate -Inf   0     -> -Infinity\r
+ddrot785 rotate -Inf   1     -> -Infinity\r
+ddrot786 rotate -Inf   8     -> -Infinity\r
+ddrot787 rotate -1000 -Inf   -> NaN Invalid_operation\r
+ddrot788 rotate -Inf  -Inf   -> NaN Invalid_operation\r
+ddrot789 rotate -1    -Inf   -> NaN Invalid_operation\r
+ddrot790 rotate -0    -Inf   -> NaN Invalid_operation\r
+ddrot791 rotate  0    -Inf   -> NaN Invalid_operation\r
+ddrot792 rotate  1    -Inf   -> NaN Invalid_operation\r
+ddrot793 rotate  1000 -Inf   -> NaN Invalid_operation\r
+ddrot794 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+ddrot800 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+ddrot801 rotate  Inf  -8     -> Infinity\r
+ddrot802 rotate  Inf  -1     -> Infinity\r
+ddrot803 rotate  Inf  -0     -> Infinity\r
+ddrot804 rotate  Inf   0     -> Infinity\r
+ddrot805 rotate  Inf   1     -> Infinity\r
+ddrot806 rotate  Inf   8     -> Infinity\r
+ddrot807 rotate  Inf   Inf   -> NaN Invalid_operation\r
+ddrot808 rotate -1000  Inf   -> NaN Invalid_operation\r
+ddrot809 rotate -Inf   Inf   -> NaN Invalid_operation\r
+ddrot810 rotate -1     Inf   -> NaN Invalid_operation\r
+ddrot811 rotate -0     Inf   -> NaN Invalid_operation\r
+ddrot812 rotate  0     Inf   -> NaN Invalid_operation\r
+ddrot813 rotate  1     Inf   -> NaN Invalid_operation\r
+ddrot814 rotate  1000  Inf   -> NaN Invalid_operation\r
+ddrot815 rotate  Inf   Inf   -> NaN Invalid_operation\r
+\r
+ddrot821 rotate  NaN -Inf    ->  NaN\r
+ddrot822 rotate  NaN -1000   ->  NaN\r
+ddrot823 rotate  NaN -1      ->  NaN\r
+ddrot824 rotate  NaN -0      ->  NaN\r
+ddrot825 rotate  NaN  0      ->  NaN\r
+ddrot826 rotate  NaN  1      ->  NaN\r
+ddrot827 rotate  NaN  1000   ->  NaN\r
+ddrot828 rotate  NaN  Inf    ->  NaN\r
+ddrot829 rotate  NaN  NaN    ->  NaN\r
+ddrot830 rotate -Inf  NaN    ->  NaN\r
+ddrot831 rotate -1000 NaN    ->  NaN\r
+ddrot832 rotate -1    NaN    ->  NaN\r
+ddrot833 rotate -0    NaN    ->  NaN\r
+ddrot834 rotate  0    NaN    ->  NaN\r
+ddrot835 rotate  1    NaN    ->  NaN\r
+ddrot836 rotate  1000 NaN    ->  NaN\r
+ddrot837 rotate  Inf  NaN    ->  NaN\r
+\r
+ddrot841 rotate  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddrot842 rotate  sNaN -1000  ->  NaN  Invalid_operation\r
+ddrot843 rotate  sNaN -1     ->  NaN  Invalid_operation\r
+ddrot844 rotate  sNaN -0     ->  NaN  Invalid_operation\r
+ddrot845 rotate  sNaN  0     ->  NaN  Invalid_operation\r
+ddrot846 rotate  sNaN  1     ->  NaN  Invalid_operation\r
+ddrot847 rotate  sNaN  1000  ->  NaN  Invalid_operation\r
+ddrot848 rotate  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddrot849 rotate  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddrot850 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddrot851 rotate -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddrot852 rotate -1000 sNaN   ->  NaN  Invalid_operation\r
+ddrot853 rotate -1    sNaN   ->  NaN  Invalid_operation\r
+ddrot854 rotate -0    sNaN   ->  NaN  Invalid_operation\r
+ddrot855 rotate  0    sNaN   ->  NaN  Invalid_operation\r
+ddrot856 rotate  1    sNaN   ->  NaN  Invalid_operation\r
+ddrot857 rotate  1000 sNaN   ->  NaN  Invalid_operation\r
+ddrot858 rotate  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddrot859 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddrot861 rotate  NaN1   -Inf    ->  NaN1\r
+ddrot862 rotate +NaN2   -1000   ->  NaN2\r
+ddrot863 rotate  NaN3    1000   ->  NaN3\r
+ddrot864 rotate  NaN4    Inf    ->  NaN4\r
+ddrot865 rotate  NaN5   +NaN6   ->  NaN5\r
+ddrot866 rotate -Inf     NaN7   ->  NaN7\r
+ddrot867 rotate -1000    NaN8   ->  NaN8\r
+ddrot868 rotate  1000    NaN9   ->  NaN9\r
+ddrot869 rotate  Inf    +NaN10  ->  NaN10\r
+ddrot871 rotate  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+ddrot872 rotate  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+ddrot873 rotate  sNaN13   1000  ->  NaN13  Invalid_operation\r
+ddrot874 rotate  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+ddrot875 rotate  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+ddrot876 rotate  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+ddrot877 rotate -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+ddrot878 rotate -1000    sNaN21 ->  NaN21  Invalid_operation\r
+ddrot879 rotate  1000    sNaN22 ->  NaN22  Invalid_operation\r
+ddrot880 rotate  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+ddrot881 rotate +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+ddrot882 rotate -NaN26    NaN28 -> -NaN26\r
+ddrot883 rotate -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+ddrot884 rotate  1000    -NaN30 -> -NaN30\r
+ddrot885 rotate  1000   -sNaN31 -> -NaN31  Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddSameQuantum.decTest b/Lib/test/decimaltestdata/ddSameQuantum.decTest
new file mode 100644 (file)
index 0000000..a396cd1
--- /dev/null
@@ -0,0 +1,389 @@
+------------------------------------------------------------------------\r
+-- ddSameQuantum.decTest -- check decDouble quantums match            --\r
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decDoubles.\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddsamq001 samequantum  0      0      ->  1\r
+ddsamq002 samequantum  0      1      ->  1\r
+ddsamq003 samequantum  1      0      ->  1\r
+ddsamq004 samequantum  1      1      ->  1\r
+\r
+ddsamq011 samequantum  10     1E+1   -> 0\r
+ddsamq012 samequantum  10E+1  10E+1  -> 1\r
+ddsamq013 samequantum  100    10E+1  -> 0\r
+ddsamq014 samequantum  100    1E+2   -> 0\r
+ddsamq015 samequantum  0.1    1E-2   -> 0\r
+ddsamq016 samequantum  0.1    1E-1   -> 1\r
+ddsamq017 samequantum  0.1    1E-0   -> 0\r
+ddsamq018 samequantum  999    999    -> 1\r
+ddsamq019 samequantum  999E-1 99.9   -> 1\r
+ddsamq020 samequantum  111E-1 22.2   -> 1\r
+ddsamq021 samequantum  111E-1 1234.2 -> 1\r
+\r
+-- zeros\r
+ddsamq030 samequantum  0.0    1.1    -> 1\r
+ddsamq031 samequantum  0.0    1.11   -> 0\r
+ddsamq032 samequantum  0.0    0      -> 0\r
+ddsamq033 samequantum  0.0    0.0    -> 1\r
+ddsamq034 samequantum  0.0    0.00   -> 0\r
+ddsamq035 samequantum  0E+1   0E+0   -> 0\r
+ddsamq036 samequantum  0E+1   0E+1   -> 1\r
+ddsamq037 samequantum  0E+1   0E+2   -> 0\r
+ddsamq038 samequantum  0E-17  0E-16  -> 0\r
+ddsamq039 samequantum  0E-17  0E-17  -> 1\r
+ddsamq040 samequantum  0E-17  0E-18  -> 0\r
+ddsamq041 samequantum  0E-17  0.0E-15 -> 0\r
+ddsamq042 samequantum  0E-17  0.0E-16 -> 1\r
+ddsamq043 samequantum  0E-17  0.0E-17 -> 0\r
+ddsamq044 samequantum -0E-17  0.0E-16 -> 1\r
+ddsamq045 samequantum  0E-17 -0.0E-17 -> 0\r
+ddsamq046 samequantum  0E-17 -0.0E-16 -> 1\r
+ddsamq047 samequantum -0E-17  0.0E-17 -> 0\r
+ddsamq048 samequantum -0E-17 -0.0E-16 -> 1\r
+ddsamq049 samequantum -0E-17 -0.0E-17 -> 0\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddsamq051 samequantum  9.999999999999999E+384    9.999999999999999E+384  -> 1\r
+ddsamq052 samequantum  1E-383             1E-383           -> 1\r
+ddsamq053 samequantum  1.000000000000000E-383    1.000000000000000E-383  -> 1\r
+ddsamq054 samequantum  1E-398             1E-398           -> 1\r
+ddsamq055 samequantum  9.999999999999999E+384    9.999999999999999E+384  -> 1\r
+ddsamq056 samequantum  1E-383             1E-383           -> 1\r
+ddsamq057 samequantum  1.000000000000000E-383    1.000000000000000E-383  -> 1\r
+ddsamq058 samequantum  1E-398             1E-398           -> 1\r
+\r
+ddsamq061 samequantum  -1E-398            -1E-398          -> 1\r
+ddsamq062 samequantum  -1.000000000000000E-383   -1.000000000000000E-383 -> 1\r
+ddsamq063 samequantum  -1E-383            -1E-383          -> 1\r
+ddsamq064 samequantum  -9.999999999999999E+384   -9.999999999999999E+384 -> 1\r
+ddsamq065 samequantum  -1E-398            -1E-398          -> 1\r
+ddsamq066 samequantum  -1.000000000000000E-383   -1.000000000000000E-383 -> 1\r
+ddsamq067 samequantum  -1E-383            -1E-383          -> 1\r
+ddsamq068 samequantum  -9.999999999999999E+384   -9.999999999999999E+384 -> 1\r
+\r
+ddsamq071 samequantum  -4E-398            -1E-398          -> 1\r
+ddsamq072 samequantum  -4.000000000000000E-383   -1.000040000000000E-383 -> 1\r
+ddsamq073 samequantum  -4E-383            -1E-383          -> 1\r
+ddsamq074 samequantum  -4.999999999999999E+384   -9.999999999949999E+384 -> 1\r
+ddsamq075 samequantum  -4E-398            -1E-398          -> 1\r
+ddsamq076 samequantum  -4.000000000000000E-383   -1.004000000000000E-383 -> 1\r
+ddsamq077 samequantum  -4E-383            -1E-383          -> 1\r
+ddsamq078 samequantum  -4.999999999999999E+384   -9.949999999999999E+384 -> 1\r
+\r
+ddsamq081 samequantum  -4E-397            -1E-398          -> 0\r
+ddsamq082 samequantum  -4.000000000000000E-383   -1.000040000000000E-336 -> 0\r
+ddsamq083 samequantum  -4E-346            -1E-383          -> 0\r
+ddsamq084 samequantum  -4.999999999999999E+384   -9.999499999999999E+336 -> 0\r
+ddsamq085 samequantum  -4E-397            -1E-398          -> 0\r
+ddsamq086 samequantum  -4.000000000000000E-383   -1.004000000000000E-336 -> 0\r
+ddsamq087 samequantum  -4E-346            -1E-383          -> 0\r
+ddsamq088 samequantum  -4.999999999999999E+384   -9.949999999999999E+336 -> 0\r
+\r
+-- specials & combinations\r
+ddsamq0110 samequantum  -Inf    -Inf   -> 1\r
+ddsamq0111 samequantum  -Inf     Inf   -> 1\r
+ddsamq0112 samequantum  -Inf     NaN   -> 0\r
+ddsamq0113 samequantum  -Inf    -7E+3  -> 0\r
+ddsamq0114 samequantum  -Inf    -7     -> 0\r
+ddsamq0115 samequantum  -Inf    -7E-3  -> 0\r
+ddsamq0116 samequantum  -Inf    -0E-3  -> 0\r
+ddsamq0117 samequantum  -Inf    -0     -> 0\r
+ddsamq0118 samequantum  -Inf    -0E+3  -> 0\r
+ddsamq0119 samequantum  -Inf     0E-3  -> 0\r
+ddsamq0120 samequantum  -Inf     0     -> 0\r
+ddsamq0121 samequantum  -Inf     0E+3  -> 0\r
+ddsamq0122 samequantum  -Inf     7E-3  -> 0\r
+ddsamq0123 samequantum  -Inf     7     -> 0\r
+ddsamq0124 samequantum  -Inf     7E+3  -> 0\r
+ddsamq0125 samequantum  -Inf     sNaN  -> 0\r
+\r
+ddsamq0210 samequantum   Inf    -Inf   -> 1\r
+ddsamq0211 samequantum   Inf     Inf   -> 1\r
+ddsamq0212 samequantum   Inf     NaN   -> 0\r
+ddsamq0213 samequantum   Inf    -7E+3  -> 0\r
+ddsamq0214 samequantum   Inf    -7     -> 0\r
+ddsamq0215 samequantum   Inf    -7E-3  -> 0\r
+ddsamq0216 samequantum   Inf    -0E-3  -> 0\r
+ddsamq0217 samequantum   Inf    -0     -> 0\r
+ddsamq0218 samequantum   Inf    -0E+3  -> 0\r
+ddsamq0219 samequantum   Inf     0E-3  -> 0\r
+ddsamq0220 samequantum   Inf     0     -> 0\r
+ddsamq0221 samequantum   Inf     0E+3  -> 0\r
+ddsamq0222 samequantum   Inf     7E-3  -> 0\r
+ddsamq0223 samequantum   Inf     7     -> 0\r
+ddsamq0224 samequantum   Inf     7E+3  -> 0\r
+ddsamq0225 samequantum   Inf     sNaN  -> 0\r
+\r
+ddsamq0310 samequantum   NaN    -Inf   -> 0\r
+ddsamq0311 samequantum   NaN     Inf   -> 0\r
+ddsamq0312 samequantum   NaN     NaN   -> 1\r
+ddsamq0313 samequantum   NaN    -7E+3  -> 0\r
+ddsamq0314 samequantum   NaN    -7     -> 0\r
+ddsamq0315 samequantum   NaN    -7E-3  -> 0\r
+ddsamq0316 samequantum   NaN    -0E-3  -> 0\r
+ddsamq0317 samequantum   NaN    -0     -> 0\r
+ddsamq0318 samequantum   NaN    -0E+3  -> 0\r
+ddsamq0319 samequantum   NaN     0E-3  -> 0\r
+ddsamq0320 samequantum   NaN     0     -> 0\r
+ddsamq0321 samequantum   NaN     0E+3  -> 0\r
+ddsamq0322 samequantum   NaN     7E-3  -> 0\r
+ddsamq0323 samequantum   NaN     7     -> 0\r
+ddsamq0324 samequantum   NaN     7E+3  -> 0\r
+ddsamq0325 samequantum   NaN     sNaN  -> 1\r
+\r
+ddsamq0410 samequantum  -7E+3    -Inf   -> 0\r
+ddsamq0411 samequantum  -7E+3     Inf   -> 0\r
+ddsamq0412 samequantum  -7E+3     NaN   -> 0\r
+ddsamq0413 samequantum  -7E+3    -7E+3  -> 1\r
+ddsamq0414 samequantum  -7E+3    -7     -> 0\r
+ddsamq0415 samequantum  -7E+3    -7E-3  -> 0\r
+ddsamq0416 samequantum  -7E+3    -0E-3  -> 0\r
+ddsamq0417 samequantum  -7E+3    -0     -> 0\r
+ddsamq0418 samequantum  -7E+3    -0E+3  -> 1\r
+ddsamq0419 samequantum  -7E+3     0E-3  -> 0\r
+ddsamq0420 samequantum  -7E+3     0     -> 0\r
+ddsamq0421 samequantum  -7E+3     0E+3  -> 1\r
+ddsamq0422 samequantum  -7E+3     7E-3  -> 0\r
+ddsamq0423 samequantum  -7E+3     7     -> 0\r
+ddsamq0424 samequantum  -7E+3     7E+3  -> 1\r
+ddsamq0425 samequantum  -7E+3     sNaN  -> 0\r
+\r
+ddsamq0510 samequantum  -7      -Inf   -> 0\r
+ddsamq0511 samequantum  -7       Inf   -> 0\r
+ddsamq0512 samequantum  -7       NaN   -> 0\r
+ddsamq0513 samequantum  -7      -7E+3  -> 0\r
+ddsamq0514 samequantum  -7      -7     -> 1\r
+ddsamq0515 samequantum  -7      -7E-3  -> 0\r
+ddsamq0516 samequantum  -7      -0E-3  -> 0\r
+ddsamq0517 samequantum  -7      -0     -> 1\r
+ddsamq0518 samequantum  -7      -0E+3  -> 0\r
+ddsamq0519 samequantum  -7       0E-3  -> 0\r
+ddsamq0520 samequantum  -7       0     -> 1\r
+ddsamq0521 samequantum  -7       0E+3  -> 0\r
+ddsamq0522 samequantum  -7       7E-3  -> 0\r
+ddsamq0523 samequantum  -7       7     -> 1\r
+ddsamq0524 samequantum  -7       7E+3  -> 0\r
+ddsamq0525 samequantum  -7       sNaN  -> 0\r
+\r
+ddsamq0610 samequantum  -7E-3    -Inf   -> 0\r
+ddsamq0611 samequantum  -7E-3     Inf   -> 0\r
+ddsamq0612 samequantum  -7E-3     NaN   -> 0\r
+ddsamq0613 samequantum  -7E-3    -7E+3  -> 0\r
+ddsamq0614 samequantum  -7E-3    -7     -> 0\r
+ddsamq0615 samequantum  -7E-3    -7E-3  -> 1\r
+ddsamq0616 samequantum  -7E-3    -0E-3  -> 1\r
+ddsamq0617 samequantum  -7E-3    -0     -> 0\r
+ddsamq0618 samequantum  -7E-3    -0E+3  -> 0\r
+ddsamq0619 samequantum  -7E-3     0E-3  -> 1\r
+ddsamq0620 samequantum  -7E-3     0     -> 0\r
+ddsamq0621 samequantum  -7E-3     0E+3  -> 0\r
+ddsamq0622 samequantum  -7E-3     7E-3  -> 1\r
+ddsamq0623 samequantum  -7E-3     7     -> 0\r
+ddsamq0624 samequantum  -7E-3     7E+3  -> 0\r
+ddsamq0625 samequantum  -7E-3     sNaN  -> 0\r
+\r
+ddsamq0710 samequantum  -0E-3    -Inf   -> 0\r
+ddsamq0711 samequantum  -0E-3     Inf   -> 0\r
+ddsamq0712 samequantum  -0E-3     NaN   -> 0\r
+ddsamq0713 samequantum  -0E-3    -7E+3  -> 0\r
+ddsamq0714 samequantum  -0E-3    -7     -> 0\r
+ddsamq0715 samequantum  -0E-3    -7E-3  -> 1\r
+ddsamq0716 samequantum  -0E-3    -0E-3  -> 1\r
+ddsamq0717 samequantum  -0E-3    -0     -> 0\r
+ddsamq0718 samequantum  -0E-3    -0E+3  -> 0\r
+ddsamq0719 samequantum  -0E-3     0E-3  -> 1\r
+ddsamq0720 samequantum  -0E-3     0     -> 0\r
+ddsamq0721 samequantum  -0E-3     0E+3  -> 0\r
+ddsamq0722 samequantum  -0E-3     7E-3  -> 1\r
+ddsamq0723 samequantum  -0E-3     7     -> 0\r
+ddsamq0724 samequantum  -0E-3     7E+3  -> 0\r
+ddsamq0725 samequantum  -0E-3     sNaN  -> 0\r
+\r
+ddsamq0810 samequantum  -0      -Inf   -> 0\r
+ddsamq0811 samequantum  -0       Inf   -> 0\r
+ddsamq0812 samequantum  -0       NaN   -> 0\r
+ddsamq0813 samequantum  -0      -7E+3  -> 0\r
+ddsamq0814 samequantum  -0      -7     -> 1\r
+ddsamq0815 samequantum  -0      -7E-3  -> 0\r
+ddsamq0816 samequantum  -0      -0E-3  -> 0\r
+ddsamq0817 samequantum  -0      -0     -> 1\r
+ddsamq0818 samequantum  -0      -0E+3  -> 0\r
+ddsamq0819 samequantum  -0       0E-3  -> 0\r
+ddsamq0820 samequantum  -0       0     -> 1\r
+ddsamq0821 samequantum  -0       0E+3  -> 0\r
+ddsamq0822 samequantum  -0       7E-3  -> 0\r
+ddsamq0823 samequantum  -0       7     -> 1\r
+ddsamq0824 samequantum  -0       7E+3  -> 0\r
+ddsamq0825 samequantum  -0       sNaN  -> 0\r
+\r
+ddsamq0910 samequantum  -0E+3    -Inf   -> 0\r
+ddsamq0911 samequantum  -0E+3     Inf   -> 0\r
+ddsamq0912 samequantum  -0E+3     NaN   -> 0\r
+ddsamq0913 samequantum  -0E+3    -7E+3  -> 1\r
+ddsamq0914 samequantum  -0E+3    -7     -> 0\r
+ddsamq0915 samequantum  -0E+3    -7E-3  -> 0\r
+ddsamq0916 samequantum  -0E+3    -0E-3  -> 0\r
+ddsamq0917 samequantum  -0E+3    -0     -> 0\r
+ddsamq0918 samequantum  -0E+3    -0E+3  -> 1\r
+ddsamq0919 samequantum  -0E+3     0E-3  -> 0\r
+ddsamq0920 samequantum  -0E+3     0     -> 0\r
+ddsamq0921 samequantum  -0E+3     0E+3  -> 1\r
+ddsamq0922 samequantum  -0E+3     7E-3  -> 0\r
+ddsamq0923 samequantum  -0E+3     7     -> 0\r
+ddsamq0924 samequantum  -0E+3     7E+3  -> 1\r
+ddsamq0925 samequantum  -0E+3     sNaN  -> 0\r
+\r
+ddsamq1110 samequantum  0E-3    -Inf   -> 0\r
+ddsamq1111 samequantum  0E-3     Inf   -> 0\r
+ddsamq1112 samequantum  0E-3     NaN   -> 0\r
+ddsamq1113 samequantum  0E-3    -7E+3  -> 0\r
+ddsamq1114 samequantum  0E-3    -7     -> 0\r
+ddsamq1115 samequantum  0E-3    -7E-3  -> 1\r
+ddsamq1116 samequantum  0E-3    -0E-3  -> 1\r
+ddsamq1117 samequantum  0E-3    -0     -> 0\r
+ddsamq1118 samequantum  0E-3    -0E+3  -> 0\r
+ddsamq1119 samequantum  0E-3     0E-3  -> 1\r
+ddsamq1120 samequantum  0E-3     0     -> 0\r
+ddsamq1121 samequantum  0E-3     0E+3  -> 0\r
+ddsamq1122 samequantum  0E-3     7E-3  -> 1\r
+ddsamq1123 samequantum  0E-3     7     -> 0\r
+ddsamq1124 samequantum  0E-3     7E+3  -> 0\r
+ddsamq1125 samequantum  0E-3     sNaN  -> 0\r
+\r
+ddsamq1210 samequantum  0       -Inf   -> 0\r
+ddsamq1211 samequantum  0        Inf   -> 0\r
+ddsamq1212 samequantum  0        NaN   -> 0\r
+ddsamq1213 samequantum  0       -7E+3  -> 0\r
+ddsamq1214 samequantum  0       -7     -> 1\r
+ddsamq1215 samequantum  0       -7E-3  -> 0\r
+ddsamq1216 samequantum  0       -0E-3  -> 0\r
+ddsamq1217 samequantum  0       -0     -> 1\r
+ddsamq1218 samequantum  0       -0E+3  -> 0\r
+ddsamq1219 samequantum  0        0E-3  -> 0\r
+ddsamq1220 samequantum  0        0     -> 1\r
+ddsamq1221 samequantum  0        0E+3  -> 0\r
+ddsamq1222 samequantum  0        7E-3  -> 0\r
+ddsamq1223 samequantum  0        7     -> 1\r
+ddsamq1224 samequantum  0        7E+3  -> 0\r
+ddsamq1225 samequantum  0        sNaN  -> 0\r
+\r
+ddsamq1310 samequantum  0E+3    -Inf   -> 0\r
+ddsamq1311 samequantum  0E+3     Inf   -> 0\r
+ddsamq1312 samequantum  0E+3     NaN   -> 0\r
+ddsamq1313 samequantum  0E+3    -7E+3  -> 1\r
+ddsamq1314 samequantum  0E+3    -7     -> 0\r
+ddsamq1315 samequantum  0E+3    -7E-3  -> 0\r
+ddsamq1316 samequantum  0E+3    -0E-3  -> 0\r
+ddsamq1317 samequantum  0E+3    -0     -> 0\r
+ddsamq1318 samequantum  0E+3    -0E+3  -> 1\r
+ddsamq1319 samequantum  0E+3     0E-3  -> 0\r
+ddsamq1320 samequantum  0E+3     0     -> 0\r
+ddsamq1321 samequantum  0E+3     0E+3  -> 1\r
+ddsamq1322 samequantum  0E+3     7E-3  -> 0\r
+ddsamq1323 samequantum  0E+3     7     -> 0\r
+ddsamq1324 samequantum  0E+3     7E+3  -> 1\r
+ddsamq1325 samequantum  0E+3     sNaN  -> 0\r
+\r
+ddsamq1410 samequantum  7E-3    -Inf   -> 0\r
+ddsamq1411 samequantum  7E-3     Inf   -> 0\r
+ddsamq1412 samequantum  7E-3     NaN   -> 0\r
+ddsamq1413 samequantum  7E-3    -7E+3  -> 0\r
+ddsamq1414 samequantum  7E-3    -7     -> 0\r
+ddsamq1415 samequantum  7E-3    -7E-3  -> 1\r
+ddsamq1416 samequantum  7E-3    -0E-3  -> 1\r
+ddsamq1417 samequantum  7E-3    -0     -> 0\r
+ddsamq1418 samequantum  7E-3    -0E+3  -> 0\r
+ddsamq1419 samequantum  7E-3     0E-3  -> 1\r
+ddsamq1420 samequantum  7E-3     0     -> 0\r
+ddsamq1421 samequantum  7E-3     0E+3  -> 0\r
+ddsamq1422 samequantum  7E-3     7E-3  -> 1\r
+ddsamq1423 samequantum  7E-3     7     -> 0\r
+ddsamq1424 samequantum  7E-3     7E+3  -> 0\r
+ddsamq1425 samequantum  7E-3     sNaN  -> 0\r
+\r
+ddsamq1510 samequantum  7      -Inf   -> 0\r
+ddsamq1511 samequantum  7       Inf   -> 0\r
+ddsamq1512 samequantum  7       NaN   -> 0\r
+ddsamq1513 samequantum  7      -7E+3  -> 0\r
+ddsamq1514 samequantum  7      -7     -> 1\r
+ddsamq1515 samequantum  7      -7E-3  -> 0\r
+ddsamq1516 samequantum  7      -0E-3  -> 0\r
+ddsamq1517 samequantum  7      -0     -> 1\r
+ddsamq1518 samequantum  7      -0E+3  -> 0\r
+ddsamq1519 samequantum  7       0E-3  -> 0\r
+ddsamq1520 samequantum  7       0     -> 1\r
+ddsamq1521 samequantum  7       0E+3  -> 0\r
+ddsamq1522 samequantum  7       7E-3  -> 0\r
+ddsamq1523 samequantum  7       7     -> 1\r
+ddsamq1524 samequantum  7       7E+3  -> 0\r
+ddsamq1525 samequantum  7       sNaN  -> 0\r
+\r
+ddsamq1610 samequantum  7E+3    -Inf   -> 0\r
+ddsamq1611 samequantum  7E+3     Inf   -> 0\r
+ddsamq1612 samequantum  7E+3     NaN   -> 0\r
+ddsamq1613 samequantum  7E+3    -7E+3  -> 1\r
+ddsamq1614 samequantum  7E+3    -7     -> 0\r
+ddsamq1615 samequantum  7E+3    -7E-3  -> 0\r
+ddsamq1616 samequantum  7E+3    -0E-3  -> 0\r
+ddsamq1617 samequantum  7E+3    -0     -> 0\r
+ddsamq1618 samequantum  7E+3    -0E+3  -> 1\r
+ddsamq1619 samequantum  7E+3     0E-3  -> 0\r
+ddsamq1620 samequantum  7E+3     0     -> 0\r
+ddsamq1621 samequantum  7E+3     0E+3  -> 1\r
+ddsamq1622 samequantum  7E+3     7E-3  -> 0\r
+ddsamq1623 samequantum  7E+3     7     -> 0\r
+ddsamq1624 samequantum  7E+3     7E+3  -> 1\r
+ddsamq1625 samequantum  7E+3     sNaN  -> 0\r
+\r
+ddsamq1710 samequantum  sNaN    -Inf   -> 0\r
+ddsamq1711 samequantum  sNaN     Inf   -> 0\r
+ddsamq1712 samequantum  sNaN     NaN   -> 1\r
+ddsamq1713 samequantum  sNaN    -7E+3  -> 0\r
+ddsamq1714 samequantum  sNaN    -7     -> 0\r
+ddsamq1715 samequantum  sNaN    -7E-3  -> 0\r
+ddsamq1716 samequantum  sNaN    -0E-3  -> 0\r
+ddsamq1717 samequantum  sNaN    -0     -> 0\r
+ddsamq1718 samequantum  sNaN    -0E+3  -> 0\r
+ddsamq1719 samequantum  sNaN     0E-3  -> 0\r
+ddsamq1720 samequantum  sNaN     0     -> 0\r
+ddsamq1721 samequantum  sNaN     0E+3  -> 0\r
+ddsamq1722 samequantum  sNaN     7E-3  -> 0\r
+ddsamq1723 samequantum  sNaN     7     -> 0\r
+ddsamq1724 samequantum  sNaN     7E+3  -> 0\r
+ddsamq1725 samequantum  sNaN     sNaN  -> 1\r
+-- noisy NaNs\r
+ddsamq1730 samequantum  sNaN3    sNaN3 -> 1\r
+ddsamq1731 samequantum  sNaN3    sNaN4 -> 1\r
+ddsamq1732 samequantum   NaN3     NaN3 -> 1\r
+ddsamq1733 samequantum   NaN3     NaN4 -> 1\r
+ddsamq1734 samequantum  sNaN3     3    -> 0\r
+ddsamq1735 samequantum   NaN3     3    -> 0\r
+ddsamq1736 samequantum      4    sNaN4 -> 0\r
+ddsamq1737 samequantum      3     NaN3 -> 0\r
+ddsamq1738 samequantum    Inf    sNaN4 -> 0\r
+ddsamq1739 samequantum   -Inf     NaN3 -> 0\r
+\r
diff --git a/Lib/test/decimaltestdata/ddScaleB.decTest b/Lib/test/decimaltestdata/ddScaleB.decTest
new file mode 100644 (file)
index 0000000..4091f86
--- /dev/null
@@ -0,0 +1,243 @@
+------------------------------------------------------------------------\r
+-- ddScalebB.decTest -- scale a decDouble by powers of 10             --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Max |rhs| is 2*(384+16) = 800\r
+\r
+-- Sanity checks\r
+ddscb001 scaleb       7.50   10 -> 7.50E+10\r
+ddscb002 scaleb       7.50    3 -> 7.50E+3\r
+ddscb003 scaleb       7.50    2 -> 750\r
+ddscb004 scaleb       7.50    1 -> 75.0\r
+ddscb005 scaleb       7.50    0 -> 7.50\r
+ddscb006 scaleb       7.50   -1 -> 0.750\r
+ddscb007 scaleb       7.50   -2 -> 0.0750\r
+ddscb008 scaleb       7.50  -10 -> 7.50E-10\r
+ddscb009 scaleb      -7.50    3 -> -7.50E+3\r
+ddscb010 scaleb      -7.50    2 -> -750\r
+ddscb011 scaleb      -7.50    1 -> -75.0\r
+ddscb012 scaleb      -7.50    0 -> -7.50\r
+ddscb013 scaleb      -7.50   -1 -> -0.750\r
+\r
+-- Infinities\r
+ddscb014 scaleb  Infinity   1 -> Infinity\r
+ddscb015 scaleb  -Infinity  2 -> -Infinity\r
+ddscb016 scaleb  Infinity  -1 -> Infinity\r
+ddscb017 scaleb  -Infinity -2 -> -Infinity\r
+\r
+-- Next two are somewhat undefined in 754r; treat as non-integer\r
+ddscb018 scaleb  10  Infinity -> NaN Invalid_operation\r
+ddscb019 scaleb  10 -Infinity -> NaN Invalid_operation\r
+\r
+-- NaNs are undefined in 754r; assume usual processing\r
+-- NaNs, 0 payload\r
+ddscb021 scaleb         NaN  1 -> NaN\r
+ddscb022 scaleb        -NaN -1 -> -NaN\r
+ddscb023 scaleb        sNaN  1 -> NaN Invalid_operation\r
+ddscb024 scaleb       -sNaN  1 -> -NaN Invalid_operation\r
+ddscb025 scaleb    4    NaN    -> NaN\r
+ddscb026 scaleb -Inf   -NaN    -> -NaN\r
+ddscb027 scaleb    4   sNaN    -> NaN Invalid_operation\r
+ddscb028 scaleb  Inf  -sNaN    -> -NaN Invalid_operation\r
+\r
+-- non-integer RHS\r
+ddscb030 scaleb  1.23    1    ->  12.3\r
+ddscb031 scaleb  1.23    1.00 ->  NaN Invalid_operation\r
+ddscb032 scaleb  1.23    1.1  ->  NaN Invalid_operation\r
+ddscb033 scaleb  1.23    1.01 ->  NaN Invalid_operation\r
+ddscb034 scaleb  1.23    0.01 ->  NaN Invalid_operation\r
+ddscb035 scaleb  1.23    0.11 ->  NaN Invalid_operation\r
+ddscb036 scaleb  1.23    0.999999999 ->  NaN Invalid_operation\r
+ddscb037 scaleb  1.23   -1    ->  0.123\r
+ddscb038 scaleb  1.23   -1.00 ->  NaN Invalid_operation\r
+ddscb039 scaleb  1.23   -1.1  ->  NaN Invalid_operation\r
+ddscb040 scaleb  1.23   -1.01 ->  NaN Invalid_operation\r
+ddscb041 scaleb  1.23   -0.01 ->  NaN Invalid_operation\r
+ddscb042 scaleb  1.23   -0.11 ->  NaN Invalid_operation\r
+ddscb043 scaleb  1.23   -0.999999999 ->  NaN Invalid_operation\r
+ddscb044 scaleb  1.23    0.1         ->  NaN Invalid_operation\r
+ddscb045 scaleb  1.23    1E+1        ->  NaN Invalid_operation\r
+ddscb046 scaleb  1.23    1.1234E+6   ->  NaN Invalid_operation\r
+ddscb047 scaleb  1.23    1.123E+4    ->  NaN Invalid_operation\r
+\r
+-- out-of range RHS\r
+ddscb120 scaleb  1.23    799         ->  Infinity Overflow Inexact Rounded\r
+ddscb121 scaleb  1.23    800         ->  Infinity Overflow Inexact Rounded\r
+ddscb122 scaleb  1.23    801         ->  NaN Invalid_operation\r
+ddscb123 scaleb  1.23    802         ->  NaN Invalid_operation\r
+ddscb124 scaleb  1.23   -799         ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddscb125 scaleb  1.23   -800         ->  0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddscb126 scaleb  1.23   -801         ->  NaN Invalid_operation\r
+ddscb127 scaleb  1.23   -802         ->  NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+-- propagating NaNs\r
+ddscb861 scaleb  NaN01   -Inf     ->  NaN1\r
+ddscb862 scaleb -NaN02   -1000    -> -NaN2\r
+ddscb863 scaleb  NaN03    1000    ->  NaN3\r
+ddscb864 scaleb  NaN04    Inf     ->  NaN4\r
+ddscb865 scaleb  NaN05    NaN61   ->  NaN5\r
+ddscb866 scaleb -Inf     -NaN71   -> -NaN71\r
+ddscb867 scaleb -1000     NaN81   ->  NaN81\r
+ddscb868 scaleb  1000     NaN91   ->  NaN91\r
+ddscb869 scaleb  Inf      NaN101  ->  NaN101\r
+ddscb871 scaleb  sNaN011  -Inf    ->  NaN11  Invalid_operation\r
+ddscb872 scaleb  sNaN012  -1000   ->  NaN12  Invalid_operation\r
+ddscb873 scaleb -sNaN013   1000   -> -NaN13  Invalid_operation\r
+ddscb874 scaleb  sNaN014   NaN171 ->  NaN14  Invalid_operation\r
+ddscb875 scaleb  sNaN015  sNaN181 ->  NaN15  Invalid_operation\r
+ddscb876 scaleb  NaN016   sNaN191 ->  NaN191 Invalid_operation\r
+ddscb877 scaleb -Inf      sNaN201 ->  NaN201 Invalid_operation\r
+ddscb878 scaleb -1000     sNaN211 ->  NaN211 Invalid_operation\r
+ddscb879 scaleb  1000    -sNaN221 -> -NaN221 Invalid_operation\r
+ddscb880 scaleb  Inf      sNaN231 ->  NaN231 Invalid_operation\r
+ddscb881 scaleb  NaN025   sNaN241 ->  NaN241 Invalid_operation\r
+\r
+-- finites\r
+ddscb051 scaleb          7   -2  -> 0.07\r
+ddscb052 scaleb         -7   -2  -> -0.07\r
+ddscb053 scaleb         75   -2  -> 0.75\r
+ddscb054 scaleb        -75   -2  -> -0.75\r
+ddscb055 scaleb       7.50   -2  -> 0.0750\r
+ddscb056 scaleb      -7.50   -2  -> -0.0750\r
+ddscb057 scaleb       7.500  -2  -> 0.07500\r
+ddscb058 scaleb      -7.500  -2  -> -0.07500\r
+ddscb061 scaleb          7   -1  -> 0.7\r
+ddscb062 scaleb         -7   -1  -> -0.7\r
+ddscb063 scaleb         75   -1  -> 7.5\r
+ddscb064 scaleb        -75   -1  -> -7.5\r
+ddscb065 scaleb       7.50   -1  -> 0.750\r
+ddscb066 scaleb      -7.50   -1  -> -0.750\r
+ddscb067 scaleb       7.500  -1  -> 0.7500\r
+ddscb068 scaleb      -7.500  -1  -> -0.7500\r
+ddscb071 scaleb          7    0  -> 7\r
+ddscb072 scaleb         -7    0  -> -7\r
+ddscb073 scaleb         75    0  -> 75\r
+ddscb074 scaleb        -75    0  -> -75\r
+ddscb075 scaleb       7.50    0  -> 7.50\r
+ddscb076 scaleb      -7.50    0  -> -7.50\r
+ddscb077 scaleb       7.500   0  -> 7.500\r
+ddscb078 scaleb      -7.500   0  -> -7.500\r
+ddscb081 scaleb          7    1  -> 7E+1\r
+ddscb082 scaleb         -7    1  -> -7E+1\r
+ddscb083 scaleb         75    1  -> 7.5E+2\r
+ddscb084 scaleb        -75    1  -> -7.5E+2\r
+ddscb085 scaleb       7.50    1  -> 75.0\r
+ddscb086 scaleb      -7.50    1  -> -75.0\r
+ddscb087 scaleb       7.500   1  -> 75.00\r
+ddscb088 scaleb      -7.500   1  -> -75.00\r
+ddscb091 scaleb          7    2  -> 7E+2\r
+ddscb092 scaleb         -7    2  -> -7E+2\r
+ddscb093 scaleb         75    2  -> 7.5E+3\r
+ddscb094 scaleb        -75    2  -> -7.5E+3\r
+ddscb095 scaleb       7.50    2  -> 750\r
+ddscb096 scaleb      -7.50    2  -> -750\r
+ddscb097 scaleb       7.500   2  -> 750.0\r
+ddscb098 scaleb      -7.500   2  -> -750.0\r
+\r
+-- zeros\r
+ddscb111 scaleb          0  1 -> 0E+1\r
+ddscb112 scaleb         -0  2 -> -0E+2\r
+ddscb113 scaleb       0E+4  3 -> 0E+7\r
+ddscb114 scaleb      -0E+4  4 -> -0E+8\r
+ddscb115 scaleb     0.0000  5 -> 0E+1\r
+ddscb116 scaleb    -0.0000  6 -> -0E+2\r
+ddscb117 scaleb      0E-141 7 -> 0E-134\r
+ddscb118 scaleb     -0E-141 8 -> -0E-133\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddscb132 scaleb  9.999999999999999E+384  +384 -> Infinity    Overflow Inexact Rounded\r
+ddscb133 scaleb  9.999999999999999E+384  +10 -> Infinity     Overflow Inexact Rounded\r
+ddscb134 scaleb  9.999999999999999E+384  +1  -> Infinity     Overflow Inexact Rounded\r
+ddscb135 scaleb  9.999999999999999E+384   0  -> 9.999999999999999E+384\r
+ddscb136 scaleb  9.999999999999999E+384  -1  -> 9.999999999999999E+383\r
+ddscb137 scaleb  1E-383           +1  -> 1E-382\r
+ddscb138 scaleb  1E-383           -0  -> 1E-383\r
+ddscb139 scaleb  1E-383           -1  -> 1E-384          Subnormal\r
+ddscb140 scaleb  1.000000000000000E-383  +1  -> 1.000000000000000E-382\r
+ddscb141 scaleb  1.000000000000000E-383   0  -> 1.000000000000000E-383\r
+ddscb142 scaleb  1.000000000000000E-383  -1  -> 1.00000000000000E-384 Subnormal Rounded\r
+ddscb143 scaleb  1E-398          +1  -> 1E-397          Subnormal\r
+ddscb144 scaleb  1E-398          -0  -> 1E-398         Subnormal\r
+ddscb145 scaleb  1E-398          -1  -> 0E-398         Underflow Subnormal Inexact Rounded Clamped\r
+\r
+ddscb150 scaleb  -1E-398         +1  -> -1E-397         Subnormal\r
+ddscb151 scaleb  -1E-398         -0  -> -1E-398        Subnormal\r
+ddscb152 scaleb  -1E-398         -1  -> -0E-398        Underflow Subnormal Inexact Rounded Clamped\r
+ddscb153 scaleb  -1.000000000000000E-383 +1  -> -1.000000000000000E-382\r
+ddscb154 scaleb  -1.000000000000000E-383 +0  -> -1.000000000000000E-383\r
+ddscb155 scaleb  -1.000000000000000E-383 -1  -> -1.00000000000000E-384 Subnormal Rounded\r
+ddscb156 scaleb  -1E-383          +1  -> -1E-382\r
+ddscb157 scaleb  -1E-383          -0  -> -1E-383\r
+ddscb158 scaleb  -1E-383          -1  -> -1E-384          Subnormal\r
+ddscb159 scaleb  -9.999999999999999E+384 +1  -> -Infinity        Overflow Inexact Rounded\r
+ddscb160 scaleb  -9.999999999999999E+384 +0  -> -9.999999999999999E+384\r
+ddscb161 scaleb  -9.999999999999999E+384 -1  -> -9.999999999999999E+383\r
+ddscb162 scaleb  -9E+384          +1  -> -Infinity        Overflow Inexact Rounded\r
+ddscb163 scaleb  -1E+384          +1  -> -Infinity        Overflow Inexact Rounded\r
+\r
+-- some Origami\r
+-- (these check that overflow is being done correctly)\r
+ddscb171 scaleb   1000E+365  +1 -> 1.000E+369\r
+ddscb172 scaleb   1000E+366  +1 -> 1.000E+370\r
+ddscb173 scaleb   1000E+367  +1 -> 1.000E+371\r
+ddscb174 scaleb   1000E+368  +1 -> 1.000E+372\r
+ddscb175 scaleb   1000E+369  +1 -> 1.0000E+373                  Clamped\r
+ddscb176 scaleb   1000E+370  +1 -> 1.00000E+374                 Clamped\r
+ddscb177 scaleb   1000E+371  +1 -> 1.000000E+375                Clamped\r
+ddscb178 scaleb   1000E+372  +1 -> 1.0000000E+376               Clamped\r
+ddscb179 scaleb   1000E+373  +1 -> 1.00000000E+377              Clamped\r
+ddscb180 scaleb   1000E+374  +1 -> 1.000000000E+378             Clamped\r
+ddscb181 scaleb   1000E+375  +1 -> 1.0000000000E+379            Clamped\r
+ddscb182 scaleb   1000E+376  +1 -> 1.00000000000E+380           Clamped\r
+ddscb183 scaleb   1000E+377  +1 -> 1.000000000000E+381          Clamped\r
+ddscb184 scaleb   1000E+378  +1 -> 1.0000000000000E+382         Clamped\r
+ddscb185 scaleb   1000E+379  +1 -> 1.00000000000000E+383        Clamped\r
+ddscb186 scaleb   1000E+380  +1 -> 1.000000000000000E+384       Clamped\r
+ddscb187 scaleb   1000E+381  +1 -> Infinity    Overflow Inexact Rounded\r
+\r
+-- and a few more subnormal truncations\r
+-- (these check that underflow is being done correctly)\r
+ddscb201 scaleb  1.000000000000000E-383   0  -> 1.000000000000000E-383\r
+ddscb202 scaleb  1.000000000000000E-383  -1  -> 1.00000000000000E-384 Subnormal Rounded\r
+ddscb203 scaleb  1.000000000000000E-383  -2  -> 1.0000000000000E-385 Subnormal Rounded\r
+ddscb204 scaleb  1.000000000000000E-383  -3  -> 1.000000000000E-386 Subnormal Rounded\r
+ddscb205 scaleb  1.000000000000000E-383  -4  -> 1.00000000000E-387 Subnormal Rounded\r
+ddscb206 scaleb  1.000000000000000E-383  -5  -> 1.0000000000E-388 Subnormal Rounded\r
+ddscb207 scaleb  1.000000000000000E-383  -6  -> 1.000000000E-389 Subnormal Rounded\r
+ddscb208 scaleb  1.000000000000000E-383  -7  -> 1.00000000E-390 Subnormal Rounded\r
+ddscb209 scaleb  1.000000000000000E-383  -8  -> 1.0000000E-391 Subnormal Rounded\r
+ddscb210 scaleb  1.000000000000000E-383  -9  -> 1.000000E-392 Subnormal Rounded\r
+ddscb211 scaleb  1.000000000000000E-383  -10 -> 1.00000E-393 Subnormal Rounded\r
+ddscb212 scaleb  1.000000000000000E-383  -11 -> 1.0000E-394 Subnormal Rounded\r
+ddscb213 scaleb  1.000000000000000E-383  -12 -> 1.000E-395 Subnormal Rounded\r
+ddscb214 scaleb  1.000000000000000E-383  -13 -> 1.00E-396 Subnormal Rounded\r
+ddscb215 scaleb  1.000000000000000E-383  -14 -> 1.0E-397 Subnormal Rounded\r
+ddscb216 scaleb  1.000000000000000E-383  -15 -> 1E-398 Subnormal Rounded\r
+ddscb217 scaleb  1.000000000000000E-383  -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+ddscb218 scaleb  1.000000000000000E-383  -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped\r
+\r
diff --git a/Lib/test/decimaltestdata/ddShift.decTest b/Lib/test/decimaltestdata/ddShift.decTest
new file mode 100644 (file)
index 0000000..2cbe06a
--- /dev/null
@@ -0,0 +1,262 @@
+------------------------------------------------------------------------\r
+-- ddShift.decTest -- shift decDouble coefficient left or right       --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+ddshi001 shift                 0    0  ->  0\r
+ddshi002 shift                 0    2  ->  0\r
+ddshi003 shift                 1    2  ->  100\r
+ddshi004 shift                 1   15  ->  1000000000000000\r
+ddshi005 shift                 1   16  ->  0\r
+ddshi006 shift                 1   -1  ->  0\r
+ddshi007 shift                 0   -2  ->  0\r
+ddshi008 shift  1234567890123456   -1  ->  123456789012345\r
+ddshi009 shift  1234567890123456   -15 ->  1\r
+ddshi010 shift  1234567890123456   -16 ->  0\r
+ddshi011 shift  9934567890123456   -15 ->  9\r
+ddshi012 shift  9934567890123456   -16 ->  0\r
+\r
+-- rhs must be an integer\r
+ddshi015 shift        1    1.5    -> NaN Invalid_operation\r
+ddshi016 shift        1    1.0    -> NaN Invalid_operation\r
+ddshi017 shift        1    0.1    -> NaN Invalid_operation\r
+ddshi018 shift        1    0.0    -> NaN Invalid_operation\r
+ddshi019 shift        1    1E+1   -> NaN Invalid_operation\r
+ddshi020 shift        1    1E+99  -> NaN Invalid_operation\r
+ddshi021 shift        1    Inf    -> NaN Invalid_operation\r
+ddshi022 shift        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+ddshi025 shift        1    -1000  -> NaN Invalid_operation\r
+ddshi026 shift        1    -17    -> NaN Invalid_operation\r
+ddshi027 shift        1     17    -> NaN Invalid_operation\r
+ddshi028 shift        1     1000  -> NaN Invalid_operation\r
+\r
+-- full shifting pattern\r
+ddshi030 shift  1234567890123456         -16  -> 0\r
+ddshi031 shift  1234567890123456         -15  -> 1\r
+ddshi032 shift  1234567890123456         -14  -> 12\r
+ddshi033 shift  1234567890123456         -13  -> 123\r
+ddshi034 shift  1234567890123456         -12  -> 1234\r
+ddshi035 shift  1234567890123456         -11  -> 12345\r
+ddshi036 shift  1234567890123456         -10  -> 123456\r
+ddshi037 shift  1234567890123456         -9   -> 1234567\r
+ddshi038 shift  1234567890123456         -8   -> 12345678\r
+ddshi039 shift  1234567890123456         -7   -> 123456789\r
+ddshi040 shift  1234567890123456         -6   -> 1234567890\r
+ddshi041 shift  1234567890123456         -5   -> 12345678901\r
+ddshi042 shift  1234567890123456         -4   -> 123456789012\r
+ddshi043 shift  1234567890123456         -3   -> 1234567890123\r
+ddshi044 shift  1234567890123456         -2   -> 12345678901234\r
+ddshi045 shift  1234567890123456         -1   -> 123456789012345\r
+ddshi046 shift  1234567890123456         -0   -> 1234567890123456\r
+\r
+ddshi047 shift  1234567890123456         +0   -> 1234567890123456\r
+ddshi048 shift  1234567890123456         +1   -> 2345678901234560\r
+ddshi049 shift  1234567890123456         +2   -> 3456789012345600\r
+ddshi050 shift  1234567890123456         +3   -> 4567890123456000\r
+ddshi051 shift  1234567890123456         +4   -> 5678901234560000\r
+ddshi052 shift  1234567890123456         +5   -> 6789012345600000\r
+ddshi053 shift  1234567890123456         +6   -> 7890123456000000\r
+ddshi054 shift  1234567890123456         +7   -> 8901234560000000\r
+ddshi055 shift  1234567890123456         +8   -> 9012345600000000\r
+ddshi056 shift  1234567890123456         +9   ->  123456000000000\r
+ddshi057 shift  1234567890123456         +10  -> 1234560000000000\r
+ddshi058 shift  1234567890123456         +11  -> 2345600000000000\r
+ddshi059 shift  1234567890123456         +12  -> 3456000000000000\r
+ddshi060 shift  1234567890123456         +13  -> 4560000000000000\r
+ddshi061 shift  1234567890123456         +14  -> 5600000000000000\r
+ddshi062 shift  1234567890123456         +15  -> 6000000000000000\r
+ddshi063 shift  1234567890123456         +16  -> 0\r
+\r
+-- zeros\r
+ddshi070 shift  0E-10              +9   ->   0E-10\r
+ddshi071 shift  0E-10              -9   ->   0E-10\r
+ddshi072 shift  0.000              +9   ->   0.000\r
+ddshi073 shift  0.000              -9   ->   0.000\r
+ddshi074 shift  0E+10              +9   ->   0E+10\r
+ddshi075 shift  0E+10              -9   ->   0E+10\r
+ddshi076 shift -0E-10              +9   ->  -0E-10\r
+ddshi077 shift -0E-10              -9   ->  -0E-10\r
+ddshi078 shift -0.000              +9   ->  -0.000\r
+ddshi079 shift -0.000              -9   ->  -0.000\r
+ddshi080 shift -0E+10              +9   ->  -0E+10\r
+ddshi081 shift -0E+10              -9   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+ddshi141 shift  9.999999999999999E+384     -1  -> 9.99999999999999E+383\r
+ddshi142 shift  9.999999999999999E+384     -15 -> 9E+369\r
+ddshi143 shift  9.999999999999999E+384      1  -> 9.999999999999990E+384\r
+ddshi144 shift  9.999999999999999E+384      15 -> 9.000000000000000E+384\r
+ddshi145 shift  1E-383                     -1  -> 0E-383\r
+ddshi146 shift  1E-383                     -15 -> 0E-383\r
+ddshi147 shift  1E-383                      1  -> 1.0E-382\r
+ddshi148 shift  1E-383                      15 -> 1.000000000000000E-368\r
+ddshi151 shift  1.000000000000000E-383     -1  -> 1.00000000000000E-384\r
+ddshi152 shift  1.000000000000000E-383     -15 -> 1E-398\r
+ddshi153 shift  1.000000000000000E-383      1  -> 0E-398\r
+ddshi154 shift  1.000000000000000E-383      15 -> 0E-398\r
+ddshi155 shift  9.000000000000000E-383     -1  -> 9.00000000000000E-384\r
+ddshi156 shift  9.000000000000000E-383     -15 -> 9E-398\r
+ddshi157 shift  9.000000000000000E-383      1  -> 0E-398\r
+ddshi158 shift  9.000000000000000E-383      15 -> 0E-398\r
+ddshi160 shift  1E-398                     -1  -> 0E-398\r
+ddshi161 shift  1E-398                     -15 -> 0E-398\r
+ddshi162 shift  1E-398                      1  -> 1.0E-397\r
+ddshi163 shift  1E-398                      15 -> 1.000000000000000E-383\r
+--  negatives\r
+ddshi171 shift -9.999999999999999E+384     -1  -> -9.99999999999999E+383\r
+ddshi172 shift -9.999999999999999E+384     -15 -> -9E+369\r
+ddshi173 shift -9.999999999999999E+384      1  -> -9.999999999999990E+384\r
+ddshi174 shift -9.999999999999999E+384      15 -> -9.000000000000000E+384\r
+ddshi175 shift -1E-383                     -1  -> -0E-383\r
+ddshi176 shift -1E-383                     -15 -> -0E-383\r
+ddshi177 shift -1E-383                      1  -> -1.0E-382\r
+ddshi178 shift -1E-383                      15 -> -1.000000000000000E-368\r
+ddshi181 shift -1.000000000000000E-383     -1  -> -1.00000000000000E-384\r
+ddshi182 shift -1.000000000000000E-383     -15 -> -1E-398\r
+ddshi183 shift -1.000000000000000E-383      1  -> -0E-398\r
+ddshi184 shift -1.000000000000000E-383      15 -> -0E-398\r
+ddshi185 shift -9.000000000000000E-383     -1  -> -9.00000000000000E-384\r
+ddshi186 shift -9.000000000000000E-383     -15 -> -9E-398\r
+ddshi187 shift -9.000000000000000E-383      1  -> -0E-398\r
+ddshi188 shift -9.000000000000000E-383      15 -> -0E-398\r
+ddshi190 shift -1E-398                     -1  -> -0E-398\r
+ddshi191 shift -1E-398                     -15 -> -0E-398\r
+ddshi192 shift -1E-398                      1  -> -1.0E-397\r
+ddshi193 shift -1E-398                      15 -> -1.000000000000000E-383\r
+\r
+-- more negatives (of sanities)\r
+ddshi201 shift                -0    0  -> -0\r
+ddshi202 shift                -0    2  -> -0\r
+ddshi203 shift                -1    2  -> -100\r
+ddshi204 shift                -1   15  -> -1000000000000000\r
+ddshi205 shift                -1   16  -> -0\r
+ddshi206 shift                -1   -1  -> -0\r
+ddshi207 shift                -0   -2  -> -0\r
+ddshi208 shift -1234567890123456   -1  -> -123456789012345\r
+ddshi209 shift -1234567890123456   -15 -> -1\r
+ddshi210 shift -1234567890123456   -16 -> -0\r
+ddshi211 shift -9934567890123456   -15 -> -9\r
+ddshi212 shift -9934567890123456   -16 -> -0\r
+\r
+\r
+-- Specials; NaNs are handled as usual\r
+ddshi781 shift -Inf  -8     -> -Infinity\r
+ddshi782 shift -Inf  -1     -> -Infinity\r
+ddshi783 shift -Inf  -0     -> -Infinity\r
+ddshi784 shift -Inf   0     -> -Infinity\r
+ddshi785 shift -Inf   1     -> -Infinity\r
+ddshi786 shift -Inf   8     -> -Infinity\r
+ddshi787 shift -1000 -Inf   -> NaN Invalid_operation\r
+ddshi788 shift -Inf  -Inf   -> NaN Invalid_operation\r
+ddshi789 shift -1    -Inf   -> NaN Invalid_operation\r
+ddshi790 shift -0    -Inf   -> NaN Invalid_operation\r
+ddshi791 shift  0    -Inf   -> NaN Invalid_operation\r
+ddshi792 shift  1    -Inf   -> NaN Invalid_operation\r
+ddshi793 shift  1000 -Inf   -> NaN Invalid_operation\r
+ddshi794 shift  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+ddshi800 shift  Inf  -Inf   -> NaN Invalid_operation\r
+ddshi801 shift  Inf  -8     -> Infinity\r
+ddshi802 shift  Inf  -1     -> Infinity\r
+ddshi803 shift  Inf  -0     -> Infinity\r
+ddshi804 shift  Inf   0     -> Infinity\r
+ddshi805 shift  Inf   1     -> Infinity\r
+ddshi806 shift  Inf   8     -> Infinity\r
+ddshi807 shift  Inf   Inf   -> NaN Invalid_operation\r
+ddshi808 shift -1000  Inf   -> NaN Invalid_operation\r
+ddshi809 shift -Inf   Inf   -> NaN Invalid_operation\r
+ddshi810 shift -1     Inf   -> NaN Invalid_operation\r
+ddshi811 shift -0     Inf   -> NaN Invalid_operation\r
+ddshi812 shift  0     Inf   -> NaN Invalid_operation\r
+ddshi813 shift  1     Inf   -> NaN Invalid_operation\r
+ddshi814 shift  1000  Inf   -> NaN Invalid_operation\r
+ddshi815 shift  Inf   Inf   -> NaN Invalid_operation\r
+\r
+ddshi821 shift  NaN -Inf    ->  NaN\r
+ddshi822 shift  NaN -1000   ->  NaN\r
+ddshi823 shift  NaN -1      ->  NaN\r
+ddshi824 shift  NaN -0      ->  NaN\r
+ddshi825 shift  NaN  0      ->  NaN\r
+ddshi826 shift  NaN  1      ->  NaN\r
+ddshi827 shift  NaN  1000   ->  NaN\r
+ddshi828 shift  NaN  Inf    ->  NaN\r
+ddshi829 shift  NaN  NaN    ->  NaN\r
+ddshi830 shift -Inf  NaN    ->  NaN\r
+ddshi831 shift -1000 NaN    ->  NaN\r
+ddshi832 shift -1    NaN    ->  NaN\r
+ddshi833 shift -0    NaN    ->  NaN\r
+ddshi834 shift  0    NaN    ->  NaN\r
+ddshi835 shift  1    NaN    ->  NaN\r
+ddshi836 shift  1000 NaN    ->  NaN\r
+ddshi837 shift  Inf  NaN    ->  NaN\r
+\r
+ddshi841 shift  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddshi842 shift  sNaN -1000  ->  NaN  Invalid_operation\r
+ddshi843 shift  sNaN -1     ->  NaN  Invalid_operation\r
+ddshi844 shift  sNaN -0     ->  NaN  Invalid_operation\r
+ddshi845 shift  sNaN  0     ->  NaN  Invalid_operation\r
+ddshi846 shift  sNaN  1     ->  NaN  Invalid_operation\r
+ddshi847 shift  sNaN  1000  ->  NaN  Invalid_operation\r
+ddshi848 shift  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddshi849 shift  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddshi850 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddshi851 shift -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddshi852 shift -1000 sNaN   ->  NaN  Invalid_operation\r
+ddshi853 shift -1    sNaN   ->  NaN  Invalid_operation\r
+ddshi854 shift -0    sNaN   ->  NaN  Invalid_operation\r
+ddshi855 shift  0    sNaN   ->  NaN  Invalid_operation\r
+ddshi856 shift  1    sNaN   ->  NaN  Invalid_operation\r
+ddshi857 shift  1000 sNaN   ->  NaN  Invalid_operation\r
+ddshi858 shift  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddshi859 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddshi861 shift  NaN1   -Inf    ->  NaN1\r
+ddshi862 shift +NaN2   -1000   ->  NaN2\r
+ddshi863 shift  NaN3    1000   ->  NaN3\r
+ddshi864 shift  NaN4    Inf    ->  NaN4\r
+ddshi865 shift  NaN5   +NaN6   ->  NaN5\r
+ddshi866 shift -Inf     NaN7   ->  NaN7\r
+ddshi867 shift -1000    NaN8   ->  NaN8\r
+ddshi868 shift  1000    NaN9   ->  NaN9\r
+ddshi869 shift  Inf    +NaN10  ->  NaN10\r
+ddshi871 shift  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+ddshi872 shift  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+ddshi873 shift  sNaN13   1000  ->  NaN13  Invalid_operation\r
+ddshi874 shift  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+ddshi875 shift  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+ddshi876 shift  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+ddshi877 shift -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+ddshi878 shift -1000    sNaN21 ->  NaN21  Invalid_operation\r
+ddshi879 shift  1000    sNaN22 ->  NaN22  Invalid_operation\r
+ddshi880 shift  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+ddshi881 shift +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+ddshi882 shift -NaN26    NaN28 -> -NaN26\r
+ddshi883 shift -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+ddshi884 shift  1000    -NaN30 -> -NaN30\r
+ddshi885 shift  1000   -sNaN31 -> -NaN31  Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddSubtract.decTest b/Lib/test/decimaltestdata/ddSubtract.decTest
new file mode 100644 (file)
index 0000000..89895e9
--- /dev/null
@@ -0,0 +1,629 @@
+------------------------------------------------------------------------\r
+-- ddSubtract.decTest -- decDouble subtraction                        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decDoubles only; all arguments are\r
+-- representable in a decDouble\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- [first group are 'quick confidence check']\r
+ddsub001 subtract  0   0  -> '0'\r
+ddsub002 subtract  1   1  -> '0'\r
+ddsub003 subtract  1   2  -> '-1'\r
+ddsub004 subtract  2   1  -> '1'\r
+ddsub005 subtract  2   2  -> '0'\r
+ddsub006 subtract  3   2  -> '1'\r
+ddsub007 subtract  2   3  -> '-1'\r
+\r
+ddsub011 subtract -0   0  -> '-0'\r
+ddsub012 subtract -1   1  -> '-2'\r
+ddsub013 subtract -1   2  -> '-3'\r
+ddsub014 subtract -2   1  -> '-3'\r
+ddsub015 subtract -2   2  -> '-4'\r
+ddsub016 subtract -3   2  -> '-5'\r
+ddsub017 subtract -2   3  -> '-5'\r
+\r
+ddsub021 subtract  0  -0  -> '0'\r
+ddsub022 subtract  1  -1  -> '2'\r
+ddsub023 subtract  1  -2  -> '3'\r
+ddsub024 subtract  2  -1  -> '3'\r
+ddsub025 subtract  2  -2  -> '4'\r
+ddsub026 subtract  3  -2  -> '5'\r
+ddsub027 subtract  2  -3  -> '5'\r
+\r
+ddsub030 subtract  11  1  -> 10\r
+ddsub031 subtract  10  1  ->  9\r
+ddsub032 subtract  9   1  ->  8\r
+ddsub033 subtract  1   1  ->  0\r
+ddsub034 subtract  0   1  -> -1\r
+ddsub035 subtract -1   1  -> -2\r
+ddsub036 subtract -9   1  -> -10\r
+ddsub037 subtract -10  1  -> -11\r
+ddsub038 subtract -11  1  -> -12\r
+\r
+ddsub040 subtract '5.75' '3.3'  -> '2.45'\r
+ddsub041 subtract '5'    '-3'   -> '8'\r
+ddsub042 subtract '-5'   '-3'   -> '-2'\r
+ddsub043 subtract '-7'   '2.5'  -> '-9.5'\r
+ddsub044 subtract '0.7'  '0.3'  -> '0.4'\r
+ddsub045 subtract '1.3'  '0.3'  -> '1.0'\r
+ddsub046 subtract '1.25' '1.25' -> '0.00'\r
+\r
+ddsub050 subtract '1.23456789'    '1.00000000' -> '0.23456789'\r
+ddsub051 subtract '1.23456789'    '1.00000089' -> '0.23456700'\r
+\r
+ddsub060 subtract '70'    '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded\r
+ddsub061 subtract '700'    '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded\r
+ddsub062 subtract '7000'    '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded\r
+ddsub063 subtract '70000'    '10000e+16' -> '-9.999999999999993E+19' Rounded\r
+ddsub064 subtract '700000'    '10000e+16' -> '-9.999999999999930E+19' Rounded\r
+  -- symmetry:\r
+ddsub065 subtract '10000e+16'    '70' -> '1.000000000000000E+20' Inexact Rounded\r
+ddsub066 subtract '10000e+16'    '700' -> '1.000000000000000E+20' Inexact Rounded\r
+ddsub067 subtract '10000e+16'    '7000' -> '9.999999999999999E+19' Inexact Rounded\r
+ddsub068 subtract '10000e+16'    '70000' -> '9.999999999999993E+19' Rounded\r
+ddsub069 subtract '10000e+16'    '700000' -> '9.999999999999930E+19' Rounded\r
+\r
+  -- some of the next group are really constructor tests\r
+ddsub090 subtract '00.0'    '0.0'  -> '0.0'\r
+ddsub091 subtract '00.0'    '0.00' -> '0.00'\r
+ddsub092 subtract '0.00'    '00.0' -> '0.00'\r
+ddsub093 subtract '00.0'    '0.00' -> '0.00'\r
+ddsub094 subtract '0.00'    '00.0' -> '0.00'\r
+ddsub095 subtract '3'    '.3'   -> '2.7'\r
+ddsub096 subtract '3.'   '.3'   -> '2.7'\r
+ddsub097 subtract '3.0'  '.3'   -> '2.7'\r
+ddsub098 subtract '3.00' '.3'   -> '2.70'\r
+ddsub099 subtract '3'    '3'    -> '0'\r
+ddsub100 subtract '3'    '+3'   -> '0'\r
+ddsub101 subtract '3'    '-3'   -> '6'\r
+ddsub102 subtract '3'    '0.3'  -> '2.7'\r
+ddsub103 subtract '3.'   '0.3'  -> '2.7'\r
+ddsub104 subtract '3.0'  '0.3'  -> '2.7'\r
+ddsub105 subtract '3.00' '0.3'  -> '2.70'\r
+ddsub106 subtract '3'    '3.0'  -> '0.0'\r
+ddsub107 subtract '3'    '+3.0' -> '0.0'\r
+ddsub108 subtract '3'    '-3.0' -> '6.0'\r
+\r
+-- the above all from add; massaged and extended.  Now some new ones...\r
+-- [particularly important for comparisons]\r
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7\r
+-- with input rounding.\r
+ddsub120 subtract  '10.23456784'    '10.23456789'  -> '-5E-8'\r
+ddsub121 subtract  '10.23456785'    '10.23456789'  -> '-4E-8'\r
+ddsub122 subtract  '10.23456786'    '10.23456789'  -> '-3E-8'\r
+ddsub123 subtract  '10.23456787'    '10.23456789'  -> '-2E-8'\r
+ddsub124 subtract  '10.23456788'    '10.23456789'  -> '-1E-8'\r
+ddsub125 subtract  '10.23456789'    '10.23456789'  -> '0E-8'\r
+ddsub126 subtract  '10.23456790'    '10.23456789'  -> '1E-8'\r
+ddsub127 subtract  '10.23456791'    '10.23456789'  -> '2E-8'\r
+ddsub128 subtract  '10.23456792'    '10.23456789'  -> '3E-8'\r
+ddsub129 subtract  '10.23456793'    '10.23456789'  -> '4E-8'\r
+ddsub130 subtract  '10.23456794'    '10.23456789'  -> '5E-8'\r
+ddsub131 subtract  '10.23456781'    '10.23456786'  -> '-5E-8'\r
+ddsub132 subtract  '10.23456782'    '10.23456786'  -> '-4E-8'\r
+ddsub133 subtract  '10.23456783'    '10.23456786'  -> '-3E-8'\r
+ddsub134 subtract  '10.23456784'    '10.23456786'  -> '-2E-8'\r
+ddsub135 subtract  '10.23456785'    '10.23456786'  -> '-1E-8'\r
+ddsub136 subtract  '10.23456786'    '10.23456786'  -> '0E-8'\r
+ddsub137 subtract  '10.23456787'    '10.23456786'  -> '1E-8'\r
+ddsub138 subtract  '10.23456788'    '10.23456786'  -> '2E-8'\r
+ddsub139 subtract  '10.23456789'    '10.23456786'  -> '3E-8'\r
+ddsub140 subtract  '10.23456790'    '10.23456786'  -> '4E-8'\r
+ddsub141 subtract  '10.23456791'    '10.23456786'  -> '5E-8'\r
+ddsub142 subtract  '1'              '0.999999999'  -> '1E-9'\r
+ddsub143 subtract  '0.999999999'    '1'            -> '-1E-9'\r
+ddsub144 subtract  '-10.23456780'   '-10.23456786' -> '6E-8'\r
+ddsub145 subtract  '-10.23456790'   '-10.23456786' -> '-4E-8'\r
+ddsub146 subtract  '-10.23456791'   '-10.23456786' -> '-5E-8'\r
+\r
+-- additional scaled arithmetic tests [0.97 problem]\r
+ddsub160 subtract '0'     '.1'      -> '-0.1'\r
+ddsub161 subtract '00'    '.97983'  -> '-0.97983'\r
+ddsub162 subtract '0'     '.9'      -> '-0.9'\r
+ddsub163 subtract '0'     '0.102'   -> '-0.102'\r
+ddsub164 subtract '0'     '.4'      -> '-0.4'\r
+ddsub165 subtract '0'     '.307'    -> '-0.307'\r
+ddsub166 subtract '0'     '.43822'  -> '-0.43822'\r
+ddsub167 subtract '0'     '.911'    -> '-0.911'\r
+ddsub168 subtract '.0'    '.02'     -> '-0.02'\r
+ddsub169 subtract '00'    '.392'    -> '-0.392'\r
+ddsub170 subtract '0'     '.26'     -> '-0.26'\r
+ddsub171 subtract '0'     '0.51'    -> '-0.51'\r
+ddsub172 subtract '0'     '.2234'   -> '-0.2234'\r
+ddsub173 subtract '0'     '.2'      -> '-0.2'\r
+ddsub174 subtract '.0'    '.0008'   -> '-0.0008'\r
+-- 0. on left\r
+ddsub180 subtract '0.0'     '-.1'      -> '0.1'\r
+ddsub181 subtract '0.00'    '-.97983'  -> '0.97983'\r
+ddsub182 subtract '0.0'     '-.9'      -> '0.9'\r
+ddsub183 subtract '0.0'     '-0.102'   -> '0.102'\r
+ddsub184 subtract '0.0'     '-.4'      -> '0.4'\r
+ddsub185 subtract '0.0'     '-.307'    -> '0.307'\r
+ddsub186 subtract '0.0'     '-.43822'  -> '0.43822'\r
+ddsub187 subtract '0.0'     '-.911'    -> '0.911'\r
+ddsub188 subtract '0.0'     '-.02'     -> '0.02'\r
+ddsub189 subtract '0.00'    '-.392'    -> '0.392'\r
+ddsub190 subtract '0.0'     '-.26'     -> '0.26'\r
+ddsub191 subtract '0.0'     '-0.51'    -> '0.51'\r
+ddsub192 subtract '0.0'     '-.2234'   -> '0.2234'\r
+ddsub193 subtract '0.0'     '-.2'      -> '0.2'\r
+ddsub194 subtract '0.0'     '-.0008'   -> '0.0008'\r
+-- negatives of same\r
+ddsub200 subtract '0'     '-.1'      -> '0.1'\r
+ddsub201 subtract '00'    '-.97983'  -> '0.97983'\r
+ddsub202 subtract '0'     '-.9'      -> '0.9'\r
+ddsub203 subtract '0'     '-0.102'   -> '0.102'\r
+ddsub204 subtract '0'     '-.4'      -> '0.4'\r
+ddsub205 subtract '0'     '-.307'    -> '0.307'\r
+ddsub206 subtract '0'     '-.43822'  -> '0.43822'\r
+ddsub207 subtract '0'     '-.911'    -> '0.911'\r
+ddsub208 subtract '.0'    '-.02'     -> '0.02'\r
+ddsub209 subtract '00'    '-.392'    -> '0.392'\r
+ddsub210 subtract '0'     '-.26'     -> '0.26'\r
+ddsub211 subtract '0'     '-0.51'    -> '0.51'\r
+ddsub212 subtract '0'     '-.2234'   -> '0.2234'\r
+ddsub213 subtract '0'     '-.2'      -> '0.2'\r
+ddsub214 subtract '.0'    '-.0008'   -> '0.0008'\r
+\r
+-- more fixed, LHS swaps [really the same as testcases under add]\r
+ddsub220 subtract '-56267E-12' 0  -> '-5.6267E-8'\r
+ddsub221 subtract '-56267E-11' 0  -> '-5.6267E-7'\r
+ddsub222 subtract '-56267E-10' 0  -> '-0.0000056267'\r
+ddsub223 subtract '-56267E-9'  0  -> '-0.000056267'\r
+ddsub224 subtract '-56267E-8'  0  -> '-0.00056267'\r
+ddsub225 subtract '-56267E-7'  0  -> '-0.0056267'\r
+ddsub226 subtract '-56267E-6'  0  -> '-0.056267'\r
+ddsub227 subtract '-56267E-5'  0  -> '-0.56267'\r
+ddsub228 subtract '-56267E-2'  0  -> '-562.67'\r
+ddsub229 subtract '-56267E-1'  0  -> '-5626.7'\r
+ddsub230 subtract '-56267E-0'  0  -> '-56267'\r
+-- symmetry ...\r
+ddsub240 subtract 0 '-56267E-12'  -> '5.6267E-8'\r
+ddsub241 subtract 0 '-56267E-11'  -> '5.6267E-7'\r
+ddsub242 subtract 0 '-56267E-10'  -> '0.0000056267'\r
+ddsub243 subtract 0 '-56267E-9'   -> '0.000056267'\r
+ddsub244 subtract 0 '-56267E-8'   -> '0.00056267'\r
+ddsub245 subtract 0 '-56267E-7'   -> '0.0056267'\r
+ddsub246 subtract 0 '-56267E-6'   -> '0.056267'\r
+ddsub247 subtract 0 '-56267E-5'   -> '0.56267'\r
+ddsub248 subtract 0 '-56267E-2'   -> '562.67'\r
+ddsub249 subtract 0 '-56267E-1'   -> '5626.7'\r
+ddsub250 subtract 0 '-56267E-0'   -> '56267'\r
+\r
+-- now some more from the 'new' add\r
+ddsub301 subtract '1.23456789'  '1.00000000' -> '0.23456789'\r
+ddsub302 subtract '1.23456789'  '1.00000011' -> '0.23456778'\r
+\r
+-- some carrying effects\r
+ddsub321 subtract '0.9998'  '0.0000' -> '0.9998'\r
+ddsub322 subtract '0.9998'  '0.0001' -> '0.9997'\r
+ddsub323 subtract '0.9998'  '0.0002' -> '0.9996'\r
+ddsub324 subtract '0.9998'  '0.0003' -> '0.9995'\r
+ddsub325 subtract '0.9998'  '-0.0000' -> '0.9998'\r
+ddsub326 subtract '0.9998'  '-0.0001' -> '0.9999'\r
+ddsub327 subtract '0.9998'  '-0.0002' -> '1.0000'\r
+ddsub328 subtract '0.9998'  '-0.0003' -> '1.0001'\r
+\r
+-- internal boundaries\r
+ddsub346 subtract '10000e+9'  '7'   -> '9999999999993'\r
+ddsub347 subtract '10000e+9'  '70'   -> '9999999999930'\r
+ddsub348 subtract '10000e+9'  '700'   -> '9999999999300'\r
+ddsub349 subtract '10000e+9'  '7000'   -> '9999999993000'\r
+ddsub350 subtract '10000e+9'  '70000'   -> '9999999930000'\r
+ddsub351 subtract '10000e+9'  '700000'   -> '9999999300000'\r
+ddsub352 subtract '7' '10000e+9'   -> '-9999999999993'\r
+ddsub353 subtract '70' '10000e+9'   -> '-9999999999930'\r
+ddsub354 subtract '700' '10000e+9'   -> '-9999999999300'\r
+ddsub355 subtract '7000' '10000e+9'   -> '-9999999993000'\r
+ddsub356 subtract '70000' '10000e+9'   -> '-9999999930000'\r
+ddsub357 subtract '700000' '10000e+9'   -> '-9999999300000'\r
+\r
+-- zero preservation\r
+ddsub361 subtract 1 '0.0001' -> '0.9999'\r
+ddsub362 subtract 1 '0.00001' -> '0.99999'\r
+ddsub363 subtract 1 '0.000001' -> '0.999999'\r
+ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'\r
+ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded\r
+ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded\r
+\r
+-- some funny zeros [in case of bad signum]\r
+ddsub370 subtract 1  0  -> 1\r
+ddsub371 subtract 1 0.  -> 1\r
+ddsub372 subtract 1  .0 -> 1.0\r
+ddsub373 subtract 1 0.0 -> 1.0\r
+ddsub374 subtract  0  1 -> -1\r
+ddsub375 subtract 0.  1 -> -1\r
+ddsub376 subtract  .0 1 -> -1.0\r
+ddsub377 subtract 0.0 1 -> -1.0\r
+\r
+-- leading 0 digit before round\r
+ddsub910 subtract -103519362 -51897955.3 -> -51621406.7\r
+ddsub911 subtract 159579.444 89827.5229 -> 69751.9211\r
+\r
+ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded\r
+ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded\r
+ddsub922 subtract 133.0000000123456 33.00000001234565 ->  99.99999999999995\r
+ddsub923 subtract 133.0000000123456 33.00000001234564 ->  99.99999999999996\r
+ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded\r
+ddsub925 subtract 133.0000000123456 43.00000001234560 ->  90.00000000000000\r
+ddsub926 subtract 133.0000000123456 43.00000001234561 ->  89.99999999999999\r
+ddsub927 subtract 133.0000000123456 43.00000001234566 ->  89.99999999999994\r
+ddsub928 subtract 101.0000000123456 91.00000001234566 ->   9.99999999999994\r
+ddsub929 subtract 101.0000000123456 99.00000001234566 ->   1.99999999999994\r
+\r
+-- more LHS swaps [were fixed]\r
+ddsub390 subtract '-56267E-10'   0 ->  '-0.0000056267'\r
+ddsub391 subtract '-56267E-6'    0 ->  '-0.056267'\r
+ddsub392 subtract '-56267E-5'    0 ->  '-0.56267'\r
+ddsub393 subtract '-56267E-4'    0 ->  '-5.6267'\r
+ddsub394 subtract '-56267E-3'    0 ->  '-56.267'\r
+ddsub395 subtract '-56267E-2'    0 ->  '-562.67'\r
+ddsub396 subtract '-56267E-1'    0 ->  '-5626.7'\r
+ddsub397 subtract '-56267E-0'    0 ->  '-56267'\r
+ddsub398 subtract '-5E-10'       0 ->  '-5E-10'\r
+ddsub399 subtract '-5E-7'        0 ->  '-5E-7'\r
+ddsub400 subtract '-5E-6'        0 ->  '-0.000005'\r
+ddsub401 subtract '-5E-5'        0 ->  '-0.00005'\r
+ddsub402 subtract '-5E-4'        0 ->  '-0.0005'\r
+ddsub403 subtract '-5E-1'        0 ->  '-0.5'\r
+ddsub404 subtract '-5E0'         0 ->  '-5'\r
+ddsub405 subtract '-5E1'         0 ->  '-50'\r
+ddsub406 subtract '-5E5'         0 ->  '-500000'\r
+ddsub407 subtract '-5E15'        0 ->  '-5000000000000000'\r
+ddsub408 subtract '-5E16'        0 ->  '-5.000000000000000E+16'  Rounded\r
+ddsub409 subtract '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded\r
+ddsub410 subtract '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded\r
+ddsub411 subtract '-5E100'       0 ->  '-5.000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps [were fixed]\r
+ddsub420 subtract 0  '-56267E-10' ->  '0.0000056267'\r
+ddsub421 subtract 0  '-56267E-6'  ->  '0.056267'\r
+ddsub422 subtract 0  '-56267E-5'  ->  '0.56267'\r
+ddsub423 subtract 0  '-56267E-4'  ->  '5.6267'\r
+ddsub424 subtract 0  '-56267E-3'  ->  '56.267'\r
+ddsub425 subtract 0  '-56267E-2'  ->  '562.67'\r
+ddsub426 subtract 0  '-56267E-1'  ->  '5626.7'\r
+ddsub427 subtract 0  '-56267E-0'  ->  '56267'\r
+ddsub428 subtract 0  '-5E-10'     ->  '5E-10'\r
+ddsub429 subtract 0  '-5E-7'      ->  '5E-7'\r
+ddsub430 subtract 0  '-5E-6'      ->  '0.000005'\r
+ddsub431 subtract 0  '-5E-5'      ->  '0.00005'\r
+ddsub432 subtract 0  '-5E-4'      ->  '0.0005'\r
+ddsub433 subtract 0  '-5E-1'      ->  '0.5'\r
+ddsub434 subtract 0  '-5E0'       ->  '5'\r
+ddsub435 subtract 0  '-5E1'       ->  '50'\r
+ddsub436 subtract 0  '-5E5'       ->  '500000'\r
+ddsub437 subtract 0  '-5E15'      ->  '5000000000000000'\r
+ddsub438 subtract 0  '-5E16'      ->  '5.000000000000000E+16'   Rounded\r
+ddsub439 subtract 0  '-5E17'      ->  '5.000000000000000E+17'   Rounded\r
+ddsub440 subtract 0  '-5E18'      ->  '5.000000000000000E+18'   Rounded\r
+ddsub441 subtract 0  '-5E100'     ->  '5.000000000000000E+100'  Rounded\r
+\r
+\r
+-- try borderline precision, with carries, etc.\r
+ddsub461 subtract '1E+16' '1'        -> '9999999999999999'\r
+ddsub462 subtract '1E+12' '-1.111'   -> '1000000000001.111'\r
+ddsub463 subtract '1.111'  '-1E+12'  -> '1000000000001.111'\r
+ddsub464 subtract '-1'    '-1E+16'   -> '9999999999999999'\r
+ddsub465 subtract '7E+15' '1'        -> '6999999999999999'\r
+ddsub466 subtract '7E+12' '-1.111'   -> '7000000000001.111'\r
+ddsub467 subtract '1.111'  '-7E+12'  -> '7000000000001.111'\r
+ddsub468 subtract '-1'    '-7E+15'   -> '6999999999999999'\r
+\r
+--                  1234567890123456       1234567890123456      1 23456789012345\r
+ddsub470 subtract '0.4444444444444444'  '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded\r
+ddsub471 subtract '0.4444444444444444'  '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded\r
+ddsub472 subtract '0.4444444444444444'  '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded\r
+ddsub473 subtract '0.4444444444444444'  '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded\r
+ddsub474 subtract '0.4444444444444444'  '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded\r
+ddsub475 subtract '0.4444444444444444'  '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded\r
+ddsub476 subtract '0.4444444444444444'  '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded\r
+ddsub477 subtract '0.4444444444444444'  '-0.5555555555555556' -> '1.000000000000000' Rounded\r
+ddsub478 subtract '0.4444444444444444'  '-0.5555555555555555' -> '0.9999999999999999'\r
+ddsub479 subtract '0.4444444444444444'  '-0.5555555555555554' -> '0.9999999999999998'\r
+ddsub480 subtract '0.4444444444444444'  '-0.5555555555555553' -> '0.9999999999999997'\r
+ddsub481 subtract '0.4444444444444444'  '-0.5555555555555552' -> '0.9999999999999996'\r
+ddsub482 subtract '0.4444444444444444'  '-0.5555555555555551' -> '0.9999999999999995'\r
+ddsub483 subtract '0.4444444444444444'  '-0.5555555555555550' -> '0.9999999999999994'\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+ddsub500 subtract '1231234567456789' 0             -> '1231234567456789'\r
+ddsub501 subtract '1231234567456789' 0.000000001   -> '1231234567456789' Inexact Rounded\r
+ddsub502 subtract '1231234567456789' 0.000001      -> '1231234567456789' Inexact Rounded\r
+ddsub503 subtract '1231234567456789' 0.1           -> '1231234567456789' Inexact Rounded\r
+ddsub504 subtract '1231234567456789' 0.4           -> '1231234567456789' Inexact Rounded\r
+ddsub505 subtract '1231234567456789' 0.49          -> '1231234567456789' Inexact Rounded\r
+ddsub506 subtract '1231234567456789' 0.499999      -> '1231234567456789' Inexact Rounded\r
+ddsub507 subtract '1231234567456789' 0.499999999   -> '1231234567456789' Inexact Rounded\r
+ddsub508 subtract '1231234567456789' 0.5           -> '1231234567456789' Inexact Rounded\r
+ddsub509 subtract '1231234567456789' 0.500000001   -> '1231234567456788' Inexact Rounded\r
+ddsub510 subtract '1231234567456789' 0.500001      -> '1231234567456788' Inexact Rounded\r
+ddsub511 subtract '1231234567456789' 0.51          -> '1231234567456788' Inexact Rounded\r
+ddsub512 subtract '1231234567456789' 0.6           -> '1231234567456788' Inexact Rounded\r
+ddsub513 subtract '1231234567456789' 0.9           -> '1231234567456788' Inexact Rounded\r
+ddsub514 subtract '1231234567456789' 0.99999       -> '1231234567456788' Inexact Rounded\r
+ddsub515 subtract '1231234567456789' 0.999999999   -> '1231234567456788' Inexact Rounded\r
+ddsub516 subtract '1231234567456789' 1             -> '1231234567456788'\r
+ddsub517 subtract '1231234567456789' 1.000000001   -> '1231234567456788' Inexact Rounded\r
+ddsub518 subtract '1231234567456789' 1.00001       -> '1231234567456788' Inexact Rounded\r
+ddsub519 subtract '1231234567456789' 1.1           -> '1231234567456788' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddsub520 subtract '1231234567456789' 0             -> '1231234567456789'\r
+ddsub521 subtract '1231234567456789' 0.000000001   -> '1231234567456789' Inexact Rounded\r
+ddsub522 subtract '1231234567456789' 0.000001      -> '1231234567456789' Inexact Rounded\r
+ddsub523 subtract '1231234567456789' 0.1           -> '1231234567456789' Inexact Rounded\r
+ddsub524 subtract '1231234567456789' 0.4           -> '1231234567456789' Inexact Rounded\r
+ddsub525 subtract '1231234567456789' 0.49          -> '1231234567456789' Inexact Rounded\r
+ddsub526 subtract '1231234567456789' 0.499999      -> '1231234567456789' Inexact Rounded\r
+ddsub527 subtract '1231234567456789' 0.499999999   -> '1231234567456789' Inexact Rounded\r
+ddsub528 subtract '1231234567456789' 0.5           -> '1231234567456788' Inexact Rounded\r
+ddsub529 subtract '1231234567456789' 0.500000001   -> '1231234567456788' Inexact Rounded\r
+ddsub530 subtract '1231234567456789' 0.500001      -> '1231234567456788' Inexact Rounded\r
+ddsub531 subtract '1231234567456789' 0.51          -> '1231234567456788' Inexact Rounded\r
+ddsub532 subtract '1231234567456789' 0.6           -> '1231234567456788' Inexact Rounded\r
+ddsub533 subtract '1231234567456789' 0.9           -> '1231234567456788' Inexact Rounded\r
+ddsub534 subtract '1231234567456789' 0.99999       -> '1231234567456788' Inexact Rounded\r
+ddsub535 subtract '1231234567456789' 0.999999999   -> '1231234567456788' Inexact Rounded\r
+ddsub536 subtract '1231234567456789' 1             -> '1231234567456788'\r
+ddsub537 subtract '1231234567456789' 1.00000001    -> '1231234567456788' Inexact Rounded\r
+ddsub538 subtract '1231234567456789' 1.00001       -> '1231234567456788' Inexact Rounded\r
+ddsub539 subtract '1231234567456789' 1.1           -> '1231234567456788' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+ddsub540 subtract '1231234567456788' 0.499999999   -> '1231234567456788' Inexact Rounded\r
+ddsub541 subtract '1231234567456788' 0.5           -> '1231234567456788' Inexact Rounded\r
+ddsub542 subtract '1231234567456788' 0.500000001   -> '1231234567456787' Inexact Rounded\r
+\r
+rounding: down\r
+ddsub550 subtract '1231234567456789' 0             -> '1231234567456789'\r
+ddsub551 subtract '1231234567456789' 0.000000001   -> '1231234567456788' Inexact Rounded\r
+ddsub552 subtract '1231234567456789' 0.000001      -> '1231234567456788' Inexact Rounded\r
+ddsub553 subtract '1231234567456789' 0.1           -> '1231234567456788' Inexact Rounded\r
+ddsub554 subtract '1231234567456789' 0.4           -> '1231234567456788' Inexact Rounded\r
+ddsub555 subtract '1231234567456789' 0.49          -> '1231234567456788' Inexact Rounded\r
+ddsub556 subtract '1231234567456789' 0.499999      -> '1231234567456788' Inexact Rounded\r
+ddsub557 subtract '1231234567456789' 0.499999999   -> '1231234567456788' Inexact Rounded\r
+ddsub558 subtract '1231234567456789' 0.5           -> '1231234567456788' Inexact Rounded\r
+ddsub559 subtract '1231234567456789' 0.500000001   -> '1231234567456788' Inexact Rounded\r
+ddsub560 subtract '1231234567456789' 0.500001      -> '1231234567456788' Inexact Rounded\r
+ddsub561 subtract '1231234567456789' 0.51          -> '1231234567456788' Inexact Rounded\r
+ddsub562 subtract '1231234567456789' 0.6           -> '1231234567456788' Inexact Rounded\r
+ddsub563 subtract '1231234567456789' 0.9           -> '1231234567456788' Inexact Rounded\r
+ddsub564 subtract '1231234567456789' 0.99999       -> '1231234567456788' Inexact Rounded\r
+ddsub565 subtract '1231234567456789' 0.999999999   -> '1231234567456788' Inexact Rounded\r
+ddsub566 subtract '1231234567456789' 1             -> '1231234567456788'\r
+ddsub567 subtract '1231234567456789' 1.00000001    -> '1231234567456787' Inexact Rounded\r
+ddsub568 subtract '1231234567456789' 1.00001       -> '1231234567456787' Inexact Rounded\r
+ddsub569 subtract '1231234567456789' 1.1           -> '1231234567456787' Inexact Rounded\r
+\r
+-- symmetry...\r
+rounding: half_up\r
+ddsub600 subtract 0             '1231234567456789' -> '-1231234567456789'\r
+ddsub601 subtract 0.000000001   '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub602 subtract 0.000001      '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub603 subtract 0.1           '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub604 subtract 0.4           '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub605 subtract 0.49          '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub606 subtract 0.499999      '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub607 subtract 0.499999999   '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub608 subtract 0.5           '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub609 subtract 0.500000001   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub610 subtract 0.500001      '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub611 subtract 0.51          '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub612 subtract 0.6           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub613 subtract 0.9           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub614 subtract 0.99999       '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub615 subtract 0.999999999   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub616 subtract 1             '1231234567456789' -> '-1231234567456788'\r
+ddsub617 subtract 1.000000001   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub618 subtract 1.00001       '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub619 subtract 1.1           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+\r
+rounding: half_even\r
+ddsub620 subtract 0             '1231234567456789' -> '-1231234567456789'\r
+ddsub621 subtract 0.000000001   '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub622 subtract 0.000001      '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub623 subtract 0.1           '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub624 subtract 0.4           '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub625 subtract 0.49          '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub626 subtract 0.499999      '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub627 subtract 0.499999999   '1231234567456789' -> '-1231234567456789' Inexact Rounded\r
+ddsub628 subtract 0.5           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub629 subtract 0.500000001   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub630 subtract 0.500001      '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub631 subtract 0.51          '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub632 subtract 0.6           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub633 subtract 0.9           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub634 subtract 0.99999       '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub635 subtract 0.999999999   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub636 subtract 1             '1231234567456789' -> '-1231234567456788'\r
+ddsub637 subtract 1.00000001    '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub638 subtract 1.00001       '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub639 subtract 1.1           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+ddsub640 subtract 0.499999999   '1231234567456788' -> '-1231234567456788' Inexact Rounded\r
+ddsub641 subtract 0.5           '1231234567456788' -> '-1231234567456788' Inexact Rounded\r
+ddsub642 subtract 0.500000001   '1231234567456788' -> '-1231234567456787' Inexact Rounded\r
+\r
+rounding: down\r
+ddsub650 subtract 0             '1231234567456789' -> '-1231234567456789'\r
+ddsub651 subtract 0.000000001   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub652 subtract 0.000001      '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub653 subtract 0.1           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub654 subtract 0.4           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub655 subtract 0.49          '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub656 subtract 0.499999      '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub657 subtract 0.499999999   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub658 subtract 0.5           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub659 subtract 0.500000001   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub660 subtract 0.500001      '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub661 subtract 0.51          '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub662 subtract 0.6           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub663 subtract 0.9           '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub664 subtract 0.99999       '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub665 subtract 0.999999999   '1231234567456789' -> '-1231234567456788' Inexact Rounded\r
+ddsub666 subtract 1             '1231234567456789' -> '-1231234567456788'\r
+ddsub667 subtract 1.00000001    '1231234567456789' -> '-1231234567456787' Inexact Rounded\r
+ddsub668 subtract 1.00001       '1231234567456789' -> '-1231234567456787' Inexact Rounded\r
+ddsub669 subtract 1.1           '1231234567456789' -> '-1231234567456787' Inexact Rounded\r
+\r
+\r
+-- lots of leading zeros in intermediate result, and showing effects of\r
+-- input rounding would have affected the following\r
+rounding: half_up\r
+ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+rounding: half_even\r
+ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9\r
+ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1\r
+ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1\r
+ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5\r
+ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9\r
+\r
+rounding: down\r
+ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+-- Specials\r
+ddsub780 subtract -Inf   Inf   -> -Infinity\r
+ddsub781 subtract -Inf   1000  -> -Infinity\r
+ddsub782 subtract -Inf   1     -> -Infinity\r
+ddsub783 subtract -Inf  -0     -> -Infinity\r
+ddsub784 subtract -Inf  -1     -> -Infinity\r
+ddsub785 subtract -Inf  -1000  -> -Infinity\r
+ddsub787 subtract -1000  Inf   -> -Infinity\r
+ddsub788 subtract -Inf   Inf   -> -Infinity\r
+ddsub789 subtract -1     Inf   -> -Infinity\r
+ddsub790 subtract  0     Inf   -> -Infinity\r
+ddsub791 subtract  1     Inf   -> -Infinity\r
+ddsub792 subtract  1000  Inf   -> -Infinity\r
+\r
+ddsub800 subtract  Inf   Inf   ->  NaN  Invalid_operation\r
+ddsub801 subtract  Inf   1000  ->  Infinity\r
+ddsub802 subtract  Inf   1     ->  Infinity\r
+ddsub803 subtract  Inf   0     ->  Infinity\r
+ddsub804 subtract  Inf  -0     ->  Infinity\r
+ddsub805 subtract  Inf  -1     ->  Infinity\r
+ddsub806 subtract  Inf  -1000  ->  Infinity\r
+ddsub807 subtract  Inf  -Inf   ->  Infinity\r
+ddsub808 subtract -1000 -Inf   ->  Infinity\r
+ddsub809 subtract -Inf  -Inf   ->  NaN  Invalid_operation\r
+ddsub810 subtract -1    -Inf   ->  Infinity\r
+ddsub811 subtract -0    -Inf   ->  Infinity\r
+ddsub812 subtract  0    -Inf   ->  Infinity\r
+ddsub813 subtract  1    -Inf   ->  Infinity\r
+ddsub814 subtract  1000 -Inf   ->  Infinity\r
+ddsub815 subtract  Inf  -Inf   ->  Infinity\r
+\r
+ddsub821 subtract  NaN   Inf   ->  NaN\r
+ddsub822 subtract -NaN   1000  -> -NaN\r
+ddsub823 subtract  NaN   1     ->  NaN\r
+ddsub824 subtract  NaN   0     ->  NaN\r
+ddsub825 subtract  NaN  -0     ->  NaN\r
+ddsub826 subtract  NaN  -1     ->  NaN\r
+ddsub827 subtract  NaN  -1000  ->  NaN\r
+ddsub828 subtract  NaN  -Inf   ->  NaN\r
+ddsub829 subtract -NaN   NaN   -> -NaN\r
+ddsub830 subtract -Inf   NaN   ->  NaN\r
+ddsub831 subtract -1000  NaN   ->  NaN\r
+ddsub832 subtract -1     NaN   ->  NaN\r
+ddsub833 subtract -0     NaN   ->  NaN\r
+ddsub834 subtract  0     NaN   ->  NaN\r
+ddsub835 subtract  1     NaN   ->  NaN\r
+ddsub836 subtract  1000 -NaN   -> -NaN\r
+ddsub837 subtract  Inf   NaN   ->  NaN\r
+\r
+ddsub841 subtract  sNaN  Inf   ->  NaN  Invalid_operation\r
+ddsub842 subtract -sNaN  1000  -> -NaN  Invalid_operation\r
+ddsub843 subtract  sNaN  1     ->  NaN  Invalid_operation\r
+ddsub844 subtract  sNaN  0     ->  NaN  Invalid_operation\r
+ddsub845 subtract  sNaN -0     ->  NaN  Invalid_operation\r
+ddsub846 subtract  sNaN -1     ->  NaN  Invalid_operation\r
+ddsub847 subtract  sNaN -1000  ->  NaN  Invalid_operation\r
+ddsub848 subtract  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddsub849 subtract  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddsub850 subtract  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddsub851 subtract -Inf -sNaN   -> -NaN  Invalid_operation\r
+ddsub852 subtract -1000 sNaN   ->  NaN  Invalid_operation\r
+ddsub853 subtract -1    sNaN   ->  NaN  Invalid_operation\r
+ddsub854 subtract -0    sNaN   ->  NaN  Invalid_operation\r
+ddsub855 subtract  0    sNaN   ->  NaN  Invalid_operation\r
+ddsub856 subtract  1    sNaN   ->  NaN  Invalid_operation\r
+ddsub857 subtract  1000 sNaN   ->  NaN  Invalid_operation\r
+ddsub858 subtract  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddsub859 subtract  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddsub861 subtract  NaN01   -Inf     ->  NaN1\r
+ddsub862 subtract -NaN02   -1000    -> -NaN2\r
+ddsub863 subtract  NaN03    1000    ->  NaN3\r
+ddsub864 subtract  NaN04    Inf     ->  NaN4\r
+ddsub865 subtract  NaN05    NaN61   ->  NaN5\r
+ddsub866 subtract -Inf     -NaN71   -> -NaN71\r
+ddsub867 subtract -1000     NaN81   ->  NaN81\r
+ddsub868 subtract  1000     NaN91   ->  NaN91\r
+ddsub869 subtract  Inf      NaN101  ->  NaN101\r
+ddsub871 subtract  sNaN011  -Inf    ->  NaN11  Invalid_operation\r
+ddsub872 subtract  sNaN012  -1000   ->  NaN12  Invalid_operation\r
+ddsub873 subtract -sNaN013   1000   -> -NaN13  Invalid_operation\r
+ddsub874 subtract  sNaN014   NaN171 ->  NaN14  Invalid_operation\r
+ddsub875 subtract  sNaN015  sNaN181 ->  NaN15  Invalid_operation\r
+ddsub876 subtract  NaN016   sNaN191 ->  NaN191 Invalid_operation\r
+ddsub877 subtract -Inf      sNaN201 ->  NaN201 Invalid_operation\r
+ddsub878 subtract -1000     sNaN211 ->  NaN211 Invalid_operation\r
+ddsub879 subtract  1000    -sNaN221 -> -NaN221 Invalid_operation\r
+ddsub880 subtract  Inf      sNaN231 ->  NaN231 Invalid_operation\r
+ddsub881 subtract  NaN025   sNaN241 ->  NaN241 Invalid_operation\r
+\r
+-- edge case spills\r
+ddsub901 subtract  2.E-3  1.002  -> -1.000\r
+ddsub902 subtract  2.0E-3  1.002  -> -1.0000\r
+ddsub903 subtract  2.00E-3  1.0020  -> -1.00000\r
+ddsub904 subtract  2.000E-3  1.00200  -> -1.000000\r
+ddsub905 subtract  2.0000E-3  1.002000  -> -1.0000000\r
+ddsub906 subtract  2.00000E-3  1.0020000  -> -1.00000000\r
+ddsub907 subtract  2.000000E-3  1.00200000  -> -1.000000000\r
+ddsub908 subtract  2.0000000E-3  1.002000000  -> -1.0000000000\r
+\r
+-- subnormals and overflows covered under Add\r
+\r
+-- Null tests\r
+ddsub9990 subtract 10  # -> NaN Invalid_operation\r
+ddsub9991 subtract  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ddToIntegral.decTest b/Lib/test/decimaltestdata/ddToIntegral.decTest
new file mode 100644 (file)
index 0000000..1e3e573
--- /dev/null
@@ -0,0 +1,257 @@
+------------------------------------------------------------------------\r
+-- ddToIntegral.decTest -- round Double to integral value             --\r
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests tests the extended specification 'round-to-integral\r
+-- value-exact' operations (from IEEE 854, later modified in 754r).\r
+-- All non-zero results are defined as being those from either copy or\r
+-- quantize, so those are assumed to have been tested extensively\r
+-- elsewhere; the tests here are for integrity, rounding mode, etc.\r
+-- Also, it is assumed the test harness will use these tests for both\r
+-- ToIntegralExact (which does set Inexact) and the fixed-name\r
+-- functions (which do not set Inexact).\r
+\r
+-- Note that decNumber implements an earlier definition of toIntegral\r
+-- which never sets Inexact; the decTest operator for that is called\r
+-- 'tointegral' instead of 'tointegralx'.\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+ddintx001 tointegralx      0     ->  0\r
+ddintx002 tointegralx      0.0   ->  0\r
+ddintx003 tointegralx      0.1   ->  0  Inexact Rounded\r
+ddintx004 tointegralx      0.2   ->  0  Inexact Rounded\r
+ddintx005 tointegralx      0.3   ->  0  Inexact Rounded\r
+ddintx006 tointegralx      0.4   ->  0  Inexact Rounded\r
+ddintx007 tointegralx      0.5   ->  0  Inexact Rounded\r
+ddintx008 tointegralx      0.6   ->  1  Inexact Rounded\r
+ddintx009 tointegralx      0.7   ->  1  Inexact Rounded\r
+ddintx010 tointegralx      0.8   ->  1  Inexact Rounded\r
+ddintx011 tointegralx      0.9   ->  1  Inexact Rounded\r
+ddintx012 tointegralx      1     ->  1\r
+ddintx013 tointegralx      1.0   ->  1  Rounded\r
+ddintx014 tointegralx      1.1   ->  1  Inexact Rounded\r
+ddintx015 tointegralx      1.2   ->  1  Inexact Rounded\r
+ddintx016 tointegralx      1.3   ->  1  Inexact Rounded\r
+ddintx017 tointegralx      1.4   ->  1  Inexact Rounded\r
+ddintx018 tointegralx      1.5   ->  2  Inexact Rounded\r
+ddintx019 tointegralx      1.6   ->  2  Inexact Rounded\r
+ddintx020 tointegralx      1.7   ->  2  Inexact Rounded\r
+ddintx021 tointegralx      1.8   ->  2  Inexact Rounded\r
+ddintx022 tointegralx      1.9   ->  2  Inexact Rounded\r
+-- negatives\r
+ddintx031 tointegralx     -0     -> -0\r
+ddintx032 tointegralx     -0.0   -> -0\r
+ddintx033 tointegralx     -0.1   -> -0  Inexact Rounded\r
+ddintx034 tointegralx     -0.2   -> -0  Inexact Rounded\r
+ddintx035 tointegralx     -0.3   -> -0  Inexact Rounded\r
+ddintx036 tointegralx     -0.4   -> -0  Inexact Rounded\r
+ddintx037 tointegralx     -0.5   -> -0  Inexact Rounded\r
+ddintx038 tointegralx     -0.6   -> -1  Inexact Rounded\r
+ddintx039 tointegralx     -0.7   -> -1  Inexact Rounded\r
+ddintx040 tointegralx     -0.8   -> -1  Inexact Rounded\r
+ddintx041 tointegralx     -0.9   -> -1  Inexact Rounded\r
+ddintx042 tointegralx     -1     -> -1\r
+ddintx043 tointegralx     -1.0   -> -1  Rounded\r
+ddintx044 tointegralx     -1.1   -> -1  Inexact Rounded\r
+ddintx045 tointegralx     -1.2   -> -1  Inexact Rounded\r
+ddintx046 tointegralx     -1.3   -> -1  Inexact Rounded\r
+ddintx047 tointegralx     -1.4   -> -1  Inexact Rounded\r
+ddintx048 tointegralx     -1.5   -> -2  Inexact Rounded\r
+ddintx049 tointegralx     -1.6   -> -2  Inexact Rounded\r
+ddintx050 tointegralx     -1.7   -> -2  Inexact Rounded\r
+ddintx051 tointegralx     -1.8   -> -2  Inexact Rounded\r
+ddintx052 tointegralx     -1.9   -> -2  Inexact Rounded\r
+-- next two would be NaN using quantize(x, 0)\r
+ddintx053 tointegralx    10E+60  -> 1.0E+61\r
+ddintx054 tointegralx   -10E+60  -> -1.0E+61\r
+\r
+-- numbers around precision\r
+ddintx060 tointegralx '56267E-17'   -> '0'      Inexact Rounded\r
+ddintx061 tointegralx '56267E-5'    -> '1'      Inexact Rounded\r
+ddintx062 tointegralx '56267E-2'    -> '563'    Inexact Rounded\r
+ddintx063 tointegralx '56267E-1'    -> '5627'   Inexact Rounded\r
+ddintx065 tointegralx '56267E-0'    -> '56267'\r
+ddintx066 tointegralx '56267E+0'    -> '56267'\r
+ddintx067 tointegralx '56267E+1'    -> '5.6267E+5'\r
+ddintx068 tointegralx '56267E+9'    -> '5.6267E+13'\r
+ddintx069 tointegralx '56267E+10'   -> '5.6267E+14'\r
+ddintx070 tointegralx '56267E+11'   -> '5.6267E+15'\r
+ddintx071 tointegralx '56267E+12'   -> '5.6267E+16'\r
+ddintx072 tointegralx '56267E+13'   -> '5.6267E+17'\r
+ddintx073 tointegralx '1.23E+96'    -> '1.23E+96'\r
+ddintx074 tointegralx '1.23E+384'   -> #47fd300000000000  Clamped\r
+\r
+ddintx080 tointegralx '-56267E-10'  -> '-0'      Inexact Rounded\r
+ddintx081 tointegralx '-56267E-5'   -> '-1'      Inexact Rounded\r
+ddintx082 tointegralx '-56267E-2'   -> '-563'    Inexact Rounded\r
+ddintx083 tointegralx '-56267E-1'   -> '-5627'   Inexact Rounded\r
+ddintx085 tointegralx '-56267E-0'   -> '-56267'\r
+ddintx086 tointegralx '-56267E+0'   -> '-56267'\r
+ddintx087 tointegralx '-56267E+1'   -> '-5.6267E+5'\r
+ddintx088 tointegralx '-56267E+9'   -> '-5.6267E+13'\r
+ddintx089 tointegralx '-56267E+10'  -> '-5.6267E+14'\r
+ddintx090 tointegralx '-56267E+11'  -> '-5.6267E+15'\r
+ddintx091 tointegralx '-56267E+12'  -> '-5.6267E+16'\r
+ddintx092 tointegralx '-56267E+13'  -> '-5.6267E+17'\r
+ddintx093 tointegralx '-1.23E+96'   -> '-1.23E+96'\r
+ddintx094 tointegralx '-1.23E+384'  -> #c7fd300000000000  Clamped\r
+\r
+-- subnormal inputs\r
+ddintx100 tointegralx        1E-299 -> 0  Inexact Rounded\r
+ddintx101 tointegralx      0.1E-299 -> 0  Inexact Rounded\r
+ddintx102 tointegralx     0.01E-299 -> 0  Inexact Rounded\r
+ddintx103 tointegralx        0E-299 -> 0\r
+\r
+-- specials and zeros\r
+ddintx120 tointegralx 'Inf'       ->  Infinity\r
+ddintx121 tointegralx '-Inf'      -> -Infinity\r
+ddintx122 tointegralx   NaN       ->  NaN\r
+ddintx123 tointegralx  sNaN       ->  NaN  Invalid_operation\r
+ddintx124 tointegralx     0       ->  0\r
+ddintx125 tointegralx    -0       -> -0\r
+ddintx126 tointegralx     0.000   ->  0\r
+ddintx127 tointegralx     0.00    ->  0\r
+ddintx128 tointegralx     0.0     ->  0\r
+ddintx129 tointegralx     0       ->  0\r
+ddintx130 tointegralx     0E-3    ->  0\r
+ddintx131 tointegralx     0E-2    ->  0\r
+ddintx132 tointegralx     0E-1    ->  0\r
+ddintx133 tointegralx     0E-0    ->  0\r
+ddintx134 tointegralx     0E+1    ->  0E+1\r
+ddintx135 tointegralx     0E+2    ->  0E+2\r
+ddintx136 tointegralx     0E+3    ->  0E+3\r
+ddintx137 tointegralx     0E+4    ->  0E+4\r
+ddintx138 tointegralx     0E+5    ->  0E+5\r
+ddintx139 tointegralx    -0.000   -> -0\r
+ddintx140 tointegralx    -0.00    -> -0\r
+ddintx141 tointegralx    -0.0     -> -0\r
+ddintx142 tointegralx    -0       -> -0\r
+ddintx143 tointegralx    -0E-3    -> -0\r
+ddintx144 tointegralx    -0E-2    -> -0\r
+ddintx145 tointegralx    -0E-1    -> -0\r
+ddintx146 tointegralx    -0E-0    -> -0\r
+ddintx147 tointegralx    -0E+1    -> -0E+1\r
+ddintx148 tointegralx    -0E+2    -> -0E+2\r
+ddintx149 tointegralx    -0E+3    -> -0E+3\r
+ddintx150 tointegralx    -0E+4    -> -0E+4\r
+ddintx151 tointegralx    -0E+5    -> -0E+5\r
+-- propagating NaNs\r
+ddintx152 tointegralx   NaN808    ->  NaN808\r
+ddintx153 tointegralx  sNaN080    ->  NaN80  Invalid_operation\r
+ddintx154 tointegralx  -NaN808    -> -NaN808\r
+ddintx155 tointegralx -sNaN080    -> -NaN80  Invalid_operation\r
+ddintx156 tointegralx  -NaN       -> -NaN\r
+ddintx157 tointegralx -sNaN       -> -NaN    Invalid_operation\r
+\r
+-- examples\r
+rounding:    half_up\r
+ddintx200 tointegralx     2.1    -> 2            Inexact Rounded\r
+ddintx201 tointegralx   100      -> 100\r
+ddintx202 tointegralx   100.0    -> 100          Rounded\r
+ddintx203 tointegralx   101.5    -> 102          Inexact Rounded\r
+ddintx204 tointegralx  -101.5    -> -102         Inexact Rounded\r
+ddintx205 tointegralx   10E+5    -> 1.0E+6\r
+ddintx206 tointegralx  7.89E+77  -> 7.89E+77\r
+ddintx207 tointegralx   -Inf     -> -Infinity\r
+\r
+\r
+-- all rounding modes\r
+rounding:    half_even\r
+ddintx210 tointegralx     55.5   ->  56  Inexact Rounded\r
+ddintx211 tointegralx     56.5   ->  56  Inexact Rounded\r
+ddintx212 tointegralx     57.5   ->  58  Inexact Rounded\r
+ddintx213 tointegralx    -55.5   -> -56  Inexact Rounded\r
+ddintx214 tointegralx    -56.5   -> -56  Inexact Rounded\r
+ddintx215 tointegralx    -57.5   -> -58  Inexact Rounded\r
+\r
+rounding:    half_up\r
+\r
+ddintx220 tointegralx     55.5   ->  56  Inexact Rounded\r
+ddintx221 tointegralx     56.5   ->  57  Inexact Rounded\r
+ddintx222 tointegralx     57.5   ->  58  Inexact Rounded\r
+ddintx223 tointegralx    -55.5   -> -56  Inexact Rounded\r
+ddintx224 tointegralx    -56.5   -> -57  Inexact Rounded\r
+ddintx225 tointegralx    -57.5   -> -58  Inexact Rounded\r
+\r
+rounding:    half_down\r
+\r
+ddintx230 tointegralx     55.5   ->  55  Inexact Rounded\r
+ddintx231 tointegralx     56.5   ->  56  Inexact Rounded\r
+ddintx232 tointegralx     57.5   ->  57  Inexact Rounded\r
+ddintx233 tointegralx    -55.5   -> -55  Inexact Rounded\r
+ddintx234 tointegralx    -56.5   -> -56  Inexact Rounded\r
+ddintx235 tointegralx    -57.5   -> -57  Inexact Rounded\r
+\r
+rounding:    up\r
+\r
+ddintx240 tointegralx     55.3   ->  56  Inexact Rounded\r
+ddintx241 tointegralx     56.3   ->  57  Inexact Rounded\r
+ddintx242 tointegralx     57.3   ->  58  Inexact Rounded\r
+ddintx243 tointegralx    -55.3   -> -56  Inexact Rounded\r
+ddintx244 tointegralx    -56.3   -> -57  Inexact Rounded\r
+ddintx245 tointegralx    -57.3   -> -58  Inexact Rounded\r
+\r
+rounding:    down\r
+\r
+ddintx250 tointegralx     55.7   ->  55  Inexact Rounded\r
+ddintx251 tointegralx     56.7   ->  56  Inexact Rounded\r
+ddintx252 tointegralx     57.7   ->  57  Inexact Rounded\r
+ddintx253 tointegralx    -55.7   -> -55  Inexact Rounded\r
+ddintx254 tointegralx    -56.7   -> -56  Inexact Rounded\r
+ddintx255 tointegralx    -57.7   -> -57  Inexact Rounded\r
+\r
+rounding:    ceiling\r
+\r
+ddintx260 tointegralx     55.3   ->  56  Inexact Rounded\r
+ddintx261 tointegralx     56.3   ->  57  Inexact Rounded\r
+ddintx262 tointegralx     57.3   ->  58  Inexact Rounded\r
+ddintx263 tointegralx    -55.3   -> -55  Inexact Rounded\r
+ddintx264 tointegralx    -56.3   -> -56  Inexact Rounded\r
+ddintx265 tointegralx    -57.3   -> -57  Inexact Rounded\r
+\r
+rounding:    floor\r
+\r
+ddintx270 tointegralx     55.7   ->  55  Inexact Rounded\r
+ddintx271 tointegralx     56.7   ->  56  Inexact Rounded\r
+ddintx272 tointegralx     57.7   ->  57  Inexact Rounded\r
+ddintx273 tointegralx    -55.7   -> -56  Inexact Rounded\r
+ddintx274 tointegralx    -56.7   -> -57  Inexact Rounded\r
+ddintx275 tointegralx    -57.7   -> -58  Inexact Rounded\r
+\r
+-- Int and uInt32 edge values for testing conversions\r
+ddintx300 tointegralx -2147483646  -> -2147483646\r
+ddintx301 tointegralx -2147483647  -> -2147483647\r
+ddintx302 tointegralx -2147483648  -> -2147483648\r
+ddintx303 tointegralx -2147483649  -> -2147483649\r
+ddintx304 tointegralx  2147483646  ->  2147483646\r
+ddintx305 tointegralx  2147483647  ->  2147483647\r
+ddintx306 tointegralx  2147483648  ->  2147483648\r
+ddintx307 tointegralx  2147483649  ->  2147483649\r
+ddintx308 tointegralx  4294967294  ->  4294967294\r
+ddintx309 tointegralx  4294967295  ->  4294967295\r
+ddintx310 tointegralx  4294967296  ->  4294967296\r
+ddintx311 tointegralx  4294967297  ->  4294967297\r
+\r
diff --git a/Lib/test/decimaltestdata/ddXor.decTest b/Lib/test/decimaltestdata/ddXor.decTest
new file mode 100644 (file)
index 0000000..783fc2b
--- /dev/null
@@ -0,0 +1,337 @@
+------------------------------------------------------------------------\r
+-- ddXor.decTest -- digitwise logical XOR for decDoubles              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+precision:   16\r
+maxExponent: 384\r
+minExponent: -383\r
+extended:    1\r
+clamp:       1\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+ddxor001 xor             0    0 ->    0\r
+ddxor002 xor             0    1 ->    1\r
+ddxor003 xor             1    0 ->    1\r
+ddxor004 xor             1    1 ->    0\r
+ddxor005 xor          1100 1010 ->  110\r
+-- and at msd and msd-1\r
+ddxor006 xor 0000000000000000 0000000000000000 ->           0\r
+ddxor007 xor 0000000000000000 1000000000000000 ->   1000000000000000\r
+ddxor008 xor 1000000000000000 0000000000000000 ->   1000000000000000\r
+ddxor009 xor 1000000000000000 1000000000000000 ->           0\r
+ddxor010 xor 0000000000000000 0000000000000000 ->           0\r
+ddxor011 xor 0000000000000000 0100000000000000 ->    100000000000000\r
+ddxor012 xor 0100000000000000 0000000000000000 ->    100000000000000\r
+ddxor013 xor 0100000000000000 0100000000000000 ->           0\r
+\r
+-- Various lengths\r
+--          1234567890123456     1234567890123456 1234567890123456\r
+ddxor021 xor 1111111110000000     1111111110000000  ->  0\r
+ddxor022 xor  111111110000000      111111110000000  ->  0\r
+ddxor023 xor   11111110000000       11111110000000  ->  0\r
+ddxor024 xor    1111110000000        1111110000000  ->  0\r
+ddxor025 xor     111110000000         111110000000  ->  0\r
+ddxor026 xor      11110000000          11110000000  ->  0\r
+ddxor027 xor       1110000000           1110000000  ->  0\r
+ddxor028 xor        110000000            110000000  ->  0\r
+ddxor029 xor         10000000             10000000  ->  0\r
+ddxor030 xor          1000000              1000000  ->  0\r
+ddxor031 xor           100000               100000  ->  0\r
+ddxor032 xor            10000                10000  ->  0\r
+ddxor033 xor             1000                 1000  ->  0\r
+ddxor034 xor              100                  100  ->  0\r
+ddxor035 xor               10                   10  ->  0\r
+ddxor036 xor                1                    1  ->  0\r
+\r
+ddxor040 xor 111111111  111111111111  ->  111000000000\r
+ddxor041 xor  11111111  111111111111  ->  111100000000\r
+ddxor042 xor  11111111     111111111  ->  100000000\r
+ddxor043 xor   1111111     100000010  ->  101111101\r
+ddxor044 xor    111111     100000100  ->  100111011\r
+ddxor045 xor     11111     100001000  ->  100010111\r
+ddxor046 xor      1111     100010000  ->  100011111\r
+ddxor047 xor       111     100100000  ->  100100111\r
+ddxor048 xor        11     101000000  ->  101000011\r
+ddxor049 xor         1     110000000  ->  110000001\r
+\r
+ddxor050 xor 1111111111  1  ->  1111111110\r
+ddxor051 xor  111111111  1  ->  111111110\r
+ddxor052 xor   11111111  1  ->  11111110\r
+ddxor053 xor    1111111  1  ->  1111110\r
+ddxor054 xor     111111  1  ->  111110\r
+ddxor055 xor      11111  1  ->  11110\r
+ddxor056 xor       1111  1  ->  1110\r
+ddxor057 xor        111  1  ->  110\r
+ddxor058 xor         11  1  ->  10\r
+ddxor059 xor          1  1  ->  0\r
+\r
+ddxor060 xor 1111111111  0  ->  1111111111\r
+ddxor061 xor  111111111  0  ->  111111111\r
+ddxor062 xor   11111111  0  ->  11111111\r
+ddxor063 xor    1111111  0  ->  1111111\r
+ddxor064 xor     111111  0  ->  111111\r
+ddxor065 xor      11111  0  ->  11111\r
+ddxor066 xor       1111  0  ->  1111\r
+ddxor067 xor        111  0  ->  111\r
+ddxor068 xor         11  0  ->  11\r
+ddxor069 xor          1  0  ->  1\r
+\r
+ddxor070 xor 1  1111111111  ->  1111111110\r
+ddxor071 xor 1   111111111  ->  111111110\r
+ddxor072 xor 1    11111111  ->  11111110\r
+ddxor073 xor 1     1111111  ->  1111110\r
+ddxor074 xor 1      111111  ->  111110\r
+ddxor075 xor 1       11111  ->  11110\r
+ddxor076 xor 1        1111  ->  1110\r
+ddxor077 xor 1         111  ->  110\r
+ddxor078 xor 1          11  ->  10\r
+ddxor079 xor 1           1  ->  0\r
+\r
+ddxor080 xor 0  1111111111  ->  1111111111\r
+ddxor081 xor 0   111111111  ->  111111111\r
+ddxor082 xor 0    11111111  ->  11111111\r
+ddxor083 xor 0     1111111  ->  1111111\r
+ddxor084 xor 0      111111  ->  111111\r
+ddxor085 xor 0       11111  ->  11111\r
+ddxor086 xor 0        1111  ->  1111\r
+ddxor087 xor 0         111  ->  111\r
+ddxor088 xor 0          11  ->  11\r
+ddxor089 xor 0           1  ->  1\r
+\r
+ddxor090 xor 011111111  111101111  ->  100010000\r
+ddxor091 xor 101111111  111101111  ->   10010000\r
+ddxor092 xor 110111111  111101111  ->    1010000\r
+ddxor093 xor 111011111  111101111  ->     110000\r
+ddxor094 xor 111101111  111101111  ->          0\r
+ddxor095 xor 111110111  111101111  ->      11000\r
+ddxor096 xor 111111011  111101111  ->      10100\r
+ddxor097 xor 111111101  111101111  ->      10010\r
+ddxor098 xor 111111110  111101111  ->      10001\r
+\r
+ddxor100 xor 111101111  011111111  ->  100010000\r
+ddxor101 xor 111101111  101111111  ->   10010000\r
+ddxor102 xor 111101111  110111111  ->    1010000\r
+ddxor103 xor 111101111  111011111  ->     110000\r
+ddxor104 xor 111101111  111101111  ->          0\r
+ddxor105 xor 111101111  111110111  ->      11000\r
+ddxor106 xor 111101111  111111011  ->      10100\r
+ddxor107 xor 111101111  111111101  ->      10010\r
+ddxor108 xor 111101111  111111110  ->      10001\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+ddxor220 xor 111111112  111111111  ->  NaN Invalid_operation\r
+ddxor221 xor 333333333  333333333  ->  NaN Invalid_operation\r
+ddxor222 xor 555555555  555555555  ->  NaN Invalid_operation\r
+ddxor223 xor 777777777  777777777  ->  NaN Invalid_operation\r
+ddxor224 xor 999999999  999999999  ->  NaN Invalid_operation\r
+ddxor225 xor 222222222  999999999  ->  NaN Invalid_operation\r
+ddxor226 xor 444444444  999999999  ->  NaN Invalid_operation\r
+ddxor227 xor 666666666  999999999  ->  NaN Invalid_operation\r
+ddxor228 xor 888888888  999999999  ->  NaN Invalid_operation\r
+ddxor229 xor 999999999  222222222  ->  NaN Invalid_operation\r
+ddxor230 xor 999999999  444444444  ->  NaN Invalid_operation\r
+ddxor231 xor 999999999  666666666  ->  NaN Invalid_operation\r
+ddxor232 xor 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+ddxor240 xor  567468689 -934981942 ->  NaN Invalid_operation\r
+ddxor241 xor  567367689  934981942 ->  NaN Invalid_operation\r
+ddxor242 xor -631917772 -706014634 ->  NaN Invalid_operation\r
+ddxor243 xor -756253257  138579234 ->  NaN Invalid_operation\r
+ddxor244 xor  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+ddxor250 xor  2000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddxor251 xor  7000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddxor252 xor  8000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddxor253 xor  9000000000000000 1000000000000000 ->  NaN Invalid_operation\r
+ddxor254 xor  2000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddxor255 xor  7000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddxor256 xor  8000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddxor257 xor  9000000000000000 0000000000000000 ->  NaN Invalid_operation\r
+ddxor258 xor  1000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddxor259 xor  1000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddxor260 xor  1000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddxor261 xor  1000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+ddxor262 xor  0000000000000000 2000000000000000 ->  NaN Invalid_operation\r
+ddxor263 xor  0000000000000000 7000000000000000 ->  NaN Invalid_operation\r
+ddxor264 xor  0000000000000000 8000000000000000 ->  NaN Invalid_operation\r
+ddxor265 xor  0000000000000000 9000000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+ddxor270 xor  0200001000000000 1000100000000010 ->  NaN Invalid_operation\r
+ddxor271 xor  0700000100000000 1000010000000100 ->  NaN Invalid_operation\r
+ddxor272 xor  0800000010000000 1000001000001000 ->  NaN Invalid_operation\r
+ddxor273 xor  0900000001000000 1000000100010000 ->  NaN Invalid_operation\r
+ddxor274 xor  1000000000100000 0200000010100000 ->  NaN Invalid_operation\r
+ddxor275 xor  1000000000010000 0700000001000000 ->  NaN Invalid_operation\r
+ddxor276 xor  1000000000001000 0800000010100000 ->  NaN Invalid_operation\r
+ddxor277 xor  1000000000000100 0900000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+ddxor280 xor  0010000000000002 1000000100000001 ->  NaN Invalid_operation\r
+ddxor281 xor  0001000000000007 1000001000000011 ->  NaN Invalid_operation\r
+ddxor282 xor  0000100000000008 1000010000000001 ->  NaN Invalid_operation\r
+ddxor283 xor  0000010000000009 1000100000000001 ->  NaN Invalid_operation\r
+ddxor284 xor  1000001000000000 0001000000000002 ->  NaN Invalid_operation\r
+ddxor285 xor  1000000100000000 0010000000000007 ->  NaN Invalid_operation\r
+ddxor286 xor  1000000010000000 0100000000000008 ->  NaN Invalid_operation\r
+ddxor287 xor  1000000001000000 1000000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+ddxor288 xor  0010000020000000 1000001000000000 ->  NaN Invalid_operation\r
+ddxor289 xor  0001000070000001 1000000100000000 ->  NaN Invalid_operation\r
+ddxor290 xor  0000100080000010 1000000010000000 ->  NaN Invalid_operation\r
+ddxor291 xor  0000010090000100 1000000001000000 ->  NaN Invalid_operation\r
+ddxor292 xor  1000001000001000 0000000020100000 ->  NaN Invalid_operation\r
+ddxor293 xor  1000000100010000 0000000070010000 ->  NaN Invalid_operation\r
+ddxor294 xor  1000000010100000 0000000080001000 ->  NaN Invalid_operation\r
+ddxor295 xor  1000000001000000 0000000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+ddxor296 xor -1000000001000000 -0000010000000100 ->  NaN Invalid_operation\r
+ddxor297 xor -1000000001000000  0000000010000100 ->  NaN Invalid_operation\r
+ddxor298 xor  1000000001000000 -0000001000000100 ->  NaN Invalid_operation\r
+ddxor299 xor  1000000001000000  0000000011000100 ->  1000000010000100\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+ddxor331 xor  2   9.99999999E+299     -> NaN Invalid_operation\r
+ddxor332 xor  3   1E-299              -> NaN Invalid_operation\r
+ddxor333 xor  4   1.00000000E-299     -> NaN Invalid_operation\r
+ddxor334 xor  5   1E-200              -> NaN Invalid_operation\r
+ddxor335 xor  6   -1E-200             -> NaN Invalid_operation\r
+ddxor336 xor  7   -1.00000000E-299    -> NaN Invalid_operation\r
+ddxor337 xor  8   -1E-299             -> NaN Invalid_operation\r
+ddxor338 xor  9   -9.99999999E+299    -> NaN Invalid_operation\r
+ddxor341 xor  9.99999999E+299     -18 -> NaN Invalid_operation\r
+ddxor342 xor  1E-299               01 -> NaN Invalid_operation\r
+ddxor343 xor  1.00000000E-299     -18 -> NaN Invalid_operation\r
+ddxor344 xor  1E-208               18 -> NaN Invalid_operation\r
+ddxor345 xor  -1E-207             -10 -> NaN Invalid_operation\r
+ddxor346 xor  -1.00000000E-299     18 -> NaN Invalid_operation\r
+ddxor347 xor  -1E-299              10 -> NaN Invalid_operation\r
+ddxor348 xor  -9.99999999E+299    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+ddxor361 xor  1.0                  1  -> NaN Invalid_operation\r
+ddxor362 xor  1E+1                 1  -> NaN Invalid_operation\r
+ddxor363 xor  0.0                  1  -> NaN Invalid_operation\r
+ddxor364 xor  0E+1                 1  -> NaN Invalid_operation\r
+ddxor365 xor  9.9                  1  -> NaN Invalid_operation\r
+ddxor366 xor  9E+1                 1  -> NaN Invalid_operation\r
+ddxor371 xor  0 1.0                   -> NaN Invalid_operation\r
+ddxor372 xor  0 1E+1                  -> NaN Invalid_operation\r
+ddxor373 xor  0 0.0                   -> NaN Invalid_operation\r
+ddxor374 xor  0 0E+1                  -> NaN Invalid_operation\r
+ddxor375 xor  0 9.9                   -> NaN Invalid_operation\r
+ddxor376 xor  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+ddxor780 xor -Inf  -Inf   -> NaN Invalid_operation\r
+ddxor781 xor -Inf  -1000  -> NaN Invalid_operation\r
+ddxor782 xor -Inf  -1     -> NaN Invalid_operation\r
+ddxor783 xor -Inf  -0     -> NaN Invalid_operation\r
+ddxor784 xor -Inf   0     -> NaN Invalid_operation\r
+ddxor785 xor -Inf   1     -> NaN Invalid_operation\r
+ddxor786 xor -Inf   1000  -> NaN Invalid_operation\r
+ddxor787 xor -1000 -Inf   -> NaN Invalid_operation\r
+ddxor788 xor -Inf  -Inf   -> NaN Invalid_operation\r
+ddxor789 xor -1    -Inf   -> NaN Invalid_operation\r
+ddxor790 xor -0    -Inf   -> NaN Invalid_operation\r
+ddxor791 xor  0    -Inf   -> NaN Invalid_operation\r
+ddxor792 xor  1    -Inf   -> NaN Invalid_operation\r
+ddxor793 xor  1000 -Inf   -> NaN Invalid_operation\r
+ddxor794 xor  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+ddxor800 xor  Inf  -Inf   -> NaN Invalid_operation\r
+ddxor801 xor  Inf  -1000  -> NaN Invalid_operation\r
+ddxor802 xor  Inf  -1     -> NaN Invalid_operation\r
+ddxor803 xor  Inf  -0     -> NaN Invalid_operation\r
+ddxor804 xor  Inf   0     -> NaN Invalid_operation\r
+ddxor805 xor  Inf   1     -> NaN Invalid_operation\r
+ddxor806 xor  Inf   1000  -> NaN Invalid_operation\r
+ddxor807 xor  Inf   Inf   -> NaN Invalid_operation\r
+ddxor808 xor -1000  Inf   -> NaN Invalid_operation\r
+ddxor809 xor -Inf   Inf   -> NaN Invalid_operation\r
+ddxor810 xor -1     Inf   -> NaN Invalid_operation\r
+ddxor811 xor -0     Inf   -> NaN Invalid_operation\r
+ddxor812 xor  0     Inf   -> NaN Invalid_operation\r
+ddxor813 xor  1     Inf   -> NaN Invalid_operation\r
+ddxor814 xor  1000  Inf   -> NaN Invalid_operation\r
+ddxor815 xor  Inf   Inf   -> NaN Invalid_operation\r
+\r
+ddxor821 xor  NaN -Inf    -> NaN Invalid_operation\r
+ddxor822 xor  NaN -1000   -> NaN Invalid_operation\r
+ddxor823 xor  NaN -1      -> NaN Invalid_operation\r
+ddxor824 xor  NaN -0      -> NaN Invalid_operation\r
+ddxor825 xor  NaN  0      -> NaN Invalid_operation\r
+ddxor826 xor  NaN  1      -> NaN Invalid_operation\r
+ddxor827 xor  NaN  1000   -> NaN Invalid_operation\r
+ddxor828 xor  NaN  Inf    -> NaN Invalid_operation\r
+ddxor829 xor  NaN  NaN    -> NaN Invalid_operation\r
+ddxor830 xor -Inf  NaN    -> NaN Invalid_operation\r
+ddxor831 xor -1000 NaN    -> NaN Invalid_operation\r
+ddxor832 xor -1    NaN    -> NaN Invalid_operation\r
+ddxor833 xor -0    NaN    -> NaN Invalid_operation\r
+ddxor834 xor  0    NaN    -> NaN Invalid_operation\r
+ddxor835 xor  1    NaN    -> NaN Invalid_operation\r
+ddxor836 xor  1000 NaN    -> NaN Invalid_operation\r
+ddxor837 xor  Inf  NaN    -> NaN Invalid_operation\r
+\r
+ddxor841 xor  sNaN -Inf   ->  NaN  Invalid_operation\r
+ddxor842 xor  sNaN -1000  ->  NaN  Invalid_operation\r
+ddxor843 xor  sNaN -1     ->  NaN  Invalid_operation\r
+ddxor844 xor  sNaN -0     ->  NaN  Invalid_operation\r
+ddxor845 xor  sNaN  0     ->  NaN  Invalid_operation\r
+ddxor846 xor  sNaN  1     ->  NaN  Invalid_operation\r
+ddxor847 xor  sNaN  1000  ->  NaN  Invalid_operation\r
+ddxor848 xor  sNaN  NaN   ->  NaN  Invalid_operation\r
+ddxor849 xor  sNaN sNaN   ->  NaN  Invalid_operation\r
+ddxor850 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+ddxor851 xor -Inf  sNaN   ->  NaN  Invalid_operation\r
+ddxor852 xor -1000 sNaN   ->  NaN  Invalid_operation\r
+ddxor853 xor -1    sNaN   ->  NaN  Invalid_operation\r
+ddxor854 xor -0    sNaN   ->  NaN  Invalid_operation\r
+ddxor855 xor  0    sNaN   ->  NaN  Invalid_operation\r
+ddxor856 xor  1    sNaN   ->  NaN  Invalid_operation\r
+ddxor857 xor  1000 sNaN   ->  NaN  Invalid_operation\r
+ddxor858 xor  Inf  sNaN   ->  NaN  Invalid_operation\r
+ddxor859 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+ddxor861 xor  NaN1   -Inf    -> NaN Invalid_operation\r
+ddxor862 xor +NaN2   -1000   -> NaN Invalid_operation\r
+ddxor863 xor  NaN3    1000   -> NaN Invalid_operation\r
+ddxor864 xor  NaN4    Inf    -> NaN Invalid_operation\r
+ddxor865 xor  NaN5   +NaN6   -> NaN Invalid_operation\r
+ddxor866 xor -Inf     NaN7   -> NaN Invalid_operation\r
+ddxor867 xor -1000    NaN8   -> NaN Invalid_operation\r
+ddxor868 xor  1000    NaN9   -> NaN Invalid_operation\r
+ddxor869 xor  Inf    +NaN10  -> NaN Invalid_operation\r
+ddxor871 xor  sNaN11  -Inf   -> NaN Invalid_operation\r
+ddxor872 xor  sNaN12  -1000  -> NaN Invalid_operation\r
+ddxor873 xor  sNaN13   1000  -> NaN Invalid_operation\r
+ddxor874 xor  sNaN14   NaN17 -> NaN Invalid_operation\r
+ddxor875 xor  sNaN15  sNaN18 -> NaN Invalid_operation\r
+ddxor876 xor  NaN16   sNaN19 -> NaN Invalid_operation\r
+ddxor877 xor -Inf    +sNaN20 -> NaN Invalid_operation\r
+ddxor878 xor -1000    sNaN21 -> NaN Invalid_operation\r
+ddxor879 xor  1000    sNaN22 -> NaN Invalid_operation\r
+ddxor880 xor  Inf     sNaN23 -> NaN Invalid_operation\r
+ddxor881 xor +NaN25  +sNaN24 -> NaN Invalid_operation\r
+ddxor882 xor -NaN26    NaN28 -> NaN Invalid_operation\r
+ddxor883 xor -sNaN27  sNaN29 -> NaN Invalid_operation\r
+ddxor884 xor  1000    -NaN30 -> NaN Invalid_operation\r
+ddxor885 xor  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/decDouble.decTest b/Lib/test/decimaltestdata/decDouble.decTest
new file mode 100644 (file)
index 0000000..d5205b7
--- /dev/null
@@ -0,0 +1,65 @@
+------------------------------------------------------------------------
+-- decDouble.decTest -- run all decDouble decimal arithmetic tests    --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases"     --
+-- at http://www2.hursley.ibm.com/decimal for the description of      --
+-- these testcases.                                                   --
+--                                                                    --
+-- These testcases are experimental ('beta' versions), and they       --
+-- may contain errors.  They are offered on an as-is basis.  In       --
+-- particular, achieving the same results as the tests here is not    --
+-- a guarantee that an implementation complies with any Standard      --
+-- or specification.  The tests are not exhaustive.                   --
+--                                                                    --
+-- Please send comments, suggestions, and corrections to the author:  --
+--   Mike Cowlishaw, IBM Fellow                                       --
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
+--   mfc@uk.ibm.com                                                   --
+------------------------------------------------------------------------
+version: 2.56
+
+-- decDouble tests
+dectest: ddAbs
+dectest: ddAdd
+dectest: ddAnd
+dectest: ddBase
+dectest: ddCanonical
+dectest: ddClass
+dectest: ddCompare
+dectest: ddCompareSig
+dectest: ddCompareTotal
+dectest: ddCompareTotalMag
+dectest: ddCopy
+dectest: ddCopyAbs
+dectest: ddCopyNegate
+dectest: ddCopySign
+dectest: ddDivide
+dectest: ddDivideInt
+dectest: ddEncode
+dectest: ddFMA
+dectest: ddInvert
+dectest: ddLogB
+dectest: ddMax
+dectest: ddMaxMag
+dectest: ddMin
+dectest: ddMinMag
+dectest: ddMinus
+dectest: ddMultiply
+dectest: ddNextMinus
+dectest: ddNextPlus
+dectest: ddNextToward
+dectest: ddOr
+dectest: ddPlus
+dectest: ddQuantize
+dectest: ddReduce
+dectest: ddRemainder
+dectest: ddRemainderNear
+dectest: ddRotate
+dectest: ddSameQuantum
+dectest: ddScaleB
+dectest: ddShift
+dectest: ddSubtract
+dectest: ddToIntegral
+dectest: ddXor
+
diff --git a/Lib/test/decimaltestdata/decQuad.decTest b/Lib/test/decimaltestdata/decQuad.decTest
new file mode 100644 (file)
index 0000000..4d10069
--- /dev/null
@@ -0,0 +1,65 @@
+------------------------------------------------------------------------
+-- decQuad.decTest -- run all decQuad decimal arithmetic tests        --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases"     --
+-- at http://www2.hursley.ibm.com/decimal for the description of      --
+-- these testcases.                                                   --
+--                                                                    --
+-- These testcases are experimental ('beta' versions), and they       --
+-- may contain errors.  They are offered on an as-is basis.  In       --
+-- particular, achieving the same results as the tests here is not    --
+-- a guarantee that an implementation complies with any Standard      --
+-- or specification.  The tests are not exhaustive.                   --
+--                                                                    --
+-- Please send comments, suggestions, and corrections to the author:  --
+--   Mike Cowlishaw, IBM Fellow                                       --
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
+--   mfc@uk.ibm.com                                                   --
+------------------------------------------------------------------------
+version: 2.56
+
+-- decQuad tests
+dectest: dqAbs
+dectest: dqAdd
+dectest: dqAnd
+dectest: dqBase
+dectest: dqCanonical
+dectest: dqClass
+dectest: dqCompare
+dectest: dqCompareSig
+dectest: dqCompareTotal
+dectest: dqCompareTotalMag
+dectest: dqCopy
+dectest: dqCopyAbs
+dectest: dqCopyNegate
+dectest: dqCopySign
+dectest: dqDivide
+dectest: dqDivideInt
+dectest: dqEncode
+dectest: dqFMA
+dectest: dqInvert
+dectest: dqLogB
+dectest: dqMax
+dectest: dqMaxMag
+dectest: dqMin
+dectest: dqMinMag
+dectest: dqMinus
+dectest: dqMultiply
+dectest: dqNextMinus
+dectest: dqNextPlus
+dectest: dqNextToward
+dectest: dqOr
+dectest: dqPlus
+dectest: dqQuantize
+dectest: dqReduce
+dectest: dqRemainder
+dectest: dqRemainderNear
+dectest: dqRotate
+dectest: dqSameQuantum
+dectest: dqScaleB
+dectest: dqShift
+dectest: dqSubtract
+dectest: dqToIntegral
+dectest: dqXor
+
diff --git a/Lib/test/decimaltestdata/decSingle.decTest b/Lib/test/decimaltestdata/decSingle.decTest
new file mode 100644 (file)
index 0000000..c661fe4
--- /dev/null
@@ -0,0 +1,25 @@
+------------------------------------------------------------------------
+-- decSingle.decTest -- run all decSingle decimal arithmetic tests    --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases"     --
+-- at http://www2.hursley.ibm.com/decimal for the description of      --
+-- these testcases.                                                   --
+--                                                                    --
+-- These testcases are experimental ('beta' versions), and they       --
+-- may contain errors.  They are offered on an as-is basis.  In       --
+-- particular, achieving the same results as the tests here is not    --
+-- a guarantee that an implementation complies with any Standard      --
+-- or specification.  The tests are not exhaustive.                   --
+--                                                                    --
+-- Please send comments, suggestions, and corrections to the author:  --
+--   Mike Cowlishaw, IBM Fellow                                       --
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
+--   mfc@uk.ibm.com                                                   --
+------------------------------------------------------------------------
+version: 2.56
+
+-- decSingle tests
+dectest: dsBase
+dectest: dsEncode
+
diff --git a/Lib/test/decimaltestdata/decimal128.decTest b/Lib/test/decimaltestdata/decimal128.decTest
deleted file mode 100644 (file)
index 3cc9d06..0000000
+++ /dev/null
@@ -1,441 +0,0 @@
-------------------------------------------------------------------------
--- decimal128.decTest -- decimal sixteen-byte format testcases        --
--- Copyright (c) IBM Corporation, 2000, 2003.  All rights reserved.   --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases"     --
--- at http://www2.hursley.ibm.com/decimal for the description of      --
--- these testcases.                                                   --
---                                                                    --
--- These testcases are experimental ('beta' versions), and they       --
--- may contain errors.  They are offered on an as-is basis.  In       --
--- particular, achieving the same results as the tests here is not    --
--- a guarantee that an implementation complies with any Standard      --
--- or specification.  The tests are not exhaustive.                   --
---                                                                    --
--- Please send comments, suggestions, and corrections to the author:  --
---   Mike Cowlishaw, IBM Fellow                                       --
---   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
---   mfc@uk.ibm.com                                                   --
-------------------------------------------------------------------------
-version: 2.39
-
--- This set of tests is for the sixteen-byte concrete representation.
--- Its characteristics are:
---
---   1 bit  sign
---   5 bits combination field
---  12 bits exponent continuation
--- 110 bits coefficient continuation
---
--- Total exponent length 14 bits
--- Total coefficient length 114 bits (34 digits)
---
--- Elimit = 12287 (maximum encoded exponent)
--- Emax   =  6144 (largest exponent value)
--- Emin   = -6143 (smallest exponent value)
--- bias   =  6176 (subtracted from encoded exponent) = -Etiny
-
-extended:    1
-precision:   34
-rounding:    half_up
-maxExponent: 6144
-minExponent: -6143
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decg001 apply   #A20780000000000000000000000003D0 -> -7.50
-decg002 apply   -7.50  -> #A20780000000000000000000000003D0
-
--- Normality
-decf010 apply   1234567890123456789012345678901234   -> #2608134b9c1e28e56f3c127177823534
-decf011 apply   1234567890123456789012345678901234.0 -> #2608134b9c1e28e56f3c127177823534 Rounded
-decf012 apply   1234567890123456789012345678901234.1 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact
-decf013 apply  -1234567890123456789012345678901234   -> #a608134b9c1e28e56f3c127177823534
-decf014 apply  -1234567890123456789012345678901234.0 -> #a608134b9c1e28e56f3c127177823534 Rounded
-decf015 apply  -1234567890123456789012345678901234.1 -> #a608134b9c1e28e56f3c127177823534 Rounded Inexact
-
-
--- Nmax and similar
-decf022 apply   9.999999999999999999999999999999999E+6144  -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-decf023 apply   #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
-decf024 apply   1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
-decf025 apply   #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decf030 apply   1.23E+6144    -> #47ffd300000000000000000000000000 Clamped
-decf031 apply   #47ffd300000000000000000000000000       -> 1.230000000000000000000000000000000E+6144
-decf032 apply   1E+6144       -> #47ffc000000000000000000000000000 Clamped
-decf033 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144
-
--- overflows
-maxExponent: 9999  -- set high so conversion causes the overflow
-minExponent: -9999
-decf040 apply   10E+6144                 -> #78000000000000000000000000000000 Overflow Rounded Inexact
-decf041 apply   1.000000000000000E+6145  -> #78000000000000000000000000000000 Overflow Rounded Inexact
-maxExponent: 6144
-minExponent: -6143
-
-decf051 apply   12345                   -> #220800000000000000000000000049c5
-decf052 apply   #220800000000000000000000000049c5       -> 12345
-decf053 apply   1234                    -> #22080000000000000000000000000534
-decf054 apply   #22080000000000000000000000000534       -> 1234
-decf055 apply   123                     -> #220800000000000000000000000000a3
-decf056 apply   #220800000000000000000000000000a3       -> 123
-decf057 apply   12                      -> #22080000000000000000000000000012
-decf058 apply   #22080000000000000000000000000012       -> 12
-decf059 apply   1                       -> #22080000000000000000000000000001
-decf060 apply   #22080000000000000000000000000001       -> 1
-decf061 apply   1.23                    -> #220780000000000000000000000000a3
-decf062 apply   #220780000000000000000000000000a3       -> 1.23
-decf063 apply   123.45                  -> #220780000000000000000000000049c5
-decf064 apply   #220780000000000000000000000049c5       -> 123.45
-
--- Nmin and below
-decf071 apply   1E-6143                                    -> #00084000000000000000000000000001
-decf072 apply   #00084000000000000000000000000001          -> 1E-6143
-decf073 apply   1.000000000000000000000000000000000E-6143  -> #04000000000000000000000000000000
-decf074 apply   #04000000000000000000000000000000          -> 1.000000000000000000000000000000000E-6143
-decf075 apply   1.000000000000000000000000000000001E-6143  -> #04000000000000000000000000000001
-decf076 apply   #04000000000000000000000000000001          -> 1.000000000000000000000000000000001E-6143
-
-decf077 apply   0.100000000000000000000000000000000E-6143  -> #00000800000000000000000000000000      Subnormal
-decf078 apply   #00000800000000000000000000000000          -> 1.00000000000000000000000000000000E-6144  Subnormal
-decf079 apply   0.000000000000000000000000000000010E-6143  -> #00000000000000000000000000000010      Subnormal
-decf080 apply   #00000000000000000000000000000010          -> 1.0E-6175              Subnormal
-decf081 apply   0.00000000000000000000000000000001E-6143   -> #00004000000000000000000000000001      Subnormal
-decf082 apply   #00004000000000000000000000000001          -> 1E-6175                Subnormal
-decf083 apply   0.000000000000000000000000000000001E-6143  -> #00000000000000000000000000000001      Subnormal
-decf084 apply   #00000000000000000000000000000001          -> 1E-6176                 Subnormal
-
--- underflows
-decf090 apply   1e-6176                  -> #00000000000000000000000000000001  Subnormal
-decf091 apply   1.9e-6176                -> #00000000000000000000000000000002  Subnormal Underflow Inexact Rounded
-decf092 apply   1.1e-6176                -> #00000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf093 apply   1.00000000001e-6176      -> #00000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf094 apply   1.00000000000001e-6176   -> #00000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf095 apply   1.000000000000001e-6176  -> #00000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf096 apply   0.1e-6176                -> #00000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf097 apply   0.00000000001e-6176      -> #00000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf098 apply   0.00000000000001e-6176   -> #00000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf099 apply   0.000000000000001e-6176  -> #00000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf100 apply   999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff  Subnormal
-
--- same again, negatives
--- Nmax and similar
-decf122 apply  -9.999999999999999999999999999999999E+6144  -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
-decf123 apply   #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
-decf124 apply  -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
-decf125 apply   #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decf130 apply  -1.23E+6144    -> #c7ffd300000000000000000000000000 Clamped
-decf131 apply   #c7ffd300000000000000000000000000       -> -1.230000000000000000000000000000000E+6144
-decf132 apply  -1E+6144       -> #c7ffc000000000000000000000000000 Clamped
-decf133 apply   #c7ffc000000000000000000000000000       -> -1.000000000000000000000000000000000E+6144
-
--- overflows
-maxExponent: 9999  -- set high so conversion causes the overflow
-minExponent: -9999
-decf140 apply  -10E+6144                 -> #f8000000000000000000000000000000 Overflow Rounded Inexact
-decf141 apply  -1.000000000000000E+6145  -> #f8000000000000000000000000000000 Overflow Rounded Inexact
-maxExponent: 6144
-minExponent: -6143
-
-decf151 apply  -12345                   -> #a20800000000000000000000000049c5
-decf152 apply   #a20800000000000000000000000049c5       -> -12345
-decf153 apply  -1234                    -> #a2080000000000000000000000000534
-decf154 apply   #a2080000000000000000000000000534       -> -1234
-decf155 apply  -123                     -> #a20800000000000000000000000000a3
-decf156 apply   #a20800000000000000000000000000a3       -> -123
-decf157 apply  -12                      -> #a2080000000000000000000000000012
-decf158 apply   #a2080000000000000000000000000012       -> -12
-decf159 apply  -1                       -> #a2080000000000000000000000000001
-decf160 apply   #a2080000000000000000000000000001       -> -1
-decf161 apply  -1.23                    -> #a20780000000000000000000000000a3
-decf162 apply   #a20780000000000000000000000000a3       -> -1.23
-decf163 apply  -123.45                  -> #a20780000000000000000000000049c5
-decf164 apply   #a20780000000000000000000000049c5       -> -123.45
-
--- Nmin and below
-decf171 apply  -1E-6143                                    -> #80084000000000000000000000000001
-decf172 apply   #80084000000000000000000000000001          -> -1E-6143
-decf173 apply  -1.000000000000000000000000000000000E-6143  -> #84000000000000000000000000000000
-decf174 apply   #84000000000000000000000000000000          -> -1.000000000000000000000000000000000E-6143
-decf175 apply  -1.000000000000000000000000000000001E-6143  -> #84000000000000000000000000000001
-decf176 apply   #84000000000000000000000000000001          -> -1.000000000000000000000000000000001E-6143
-
-decf177 apply  -0.100000000000000000000000000000000E-6143  -> #80000800000000000000000000000000      Subnormal
-decf178 apply   #80000800000000000000000000000000          -> -1.00000000000000000000000000000000E-6144  Subnormal
-decf179 apply  -0.000000000000000000000000000000010E-6143  -> #80000000000000000000000000000010      Subnormal
-decf180 apply   #80000000000000000000000000000010          -> -1.0E-6175              Subnormal
-decf181 apply  -0.00000000000000000000000000000001E-6143   -> #80004000000000000000000000000001      Subnormal
-decf182 apply   #80004000000000000000000000000001          -> -1E-6175                Subnormal
-decf183 apply  -0.000000000000000000000000000000001E-6143  -> #80000000000000000000000000000001      Subnormal
-decf184 apply   #80000000000000000000000000000001          -> -1E-6176                 Subnormal
-
--- underflows
-decf190 apply   -1e-6176                  -> #80000000000000000000000000000001  Subnormal
-decf191 apply   -1.9e-6176                -> #80000000000000000000000000000002  Subnormal Underflow Inexact Rounded
-decf192 apply   -1.1e-6176                -> #80000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf193 apply   -1.00000000001e-6176      -> #80000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf194 apply   -1.00000000000001e-6176   -> #80000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf195 apply   -1.000000000000001e-6176  -> #80000000000000000000000000000001  Subnormal Underflow Inexact Rounded
-decf196 apply   -0.1e-6176                -> #80000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf197 apply   -0.00000000001e-6176      -> #80000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf198 apply   -0.00000000000001e-6176   -> #80000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf199 apply   -0.000000000000001e-6176  -> #80000000000000000000000000000000  Subnormal Underflow Inexact Rounded
-decf200 apply   -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff  Subnormal
-
--- zeros
-decf400 apply   0E-8000                 -> #00000000000000000000000000000000  Clamped
-decf401 apply   0E-6177                 -> #00000000000000000000000000000000  Clamped
-decf402 apply   0E-6176                 -> #00000000000000000000000000000000
-decf403 apply   #00000000000000000000000000000000       -> 0E-6176
-decf404 apply   0.000000000000000000000000000000000E-6143  -> #00000000000000000000000000000000
-decf405 apply   #00000000000000000000000000000000       -> 0E-6176
-decf406 apply   0E-2                    -> #22078000000000000000000000000000
-decf407 apply   #22078000000000000000000000000000       -> 0.00
-decf408 apply   0                       -> #22080000000000000000000000000000
-decf409 apply   #22080000000000000000000000000000       -> 0
-decf410 apply   0E+3                    -> #2208c000000000000000000000000000
-decf411 apply   #2208c000000000000000000000000000       -> 0E+3
-decf412 apply   0E+6111                 -> #43ffc000000000000000000000000000
-decf413 apply   #43ffc000000000000000000000000000       -> 0E+6111
--- clamped zeros...
-decf414 apply   0E+6112                 -> #43ffc000000000000000000000000000  Clamped
-decf415 apply   #43ffc000000000000000000000000000       -> 0E+6111
-decf416 apply   0E+6144                 -> #43ffc000000000000000000000000000  Clamped
-decf417 apply   #43ffc000000000000000000000000000       -> 0E+6111
-decf418 apply   0E+8000                 -> #43ffc000000000000000000000000000  Clamped
-decf419 apply   #43ffc000000000000000000000000000       -> 0E+6111
-
--- negative zeros
-decf420 apply  -0E-8000                 -> #80000000000000000000000000000000  Clamped
-decf421 apply  -0E-6177                 -> #80000000000000000000000000000000  Clamped
-decf422 apply  -0E-6176                 -> #80000000000000000000000000000000
-decf423 apply   #80000000000000000000000000000000       -> -0E-6176
-decf424 apply  -0.000000000000000000000000000000000E-6143  -> #80000000000000000000000000000000
-decf425 apply   #80000000000000000000000000000000       -> -0E-6176
-decf426 apply  -0E-2                    -> #a2078000000000000000000000000000
-decf427 apply   #a2078000000000000000000000000000       -> -0.00
-decf428 apply  -0                       -> #a2080000000000000000000000000000
-decf429 apply   #a2080000000000000000000000000000       -> -0
-decf430 apply  -0E+3                    -> #a208c000000000000000000000000000
-decf431 apply   #a208c000000000000000000000000000       -> -0E+3
-decf432 apply  -0E+6111                 -> #c3ffc000000000000000000000000000
-decf433 apply   #c3ffc000000000000000000000000000       -> -0E+6111
--- clamped zeros...
-decf434 apply  -0E+6112                 -> #c3ffc000000000000000000000000000  Clamped
-decf435 apply   #c3ffc000000000000000000000000000       -> -0E+6111
-decf436 apply  -0E+6144                 -> #c3ffc000000000000000000000000000  Clamped
-decf437 apply   #c3ffc000000000000000000000000000       -> -0E+6111
-decf438 apply  -0E+8000                 -> #c3ffc000000000000000000000000000  Clamped
-decf439 apply   #c3ffc000000000000000000000000000       -> -0E+6111
-
--- Specials
-decf500 apply   Infinity                          -> #78000000000000000000000000000000
-decf501 apply   #78787878787878787878787878787878 -> #78000000000000000000000000000000
-decf502 apply   #78000000000000000000000000000000 -> Infinity
-decf503 apply   #79797979797979797979797979797979 -> #78000000000000000000000000000000
-decf504 apply   #79000000000000000000000000000000 -> Infinity
-decf505 apply   #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
-decf506 apply   #7a000000000000000000000000000000 -> Infinity
-decf507 apply   #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
-decf508 apply   #7b000000000000000000000000000000 -> Infinity
-
-decf509 apply   NaN                               -> #7c000000000000000000000000000000
-decf510 apply   #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decf511 apply   #7c000000000000000000000000000000 -> NaN
-decf512 apply   #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decf513 apply   #7d000000000000000000000000000000 -> NaN
-decf514 apply   #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decf515 apply   #7e000000000000000000000000000000 -> sNaN
-decf516 apply   #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decf517 apply   #7f000000000000000000000000000000 -> sNaN
-decf518 apply   #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
-decf519 apply   #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-
-decf520 apply   -Infinity                         -> #f8000000000000000000000000000000
-decf521 apply   #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
-decf522 apply   #f8000000000000000000000000000000 -> -Infinity
-decf523 apply   #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
-decf524 apply   #f9000000000000000000000000000000 -> -Infinity
-decf525 apply   #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
-decf526 apply   #fa000000000000000000000000000000 -> -Infinity
-decf527 apply   #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
-decf528 apply   #fb000000000000000000000000000000 -> -Infinity
-
-decf529 apply   -NaN                              -> #fc000000000000000000000000000000
-decf530 apply   #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decf531 apply   #fc000000000000000000000000000000 -> -NaN
-decf532 apply   #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decf533 apply   #fd000000000000000000000000000000 -> -NaN
-decf534 apply   #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decf535 apply   #fe000000000000000000000000000000 -> -sNaN
-decf536 apply   #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decf537 apply   #ff000000000000000000000000000000 -> -sNaN
-decf538 apply   #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
-decf539 apply   #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
-
-decf540 apply   NaN               -> #7c000000000000000000000000000000
-decf541 apply   NaN0              -> #7c000000000000000000000000000000
-decf542 apply   NaN1              -> #7c000000000000000000000000000001
-decf543 apply   NaN12             -> #7c000000000000000000000000000012
-decf544 apply   NaN79             -> #7c000000000000000000000000000079
-decf545 apply   NaN12345          -> #7c0000000000000000000000000049c5
-decf546 apply   NaN123456         -> #7c000000000000000000000000028e56
-decf547 apply   NaN799799         -> #7c0000000000000000000000000f7fdf
-decf548 apply   NaN799799799799799799799799799799799  -> #7c003dff7fdff7fdff7fdff7fdff7fdf
-decf549 apply   NaN999999999999999999999999999999999  -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-decf550 apply   NaN1234567890123456789012345678901234 -> #7c000000000000000000000000000000  -- too many digits
-
--- fold-down full sequence
-decf600 apply   1E+6145                 -> #78000000000000000000000000000000 Overflow Inexact Rounded
-decf601 apply   1E+6144                 -> #47ffc000000000000000000000000000 Clamped
-decf602 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144
-decf603 apply   1E+6143                 -> #43ffc800000000000000000000000000 Clamped
-decf604 apply   #43ffc800000000000000000000000000       -> 1.00000000000000000000000000000000E+6143
-decf605 apply   1E+6142                 -> #43ffc100000000000000000000000000 Clamped
-decf606 apply   #43ffc100000000000000000000000000       -> 1.0000000000000000000000000000000E+6142
-decf607 apply   1E+6141                 -> #43ffc010000000000000000000000000 Clamped
-decf608 apply   #43ffc010000000000000000000000000       -> 1.000000000000000000000000000000E+6141
-decf609 apply   1E+6140                 -> #43ffc002000000000000000000000000 Clamped
-decf610 apply   #43ffc002000000000000000000000000       -> 1.00000000000000000000000000000E+6140
-decf611 apply   1E+6139                 -> #43ffc000400000000000000000000000 Clamped
-decf612 apply   #43ffc000400000000000000000000000       -> 1.0000000000000000000000000000E+6139
-decf613 apply   1E+6138                 -> #43ffc000040000000000000000000000 Clamped
-decf614 apply   #43ffc000040000000000000000000000       -> 1.000000000000000000000000000E+6138
-decf615 apply   1E+6137                 -> #43ffc000008000000000000000000000 Clamped
-decf616 apply   #43ffc000008000000000000000000000       -> 1.00000000000000000000000000E+6137
-decf617 apply   1E+6136                 -> #43ffc000001000000000000000000000 Clamped
-decf618 apply   #43ffc000001000000000000000000000       -> 1.0000000000000000000000000E+6136
-decf619 apply   1E+6135                 -> #43ffc000000100000000000000000000 Clamped
-decf620 apply   #43ffc000000100000000000000000000       -> 1.000000000000000000000000E+6135
-decf621 apply   1E+6134                 -> #43ffc000000020000000000000000000 Clamped
-decf622 apply   #43ffc000000020000000000000000000       -> 1.00000000000000000000000E+6134
-decf623 apply   1E+6133                 -> #43ffc000000004000000000000000000 Clamped
-decf624 apply   #43ffc000000004000000000000000000       -> 1.0000000000000000000000E+6133
-decf625 apply   1E+6132                 -> #43ffc000000000400000000000000000 Clamped
-decf626 apply   #43ffc000000000400000000000000000       -> 1.000000000000000000000E+6132
-decf627 apply   1E+6131                 -> #43ffc000000000080000000000000000 Clamped
-decf628 apply   #43ffc000000000080000000000000000       -> 1.00000000000000000000E+6131
-decf629 apply   1E+6130                 -> #43ffc000000000010000000000000000 Clamped
-decf630 apply   #43ffc000000000010000000000000000       -> 1.0000000000000000000E+6130
-decf631 apply   1E+6129                 -> #43ffc000000000001000000000000000 Clamped
-decf632 apply   #43ffc000000000001000000000000000       -> 1.000000000000000000E+6129
-decf633 apply   1E+6128                 -> #43ffc000000000000200000000000000 Clamped
-decf634 apply   #43ffc000000000000200000000000000       -> 1.00000000000000000E+6128
-decf635 apply   1E+6127                 -> #43ffc000000000000040000000000000 Clamped
-decf636 apply   #43ffc000000000000040000000000000       -> 1.0000000000000000E+6127
-decf637 apply   1E+6126                 -> #43ffc000000000000004000000000000 Clamped
-decf638 apply   #43ffc000000000000004000000000000       -> 1.000000000000000E+6126
-decf639 apply   1E+6125                 -> #43ffc000000000000000800000000000 Clamped
-decf640 apply   #43ffc000000000000000800000000000       -> 1.00000000000000E+6125
-decf641 apply   1E+6124                 -> #43ffc000000000000000100000000000 Clamped
-decf642 apply   #43ffc000000000000000100000000000       -> 1.0000000000000E+6124
-decf643 apply   1E+6123                 -> #43ffc000000000000000010000000000 Clamped
-decf644 apply   #43ffc000000000000000010000000000       -> 1.000000000000E+6123
-decf645 apply   1E+6122                 -> #43ffc000000000000000002000000000 Clamped
-decf646 apply   #43ffc000000000000000002000000000       -> 1.00000000000E+6122
-decf647 apply   1E+6121                 -> #43ffc000000000000000000400000000 Clamped
-decf648 apply   #43ffc000000000000000000400000000       -> 1.0000000000E+6121
-decf649 apply   1E+6120                 -> #43ffc000000000000000000040000000 Clamped
-decf650 apply   #43ffc000000000000000000040000000       -> 1.000000000E+6120
-decf651 apply   1E+6119                 -> #43ffc000000000000000000008000000 Clamped
-decf652 apply   #43ffc000000000000000000008000000       -> 1.00000000E+6119
-decf653 apply   1E+6118                 -> #43ffc000000000000000000001000000 Clamped
-decf654 apply   #43ffc000000000000000000001000000       -> 1.0000000E+6118
-decf655 apply   1E+6117                 -> #43ffc000000000000000000000100000 Clamped
-decf656 apply   #43ffc000000000000000000000100000       -> 1.000000E+6117
-decf657 apply   1E+6116                 -> #43ffc000000000000000000000020000 Clamped
-decf658 apply   #43ffc000000000000000000000020000       -> 1.00000E+6116
-decf659 apply   1E+6115                 -> #43ffc000000000000000000000004000 Clamped
-decf660 apply   #43ffc000000000000000000000004000       -> 1.0000E+6115
-decf661 apply   1E+6114                 -> #43ffc000000000000000000000000400 Clamped
-decf662 apply   #43ffc000000000000000000000000400       -> 1.000E+6114
-decf663 apply   1E+6113                 -> #43ffc000000000000000000000000080 Clamped
-decf664 apply   #43ffc000000000000000000000000080       -> 1.00E+6113
-decf665 apply   1E+6112                 -> #43ffc000000000000000000000000010 Clamped
-decf666 apply   #43ffc000000000000000000000000010       -> 1.0E+6112
-decf667 apply   1E+6111                 -> #43ffc000000000000000000000000001
-decf668 apply   #43ffc000000000000000000000000001       -> 1E+6111
-decf669 apply   1E+6110                 -> #43ff8000000000000000000000000001
-decf670 apply   #43ff8000000000000000000000000001       -> 1E+6110
-
--- Selected DPD codes
-decf700 apply   #22080000000000000000000000000000       -> 0
-decf701 apply   #22080000000000000000000000000009       -> 9
-decf702 apply   #22080000000000000000000000000010       -> 10
-decf703 apply   #22080000000000000000000000000019       -> 19
-decf704 apply   #22080000000000000000000000000020       -> 20
-decf705 apply   #22080000000000000000000000000029       -> 29
-decf706 apply   #22080000000000000000000000000030       -> 30
-decf707 apply   #22080000000000000000000000000039       -> 39
-decf708 apply   #22080000000000000000000000000040       -> 40
-decf709 apply   #22080000000000000000000000000049       -> 49
-decf710 apply   #22080000000000000000000000000050       -> 50
-decf711 apply   #22080000000000000000000000000059       -> 59
-decf712 apply   #22080000000000000000000000000060       -> 60
-decf713 apply   #22080000000000000000000000000069       -> 69
-decf714 apply   #22080000000000000000000000000070       -> 70
-decf715 apply   #22080000000000000000000000000071       -> 71
-decf716 apply   #22080000000000000000000000000072       -> 72
-decf717 apply   #22080000000000000000000000000073       -> 73
-decf718 apply   #22080000000000000000000000000074       -> 74
-decf719 apply   #22080000000000000000000000000075       -> 75
-decf720 apply   #22080000000000000000000000000076       -> 76
-decf721 apply   #22080000000000000000000000000077       -> 77
-decf722 apply   #22080000000000000000000000000078       -> 78
-decf723 apply   #22080000000000000000000000000079       -> 79
-
-decf730 apply   #2208000000000000000000000000029e       -> 994
-decf731 apply   #2208000000000000000000000000029f       -> 995
-decf732 apply   #220800000000000000000000000002a0       -> 520
-decf733 apply   #220800000000000000000000000002a1       -> 521
-
--- DPD: one of each of the huffman groups
-decf740 apply   #220800000000000000000000000003f7       -> 777
-decf741 apply   #220800000000000000000000000003f8       -> 778
-decf742 apply   #220800000000000000000000000003eb       -> 787
-decf743 apply   #2208000000000000000000000000037d       -> 877
-decf744 apply   #2208000000000000000000000000039f       -> 997
-decf745 apply   #220800000000000000000000000003bf       -> 979
-decf746 apply   #220800000000000000000000000003df       -> 799
-decf747 apply   #2208000000000000000000000000006e       -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decf750 apply   #2208000000000000000000000000006e       -> 888
-decf751 apply   #2208000000000000000000000000016e       -> 888
-decf752 apply   #2208000000000000000000000000026e       -> 888
-decf753 apply   #2208000000000000000000000000036e       -> 888
-decf754 apply   #2208000000000000000000000000006f       -> 889
-decf755 apply   #2208000000000000000000000000016f       -> 889
-decf756 apply   #2208000000000000000000000000026f       -> 889
-decf757 apply   #2208000000000000000000000000036f       -> 889
-
-decf760 apply   #2208000000000000000000000000007e       -> 898
-decf761 apply   #2208000000000000000000000000017e       -> 898
-decf762 apply   #2208000000000000000000000000027e       -> 898
-decf763 apply   #2208000000000000000000000000037e       -> 898
-decf764 apply   #2208000000000000000000000000007f       -> 899
-decf765 apply   #2208000000000000000000000000017f       -> 899
-decf766 apply   #2208000000000000000000000000027f       -> 899
-decf767 apply   #2208000000000000000000000000037f       -> 899
-
-decf770 apply   #220800000000000000000000000000ee       -> 988
-decf771 apply   #220800000000000000000000000001ee       -> 988
-decf772 apply   #220800000000000000000000000002ee       -> 988
-decf773 apply   #220800000000000000000000000003ee       -> 988
-decf774 apply   #220800000000000000000000000000ef       -> 989
-decf775 apply   #220800000000000000000000000001ef       -> 989
-decf776 apply   #220800000000000000000000000002ef       -> 989
-decf777 apply   #220800000000000000000000000003ef       -> 989
-
-decf780 apply   #220800000000000000000000000000fe       -> 998
-decf781 apply   #220800000000000000000000000001fe       -> 998
-decf782 apply   #220800000000000000000000000002fe       -> 998
-decf783 apply   #220800000000000000000000000003fe       -> 998
-decf784 apply   #220800000000000000000000000000ff       -> 999
-decf785 apply   #220800000000000000000000000001ff       -> 999
-decf786 apply   #220800000000000000000000000002ff       -> 999
-decf787 apply   #220800000000000000000000000003ff       -> 999
-
diff --git a/Lib/test/decimaltestdata/decimal32.decTest b/Lib/test/decimaltestdata/decimal32.decTest
deleted file mode 100644 (file)
index faf1cf4..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-------------------------------------------------------------------------
--- decimal32.decTest -- decimal four-byte format testcases            --
--- Copyright (c) IBM Corporation, 2000, 2003.  All rights reserved.   --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases"     --
--- at http://www2.hursley.ibm.com/decimal for the description of      --
--- these testcases.                                                   --
---                                                                    --
--- These testcases are experimental ('beta' versions), and they       --
--- may contain errors.  They are offered on an as-is basis.  In       --
--- particular, achieving the same results as the tests here is not    --
--- a guarantee that an implementation complies with any Standard      --
--- or specification.  The tests are not exhaustive.                   --
---                                                                    --
--- Please send comments, suggestions, and corrections to the author:  --
---   Mike Cowlishaw, IBM Fellow                                       --
---   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
---   mfc@uk.ibm.com                                                   --
-------------------------------------------------------------------------
-version: 2.39
-
--- This set of tests is for the four-byte concrete representation.
--- Its characteristics are:
---
---  1 bit  sign
---  5 bits combination field
---  6 bits exponent continuation
--- 20 bits coefficient continuation
---
--- Total exponent length 8 bits
--- Total coefficient length 24 bits (7 digits)
---
--- Elimit =  191 (maximum encoded exponent)
--- Emax   =   96 (largest exponent value)
--- Emin   =  -95 (smallest exponent value)
--- bias   =  101 (subtracted from encoded exponent) = -Etiny
-
-extended:    1
-precision:   7
-rounding:    half_up
-maxExponent: 96
-minExponent: -95
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decd001 apply   #A23003D0          -> -7.50
-decd002 apply   -7.50              -> #A23003D0
-
--- Normality
-decd010 apply   1234567            -> #2654d2e7
-decd011 apply   1234567.0          -> #2654d2e7 Rounded
-decd012 apply   1234567.1          -> #2654d2e7 Rounded Inexact
-decd013 apply  -1234567            -> #a654d2e7
-decd014 apply  -1234567.0          -> #a654d2e7 Rounded
-decd015 apply  -1234567.1          -> #a654d2e7 Rounded Inexact
-
-
--- Nmax and similar
-decd022 apply   9.999999E+96            -> #77f3fcff
-decd023 apply   #77f3fcff               -> 9.999999E+96
-decd024 apply   1.234567E+96            -> #47f4d2e7
-decd025 apply   #47f4d2e7               -> 1.234567E+96
--- fold-downs (more below)
-decd030 apply   1.23E+96                -> #47f4c000 Clamped
-decd031 apply   #47f4c000               -> 1.230000E+96
-decd032 apply   1E+96                   -> #47f00000 Clamped
-decd033 apply   #47f00000               -> 1.000000E+96
-
--- overflows
-maxExponent: 999   -- set high so conversion causes the overflow
-minExponent: -999
-decd040 apply   10E+96                  -> #78000000 Overflow Rounded Inexact
-decd041 apply   1.000000E+97            -> #78000000 Overflow Rounded Inexact
-maxExponent: 96
-minExponent: -95
-
-decd051 apply   12345                   -> #225049c5
-decd052 apply   #225049c5               -> 12345
-decd053 apply   1234                    -> #22500534
-decd054 apply   #22500534               -> 1234
-decd055 apply   123                     -> #225000a3
-decd056 apply   #225000a3               -> 123
-decd057 apply   12                      -> #22500012
-decd058 apply   #22500012               -> 12
-decd059 apply   1                       -> #22500001
-decd060 apply   #22500001               -> 1
-decd061 apply   1.23                    -> #223000a3
-decd062 apply   #223000a3               -> 1.23
-decd063 apply   123.45                  -> #223049c5
-decd064 apply   #223049c5               -> 123.45
-
--- Nmin and below
-decd071 apply   1E-95                   -> #00600001
-decd072 apply   #00600001               -> 1E-95
-decd073 apply   1.000000E-95            -> #04000000
-decd074 apply   #04000000               -> 1.000000E-95
-decd075 apply   1.000001E-95            -> #04000001
-decd076 apply   #04000001               -> 1.000001E-95
-
-decd077 apply   0.100000E-95            -> #00020000     Subnormal
-decd07x apply   1.00000E-96             -> 1.00000E-96   Subnormal
-decd078 apply   #00020000               -> 1.00000E-96   Subnormal
-decd079 apply   0.000010E-95            -> #00000010     Subnormal
-decd080 apply   #00000010               -> 1.0E-100      Subnormal
-decd081 apply   0.000001E-95            -> #00000001     Subnormal
-decd082 apply   #00000001               -> 1E-101        Subnormal
-decd083 apply   1e-101                  -> #00000001     Subnormal
-decd084 apply   #00000001               -> 1E-101        Subnormal
-decd08x apply   1e-101                  -> 1E-101        Subnormal
-
--- underflows
-decd090 apply   1e-101                  -> #00000001  Subnormal
-decd091 apply   1.9e-101                -> #00000002  Subnormal Underflow Inexact Rounded
-decd092 apply   1.1e-101                -> #00000001  Subnormal Underflow Inexact Rounded
-decd093 apply   1.001e-101              -> #00000001  Subnormal Underflow Inexact Rounded
-decd094 apply   1.000001e-101           -> #00000001  Subnormal Underflow Inexact Rounded
-decd095 apply   1.0000001e-101          -> #00000001  Subnormal Underflow Inexact Rounded
-decd096 apply   0.1e-101                -> #00000000  Subnormal Underflow Inexact Rounded
-decd097 apply   0.001e-101              -> #00000000  Subnormal Underflow Inexact Rounded
-decd098 apply   0.000001e-101           -> #00000000  Subnormal Underflow Inexact Rounded
-decd099 apply   0.0000001e-101          -> #00000000  Subnormal Underflow Inexact Rounded
-
--- same again, negatives --
-
--- Nmax and similar
-decd122 apply  -9.999999E+96            -> #f7f3fcff
-decd123 apply   #f7f3fcff               -> -9.999999E+96
-decd124 apply  -1.234567E+96            -> #c7f4d2e7
-decd125 apply   #c7f4d2e7               -> -1.234567E+96
--- fold-downs (more below)
-decd130 apply  -1.23E+96                -> #c7f4c000 Clamped
-decd131 apply   #c7f4c000               -> -1.230000E+96
-decd132 apply  -1E+96                   -> #c7f00000 Clamped
-decd133 apply   #c7f00000               -> -1.000000E+96
-
--- overflows
-maxExponent: 999   -- set high so conversion causes the overflow
-minExponent: -999
-decd140 apply  -10E+96                  -> #f8000000 Overflow Rounded Inexact
-decd141 apply  -1.000000E+97            -> #f8000000 Overflow Rounded Inexact
-maxExponent: 96
-minExponent: -95
-
-decd151 apply  -12345                   -> #a25049c5
-decd152 apply   #a25049c5               -> -12345
-decd153 apply  -1234                    -> #a2500534
-decd154 apply   #a2500534               -> -1234
-decd155 apply  -123                     -> #a25000a3
-decd156 apply   #a25000a3               -> -123
-decd157 apply  -12                      -> #a2500012
-decd158 apply   #a2500012               -> -12
-decd159 apply  -1                       -> #a2500001
-decd160 apply   #a2500001               -> -1
-decd161 apply  -1.23                    -> #a23000a3
-decd162 apply   #a23000a3               -> -1.23
-decd163 apply  -123.45                  -> #a23049c5
-decd164 apply   #a23049c5               -> -123.45
-
--- Nmin and below
-decd171 apply  -1E-95                   -> #80600001
-decd172 apply   #80600001               -> -1E-95
-decd173 apply  -1.000000E-95            -> #84000000
-decd174 apply   #84000000               -> -1.000000E-95
-decd175 apply  -1.000001E-95            -> #84000001
-decd176 apply   #84000001               -> -1.000001E-95
-
-decd177 apply  -0.100000E-95            -> #80020000     Subnormal
-decd178 apply   #80020000               -> -1.00000E-96  Subnormal
-decd179 apply  -0.000010E-95            -> #80000010     Subnormal
-decd180 apply   #80000010               -> -1.0E-100     Subnormal
-decd181 apply  -0.000001E-95            -> #80000001     Subnormal
-decd182 apply   #80000001               -> -1E-101       Subnormal
-decd183 apply  -1e-101                  -> #80000001     Subnormal
-decd184 apply   #80000001               -> -1E-101       Subnormal
-
--- underflows
-decd190 apply  -1e-101                  -> #80000001  Subnormal
-decd191 apply  -1.9e-101                -> #80000002  Subnormal Underflow Inexact Rounded
-decd192 apply  -1.1e-101                -> #80000001  Subnormal Underflow Inexact Rounded
-decd193 apply  -1.001e-101              -> #80000001  Subnormal Underflow Inexact Rounded
-decd194 apply  -1.000001e-101           -> #80000001  Subnormal Underflow Inexact Rounded
-decd195 apply  -1.0000001e-101          -> #80000001  Subnormal Underflow Inexact Rounded
-decd196 apply  -0.1e-101                -> #80000000  Subnormal Underflow Inexact Rounded
-decd197 apply  -0.001e-101              -> #80000000  Subnormal Underflow Inexact Rounded
-decd198 apply  -0.000001e-101           -> #80000000  Subnormal Underflow Inexact Rounded
-decd199 apply  -0.0000001e-101          -> #80000000  Subnormal Underflow Inexact Rounded
-
--- zeros
-decd400 apply   0E-400                  -> #00000000  Clamped
-decd401 apply   0E-101                  -> #00000000
-decd402 apply   #00000000               -> 0E-101
-decd403 apply   0.000000E-95            -> #00000000
-decd404 apply   #00000000               -> 0E-101
-decd405 apply   0E-2                    -> #22300000
-decd406 apply   #22300000               -> 0.00
-decd407 apply   0                       -> #22500000
-decd408 apply   #22500000               -> 0
-decd409 apply   0E+3                    -> #22800000
-decd410 apply   #22800000               -> 0E+3
-decd411 apply   0E+90                   -> #43f00000
-decd412 apply   #43f00000               -> 0E+90
--- clamped zeros...
-decd413 apply   0E+91                   -> #43f00000  Clamped
-decd414 apply   #43f00000               -> 0E+90
-decd415 apply   0E+96                   -> #43f00000  Clamped
-decd416 apply   #43f00000               -> 0E+90
-decd417 apply   0E+400                  -> #43f00000  Clamped
-decd418 apply   #43f00000               -> 0E+90
-
--- negative zeros
-decd420 apply   -0E-400                 -> #80000000  Clamped
-decd421 apply   -0E-101                 -> #80000000
-decd422 apply   #80000000               -> -0E-101
-decd423 apply   -0.000000E-95           -> #80000000
-decd424 apply   #80000000               -> -0E-101
-decd425 apply   -0E-2                   -> #a2300000
-decd426 apply   #a2300000               -> -0.00
-decd427 apply   -0                      -> #a2500000
-decd428 apply   #a2500000               -> -0
-decd429 apply   -0E+3                   -> #a2800000
-decd430 apply   #a2800000               -> -0E+3
-decd431 apply   -0E+90                  -> #c3f00000
-decd432 apply   #c3f00000               -> -0E+90
--- clamped zeros...
-decd433 apply   -0E+91                  -> #c3f00000  Clamped
-decd434 apply   #c3f00000               -> -0E+90
-decd435 apply   -0E+96                  -> #c3f00000  Clamped
-decd436 apply   #c3f00000               -> -0E+90
-decd437 apply   -0E+400                 -> #c3f00000  Clamped
-decd438 apply   #c3f00000               -> -0E+90
-
--- Specials
-decd500 apply   Infinity  -> #78000000
-decd501 apply   #78787878 -> #78000000
-decd502 apply   #78000000 -> Infinity
-decd503 apply   #79797979 -> #78000000
-decd504 apply   #79000000 -> Infinity
-decd505 apply   #7a7a7a7a -> #78000000
-decd506 apply   #7a000000 -> Infinity
-decd507 apply   #7b7b7b7b -> #78000000
-decd508 apply   #7b000000 -> Infinity
-decd509 apply   #7c7c7c7c -> #7c0c7c7c
-
-decd510 apply   NaN       -> #7c000000
-decd511 apply   #7c000000 -> NaN
-decd512 apply   #7d7d7d7d -> #7c0d7d7d
-decd513 apply   #7d000000 -> NaN
-decd514 apply   #7e7e7e7e -> #7e0e7c7e
-decd515 apply   #7e000000 -> sNaN
-decd516 apply   #7f7f7f7f -> #7e0f7c7f
-decd517 apply   #7f000000 -> sNaN
-decd518 apply   #7fffffff -> sNaN999999
-decd519 apply   #7fffffff -> #7e03fcff
-
-decd520 apply   -Infinity -> #f8000000
-decd521 apply   #f8787878 -> #f8000000
-decd522 apply   #f8000000 -> -Infinity
-decd523 apply   #f9797979 -> #f8000000
-decd524 apply   #f9000000 -> -Infinity
-decd525 apply   #fa7a7a7a -> #f8000000
-decd526 apply   #fa000000 -> -Infinity
-decd527 apply   #fb7b7b7b -> #f8000000
-decd528 apply   #fb000000 -> -Infinity
-
-decd529 apply   -NaN      -> #fc000000
-decd530 apply   #fc7c7c7c -> #fc0c7c7c
-decd531 apply   #fc000000 -> -NaN
-decd532 apply   #fd7d7d7d -> #fc0d7d7d
-decd533 apply   #fd000000 -> -NaN
-decd534 apply   #fe7e7e7e -> #fe0e7c7e
-decd535 apply   #fe000000 -> -sNaN
-decd536 apply   #ff7f7f7f -> #fe0f7c7f
-decd537 apply   #ff000000 -> -sNaN
-decd538 apply   #ffffffff -> -sNaN999999
-decd539 apply   #ffffffff -> #fe03fcff
-
--- diagnostic NaNs
-decd540 apply   NaN       -> #7c000000
-decd541 apply   NaN0      -> #7c000000
-decd542 apply   NaN1      -> #7c000001
-decd543 apply   NaN12     -> #7c000012
-decd544 apply   NaN79     -> #7c000079
-decd545 apply   NaN12345   -> #7c0049c5
-decd546 apply   NaN123456  -> #7c028e56
-decd547 apply   NaN799799  -> #7c0f7fdf
-decd548 apply   NaN999999  -> #7c03fcff
-decd549 apply   NaN1234567 -> #7c000000  -- too many digits
-
-
--- fold-down full sequence
-decd601 apply   1E+96                   -> #47f00000 Clamped
-decd602 apply   #47f00000               -> 1.000000E+96
-decd603 apply   1E+95                   -> #43f20000 Clamped
-decd604 apply   #43f20000               -> 1.00000E+95
-decd605 apply   1E+94                   -> #43f04000 Clamped
-decd606 apply   #43f04000               -> 1.0000E+94
-decd607 apply   1E+93                   -> #43f00400 Clamped
-decd608 apply   #43f00400               -> 1.000E+93
-decd609 apply   1E+92                   -> #43f00080 Clamped
-decd610 apply   #43f00080               -> 1.00E+92
-decd611 apply   1E+91                   -> #43f00010 Clamped
-decd612 apply   #43f00010               -> 1.0E+91
-decd613 apply   1E+90                   -> #43f00001
-decd614 apply   #43f00001               -> 1E+90
-
-
--- Selected DPD codes
-decd700 apply   #22500000       -> 0
-decd701 apply   #22500009       -> 9
-decd702 apply   #22500010       -> 10
-decd703 apply   #22500019       -> 19
-decd704 apply   #22500020       -> 20
-decd705 apply   #22500029       -> 29
-decd706 apply   #22500030       -> 30
-decd707 apply   #22500039       -> 39
-decd708 apply   #22500040       -> 40
-decd709 apply   #22500049       -> 49
-decd710 apply   #22500050       -> 50
-decd711 apply   #22500059       -> 59
-decd712 apply   #22500060       -> 60
-decd713 apply   #22500069       -> 69
-decd714 apply   #22500070       -> 70
-decd715 apply   #22500071       -> 71
-decd716 apply   #22500072       -> 72
-decd717 apply   #22500073       -> 73
-decd718 apply   #22500074       -> 74
-decd719 apply   #22500075       -> 75
-decd720 apply   #22500076       -> 76
-decd721 apply   #22500077       -> 77
-decd722 apply   #22500078       -> 78
-decd723 apply   #22500079       -> 79
-
-decd730 apply   #2250029e       -> 994
-decd731 apply   #2250029f       -> 995
-decd732 apply   #225002a0       -> 520
-decd733 apply   #225002a1       -> 521
-
--- DPD: one of each of the huffman groups
-decd740 apply   #225003f7       -> 777
-decd741 apply   #225003f8       -> 778
-decd742 apply   #225003eb       -> 787
-decd743 apply   #2250037d       -> 877
-decd744 apply   #2250039f       -> 997
-decd745 apply   #225003bf       -> 979
-decd746 apply   #225003df       -> 799
-decd747 apply   #2250006e       -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decd750 apply   #2250006e       -> 888
-decd751 apply   #2250016e       -> 888
-decd752 apply   #2250026e       -> 888
-decd753 apply   #2250036e       -> 888
-decd754 apply   #2250006f       -> 889
-decd755 apply   #2250016f       -> 889
-decd756 apply   #2250026f       -> 889
-decd757 apply   #2250036f       -> 889
-
-decd760 apply   #2250007e       -> 898
-decd761 apply   #2250017e       -> 898
-decd762 apply   #2250027e       -> 898
-decd763 apply   #2250037e       -> 898
-decd764 apply   #2250007f       -> 899
-decd765 apply   #2250017f       -> 899
-decd766 apply   #2250027f       -> 899
-decd767 apply   #2250037f       -> 899
-
-decd770 apply   #225000ee       -> 988
-decd771 apply   #225001ee       -> 988
-decd772 apply   #225002ee       -> 988
-decd773 apply   #225003ee       -> 988
-decd774 apply   #225000ef       -> 989
-decd775 apply   #225001ef       -> 989
-decd776 apply   #225002ef       -> 989
-decd777 apply   #225003ef       -> 989
-
-decd780 apply   #225000fe       -> 998
-decd781 apply   #225001fe       -> 998
-decd782 apply   #225002fe       -> 998
-decd783 apply   #225003fe       -> 998
-decd784 apply   #225000ff       -> 999
-decd785 apply   #225001ff       -> 999
-decd786 apply   #225002ff       -> 999
-decd787 apply   #225003ff       -> 999
-
diff --git a/Lib/test/decimaltestdata/decimal64.decTest b/Lib/test/decimaltestdata/decimal64.decTest
deleted file mode 100644 (file)
index a254167..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-------------------------------------------------------------------------
--- decimal64.decTest -- decimal eight-byte format testcases           --
--- Copyright (c) IBM Corporation, 2000, 2003.  All rights reserved.   --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases"     --
--- at http://www2.hursley.ibm.com/decimal for the description of      --
--- these testcases.                                                   --
---                                                                    --
--- These testcases are experimental ('beta' versions), and they       --
--- may contain errors.  They are offered on an as-is basis.  In       --
--- particular, achieving the same results as the tests here is not    --
--- a guarantee that an implementation complies with any Standard      --
--- or specification.  The tests are not exhaustive.                   --
---                                                                    --
--- Please send comments, suggestions, and corrections to the author:  --
---   Mike Cowlishaw, IBM Fellow                                       --
---   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
---   mfc@uk.ibm.com                                                   --
-------------------------------------------------------------------------
-version: 2.39
-
--- This set of tests is for the eight-byte concrete representation.
--- Its characteristics are:
---
---  1 bit  sign
---  5 bits combination field
---  8 bits exponent continuation
--- 50 bits coefficient continuation
---
--- Total exponent length 10 bits
--- Total coefficient length 54 bits (16 digits)
---
--- Elimit =  767 (maximum encoded exponent)
--- Emax   =  384 (largest exponent value)
--- Emin   = -383 (smallest exponent value)
--- bias   =  398 (subtracted from encoded exponent) = -Etiny
-
-extended:    1
-precision:   16
-rounding:    half_up
-maxExponent: 384
-minExponent: -383
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-dece001 apply   #A2300000000003D0 -> -7.50
-dece002 apply   -7.50             -> #A2300000000003D0
-
--- Normality
-dece010 apply   1234567890123456   -> #263934b9c1e28e56
-dece011 apply   1234567890123456.0 -> #263934b9c1e28e56 Rounded
-dece012 apply   1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact
-dece013 apply  -1234567890123456   -> #a63934b9c1e28e56
-dece014 apply  -1234567890123456.0 -> #a63934b9c1e28e56 Rounded
-dece015 apply  -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact
-
-
--- Nmax and similar
-dece022 apply   9.999999999999999E+384  -> #77fcff3fcff3fcff
-dece023 apply   #77fcff3fcff3fcff       -> 9.999999999999999E+384
-dece024 apply   1.234567890123456E+384  -> #47fd34b9c1e28e56
-dece025 apply   #47fd34b9c1e28e56       -> 1.234567890123456E+384
--- fold-downs (more below)
-dece030 apply   1.23E+384               -> #47fd300000000000 Clamped
-dece031 apply   #47fd300000000000       -> 1.230000000000000E+384
-dece032 apply   1E+384                  -> #47fc000000000000 Clamped
-dece033 apply   #47fc000000000000       -> 1.000000000000000E+384
-
--- overflows
-maxExponent: 999   -- set high so conversion causes the overflow
-minExponent: -999
-dece040 apply   10E+384                 -> #7800000000000000 Overflow Rounded Inexact
-dece041 apply   1.000000000000000E+385  -> #7800000000000000 Overflow Rounded Inexact
-maxExponent: 384
-minExponent: -383
-
-dece051 apply   12345                   -> #22380000000049c5
-dece052 apply   #22380000000049c5       -> 12345
-dece053 apply   1234                    -> #2238000000000534
-dece054 apply   #2238000000000534       -> 1234
-dece055 apply   123                     -> #22380000000000a3
-dece056 apply   #22380000000000a3       -> 123
-dece057 apply   12                      -> #2238000000000012
-dece058 apply   #2238000000000012       -> 12
-dece059 apply   1                       -> #2238000000000001
-dece060 apply   #2238000000000001       -> 1
-dece061 apply   1.23                    -> #22300000000000a3
-dece062 apply   #22300000000000a3       -> 1.23
-dece063 apply   123.45                  -> #22300000000049c5
-dece064 apply   #22300000000049c5       -> 123.45
-
--- Nmin and below
-dece071 apply   1E-383                  -> #003c000000000001
-dece072 apply   #003c000000000001       -> 1E-383
-dece073 apply   1.000000000000000E-383  -> #0400000000000000
-dece074 apply   #0400000000000000       -> 1.000000000000000E-383
-dece075 apply   1.000000000000001E-383  -> #0400000000000001
-dece076 apply   #0400000000000001       -> 1.000000000000001E-383
-
-dece077 apply   0.100000000000000E-383  -> #0000800000000000      Subnormal
-dece078 apply   #0000800000000000       -> 1.00000000000000E-384  Subnormal
-dece079 apply   0.000000000000010E-383  -> #0000000000000010      Subnormal
-dece080 apply   #0000000000000010       -> 1.0E-397               Subnormal
-dece081 apply   0.00000000000001E-383   -> #0004000000000001      Subnormal
-dece082 apply   #0004000000000001       -> 1E-397                 Subnormal
-dece083 apply   0.000000000000001E-383  -> #0000000000000001      Subnormal
-dece084 apply   #0000000000000001       -> 1E-398                 Subnormal
-
--- underflows
-dece090 apply   1e-398                  -> #0000000000000001  Subnormal
-dece091 apply   1.9e-398                -> #0000000000000002  Subnormal Underflow Inexact Rounded
-dece092 apply   1.1e-398                -> #0000000000000001  Subnormal Underflow Inexact Rounded
-dece093 apply   1.00000000001e-398      -> #0000000000000001  Subnormal Underflow Inexact Rounded
-dece094 apply   1.00000000000001e-398   -> #0000000000000001  Subnormal Underflow Inexact Rounded
-dece095 apply   1.000000000000001e-398  -> #0000000000000001  Subnormal Underflow Inexact Rounded
-dece096 apply   0.1e-398                -> #0000000000000000  Subnormal Underflow Inexact Rounded
-dece097 apply   0.00000000001e-398      -> #0000000000000000  Subnormal Underflow Inexact Rounded
-dece098 apply   0.00000000000001e-398   -> #0000000000000000  Subnormal Underflow Inexact Rounded
-dece099 apply   0.000000000000001e-398  -> #0000000000000000  Subnormal Underflow Inexact Rounded
-
--- Same again, negatives
--- Nmax and similar
-dece122 apply  -9.999999999999999E+384  -> #f7fcff3fcff3fcff
-dece123 apply   #f7fcff3fcff3fcff       -> -9.999999999999999E+384
-dece124 apply  -1.234567890123456E+384  -> #c7fd34b9c1e28e56
-dece125 apply   #c7fd34b9c1e28e56       -> -1.234567890123456E+384
--- fold-downs (more below)
-dece130 apply  -1.23E+384               -> #c7fd300000000000 Clamped
-dece131 apply   #c7fd300000000000       -> -1.230000000000000E+384
-dece132 apply  -1E+384                  -> #c7fc000000000000 Clamped
-dece133 apply   #c7fc000000000000       -> -1.000000000000000E+384
-
--- overflows
-maxExponent: 999   -- set high so conversion causes the overflow
-minExponent: -999
-dece140 apply  -10E+384                 -> #f800000000000000 Overflow Rounded Inexact
-dece141 apply  -1.000000000000000E+385  -> #f800000000000000 Overflow Rounded Inexact
-maxExponent: 384
-minExponent: -383
-
-dece151 apply  -12345                   -> #a2380000000049c5
-dece152 apply   #a2380000000049c5       -> -12345
-dece153 apply  -1234                    -> #a238000000000534
-dece154 apply   #a238000000000534       -> -1234
-dece155 apply  -123                     -> #a2380000000000a3
-dece156 apply   #a2380000000000a3       -> -123
-dece157 apply  -12                      -> #a238000000000012
-dece158 apply   #a238000000000012       -> -12
-dece159 apply  -1                       -> #a238000000000001
-dece160 apply   #a238000000000001       -> -1
-dece161 apply  -1.23                    -> #a2300000000000a3
-dece162 apply   #a2300000000000a3       -> -1.23
-dece163 apply  -123.45                  -> #a2300000000049c5
-dece164 apply   #a2300000000049c5       -> -123.45
-
--- Nmin and below
-dece171 apply  -1E-383                  -> #803c000000000001
-dece172 apply   #803c000000000001       -> -1E-383
-dece173 apply  -1.000000000000000E-383  -> #8400000000000000
-dece174 apply   #8400000000000000       -> -1.000000000000000E-383
-dece175 apply  -1.000000000000001E-383  -> #8400000000000001
-dece176 apply   #8400000000000001       -> -1.000000000000001E-383
-
-dece177 apply  -0.100000000000000E-383  -> #8000800000000000       Subnormal
-dece178 apply   #8000800000000000       -> -1.00000000000000E-384  Subnormal
-dece179 apply  -0.000000000000010E-383  -> #8000000000000010       Subnormal
-dece180 apply   #8000000000000010       -> -1.0E-397               Subnormal
-dece181 apply  -0.00000000000001E-383   -> #8004000000000001       Subnormal
-dece182 apply   #8004000000000001       -> -1E-397                 Subnormal
-dece183 apply  -0.000000000000001E-383  -> #8000000000000001       Subnormal
-dece184 apply   #8000000000000001       -> -1E-398                 Subnormal
-
--- underflows
-dece189 apply   -1e-398                 -> #8000000000000001  Subnormal
-dece190 apply   -1.0e-398               -> #8000000000000001  Subnormal Rounded
-dece191 apply   -1.9e-398               -> #8000000000000002  Subnormal Underflow Inexact Rounded
-dece192 apply   -1.1e-398               -> #8000000000000001  Subnormal Underflow Inexact Rounded
-dece193 apply   -1.00000000001e-398     -> #8000000000000001  Subnormal Underflow Inexact Rounded
-dece194 apply   -1.00000000000001e-398  -> #8000000000000001  Subnormal Underflow Inexact Rounded
-dece195 apply   -1.000000000000001e-398 -> #8000000000000001  Subnormal Underflow Inexact Rounded
-dece196 apply   -0.1e-398               -> #8000000000000000  Subnormal Underflow Inexact Rounded
-dece197 apply   -0.00000000001e-398     -> #8000000000000000  Subnormal Underflow Inexact Rounded
-dece198 apply   -0.00000000000001e-398  -> #8000000000000000  Subnormal Underflow Inexact Rounded
-dece199 apply   -0.000000000000001e-398 -> #8000000000000000  Subnormal Underflow Inexact Rounded
-
--- zeros
-dece401 apply   0E-500                  -> #0000000000000000  Clamped
-dece402 apply   0E-400                  -> #0000000000000000  Clamped
-dece403 apply   0E-398                  -> #0000000000000000
-dece404 apply   #0000000000000000       -> 0E-398
-dece405 apply   0.000000000000000E-383  -> #0000000000000000
-dece406 apply   #0000000000000000       -> 0E-398
-dece407 apply   0E-2                    -> #2230000000000000
-dece408 apply   #2230000000000000       -> 0.00
-dece409 apply   0                       -> #2238000000000000
-dece410 apply   #2238000000000000       -> 0
-dece411 apply   0E+3                    -> #2244000000000000
-dece412 apply   #2244000000000000       -> 0E+3
-dece413 apply   0E+369                  -> #43fc000000000000
-dece414 apply   #43fc000000000000       -> 0E+369
--- clamped zeros...
-dece415 apply   0E+370                  -> #43fc000000000000  Clamped
-dece416 apply   #43fc000000000000       -> 0E+369
-dece417 apply   0E+384                  -> #43fc000000000000  Clamped
-dece418 apply   #43fc000000000000       -> 0E+369
-dece419 apply   0E+400                  -> #43fc000000000000  Clamped
-dece420 apply   #43fc000000000000       -> 0E+369
-dece421 apply   0E+500                  -> #43fc000000000000  Clamped
-dece422 apply   #43fc000000000000       -> 0E+369
-
--- negative zeros
-dece431 apply   -0E-400                 -> #8000000000000000  Clamped
-dece432 apply   -0E-400                 -> #8000000000000000  Clamped
-dece433 apply   -0E-398                 -> #8000000000000000
-dece434 apply   #8000000000000000       -> -0E-398
-dece435 apply   -0.000000000000000E-383 -> #8000000000000000
-dece436 apply   #8000000000000000       -> -0E-398
-dece437 apply   -0E-2                   -> #a230000000000000
-dece438 apply   #a230000000000000       -> -0.00
-dece439 apply   -0                      -> #a238000000000000
-dece440 apply   #a238000000000000       -> -0
-dece441 apply   -0E+3                   -> #a244000000000000
-dece442 apply   #a244000000000000       -> -0E+3
-dece443 apply   -0E+369                 -> #c3fc000000000000
-dece444 apply   #c3fc000000000000       -> -0E+369
--- clamped zeros...
-dece445 apply   -0E+370                 -> #c3fc000000000000  Clamped
-dece446 apply   #c3fc000000000000       -> -0E+369
-dece447 apply   -0E+384                 -> #c3fc000000000000  Clamped
-dece448 apply   #c3fc000000000000       -> -0E+369
-dece449 apply   -0E+400                 -> #c3fc000000000000  Clamped
-dece450 apply   #c3fc000000000000       -> -0E+369
-dece451 apply   -0E+500                 -> #c3fc000000000000  Clamped
-dece452 apply   #c3fc000000000000       -> -0E+369
-
--- Specials
-dece500 apply   Infinity          -> #7800000000000000
-dece501 apply   #7878787878787878 -> #7800000000000000
-dece502 apply   #7800000000000000 -> Infinity
-dece503 apply   #7979797979797979 -> #7800000000000000
-dece504 apply   #7900000000000000 -> Infinity
-dece505 apply   #7a7a7a7a7a7a7a7a -> #7800000000000000
-dece506 apply   #7a00000000000000 -> Infinity
-dece507 apply   #7b7b7b7b7b7b7b7b -> #7800000000000000
-dece508 apply   #7b00000000000000 -> Infinity
-
-dece509 apply   NaN               -> #7c00000000000000
-dece510 apply   #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
-dece511 apply   #7c00000000000000 -> NaN
-dece512 apply   #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
-dece513 apply   #7d00000000000000 -> NaN
-dece514 apply   #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
-dece515 apply   #7e00000000000000 -> sNaN
-dece516 apply   #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
-dece517 apply   #7f00000000000000 -> sNaN
-dece518 apply   #7fffffffffffffff -> sNaN999999999999999
-dece519 apply   #7fffffffffffffff -> #7e00ff3fcff3fcff
-
-dece520 apply   -Infinity         -> #f800000000000000
-dece521 apply   #f878787878787878 -> #f800000000000000
-dece522 apply   #f800000000000000 -> -Infinity
-dece523 apply   #f979797979797979 -> #f800000000000000
-dece524 apply   #f900000000000000 -> -Infinity
-dece525 apply   #fa7a7a7a7a7a7a7a -> #f800000000000000
-dece526 apply   #fa00000000000000 -> -Infinity
-dece527 apply   #fb7b7b7b7b7b7b7b -> #f800000000000000
-dece528 apply   #fb00000000000000 -> -Infinity
-
-dece529 apply   -NaN              -> #fc00000000000000
-dece530 apply   #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
-dece531 apply   #fc00000000000000 -> -NaN
-dece532 apply   #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
-dece533 apply   #fd00000000000000 -> -NaN
-dece534 apply   #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
-dece535 apply   #fe00000000000000 -> -sNaN
-dece536 apply   #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
-dece537 apply   #ff00000000000000 -> -sNaN
-dece538 apply   #ffffffffffffffff -> -sNaN999999999999999
-dece539 apply   #ffffffffffffffff -> #fe00ff3fcff3fcff
-
--- diagnostic NaNs
-dece540 apply   NaN                 -> #7c00000000000000
-dece541 apply   NaN0                -> #7c00000000000000
-dece542 apply   NaN1                -> #7c00000000000001
-dece543 apply   NaN12               -> #7c00000000000012
-dece544 apply   NaN79               -> #7c00000000000079
-dece545 apply   NaN12345            -> #7c000000000049c5
-dece546 apply   NaN123456           -> #7c00000000028e56
-dece547 apply   NaN799799           -> #7c000000000f7fdf
-dece548 apply   NaN799799799799799  -> #7c03dff7fdff7fdf
-dece549 apply   NaN999999999999999  -> #7c00ff3fcff3fcff
-dece550 apply   NaN1234567890123456 -> #7c00000000000000  -- too many digits
-
--- fold-down full sequence
-dece601 apply   1E+384                  -> #47fc000000000000 Clamped
-dece602 apply   #47fc000000000000       -> 1.000000000000000E+384
-dece603 apply   1E+383                  -> #43fc800000000000 Clamped
-dece604 apply   #43fc800000000000       -> 1.00000000000000E+383
-dece605 apply   1E+382                  -> #43fc100000000000 Clamped
-dece606 apply   #43fc100000000000       -> 1.0000000000000E+382
-dece607 apply   1E+381                  -> #43fc010000000000 Clamped
-dece608 apply   #43fc010000000000       -> 1.000000000000E+381
-dece609 apply   1E+380                  -> #43fc002000000000 Clamped
-dece610 apply   #43fc002000000000       -> 1.00000000000E+380
-dece611 apply   1E+379                  -> #43fc000400000000 Clamped
-dece612 apply   #43fc000400000000       -> 1.0000000000E+379
-dece613 apply   1E+378                  -> #43fc000040000000 Clamped
-dece614 apply   #43fc000040000000       -> 1.000000000E+378
-dece615 apply   1E+377                  -> #43fc000008000000 Clamped
-dece616 apply   #43fc000008000000       -> 1.00000000E+377
-dece617 apply   1E+376                  -> #43fc000001000000 Clamped
-dece618 apply   #43fc000001000000       -> 1.0000000E+376
-dece619 apply   1E+375                  -> #43fc000000100000 Clamped
-dece620 apply   #43fc000000100000       -> 1.000000E+375
-dece621 apply   1E+374                  -> #43fc000000020000 Clamped
-dece622 apply   #43fc000000020000       -> 1.00000E+374
-dece623 apply   1E+373                  -> #43fc000000004000 Clamped
-dece624 apply   #43fc000000004000       -> 1.0000E+373
-dece625 apply   1E+372                  -> #43fc000000000400 Clamped
-dece626 apply   #43fc000000000400       -> 1.000E+372
-dece627 apply   1E+371                  -> #43fc000000000080 Clamped
-dece628 apply   #43fc000000000080       -> 1.00E+371
-dece629 apply   1E+370                  -> #43fc000000000010 Clamped
-dece630 apply   #43fc000000000010       -> 1.0E+370
-dece631 apply   1E+369                  -> #43fc000000000001
-dece632 apply   #43fc000000000001       -> 1E+369
-dece633 apply   1E+368                  -> #43f8000000000001
-dece634 apply   #43f8000000000001       -> 1E+368
--- same with 9s
-dece641 apply   9E+384                  -> #77fc000000000000 Clamped
-dece642 apply   #77fc000000000000       -> 9.000000000000000E+384
-dece643 apply   9E+383                  -> #43fc8c0000000000 Clamped
-dece644 apply   #43fc8c0000000000       -> 9.00000000000000E+383
-dece645 apply   9E+382                  -> #43fc1a0000000000 Clamped
-dece646 apply   #43fc1a0000000000       -> 9.0000000000000E+382
-dece647 apply   9E+381                  -> #43fc090000000000 Clamped
-dece648 apply   #43fc090000000000       -> 9.000000000000E+381
-dece649 apply   9E+380                  -> #43fc002300000000 Clamped
-dece650 apply   #43fc002300000000       -> 9.00000000000E+380
-dece651 apply   9E+379                  -> #43fc000680000000 Clamped
-dece652 apply   #43fc000680000000       -> 9.0000000000E+379
-dece653 apply   9E+378                  -> #43fc000240000000 Clamped
-dece654 apply   #43fc000240000000       -> 9.000000000E+378
-dece655 apply   9E+377                  -> #43fc000008c00000 Clamped
-dece656 apply   #43fc000008c00000       -> 9.00000000E+377
-dece657 apply   9E+376                  -> #43fc000001a00000 Clamped
-dece658 apply   #43fc000001a00000       -> 9.0000000E+376
-dece659 apply   9E+375                  -> #43fc000000900000 Clamped
-dece660 apply   #43fc000000900000       -> 9.000000E+375
-dece661 apply   9E+374                  -> #43fc000000023000 Clamped
-dece662 apply   #43fc000000023000       -> 9.00000E+374
-dece663 apply   9E+373                  -> #43fc000000006800 Clamped
-dece664 apply   #43fc000000006800       -> 9.0000E+373
-dece665 apply   9E+372                  -> #43fc000000002400 Clamped
-dece666 apply   #43fc000000002400       -> 9.000E+372
-dece667 apply   9E+371                  -> #43fc00000000008c Clamped
-dece668 apply   #43fc00000000008c       -> 9.00E+371
-dece669 apply   9E+370                  -> #43fc00000000001a Clamped
-dece670 apply   #43fc00000000001a       -> 9.0E+370
-dece671 apply   9E+369                  -> #43fc000000000009
-dece672 apply   #43fc000000000009       -> 9E+369
-dece673 apply   9E+368                  -> #43f8000000000009
-dece674 apply   #43f8000000000009       -> 9E+368
-
-
--- Selected DPD codes
-dece700 apply   #2238000000000000       -> 0
-dece701 apply   #2238000000000009       -> 9
-dece702 apply   #2238000000000010       -> 10
-dece703 apply   #2238000000000019       -> 19
-dece704 apply   #2238000000000020       -> 20
-dece705 apply   #2238000000000029       -> 29
-dece706 apply   #2238000000000030       -> 30
-dece707 apply   #2238000000000039       -> 39
-dece708 apply   #2238000000000040       -> 40
-dece709 apply   #2238000000000049       -> 49
-dece710 apply   #2238000000000050       -> 50
-dece711 apply   #2238000000000059       -> 59
-dece712 apply   #2238000000000060       -> 60
-dece713 apply   #2238000000000069       -> 69
-dece714 apply   #2238000000000070       -> 70
-dece715 apply   #2238000000000071       -> 71
-dece716 apply   #2238000000000072       -> 72
-dece717 apply   #2238000000000073       -> 73
-dece718 apply   #2238000000000074       -> 74
-dece719 apply   #2238000000000075       -> 75
-dece720 apply   #2238000000000076       -> 76
-dece721 apply   #2238000000000077       -> 77
-dece722 apply   #2238000000000078       -> 78
-dece723 apply   #2238000000000079       -> 79
-
-dece730 apply   #223800000000029e       -> 994
-dece731 apply   #223800000000029f       -> 995
-dece732 apply   #22380000000002a0       -> 520
-dece733 apply   #22380000000002a1       -> 521
-
--- DPD: one of each of the huffman groups
-dece740 apply   #22380000000003f7       -> 777
-dece741 apply   #22380000000003f8       -> 778
-dece742 apply   #22380000000003eb       -> 787
-dece743 apply   #223800000000037d       -> 877
-dece744 apply   #223800000000039f       -> 997
-dece745 apply   #22380000000003bf       -> 979
-dece746 apply   #22380000000003df       -> 799
-dece747 apply   #223800000000006e       -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-dece750 apply   #223800000000006e       -> 888
-dece751 apply   #223800000000016e       -> 888
-dece752 apply   #223800000000026e       -> 888
-dece753 apply   #223800000000036e       -> 888
-dece754 apply   #223800000000006f       -> 889
-dece755 apply   #223800000000016f       -> 889
-dece756 apply   #223800000000026f       -> 889
-dece757 apply   #223800000000036f       -> 889
-
-dece760 apply   #223800000000007e       -> 898
-dece761 apply   #223800000000017e       -> 898
-dece762 apply   #223800000000027e       -> 898
-dece763 apply   #223800000000037e       -> 898
-dece764 apply   #223800000000007f       -> 899
-dece765 apply   #223800000000017f       -> 899
-dece766 apply   #223800000000027f       -> 899
-dece767 apply   #223800000000037f       -> 899
-
-dece770 apply   #22380000000000ee       -> 988
-dece771 apply   #22380000000001ee       -> 988
-dece772 apply   #22380000000002ee       -> 988
-dece773 apply   #22380000000003ee       -> 988
-dece774 apply   #22380000000000ef       -> 989
-dece775 apply   #22380000000001ef       -> 989
-dece776 apply   #22380000000002ef       -> 989
-dece777 apply   #22380000000003ef       -> 989
-
-dece780 apply   #22380000000000fe       -> 998
-dece781 apply   #22380000000001fe       -> 998
-dece782 apply   #22380000000002fe       -> 998
-dece783 apply   #22380000000003fe       -> 998
-dece784 apply   #22380000000000ff       -> 999
-dece785 apply   #22380000000001ff       -> 999
-dece786 apply   #22380000000002ff       -> 999
-dece787 apply   #22380000000003ff       -> 999
-
index 437d82a2f2c31f94f7497b179fdc0f56725e3427..1cb82b4ff3fcd1cc236527e4a37bcb3f2dbd3fee 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- divide.decTest -- decimal division                                 --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -47,41 +47,45 @@ divx017 divide  2.400 2    ->  1.200
 divx018 divide  2.    2    ->  1
 divx019 divide  20    20   ->  1
 
-divx020 divide  187   187  ->  1
-divx021 divide  5     2    ->  2.5
-divx022 divide  5     2.0    ->  2.5
-divx023 divide  5     2.000  ->  2.5
-divx024 divide  5     0.20   ->  25
-divx025 divide  5     0.200  ->  25
-divx026 divide  10    1      ->  10
-divx027 divide  100   1      ->  100
-divx028 divide  1000  1      ->  1000
-divx029 divide  1000  100    ->  10
-
-divx030 divide  1     2      ->  0.5
-divx031 divide  1     4      ->  0.25
-divx032 divide  1     8      ->  0.125
-divx033 divide  1     16     ->  0.0625
-divx034 divide  1     32     ->  0.03125
-divx035 divide  1     64     ->  0.015625
-divx040 divide  1    -2      ->  -0.5
-divx041 divide  1    -4      ->  -0.25
-divx042 divide  1    -8      ->  -0.125
-divx043 divide  1    -16     ->  -0.0625
-divx044 divide  1    -32     ->  -0.03125
-divx045 divide  1    -64     ->  -0.015625
-divx050 divide -1     2      ->  -0.5
-divx051 divide -1     4      ->  -0.25
-divx052 divide -1     8      ->  -0.125
-divx053 divide -1     16     ->  -0.0625
-divx054 divide -1     32     ->  -0.03125
-divx055 divide -1     64     ->  -0.015625
-divx060 divide -1    -2      ->  0.5
-divx061 divide -1    -4      ->  0.25
-divx062 divide -1    -8      ->  0.125
-divx063 divide -1    -16     ->  0.0625
-divx064 divide -1    -32     ->  0.03125
-divx065 divide -1    -64     ->  0.015625
+divx020 divide  187   187    ->  1
+divx021 divide  5     2      ->  2.5
+divx022 divide  50    20     ->  2.5
+divx023 divide  500   200    ->  2.5
+divx024 divide  50.0  20.0   ->  2.5
+divx025 divide  5.00  2.00   ->  2.5
+divx026 divide  5     2.0    ->  2.5
+divx027 divide  5     2.000  ->  2.5
+divx028 divide  5     0.20   ->  25
+divx029 divide  5     0.200  ->  25
+divx030 divide  10    1      ->  10
+divx031 divide  100   1      ->  100
+divx032 divide  1000  1      ->  1000
+divx033 divide  1000  100    ->  10
+
+divx035 divide  1     2      ->  0.5
+divx036 divide  1     4      ->  0.25
+divx037 divide  1     8      ->  0.125
+divx038 divide  1     16     ->  0.0625
+divx039 divide  1     32     ->  0.03125
+divx040 divide  1     64     ->  0.015625
+divx041 divide  1    -2      ->  -0.5
+divx042 divide  1    -4      ->  -0.25
+divx043 divide  1    -8      ->  -0.125
+divx044 divide  1    -16     ->  -0.0625
+divx045 divide  1    -32     ->  -0.03125
+divx046 divide  1    -64     ->  -0.015625
+divx047 divide -1     2      ->  -0.5
+divx048 divide -1     4      ->  -0.25
+divx049 divide -1     8      ->  -0.125
+divx050 divide -1     16     ->  -0.0625
+divx051 divide -1     32     ->  -0.03125
+divx052 divide -1     64     ->  -0.015625
+divx053 divide -1    -2      ->  0.5
+divx054 divide -1    -4      ->  0.25
+divx055 divide -1    -8      ->  0.125
+divx056 divide -1    -16     ->  0.0625
+divx057 divide -1    -32     ->  0.03125
+divx058 divide -1    -64     ->  0.015625
 
 divx070 divide  999999999        1    ->  999999999
 divx071 divide  999999999.4      1    ->  999999999 Inexact Rounded
@@ -763,9 +767,9 @@ divx963 divide 1e-600000000 1e+400000004 -> 1E-1000000004 Subnormal
 divx964 divide 1e-600000000 1e+400000005 -> 1E-1000000005 Subnormal
 divx965 divide 1e-600000000 1e+400000006 -> 1E-1000000006 Subnormal
 divx966 divide 1e-600000000 1e+400000007 -> 1E-1000000007 Subnormal
-divx967 divide 1e-600000000 1e+400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-divx968 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-divx969 divide 1e-600000000 1e+400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
+divx967 divide 1e-600000000 1e+400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+divx968 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+divx969 divide 1e-600000000 1e+400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 -- [no equivalent of 'subnormal' for overflow]
 divx970 divide 1e+600000000 1e-400000001 -> Infinity Overflow Inexact Rounded
 divx971 divide 1e+600000000 1e-400000002 -> Infinity Overflow Inexact Rounded
@@ -779,10 +783,10 @@ divx978 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded
 divx979 divide 1e+600000000 1e-400000010 -> Infinity Overflow Inexact Rounded
 
 -- Sign after overflow and underflow
-divx980 divide  1e-600000000  1e+400000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
-divx981 divide  1e-600000000 -1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-divx982 divide -1e-600000000  1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-divx983 divide -1e-600000000 -1e+400000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
+divx980 divide  1e-600000000  1e+400000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+divx981 divide  1e-600000000 -1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+divx982 divide -1e-600000000  1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+divx983 divide -1e-600000000 -1e+400000009 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 divx984 divide  1e+600000000  1e-400000009 ->  Infinity Overflow Inexact Rounded
 divx985 divide  1e+600000000 -1e-400000009 -> -Infinity Overflow Inexact Rounded
 divx986 divide -1e+600000000  1e-400000009 -> -Infinity Overflow Inexact Rounded
@@ -812,6 +816,38 @@ minExponent: -6143
 --   1.465811965811965811965811965811965811966E+7000
 divx1010 divide 343E6000  234E-1000 -> Infinity Overflow Inexact Rounded
 
+precision:   34
+rounding:    half_up
+maxExponent: 6144
+minExponent: -6143
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 7
+divx1021  divide 1E0          1E0 -> 1
+divx1022  divide 1E0          2E0 -> 0.5
+divx1023  divide 1E0          3E0 -> 0.3333333 Inexact Rounded
+divx1024  divide 100E-2   1000E-3 -> 1
+divx1025  divide 24E-1        2E0 -> 1.2
+divx1026  divide 2400E-3      2E0 -> 1.200
+divx1027  divide 5E0          2E0 -> 2.5
+divx1028  divide 5E0        20E-1 -> 2.5
+divx1029  divide 5E0      2000E-3 -> 2.5
+divx1030  divide 5E0         2E-1 -> 25
+divx1031  divide 5E0        20E-2 -> 25
+divx1032  divide 480E-2       3E0 -> 1.60
+divx1033  divide 47E-1        2E0 -> 2.35
+
+-- ECMAScript bad examples
+rounding:    half_down
+precision: 7
+divx1050  divide 5 9  -> 0.5555556 Inexact Rounded
+rounding:    half_even
+divx1051  divide 5 11 -> 0.4545455 Inexact Rounded
+
+-- payload decapitate
+precision: 5
+divx1055  divide   sNaN987654321 1 ->  NaN54321  Invalid_operation
+
 -- Null tests
 divx9998 divide 10  # -> NaN Invalid_operation
 divx9999 divide  # 10 -> NaN Invalid_operation
index 7c31297b2f2276322dcbfd58bc324d9ae9572dcc..dfa17ca983d1590e1c367668748e500d3cfde65b 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- divideint.decTest -- decimal integer division                      --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -234,6 +234,22 @@ dvix286 divideint 0.1 999e-999999997     -> NaN Division_impossible
 dvix287 divideint 0.1 9999e-999999997    -> NaN Division_impossible
 dvix288 divideint 0.1 99999e-999999997   -> NaN Division_impossible
 
+-- GD edge cases: lhs smaller than rhs but more digits
+dvix301  divideint  0.9      2      ->  0
+dvix302  divideint  0.9      2.0    ->  0
+dvix303  divideint  0.9      2.1    ->  0
+dvix304  divideint  0.9      2.00   ->  0
+dvix305  divideint  0.9      2.01   ->  0
+dvix306  divideint  0.12     1      ->  0
+dvix307  divideint  0.12     1.0    ->  0
+dvix308  divideint  0.12     1.00   ->  0
+dvix309  divideint  0.12     1.0    ->  0
+dvix310  divideint  0.12     1.00   ->  0
+dvix311  divideint  0.12     2      ->  0
+dvix312  divideint  0.12     2.0    ->  0
+dvix313  divideint  0.12     2.1    ->  0
+dvix314  divideint  0.12     2.00   ->  0
+dvix315  divideint  0.12     2.01   ->  0
 
 -- overflow and underflow tests [from divide]
 maxexponent: 999999999
diff --git a/Lib/test/decimaltestdata/dqAbs.decTest b/Lib/test/decimaltestdata/dqAbs.decTest
new file mode 100644 (file)
index 0000000..01d1f30
--- /dev/null
@@ -0,0 +1,126 @@
+------------------------------------------------------------------------\r
+-- dqAbs.decTest -- decQuad absolute value, heeding sNaN              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqabs001 abs '1'      -> '1'\r
+dqabs002 abs '-1'     -> '1'\r
+dqabs003 abs '1.00'   -> '1.00'\r
+dqabs004 abs '-1.00'  -> '1.00'\r
+dqabs005 abs '0'      -> '0'\r
+dqabs006 abs '0.00'   -> '0.00'\r
+dqabs007 abs '00.0'   -> '0.0'\r
+dqabs008 abs '00.00'  -> '0.00'\r
+dqabs009 abs '00'     -> '0'\r
+\r
+dqabs010 abs '-2'     -> '2'\r
+dqabs011 abs '2'      -> '2'\r
+dqabs012 abs '-2.00'  -> '2.00'\r
+dqabs013 abs '2.00'   -> '2.00'\r
+dqabs014 abs '-0'     -> '0'\r
+dqabs015 abs '-0.00'  -> '0.00'\r
+dqabs016 abs '-00.0'  -> '0.0'\r
+dqabs017 abs '-00.00' -> '0.00'\r
+dqabs018 abs '-00'    -> '0'\r
+\r
+dqabs020 abs '-2000000' -> '2000000'\r
+dqabs021 abs '2000000'  -> '2000000'\r
+\r
+dqabs030 abs '+0.1'            -> '0.1'\r
+dqabs031 abs '-0.1'            -> '0.1'\r
+dqabs032 abs '+0.01'           -> '0.01'\r
+dqabs033 abs '-0.01'           -> '0.01'\r
+dqabs034 abs '+0.001'          -> '0.001'\r
+dqabs035 abs '-0.001'          -> '0.001'\r
+dqabs036 abs '+0.000001'       -> '0.000001'\r
+dqabs037 abs '-0.000001'       -> '0.000001'\r
+dqabs038 abs '+0.000000000001' -> '1E-12'\r
+dqabs039 abs '-0.000000000001' -> '1E-12'\r
+\r
+-- examples from decArith\r
+dqabs040 abs '2.1'     ->  '2.1'\r
+dqabs041 abs '-100'    ->  '100'\r
+dqabs042 abs '101.5'   ->  '101.5'\r
+dqabs043 abs '-101.5'  ->  '101.5'\r
+\r
+-- more fixed, potential LHS swaps/overlays if done by subtract 0\r
+dqabs060 abs '-56267E-10'  -> '0.0000056267'\r
+dqabs061 abs '-56267E-5'   -> '0.56267'\r
+dqabs062 abs '-56267E-2'   -> '562.67'\r
+dqabs063 abs '-56267E-1'   -> '5626.7'\r
+dqabs065 abs '-56267E-0'   -> '56267'\r
+\r
+-- subnormals and underflow\r
+\r
+-- long operand tests\r
+dqabs321 abs 1234567890123456  -> 1234567890123456\r
+dqabs322 abs 12345678000  -> 12345678000\r
+dqabs323 abs 1234567800   -> 1234567800\r
+dqabs324 abs 1234567890   -> 1234567890\r
+dqabs325 abs 1234567891   -> 1234567891\r
+dqabs326 abs 12345678901  -> 12345678901\r
+dqabs327 abs 1234567896   -> 1234567896\r
+\r
+-- zeros\r
+dqabs111 abs          0   -> 0\r
+dqabs112 abs         -0   -> 0\r
+dqabs113 abs       0E+6   -> 0E+6\r
+dqabs114 abs      -0E+6   -> 0E+6\r
+dqabs115 abs     0.0000   -> 0.0000\r
+dqabs116 abs    -0.0000   -> 0.0000\r
+dqabs117 abs      0E-141  -> 0E-141\r
+dqabs118 abs     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqabs121 abs   2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqabs122 abs  -2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqabs123 abs   1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+dqabs124 abs  -1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqabs131 abs  9.999999999999999999999999999999999E+6144   ->  9.999999999999999999999999999999999E+6144\r
+dqabs132 abs  1E-6143                                     ->  1E-6143\r
+dqabs133 abs  1.000000000000000000000000000000000E-6143   ->  1.000000000000000000000000000000000E-6143\r
+dqabs134 abs  1E-6176                                     ->  1E-6176 Subnormal\r
+\r
+dqabs135 abs  -1E-6176                                    ->  1E-6176 Subnormal\r
+dqabs136 abs  -1.000000000000000000000000000000000E-6143  ->  1.000000000000000000000000000000000E-6143\r
+dqabs137 abs  -1E-6143                                    ->  1E-6143\r
+dqabs138 abs  -9.999999999999999999999999999999999E+6144  ->  9.999999999999999999999999999999999E+6144\r
+\r
+-- specials\r
+dqabs520 abs 'Inf'    -> 'Infinity'\r
+dqabs521 abs '-Inf'   -> 'Infinity'\r
+dqabs522 abs   NaN    ->  NaN\r
+dqabs523 abs  sNaN    ->  NaN   Invalid_operation\r
+dqabs524 abs   NaN22  ->  NaN22\r
+dqabs525 abs  sNaN33  ->  NaN33 Invalid_operation\r
+dqabs526 abs  -NaN22  -> -NaN22\r
+dqabs527 abs -sNaN33  -> -NaN33 Invalid_operation\r
+\r
+-- Null tests\r
+dqabs900 abs  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqAdd.decTest b/Lib/test/decimaltestdata/dqAdd.decTest
new file mode 100644 (file)
index 0000000..72238d3
--- /dev/null
@@ -0,0 +1,1157 @@
+------------------------------------------------------------------------\r
+-- dqAdd.decTest -- decQuad addition                                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decQuads only; all arguments are\r
+-- representable in a decQuad\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- [first group are 'quick confidence check']\r
+dqadd001 add 1       1       ->  2\r
+dqadd002 add 2       3       ->  5\r
+dqadd003 add '5.75'  '3.3'   ->  9.05\r
+dqadd004 add '5'     '-3'    ->  2\r
+dqadd005 add '-5'    '-3'    ->  -8\r
+dqadd006 add '-7'    '2.5'   ->  -4.5\r
+dqadd007 add '0.7'   '0.3'   ->  1.0\r
+dqadd008 add '1.25'  '1.25'  ->  2.50\r
+dqadd009 add '1.23456789'  '1.00000000' -> '2.23456789'\r
+dqadd010 add '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+--             1234567890123456      1234567890123456\r
+dqadd011 add '0.4444444444444444444444444444444446'  '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqadd012 add '0.4444444444444444444444444444444445'  '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded\r
+dqadd013 add '0.4444444444444444444444444444444444'  '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'\r
+dqadd014 add   '4444444444444444444444444444444444' '0.49'   -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd015 add   '4444444444444444444444444444444444' '0.499'  -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd016 add   '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd017 add   '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd018 add   '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded\r
+dqadd019 add   '4444444444444444444444444444444444' '0.501'  -> '4444444444444444444444444444444445' Inexact Rounded\r
+dqadd020 add   '4444444444444444444444444444444444' '0.51'   -> '4444444444444444444444444444444445' Inexact Rounded\r
+\r
+dqadd021 add 0 1 -> 1\r
+dqadd022 add 1 1 -> 2\r
+dqadd023 add 2 1 -> 3\r
+dqadd024 add 3 1 -> 4\r
+dqadd025 add 4 1 -> 5\r
+dqadd026 add 5 1 -> 6\r
+dqadd027 add 6 1 -> 7\r
+dqadd028 add 7 1 -> 8\r
+dqadd029 add 8 1 -> 9\r
+dqadd030 add 9 1 -> 10\r
+\r
+-- some carrying effects\r
+dqadd031 add '0.9998'  '0.0000' -> '0.9998'\r
+dqadd032 add '0.9998'  '0.0001' -> '0.9999'\r
+dqadd033 add '0.9998'  '0.0002' -> '1.0000'\r
+dqadd034 add '0.9998'  '0.0003' -> '1.0001'\r
+\r
+dqadd035 add '70'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd036 add '700'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd037 add '7000'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd038 add '70000'  '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded\r
+dqadd039 add '700000'  '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded\r
+\r
+-- symmetry:\r
+dqadd040 add '10000e+34'  '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd041 add '10000e+34'  '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd042 add '10000e+34'  '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd044 add '10000e+34'  '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded\r
+dqadd045 add '10000e+34'  '700000' -> '1.000000000000000000000000000000007E+38' Rounded\r
+\r
+-- same, without rounding\r
+dqadd046 add '10000e+9'  '7' -> '10000000000007'\r
+dqadd047 add '10000e+9'  '70' -> '10000000000070'\r
+dqadd048 add '10000e+9'  '700' -> '10000000000700'\r
+dqadd049 add '10000e+9'  '7000' -> '10000000007000'\r
+dqadd050 add '10000e+9'  '70000' -> '10000000070000'\r
+dqadd051 add '10000e+9'  '700000' -> '10000000700000'\r
+dqadd052 add '10000e+9'  '7000000' -> '10000007000000'\r
+\r
+-- examples from decarith\r
+dqadd053 add '12' '7.00' -> '19.00'\r
+dqadd054 add '1.3' '-1.07' -> '0.23'\r
+dqadd055 add '1.3' '-1.30' -> '0.00'\r
+dqadd056 add '1.3' '-2.07' -> '-0.77'\r
+dqadd057 add '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- leading zero preservation\r
+dqadd061 add 1 '0.0001' -> '1.0001'\r
+dqadd062 add 1 '0.00001' -> '1.00001'\r
+dqadd063 add 1 '0.000001' -> '1.000001'\r
+dqadd064 add 1 '0.0000001' -> '1.0000001'\r
+dqadd065 add 1 '0.00000001' -> '1.00000001'\r
+\r
+-- some funny zeros [in case of bad signum]\r
+dqadd070 add 1  0    -> 1\r
+dqadd071 add 1 0.    -> 1\r
+dqadd072 add 1  .0   -> 1.0\r
+dqadd073 add 1 0.0   -> 1.0\r
+dqadd074 add 1 0.00  -> 1.00\r
+dqadd075 add  0  1   -> 1\r
+dqadd076 add 0.  1   -> 1\r
+dqadd077 add  .0 1   -> 1.0\r
+dqadd078 add 0.0 1   -> 1.0\r
+dqadd079 add 0.00 1  -> 1.00\r
+\r
+-- some carries\r
+dqadd080 add 999999998 1  -> 999999999\r
+dqadd081 add 999999999 1  -> 1000000000\r
+dqadd082 add  99999999 1  -> 100000000\r
+dqadd083 add   9999999 1  -> 10000000\r
+dqadd084 add    999999 1  -> 1000000\r
+dqadd085 add     99999 1  -> 100000\r
+dqadd086 add      9999 1  -> 10000\r
+dqadd087 add       999 1  -> 1000\r
+dqadd088 add        99 1  -> 100\r
+dqadd089 add         9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+dqadd090 add '-56267E-10'   0 ->  '-0.0000056267'\r
+dqadd091 add '-56267E-6'    0 ->  '-0.056267'\r
+dqadd092 add '-56267E-5'    0 ->  '-0.56267'\r
+dqadd093 add '-56267E-4'    0 ->  '-5.6267'\r
+dqadd094 add '-56267E-3'    0 ->  '-56.267'\r
+dqadd095 add '-56267E-2'    0 ->  '-562.67'\r
+dqadd096 add '-56267E-1'    0 ->  '-5626.7'\r
+dqadd097 add '-56267E-0'    0 ->  '-56267'\r
+dqadd098 add '-5E-10'       0 ->  '-5E-10'\r
+dqadd099 add '-5E-7'        0 ->  '-5E-7'\r
+dqadd100 add '-5E-6'        0 ->  '-0.000005'\r
+dqadd101 add '-5E-5'        0 ->  '-0.00005'\r
+dqadd102 add '-5E-4'        0 ->  '-0.0005'\r
+dqadd103 add '-5E-1'        0 ->  '-0.5'\r
+dqadd104 add '-5E0'         0 ->  '-5'\r
+dqadd105 add '-5E1'         0 ->  '-50'\r
+dqadd106 add '-5E5'         0 ->  '-500000'\r
+dqadd107 add '-5E33'        0 ->  '-5000000000000000000000000000000000'\r
+dqadd108 add '-5E34'        0 ->  '-5.000000000000000000000000000000000E+34'  Rounded\r
+dqadd109 add '-5E35'        0 ->  '-5.000000000000000000000000000000000E+35'  Rounded\r
+dqadd110 add '-5E36'        0 ->  '-5.000000000000000000000000000000000E+36'  Rounded\r
+dqadd111 add '-5E100'       0 ->  '-5.000000000000000000000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+dqadd113 add 0  '-56267E-10' ->  '-0.0000056267'\r
+dqadd114 add 0  '-56267E-6'  ->  '-0.056267'\r
+dqadd116 add 0  '-56267E-5'  ->  '-0.56267'\r
+dqadd117 add 0  '-56267E-4'  ->  '-5.6267'\r
+dqadd119 add 0  '-56267E-3'  ->  '-56.267'\r
+dqadd120 add 0  '-56267E-2'  ->  '-562.67'\r
+dqadd121 add 0  '-56267E-1'  ->  '-5626.7'\r
+dqadd122 add 0  '-56267E-0'  ->  '-56267'\r
+dqadd123 add 0  '-5E-10'     ->  '-5E-10'\r
+dqadd124 add 0  '-5E-7'      ->  '-5E-7'\r
+dqadd125 add 0  '-5E-6'      ->  '-0.000005'\r
+dqadd126 add 0  '-5E-5'      ->  '-0.00005'\r
+dqadd127 add 0  '-5E-4'      ->  '-0.0005'\r
+dqadd128 add 0  '-5E-1'      ->  '-0.5'\r
+dqadd129 add 0  '-5E0'       ->  '-5'\r
+dqadd130 add 0  '-5E1'       ->  '-50'\r
+dqadd131 add 0  '-5E5'       ->  '-500000'\r
+dqadd132 add 0  '-5E33'      ->  '-5000000000000000000000000000000000'\r
+dqadd133 add 0  '-5E34'      ->  '-5.000000000000000000000000000000000E+34'   Rounded\r
+dqadd134 add 0  '-5E35'      ->  '-5.000000000000000000000000000000000E+35'   Rounded\r
+dqadd135 add 0  '-5E36'      ->  '-5.000000000000000000000000000000000E+36'   Rounded\r
+dqadd136 add 0  '-5E100'     ->  '-5.000000000000000000000000000000000E+100'  Rounded\r
+\r
+-- related\r
+dqadd137 add  1  '0E-39'      ->  '1.000000000000000000000000000000000'  Rounded\r
+dqadd138 add -1  '0E-39'      ->  '-1.000000000000000000000000000000000' Rounded\r
+dqadd139 add '0E-39' 1        ->  '1.000000000000000000000000000000000'  Rounded\r
+dqadd140 add '0E-39' -1       ->  '-1.000000000000000000000000000000000' Rounded\r
+dqadd141 add 1E+29   0.0000   ->  '100000000000000000000000000000.0000'\r
+dqadd142 add 1E+29   0.00000  ->  '100000000000000000000000000000.0000'  Rounded\r
+dqadd143 add 0.000   1E+30    ->  '1000000000000000000000000000000.000'\r
+dqadd144 add 0.0000  1E+30    ->  '1000000000000000000000000000000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+dqadd146 add '00.0'  0       ->  '0.0'\r
+dqadd147 add '0.00'  0       ->  '0.00'\r
+dqadd148 add  0      '0.00'  ->  '0.00'\r
+dqadd149 add  0      '00.0'  ->  '0.0'\r
+dqadd150 add '00.0'  '0.00'  ->  '0.00'\r
+dqadd151 add '0.00'  '00.0'  ->  '0.00'\r
+dqadd152 add '3'     '.3'    ->  '3.3'\r
+dqadd153 add '3.'    '.3'    ->  '3.3'\r
+dqadd154 add '3.0'   '.3'    ->  '3.3'\r
+dqadd155 add '3.00'  '.3'    ->  '3.30'\r
+dqadd156 add '3'     '3'     ->  '6'\r
+dqadd157 add '3'     '+3'    ->  '6'\r
+dqadd158 add '3'     '-3'    ->  '0'\r
+dqadd159 add '0.3'   '-0.3'  ->  '0.0'\r
+dqadd160 add '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+dqadd161 add '1E+12' '-1'    -> '999999999999'\r
+dqadd162 add '1E+12'  '1.11' -> '1000000000001.11'\r
+dqadd163 add '1.11'  '1E+12' -> '1000000000001.11'\r
+dqadd164 add '-1'    '1E+12' -> '999999999999'\r
+dqadd165 add '7E+12' '-1'    -> '6999999999999'\r
+dqadd166 add '7E+12'  '1.11' -> '7000000000001.11'\r
+dqadd167 add '1.11'  '7E+12' -> '7000000000001.11'\r
+dqadd168 add '-1'    '7E+12' -> '6999999999999'\r
+\r
+rounding: half_up\r
+dqadd170 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd171 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd172 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd173 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded\r
+dqadd174 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd175 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd176 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd177 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded\r
+dqadd178 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd179 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd180 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd181 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd182 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd183 add '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+dqadd200 add '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd201 add '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd202 add '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd203 add '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd204 add '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd205 add '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd206 add '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd207 add '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd208 add '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd209 add '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd210 add '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd211 add '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd212 add '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd213 add '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd214 add '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd215 add '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd216 add '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd217 add '1231234567890123456784560123456789' 1.000000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd218 add '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd219 add '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqadd220 add '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd221 add '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd222 add '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd223 add '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd224 add '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd225 add '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd226 add '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd227 add '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd228 add '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd229 add '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd230 add '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd231 add '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd232 add '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd233 add '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd234 add '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd235 add '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd236 add '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd237 add '1231234567890123456784560123456789' 1.00000001    -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd238 add '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd239 add '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+dqadd240 add '1231234567890123456784560123456788' 0.499999999   -> '1231234567890123456784560123456788' Inexact Rounded\r
+dqadd241 add '1231234567890123456784560123456788' 0.5           -> '1231234567890123456784560123456788' Inexact Rounded\r
+dqadd242 add '1231234567890123456784560123456788' 0.500000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+\r
+rounding: down\r
+dqadd250 add '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd251 add '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd252 add '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd253 add '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd254 add '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd255 add '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd256 add '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd257 add '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd258 add '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd259 add '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd260 add '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd261 add '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd262 add '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd263 add '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd264 add '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd265 add '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd266 add '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd267 add '1231234567890123456784560123456789' 1.00000001    -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd268 add '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd269 add '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_up\r
+dqadd301 add  -1   1      ->   0\r
+dqadd302 add   0   1      ->   1\r
+dqadd303 add   1   1      ->   2\r
+dqadd304 add  12   1      ->  13\r
+dqadd305 add  98   1      ->  99\r
+dqadd306 add  99   1      -> 100\r
+dqadd307 add 100   1      -> 101\r
+dqadd308 add 101   1      -> 102\r
+dqadd309 add  -1  -1      ->  -2\r
+dqadd310 add   0  -1      ->  -1\r
+dqadd311 add   1  -1      ->   0\r
+dqadd312 add  12  -1      ->  11\r
+dqadd313 add  98  -1      ->  97\r
+dqadd314 add  99  -1      ->  98\r
+dqadd315 add 100  -1      ->  99\r
+dqadd316 add 101  -1      -> 100\r
+\r
+dqadd321 add -0.01  0.01    ->  0.00\r
+dqadd322 add  0.00  0.01    ->  0.01\r
+dqadd323 add  0.01  0.01    ->  0.02\r
+dqadd324 add  0.12  0.01    ->  0.13\r
+dqadd325 add  0.98  0.01    ->  0.99\r
+dqadd326 add  0.99  0.01    ->  1.00\r
+dqadd327 add  1.00  0.01    ->  1.01\r
+dqadd328 add  1.01  0.01    ->  1.02\r
+dqadd329 add -0.01 -0.01    -> -0.02\r
+dqadd330 add  0.00 -0.01    -> -0.01\r
+dqadd331 add  0.01 -0.01    ->  0.00\r
+dqadd332 add  0.12 -0.01    ->  0.11\r
+dqadd333 add  0.98 -0.01    ->  0.97\r
+dqadd334 add  0.99 -0.01    ->  0.98\r
+dqadd335 add  1.00 -0.01    ->  0.99\r
+dqadd336 add  1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where adding 0 affects the coefficient\r
+dqadd340 add 1E+3    0    ->         1000\r
+dqadd341 add 1E+33   0    ->    1000000000000000000000000000000000\r
+dqadd342 add 1E+34   0    ->   1.000000000000000000000000000000000E+34  Rounded\r
+dqadd343 add 1E+35   0    ->   1.000000000000000000000000000000000E+35  Rounded\r
+-- which simply follow from these cases ...\r
+dqadd344 add 1E+3    1    ->         1001\r
+dqadd345 add 1E+33   1    ->    1000000000000000000000000000000001\r
+dqadd346 add 1E+34   1    ->   1.000000000000000000000000000000000E+34  Inexact Rounded\r
+dqadd347 add 1E+35   1    ->   1.000000000000000000000000000000000E+35  Inexact Rounded\r
+dqadd348 add 1E+3    7    ->         1007\r
+dqadd349 add 1E+33   7    ->    1000000000000000000000000000000007\r
+dqadd350 add 1E+34   7    ->   1.000000000000000000000000000000001E+34  Inexact Rounded\r
+dqadd351 add 1E+35   7    ->   1.000000000000000000000000000000000E+35  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+dqadd360  add 0E+50 10000E+1  -> 1.0000E+5\r
+dqadd361  add 0E-50 10000E+1  -> 100000.0000000000000000000000000000 Rounded\r
+dqadd362  add 10000E+1 0E-50  -> 100000.0000000000000000000000000000 Rounded\r
+dqadd363  add 10000E+1 10000E-50  -> 100000.0000000000000000000000000000 Rounded Inexact\r
+dqadd364  add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111\r
+--            1 234567890123456789012345678901234\r
+\r
+-- a curiosity from JSR 13 testing\r
+rounding:    half_down\r
+dqadd370 add  999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+rounding:    half_up\r
+dqadd372 add  999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+rounding:    half_even\r
+dqadd374 add  999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+\r
+-- ulp replacement tests\r
+dqadd400 add   1   77e-32      ->  1.00000000000000000000000000000077\r
+dqadd401 add   1   77e-33      ->  1.000000000000000000000000000000077\r
+dqadd402 add   1   77e-34      ->  1.000000000000000000000000000000008 Inexact Rounded\r
+dqadd403 add   1   77e-35      ->  1.000000000000000000000000000000001 Inexact Rounded\r
+dqadd404 add   1   77e-36      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd405 add   1   77e-37      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd406 add   1   77e-299     ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd410 add  10   77e-32      ->  10.00000000000000000000000000000077\r
+dqadd411 add  10   77e-33      ->  10.00000000000000000000000000000008 Inexact Rounded\r
+dqadd412 add  10   77e-34      ->  10.00000000000000000000000000000001 Inexact Rounded\r
+dqadd413 add  10   77e-35      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd414 add  10   77e-36      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd415 add  10   77e-37      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd416 add  10   77e-299     ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd420 add  77e-32       1   ->  1.00000000000000000000000000000077\r
+dqadd421 add  77e-33       1   ->  1.000000000000000000000000000000077\r
+dqadd422 add  77e-34       1   ->  1.000000000000000000000000000000008 Inexact Rounded\r
+dqadd423 add  77e-35       1   ->  1.000000000000000000000000000000001 Inexact Rounded\r
+dqadd424 add  77e-36       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd425 add  77e-37       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd426 add  77e-299      1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd430 add  77e-32      10   ->  10.00000000000000000000000000000077\r
+dqadd431 add  77e-33      10   ->  10.00000000000000000000000000000008 Inexact Rounded\r
+dqadd432 add  77e-34      10   ->  10.00000000000000000000000000000001 Inexact Rounded\r
+dqadd433 add  77e-35      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd434 add  77e-36      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd435 add  77e-37      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd436 add  77e-299     10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+dqadd6440 add   1   -77e-32      ->  0.99999999999999999999999999999923\r
+dqadd6441 add   1   -77e-33      ->  0.999999999999999999999999999999923\r
+dqadd6442 add   1   -77e-34      ->  0.9999999999999999999999999999999923\r
+dqadd6443 add   1   -77e-35      ->  0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd6444 add   1   -77e-36      ->  0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd6445 add   1   -77e-37      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd6446 add   1   -77e-99      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6450 add  10   -77e-32      ->   9.99999999999999999999999999999923\r
+dqadd6451 add  10   -77e-33      ->   9.999999999999999999999999999999923\r
+dqadd6452 add  10   -77e-34      ->   9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd6453 add  10   -77e-35      ->   9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd6454 add  10   -77e-36      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6455 add  10   -77e-37      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6456 add  10   -77e-99      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6460 add  -77e-32       1   ->  0.99999999999999999999999999999923\r
+dqadd6461 add  -77e-33       1   ->  0.999999999999999999999999999999923\r
+dqadd6462 add  -77e-34       1   ->  0.9999999999999999999999999999999923\r
+dqadd6463 add  -77e-35       1   ->  0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd6464 add  -77e-36       1   ->  0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd6465 add  -77e-37       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd6466 add  -77e-99       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6470 add  -77e-32      10   ->   9.99999999999999999999999999999923\r
+dqadd6471 add  -77e-33      10   ->   9.999999999999999999999999999999923\r
+dqadd6472 add  -77e-34      10   ->   9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd6473 add  -77e-35      10   ->   9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd6474 add  -77e-36      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6475 add  -77e-37      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6476 add  -77e-99      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+dqadd6480 add  -1    77e-32      ->  -0.99999999999999999999999999999923\r
+dqadd6481 add  -1    77e-33      ->  -0.999999999999999999999999999999923\r
+dqadd6482 add  -1    77e-34      ->  -0.9999999999999999999999999999999923\r
+dqadd6483 add  -1    77e-35      ->  -0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd6484 add  -1    77e-36      ->  -0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd6485 add  -1    77e-37      ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd6486 add  -1    77e-99      ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6490 add -10    77e-32      ->   -9.99999999999999999999999999999923\r
+dqadd6491 add -10    77e-33      ->   -9.999999999999999999999999999999923\r
+dqadd6492 add -10    77e-34      ->   -9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd6493 add -10    77e-35      ->   -9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd6494 add -10    77e-36      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6495 add -10    77e-37      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6496 add -10    77e-99      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6500 add   77e-32      -1   ->  -0.99999999999999999999999999999923\r
+dqadd6501 add   77e-33      -1   ->  -0.999999999999999999999999999999923\r
+dqadd6502 add   77e-34      -1   ->  -0.9999999999999999999999999999999923\r
+dqadd6503 add   77e-35      -1   ->  -0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd6504 add   77e-36      -1   ->  -0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd6505 add   77e-37      -1   ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd6506 add   77e-99      -1   ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd6510 add   77e-32      -10  ->   -9.99999999999999999999999999999923\r
+dqadd6511 add   77e-33      -10  ->   -9.999999999999999999999999999999923\r
+dqadd6512 add   77e-34      -10  ->   -9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd6513 add   77e-35      -10  ->   -9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd6514 add   77e-36      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6515 add   77e-37      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd6516 add   77e-99      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- and some more residue effects and different roundings\r
+rounding: half_up\r
+dqadd6540 add '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd6541 add '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6542 add '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6543 add '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6544 add '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6545 add '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6546 add '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6547 add '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6548 add '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6549 add '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6550 add '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6551 add '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6552 add '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6553 add '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6554 add '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6555 add '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6556 add '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd6557 add '9876543219876543216543210123456789' 1.000000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6558 add '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6559 add '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqadd6560 add '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd6561 add '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6562 add '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6563 add '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6564 add '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6565 add '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6566 add '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6567 add '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd6568 add '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6569 add '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6570 add '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6571 add '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6572 add '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6573 add '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6574 add '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6575 add '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6576 add '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd6577 add '9876543219876543216543210123456789' 1.00000001    -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6578 add '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd6579 add '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+-- critical few with even bottom digit...\r
+dqadd7540 add '9876543219876543216543210123456788' 0.499999999   -> '9876543219876543216543210123456788' Inexact Rounded\r
+dqadd7541 add '9876543219876543216543210123456788' 0.5           -> '9876543219876543216543210123456788' Inexact Rounded\r
+dqadd7542 add '9876543219876543216543210123456788' 0.500000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+\r
+rounding: down\r
+dqadd7550 add '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd7551 add '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7552 add '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7553 add '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7554 add '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7555 add '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7556 add '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7557 add '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7558 add '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7559 add '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7560 add '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7561 add '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7562 add '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7563 add '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7564 add '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7565 add '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd7566 add '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd7567 add '9876543219876543216543210123456789' 1.00000001    -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd7568 add '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd7569 add '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_even\r
+\r
+dqadd7701 add 5.00 1.00E-3 -> 5.00100\r
+dqadd7702 add 00.00 0.000  -> 0.000\r
+dqadd7703 add 00.00 0E-3   -> 0.000\r
+dqadd7704 add 0E-3  00.00  -> 0.000\r
+\r
+dqadd7710 add 0E+3  00.00  -> 0.00\r
+dqadd7711 add 0E+3  00.0   -> 0.0\r
+dqadd7712 add 0E+3  00.    -> 0\r
+dqadd7713 add 0E+3  00.E+1 -> 0E+1\r
+dqadd7714 add 0E+3  00.E+2 -> 0E+2\r
+dqadd7715 add 0E+3  00.E+3 -> 0E+3\r
+dqadd7716 add 0E+3  00.E+4 -> 0E+3\r
+dqadd7717 add 0E+3  00.E+5 -> 0E+3\r
+dqadd7718 add 0E+3  -00.0   -> 0.0\r
+dqadd7719 add 0E+3  -00.    -> 0\r
+dqadd7731 add 0E+3  -00.E+1 -> 0E+1\r
+\r
+dqadd7720 add 00.00  0E+3  -> 0.00\r
+dqadd7721 add 00.0   0E+3  -> 0.0\r
+dqadd7722 add 00.    0E+3  -> 0\r
+dqadd7723 add 00.E+1 0E+3  -> 0E+1\r
+dqadd7724 add 00.E+2 0E+3  -> 0E+2\r
+dqadd7725 add 00.E+3 0E+3  -> 0E+3\r
+dqadd7726 add 00.E+4 0E+3  -> 0E+3\r
+dqadd7727 add 00.E+5 0E+3  -> 0E+3\r
+dqadd7728 add -00.00 0E+3  -> 0.00\r
+dqadd7729 add -00.0  0E+3  -> 0.0\r
+dqadd7730 add -00.   0E+3  -> 0\r
+\r
+dqadd7732 add  0     0     ->  0\r
+dqadd7733 add  0    -0     ->  0\r
+dqadd7734 add -0     0     ->  0\r
+dqadd7735 add -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+dqadd7736 add  1    -1     ->  0\r
+dqadd7737 add -1    -1     -> -2\r
+dqadd7738 add  1     1     ->  2\r
+dqadd7739 add -1     1     ->  0\r
+\r
+dqadd7741 add  0    -1     -> -1\r
+dqadd7742 add -0    -1     -> -1\r
+dqadd7743 add  0     1     ->  1\r
+dqadd7744 add -0     1     ->  1\r
+dqadd7745 add -1     0     -> -1\r
+dqadd7746 add -1    -0     -> -1\r
+dqadd7747 add  1     0     ->  1\r
+dqadd7748 add  1    -0     ->  1\r
+\r
+dqadd7751 add  0.0  -1     -> -1.0\r
+dqadd7752 add -0.0  -1     -> -1.0\r
+dqadd7753 add  0.0   1     ->  1.0\r
+dqadd7754 add -0.0   1     ->  1.0\r
+dqadd7755 add -1.0   0     -> -1.0\r
+dqadd7756 add -1.0  -0     -> -1.0\r
+dqadd7757 add  1.0   0     ->  1.0\r
+dqadd7758 add  1.0  -0     ->  1.0\r
+\r
+dqadd7761 add  0    -1.0   -> -1.0\r
+dqadd7762 add -0    -1.0   -> -1.0\r
+dqadd7763 add  0     1.0   ->  1.0\r
+dqadd7764 add -0     1.0   ->  1.0\r
+dqadd7765 add -1     0.0   -> -1.0\r
+dqadd7766 add -1    -0.0   -> -1.0\r
+dqadd7767 add  1     0.0   ->  1.0\r
+dqadd7768 add  1    -0.0   ->  1.0\r
+\r
+dqadd7771 add  0.0  -1.0   -> -1.0\r
+dqadd7772 add -0.0  -1.0   -> -1.0\r
+dqadd7773 add  0.0   1.0   ->  1.0\r
+dqadd7774 add -0.0   1.0   ->  1.0\r
+dqadd7775 add -1.0   0.0   -> -1.0\r
+dqadd7776 add -1.0  -0.0   -> -1.0\r
+dqadd7777 add  1.0   0.0   ->  1.0\r
+dqadd7778 add  1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+dqadd7780 add -Inf  -Inf   -> -Infinity\r
+dqadd7781 add -Inf  -1000  -> -Infinity\r
+dqadd7782 add -Inf  -1     -> -Infinity\r
+dqadd7783 add -Inf  -0     -> -Infinity\r
+dqadd7784 add -Inf   0     -> -Infinity\r
+dqadd7785 add -Inf   1     -> -Infinity\r
+dqadd7786 add -Inf   1000  -> -Infinity\r
+dqadd7787 add -1000 -Inf   -> -Infinity\r
+dqadd7788 add -Inf  -Inf   -> -Infinity\r
+dqadd7789 add -1    -Inf   -> -Infinity\r
+dqadd7790 add -0    -Inf   -> -Infinity\r
+dqadd7791 add  0    -Inf   -> -Infinity\r
+dqadd7792 add  1    -Inf   -> -Infinity\r
+dqadd7793 add  1000 -Inf   -> -Infinity\r
+dqadd7794 add  Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+dqadd7800 add  Inf  -Inf   ->  NaN  Invalid_operation\r
+dqadd7801 add  Inf  -1000  ->  Infinity\r
+dqadd7802 add  Inf  -1     ->  Infinity\r
+dqadd7803 add  Inf  -0     ->  Infinity\r
+dqadd7804 add  Inf   0     ->  Infinity\r
+dqadd7805 add  Inf   1     ->  Infinity\r
+dqadd7806 add  Inf   1000  ->  Infinity\r
+dqadd7807 add  Inf   Inf   ->  Infinity\r
+dqadd7808 add -1000  Inf   ->  Infinity\r
+dqadd7809 add -Inf   Inf   ->  NaN  Invalid_operation\r
+dqadd7810 add -1     Inf   ->  Infinity\r
+dqadd7811 add -0     Inf   ->  Infinity\r
+dqadd7812 add  0     Inf   ->  Infinity\r
+dqadd7813 add  1     Inf   ->  Infinity\r
+dqadd7814 add  1000  Inf   ->  Infinity\r
+dqadd7815 add  Inf   Inf   ->  Infinity\r
+\r
+dqadd7821 add  NaN -Inf    ->  NaN\r
+dqadd7822 add  NaN -1000   ->  NaN\r
+dqadd7823 add  NaN -1      ->  NaN\r
+dqadd7824 add  NaN -0      ->  NaN\r
+dqadd7825 add  NaN  0      ->  NaN\r
+dqadd7826 add  NaN  1      ->  NaN\r
+dqadd7827 add  NaN  1000   ->  NaN\r
+dqadd7828 add  NaN  Inf    ->  NaN\r
+dqadd7829 add  NaN  NaN    ->  NaN\r
+dqadd7830 add -Inf  NaN    ->  NaN\r
+dqadd7831 add -1000 NaN    ->  NaN\r
+dqadd7832 add -1    NaN    ->  NaN\r
+dqadd7833 add -0    NaN    ->  NaN\r
+dqadd7834 add  0    NaN    ->  NaN\r
+dqadd7835 add  1    NaN    ->  NaN\r
+dqadd7836 add  1000 NaN    ->  NaN\r
+dqadd7837 add  Inf  NaN    ->  NaN\r
+\r
+dqadd7841 add  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqadd7842 add  sNaN -1000  ->  NaN  Invalid_operation\r
+dqadd7843 add  sNaN -1     ->  NaN  Invalid_operation\r
+dqadd7844 add  sNaN -0     ->  NaN  Invalid_operation\r
+dqadd7845 add  sNaN  0     ->  NaN  Invalid_operation\r
+dqadd7846 add  sNaN  1     ->  NaN  Invalid_operation\r
+dqadd7847 add  sNaN  1000  ->  NaN  Invalid_operation\r
+dqadd7848 add  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqadd7849 add  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqadd7850 add  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqadd7851 add -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqadd7852 add -1000 sNaN   ->  NaN  Invalid_operation\r
+dqadd7853 add -1    sNaN   ->  NaN  Invalid_operation\r
+dqadd7854 add -0    sNaN   ->  NaN  Invalid_operation\r
+dqadd7855 add  0    sNaN   ->  NaN  Invalid_operation\r
+dqadd7856 add  1    sNaN   ->  NaN  Invalid_operation\r
+dqadd7857 add  1000 sNaN   ->  NaN  Invalid_operation\r
+dqadd7858 add  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqadd7859 add  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqadd7861 add  NaN1   -Inf    ->  NaN1\r
+dqadd7862 add +NaN2   -1000   ->  NaN2\r
+dqadd7863 add  NaN3    1000   ->  NaN3\r
+dqadd7864 add  NaN4    Inf    ->  NaN4\r
+dqadd7865 add  NaN5   +NaN6   ->  NaN5\r
+dqadd7866 add -Inf     NaN7   ->  NaN7\r
+dqadd7867 add -1000    NaN8   ->  NaN8\r
+dqadd7868 add  1000    NaN9   ->  NaN9\r
+dqadd7869 add  Inf    +NaN10  ->  NaN10\r
+dqadd7871 add  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+dqadd7872 add  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+dqadd7873 add  sNaN13   1000  ->  NaN13  Invalid_operation\r
+dqadd7874 add  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+dqadd7875 add  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+dqadd7876 add  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+dqadd7877 add -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+dqadd7878 add -1000    sNaN21 ->  NaN21  Invalid_operation\r
+dqadd7879 add  1000    sNaN22 ->  NaN22  Invalid_operation\r
+dqadd7880 add  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+dqadd7881 add +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+dqadd7882 add -NaN26    NaN28 -> -NaN26\r
+dqadd7883 add -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+dqadd7884 add  1000    -NaN30 -> -NaN30\r
+dqadd7885 add  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Here we explore near the boundary of rounding a subnormal to Nmin\r
+dqadd7575 add  1E-6143 -1E-6176 ->  9.99999999999999999999999999999999E-6144 Subnormal\r
+dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal\r
+\r
+-- check overflow edge case\r
+--               1234567890123456\r
+dqadd7972 apply   9.999999999999999999999999999999999E+6144         -> 9.999999999999999999999999999999999E+6144\r
+dqadd7973 add     9.999999999999999999999999999999999E+6144  1      -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7974 add      9999999999999999999999999999999999E+6111  1      -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7975 add      9999999999999999999999999999999999E+6111  1E+6111  -> Infinity Overflow Inexact Rounded\r
+dqadd7976 add      9999999999999999999999999999999999E+6111  9E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd7977 add      9999999999999999999999999999999999E+6111  8E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd7978 add      9999999999999999999999999999999999E+6111  7E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd7979 add      9999999999999999999999999999999999E+6111  6E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd7980 add      9999999999999999999999999999999999E+6111  5E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd7981 add      9999999999999999999999999999999999E+6111  4E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7982 add      9999999999999999999999999999999999E+6111  3E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7983 add      9999999999999999999999999999999999E+6111  2E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7984 add      9999999999999999999999999999999999E+6111  1E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+\r
+dqadd7985 apply  -9.999999999999999999999999999999999E+6144         -> -9.999999999999999999999999999999999E+6144\r
+dqadd7986 add    -9.999999999999999999999999999999999E+6144 -1      -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7987 add     -9999999999999999999999999999999999E+6111 -1      -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7988 add     -9999999999999999999999999999999999E+6111 -1E+6111  -> -Infinity Overflow Inexact Rounded\r
+dqadd7989 add     -9999999999999999999999999999999999E+6111 -9E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd7990 add     -9999999999999999999999999999999999E+6111 -8E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd7991 add     -9999999999999999999999999999999999E+6111 -7E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd7992 add     -9999999999999999999999999999999999E+6111 -6E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd7993 add     -9999999999999999999999999999999999E+6111 -5E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd7994 add     -9999999999999999999999999999999999E+6111 -4E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7995 add     -9999999999999999999999999999999999E+6111 -3E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7996 add     -9999999999999999999999999999999999E+6111 -2E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd7997 add     -9999999999999999999999999999999999E+6111 -1E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+\r
+-- And for round down full and subnormal results\r
+rounding:     down\r
+dqadd71100 add 1e+2 -1e-6143    -> 99.99999999999999999999999999999999 Rounded Inexact\r
+dqadd71101 add 1e+1 -1e-6143    -> 9.999999999999999999999999999999999  Rounded Inexact\r
+dqadd71103 add   +1 -1e-6143    -> 0.9999999999999999999999999999999999  Rounded Inexact\r
+dqadd71104 add 1e-1 -1e-6143    -> 0.09999999999999999999999999999999999  Rounded Inexact\r
+dqadd71105 add 1e-2 -1e-6143    -> 0.009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71106 add 1e-3 -1e-6143    -> 0.0009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71107 add 1e-4 -1e-6143    -> 0.00009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71108 add 1e-5 -1e-6143    -> 0.000009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71109 add 1e-6 -1e-6143    -> 9.999999999999999999999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+dqadd71110 add -1e+2 +1e-6143   -> -99.99999999999999999999999999999999 Rounded Inexact\r
+dqadd71111 add -1e+1 +1e-6143   -> -9.999999999999999999999999999999999  Rounded Inexact\r
+dqadd71113 add    -1 +1e-6143   -> -0.9999999999999999999999999999999999  Rounded Inexact\r
+dqadd71114 add -1e-1 +1e-6143   -> -0.09999999999999999999999999999999999  Rounded Inexact\r
+dqadd71115 add -1e-2 +1e-6143   -> -0.009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71116 add -1e-3 +1e-6143   -> -0.0009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71117 add -1e-4 +1e-6143   -> -0.00009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71118 add -1e-5 +1e-6143   -> -0.000009999999999999999999999999999999999  Rounded Inexact\r
+dqadd71119 add -1e-6 +1e-6143   -> -9.999999999999999999999999999999999E-7  Rounded Inexact\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+rounding:     half_even\r
+\r
+dqadd71300 add 1E34  -0.5                 ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71310 add 1E34  -0.51                ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71311 add 1E34  -0.501               ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71312 add 1E34  -0.5001              ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71313 add 1E34  -0.50001             ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71314 add 1E34  -0.500001            ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71315 add 1E34  -0.5000001           ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71316 add 1E34  -0.50000001          ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71317 add 1E34  -0.500000001         ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71318 add 1E34  -0.5000000001        ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71319 add 1E34  -0.50000000001       ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71320 add 1E34  -0.500000000001      ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71321 add 1E34  -0.5000000000001     ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71322 add 1E34  -0.50000000000001    ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71323 add 1E34  -0.500000000000001   ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71324 add 1E34  -0.5000000000000001  ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71325 add 1E34  -0.5000000000000000  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71326 add 1E34  -0.500000000000000   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71327 add 1E34  -0.50000000000000    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71328 add 1E34  -0.5000000000000     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71329 add 1E34  -0.500000000000      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71330 add 1E34  -0.50000000000       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71331 add 1E34  -0.5000000000        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71332 add 1E34  -0.500000000         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71333 add 1E34  -0.50000000          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71334 add 1E34  -0.5000000           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71335 add 1E34  -0.500000            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71336 add 1E34  -0.50000             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71337 add 1E34  -0.5000              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71338 add 1E34  -0.500               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71339 add 1E34  -0.50                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+\r
+dqadd71340 add 1E34  -5000000.000010001   ->  9999999999999999999999999995000000      Inexact Rounded\r
+dqadd71341 add 1E34  -5000000.000000001   ->  9999999999999999999999999995000000      Inexact Rounded\r
+\r
+dqadd71349 add 9999999999999999999999999999999999 0.4                 ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71350 add 9999999999999999999999999999999999 0.49                ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71351 add 9999999999999999999999999999999999 0.499               ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71352 add 9999999999999999999999999999999999 0.4999              ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71353 add 9999999999999999999999999999999999 0.49999             ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71354 add 9999999999999999999999999999999999 0.499999            ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71355 add 9999999999999999999999999999999999 0.4999999           ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71356 add 9999999999999999999999999999999999 0.49999999          ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71357 add 9999999999999999999999999999999999 0.499999999         ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71358 add 9999999999999999999999999999999999 0.4999999999        ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71359 add 9999999999999999999999999999999999 0.49999999999       ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71360 add 9999999999999999999999999999999999 0.499999999999      ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71361 add 9999999999999999999999999999999999 0.4999999999999     ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71362 add 9999999999999999999999999999999999 0.49999999999999    ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71363 add 9999999999999999999999999999999999 0.499999999999999   ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999  ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71367 add 9999999999999999999999999999999999 0.500000000000000   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71368 add 9999999999999999999999999999999999 0.50000000000000    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71369 add 9999999999999999999999999999999999 0.5000000000000     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71370 add 9999999999999999999999999999999999 0.500000000000      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71371 add 9999999999999999999999999999999999 0.50000000000       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71372 add 9999999999999999999999999999999999 0.5000000000        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71373 add 9999999999999999999999999999999999 0.500000000         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71374 add 9999999999999999999999999999999999 0.50000000          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71375 add 9999999999999999999999999999999999 0.5000000           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71376 add 9999999999999999999999999999999999 0.500000            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71377 add 9999999999999999999999999999999999 0.50000             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71378 add 9999999999999999999999999999999999 0.5000              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71379 add 9999999999999999999999999999999999 0.500               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71380 add 9999999999999999999999999999999999 0.50                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71381 add 9999999999999999999999999999999999 0.5                 ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71383 add 9999999999999999999999999999999999 0.500000000000001   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71384 add 9999999999999999999999999999999999 0.50000000000001    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71385 add 9999999999999999999999999999999999 0.5000000000001     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71386 add 9999999999999999999999999999999999 0.500000000001      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71387 add 9999999999999999999999999999999999 0.50000000001       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71388 add 9999999999999999999999999999999999 0.5000000001        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71389 add 9999999999999999999999999999999999 0.500000001         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71390 add 9999999999999999999999999999999999 0.50000001          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71391 add 9999999999999999999999999999999999 0.5000001           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71392 add 9999999999999999999999999999999999 0.500001            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71393 add 9999999999999999999999999999999999 0.50001             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71394 add 9999999999999999999999999999999999 0.5001              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71395 add 9999999999999999999999999999999999 0.501               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd71396 add 9999999999999999999999999999999999 0.51                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+dqadd71420 add  0 1.123456789987654321123456789012345     -> 1.123456789987654321123456789012345\r
+dqadd71421 add  0 1.123456789987654321123456789012345E-1  -> 0.1123456789987654321123456789012345\r
+dqadd71422 add  0 1.123456789987654321123456789012345E-2  -> 0.01123456789987654321123456789012345\r
+dqadd71423 add  0 1.123456789987654321123456789012345E-3  -> 0.001123456789987654321123456789012345\r
+dqadd71424 add  0 1.123456789987654321123456789012345E-4  -> 0.0001123456789987654321123456789012345\r
+dqadd71425 add  0 1.123456789987654321123456789012345E-5  -> 0.00001123456789987654321123456789012345\r
+dqadd71426 add  0 1.123456789987654321123456789012345E-6  -> 0.000001123456789987654321123456789012345\r
+dqadd71427 add  0 1.123456789987654321123456789012345E-7  -> 1.123456789987654321123456789012345E-7\r
+dqadd71428 add  0 1.123456789987654321123456789012345E-8  -> 1.123456789987654321123456789012345E-8\r
+dqadd71429 add  0 1.123456789987654321123456789012345E-9  -> 1.123456789987654321123456789012345E-9\r
+dqadd71430 add  0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10\r
+dqadd71431 add  0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11\r
+dqadd71432 add  0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12\r
+dqadd71433 add  0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13\r
+dqadd71434 add  0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14\r
+dqadd71435 add  0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15\r
+dqadd71436 add  0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16\r
+dqadd71437 add  0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17\r
+dqadd71438 add  0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18\r
+dqadd71439 add  0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19\r
+dqadd71440 add  0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20\r
+dqadd71441 add  0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21\r
+dqadd71442 add  0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22\r
+dqadd71443 add  0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23\r
+dqadd71444 add  0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24\r
+dqadd71445 add  0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25\r
+dqadd71446 add  0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26\r
+dqadd71447 add  0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27\r
+dqadd71448 add  0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28\r
+dqadd71449 add  0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29\r
+dqadd71450 add  0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30\r
+dqadd71451 add  0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31\r
+dqadd71452 add  0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32\r
+dqadd71453 add  0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33\r
+dqadd71454 add  0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34\r
+dqadd71455 add  0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35\r
+dqadd71456 add  0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36\r
+\r
+-- same, reversed 0\r
+dqadd71460 add 1.123456789987654321123456789012345     0 -> 1.123456789987654321123456789012345\r
+dqadd71461 add 1.123456789987654321123456789012345E-1  0 -> 0.1123456789987654321123456789012345\r
+dqadd71462 add 1.123456789987654321123456789012345E-2  0 -> 0.01123456789987654321123456789012345\r
+dqadd71463 add 1.123456789987654321123456789012345E-3  0 -> 0.001123456789987654321123456789012345\r
+dqadd71464 add 1.123456789987654321123456789012345E-4  0 -> 0.0001123456789987654321123456789012345\r
+dqadd71465 add 1.123456789987654321123456789012345E-5  0 -> 0.00001123456789987654321123456789012345\r
+dqadd71466 add 1.123456789987654321123456789012345E-6  0 -> 0.000001123456789987654321123456789012345\r
+dqadd71467 add 1.123456789987654321123456789012345E-7  0 -> 1.123456789987654321123456789012345E-7\r
+dqadd71468 add 1.123456789987654321123456789012345E-8  0 -> 1.123456789987654321123456789012345E-8\r
+dqadd71469 add 1.123456789987654321123456789012345E-9  0 -> 1.123456789987654321123456789012345E-9\r
+dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10\r
+dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11\r
+dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12\r
+dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13\r
+dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14\r
+dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15\r
+dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16\r
+dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17\r
+dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18\r
+dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19\r
+dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20\r
+dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21\r
+dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22\r
+dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23\r
+dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24\r
+dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25\r
+dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26\r
+dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27\r
+dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28\r
+dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29\r
+dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30\r
+dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31\r
+dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32\r
+dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33\r
+dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34\r
+dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35\r
+dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36\r
+\r
+-- same, Es on the 0\r
+dqadd71500 add 1.123456789987654321123456789012345  0E-0   -> 1.123456789987654321123456789012345\r
+dqadd71501 add 1.123456789987654321123456789012345  0E-1   -> 1.123456789987654321123456789012345\r
+dqadd71502 add 1.123456789987654321123456789012345  0E-2   -> 1.123456789987654321123456789012345\r
+dqadd71503 add 1.123456789987654321123456789012345  0E-3   -> 1.123456789987654321123456789012345\r
+dqadd71504 add 1.123456789987654321123456789012345  0E-4   -> 1.123456789987654321123456789012345\r
+dqadd71505 add 1.123456789987654321123456789012345  0E-5   -> 1.123456789987654321123456789012345\r
+dqadd71506 add 1.123456789987654321123456789012345  0E-6   -> 1.123456789987654321123456789012345\r
+dqadd71507 add 1.123456789987654321123456789012345  0E-7   -> 1.123456789987654321123456789012345\r
+dqadd71508 add 1.123456789987654321123456789012345  0E-8   -> 1.123456789987654321123456789012345\r
+dqadd71509 add 1.123456789987654321123456789012345  0E-9   -> 1.123456789987654321123456789012345\r
+dqadd71510 add 1.123456789987654321123456789012345  0E-10  -> 1.123456789987654321123456789012345\r
+dqadd71511 add 1.123456789987654321123456789012345  0E-11  -> 1.123456789987654321123456789012345\r
+dqadd71512 add 1.123456789987654321123456789012345  0E-12  -> 1.123456789987654321123456789012345\r
+dqadd71513 add 1.123456789987654321123456789012345  0E-13  -> 1.123456789987654321123456789012345\r
+dqadd71514 add 1.123456789987654321123456789012345  0E-14  -> 1.123456789987654321123456789012345\r
+dqadd71515 add 1.123456789987654321123456789012345  0E-15  -> 1.123456789987654321123456789012345\r
+dqadd71516 add 1.123456789987654321123456789012345  0E-16  -> 1.123456789987654321123456789012345\r
+dqadd71517 add 1.123456789987654321123456789012345  0E-17  -> 1.123456789987654321123456789012345\r
+dqadd71518 add 1.123456789987654321123456789012345  0E-18  -> 1.123456789987654321123456789012345\r
+dqadd71519 add 1.123456789987654321123456789012345  0E-19  -> 1.123456789987654321123456789012345\r
+dqadd71520 add 1.123456789987654321123456789012345  0E-20  -> 1.123456789987654321123456789012345\r
+dqadd71521 add 1.123456789987654321123456789012345  0E-21  -> 1.123456789987654321123456789012345\r
+dqadd71522 add 1.123456789987654321123456789012345  0E-22  -> 1.123456789987654321123456789012345\r
+dqadd71523 add 1.123456789987654321123456789012345  0E-23  -> 1.123456789987654321123456789012345\r
+dqadd71524 add 1.123456789987654321123456789012345  0E-24  -> 1.123456789987654321123456789012345\r
+dqadd71525 add 1.123456789987654321123456789012345  0E-25  -> 1.123456789987654321123456789012345\r
+dqadd71526 add 1.123456789987654321123456789012345  0E-26  -> 1.123456789987654321123456789012345\r
+dqadd71527 add 1.123456789987654321123456789012345  0E-27  -> 1.123456789987654321123456789012345\r
+dqadd71528 add 1.123456789987654321123456789012345  0E-28  -> 1.123456789987654321123456789012345\r
+dqadd71529 add 1.123456789987654321123456789012345  0E-29  -> 1.123456789987654321123456789012345\r
+dqadd71530 add 1.123456789987654321123456789012345  0E-30  -> 1.123456789987654321123456789012345\r
+dqadd71531 add 1.123456789987654321123456789012345  0E-31  -> 1.123456789987654321123456789012345\r
+dqadd71532 add 1.123456789987654321123456789012345  0E-32  -> 1.123456789987654321123456789012345\r
+dqadd71533 add 1.123456789987654321123456789012345  0E-33  -> 1.123456789987654321123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+dqadd71534 add 1.123456789987654321123456789012345  0E-34  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd71535 add 1.123456789987654321123456789012345  0E-35  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd71536 add 1.123456789987654321123456789012345  0E-36  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd71537 add 1.123456789987654321123456789012345  0E-37  -> 1.123456789987654321123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+dqadd71600 add  0        0E-19  ->  0E-19\r
+dqadd71601 add -0        0E-19  ->  0E-19\r
+dqadd71602 add  0       -0E-19  ->  0E-19\r
+dqadd71603 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71611 add -11      11    ->  0\r
+dqadd71612 add  11     -11    ->  0\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+dqadd71620 add  0        0E-19  ->  0E-19\r
+dqadd71621 add -0        0E-19  ->  0E-19\r
+dqadd71622 add  0       -0E-19  ->  0E-19\r
+dqadd71623 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71631 add -11      11    ->  0\r
+dqadd71632 add  11     -11    ->  0\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+dqadd71640 add  0        0E-19  ->  0E-19\r
+dqadd71641 add -0        0E-19  ->  0E-19\r
+dqadd71642 add  0       -0E-19  ->  0E-19\r
+dqadd71643 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71651 add -11      11    ->  0\r
+dqadd71652 add  11     -11    ->  0\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+dqadd71660 add  0        0E-19  ->  0E-19\r
+dqadd71661 add -0        0E-19  ->  0E-19\r
+dqadd71662 add  0       -0E-19  ->  0E-19\r
+dqadd71663 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71671 add -11      11    ->  0\r
+dqadd71672 add  11     -11    ->  0\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+dqadd71680 add  0        0E-19  ->  0E-19\r
+dqadd71681 add -0        0E-19  ->  0E-19\r
+dqadd71682 add  0       -0E-19  ->  0E-19\r
+dqadd71683 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71691 add -11      11    ->  0\r
+dqadd71692 add  11     -11    ->  0\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+dqadd71700 add  0        0E-19  ->  0E-19\r
+dqadd71701 add -0        0E-19  ->  0E-19\r
+dqadd71702 add  0       -0E-19  ->  0E-19\r
+dqadd71703 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71711 add -11      11    ->  0\r
+dqadd71712 add  11     -11    ->  0\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+dqadd71720 add  0        0E-19  ->  0E-19\r
+dqadd71721 add -0        0E-19  -> -0E-19           -- *\r
+dqadd71722 add  0       -0E-19  -> -0E-19           -- *\r
+dqadd71723 add -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd71731 add -11      11    ->  -0                -- *\r
+dqadd71732 add  11     -11    ->  -0                -- *\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+dqadd71741 add 130E-2    120E-2    -> 2.50\r
+dqadd71742 add 130E-2    12E-1     -> 2.50\r
+dqadd71743 add 130E-2    1E0       -> 2.30\r
+dqadd71744 add 1E2       1E4       -> 1.01E+4\r
+dqadd71745 add 130E-2   -120E-2 -> 0.10\r
+dqadd71746 add 130E-2   -12E-1  -> 0.10\r
+dqadd71747 add 130E-2   -1E0    -> 0.30\r
+dqadd71748 add 1E2      -1E4    -> -9.9E+3\r
+\r
+-- Gappy coefficients; check residue handling even with full coefficient gap\r
+rounding: half_even\r
+\r
+dqadd75001 add 1239876543211234567894567890123456 1      -> 1239876543211234567894567890123457\r
+dqadd75002 add 1239876543211234567894567890123456 0.6    -> 1239876543211234567894567890123457  Inexact Rounded\r
+dqadd75003 add 1239876543211234567894567890123456 0.06   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75004 add 1239876543211234567894567890123456 6E-3   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75005 add 1239876543211234567894567890123456 6E-4   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75006 add 1239876543211234567894567890123456 6E-5   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75007 add 1239876543211234567894567890123456 6E-6   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75008 add 1239876543211234567894567890123456 6E-7   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75009 add 1239876543211234567894567890123456 6E-8   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75010 add 1239876543211234567894567890123456 6E-9   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75011 add 1239876543211234567894567890123456 6E-10  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75012 add 1239876543211234567894567890123456 6E-11  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75013 add 1239876543211234567894567890123456 6E-12  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75014 add 1239876543211234567894567890123456 6E-13  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75015 add 1239876543211234567894567890123456 6E-14  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75016 add 1239876543211234567894567890123456 6E-15  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75017 add 1239876543211234567894567890123456 6E-16  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75018 add 1239876543211234567894567890123456 6E-17  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75019 add 1239876543211234567894567890123456 6E-18  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75020 add 1239876543211234567894567890123456 6E-19  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd75021 add 1239876543211234567894567890123456 6E-20  -> 1239876543211234567894567890123456  Inexact Rounded\r
+\r
+-- widening second argument at gap\r
+dqadd75030 add 12398765432112345678945678 1                       -> 12398765432112345678945679\r
+dqadd75031 add 12398765432112345678945678 0.1                     -> 12398765432112345678945678.1\r
+dqadd75032 add 12398765432112345678945678 0.12                    -> 12398765432112345678945678.12\r
+dqadd75033 add 12398765432112345678945678 0.123                   -> 12398765432112345678945678.123\r
+dqadd75034 add 12398765432112345678945678 0.1234                  -> 12398765432112345678945678.1234\r
+dqadd75035 add 12398765432112345678945678 0.12345                 -> 12398765432112345678945678.12345\r
+dqadd75036 add 12398765432112345678945678 0.123456                -> 12398765432112345678945678.123456\r
+dqadd75037 add 12398765432112345678945678 0.1234567               -> 12398765432112345678945678.1234567\r
+dqadd75038 add 12398765432112345678945678 0.12345678              -> 12398765432112345678945678.12345678\r
+dqadd75039 add 12398765432112345678945678 0.123456789             -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75040 add 12398765432112345678945678 0.123456785             -> 12398765432112345678945678.12345678 Inexact Rounded\r
+dqadd75041 add 12398765432112345678945678 0.1234567850            -> 12398765432112345678945678.12345678 Inexact Rounded\r
+dqadd75042 add 12398765432112345678945678 0.1234567851            -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75043 add 12398765432112345678945678 0.12345678501           -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75044 add 12398765432112345678945678 0.123456785001          -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75045 add 12398765432112345678945678 0.1234567850001         -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75046 add 12398765432112345678945678 0.12345678500001        -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75047 add 12398765432112345678945678 0.123456785000001       -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75048 add 12398765432112345678945678 0.1234567850000001      -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd75049 add 12398765432112345678945678 0.1234567850000000      -> 12398765432112345678945678.12345678 Inexact Rounded\r
+--                               90123456\r
+rounding: half_even\r
+dqadd75050 add 12398765432112345678945678 0.0234567750000000      -> 12398765432112345678945678.02345678 Inexact Rounded\r
+dqadd75051 add 12398765432112345678945678 0.0034567750000000      -> 12398765432112345678945678.00345678 Inexact Rounded\r
+dqadd75052 add 12398765432112345678945678 0.0004567750000000      -> 12398765432112345678945678.00045678 Inexact Rounded\r
+dqadd75053 add 12398765432112345678945678 0.0000567750000000      -> 12398765432112345678945678.00005678 Inexact Rounded\r
+dqadd75054 add 12398765432112345678945678 0.0000067750000000      -> 12398765432112345678945678.00000678 Inexact Rounded\r
+dqadd75055 add 12398765432112345678945678 0.0000007750000000      -> 12398765432112345678945678.00000078 Inexact Rounded\r
+dqadd75056 add 12398765432112345678945678 0.0000000750000000      -> 12398765432112345678945678.00000008 Inexact Rounded\r
+dqadd75057 add 12398765432112345678945678 0.0000000050000000      -> 12398765432112345678945678.00000000 Inexact Rounded\r
+dqadd75060 add 12398765432112345678945678 0.0234567750000001      -> 12398765432112345678945678.02345678 Inexact Rounded\r
+dqadd75061 add 12398765432112345678945678 0.0034567750000001      -> 12398765432112345678945678.00345678 Inexact Rounded\r
+dqadd75062 add 12398765432112345678945678 0.0004567750000001      -> 12398765432112345678945678.00045678 Inexact Rounded\r
+dqadd75063 add 12398765432112345678945678 0.0000567750000001      -> 12398765432112345678945678.00005678 Inexact Rounded\r
+dqadd75064 add 12398765432112345678945678 0.0000067750000001      -> 12398765432112345678945678.00000678 Inexact Rounded\r
+dqadd75065 add 12398765432112345678945678 0.0000007750000001      -> 12398765432112345678945678.00000078 Inexact Rounded\r
+dqadd75066 add 12398765432112345678945678 0.0000000750000001      -> 12398765432112345678945678.00000008 Inexact Rounded\r
+dqadd75067 add 12398765432112345678945678 0.0000000050000001      -> 12398765432112345678945678.00000001 Inexact Rounded\r
+-- far-out residues (full coefficient gap is 16+15 digits)\r
+rounding: up\r
+dqadd75070 add 12398765432112345678945678 1E-8                    -> 12398765432112345678945678.00000001\r
+dqadd75071 add 12398765432112345678945678 1E-9                    -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75072 add 12398765432112345678945678 1E-10                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75073 add 12398765432112345678945678 1E-11                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75074 add 12398765432112345678945678 1E-12                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75075 add 12398765432112345678945678 1E-13                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75076 add 12398765432112345678945678 1E-14                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75077 add 12398765432112345678945678 1E-15                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75078 add 12398765432112345678945678 1E-16                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75079 add 12398765432112345678945678 1E-17                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75080 add 12398765432112345678945678 1E-18                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75081 add 12398765432112345678945678 1E-19                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75082 add 12398765432112345678945678 1E-20                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75083 add 12398765432112345678945678 1E-25                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75084 add 12398765432112345678945678 1E-30                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75085 add 12398765432112345678945678 1E-31                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75086 add 12398765432112345678945678 1E-32                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75087 add 12398765432112345678945678 1E-33                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75088 add 12398765432112345678945678 1E-34                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd75089 add 12398765432112345678945678 1E-35                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+\r
+-- Null tests\r
+dqadd9990 add 10  # -> NaN Invalid_operation\r
+dqadd9991 add  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqAnd.decTest b/Lib/test/decimaltestdata/dqAnd.decTest
new file mode 100644 (file)
index 0000000..be3fb34
--- /dev/null
@@ -0,0 +1,420 @@
+------------------------------------------------------------------------\r
+-- dqAnd.decTest -- digitwise logical AND for decQuads                --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+dqand001 and             0    0 ->    0\r
+dqand002 and             0    1 ->    0\r
+dqand003 and             1    0 ->    0\r
+dqand004 and             1    1 ->    1\r
+dqand005 and          1100 1010 -> 1000\r
+-- and at msd and msd-1\r
+--           1234567890123456789012345678901234\r
+dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 ->                  0\r
+dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 ->                  0\r
+dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 ->                  0\r
+dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 ->                  0\r
+dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 ->                  0\r
+dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 ->                  0\r
+dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 ->    100000000000000000000000000000000\r
+\r
+-- Various lengths\r
+--           1234567890123456789012345678901234\r
+\r
+dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111  ->  111111111111111111111111111111111\r
+dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111  -> 1011111111111111111111111111111111\r
+dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111  -> 1101111111111111111111111111111111\r
+dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111  -> 1110111111111111111111111111111111\r
+dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111  -> 1111011111111111111111111111111111\r
+dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111  -> 1111101111111111111111111111111111\r
+dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111  -> 1111110111111111111111111111111111\r
+dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111  -> 1111111011111111111111111111111111\r
+dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111  -> 1111111101111111111111111111111111\r
+dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111  -> 1111111110111111111111111111111111\r
+dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111  -> 1111111111011111111111111111111111\r
+dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111  -> 1111111111101111111111111111111111\r
+dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111  -> 1111111111110111111111111111111111\r
+dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111  -> 1111111111111011111111111111111111\r
+dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111  -> 1111111111111101111111111111111111\r
+dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111  -> 1111111111111110111111111111111111\r
+dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111  -> 1111111111111111011111111111111111\r
+dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111  -> 1111111111111111101111111111111111\r
+dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111  -> 1111111111111111110111111111111111\r
+dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111  -> 1111111111111111111011111111111111\r
+dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111  -> 1111111111111111111101111111111111\r
+dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111  -> 1111111111111111111110111111111111\r
+dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111  -> 1111111111111111111111011111111111\r
+dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111  -> 1111111111111111111111101111111111\r
+dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111  -> 1111111111111111111111110111111111\r
+dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111  -> 1111111111111111111111111011111111\r
+dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111  -> 1111111111111111111111111101111111\r
+dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111  -> 1111111111111111111111111110111111\r
+dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111  -> 1111111111111111111111111111011111\r
+dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111  -> 1111111111111111111111111111101111\r
+dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111  -> 1111111111111111111111111111110111\r
+dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111  -> 1111111111111111111111111111111011\r
+dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111  -> 1111111111111111111111111111111101\r
+dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111  -> 1111111111111111111111111111111110\r
+\r
+dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111  ->  111111111111111111111111111111111\r
+dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111  -> 1011111111111111111111111111111111\r
+dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111  -> 1101111111111111111111111111111111\r
+dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111  -> 1110111111111111111111111111111111\r
+dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111  -> 1111011111111111111111111111111111\r
+dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111  -> 1111101111111111111111111111111111\r
+dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111  -> 1111110111111111111111111111111111\r
+dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111  -> 1111111011111111111111111111111111\r
+dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111  -> 1111111101111111111111111111111111\r
+dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111  -> 1111111110111111111111111111111111\r
+dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111  -> 1111111111011111111111111111111111\r
+dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111  -> 1111111111101111111111111111111111\r
+dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111  -> 1111111111110111111111111111111111\r
+dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111  -> 1111111111111011111111111111111111\r
+dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111  -> 1111111111111101111111111111111111\r
+dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111  -> 1111111111111110111111111111111111\r
+dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111  -> 1111111111111111011111111111111111\r
+dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111  -> 1111111111111111101111111111111111\r
+dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111  -> 1111111111111111110111111111111111\r
+dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111  -> 1111111111111111111011111111111111\r
+dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111  -> 1111111111111111111101111111111111\r
+dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111  -> 1111111111111111111110111111111111\r
+dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111  -> 1111111111111111111111011111111111\r
+dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111  -> 1111111111111111111111101111111111\r
+dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111  -> 1111111111111111111111110111111111\r
+dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111  -> 1111111111111111111111111011111111\r
+dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111  -> 1111111111111111111111111101111111\r
+dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111  -> 1111111111111111111111111110111111\r
+dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111  -> 1111111111111111111111111111011111\r
+dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111  -> 1111111111111111111111111111101111\r
+dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111  -> 1111111111111111111111111111110111\r
+dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011  -> 1111111111111111111111111111111011\r
+dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101  -> 1111111111111111111111111111111101\r
+dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110  -> 1111111111111111111111111111111110\r
+dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110  ->  111111111111111111111111111111110\r
+dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110  -> 1111111111111111111111111111111110\r
+\r
+dqand021 and 1111111111111111 1111111111111111  ->  1111111111111111\r
+dqand024 and 1111111111111111  111111111111111  ->   111111111111111\r
+dqand025 and 1111111111111111   11111111111111  ->    11111111111111\r
+dqand026 and 1111111111111111    1111111111111  ->     1111111111111\r
+dqand027 and 1111111111111111     111111111111  ->      111111111111\r
+dqand028 and 1111111111111111      11111111111  ->       11111111111\r
+dqand029 and 1111111111111111       1111111111  ->        1111111111\r
+dqand030 and 1111111111111111        111111111  ->         111111111\r
+dqand031 and 1111111111111111         11111111  ->          11111111\r
+dqand032 and 1111111111111111          1111111  ->           1111111\r
+dqand033 and 1111111111111111           111111  ->            111111\r
+dqand034 and 1111111111111111            11111  ->             11111\r
+dqand035 and 1111111111111111             1111  ->              1111\r
+dqand036 and 1111111111111111              111  ->               111\r
+dqand037 and 1111111111111111               11  ->                11\r
+dqand038 and 1111111111111111                1  ->                 1\r
+dqand039 and 1111111111111111                0  ->                 0\r
+\r
+dqand040 and 1111111111111111    1111111111111111 ->  1111111111111111\r
+dqand041 and  111111111111111    1111111111111111 ->   111111111111111\r
+dqand042 and  111111111111111    1111111111111111 ->   111111111111111\r
+dqand043 and   11111111111111    1111111111111111 ->    11111111111111\r
+dqand044 and    1111111111111    1111111111111111 ->     1111111111111\r
+dqand045 and     111111111111    1111111111111111 ->      111111111111\r
+dqand046 and      11111111111    1111111111111111 ->       11111111111\r
+dqand047 and       1111111111    1111111111111111 ->        1111111111\r
+dqand048 and        111111111    1111111111111111 ->         111111111\r
+dqand049 and         11111111    1111111111111111 ->          11111111\r
+dqand050 and          1111111    1111111111111111 ->           1111111\r
+dqand051 and           111111    1111111111111111 ->            111111\r
+dqand052 and            11111    1111111111111111 ->             11111\r
+dqand053 and             1111    1111111111111111 ->              1111\r
+dqand054 and              111    1111111111111111 ->               111\r
+dqand055 and               11    1111111111111111 ->                11\r
+dqand056 and                1    1111111111111111 ->                 1\r
+dqand057 and                0    1111111111111111 ->                 0\r
+\r
+dqand150 and 1111111111  1  ->  1\r
+dqand151 and  111111111  1  ->  1\r
+dqand152 and   11111111  1  ->  1\r
+dqand153 and    1111111  1  ->  1\r
+dqand154 and     111111  1  ->  1\r
+dqand155 and      11111  1  ->  1\r
+dqand156 and       1111  1  ->  1\r
+dqand157 and        111  1  ->  1\r
+dqand158 and         11  1  ->  1\r
+dqand159 and          1  1  ->  1\r
+\r
+dqand160 and 1111111111  0  ->  0\r
+dqand161 and  111111111  0  ->  0\r
+dqand162 and   11111111  0  ->  0\r
+dqand163 and    1111111  0  ->  0\r
+dqand164 and     111111  0  ->  0\r
+dqand165 and      11111  0  ->  0\r
+dqand166 and       1111  0  ->  0\r
+dqand167 and        111  0  ->  0\r
+dqand168 and         11  0  ->  0\r
+dqand169 and          1  0  ->  0\r
+\r
+dqand170 and 1  1111111111  ->  1\r
+dqand171 and 1   111111111  ->  1\r
+dqand172 and 1    11111111  ->  1\r
+dqand173 and 1     1111111  ->  1\r
+dqand174 and 1      111111  ->  1\r
+dqand175 and 1       11111  ->  1\r
+dqand176 and 1        1111  ->  1\r
+dqand177 and 1         111  ->  1\r
+dqand178 and 1          11  ->  1\r
+dqand179 and 1           1  ->  1\r
+\r
+dqand180 and 0  1111111111  ->  0\r
+dqand181 and 0   111111111  ->  0\r
+dqand182 and 0    11111111  ->  0\r
+dqand183 and 0     1111111  ->  0\r
+dqand184 and 0      111111  ->  0\r
+dqand185 and 0       11111  ->  0\r
+dqand186 and 0        1111  ->  0\r
+dqand187 and 0         111  ->  0\r
+dqand188 and 0          11  ->  0\r
+dqand189 and 0           1  ->  0\r
+\r
+dqand090 and 011111111  111111111  ->   11111111\r
+dqand091 and 101111111  111111111  ->  101111111\r
+dqand092 and 110111111  111111111  ->  110111111\r
+dqand093 and 111011111  111111111  ->  111011111\r
+dqand094 and 111101111  111111111  ->  111101111\r
+dqand095 and 111110111  111111111  ->  111110111\r
+dqand096 and 111111011  111111111  ->  111111011\r
+dqand097 and 111111101  111111111  ->  111111101\r
+dqand098 and 111111110  111111111  ->  111111110\r
+\r
+dqand100 and 111111111  011111111  ->   11111111\r
+dqand101 and 111111111  101111111  ->  101111111\r
+dqand102 and 111111111  110111111  ->  110111111\r
+dqand103 and 111111111  111011111  ->  111011111\r
+dqand104 and 111111111  111101111  ->  111101111\r
+dqand105 and 111111111  111110111  ->  111110111\r
+dqand106 and 111111111  111111011  ->  111111011\r
+dqand107 and 111111111  111111101  ->  111111101\r
+dqand108 and 111111111  111111110  ->  111111110\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+dqand220 and 111111112  111111111  ->  NaN Invalid_operation\r
+dqand221 and 333333333  333333333  ->  NaN Invalid_operation\r
+dqand222 and 555555555  555555555  ->  NaN Invalid_operation\r
+dqand223 and 777777777  777777777  ->  NaN Invalid_operation\r
+dqand224 and 999999999  999999999  ->  NaN Invalid_operation\r
+dqand225 and 222222222  999999999  ->  NaN Invalid_operation\r
+dqand226 and 444444444  999999999  ->  NaN Invalid_operation\r
+dqand227 and 666666666  999999999  ->  NaN Invalid_operation\r
+dqand228 and 888888888  999999999  ->  NaN Invalid_operation\r
+dqand229 and 999999999  222222222  ->  NaN Invalid_operation\r
+dqand230 and 999999999  444444444  ->  NaN Invalid_operation\r
+dqand231 and 999999999  666666666  ->  NaN Invalid_operation\r
+dqand232 and 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+dqand240 and  567468689 -934981942 ->  NaN Invalid_operation\r
+dqand241 and  567367689  934981942 ->  NaN Invalid_operation\r
+dqand242 and -631917772 -706014634 ->  NaN Invalid_operation\r
+dqand243 and -756253257  138579234 ->  NaN Invalid_operation\r
+dqand244 and  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+dqand250 and  2000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand251 and  7000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand252 and  8000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand253 and  9000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand254 and  2000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand255 and  7000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand256 and  8000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand257 and  9000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand258 and  1000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand259 and  1000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand260 and  1000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand261 and  1000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand262 and  0000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand263 and  0000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand264 and  0000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqand265 and  0000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+dqand270 and  0200000111000111000111001000000000 1000000111000111000111100000000010 ->  NaN Invalid_operation\r
+dqand271 and  0700000111000111000111000100000000 1000000111000111000111010000000100 ->  NaN Invalid_operation\r
+dqand272 and  0800000111000111000111000010000000 1000000111000111000111001000001000 ->  NaN Invalid_operation\r
+dqand273 and  0900000111000111000111000001000000 1000000111000111000111000100010000 ->  NaN Invalid_operation\r
+dqand274 and  1000000111000111000111000000100000 0200000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqand275 and  1000000111000111000111000000010000 0700000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqand276 and  1000000111000111000111000000001000 0800000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqand277 and  1000000111000111000111000000000100 0900000111000111000111000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+dqand280 and  0010000111000111000111000000000002 1000000111000111000111000100000001 ->  NaN Invalid_operation\r
+dqand281 and  0001000111000111000111000000000007 1000000111000111000111001000000011 ->  NaN Invalid_operation\r
+dqand282 and  0000000111000111000111100000000008 1000000111000111000111010000000001 ->  NaN Invalid_operation\r
+dqand283 and  0000000111000111000111010000000009 1000000111000111000111100000000001 ->  NaN Invalid_operation\r
+dqand284 and  1000000111000111000111001000000000 0001000111000111000111000000000002 ->  NaN Invalid_operation\r
+dqand285 and  1000000111000111000111000100000000 0010000111000111000111000000000007 ->  NaN Invalid_operation\r
+dqand286 and  1000000111000111000111000010000000 0100000111000111000111000000000008 ->  NaN Invalid_operation\r
+dqand287 and  1000000111000111000111000001000000 1000000111000111000111000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+dqand288 and  0010000111000111000111000020000000 1000000111000111000111001000000000 ->  NaN Invalid_operation\r
+dqand289 and  0001000111000111000111000070000001 1000000111000111000111000100000000 ->  NaN Invalid_operation\r
+dqand290 and  0000000111000111000111100080000010 1000000111000111000111000010000000 ->  NaN Invalid_operation\r
+dqand291 and  0000000111000111000111010090000100 1000000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqand292 and  1000000111000111000111001000001000 0000000111000111000111000020100000 ->  NaN Invalid_operation\r
+dqand293 and  1000000111000111000111000100010000 0000000111000111000111000070010000 ->  NaN Invalid_operation\r
+dqand294 and  1000000111000111000111000010100000 0000000111000111000111000080001000 ->  NaN Invalid_operation\r
+dqand295 and  1000000111000111000111000001000000 0000000111000111000111000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 ->  NaN Invalid_operation\r
+dqand297 and -1000000111000111000111000001000000  0000001110001110001110000010000100 ->  NaN Invalid_operation\r
+dqand298 and  1000000111000111000111000001000000 -0000001110001110001110001000000100 ->  NaN Invalid_operation\r
+dqand299 and  1000000111000111000111000001000000  0000001110001110001110000011000100 ->  110000110000110000001000000\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+dqand331 and  2   9.99999999E+999     -> NaN Invalid_operation\r
+dqand332 and  3   1E-999              -> NaN Invalid_operation\r
+dqand333 and  4   1.00000000E-999     -> NaN Invalid_operation\r
+dqand334 and  5   1E-900              -> NaN Invalid_operation\r
+dqand335 and  6   -1E-900             -> NaN Invalid_operation\r
+dqand336 and  7   -1.00000000E-999    -> NaN Invalid_operation\r
+dqand337 and  8   -1E-999             -> NaN Invalid_operation\r
+dqand338 and  9   -9.99999999E+999    -> NaN Invalid_operation\r
+dqand341 and  9.99999999E+999     -18 -> NaN Invalid_operation\r
+dqand342 and  1E-999               01 -> NaN Invalid_operation\r
+dqand343 and  1.00000000E-999     -18 -> NaN Invalid_operation\r
+dqand344 and  1E-900               18 -> NaN Invalid_operation\r
+dqand345 and  -1E-900             -10 -> NaN Invalid_operation\r
+dqand346 and  -1.00000000E-999     18 -> NaN Invalid_operation\r
+dqand347 and  -1E-999              10 -> NaN Invalid_operation\r
+dqand348 and  -9.99999999E+999    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+dqand361 and  1.0                  1  -> NaN Invalid_operation\r
+dqand362 and  1E+1                 1  -> NaN Invalid_operation\r
+dqand363 and  0.0                  1  -> NaN Invalid_operation\r
+dqand364 and  0E+1                 1  -> NaN Invalid_operation\r
+dqand365 and  9.9                  1  -> NaN Invalid_operation\r
+dqand366 and  9E+1                 1  -> NaN Invalid_operation\r
+dqand371 and  0 1.0                   -> NaN Invalid_operation\r
+dqand372 and  0 1E+1                  -> NaN Invalid_operation\r
+dqand373 and  0 0.0                   -> NaN Invalid_operation\r
+dqand374 and  0 0E+1                  -> NaN Invalid_operation\r
+dqand375 and  0 9.9                   -> NaN Invalid_operation\r
+dqand376 and  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+dqand780 and -Inf  -Inf   -> NaN Invalid_operation\r
+dqand781 and -Inf  -1000  -> NaN Invalid_operation\r
+dqand782 and -Inf  -1     -> NaN Invalid_operation\r
+dqand783 and -Inf  -0     -> NaN Invalid_operation\r
+dqand784 and -Inf   0     -> NaN Invalid_operation\r
+dqand785 and -Inf   1     -> NaN Invalid_operation\r
+dqand786 and -Inf   1000  -> NaN Invalid_operation\r
+dqand787 and -1000 -Inf   -> NaN Invalid_operation\r
+dqand788 and -Inf  -Inf   -> NaN Invalid_operation\r
+dqand789 and -1    -Inf   -> NaN Invalid_operation\r
+dqand790 and -0    -Inf   -> NaN Invalid_operation\r
+dqand791 and  0    -Inf   -> NaN Invalid_operation\r
+dqand792 and  1    -Inf   -> NaN Invalid_operation\r
+dqand793 and  1000 -Inf   -> NaN Invalid_operation\r
+dqand794 and  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+dqand800 and  Inf  -Inf   -> NaN Invalid_operation\r
+dqand801 and  Inf  -1000  -> NaN Invalid_operation\r
+dqand802 and  Inf  -1     -> NaN Invalid_operation\r
+dqand803 and  Inf  -0     -> NaN Invalid_operation\r
+dqand804 and  Inf   0     -> NaN Invalid_operation\r
+dqand805 and  Inf   1     -> NaN Invalid_operation\r
+dqand806 and  Inf   1000  -> NaN Invalid_operation\r
+dqand807 and  Inf   Inf   -> NaN Invalid_operation\r
+dqand808 and -1000  Inf   -> NaN Invalid_operation\r
+dqand809 and -Inf   Inf   -> NaN Invalid_operation\r
+dqand810 and -1     Inf   -> NaN Invalid_operation\r
+dqand811 and -0     Inf   -> NaN Invalid_operation\r
+dqand812 and  0     Inf   -> NaN Invalid_operation\r
+dqand813 and  1     Inf   -> NaN Invalid_operation\r
+dqand814 and  1000  Inf   -> NaN Invalid_operation\r
+dqand815 and  Inf   Inf   -> NaN Invalid_operation\r
+\r
+dqand821 and  NaN -Inf    -> NaN Invalid_operation\r
+dqand822 and  NaN -1000   -> NaN Invalid_operation\r
+dqand823 and  NaN -1      -> NaN Invalid_operation\r
+dqand824 and  NaN -0      -> NaN Invalid_operation\r
+dqand825 and  NaN  0      -> NaN Invalid_operation\r
+dqand826 and  NaN  1      -> NaN Invalid_operation\r
+dqand827 and  NaN  1000   -> NaN Invalid_operation\r
+dqand828 and  NaN  Inf    -> NaN Invalid_operation\r
+dqand829 and  NaN  NaN    -> NaN Invalid_operation\r
+dqand830 and -Inf  NaN    -> NaN Invalid_operation\r
+dqand831 and -1000 NaN    -> NaN Invalid_operation\r
+dqand832 and -1    NaN    -> NaN Invalid_operation\r
+dqand833 and -0    NaN    -> NaN Invalid_operation\r
+dqand834 and  0    NaN    -> NaN Invalid_operation\r
+dqand835 and  1    NaN    -> NaN Invalid_operation\r
+dqand836 and  1000 NaN    -> NaN Invalid_operation\r
+dqand837 and  Inf  NaN    -> NaN Invalid_operation\r
+\r
+dqand841 and  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqand842 and  sNaN -1000  ->  NaN  Invalid_operation\r
+dqand843 and  sNaN -1     ->  NaN  Invalid_operation\r
+dqand844 and  sNaN -0     ->  NaN  Invalid_operation\r
+dqand845 and  sNaN  0     ->  NaN  Invalid_operation\r
+dqand846 and  sNaN  1     ->  NaN  Invalid_operation\r
+dqand847 and  sNaN  1000  ->  NaN  Invalid_operation\r
+dqand848 and  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqand849 and  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqand850 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqand851 and -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqand852 and -1000 sNaN   ->  NaN  Invalid_operation\r
+dqand853 and -1    sNaN   ->  NaN  Invalid_operation\r
+dqand854 and -0    sNaN   ->  NaN  Invalid_operation\r
+dqand855 and  0    sNaN   ->  NaN  Invalid_operation\r
+dqand856 and  1    sNaN   ->  NaN  Invalid_operation\r
+dqand857 and  1000 sNaN   ->  NaN  Invalid_operation\r
+dqand858 and  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqand859 and  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqand861 and  NaN1   -Inf    -> NaN Invalid_operation\r
+dqand862 and +NaN2   -1000   -> NaN Invalid_operation\r
+dqand863 and  NaN3    1000   -> NaN Invalid_operation\r
+dqand864 and  NaN4    Inf    -> NaN Invalid_operation\r
+dqand865 and  NaN5   +NaN6   -> NaN Invalid_operation\r
+dqand866 and -Inf     NaN7   -> NaN Invalid_operation\r
+dqand867 and -1000    NaN8   -> NaN Invalid_operation\r
+dqand868 and  1000    NaN9   -> NaN Invalid_operation\r
+dqand869 and  Inf    +NaN10  -> NaN Invalid_operation\r
+dqand871 and  sNaN11  -Inf   -> NaN Invalid_operation\r
+dqand872 and  sNaN12  -1000  -> NaN Invalid_operation\r
+dqand873 and  sNaN13   1000  -> NaN Invalid_operation\r
+dqand874 and  sNaN14   NaN17 -> NaN Invalid_operation\r
+dqand875 and  sNaN15  sNaN18 -> NaN Invalid_operation\r
+dqand876 and  NaN16   sNaN19 -> NaN Invalid_operation\r
+dqand877 and -Inf    +sNaN20 -> NaN Invalid_operation\r
+dqand878 and -1000    sNaN21 -> NaN Invalid_operation\r
+dqand879 and  1000    sNaN22 -> NaN Invalid_operation\r
+dqand880 and  Inf     sNaN23 -> NaN Invalid_operation\r
+dqand881 and +NaN25  +sNaN24 -> NaN Invalid_operation\r
+dqand882 and -NaN26    NaN28 -> NaN Invalid_operation\r
+dqand883 and -sNaN27  sNaN29 -> NaN Invalid_operation\r
+dqand884 and  1000    -NaN30 -> NaN Invalid_operation\r
+dqand885 and  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqBase.decTest b/Lib/test/decimaltestdata/dqBase.decTest
new file mode 100644 (file)
index 0000000..6cf2f7f
--- /dev/null
@@ -0,0 +1,1081 @@
+------------------------------------------------------------------------\r
+-- dqBase.decTest -- base decQuad <--> string conversions             --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This file tests base conversions from string to a decimal number\r
+-- and back to a string (in Scientific form)\r
+\r
+-- Note that unlike other operations the operand is subject to rounding\r
+-- to conform to emax and precision settings (that is, numbers will\r
+-- conform to rules and exponent will be in permitted range).  The\r
+-- 'left hand side', therefore, may have numbers that cannot be\r
+-- represented in a decQuad.  Some testcases go to the limit of the\r
+-- next-wider format, and hence these testcases may also be used to\r
+-- test narrowing and widening operations.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqbas001 toSci       0 -> 0\r
+dqbas002 toSci       1 -> 1\r
+dqbas003 toSci     1.0 -> 1.0\r
+dqbas004 toSci    1.00 -> 1.00\r
+dqbas005 toSci      10 -> 10\r
+dqbas006 toSci    1000 -> 1000\r
+dqbas007 toSci    10.0 -> 10.0\r
+dqbas008 toSci    10.1 -> 10.1\r
+dqbas009 toSci    10.4 -> 10.4\r
+dqbas010 toSci    10.5 -> 10.5\r
+dqbas011 toSci    10.6 -> 10.6\r
+dqbas012 toSci    10.9 -> 10.9\r
+dqbas013 toSci    11.0 -> 11.0\r
+dqbas014 toSci  1.234 -> 1.234\r
+dqbas015 toSci  0.123 -> 0.123\r
+dqbas016 toSci  0.012 -> 0.012\r
+dqbas017 toSci  -0    -> -0\r
+dqbas018 toSci  -0.0  -> -0.0\r
+dqbas019 toSci -00.00 -> -0.00\r
+\r
+dqbas021 toSci     -1 -> -1\r
+dqbas022 toSci   -1.0 -> -1.0\r
+dqbas023 toSci   -0.1 -> -0.1\r
+dqbas024 toSci   -9.1 -> -9.1\r
+dqbas025 toSci   -9.11 -> -9.11\r
+dqbas026 toSci   -9.119 -> -9.119\r
+dqbas027 toSci   -9.999 -> -9.999\r
+\r
+dqbas030 toSci  '123456789.123456'   -> '123456789.123456'\r
+dqbas031 toSci  '123456789.000000'   -> '123456789.000000'\r
+dqbas032 toSci   '123456789123456'   -> '123456789123456'\r
+dqbas033 toSci   '0.0000123456789'   -> '0.0000123456789'\r
+dqbas034 toSci  '0.00000123456789'   -> '0.00000123456789'\r
+dqbas035 toSci '0.000000123456789'   -> '1.23456789E-7'\r
+dqbas036 toSci '0.0000000123456789'  -> '1.23456789E-8'\r
+\r
+dqbas037 toSci '0.123456789012344'   -> '0.123456789012344'\r
+dqbas038 toSci '0.123456789012345'   -> '0.123456789012345'\r
+\r
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)\r
+dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144\r
+dqbsn002 toSci -1E-6143 -> -1E-6143\r
+dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal\r
+dqbsn004 toSci -0 -> -0\r
+dqbsn005 toSci +0 ->  0\r
+dqbsn006 toSci +1E-6176 ->  1E-6176 Subnormal\r
+dqbsn007 toSci +1E-6143 ->  1E-6143\r
+dqbsn008 toSci +9.999999999999999999999999999999999E+6144 ->  9.999999999999999999999999999999999E+6144\r
+\r
+-- String [many more examples are implicitly tested elsewhere]\r
+-- strings without E cannot generate E in result\r
+dqbas040 toSci "12"        -> '12'\r
+dqbas041 toSci "-76"       -> '-76'\r
+dqbas042 toSci "12.76"     -> '12.76'\r
+dqbas043 toSci "+12.76"    -> '12.76'\r
+dqbas044 toSci "012.76"    -> '12.76'\r
+dqbas045 toSci "+0.003"    -> '0.003'\r
+dqbas046 toSci "17."       -> '17'\r
+dqbas047 toSci ".5"        -> '0.5'\r
+dqbas048 toSci "044"       -> '44'\r
+dqbas049 toSci "0044"      -> '44'\r
+dqbas050 toSci "0.0005"      -> '0.0005'\r
+dqbas051 toSci "00.00005"    -> '0.00005'\r
+dqbas052 toSci "0.000005"    -> '0.000005'\r
+dqbas053 toSci "0.0000050"   -> '0.0000050'\r
+dqbas054 toSci "0.0000005"   -> '5E-7'\r
+dqbas055 toSci "0.00000005"  -> '5E-8'\r
+dqbas056 toSci "12345678.543210" -> '12345678.543210'\r
+dqbas057 toSci "2345678.543210" -> '2345678.543210'\r
+dqbas058 toSci "345678.543210" -> '345678.543210'\r
+dqbas059 toSci "0345678.54321" -> '345678.54321'\r
+dqbas060 toSci "345678.5432" -> '345678.5432'\r
+dqbas061 toSci "+345678.5432" -> '345678.5432'\r
+dqbas062 toSci "+0345678.5432" -> '345678.5432'\r
+dqbas063 toSci "+00345678.5432" -> '345678.5432'\r
+dqbas064 toSci "-345678.5432"  -> '-345678.5432'\r
+dqbas065 toSci "-0345678.5432"  -> '-345678.5432'\r
+dqbas066 toSci "-00345678.5432"  -> '-345678.5432'\r
+-- examples\r
+dqbas067 toSci "5E-6"        -> '0.000005'\r
+dqbas068 toSci "50E-7"       -> '0.0000050'\r
+dqbas069 toSci "5E-7"        -> '5E-7'\r
+\r
+-- [No exotics as no Unicode]\r
+\r
+-- rounded with dots in all (including edge) places\r
+dqbas071 toSci  .1234567891234567890123456780123456123  -> 0.1234567891234567890123456780123456 Inexact Rounded\r
+dqbas072 toSci  1.234567891234567890123456780123456123  ->  1.234567891234567890123456780123456 Inexact Rounded\r
+dqbas073 toSci  12.34567891234567890123456780123456123  ->  12.34567891234567890123456780123456 Inexact Rounded\r
+dqbas074 toSci  123.4567891234567890123456780123456123  ->  123.4567891234567890123456780123456 Inexact Rounded\r
+dqbas075 toSci  1234.567891234567890123456780123456123  ->  1234.567891234567890123456780123456 Inexact Rounded\r
+dqbas076 toSci  12345.67891234567890123456780123456123  ->  12345.67891234567890123456780123456 Inexact Rounded\r
+dqbas077 toSci  123456.7891234567890123456780123456123  ->  123456.7891234567890123456780123456 Inexact Rounded\r
+dqbas078 toSci  1234567.891234567890123456780123456123  ->  1234567.891234567890123456780123456 Inexact Rounded\r
+dqbas079 toSci  12345678.91234567890123456780123456123  ->  12345678.91234567890123456780123456 Inexact Rounded\r
+dqbas080 toSci  123456789.1234567890123456780123456123  ->  123456789.1234567890123456780123456 Inexact Rounded\r
+dqbas081 toSci  1234567891.234567890123456780123456123  ->  1234567891.234567890123456780123456 Inexact Rounded\r
+dqbas082 toSci  12345678912.34567890123456780123456123  ->  12345678912.34567890123456780123456 Inexact Rounded\r
+dqbas083 toSci  123456789123.4567890123456780123456123  ->  123456789123.4567890123456780123456 Inexact Rounded\r
+dqbas084 toSci  1234567891234.567890123456780123456123  ->  1234567891234.567890123456780123456 Inexact Rounded\r
+dqbas085 toSci  12345678912345.67890123456780123456123  ->  12345678912345.67890123456780123456 Inexact Rounded\r
+dqbas086 toSci  123456789123456.7890123456780123456123  ->  123456789123456.7890123456780123456 Inexact Rounded\r
+dqbas087 toSci  1234567891234567.890123456780123456123  ->  1234567891234567.890123456780123456 Inexact Rounded\r
+dqbas088 toSci  12345678912345678.90123456780123456123  ->  12345678912345678.90123456780123456 Inexact Rounded\r
+dqbas089 toSci  123456789123456789.0123456780123456123  ->  123456789123456789.0123456780123456 Inexact Rounded\r
+dqbas090 toSci  1234567891234567890.123456780123456123  ->  1234567891234567890.123456780123456 Inexact Rounded\r
+dqbas091 toSci  12345678912345678901.23456780123456123  ->  12345678912345678901.23456780123456 Inexact Rounded\r
+dqbas092 toSci  123456789123456789012.3456780123456123  ->  123456789123456789012.3456780123456 Inexact Rounded\r
+dqbas093 toSci  1234567891234567890123.456780123456123  ->  1234567891234567890123.456780123456 Inexact Rounded\r
+dqbas094 toSci  12345678912345678901234.56780123456123  ->  12345678912345678901234.56780123456 Inexact Rounded\r
+dqbas095 toSci  123456789123456789012345.6780123456123  ->  123456789123456789012345.6780123456 Inexact Rounded\r
+dqbas096 toSci  1234567891234567890123456.780123456123  ->  1234567891234567890123456.780123456 Inexact Rounded\r
+dqbas097 toSci  12345678912345678901234567.80123456123  ->  12345678912345678901234567.80123456 Inexact Rounded\r
+dqbas098 toSci  123456789123456789012345678.0123456123  ->  123456789123456789012345678.0123456 Inexact Rounded\r
+dqbas099 toSci  1234567891234567890123456780.123456123  ->  1234567891234567890123456780.123456 Inexact Rounded\r
+dqbas100 toSci  12345678912345678901234567801.23456123  ->  12345678912345678901234567801.23456 Inexact Rounded\r
+dqbas101 toSci  123456789123456789012345678012.3456123  ->  123456789123456789012345678012.3456 Inexact Rounded\r
+dqbas102 toSci  1234567891234567890123456780123.456123  ->  1234567891234567890123456780123.456 Inexact Rounded\r
+dqbas103 toSci  12345678912345678901234567801234.56123  ->  12345678912345678901234567801234.56 Inexact Rounded\r
+dqbas104 toSci  123456789123456789012345678012345.6123  ->  123456789123456789012345678012345.6 Inexact Rounded\r
+dqbas105 toSci  1234567891234567890123456780123456.123  ->  1234567891234567890123456780123456  Inexact Rounded\r
+dqbas106 toSci  12345678912345678901234567801234561.23  ->  1.234567891234567890123456780123456E+34 Inexact Rounded\r
+dqbas107 toSci  123456789123456789012345678012345612.3  ->  1.234567891234567890123456780123456E+35 Inexact Rounded\r
+dqbas108 toSci  1234567891234567890123456780123456123.  ->  1.234567891234567890123456780123456E+36 Inexact Rounded\r
+-- 123456789012345678\r
+\r
+-- Numbers with E\r
+dqbas130 toSci "0.000E-1"  -> '0.0000'\r
+dqbas131 toSci "0.000E-2"  -> '0.00000'\r
+dqbas132 toSci "0.000E-3"  -> '0.000000'\r
+dqbas133 toSci "0.000E-4"  -> '0E-7'\r
+dqbas134 toSci "0.00E-2"   -> '0.0000'\r
+dqbas135 toSci "0.00E-3"   -> '0.00000'\r
+dqbas136 toSci "0.00E-4"   -> '0.000000'\r
+dqbas137 toSci "0.00E-5"   -> '0E-7'\r
+dqbas138 toSci "+0E+9"     -> '0E+9'\r
+dqbas139 toSci "-0E+9"     -> '-0E+9'\r
+dqbas140 toSci "1E+9"      -> '1E+9'\r
+dqbas141 toSci "1e+09"     -> '1E+9'\r
+dqbas142 toSci "1E+90"     -> '1E+90'\r
+dqbas143 toSci "+1E+009"   -> '1E+9'\r
+dqbas144 toSci "0E+9"      -> '0E+9'\r
+dqbas145 toSci "1E+9"      -> '1E+9'\r
+dqbas146 toSci "1E+09"     -> '1E+9'\r
+dqbas147 toSci "1e+90"     -> '1E+90'\r
+dqbas148 toSci "1E+009"    -> '1E+9'\r
+dqbas149 toSci "000E+9"    -> '0E+9'\r
+dqbas150 toSci "1E9"       -> '1E+9'\r
+dqbas151 toSci "1e09"      -> '1E+9'\r
+dqbas152 toSci "1E90"      -> '1E+90'\r
+dqbas153 toSci "1E009"     -> '1E+9'\r
+dqbas154 toSci "0E9"       -> '0E+9'\r
+dqbas155 toSci "0.000e+0"  -> '0.000'\r
+dqbas156 toSci "0.000E-1"  -> '0.0000'\r
+dqbas157 toSci "4E+9"      -> '4E+9'\r
+dqbas158 toSci "44E+9"     -> '4.4E+10'\r
+dqbas159 toSci "0.73e-7"   -> '7.3E-8'\r
+dqbas160 toSci "00E+9"     -> '0E+9'\r
+dqbas161 toSci "00E-9"     -> '0E-9'\r
+dqbas162 toSci "10E+9"     -> '1.0E+10'\r
+dqbas163 toSci "10E+09"    -> '1.0E+10'\r
+dqbas164 toSci "10e+90"    -> '1.0E+91'\r
+dqbas165 toSci "10E+009"   -> '1.0E+10'\r
+dqbas166 toSci "100e+9"    -> '1.00E+11'\r
+dqbas167 toSci "100e+09"   -> '1.00E+11'\r
+dqbas168 toSci "100E+90"   -> '1.00E+92'\r
+dqbas169 toSci "100e+009"  -> '1.00E+11'\r
+\r
+dqbas170 toSci "1.265"     -> '1.265'\r
+dqbas171 toSci "1.265E-20" -> '1.265E-20'\r
+dqbas172 toSci "1.265E-8"  -> '1.265E-8'\r
+dqbas173 toSci "1.265E-4"  -> '0.0001265'\r
+dqbas174 toSci "1.265E-3"  -> '0.001265'\r
+dqbas175 toSci "1.265E-2"  -> '0.01265'\r
+dqbas176 toSci "1.265E-1"  -> '0.1265'\r
+dqbas177 toSci "1.265E-0"  -> '1.265'\r
+dqbas178 toSci "1.265E+1"  -> '12.65'\r
+dqbas179 toSci "1.265E+2"  -> '126.5'\r
+dqbas180 toSci "1.265E+3"  -> '1265'\r
+dqbas181 toSci "1.265E+4"  -> '1.265E+4'\r
+dqbas182 toSci "1.265E+8"  -> '1.265E+8'\r
+dqbas183 toSci "1.265E+20" -> '1.265E+20'\r
+\r
+dqbas190 toSci "12.65"     -> '12.65'\r
+dqbas191 toSci "12.65E-20" -> '1.265E-19'\r
+dqbas192 toSci "12.65E-8"  -> '1.265E-7'\r
+dqbas193 toSci "12.65E-4"  -> '0.001265'\r
+dqbas194 toSci "12.65E-3"  -> '0.01265'\r
+dqbas195 toSci "12.65E-2"  -> '0.1265'\r
+dqbas196 toSci "12.65E-1"  -> '1.265'\r
+dqbas197 toSci "12.65E-0"  -> '12.65'\r
+dqbas198 toSci "12.65E+1"  -> '126.5'\r
+dqbas199 toSci "12.65E+2"  -> '1265'\r
+dqbas200 toSci "12.65E+3"  -> '1.265E+4'\r
+dqbas201 toSci "12.65E+4"  -> '1.265E+5'\r
+dqbas202 toSci "12.65E+8"  -> '1.265E+9'\r
+dqbas203 toSci "12.65E+20" -> '1.265E+21'\r
+\r
+dqbas210 toSci "126.5"     -> '126.5'\r
+dqbas211 toSci "126.5E-20" -> '1.265E-18'\r
+dqbas212 toSci "126.5E-8"  -> '0.000001265'\r
+dqbas213 toSci "126.5E-4"  -> '0.01265'\r
+dqbas214 toSci "126.5E-3"  -> '0.1265'\r
+dqbas215 toSci "126.5E-2"  -> '1.265'\r
+dqbas216 toSci "126.5E-1"  -> '12.65'\r
+dqbas217 toSci "126.5E-0"  -> '126.5'\r
+dqbas218 toSci "126.5E+1"  -> '1265'\r
+dqbas219 toSci "126.5E+2"  -> '1.265E+4'\r
+dqbas220 toSci "126.5E+3"  -> '1.265E+5'\r
+dqbas221 toSci "126.5E+4"  -> '1.265E+6'\r
+dqbas222 toSci "126.5E+8"  -> '1.265E+10'\r
+dqbas223 toSci "126.5E+20" -> '1.265E+22'\r
+\r
+dqbas230 toSci "1265"     -> '1265'\r
+dqbas231 toSci "1265E-20" -> '1.265E-17'\r
+dqbas232 toSci "1265E-8"  -> '0.00001265'\r
+dqbas233 toSci "1265E-4"  -> '0.1265'\r
+dqbas234 toSci "1265E-3"  -> '1.265'\r
+dqbas235 toSci "1265E-2"  -> '12.65'\r
+dqbas236 toSci "1265E-1"  -> '126.5'\r
+dqbas237 toSci "1265E-0"  -> '1265'\r
+dqbas238 toSci "1265E+1"  -> '1.265E+4'\r
+dqbas239 toSci "1265E+2"  -> '1.265E+5'\r
+dqbas240 toSci "1265E+3"  -> '1.265E+6'\r
+dqbas241 toSci "1265E+4"  -> '1.265E+7'\r
+dqbas242 toSci "1265E+8"  -> '1.265E+11'\r
+dqbas243 toSci "1265E+20" -> '1.265E+23'\r
+\r
+dqbas250 toSci "0.1265"     -> '0.1265'\r
+dqbas251 toSci "0.1265E-20" -> '1.265E-21'\r
+dqbas252 toSci "0.1265E-8"  -> '1.265E-9'\r
+dqbas253 toSci "0.1265E-4"  -> '0.00001265'\r
+dqbas254 toSci "0.1265E-3"  -> '0.0001265'\r
+dqbas255 toSci "0.1265E-2"  -> '0.001265'\r
+dqbas256 toSci "0.1265E-1"  -> '0.01265'\r
+dqbas257 toSci "0.1265E-0"  -> '0.1265'\r
+dqbas258 toSci "0.1265E+1"  -> '1.265'\r
+dqbas259 toSci "0.1265E+2"  -> '12.65'\r
+dqbas260 toSci "0.1265E+3"  -> '126.5'\r
+dqbas261 toSci "0.1265E+4"  -> '1265'\r
+dqbas262 toSci "0.1265E+8"  -> '1.265E+7'\r
+dqbas263 toSci "0.1265E+20" -> '1.265E+19'\r
+\r
+-- some more negative zeros [systematic tests below]\r
+dqbas290 toSci "-0.000E-1"  -> '-0.0000'\r
+dqbas291 toSci "-0.000E-2"  -> '-0.00000'\r
+dqbas292 toSci "-0.000E-3"  -> '-0.000000'\r
+dqbas293 toSci "-0.000E-4"  -> '-0E-7'\r
+dqbas294 toSci "-0.00E-2"   -> '-0.0000'\r
+dqbas295 toSci "-0.00E-3"   -> '-0.00000'\r
+dqbas296 toSci "-0.0E-2"    -> '-0.000'\r
+dqbas297 toSci "-0.0E-3"    -> '-0.0000'\r
+dqbas298 toSci "-0E-2"      -> '-0.00'\r
+dqbas299 toSci "-0E-3"      -> '-0.000'\r
+\r
+-- Engineering notation tests\r
+dqbas301  toSci 10e12  -> 1.0E+13\r
+dqbas302  toEng 10e12  -> 10E+12\r
+dqbas303  toSci 10e11  -> 1.0E+12\r
+dqbas304  toEng 10e11  -> 1.0E+12\r
+dqbas305  toSci 10e10  -> 1.0E+11\r
+dqbas306  toEng 10e10  -> 100E+9\r
+dqbas307  toSci 10e9   -> 1.0E+10\r
+dqbas308  toEng 10e9   -> 10E+9\r
+dqbas309  toSci 10e8   -> 1.0E+9\r
+dqbas310  toEng 10e8   -> 1.0E+9\r
+dqbas311  toSci 10e7   -> 1.0E+8\r
+dqbas312  toEng 10e7   -> 100E+6\r
+dqbas313  toSci 10e6   -> 1.0E+7\r
+dqbas314  toEng 10e6   -> 10E+6\r
+dqbas315  toSci 10e5   -> 1.0E+6\r
+dqbas316  toEng 10e5   -> 1.0E+6\r
+dqbas317  toSci 10e4   -> 1.0E+5\r
+dqbas318  toEng 10e4   -> 100E+3\r
+dqbas319  toSci 10e3   -> 1.0E+4\r
+dqbas320  toEng 10e3   -> 10E+3\r
+dqbas321  toSci 10e2   -> 1.0E+3\r
+dqbas322  toEng 10e2   -> 1.0E+3\r
+dqbas323  toSci 10e1   -> 1.0E+2\r
+dqbas324  toEng 10e1   -> 100\r
+dqbas325  toSci 10e0   -> 10\r
+dqbas326  toEng 10e0   -> 10\r
+dqbas327  toSci 10e-1  -> 1.0\r
+dqbas328  toEng 10e-1  -> 1.0\r
+dqbas329  toSci 10e-2  -> 0.10\r
+dqbas330  toEng 10e-2  -> 0.10\r
+dqbas331  toSci 10e-3  -> 0.010\r
+dqbas332  toEng 10e-3  -> 0.010\r
+dqbas333  toSci 10e-4  -> 0.0010\r
+dqbas334  toEng 10e-4  -> 0.0010\r
+dqbas335  toSci 10e-5  -> 0.00010\r
+dqbas336  toEng 10e-5  -> 0.00010\r
+dqbas337  toSci 10e-6  -> 0.000010\r
+dqbas338  toEng 10e-6  -> 0.000010\r
+dqbas339  toSci 10e-7  -> 0.0000010\r
+dqbas340  toEng 10e-7  -> 0.0000010\r
+dqbas341  toSci 10e-8  -> 1.0E-7\r
+dqbas342  toEng 10e-8  -> 100E-9\r
+dqbas343  toSci 10e-9  -> 1.0E-8\r
+dqbas344  toEng 10e-9  -> 10E-9\r
+dqbas345  toSci 10e-10 -> 1.0E-9\r
+dqbas346  toEng 10e-10 -> 1.0E-9\r
+dqbas347  toSci 10e-11 -> 1.0E-10\r
+dqbas348  toEng 10e-11 -> 100E-12\r
+dqbas349  toSci 10e-12 -> 1.0E-11\r
+dqbas350  toEng 10e-12 -> 10E-12\r
+dqbas351  toSci 10e-13 -> 1.0E-12\r
+dqbas352  toEng 10e-13 -> 1.0E-12\r
+\r
+dqbas361  toSci 7E12  -> 7E+12\r
+dqbas362  toEng 7E12  -> 7E+12\r
+dqbas363  toSci 7E11  -> 7E+11\r
+dqbas364  toEng 7E11  -> 700E+9\r
+dqbas365  toSci 7E10  -> 7E+10\r
+dqbas366  toEng 7E10  -> 70E+9\r
+dqbas367  toSci 7E9   -> 7E+9\r
+dqbas368  toEng 7E9   -> 7E+9\r
+dqbas369  toSci 7E8   -> 7E+8\r
+dqbas370  toEng 7E8   -> 700E+6\r
+dqbas371  toSci 7E7   -> 7E+7\r
+dqbas372  toEng 7E7   -> 70E+6\r
+dqbas373  toSci 7E6   -> 7E+6\r
+dqbas374  toEng 7E6   -> 7E+6\r
+dqbas375  toSci 7E5   -> 7E+5\r
+dqbas376  toEng 7E5   -> 700E+3\r
+dqbas377  toSci 7E4   -> 7E+4\r
+dqbas378  toEng 7E4   -> 70E+3\r
+dqbas379  toSci 7E3   -> 7E+3\r
+dqbas380  toEng 7E3   -> 7E+3\r
+dqbas381  toSci 7E2   -> 7E+2\r
+dqbas382  toEng 7E2   -> 700\r
+dqbas383  toSci 7E1   -> 7E+1\r
+dqbas384  toEng 7E1   -> 70\r
+dqbas385  toSci 7E0   -> 7\r
+dqbas386  toEng 7E0   -> 7\r
+dqbas387  toSci 7E-1  -> 0.7\r
+dqbas388  toEng 7E-1  -> 0.7\r
+dqbas389  toSci 7E-2  -> 0.07\r
+dqbas390  toEng 7E-2  -> 0.07\r
+dqbas391  toSci 7E-3  -> 0.007\r
+dqbas392  toEng 7E-3  -> 0.007\r
+dqbas393  toSci 7E-4  -> 0.0007\r
+dqbas394  toEng 7E-4  -> 0.0007\r
+dqbas395  toSci 7E-5  -> 0.00007\r
+dqbas396  toEng 7E-5  -> 0.00007\r
+dqbas397  toSci 7E-6  -> 0.000007\r
+dqbas398  toEng 7E-6  -> 0.000007\r
+dqbas399  toSci 7E-7  -> 7E-7\r
+dqbas400  toEng 7E-7  -> 700E-9\r
+dqbas401  toSci 7E-8  -> 7E-8\r
+dqbas402  toEng 7E-8  -> 70E-9\r
+dqbas403  toSci 7E-9  -> 7E-9\r
+dqbas404  toEng 7E-9  -> 7E-9\r
+dqbas405  toSci 7E-10 -> 7E-10\r
+dqbas406  toEng 7E-10 -> 700E-12\r
+dqbas407  toSci 7E-11 -> 7E-11\r
+dqbas408  toEng 7E-11 -> 70E-12\r
+dqbas409  toSci 7E-12 -> 7E-12\r
+dqbas410  toEng 7E-12 -> 7E-12\r
+dqbas411  toSci 7E-13 -> 7E-13\r
+dqbas412  toEng 7E-13 -> 700E-15\r
+\r
+-- Exacts remain exact up to precision ..\r
+dqbas420  toSci    100 -> 100\r
+dqbas422  toSci   1000 -> 1000\r
+dqbas424  toSci  999.9 ->  999.9\r
+dqbas426  toSci 1000.0 -> 1000.0\r
+dqbas428  toSci 1000.1 -> 1000.1\r
+dqbas430  toSci 10000 -> 10000\r
+dqbas432  toSci 1000000000000000000000000000000        -> 1000000000000000000000000000000\r
+dqbas434  toSci 10000000000000000000000000000000       -> 10000000000000000000000000000000\r
+dqbas436  toSci 100000000000000000000000000000000      -> 100000000000000000000000000000000\r
+dqbas438  toSci 1000000000000000000000000000000000     -> 1000000000000000000000000000000000\r
+dqbas440  toSci 10000000000000000000000000000000000    -> 1.000000000000000000000000000000000E+34   Rounded\r
+dqbas442  toSci 10000000000000000000000000000000000    -> 1.000000000000000000000000000000000E+34   Rounded\r
+dqbas444  toSci 10000000000000000000000000000000003    -> 1.000000000000000000000000000000000E+34   Rounded Inexact\r
+dqbas446  toSci 10000000000000000000000000000000005    -> 1.000000000000000000000000000000000E+34   Rounded Inexact\r
+dqbas448  toSci 100000000000000000000000000000000050   -> 1.000000000000000000000000000000000E+35   Rounded Inexact\r
+dqbas450  toSci 10000000000000000000000000000000009    -> 1.000000000000000000000000000000001E+34   Rounded Inexact\r
+dqbas452  toSci 100000000000000000000000000000000000   -> 1.000000000000000000000000000000000E+35   Rounded\r
+dqbas454  toSci 100000000000000000000000000000000003   -> 1.000000000000000000000000000000000E+35   Rounded Inexact\r
+dqbas456  toSci 100000000000000000000000000000000005   -> 1.000000000000000000000000000000000E+35   Rounded Inexact\r
+dqbas458  toSci 100000000000000000000000000000000009   -> 1.000000000000000000000000000000000E+35   Rounded Inexact\r
+dqbas460  toSci 1000000000000000000000000000000000000  -> 1.000000000000000000000000000000000E+36   Rounded\r
+dqbas462  toSci 1000000000000000000000000000000000300  -> 1.000000000000000000000000000000000E+36   Rounded Inexact\r
+dqbas464  toSci 1000000000000000000000000000000000500  -> 1.000000000000000000000000000000000E+36   Rounded Inexact\r
+dqbas466  toSci 1000000000000000000000000000000000900  -> 1.000000000000000000000000000000001E+36   Rounded Inexact\r
+dqbas468  toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37   Rounded\r
+dqbas470  toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37   Rounded Inexact\r
+dqbas472  toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37   Rounded Inexact\r
+dqbas474  toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37   Rounded Inexact\r
+\r
+-- check rounding modes heeded\r
+rounding:  ceiling\r
+dqbsr401  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr402  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr403  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr404  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  up\r
+dqbsr405  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr406  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr407  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr408  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  floor\r
+dqbsr410  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr411  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr412  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr413  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+rounding:  half_down\r
+dqbsr415  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr416  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr417  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr418  toSci  1.11111111111111111111111111111234650   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr419  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  half_even\r
+dqbsr421  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr422  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr423  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr424  toSci  1.11111111111111111111111111111234650   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr425  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  down\r
+dqbsr426  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr427  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr428  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr429  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+rounding:  half_up\r
+dqbsr431  toSci  1.1111111111111111111111111111123450    ->  1.111111111111111111111111111112345  Rounded\r
+dqbsr432  toSci  1.11111111111111111111111111111234549   ->  1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr433  toSci  1.11111111111111111111111111111234550   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr434  toSci  1.11111111111111111111111111111234650   ->  1.111111111111111111111111111112347  Rounded Inexact\r
+dqbsr435  toSci  1.11111111111111111111111111111234551   ->  1.111111111111111111111111111112346  Rounded Inexact\r
+-- negatives\r
+rounding:  ceiling\r
+dqbsr501  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr502  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr503  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr504  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+rounding:  up\r
+dqbsr505  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr506  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr507  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr508  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  floor\r
+dqbsr510  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr511  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr512  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr513  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  half_down\r
+dqbsr515  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr516  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr517  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr518  toSci -1.11111111111111111111111111111234650   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr519  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  half_even\r
+dqbsr521  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr522  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr523  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr524  toSci -1.11111111111111111111111111111234650   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr525  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+rounding:  down\r
+dqbsr526  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr527  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr528  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr529  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+rounding:  half_up\r
+dqbsr531  toSci -1.1111111111111111111111111111123450    -> -1.111111111111111111111111111112345  Rounded\r
+dqbsr532  toSci -1.11111111111111111111111111111234549   -> -1.111111111111111111111111111112345  Rounded Inexact\r
+dqbsr533  toSci -1.11111111111111111111111111111234550   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+dqbsr534  toSci -1.11111111111111111111111111111234650   -> -1.111111111111111111111111111112347  Rounded Inexact\r
+dqbsr535  toSci -1.11111111111111111111111111111234551   -> -1.111111111111111111111111111112346  Rounded Inexact\r
+\r
+rounding:    half_even\r
+\r
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones\r
+dqbas500 toSci '1..2'            -> NaN Conversion_syntax\r
+dqbas501 toSci '.'               -> NaN Conversion_syntax\r
+dqbas502 toSci '..'              -> NaN Conversion_syntax\r
+dqbas503 toSci '++1'             -> NaN Conversion_syntax\r
+dqbas504 toSci '--1'             -> NaN Conversion_syntax\r
+dqbas505 toSci '-+1'             -> NaN Conversion_syntax\r
+dqbas506 toSci '+-1'             -> NaN Conversion_syntax\r
+dqbas507 toSci '12e'             -> NaN Conversion_syntax\r
+dqbas508 toSci '12e++'           -> NaN Conversion_syntax\r
+dqbas509 toSci '12f4'            -> NaN Conversion_syntax\r
+dqbas510 toSci ' +1'             -> NaN Conversion_syntax\r
+dqbas511 toSci '+ 1'             -> NaN Conversion_syntax\r
+dqbas512 toSci '12 '             -> NaN Conversion_syntax\r
+dqbas513 toSci ' + 1'            -> NaN Conversion_syntax\r
+dqbas514 toSci ' - 1 '           -> NaN Conversion_syntax\r
+dqbas515 toSci 'x'               -> NaN Conversion_syntax\r
+dqbas516 toSci '-1-'             -> NaN Conversion_syntax\r
+dqbas517 toSci '12-'             -> NaN Conversion_syntax\r
+dqbas518 toSci '3+'              -> NaN Conversion_syntax\r
+dqbas519 toSci ''                -> NaN Conversion_syntax\r
+dqbas520 toSci '1e-'             -> NaN Conversion_syntax\r
+dqbas521 toSci '7e99999a'        -> NaN Conversion_syntax\r
+dqbas522 toSci '7e123567890x'    -> NaN Conversion_syntax\r
+dqbas523 toSci '7e12356789012x'  -> NaN Conversion_syntax\r
+dqbas524 toSci ''                -> NaN Conversion_syntax\r
+dqbas525 toSci 'e100'            -> NaN Conversion_syntax\r
+dqbas526 toSci '\u0e5a'          -> NaN Conversion_syntax\r
+dqbas527 toSci '\u0b65'          -> NaN Conversion_syntax\r
+dqbas528 toSci '123,65'          -> NaN Conversion_syntax\r
+dqbas529 toSci '1.34.5'          -> NaN Conversion_syntax\r
+dqbas530 toSci '.123.5'          -> NaN Conversion_syntax\r
+dqbas531 toSci '01.35.'          -> NaN Conversion_syntax\r
+dqbas532 toSci '01.35-'          -> NaN Conversion_syntax\r
+dqbas533 toSci '0000..'          -> NaN Conversion_syntax\r
+dqbas534 toSci '.0000.'          -> NaN Conversion_syntax\r
+dqbas535 toSci '00..00'          -> NaN Conversion_syntax\r
+dqbas536 toSci '111e*123'        -> NaN Conversion_syntax\r
+dqbas537 toSci '111e123-'        -> NaN Conversion_syntax\r
+dqbas538 toSci '111e+12+'        -> NaN Conversion_syntax\r
+dqbas539 toSci '111e1-3-'        -> NaN Conversion_syntax\r
+dqbas540 toSci '111e1*23'        -> NaN Conversion_syntax\r
+dqbas541 toSci '111e1e+3'        -> NaN Conversion_syntax\r
+dqbas542 toSci '1e1.0'           -> NaN Conversion_syntax\r
+dqbas543 toSci '1e123e'          -> NaN Conversion_syntax\r
+dqbas544 toSci 'ten'             -> NaN Conversion_syntax\r
+dqbas545 toSci 'ONE'             -> NaN Conversion_syntax\r
+dqbas546 toSci '1e.1'            -> NaN Conversion_syntax\r
+dqbas547 toSci '1e1.'            -> NaN Conversion_syntax\r
+dqbas548 toSci '1ee'             -> NaN Conversion_syntax\r
+dqbas549 toSci 'e+1'             -> NaN Conversion_syntax\r
+dqbas550 toSci '1.23.4'          -> NaN Conversion_syntax\r
+dqbas551 toSci '1.2.1'           -> NaN Conversion_syntax\r
+dqbas552 toSci '1E+1.2'          -> NaN Conversion_syntax\r
+dqbas553 toSci '1E+1.2.3'        -> NaN Conversion_syntax\r
+dqbas554 toSci '1E++1'           -> NaN Conversion_syntax\r
+dqbas555 toSci '1E--1'           -> NaN Conversion_syntax\r
+dqbas556 toSci '1E+-1'           -> NaN Conversion_syntax\r
+dqbas557 toSci '1E-+1'           -> NaN Conversion_syntax\r
+dqbas558 toSci '1E''1'           -> NaN Conversion_syntax\r
+dqbas559 toSci "1E""1"           -> NaN Conversion_syntax\r
+dqbas560 toSci "1E"""""          -> NaN Conversion_syntax\r
+-- Near-specials\r
+dqbas561 toSci "qNaN"            -> NaN Conversion_syntax\r
+dqbas562 toSci "NaNq"            -> NaN Conversion_syntax\r
+dqbas563 toSci "NaNs"            -> NaN Conversion_syntax\r
+dqbas564 toSci "Infi"            -> NaN Conversion_syntax\r
+dqbas565 toSci "Infin"           -> NaN Conversion_syntax\r
+dqbas566 toSci "Infini"          -> NaN Conversion_syntax\r
+dqbas567 toSci "Infinit"         -> NaN Conversion_syntax\r
+dqbas568 toSci "-Infinit"        -> NaN Conversion_syntax\r
+dqbas569 toSci "0Inf"            -> NaN Conversion_syntax\r
+dqbas570 toSci "9Inf"            -> NaN Conversion_syntax\r
+dqbas571 toSci "-0Inf"           -> NaN Conversion_syntax\r
+dqbas572 toSci "-9Inf"           -> NaN Conversion_syntax\r
+dqbas573 toSci "-sNa"            -> NaN Conversion_syntax\r
+dqbas574 toSci "xNaN"            -> NaN Conversion_syntax\r
+dqbas575 toSci "0sNaN"           -> NaN Conversion_syntax\r
+\r
+-- some baddies with dots and Es and dots and specials\r
+dqbas576 toSci  'e+1'            ->  NaN Conversion_syntax\r
+dqbas577 toSci  '.e+1'           ->  NaN Conversion_syntax\r
+dqbas578 toSci  '+.e+1'          ->  NaN Conversion_syntax\r
+dqbas579 toSci  '-.e+'           ->  NaN Conversion_syntax\r
+dqbas580 toSci  '-.e'            ->  NaN Conversion_syntax\r
+dqbas581 toSci  'E+1'            ->  NaN Conversion_syntax\r
+dqbas582 toSci  '.E+1'           ->  NaN Conversion_syntax\r
+dqbas583 toSci  '+.E+1'          ->  NaN Conversion_syntax\r
+dqbas584 toSci  '-.E+'           ->  NaN Conversion_syntax\r
+dqbas585 toSci  '-.E'            ->  NaN Conversion_syntax\r
+\r
+dqbas586 toSci  '.NaN'           ->  NaN Conversion_syntax\r
+dqbas587 toSci  '-.NaN'          ->  NaN Conversion_syntax\r
+dqbas588 toSci  '+.sNaN'         ->  NaN Conversion_syntax\r
+dqbas589 toSci  '+.Inf'          ->  NaN Conversion_syntax\r
+dqbas590 toSci  '.Infinity'      ->  NaN Conversion_syntax\r
+\r
+-- Zeros\r
+dqbas601 toSci 0.000000000       -> 0E-9\r
+dqbas602 toSci 0.00000000        -> 0E-8\r
+dqbas603 toSci 0.0000000         -> 0E-7\r
+dqbas604 toSci 0.000000          -> 0.000000\r
+dqbas605 toSci 0.00000           -> 0.00000\r
+dqbas606 toSci 0.0000            -> 0.0000\r
+dqbas607 toSci 0.000             -> 0.000\r
+dqbas608 toSci 0.00              -> 0.00\r
+dqbas609 toSci 0.0               -> 0.0\r
+dqbas610 toSci  .0               -> 0.0\r
+dqbas611 toSci 0.                -> 0\r
+dqbas612 toSci -.0               -> -0.0\r
+dqbas613 toSci -0.               -> -0\r
+dqbas614 toSci -0.0              -> -0.0\r
+dqbas615 toSci -0.00             -> -0.00\r
+dqbas616 toSci -0.000            -> -0.000\r
+dqbas617 toSci -0.0000           -> -0.0000\r
+dqbas618 toSci -0.00000          -> -0.00000\r
+dqbas619 toSci -0.000000         -> -0.000000\r
+dqbas620 toSci -0.0000000        -> -0E-7\r
+dqbas621 toSci -0.00000000       -> -0E-8\r
+dqbas622 toSci -0.000000000      -> -0E-9\r
+\r
+dqbas630 toSci  0.00E+0          -> 0.00\r
+dqbas631 toSci  0.00E+1          -> 0.0\r
+dqbas632 toSci  0.00E+2          -> 0\r
+dqbas633 toSci  0.00E+3          -> 0E+1\r
+dqbas634 toSci  0.00E+4          -> 0E+2\r
+dqbas635 toSci  0.00E+5          -> 0E+3\r
+dqbas636 toSci  0.00E+6          -> 0E+4\r
+dqbas637 toSci  0.00E+7          -> 0E+5\r
+dqbas638 toSci  0.00E+8          -> 0E+6\r
+dqbas639 toSci  0.00E+9          -> 0E+7\r
+\r
+dqbas640 toSci  0.0E+0           -> 0.0\r
+dqbas641 toSci  0.0E+1           -> 0\r
+dqbas642 toSci  0.0E+2           -> 0E+1\r
+dqbas643 toSci  0.0E+3           -> 0E+2\r
+dqbas644 toSci  0.0E+4           -> 0E+3\r
+dqbas645 toSci  0.0E+5           -> 0E+4\r
+dqbas646 toSci  0.0E+6           -> 0E+5\r
+dqbas647 toSci  0.0E+7           -> 0E+6\r
+dqbas648 toSci  0.0E+8           -> 0E+7\r
+dqbas649 toSci  0.0E+9           -> 0E+8\r
+\r
+dqbas650 toSci  0E+0             -> 0\r
+dqbas651 toSci  0E+1             -> 0E+1\r
+dqbas652 toSci  0E+2             -> 0E+2\r
+dqbas653 toSci  0E+3             -> 0E+3\r
+dqbas654 toSci  0E+4             -> 0E+4\r
+dqbas655 toSci  0E+5             -> 0E+5\r
+dqbas656 toSci  0E+6             -> 0E+6\r
+dqbas657 toSci  0E+7             -> 0E+7\r
+dqbas658 toSci  0E+8             -> 0E+8\r
+dqbas659 toSci  0E+9             -> 0E+9\r
+\r
+dqbas660 toSci  0.0E-0           -> 0.0\r
+dqbas661 toSci  0.0E-1           -> 0.00\r
+dqbas662 toSci  0.0E-2           -> 0.000\r
+dqbas663 toSci  0.0E-3           -> 0.0000\r
+dqbas664 toSci  0.0E-4           -> 0.00000\r
+dqbas665 toSci  0.0E-5           -> 0.000000\r
+dqbas666 toSci  0.0E-6           -> 0E-7\r
+dqbas667 toSci  0.0E-7           -> 0E-8\r
+dqbas668 toSci  0.0E-8           -> 0E-9\r
+dqbas669 toSci  0.0E-9           -> 0E-10\r
+\r
+dqbas670 toSci  0.00E-0          -> 0.00\r
+dqbas671 toSci  0.00E-1          -> 0.000\r
+dqbas672 toSci  0.00E-2          -> 0.0000\r
+dqbas673 toSci  0.00E-3          -> 0.00000\r
+dqbas674 toSci  0.00E-4          -> 0.000000\r
+dqbas675 toSci  0.00E-5          -> 0E-7\r
+dqbas676 toSci  0.00E-6          -> 0E-8\r
+dqbas677 toSci  0.00E-7          -> 0E-9\r
+dqbas678 toSci  0.00E-8          -> 0E-10\r
+dqbas679 toSci  0.00E-9          -> 0E-11\r
+\r
+dqbas680 toSci  000000.          ->  0\r
+dqbas681 toSci   00000.          ->  0\r
+dqbas682 toSci    0000.          ->  0\r
+dqbas683 toSci     000.          ->  0\r
+dqbas684 toSci      00.          ->  0\r
+dqbas685 toSci       0.          ->  0\r
+dqbas686 toSci  +00000.          ->  0\r
+dqbas687 toSci  -00000.          -> -0\r
+dqbas688 toSci  +0.              ->  0\r
+dqbas689 toSci  -0.              -> -0\r
+\r
+-- Specials\r
+dqbas700 toSci "NaN"             -> NaN\r
+dqbas701 toSci "nan"             -> NaN\r
+dqbas702 toSci "nAn"             -> NaN\r
+dqbas703 toSci "NAN"             -> NaN\r
+dqbas704 toSci "+NaN"            -> NaN\r
+dqbas705 toSci "+nan"            -> NaN\r
+dqbas706 toSci "+nAn"            -> NaN\r
+dqbas707 toSci "+NAN"            -> NaN\r
+dqbas708 toSci "-NaN"            -> -NaN\r
+dqbas709 toSci "-nan"            -> -NaN\r
+dqbas710 toSci "-nAn"            -> -NaN\r
+dqbas711 toSci "-NAN"            -> -NaN\r
+dqbas712 toSci 'NaN0'            -> NaN\r
+dqbas713 toSci 'NaN1'            -> NaN1\r
+dqbas714 toSci 'NaN12'           -> NaN12\r
+dqbas715 toSci 'NaN123'          -> NaN123\r
+dqbas716 toSci 'NaN1234'         -> NaN1234\r
+dqbas717 toSci 'NaN01'           -> NaN1\r
+dqbas718 toSci 'NaN012'          -> NaN12\r
+dqbas719 toSci 'NaN0123'         -> NaN123\r
+dqbas720 toSci 'NaN01234'        -> NaN1234\r
+dqbas721 toSci 'NaN001'          -> NaN1\r
+dqbas722 toSci 'NaN0012'         -> NaN12\r
+dqbas723 toSci 'NaN00123'        -> NaN123\r
+dqbas724 toSci 'NaN001234'       -> NaN1234\r
+dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax\r
+dqbas726 toSci 'NaN123e+1'       -> NaN Conversion_syntax\r
+dqbas727 toSci 'NaN12.45'        -> NaN Conversion_syntax\r
+dqbas728 toSci 'NaN-12'          -> NaN Conversion_syntax\r
+dqbas729 toSci 'NaN+12'          -> NaN Conversion_syntax\r
+\r
+dqbas730 toSci "sNaN"            -> sNaN\r
+dqbas731 toSci "snan"            -> sNaN\r
+dqbas732 toSci "SnAn"            -> sNaN\r
+dqbas733 toSci "SNAN"            -> sNaN\r
+dqbas734 toSci "+sNaN"           -> sNaN\r
+dqbas735 toSci "+snan"           -> sNaN\r
+dqbas736 toSci "+SnAn"           -> sNaN\r
+dqbas737 toSci "+SNAN"           -> sNaN\r
+dqbas738 toSci "-sNaN"           -> -sNaN\r
+dqbas739 toSci "-snan"           -> -sNaN\r
+dqbas740 toSci "-SnAn"           -> -sNaN\r
+dqbas741 toSci "-SNAN"           -> -sNaN\r
+dqbas742 toSci 'sNaN0000'        -> sNaN\r
+dqbas743 toSci 'sNaN7'           -> sNaN7\r
+dqbas744 toSci 'sNaN007234'      -> sNaN7234\r
+dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax\r
+dqbas746 toSci 'sNaN72.45'       -> NaN Conversion_syntax\r
+dqbas747 toSci 'sNaN-72'         -> NaN Conversion_syntax\r
+\r
+dqbas748 toSci "Inf"             -> Infinity\r
+dqbas749 toSci "inf"             -> Infinity\r
+dqbas750 toSci "iNf"             -> Infinity\r
+dqbas751 toSci "INF"             -> Infinity\r
+dqbas752 toSci "+Inf"            -> Infinity\r
+dqbas753 toSci "+inf"            -> Infinity\r
+dqbas754 toSci "+iNf"            -> Infinity\r
+dqbas755 toSci "+INF"            -> Infinity\r
+dqbas756 toSci "-Inf"            -> -Infinity\r
+dqbas757 toSci "-inf"            -> -Infinity\r
+dqbas758 toSci "-iNf"            -> -Infinity\r
+dqbas759 toSci "-INF"            -> -Infinity\r
+\r
+dqbas760 toSci "Infinity"        -> Infinity\r
+dqbas761 toSci "infinity"        -> Infinity\r
+dqbas762 toSci "iNfInItY"        -> Infinity\r
+dqbas763 toSci "INFINITY"        -> Infinity\r
+dqbas764 toSci "+Infinity"       -> Infinity\r
+dqbas765 toSci "+infinity"       -> Infinity\r
+dqbas766 toSci "+iNfInItY"       -> Infinity\r
+dqbas767 toSci "+INFINITY"       -> Infinity\r
+dqbas768 toSci "-Infinity"       -> -Infinity\r
+dqbas769 toSci "-infinity"       -> -Infinity\r
+dqbas770 toSci "-iNfInItY"       -> -Infinity\r
+dqbas771 toSci "-INFINITY"       -> -Infinity\r
+\r
+-- Specials and zeros for toEng\r
+dqbast772 toEng "NaN"              -> NaN\r
+dqbast773 toEng "-Infinity"        -> -Infinity\r
+dqbast774 toEng "-sNaN"            -> -sNaN\r
+dqbast775 toEng "-NaN"             -> -NaN\r
+dqbast776 toEng "+Infinity"        -> Infinity\r
+dqbast778 toEng "+sNaN"            -> sNaN\r
+dqbast779 toEng "+NaN"             -> NaN\r
+dqbast780 toEng "INFINITY"         -> Infinity\r
+dqbast781 toEng "SNAN"             -> sNaN\r
+dqbast782 toEng "NAN"              -> NaN\r
+dqbast783 toEng "infinity"         -> Infinity\r
+dqbast784 toEng "snan"             -> sNaN\r
+dqbast785 toEng "nan"              -> NaN\r
+dqbast786 toEng "InFINITY"         -> Infinity\r
+dqbast787 toEng "SnAN"             -> sNaN\r
+dqbast788 toEng "nAN"              -> NaN\r
+dqbast789 toEng "iNfinity"         -> Infinity\r
+dqbast790 toEng "sNan"             -> sNaN\r
+dqbast791 toEng "Nan"              -> NaN\r
+dqbast792 toEng "Infinity"         -> Infinity\r
+dqbast793 toEng "sNaN"             -> sNaN\r
+\r
+-- Zero toEng, etc.\r
+dqbast800 toEng 0e+1              -> "0.00E+3"  -- doc example\r
+\r
+dqbast801 toEng 0.000000000       -> 0E-9\r
+dqbast802 toEng 0.00000000        -> 0.00E-6\r
+dqbast803 toEng 0.0000000         -> 0.0E-6\r
+dqbast804 toEng 0.000000          -> 0.000000\r
+dqbast805 toEng 0.00000           -> 0.00000\r
+dqbast806 toEng 0.0000            -> 0.0000\r
+dqbast807 toEng 0.000             -> 0.000\r
+dqbast808 toEng 0.00              -> 0.00\r
+dqbast809 toEng 0.0               -> 0.0\r
+dqbast810 toEng  .0               -> 0.0\r
+dqbast811 toEng 0.                -> 0\r
+dqbast812 toEng -.0               -> -0.0\r
+dqbast813 toEng -0.               -> -0\r
+dqbast814 toEng -0.0              -> -0.0\r
+dqbast815 toEng -0.00             -> -0.00\r
+dqbast816 toEng -0.000            -> -0.000\r
+dqbast817 toEng -0.0000           -> -0.0000\r
+dqbast818 toEng -0.00000          -> -0.00000\r
+dqbast819 toEng -0.000000         -> -0.000000\r
+dqbast820 toEng -0.0000000        -> -0.0E-6\r
+dqbast821 toEng -0.00000000       -> -0.00E-6\r
+dqbast822 toEng -0.000000000      -> -0E-9\r
+\r
+dqbast830 toEng  0.00E+0          -> 0.00\r
+dqbast831 toEng  0.00E+1          -> 0.0\r
+dqbast832 toEng  0.00E+2          -> 0\r
+dqbast833 toEng  0.00E+3          -> 0.00E+3\r
+dqbast834 toEng  0.00E+4          -> 0.0E+3\r
+dqbast835 toEng  0.00E+5          -> 0E+3\r
+dqbast836 toEng  0.00E+6          -> 0.00E+6\r
+dqbast837 toEng  0.00E+7          -> 0.0E+6\r
+dqbast838 toEng  0.00E+8          -> 0E+6\r
+dqbast839 toEng  0.00E+9          -> 0.00E+9\r
+\r
+dqbast840 toEng  0.0E+0           -> 0.0\r
+dqbast841 toEng  0.0E+1           -> 0\r
+dqbast842 toEng  0.0E+2           -> 0.00E+3\r
+dqbast843 toEng  0.0E+3           -> 0.0E+3\r
+dqbast844 toEng  0.0E+4           -> 0E+3\r
+dqbast845 toEng  0.0E+5           -> 0.00E+6\r
+dqbast846 toEng  0.0E+6           -> 0.0E+6\r
+dqbast847 toEng  0.0E+7           -> 0E+6\r
+dqbast848 toEng  0.0E+8           -> 0.00E+9\r
+dqbast849 toEng  0.0E+9           -> 0.0E+9\r
+\r
+dqbast850 toEng  0E+0             -> 0\r
+dqbast851 toEng  0E+1             -> 0.00E+3\r
+dqbast852 toEng  0E+2             -> 0.0E+3\r
+dqbast853 toEng  0E+3             -> 0E+3\r
+dqbast854 toEng  0E+4             -> 0.00E+6\r
+dqbast855 toEng  0E+5             -> 0.0E+6\r
+dqbast856 toEng  0E+6             -> 0E+6\r
+dqbast857 toEng  0E+7             -> 0.00E+9\r
+dqbast858 toEng  0E+8             -> 0.0E+9\r
+dqbast859 toEng  0E+9             -> 0E+9\r
+\r
+dqbast860 toEng  0.0E-0           -> 0.0\r
+dqbast861 toEng  0.0E-1           -> 0.00\r
+dqbast862 toEng  0.0E-2           -> 0.000\r
+dqbast863 toEng  0.0E-3           -> 0.0000\r
+dqbast864 toEng  0.0E-4           -> 0.00000\r
+dqbast865 toEng  0.0E-5           -> 0.000000\r
+dqbast866 toEng  0.0E-6           -> 0.0E-6\r
+dqbast867 toEng  0.0E-7           -> 0.00E-6\r
+dqbast868 toEng  0.0E-8           -> 0E-9\r
+dqbast869 toEng  0.0E-9           -> 0.0E-9\r
+\r
+dqbast870 toEng  0.00E-0          -> 0.00\r
+dqbast871 toEng  0.00E-1          -> 0.000\r
+dqbast872 toEng  0.00E-2          -> 0.0000\r
+dqbast873 toEng  0.00E-3          -> 0.00000\r
+dqbast874 toEng  0.00E-4          -> 0.000000\r
+dqbast875 toEng  0.00E-5          -> 0.0E-6\r
+dqbast876 toEng  0.00E-6          -> 0.00E-6\r
+dqbast877 toEng  0.00E-7          -> 0E-9\r
+dqbast878 toEng  0.00E-8          -> 0.0E-9\r
+dqbast879 toEng  0.00E-9          -> 0.00E-9\r
+\r
+-- long input strings\r
+dqbas801 tosci '01234567890123456' -> 1234567890123456\r
+dqbas802 tosci '001234567890123456' -> 1234567890123456\r
+dqbas803 tosci '0001234567890123456' -> 1234567890123456\r
+dqbas804 tosci '00001234567890123456' -> 1234567890123456\r
+dqbas805 tosci '000001234567890123456' -> 1234567890123456\r
+dqbas806 tosci '0000001234567890123456' -> 1234567890123456\r
+dqbas807 tosci '00000001234567890123456' -> 1234567890123456\r
+dqbas808 tosci '000000001234567890123456' -> 1234567890123456\r
+dqbas809 tosci '0000000001234567890123456' -> 1234567890123456\r
+dqbas810 tosci '00000000001234567890123456' -> 1234567890123456\r
+\r
+dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456\r
+dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456\r
+dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456\r
+dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456\r
+dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456\r
+dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456\r
+dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7\r
+dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8\r
+dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9\r
+dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10\r
+\r
+dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded\r
+dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded\r
+dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded\r
+dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded\r
+dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded\r
+dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded\r
+dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded\r
+dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded\r
+dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded\r
+\r
+-- subnormals and overflows\r
+dqbas906 toSci '99e999999999'       -> Infinity Overflow  Inexact Rounded\r
+dqbas907 toSci '999e999999999'      -> Infinity Overflow  Inexact Rounded\r
+dqbas908 toSci '0.9e-999999999'     -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas909 toSci '0.09e-999999999'    -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas910 toSci '0.1e1000000000'     -> Infinity Overflow  Inexact Rounded\r
+dqbas911 toSci '10e-1000000000'     -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas912 toSci '0.9e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+dqbas913 toSci '99e-9999999999'     -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas914 toSci '111e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+dqbas915 toSci '1111e-9999999999'   -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas916 toSci '1111e-99999999999'  -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas917 toSci '7e1000000000'       -> Infinity Overflow  Inexact Rounded\r
+-- negatives the same\r
+dqbas918 toSci '-99e999999999'      -> -Infinity Overflow  Inexact Rounded\r
+dqbas919 toSci '-999e999999999'     -> -Infinity Overflow  Inexact Rounded\r
+dqbas920 toSci '-0.9e-999999999'    -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas921 toSci '-0.09e-999999999'   -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas922 toSci '-0.1e1000000000'    -> -Infinity Overflow  Inexact Rounded\r
+dqbas923 toSci '-10e-1000000000'    -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas924 toSci '-0.9e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+dqbas925 toSci '-99e-9999999999'    -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas926 toSci '-111e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+dqbas927 toSci '-1111e-9999999999'  -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas929 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded\r
+\r
+-- overflow results at different rounding modes\r
+rounding:  ceiling\r
+dqbas930 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dqbas931 toSci '-7e10000'  -> -9.999999999999999999999999999999999E+6144 Overflow  Inexact Rounded\r
+rounding:  up\r
+dqbas932 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dqbas933 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  down\r
+dqbas934 toSci  '7e10000'  ->  9.999999999999999999999999999999999E+6144 Overflow  Inexact Rounded\r
+dqbas935 toSci '-7e10000'  -> -9.999999999999999999999999999999999E+6144 Overflow  Inexact Rounded\r
+rounding:  floor\r
+dqbas936 toSci  '7e10000'  ->  9.999999999999999999999999999999999E+6144 Overflow  Inexact Rounded\r
+dqbas937 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_up\r
+dqbas938 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dqbas939 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_even\r
+dqbas940 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dqbas941 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_down\r
+dqbas942 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dqbas943 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_even\r
+\r
+-- Now check 854/754r some subnormals and underflow to 0\r
+dqbem400 toSci  1.0000E-383     -> 1.0000E-383\r
+dqbem401 toSci  0.1E-6172        -> 1E-6173       Subnormal\r
+dqbem402 toSci  0.1000E-6172     -> 1.000E-6173   Subnormal\r
+dqbem403 toSci  0.0100E-6172     -> 1.00E-6174    Subnormal\r
+dqbem404 toSci  0.0010E-6172     -> 1.0E-6175     Subnormal\r
+dqbem405 toSci  0.0001E-6172     -> 1E-6176       Subnormal\r
+dqbem406 toSci  0.00010E-6172    -> 1E-6176     Subnormal Rounded\r
+dqbem407 toSci  0.00013E-6172    -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem408 toSci  0.00015E-6172    -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem409 toSci  0.00017E-6172    -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem410 toSci  0.00023E-6172    -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem411 toSci  0.00025E-6172    -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem412 toSci  0.00027E-6172    -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem413 toSci  0.000149E-6172   -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem414 toSci  0.000150E-6172   -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem415 toSci  0.000151E-6172   -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem416 toSci  0.000249E-6172   -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem417 toSci  0.000250E-6172   -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem418 toSci  0.000251E-6172   -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem419 toSci  0.00009E-6172    -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem420 toSci  0.00005E-6172    -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem421 toSci  0.00003E-6172    -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem422 toSci  0.000009E-6172   -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem423 toSci  0.000005E-6172   -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem424 toSci  0.000003E-6172   -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dqbem425 toSci  0.001049E-6172   -> 1.0E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem426 toSci  0.001050E-6172   -> 1.0E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem427 toSci  0.001051E-6172   -> 1.1E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem428 toSci  0.001149E-6172   -> 1.1E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem429 toSci  0.001150E-6172   -> 1.2E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem430 toSci  0.001151E-6172   -> 1.2E-6175   Underflow Subnormal Inexact Rounded\r
+\r
+dqbem432 toSci  0.010049E-6172   -> 1.00E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem433 toSci  0.010050E-6172   -> 1.00E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem434 toSci  0.010051E-6172   -> 1.01E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem435 toSci  0.010149E-6172   -> 1.01E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem436 toSci  0.010150E-6172   -> 1.02E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem437 toSci  0.010151E-6172   -> 1.02E-6174  Underflow Subnormal Inexact Rounded\r
+\r
+dqbem440 toSci  0.10103E-6172    -> 1.010E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem441 toSci  0.10105E-6172    -> 1.010E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem442 toSci  0.10107E-6172    -> 1.011E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem443 toSci  0.10113E-6172    -> 1.011E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem444 toSci  0.10115E-6172    -> 1.012E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem445 toSci  0.10117E-6172    -> 1.012E-6173 Underflow Subnormal Inexact Rounded\r
+\r
+dqbem450 toSci  1.10730E-6173   -> 1.107E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem451 toSci  1.10750E-6173   -> 1.108E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem452 toSci  1.10770E-6173   -> 1.108E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem453 toSci  1.10830E-6173   -> 1.108E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem454 toSci  1.10850E-6173   -> 1.108E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem455 toSci  1.10870E-6173   -> 1.109E-6173 Underflow Subnormal Inexact Rounded\r
+\r
+-- make sure sign OK\r
+dqbem456 toSci  -0.10103E-6172   -> -1.010E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem457 toSci  -0.10105E-6172   -> -1.010E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem458 toSci  -0.10107E-6172   -> -1.011E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem459 toSci  -0.10113E-6172   -> -1.011E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem460 toSci  -0.10115E-6172   -> -1.012E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem461 toSci  -0.10117E-6172   -> -1.012E-6173 Underflow Subnormal Inexact Rounded\r
+\r
+-- '999s' cases\r
+dqbem464 toSci  999999E-6173         -> 9.99999E-6168 Subnormal\r
+dqbem465 toSci  99999.0E-6172        -> 9.99990E-6168 Subnormal\r
+dqbem466 toSci  99999.E-6172         -> 9.9999E-6168  Subnormal\r
+dqbem467 toSci  9999.9E-6172         -> 9.9999E-6169  Subnormal\r
+dqbem468 toSci  999.99E-6172         -> 9.9999E-6170  Subnormal\r
+dqbem469 toSci  99.999E-6172         -> 9.9999E-6171  Subnormal\r
+dqbem470 toSci  9.9999E-6172         -> 9.9999E-6172  Subnormal\r
+dqbem471 toSci  0.99999E-6172        -> 1.0000E-6172 Underflow Subnormal Inexact Rounded\r
+dqbem472 toSci  0.099999E-6172       -> 1.000E-6173 Underflow Subnormal Inexact Rounded\r
+dqbem473 toSci  0.0099999E-6172      -> 1.00E-6174  Underflow Subnormal Inexact Rounded\r
+dqbem474 toSci  0.00099999E-6172     -> 1.0E-6175   Underflow Subnormal Inexact Rounded\r
+dqbem475 toSci  0.000099999E-6172    -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqbem476 toSci  0.0000099999E-6172   -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem477 toSci  0.00000099999E-6172  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqbem478 toSci  0.000000099999E-6172 -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- Exponents with insignificant leading zeros\r
+dqbas1001 toSci  1e999999999 -> Infinity Overflow Inexact Rounded\r
+dqbas1002 toSci  1e0999999999 -> Infinity Overflow Inexact Rounded\r
+dqbas1003 toSci  1e00999999999 -> Infinity Overflow Inexact Rounded\r
+dqbas1004 toSci  1e000999999999 -> Infinity Overflow Inexact Rounded\r
+dqbas1005 toSci  1e000000000000999999999 -> Infinity Overflow Inexact Rounded\r
+dqbas1006 toSci  1e000000000001000000007 -> Infinity Overflow Inexact Rounded\r
+dqbas1007 toSci  1e-999999999 -> 0E-6176             Underflow Subnormal Inexact Rounded Clamped\r
+dqbas1008 toSci  1e-0999999999 -> 0E-6176            Underflow Subnormal Inexact Rounded Clamped\r
+dqbas1009 toSci  1e-00999999999 -> 0E-6176           Underflow Subnormal Inexact Rounded Clamped\r
+dqbas1010 toSci  1e-000999999999 -> 0E-6176          Underflow Subnormal Inexact Rounded Clamped\r
+dqbas1011 toSci  1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqbas1012 toSci  1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- check for double-rounded subnormals\r
+dqbas1041 toSci     1.1111111111111111111111111111152444E-6144 ->  1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow\r
+dqbas1042 toSci     1.1111111111111111111111111111152445E-6144 ->  1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow\r
+dqbas1043 toSci     1.1111111111111111111111111111152446E-6144 ->  1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow\r
+\r
+-- clamped zeros [see also clamp.decTest]\r
+dqbas1075 toSci   0e+10000  ->  0E+6111 Clamped\r
+dqbas1076 toSci   0e-10000  ->  0E-6176  Clamped\r
+dqbas1077 toSci  -0e+10000  -> -0E+6111 Clamped\r
+dqbas1078 toSci  -0e-10000  -> -0E-6176  Clamped\r
+\r
+-- extreme values from next-wider\r
+dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded\r
+dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped\r
+dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped\r
+dqbas1104 toSci -0 -> -0\r
+dqbas1105 toSci +0 ->  0\r
+dqbas1106 toSci +1E-1572932 ->  0E-6176 Inexact Rounded Subnormal Underflow Clamped\r
+dqbas1107 toSci +1E-1572863 ->  0E-6176 Inexact Rounded Subnormal Underflow Clamped\r
+dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 ->  Infinity Overflow Inexact Rounded\r
+\r
diff --git a/Lib/test/decimaltestdata/dqCanonical.decTest b/Lib/test/decimaltestdata/dqCanonical.decTest
new file mode 100644 (file)
index 0000000..a6b801a
--- /dev/null
@@ -0,0 +1,372 @@
+------------------------------------------------------------------------\r
+-- dqCanonical.decTest -- test decQuad canonical results              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This file tests that copy operations leave uncanonical operands\r
+-- unchanged, and vice versa\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Uncanonical declets are: abc, where:\r
+--   a=1,2,3\r
+--   b=6,7,e,f\r
+--   c=e,f\r
+\r
+-- assert some standard (canonical) values; this tests that FromString\r
+-- produces canonical results (many more in decimalNN)\r
+dqcan001 apply 9.999999999999999999999999999999999E+6144  -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan002 apply 0                      -> #22080000000000000000000000000000\r
+dqcan003 apply 1                      -> #22080000000000000000000000000001\r
+dqcan004 apply -1                     -> #a2080000000000000000000000000001\r
+dqcan005 apply Infinity               -> #78000000000000000000000000000000\r
+dqcan006 apply -Infinity              -> #f8000000000000000000000000000000\r
+dqcan007 apply -NaN                   -> #fc000000000000000000000000000000\r
+dqcan008 apply -sNaN                  -> #fe000000000000000000000000000000\r
+dqcan009 apply  NaN999999999999999999999999999999999  -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan010 apply sNaN999999999999999999999999999999999  -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+decan011 apply  9999999999999999999999999999999999    -> #6e080ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan012 apply 7.50                                   -> #220780000000000000000000000003d0\r
+dqcan013 apply 9.99                                   -> #220780000000000000000000000000ff\r
+\r
+-- Base tests for canonical encodings (individual operator\r
+-- propagation is tested later)\r
+\r
+-- Finites: declets in coefficient\r
+dqcan021 canonical  #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan022 canonical  #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan023 canonical  #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan024 canonical  #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan025 canonical  #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan026 canonical  #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan027 canonical  #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan028 canonical  #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan029 canonical  #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan030 canonical  #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan031 canonical  #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan032 canonical  #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+\r
+-- NaN: declets in payload\r
+dqcan061 canonical  #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan062 canonical  #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan063 canonical  #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan064 canonical  #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan065 canonical  #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan066 canonical  #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan067 canonical  #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan068 canonical  #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan069 canonical  #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan070 canonical  #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan071 canonical  #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan081 canonical  #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan082 canonical  #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan083 canonical  #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan084 canonical  #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan085 canonical  #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan086 canonical  #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan087 canonical  #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan088 canonical  #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan089 canonical  #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan090 canonical  #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan091 canonical  #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+\r
+-- sNaN: declets in payload\r
+dqcan101 canonical  #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan102 canonical  #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan103 canonical  #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan104 canonical  #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan105 canonical  #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan106 canonical  #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan107 canonical  #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan108 canonical  #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan109 canonical  #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan100 canonical  #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan111 canonical  #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan121 canonical  #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan122 canonical  #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan123 canonical  #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan124 canonical  #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan125 canonical  #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan126 canonical  #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan127 canonical  #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan128 canonical  #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan129 canonical  #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan130 canonical  #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan131 canonical  #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+\r
+-- Inf: exponent continuation bits\r
+dqcan137 canonical  #78000000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan138 canonical  #79000000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan139 canonical  #7a000000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan140 canonical  #78800000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan141 canonical  #78400000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan142 canonical  #78200000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan143 canonical  #78100000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan144 canonical  #78080000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan145 canonical  #78040000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan146 canonical  #78020000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan147 canonical  #78010000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan148 canonical  #78008000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan149 canonical  #78004000000000000000000000000000 -> #78000000000000000000000000000000\r
+\r
+-- Inf: coefficient continuation bits (first, last, and a few others)\r
+dqcan150 canonical  #78000000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan151 canonical  #78020000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan152 canonical  #78000000000000000000000000000001 -> #78000000000000000000000000000000\r
+dqcan153 canonical  #78010000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan154 canonical  #78002000000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan155 canonical  #78000800000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan156 canonical  #78000020000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan157 canonical  #78000004000000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan158 canonical  #78000000400000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan159 canonical  #78000000080000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan160 canonical  #78000000004000000000000000000000 -> #78000000000000000000000000000000\r
+dqcan161 canonical  #78000000000200000000000000000000 -> #78000000000000000000000000000000\r
+dqcan162 canonical  #78000000000080000000000000000000 -> #78000000000000000000000000000000\r
+dqcan163 canonical  #78000000000002000000000000000000 -> #78000000000000000000000000000000\r
+dqcan164 canonical  #78000000000000400000000000000000 -> #78000000000000000000000000000000\r
+dqcan165 canonical  #78000000000000080000000000000000 -> #78000000000000000000000000000000\r
+dqcan166 canonical  #78000000000000001000000000000000 -> #78000000000000000000000000000000\r
+dqcan167 canonical  #78000000000000000200000000000000 -> #78000000000000000000000000000000\r
+dqcan168 canonical  #78000000000000000080000000000000 -> #78000000000000000000000000000000\r
+dqcan169 canonical  #78000000000000000004000000000000 -> #78000000000000000000000000000000\r
+dqcan170 canonical  #78000000000000000000400000000000 -> #78000000000000000000000000000000\r
+dqcan171 canonical  #78000000000000000000010000000000 -> #78000000000000000000000000000000\r
+dqcan172 canonical  #78000000000000000000002000000000 -> #78000000000000000000000000000000\r
+dqcan173 canonical  #78000000000000000000000400000000 -> #78000000000000000000000000000000\r
+dqcan174 canonical  #78000000000000000000000080000000 -> #78000000000000000000000000000000\r
+dqcan175 canonical  #78000000000000000000000002000000 -> #78000000000000000000000000000000\r
+dqcan176 canonical  #78000000000000000000000000400000 -> #78000000000000000000000000000000\r
+dqcan177 canonical  #78000000000000000000000000020000 -> #78000000000000000000000000000000\r
+dqcan178 canonical  #78000000000000000000000000001000 -> #78000000000000000000000000000000\r
+dqcan179 canonical  #78000000000000000000000000000400 -> #78000000000000000000000000000000\r
+dqcan180 canonical  #78000000000000000000000000000020 -> #78000000000000000000000000000000\r
+dqcan181 canonical  #78000000000000000000000000000008 -> #78000000000000000000000000000000\r
+\r
+\r
+-- Now the operators -- trying to check paths that might fail to\r
+-- canonicalize propagated operands\r
+\r
+----- Add:\r
+-- Finites: neutral 0\r
+dqcan202 add  0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff         -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan203 add          #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+-- tiny zero\r
+dqcan204 add  0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff         -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded\r
+dqcan205 add          #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded\r
+-- tiny non zero\r
+dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff          -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded\r
+dqcan207 add          #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded\r
+-- NaN: declets in payload\r
+dqcan211 add  0  #7c000ff3fcff3fcff3fcfffffff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan212 add     #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan213 add  0  #7c400ff3fcff3fcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan214 add     #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN: declets in payload\r
+dqcan215 add  0  #7e000ff3fcffffcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+dqcan216 add     #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan217 add  0  #7e500ff3fcff3fcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+dqcan218 add     #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+-- Inf: exponent continuation bits\r
+dqcan220 add  0  #78010000000000000000000000000000   -> #78000000000000000000000000000000\r
+dqcan221 add     #78680000000000000000000000000000 0 -> #78000000000000000000000000000000\r
+-- Inf: coefficient continuation bits\r
+dqcan222 add  0  #78002000000000000000000000000000   -> #78000000000000000000000000000000\r
+dqcan223 add     #78000000000000000000000000000001 0 -> #78000000000000000000000000000000\r
+dqcan224 add  0  #78000002000000000000000000000000   -> #78000000000000000000000000000000\r
+dqcan225 add     #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000\r
+dqcan226 add  0  #78000000000000000005000000000000   -> #78000000000000000000000000000000\r
+dqcan227 add     #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000\r
+\r
+----- Class: [does not return encoded]\r
+\r
+----- Compare:\r
+dqcan231 compare -Inf   1     ->  #a2080000000000000000000000000001\r
+dqcan232 compare -Inf  -Inf   ->  #22080000000000000000000000000000\r
+dqcan233 compare  1    -Inf   ->  #22080000000000000000000000000001\r
+dqcan234 compare  #7c010ff3fcff3fcff3fcff3ffffffcff     -1000  -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan235 compare  #7e004ff3fcff3fcff3ffffffcff3fcff     -1000  -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation\r
+\r
+----- CompareSig:\r
+dqcan241 comparesig -Inf   1     ->  #a2080000000000000000000000000001\r
+dqcan242 comparesig -Inf  -Inf   ->  #22080000000000000000000000000000\r
+dqcan243 comparesig  1    -Inf   ->  #22080000000000000000000000000001\r
+dqcan244 comparesig  #7c400ff3ffff3fcff3fcff3fcff3fcff   -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation\r
+dqcan245 comparesig  #7e050ff3fcfffffff3fcff3fcff3fcff   -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation\r
+\r
+----- Copy: [does not usually canonicalize]\r
+-- finites\r
+dqcan250 copy  #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff\r
+dqcan251 copy  #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff\r
+-- NaNs\r
+dqcan252 copy  #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff\r
+dqcan253 copy  #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN\r
+dqcan254 copy  #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff\r
+dqcan255 copy  #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff\r
+-- Inf\r
+dqcan258 copy  #78002000000000000000000000000000 -> #78002000000000000000000000000000\r
+dqcan259 copy  #78000000000010000000000000100000 -> #78000000000010000000000000100000\r
+\r
+----- CopyAbs: [does not usually canonicalize]\r
+-- finites\r
+dqcan260 copyabs  #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff\r
+dqcan261 copyabs  #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff\r
+-- NaNs\r
+dqcan262 copyabs  #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff\r
+dqcan263 copyabs  #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN\r
+dqcan264 copyabs  #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff\r
+dqcan265 copyabs  #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff\r
+-- Inf\r
+dqcan268 copyabs  #f8002000000000000000000000000000 -> #78002000000000000000000000000000\r
+dqcan269 copyabs  #f8000000000000700700700000000000 -> #78000000000000700700700000000000\r
+\r
+----- CopyNegate: [does not usually canonicalize]\r
+-- finites\r
+dqcan270 copynegate  #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff\r
+dqcan271 copynegate  #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff\r
+-- NaNs\r
+dqcan272 copynegate  #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff\r
+dqcan273 copynegate  #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN\r
+dqcan274 copynegate  #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff\r
+dqcan275 copynegate  #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff\r
+-- Inf\r
+dqcan278 copynegate  #78002000000000000000000000000000 -> #f8002000000000000000000000000000\r
+dqcan279 copynegate  #78000000000010000000000000100000 -> #f8000000000010000000000000100000\r
+\r
+----- CopySign: [does not usually canonicalize]\r
+-- finites\r
+dqcan280 copysign  #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff\r
+dqcan281 copysign  #ee080ff3fcff3ffff3fcff3ffff3fcff  1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff\r
+-- NaNs\r
+dqcan282 copysign  #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff\r
+dqcan283 copysign  #7c080ff3fcff3fcff3fcff3fcff3fcff  1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN\r
+dqcan284 copysign  #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff\r
+dqcan285 copysign  #7e100ff3fcff3fcff3fcff3fcff3fcff  1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff\r
+-- Inf\r
+dqcan288 copysign  #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000\r
+dqcan289 copysign  #78000000000010000000000000100000  1 -> #78000000000010000000000000100000\r
+\r
+----- Multiply:\r
+-- Finites: neutral 0\r
+dqcan302 multiply  1  #77ffff3fcff3fcff0000000000000000               -> #77ffff3fcff3fcff0000000000000000\r
+dqcan303 multiply     #77fcffffcff3fcff0000000000000000 1             -> #77fccfffcff3fcff0000000000000000\r
+-- negative\r
+dqcan306 multiply -1  #77ffff3fcff3fcff0000000000000000               -> #f7ffff3fcff3fcff0000000000000000\r
+dqcan307 multiply     #77fcffffcff3fcff0000000000000000 -1            -> #f7fccfffcff3fcff0000000000000000\r
+-- NaN: declets in payload\r
+dqcan311 multiply  1  #7c03ff3fcff3fcff0000000000000000               -> #7c003f3fcff3fcff0000000000000000\r
+dqcan312 multiply     #7c03ff3fcff3fcff0000000000000000 1             -> #7c003f3fcff3fcff0000000000000000\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan313 multiply  1  #7c40ff3fcff3fcff0000000000000000               -> #7c003f3fcff3fcff0000000000000000\r
+dqcan314 multiply     #7c40ff3fcff3fcff0000000000000000 1             -> #7c003f3fcff3fcff0000000000000000\r
+-- sNaN: declets in payload\r
+dqcan315 multiply  1  #7e00ffffcff3fcff0000000000000000               -> #7c000fffcff3fcff0000000000000000 Invalid_operation\r
+dqcan316 multiply     #7e00ffffcff3fcff0000000000000000 1             -> #7c000fffcff3fcff0000000000000000 Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan317 multiply  1  #7e80ff3fcff3fcff0000000000000000               -> #7c003f3fcff3fcff0000000000000000 Invalid_operation\r
+dqcan318 multiply     #7e80ff3fcff3fcff0000000000000000 1             -> #7c003f3fcff3fcff0000000000000000 Invalid_operation\r
+-- Inf: exponent continuation bits\r
+dqcan320 multiply  1  #78800000000000000000000000000000               -> #78000000000000000000000000000000\r
+dqcan321 multiply     #78800000000000000000000000000000 1             -> #78000000000000000000000000000000\r
+-- Inf: coefficient continuation bits\r
+dqcan322 multiply  1  #78020000000000000000000000000000               -> #78000000000000000000000000000000\r
+dqcan323 multiply     #78020000000000000000000000000000 1             -> #78000000000000000000000000000000\r
+dqcan324 multiply  1  #78000000000000010000000000000000               -> #78000000000000000000000000000000\r
+dqcan325 multiply     #78000000000000010000000000000000 1             -> #78000000000000000000000000000000\r
+dqcan326 multiply  1  #78000020000000000000000000000000               -> #78000000000000000000000000000000\r
+dqcan327 multiply     #78000020000000000000000000000000 1             -> #78000000000000000000000000000000\r
+\r
+----- Quantize:\r
+dqcan401 quantize  #ee080ff3fcff3fcff3fffffffff3fcff 0    -> #ee080ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan402 quantize  #ee080ff3fffffffffffcff3fcff3fcff 0    -> #ee080ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan403 quantize  #78800000000000000000000000000000 Inf  -> #78000000000000000000000000000000\r
+dqcan404 quantize  #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000\r
+dqcan410 quantize  #7c080ff3fcff3fcff3fcff3fcff3fcff  1   -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan411 quantize  #fc000ff3fcfffffff3fcff3fcff3fcff  1   -> #fc000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan412 quantize  #7e100ff3fcff3fcff3fcff3fcff3fcff  1   -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation\r
+dqcan413 quantize  #fe000ff3fcff3fcff3ffffffcff3fcff  1   -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation\r
+\r
+----- Subtract:\r
+-- Finites: neutral 0\r
+dqcan502 subtract  0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff         -> #f7ffcff3fcff3fcff3fcff3fcff3fcff\r
+dqcan503 subtract          #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+-- tiny zero\r
+dqcan504 subtract  0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff         -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded\r
+dqcan505 subtract          #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded\r
+-- tiny non zero\r
+dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff          -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded\r
+dqcan507 subtract          #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded\r
+-- NaN: declets in payload\r
+dqcan511 subtract  0  #7c000ff3fcff3fcff3fcfffffff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan512 subtract     #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+-- NaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan513 subtract  0  #7c400ff3fcff3fcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan514 subtract     #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+-- sNaN: declets in payload\r
+dqcan515 subtract  0  #7e000ff3fcffffcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+dqcan516 subtract     #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+-- sNaN: exponent continuation bits [excluding sNaN selector]\r
+dqcan517 subtract  0  #7e500ff3fcff3fcff3fcff3fcff3fcff   -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+dqcan518 subtract     #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+-- Inf: exponent continuation bits\r
+dqcan520 subtract  0  #78010000000000000000000000000000   -> #f8000000000000000000000000000000\r
+dqcan521 subtract     #78680000000000000000000000000000 0 -> #78000000000000000000000000000000\r
+-- Inf: coefficient continuation bits\r
+dqcan522 subtract  0  #78002000000000000000000000000000   -> #f8000000000000000000000000000000\r
+dqcan523 subtract     #78000000000000000000000000000001 0 -> #78000000000000000000000000000000\r
+dqcan524 subtract  0  #78000002000000000000000000000000   -> #f8000000000000000000000000000000\r
+dqcan525 subtract     #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000\r
+dqcan526 subtract  0  #78000000000000000005000000000000   -> #f8000000000000000000000000000000\r
+dqcan527 subtract     #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000\r
+\r
+----- ToIntegral:\r
+dqcan601 tointegralx  #6e080ff3fdff3fcff3fcff3fcff3fcff  -> #6e080ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan602 tointegralx  #ee080ff3fcff3ffff3fcff3fcff3fcff  -> #ee080ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan603 tointegralx  #78800000000000000000000000000000  -> #78000000000000000000000000000000\r
+dqcan604 tointegralx  #78020000000000000000000000000000  -> #78000000000000000000000000000000\r
+dqcan614 tointegralx  #7c100ff3fcff3fcff3fcff3fcff3fcff  -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan615 tointegralx  #fc000ff3fcff3fcff3fcffffcff3fcff  -> #fc000ff3fcff3fcff3fcff3fcff3fcff\r
+dqcan616 tointegralx  #7e010ff3fcff3fcff3fcff3fcff3fcff  -> #7c000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+dqcan617 tointegralx  #fe000ff3fcff3fcff3fdff3fcff3fcff  -> #fc000ff3fcff3fcff3fcff3fcff3fcff  Invalid_operation\r
+-- uncanonical 3999, 39.99, 3.99, 0.399,                  and negatives\r
+dqcan618 tointegralx  #22080000000000000000000000000fff  -> #22080000000000000000000000000cff\r
+dqcan619 tointegralx  #22078000000000000000000000000fff  -> #22080000000000000000000000000040  Inexact Rounded\r
+dqcan620 tointegralx  #22074000000000000000000000000fff  -> #22080000000000000000000000000004  Inexact Rounded\r
+dqcan621 tointegralx  #22070000000000000000000000000fff  -> #22080000000000000000000000000000  Inexact Rounded\r
+dqcan622 tointegralx  #a2080000000000000000000000000fff  -> #a2080000000000000000000000000cff\r
+dqcan623 tointegralx  #a2078000000000000000000000000fff  -> #a2080000000000000000000000000040  Inexact Rounded\r
+dqcan624 tointegralx  #a2074000000000000000000000000fff  -> #a2080000000000000000000000000004  Inexact Rounded\r
+dqcan625 tointegralx  #a2070000000000000000000000000fff  -> #a2080000000000000000000000000000  Inexact Rounded\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dqClass.decTest b/Lib/test/decimaltestdata/dqClass.decTest
new file mode 100644 (file)
index 0000000..185fbfc
--- /dev/null
@@ -0,0 +1,77 @@
+------------------------------------------------------------------------\r
+-- dqClass.decTest -- decQuad Class operations                        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- [New 2006.11.27]\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqcla001  class    0                        -> +Zero\r
+dqcla002  class    0.00                     -> +Zero\r
+dqcla003  class    0E+5                     -> +Zero\r
+dqcla004  class    1E-6176                  -> +Subnormal\r
+dqcla005  class  0.1E-6143                  -> +Subnormal\r
+dqcla006  class  0.99999999999999999999999999999999E-6143     -> +Subnormal\r
+dqcla007  class  1.00000000000000000000000000000000E-6143     -> +Normal\r
+dqcla008  class   1E-6143                   -> +Normal\r
+dqcla009  class   1E-100                    -> +Normal\r
+dqcla010  class   1E-10                     -> +Normal\r
+dqcla012  class   1E-1                      -> +Normal\r
+dqcla013  class   1                         -> +Normal\r
+dqcla014  class   2.50                      -> +Normal\r
+dqcla015  class   100.100                   -> +Normal\r
+dqcla016  class   1E+30                     -> +Normal\r
+dqcla017  class   1E+6144                   -> +Normal\r
+dqcla018  class   9.99999999999999999999999999999999E+6144    -> +Normal\r
+dqcla019  class   Inf                       -> +Infinity\r
+\r
+dqcla021  class   -0                        -> -Zero\r
+dqcla022  class   -0.00                     -> -Zero\r
+dqcla023  class   -0E+5                     -> -Zero\r
+dqcla024  class   -1E-6176                  -> -Subnormal\r
+dqcla025  class  -0.1E-6143                 -> -Subnormal\r
+dqcla026  class  -0.99999999999999999999999999999999E-6143    -> -Subnormal\r
+dqcla027  class  -1.00000000000000000000000000000000E-6143    -> -Normal\r
+dqcla028  class  -1E-6143                   -> -Normal\r
+dqcla029  class  -1E-100                    -> -Normal\r
+dqcla030  class  -1E-10                     -> -Normal\r
+dqcla032  class  -1E-1                      -> -Normal\r
+dqcla033  class  -1                         -> -Normal\r
+dqcla034  class  -2.50                      -> -Normal\r
+dqcla035  class  -100.100                   -> -Normal\r
+dqcla036  class  -1E+30                     -> -Normal\r
+dqcla037  class  -1E+6144                   -> -Normal\r
+dqcla0614  class  -9.99999999999999999999999999999999E+6144    -> -Normal\r
+dqcla039  class  -Inf                       -> -Infinity\r
+\r
+dqcla041  class   NaN                       -> NaN\r
+dqcla042  class  -NaN                       -> NaN\r
+dqcla043  class  +NaN12345                  -> NaN\r
+dqcla044  class   sNaN                      -> sNaN\r
+dqcla045  class  -sNaN                      -> sNaN\r
+dqcla046  class  +sNaN12345                 -> sNaN\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dqCompare.decTest b/Lib/test/decimaltestdata/dqCompare.decTest
new file mode 100644 (file)
index 0000000..8947280
--- /dev/null
@@ -0,0 +1,753 @@
+------------------------------------------------------------------------\r
+-- dqCompare.decTest -- decQuad comparison that allows quiet NaNs     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqcom001 compare  -2  -2  -> 0\r
+dqcom002 compare  -2  -1  -> -1\r
+dqcom003 compare  -2   0  -> -1\r
+dqcom004 compare  -2   1  -> -1\r
+dqcom005 compare  -2   2  -> -1\r
+dqcom006 compare  -1  -2  -> 1\r
+dqcom007 compare  -1  -1  -> 0\r
+dqcom008 compare  -1   0  -> -1\r
+dqcom009 compare  -1   1  -> -1\r
+dqcom010 compare  -1   2  -> -1\r
+dqcom011 compare   0  -2  -> 1\r
+dqcom012 compare   0  -1  -> 1\r
+dqcom013 compare   0   0  -> 0\r
+dqcom014 compare   0   1  -> -1\r
+dqcom015 compare   0   2  -> -1\r
+dqcom016 compare   1  -2  -> 1\r
+dqcom017 compare   1  -1  -> 1\r
+dqcom018 compare   1   0  -> 1\r
+dqcom019 compare   1   1  -> 0\r
+dqcom020 compare   1   2  -> -1\r
+dqcom021 compare   2  -2  -> 1\r
+dqcom022 compare   2  -1  -> 1\r
+dqcom023 compare   2   0  -> 1\r
+dqcom025 compare   2   1  -> 1\r
+dqcom026 compare   2   2  -> 0\r
+\r
+dqcom031 compare  -20  -20  -> 0\r
+dqcom032 compare  -20  -10  -> -1\r
+dqcom033 compare  -20   00  -> -1\r
+dqcom034 compare  -20   10  -> -1\r
+dqcom035 compare  -20   20  -> -1\r
+dqcom036 compare  -10  -20  -> 1\r
+dqcom037 compare  -10  -10  -> 0\r
+dqcom038 compare  -10   00  -> -1\r
+dqcom039 compare  -10   10  -> -1\r
+dqcom040 compare  -10   20  -> -1\r
+dqcom041 compare   00  -20  -> 1\r
+dqcom042 compare   00  -10  -> 1\r
+dqcom043 compare   00   00  -> 0\r
+dqcom044 compare   00   10  -> -1\r
+dqcom045 compare   00   20  -> -1\r
+dqcom046 compare   10  -20  -> 1\r
+dqcom047 compare   10  -10  -> 1\r
+dqcom048 compare   10   00  -> 1\r
+dqcom049 compare   10   10  -> 0\r
+dqcom050 compare   10   20  -> -1\r
+dqcom051 compare   20  -20  -> 1\r
+dqcom052 compare   20  -10  -> 1\r
+dqcom053 compare   20   00  -> 1\r
+dqcom055 compare   20   10  -> 1\r
+dqcom056 compare   20   20  -> 0\r
+\r
+dqcom061 compare  -2.0  -2.0  -> 0\r
+dqcom062 compare  -2.0  -1.0  -> -1\r
+dqcom063 compare  -2.0   0.0  -> -1\r
+dqcom064 compare  -2.0   1.0  -> -1\r
+dqcom065 compare  -2.0   2.0  -> -1\r
+dqcom066 compare  -1.0  -2.0  -> 1\r
+dqcom067 compare  -1.0  -1.0  -> 0\r
+dqcom068 compare  -1.0   0.0  -> -1\r
+dqcom069 compare  -1.0   1.0  -> -1\r
+dqcom070 compare  -1.0   2.0  -> -1\r
+dqcom071 compare   0.0  -2.0  -> 1\r
+dqcom072 compare   0.0  -1.0  -> 1\r
+dqcom073 compare   0.0   0.0  -> 0\r
+dqcom074 compare   0.0   1.0  -> -1\r
+dqcom075 compare   0.0   2.0  -> -1\r
+dqcom076 compare   1.0  -2.0  -> 1\r
+dqcom077 compare   1.0  -1.0  -> 1\r
+dqcom078 compare   1.0   0.0  -> 1\r
+dqcom079 compare   1.0   1.0  -> 0\r
+dqcom080 compare   1.0   2.0  -> -1\r
+dqcom081 compare   2.0  -2.0  -> 1\r
+dqcom082 compare   2.0  -1.0  -> 1\r
+dqcom083 compare   2.0   0.0  -> 1\r
+dqcom085 compare   2.0   1.0  -> 1\r
+dqcom086 compare   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+dqcom090 compare  9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144  -> 0\r
+dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144  -> -1\r
+dqcom092 compare  9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1\r
+dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0\r
+\r
+-- some differing length/exponent cases\r
+dqcom100 compare   7.0    7.0    -> 0\r
+dqcom101 compare   7.0    7      -> 0\r
+dqcom102 compare   7      7.0    -> 0\r
+dqcom103 compare   7E+0   7.0    -> 0\r
+dqcom104 compare   70E-1  7.0    -> 0\r
+dqcom105 compare   0.7E+1 7      -> 0\r
+dqcom106 compare   70E-1  7      -> 0\r
+dqcom107 compare   7.0    7E+0   -> 0\r
+dqcom108 compare   7.0    70E-1  -> 0\r
+dqcom109 compare   7      0.7E+1 -> 0\r
+dqcom110 compare   7      70E-1  -> 0\r
+\r
+dqcom120 compare   8.0    7.0    -> 1\r
+dqcom121 compare   8.0    7      -> 1\r
+dqcom122 compare   8      7.0    -> 1\r
+dqcom123 compare   8E+0   7.0    -> 1\r
+dqcom124 compare   80E-1  7.0    -> 1\r
+dqcom125 compare   0.8E+1 7      -> 1\r
+dqcom126 compare   80E-1  7      -> 1\r
+dqcom127 compare   8.0    7E+0   -> 1\r
+dqcom128 compare   8.0    70E-1  -> 1\r
+dqcom129 compare   8      0.7E+1  -> 1\r
+dqcom130 compare   8      70E-1  -> 1\r
+\r
+dqcom140 compare   8.0    9.0    -> -1\r
+dqcom141 compare   8.0    9      -> -1\r
+dqcom142 compare   8      9.0    -> -1\r
+dqcom143 compare   8E+0   9.0    -> -1\r
+dqcom144 compare   80E-1  9.0    -> -1\r
+dqcom145 compare   0.8E+1 9      -> -1\r
+dqcom146 compare   80E-1  9      -> -1\r
+dqcom147 compare   8.0    9E+0   -> -1\r
+dqcom148 compare   8.0    90E-1  -> -1\r
+dqcom149 compare   8      0.9E+1 -> -1\r
+dqcom150 compare   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+dqcom200 compare  -7.0    7.0    -> -1\r
+dqcom201 compare  -7.0    7      -> -1\r
+dqcom202 compare  -7      7.0    -> -1\r
+dqcom203 compare  -7E+0   7.0    -> -1\r
+dqcom204 compare  -70E-1  7.0    -> -1\r
+dqcom205 compare  -0.7E+1 7      -> -1\r
+dqcom206 compare  -70E-1  7      -> -1\r
+dqcom207 compare  -7.0    7E+0   -> -1\r
+dqcom208 compare  -7.0    70E-1  -> -1\r
+dqcom209 compare  -7      0.7E+1 -> -1\r
+dqcom210 compare  -7      70E-1  -> -1\r
+\r
+dqcom220 compare  -8.0    7.0    -> -1\r
+dqcom221 compare  -8.0    7      -> -1\r
+dqcom222 compare  -8      7.0    -> -1\r
+dqcom223 compare  -8E+0   7.0    -> -1\r
+dqcom224 compare  -80E-1  7.0    -> -1\r
+dqcom225 compare  -0.8E+1 7      -> -1\r
+dqcom226 compare  -80E-1  7      -> -1\r
+dqcom227 compare  -8.0    7E+0   -> -1\r
+dqcom228 compare  -8.0    70E-1  -> -1\r
+dqcom229 compare  -8      0.7E+1 -> -1\r
+dqcom230 compare  -8      70E-1  -> -1\r
+\r
+dqcom240 compare  -8.0    9.0    -> -1\r
+dqcom241 compare  -8.0    9      -> -1\r
+dqcom242 compare  -8      9.0    -> -1\r
+dqcom243 compare  -8E+0   9.0    -> -1\r
+dqcom244 compare  -80E-1  9.0    -> -1\r
+dqcom245 compare  -0.8E+1 9      -> -1\r
+dqcom246 compare  -80E-1  9      -> -1\r
+dqcom247 compare  -8.0    9E+0   -> -1\r
+dqcom248 compare  -8.0    90E-1  -> -1\r
+dqcom249 compare  -8      0.9E+1 -> -1\r
+dqcom250 compare  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+dqcom300 compare   7.0    -7.0    -> 1\r
+dqcom301 compare   7.0    -7      -> 1\r
+dqcom302 compare   7      -7.0    -> 1\r
+dqcom303 compare   7E+0   -7.0    -> 1\r
+dqcom304 compare   70E-1  -7.0    -> 1\r
+dqcom305 compare   .7E+1  -7      -> 1\r
+dqcom306 compare   70E-1  -7      -> 1\r
+dqcom307 compare   7.0    -7E+0   -> 1\r
+dqcom308 compare   7.0    -70E-1  -> 1\r
+dqcom309 compare   7      -.7E+1  -> 1\r
+dqcom310 compare   7      -70E-1  -> 1\r
+\r
+dqcom320 compare   8.0    -7.0    -> 1\r
+dqcom321 compare   8.0    -7      -> 1\r
+dqcom322 compare   8      -7.0    -> 1\r
+dqcom323 compare   8E+0   -7.0    -> 1\r
+dqcom324 compare   80E-1  -7.0    -> 1\r
+dqcom325 compare   .8E+1  -7      -> 1\r
+dqcom326 compare   80E-1  -7      -> 1\r
+dqcom327 compare   8.0    -7E+0   -> 1\r
+dqcom328 compare   8.0    -70E-1  -> 1\r
+dqcom329 compare   8      -.7E+1  -> 1\r
+dqcom330 compare   8      -70E-1  -> 1\r
+\r
+dqcom340 compare   8.0    -9.0    -> 1\r
+dqcom341 compare   8.0    -9      -> 1\r
+dqcom342 compare   8      -9.0    -> 1\r
+dqcom343 compare   8E+0   -9.0    -> 1\r
+dqcom344 compare   80E-1  -9.0    -> 1\r
+dqcom345 compare   .8E+1  -9      -> 1\r
+dqcom346 compare   80E-1  -9      -> 1\r
+dqcom347 compare   8.0    -9E+0   -> 1\r
+dqcom348 compare   8.0    -90E-1  -> 1\r
+dqcom349 compare   8      -.9E+1  -> 1\r
+dqcom350 compare   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+dqcom400 compare   -7.0    -7.0    -> 0\r
+dqcom401 compare   -7.0    -7      -> 0\r
+dqcom402 compare   -7      -7.0    -> 0\r
+dqcom403 compare   -7E+0   -7.0    -> 0\r
+dqcom404 compare   -70E-1  -7.0    -> 0\r
+dqcom405 compare   -.7E+1  -7      -> 0\r
+dqcom406 compare   -70E-1  -7      -> 0\r
+dqcom407 compare   -7.0    -7E+0   -> 0\r
+dqcom408 compare   -7.0    -70E-1  -> 0\r
+dqcom409 compare   -7      -.7E+1  -> 0\r
+dqcom410 compare   -7      -70E-1  -> 0\r
+\r
+dqcom420 compare   -8.0    -7.0    -> -1\r
+dqcom421 compare   -8.0    -7      -> -1\r
+dqcom422 compare   -8      -7.0    -> -1\r
+dqcom423 compare   -8E+0   -7.0    -> -1\r
+dqcom424 compare   -80E-1  -7.0    -> -1\r
+dqcom425 compare   -.8E+1  -7      -> -1\r
+dqcom426 compare   -80E-1  -7      -> -1\r
+dqcom427 compare   -8.0    -7E+0   -> -1\r
+dqcom428 compare   -8.0    -70E-1  -> -1\r
+dqcom429 compare   -8      -.7E+1  -> -1\r
+dqcom430 compare   -8      -70E-1  -> -1\r
+\r
+dqcom440 compare   -8.0    -9.0    -> 1\r
+dqcom441 compare   -8.0    -9      -> 1\r
+dqcom442 compare   -8      -9.0    -> 1\r
+dqcom443 compare   -8E+0   -9.0    -> 1\r
+dqcom444 compare   -80E-1  -9.0    -> 1\r
+dqcom445 compare   -.8E+1  -9      -> 1\r
+dqcom446 compare   -80E-1  -9      -> 1\r
+dqcom447 compare   -8.0    -9E+0   -> 1\r
+dqcom448 compare   -8.0    -90E-1  -> 1\r
+dqcom449 compare   -8      -.9E+1  -> 1\r
+dqcom450 compare   -8      -90E-1  -> 1\r
+\r
+-- misalignment traps for little-endian\r
+dqcom451 compare      1.0       0.1  -> 1\r
+dqcom452 compare      0.1       1.0  -> -1\r
+dqcom453 compare     10.0       0.1  -> 1\r
+dqcom454 compare      0.1      10.0  -> -1\r
+dqcom455 compare      100       1.0  -> 1\r
+dqcom456 compare      1.0       100  -> -1\r
+dqcom457 compare     1000      10.0  -> 1\r
+dqcom458 compare     10.0      1000  -> -1\r
+dqcom459 compare    10000     100.0  -> 1\r
+dqcom460 compare    100.0     10000  -> -1\r
+dqcom461 compare   100000    1000.0  -> 1\r
+dqcom462 compare   1000.0    100000  -> -1\r
+dqcom463 compare  1000000   10000.0  -> 1\r
+dqcom464 compare  10000.0   1000000  -> -1\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0\r
+dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0\r
+dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0\r
+dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0\r
+dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0\r
+dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0\r
+dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0\r
+dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0\r
+dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0\r
+dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0\r
+dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0\r
+dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0\r
+dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0\r
+dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0\r
+dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0\r
+dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0\r
+dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0\r
+dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0\r
+dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+dqcom500 compare    1     1E-15    -> 1\r
+dqcom501 compare    1     1E-14    -> 1\r
+dqcom502 compare    1     1E-13    -> 1\r
+dqcom503 compare    1     1E-12    -> 1\r
+dqcom504 compare    1     1E-11    -> 1\r
+dqcom505 compare    1     1E-10    -> 1\r
+dqcom506 compare    1     1E-9     -> 1\r
+dqcom507 compare    1     1E-8     -> 1\r
+dqcom508 compare    1     1E-7     -> 1\r
+dqcom509 compare    1     1E-6     -> 1\r
+dqcom510 compare    1     1E-5     -> 1\r
+dqcom511 compare    1     1E-4     -> 1\r
+dqcom512 compare    1     1E-3     -> 1\r
+dqcom513 compare    1     1E-2     -> 1\r
+dqcom514 compare    1     1E-1     -> 1\r
+dqcom515 compare    1     1E-0     -> 0\r
+dqcom516 compare    1     1E+1     -> -1\r
+dqcom517 compare    1     1E+2     -> -1\r
+dqcom518 compare    1     1E+3     -> -1\r
+dqcom519 compare    1     1E+4     -> -1\r
+dqcom521 compare    1     1E+5     -> -1\r
+dqcom522 compare    1     1E+6     -> -1\r
+dqcom523 compare    1     1E+7     -> -1\r
+dqcom524 compare    1     1E+8     -> -1\r
+dqcom525 compare    1     1E+9     -> -1\r
+dqcom526 compare    1     1E+10    -> -1\r
+dqcom527 compare    1     1E+11    -> -1\r
+dqcom528 compare    1     1E+12    -> -1\r
+dqcom529 compare    1     1E+13    -> -1\r
+dqcom530 compare    1     1E+14    -> -1\r
+dqcom531 compare    1     1E+15    -> -1\r
+-- LR swap\r
+dqcom540 compare    1E-15  1       -> -1\r
+dqcom541 compare    1E-14  1       -> -1\r
+dqcom542 compare    1E-13  1       -> -1\r
+dqcom543 compare    1E-12  1       -> -1\r
+dqcom544 compare    1E-11  1       -> -1\r
+dqcom545 compare    1E-10  1       -> -1\r
+dqcom546 compare    1E-9   1       -> -1\r
+dqcom547 compare    1E-8   1       -> -1\r
+dqcom548 compare    1E-7   1       -> -1\r
+dqcom549 compare    1E-6   1       -> -1\r
+dqcom550 compare    1E-5   1       -> -1\r
+dqcom551 compare    1E-4   1       -> -1\r
+dqcom552 compare    1E-3   1       -> -1\r
+dqcom553 compare    1E-2   1       -> -1\r
+dqcom554 compare    1E-1   1       -> -1\r
+dqcom555 compare    1E-0   1       ->  0\r
+dqcom556 compare    1E+1   1       ->  1\r
+dqcom557 compare    1E+2   1       ->  1\r
+dqcom558 compare    1E+3   1       ->  1\r
+dqcom559 compare    1E+4   1       ->  1\r
+dqcom561 compare    1E+5   1       ->  1\r
+dqcom562 compare    1E+6   1       ->  1\r
+dqcom563 compare    1E+7   1       ->  1\r
+dqcom564 compare    1E+8   1       ->  1\r
+dqcom565 compare    1E+9   1       ->  1\r
+dqcom566 compare    1E+10  1       ->  1\r
+dqcom567 compare    1E+11  1       ->  1\r
+dqcom568 compare    1E+12  1       ->  1\r
+dqcom569 compare    1E+13  1       ->  1\r
+dqcom570 compare    1E+14  1       ->  1\r
+dqcom571 compare    1E+15  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+dqcom580 compare  0.000000987654321     1E-15    -> 1\r
+dqcom581 compare  0.000000987654321     1E-14    -> 1\r
+dqcom582 compare  0.000000987654321     1E-13    -> 1\r
+dqcom583 compare  0.000000987654321     1E-12    -> 1\r
+dqcom584 compare  0.000000987654321     1E-11    -> 1\r
+dqcom585 compare  0.000000987654321     1E-10    -> 1\r
+dqcom586 compare  0.000000987654321     1E-9     -> 1\r
+dqcom587 compare  0.000000987654321     1E-8     -> 1\r
+dqcom588 compare  0.000000987654321     1E-7     -> 1\r
+dqcom589 compare  0.000000987654321     1E-6     -> -1\r
+dqcom590 compare  0.000000987654321     1E-5     -> -1\r
+dqcom591 compare  0.000000987654321     1E-4     -> -1\r
+dqcom592 compare  0.000000987654321     1E-3     -> -1\r
+dqcom593 compare  0.000000987654321     1E-2     -> -1\r
+dqcom594 compare  0.000000987654321     1E-1     -> -1\r
+dqcom595 compare  0.000000987654321     1E-0     -> -1\r
+dqcom596 compare  0.000000987654321     1E+1     -> -1\r
+dqcom597 compare  0.000000987654321     1E+2     -> -1\r
+dqcom598 compare  0.000000987654321     1E+3     -> -1\r
+dqcom599 compare  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+dqcom600 compare   12            12.2345 -> -1\r
+dqcom601 compare   12.0          12.2345 -> -1\r
+dqcom602 compare   12.00         12.2345 -> -1\r
+dqcom603 compare   12.000        12.2345 -> -1\r
+dqcom604 compare   12.0000       12.2345 -> -1\r
+dqcom605 compare   12.00000      12.2345 -> -1\r
+dqcom606 compare   12.000000     12.2345 -> -1\r
+dqcom607 compare   12.0000000    12.2345 -> -1\r
+dqcom608 compare   12.00000000   12.2345 -> -1\r
+dqcom609 compare   12.000000000  12.2345 -> -1\r
+dqcom610 compare   12.1234 12            ->  1\r
+dqcom611 compare   12.1234 12.0          ->  1\r
+dqcom612 compare   12.1234 12.00         ->  1\r
+dqcom613 compare   12.1234 12.000        ->  1\r
+dqcom614 compare   12.1234 12.0000       ->  1\r
+dqcom615 compare   12.1234 12.00000      ->  1\r
+dqcom616 compare   12.1234 12.000000     ->  1\r
+dqcom617 compare   12.1234 12.0000000    ->  1\r
+dqcom618 compare   12.1234 12.00000000   ->  1\r
+dqcom619 compare   12.1234 12.000000000  ->  1\r
+dqcom620 compare  -12           -12.2345 ->  1\r
+dqcom621 compare  -12.0         -12.2345 ->  1\r
+dqcom622 compare  -12.00        -12.2345 ->  1\r
+dqcom623 compare  -12.000       -12.2345 ->  1\r
+dqcom624 compare  -12.0000      -12.2345 ->  1\r
+dqcom625 compare  -12.00000     -12.2345 ->  1\r
+dqcom626 compare  -12.000000    -12.2345 ->  1\r
+dqcom627 compare  -12.0000000   -12.2345 ->  1\r
+dqcom628 compare  -12.00000000  -12.2345 ->  1\r
+dqcom629 compare  -12.000000000 -12.2345 ->  1\r
+dqcom630 compare  -12.1234 -12           -> -1\r
+dqcom631 compare  -12.1234 -12.0         -> -1\r
+dqcom632 compare  -12.1234 -12.00        -> -1\r
+dqcom633 compare  -12.1234 -12.000       -> -1\r
+dqcom634 compare  -12.1234 -12.0000      -> -1\r
+dqcom635 compare  -12.1234 -12.00000     -> -1\r
+dqcom636 compare  -12.1234 -12.000000    -> -1\r
+dqcom637 compare  -12.1234 -12.0000000   -> -1\r
+dqcom638 compare  -12.1234 -12.00000000  -> -1\r
+dqcom639 compare  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+dqcom640 compare   0     0   -> 0\r
+dqcom641 compare   0    -0   -> 0\r
+dqcom642 compare   0    -0.0 -> 0\r
+dqcom643 compare   0     0.0 -> 0\r
+dqcom644 compare  -0     0   -> 0\r
+dqcom645 compare  -0    -0   -> 0\r
+dqcom646 compare  -0    -0.0 -> 0\r
+dqcom647 compare  -0     0.0 -> 0\r
+dqcom648 compare   0.0   0   -> 0\r
+dqcom649 compare   0.0  -0   -> 0\r
+dqcom650 compare   0.0  -0.0 -> 0\r
+dqcom651 compare   0.0   0.0 -> 0\r
+dqcom652 compare  -0.0   0   -> 0\r
+dqcom653 compare  -0.0  -0   -> 0\r
+dqcom654 compare  -0.0  -0.0 -> 0\r
+dqcom655 compare  -0.0   0.0 -> 0\r
+\r
+dqcom656 compare  -0E1   0.0 -> 0\r
+dqcom657 compare  -0E2   0.0 -> 0\r
+dqcom658 compare   0E1   0.0 -> 0\r
+dqcom659 compare   0E2   0.0 -> 0\r
+dqcom660 compare  -0E1   0   -> 0\r
+dqcom661 compare  -0E2   0   -> 0\r
+dqcom662 compare   0E1   0   -> 0\r
+dqcom663 compare   0E2   0   -> 0\r
+dqcom664 compare  -0E1  -0E1 -> 0\r
+dqcom665 compare  -0E2  -0E1 -> 0\r
+dqcom666 compare   0E1  -0E1 -> 0\r
+dqcom667 compare   0E2  -0E1 -> 0\r
+dqcom668 compare  -0E1  -0E2 -> 0\r
+dqcom669 compare  -0E2  -0E2 -> 0\r
+dqcom670 compare   0E1  -0E2 -> 0\r
+dqcom671 compare   0E2  -0E2 -> 0\r
+dqcom672 compare  -0E1   0E1 -> 0\r
+dqcom673 compare  -0E2   0E1 -> 0\r
+dqcom674 compare   0E1   0E1 -> 0\r
+dqcom675 compare   0E2   0E1 -> 0\r
+dqcom676 compare  -0E1   0E2 -> 0\r
+dqcom677 compare  -0E2   0E2 -> 0\r
+dqcom678 compare   0E1   0E2 -> 0\r
+dqcom679 compare   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+dqcom680 compare   12    12           -> 0\r
+dqcom681 compare   12    12.0         -> 0\r
+dqcom682 compare   12    12.00        -> 0\r
+dqcom683 compare   12    12.000       -> 0\r
+dqcom684 compare   12    12.0000      -> 0\r
+dqcom685 compare   12    12.00000     -> 0\r
+dqcom686 compare   12    12.000000    -> 0\r
+dqcom687 compare   12    12.0000000   -> 0\r
+dqcom688 compare   12    12.00000000  -> 0\r
+dqcom689 compare   12    12.000000000 -> 0\r
+dqcom690 compare   12              12 -> 0\r
+dqcom691 compare   12.0            12 -> 0\r
+dqcom692 compare   12.00           12 -> 0\r
+dqcom693 compare   12.000          12 -> 0\r
+dqcom694 compare   12.0000         12 -> 0\r
+dqcom695 compare   12.00000        12 -> 0\r
+dqcom696 compare   12.000000       12 -> 0\r
+dqcom697 compare   12.0000000      12 -> 0\r
+dqcom698 compare   12.00000000     12 -> 0\r
+dqcom699 compare   12.000000000    12 -> 0\r
+\r
+-- first, second, & last digit\r
+dqcom700 compare   1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1\r
+dqcom701 compare   1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0\r
+dqcom702 compare   1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1\r
+dqcom703 compare   1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1\r
+dqcom704 compare   1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0\r
+dqcom705 compare   1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1\r
+dqcom706 compare   1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1\r
+dqcom707 compare   1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0\r
+dqcom708 compare   1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1\r
+\r
+-- miscellaneous\r
+dqcom721 compare 12345678000 1 -> 1\r
+dqcom722 compare 1 12345678000 -> -1\r
+dqcom723 compare 1234567800  1 -> 1\r
+dqcom724 compare 1 1234567800  -> -1\r
+dqcom725 compare 1234567890  1 -> 1\r
+dqcom726 compare 1 1234567890  -> -1\r
+dqcom727 compare 1234567891  1 -> 1\r
+dqcom728 compare 1 1234567891  -> -1\r
+dqcom729 compare 12345678901 1 -> 1\r
+dqcom730 compare 1 12345678901 -> -1\r
+dqcom731 compare 1234567896  1 -> 1\r
+dqcom732 compare 1 1234567896  -> -1\r
+\r
+-- residue cases at lower precision\r
+dqcom740 compare  1  0.9999999  -> 1\r
+dqcom741 compare  1  0.999999   -> 1\r
+dqcom742 compare  1  0.99999    -> 1\r
+dqcom743 compare  1  1.0000     -> 0\r
+dqcom744 compare  1  1.00001    -> -1\r
+dqcom745 compare  1  1.000001   -> -1\r
+dqcom746 compare  1  1.0000001  -> -1\r
+dqcom750 compare  0.9999999  1  -> -1\r
+dqcom751 compare  0.999999   1  -> -1\r
+dqcom752 compare  0.99999    1  -> -1\r
+dqcom753 compare  1.0000     1  -> 0\r
+dqcom754 compare  1.00001    1  -> 1\r
+dqcom755 compare  1.000001   1  -> 1\r
+dqcom756 compare  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+dqcom780 compare  Inf  -Inf   ->  1\r
+dqcom781 compare  Inf  -1000  ->  1\r
+dqcom782 compare  Inf  -1     ->  1\r
+dqcom783 compare  Inf  -0     ->  1\r
+dqcom784 compare  Inf   0     ->  1\r
+dqcom785 compare  Inf   1     ->  1\r
+dqcom786 compare  Inf   1000  ->  1\r
+dqcom787 compare  Inf   Inf   ->  0\r
+dqcom788 compare -1000  Inf   -> -1\r
+dqcom789 compare -Inf   Inf   -> -1\r
+dqcom790 compare -1     Inf   -> -1\r
+dqcom791 compare -0     Inf   -> -1\r
+dqcom792 compare  0     Inf   -> -1\r
+dqcom793 compare  1     Inf   -> -1\r
+dqcom794 compare  1000  Inf   -> -1\r
+dqcom795 compare  Inf   Inf   ->  0\r
+\r
+dqcom800 compare -Inf  -Inf   ->  0\r
+dqcom801 compare -Inf  -1000  -> -1\r
+dqcom802 compare -Inf  -1     -> -1\r
+dqcom803 compare -Inf  -0     -> -1\r
+dqcom804 compare -Inf   0     -> -1\r
+dqcom805 compare -Inf   1     -> -1\r
+dqcom806 compare -Inf   1000  -> -1\r
+dqcom807 compare -Inf   Inf   -> -1\r
+dqcom808 compare -Inf  -Inf   ->  0\r
+dqcom809 compare -1000 -Inf   ->  1\r
+dqcom810 compare -1    -Inf   ->  1\r
+dqcom811 compare -0    -Inf   ->  1\r
+dqcom812 compare  0    -Inf   ->  1\r
+dqcom813 compare  1    -Inf   ->  1\r
+dqcom814 compare  1000 -Inf   ->  1\r
+dqcom815 compare  Inf  -Inf   ->  1\r
+\r
+dqcom821 compare  NaN -Inf    ->  NaN\r
+dqcom822 compare  NaN -1000   ->  NaN\r
+dqcom823 compare  NaN -1      ->  NaN\r
+dqcom824 compare  NaN -0      ->  NaN\r
+dqcom825 compare  NaN  0      ->  NaN\r
+dqcom826 compare  NaN  1      ->  NaN\r
+dqcom827 compare  NaN  1000   ->  NaN\r
+dqcom828 compare  NaN  Inf    ->  NaN\r
+dqcom829 compare  NaN  NaN    ->  NaN\r
+dqcom830 compare -Inf  NaN    ->  NaN\r
+dqcom831 compare -1000 NaN    ->  NaN\r
+dqcom832 compare -1    NaN    ->  NaN\r
+dqcom833 compare -0    NaN    ->  NaN\r
+dqcom834 compare  0    NaN    ->  NaN\r
+dqcom835 compare  1    NaN    ->  NaN\r
+dqcom836 compare  1000 NaN    ->  NaN\r
+dqcom837 compare  Inf  NaN    ->  NaN\r
+dqcom838 compare -NaN -NaN    -> -NaN\r
+dqcom839 compare +NaN -NaN    ->  NaN\r
+dqcom840 compare -NaN +NaN    -> -NaN\r
+\r
+dqcom841 compare  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqcom842 compare  sNaN -1000  ->  NaN  Invalid_operation\r
+dqcom843 compare  sNaN -1     ->  NaN  Invalid_operation\r
+dqcom844 compare  sNaN -0     ->  NaN  Invalid_operation\r
+dqcom845 compare  sNaN  0     ->  NaN  Invalid_operation\r
+dqcom846 compare  sNaN  1     ->  NaN  Invalid_operation\r
+dqcom847 compare  sNaN  1000  ->  NaN  Invalid_operation\r
+dqcom848 compare  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqcom849 compare  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqcom850 compare  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqcom851 compare -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqcom852 compare -1000 sNaN   ->  NaN  Invalid_operation\r
+dqcom853 compare -1    sNaN   ->  NaN  Invalid_operation\r
+dqcom854 compare -0    sNaN   ->  NaN  Invalid_operation\r
+dqcom855 compare  0    sNaN   ->  NaN  Invalid_operation\r
+dqcom856 compare  1    sNaN   ->  NaN  Invalid_operation\r
+dqcom857 compare  1000 sNaN   ->  NaN  Invalid_operation\r
+dqcom858 compare  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqcom859 compare  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqcom860 compare  NaN9 -Inf   ->  NaN9\r
+dqcom861 compare  NaN8  999   ->  NaN8\r
+dqcom862 compare  NaN77 Inf   ->  NaN77\r
+dqcom863 compare -NaN67 NaN5  -> -NaN67\r
+dqcom864 compare -Inf  -NaN4  -> -NaN4\r
+dqcom865 compare -999  -NaN33 -> -NaN33\r
+dqcom866 compare  Inf   NaN2  ->  NaN2\r
+dqcom867 compare -NaN41 -NaN42 -> -NaN41\r
+dqcom868 compare +NaN41 -NaN42 ->  NaN41\r
+dqcom869 compare -NaN41 +NaN42 -> -NaN41\r
+dqcom870 compare +NaN41 +NaN42 ->  NaN41\r
+\r
+dqcom871 compare -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqcom872 compare  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqcom873 compare  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqcom874 compare  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+dqcom875 compare  NaN85  sNaN83  ->  NaN83 Invalid_operation\r
+dqcom876 compare -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqcom877 compare  088    sNaN81  ->  NaN81 Invalid_operation\r
+dqcom878 compare  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dqcom879 compare  NaN   -sNaN89  -> -NaN89 Invalid_operation\r
+\r
+-- wide range\r
+dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1\r
+dqcom881 compare 9E+6144 +1.23456789012345E-0 ->  1\r
+dqcom882 compare +0.100 9E-6143               ->  1\r
+dqcom883 compare 9E-6143 +0.100               -> -1\r
+dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1\r
+dqcom886 compare 9E+6144 -1.23456789012345E-0 ->  1\r
+dqcom887 compare -0.100 9E-6143               -> -1\r
+dqcom888 compare 9E-6143 -0.100               ->  1\r
+\r
+-- signs\r
+dqcom901 compare  1e+77  1e+11 ->  1\r
+dqcom902 compare  1e+77 -1e+11 ->  1\r
+dqcom903 compare -1e+77  1e+11 -> -1\r
+dqcom904 compare -1e+77 -1e+11 -> -1\r
+dqcom905 compare  1e-77  1e-11 -> -1\r
+dqcom906 compare  1e-77 -1e-11 ->  1\r
+dqcom907 compare -1e-77  1e-11 -> -1\r
+dqcom908 compare -1e-77 -1e-11 ->  1\r
+\r
+-- full alignment range, both ways\r
+dqcomp1001 compare 1 1.000000000000000000000000000000000  -> 0\r
+dqcomp1002 compare 1 1.00000000000000000000000000000000   -> 0\r
+dqcomp1003 compare 1 1.0000000000000000000000000000000    -> 0\r
+dqcomp1004 compare 1 1.000000000000000000000000000000     -> 0\r
+dqcomp1005 compare 1 1.00000000000000000000000000000      -> 0\r
+dqcomp1006 compare 1 1.0000000000000000000000000000       -> 0\r
+dqcomp1007 compare 1 1.000000000000000000000000000        -> 0\r
+dqcomp1008 compare 1 1.00000000000000000000000000         -> 0\r
+dqcomp1009 compare 1 1.0000000000000000000000000          -> 0\r
+dqcomp1010 compare 1 1.000000000000000000000000           -> 0\r
+dqcomp1011 compare 1 1.00000000000000000000000            -> 0\r
+dqcomp1012 compare 1 1.0000000000000000000000             -> 0\r
+dqcomp1013 compare 1 1.000000000000000000000              -> 0\r
+dqcomp1014 compare 1 1.00000000000000000000               -> 0\r
+dqcomp1015 compare 1 1.0000000000000000000                -> 0\r
+dqcomp1016 compare 1 1.000000000000000000                 -> 0\r
+dqcomp1017 compare 1 1.00000000000000000                  -> 0\r
+dqcomp1018 compare 1 1.0000000000000000                   -> 0\r
+dqcomp1019 compare 1 1.000000000000000  -> 0\r
+dqcomp1020 compare 1 1.00000000000000   -> 0\r
+dqcomp1021 compare 1 1.0000000000000    -> 0\r
+dqcomp1022 compare 1 1.000000000000     -> 0\r
+dqcomp1023 compare 1 1.00000000000      -> 0\r
+dqcomp1024 compare 1 1.0000000000       -> 0\r
+dqcomp1025 compare 1 1.000000000        -> 0\r
+dqcomp1026 compare 1 1.00000000         -> 0\r
+dqcomp1027 compare 1 1.0000000          -> 0\r
+dqcomp1028 compare 1 1.000000           -> 0\r
+dqcomp1029 compare 1 1.00000            -> 0\r
+dqcomp1030 compare 1 1.0000             -> 0\r
+dqcomp1031 compare 1 1.000              -> 0\r
+dqcomp1032 compare 1 1.00               -> 0\r
+dqcomp1033 compare 1 1.0                -> 0\r
+\r
+dqcomp1041 compare 1.000000000000000000000000000000000  1 -> 0\r
+dqcomp1042 compare 1.00000000000000000000000000000000   1 -> 0\r
+dqcomp1043 compare 1.0000000000000000000000000000000    1 -> 0\r
+dqcomp1044 compare 1.000000000000000000000000000000     1 -> 0\r
+dqcomp1045 compare 1.00000000000000000000000000000      1 -> 0\r
+dqcomp1046 compare 1.0000000000000000000000000000       1 -> 0\r
+dqcomp1047 compare 1.000000000000000000000000000        1 -> 0\r
+dqcomp1048 compare 1.00000000000000000000000000         1 -> 0\r
+dqcomp1049 compare 1.0000000000000000000000000          1 -> 0\r
+dqcomp1050 compare 1.000000000000000000000000           1 -> 0\r
+dqcomp1051 compare 1.00000000000000000000000            1 -> 0\r
+dqcomp1052 compare 1.0000000000000000000000             1 -> 0\r
+dqcomp1053 compare 1.000000000000000000000              1 -> 0\r
+dqcomp1054 compare 1.00000000000000000000               1 -> 0\r
+dqcomp1055 compare 1.0000000000000000000                1 -> 0\r
+dqcomp1056 compare 1.000000000000000000                 1 -> 0\r
+dqcomp1057 compare 1.00000000000000000                  1 -> 0\r
+dqcomp1058 compare 1.0000000000000000                   1 -> 0\r
+dqcomp1059 compare 1.000000000000000  1 -> 0\r
+dqcomp1060 compare 1.00000000000000   1 -> 0\r
+dqcomp1061 compare 1.0000000000000    1 -> 0\r
+dqcomp1062 compare 1.000000000000     1 -> 0\r
+dqcomp1063 compare 1.00000000000      1 -> 0\r
+dqcomp1064 compare 1.0000000000       1 -> 0\r
+dqcomp1065 compare 1.000000000        1 -> 0\r
+dqcomp1066 compare 1.00000000         1 -> 0\r
+dqcomp1067 compare 1.0000000          1 -> 0\r
+dqcomp1068 compare 1.000000           1 -> 0\r
+dqcomp1069 compare 1.00000            1 -> 0\r
+dqcomp1070 compare 1.0000             1 -> 0\r
+dqcomp1071 compare 1.000              1 -> 0\r
+dqcomp1072 compare 1.00               1 -> 0\r
+dqcomp1073 compare 1.0                1 -> 0\r
+\r
+-- check MSD always detected non-zero\r
+dqcomp1080 compare 0 0.000000000000000000000000000000000  -> 0\r
+dqcomp1081 compare 0 1.000000000000000000000000000000000  -> -1\r
+dqcomp1082 compare 0 2.000000000000000000000000000000000  -> -1\r
+dqcomp1083 compare 0 3.000000000000000000000000000000000  -> -1\r
+dqcomp1084 compare 0 4.000000000000000000000000000000000  -> -1\r
+dqcomp1085 compare 0 5.000000000000000000000000000000000  -> -1\r
+dqcomp1086 compare 0 6.000000000000000000000000000000000  -> -1\r
+dqcomp1087 compare 0 7.000000000000000000000000000000000  -> -1\r
+dqcomp1088 compare 0 8.000000000000000000000000000000000  -> -1\r
+dqcomp1089 compare 0 9.000000000000000000000000000000000  -> -1\r
+dqcomp1090 compare 0.000000000000000000000000000000000  0 -> 0\r
+dqcomp1091 compare 1.000000000000000000000000000000000  0 -> 1\r
+dqcomp1092 compare 2.000000000000000000000000000000000  0 -> 1\r
+dqcomp1093 compare 3.000000000000000000000000000000000  0 -> 1\r
+dqcomp1094 compare 4.000000000000000000000000000000000  0 -> 1\r
+dqcomp1095 compare 5.000000000000000000000000000000000  0 -> 1\r
+dqcomp1096 compare 6.000000000000000000000000000000000  0 -> 1\r
+dqcomp1097 compare 7.000000000000000000000000000000000  0 -> 1\r
+dqcomp1098 compare 8.000000000000000000000000000000000  0 -> 1\r
+dqcomp1099 compare 9.000000000000000000000000000000000  0 -> 1\r
+\r
+-- Null tests\r
+dqcom990 compare 10  # -> NaN Invalid_operation\r
+dqcom991 compare  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqCompareSig.decTest b/Lib/test/decimaltestdata/dqCompareSig.decTest
new file mode 100644 (file)
index 0000000..43833ea
--- /dev/null
@@ -0,0 +1,647 @@
+------------------------------------------------------------------------\r
+-- dqCompareSig.decTest -- decQuad comparison; all NaNs signal        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqcms001 comparesig  -2  -2  -> 0\r
+dqcms002 comparesig  -2  -1  -> -1\r
+dqcms003 comparesig  -2   0  -> -1\r
+dqcms004 comparesig  -2   1  -> -1\r
+dqcms005 comparesig  -2   2  -> -1\r
+dqcms006 comparesig  -1  -2  -> 1\r
+dqcms007 comparesig  -1  -1  -> 0\r
+dqcms008 comparesig  -1   0  -> -1\r
+dqcms009 comparesig  -1   1  -> -1\r
+dqcms010 comparesig  -1   2  -> -1\r
+dqcms011 comparesig   0  -2  -> 1\r
+dqcms012 comparesig   0  -1  -> 1\r
+dqcms013 comparesig   0   0  -> 0\r
+dqcms014 comparesig   0   1  -> -1\r
+dqcms015 comparesig   0   2  -> -1\r
+dqcms016 comparesig   1  -2  -> 1\r
+dqcms017 comparesig   1  -1  -> 1\r
+dqcms018 comparesig   1   0  -> 1\r
+dqcms019 comparesig   1   1  -> 0\r
+dqcms020 comparesig   1   2  -> -1\r
+dqcms021 comparesig   2  -2  -> 1\r
+dqcms022 comparesig   2  -1  -> 1\r
+dqcms023 comparesig   2   0  -> 1\r
+dqcms025 comparesig   2   1  -> 1\r
+dqcms026 comparesig   2   2  -> 0\r
+\r
+dqcms031 comparesig  -20  -20  -> 0\r
+dqcms032 comparesig  -20  -10  -> -1\r
+dqcms033 comparesig  -20   00  -> -1\r
+dqcms034 comparesig  -20   10  -> -1\r
+dqcms035 comparesig  -20   20  -> -1\r
+dqcms036 comparesig  -10  -20  -> 1\r
+dqcms037 comparesig  -10  -10  -> 0\r
+dqcms038 comparesig  -10   00  -> -1\r
+dqcms039 comparesig  -10   10  -> -1\r
+dqcms040 comparesig  -10   20  -> -1\r
+dqcms041 comparesig   00  -20  -> 1\r
+dqcms042 comparesig   00  -10  -> 1\r
+dqcms043 comparesig   00   00  -> 0\r
+dqcms044 comparesig   00   10  -> -1\r
+dqcms045 comparesig   00   20  -> -1\r
+dqcms046 comparesig   10  -20  -> 1\r
+dqcms047 comparesig   10  -10  -> 1\r
+dqcms048 comparesig   10   00  -> 1\r
+dqcms049 comparesig   10   10  -> 0\r
+dqcms050 comparesig   10   20  -> -1\r
+dqcms051 comparesig   20  -20  -> 1\r
+dqcms052 comparesig   20  -10  -> 1\r
+dqcms053 comparesig   20   00  -> 1\r
+dqcms055 comparesig   20   10  -> 1\r
+dqcms056 comparesig   20   20  -> 0\r
+\r
+dqcms061 comparesig  -2.0  -2.0  -> 0\r
+dqcms062 comparesig  -2.0  -1.0  -> -1\r
+dqcms063 comparesig  -2.0   0.0  -> -1\r
+dqcms064 comparesig  -2.0   1.0  -> -1\r
+dqcms065 comparesig  -2.0   2.0  -> -1\r
+dqcms066 comparesig  -1.0  -2.0  -> 1\r
+dqcms067 comparesig  -1.0  -1.0  -> 0\r
+dqcms068 comparesig  -1.0   0.0  -> -1\r
+dqcms069 comparesig  -1.0   1.0  -> -1\r
+dqcms070 comparesig  -1.0   2.0  -> -1\r
+dqcms071 comparesig   0.0  -2.0  -> 1\r
+dqcms072 comparesig   0.0  -1.0  -> 1\r
+dqcms073 comparesig   0.0   0.0  -> 0\r
+dqcms074 comparesig   0.0   1.0  -> -1\r
+dqcms075 comparesig   0.0   2.0  -> -1\r
+dqcms076 comparesig   1.0  -2.0  -> 1\r
+dqcms077 comparesig   1.0  -1.0  -> 1\r
+dqcms078 comparesig   1.0   0.0  -> 1\r
+dqcms079 comparesig   1.0   1.0  -> 0\r
+dqcms080 comparesig   1.0   2.0  -> -1\r
+dqcms081 comparesig   2.0  -2.0  -> 1\r
+dqcms082 comparesig   2.0  -1.0  -> 1\r
+dqcms083 comparesig   2.0   0.0  -> 1\r
+dqcms085 comparesig   2.0   1.0  -> 1\r
+dqcms086 comparesig   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+dqcms090 comparesig  9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144  -> 0\r
+dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144  -> -1\r
+dqcms092 comparesig  9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1\r
+dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0\r
+\r
+-- some differing length/exponent cases\r
+dqcms100 comparesig   7.0    7.0    -> 0\r
+dqcms101 comparesig   7.0    7      -> 0\r
+dqcms102 comparesig   7      7.0    -> 0\r
+dqcms103 comparesig   7E+0   7.0    -> 0\r
+dqcms104 comparesig   70E-1  7.0    -> 0\r
+dqcms105 comparesig   0.7E+1 7      -> 0\r
+dqcms106 comparesig   70E-1  7      -> 0\r
+dqcms107 comparesig   7.0    7E+0   -> 0\r
+dqcms108 comparesig   7.0    70E-1  -> 0\r
+dqcms109 comparesig   7      0.7E+1 -> 0\r
+dqcms110 comparesig   7      70E-1  -> 0\r
+\r
+dqcms120 comparesig   8.0    7.0    -> 1\r
+dqcms121 comparesig   8.0    7      -> 1\r
+dqcms122 comparesig   8      7.0    -> 1\r
+dqcms123 comparesig   8E+0   7.0    -> 1\r
+dqcms124 comparesig   80E-1  7.0    -> 1\r
+dqcms125 comparesig   0.8E+1 7      -> 1\r
+dqcms126 comparesig   80E-1  7      -> 1\r
+dqcms127 comparesig   8.0    7E+0   -> 1\r
+dqcms128 comparesig   8.0    70E-1  -> 1\r
+dqcms129 comparesig   8      0.7E+1  -> 1\r
+dqcms130 comparesig   8      70E-1  -> 1\r
+\r
+dqcms140 comparesig   8.0    9.0    -> -1\r
+dqcms141 comparesig   8.0    9      -> -1\r
+dqcms142 comparesig   8      9.0    -> -1\r
+dqcms143 comparesig   8E+0   9.0    -> -1\r
+dqcms144 comparesig   80E-1  9.0    -> -1\r
+dqcms145 comparesig   0.8E+1 9      -> -1\r
+dqcms146 comparesig   80E-1  9      -> -1\r
+dqcms147 comparesig   8.0    9E+0   -> -1\r
+dqcms148 comparesig   8.0    90E-1  -> -1\r
+dqcms149 comparesig   8      0.9E+1 -> -1\r
+dqcms150 comparesig   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+dqcms200 comparesig  -7.0    7.0    -> -1\r
+dqcms201 comparesig  -7.0    7      -> -1\r
+dqcms202 comparesig  -7      7.0    -> -1\r
+dqcms203 comparesig  -7E+0   7.0    -> -1\r
+dqcms204 comparesig  -70E-1  7.0    -> -1\r
+dqcms205 comparesig  -0.7E+1 7      -> -1\r
+dqcms206 comparesig  -70E-1  7      -> -1\r
+dqcms207 comparesig  -7.0    7E+0   -> -1\r
+dqcms208 comparesig  -7.0    70E-1  -> -1\r
+dqcms209 comparesig  -7      0.7E+1 -> -1\r
+dqcms210 comparesig  -7      70E-1  -> -1\r
+\r
+dqcms220 comparesig  -8.0    7.0    -> -1\r
+dqcms221 comparesig  -8.0    7      -> -1\r
+dqcms222 comparesig  -8      7.0    -> -1\r
+dqcms223 comparesig  -8E+0   7.0    -> -1\r
+dqcms224 comparesig  -80E-1  7.0    -> -1\r
+dqcms225 comparesig  -0.8E+1 7      -> -1\r
+dqcms226 comparesig  -80E-1  7      -> -1\r
+dqcms227 comparesig  -8.0    7E+0   -> -1\r
+dqcms228 comparesig  -8.0    70E-1  -> -1\r
+dqcms229 comparesig  -8      0.7E+1 -> -1\r
+dqcms230 comparesig  -8      70E-1  -> -1\r
+\r
+dqcms240 comparesig  -8.0    9.0    -> -1\r
+dqcms241 comparesig  -8.0    9      -> -1\r
+dqcms242 comparesig  -8      9.0    -> -1\r
+dqcms243 comparesig  -8E+0   9.0    -> -1\r
+dqcms244 comparesig  -80E-1  9.0    -> -1\r
+dqcms245 comparesig  -0.8E+1 9      -> -1\r
+dqcms246 comparesig  -80E-1  9      -> -1\r
+dqcms247 comparesig  -8.0    9E+0   -> -1\r
+dqcms248 comparesig  -8.0    90E-1  -> -1\r
+dqcms249 comparesig  -8      0.9E+1 -> -1\r
+dqcms250 comparesig  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+dqcms300 comparesig   7.0    -7.0    -> 1\r
+dqcms301 comparesig   7.0    -7      -> 1\r
+dqcms302 comparesig   7      -7.0    -> 1\r
+dqcms303 comparesig   7E+0   -7.0    -> 1\r
+dqcms304 comparesig   70E-1  -7.0    -> 1\r
+dqcms305 comparesig   .7E+1  -7      -> 1\r
+dqcms306 comparesig   70E-1  -7      -> 1\r
+dqcms307 comparesig   7.0    -7E+0   -> 1\r
+dqcms308 comparesig   7.0    -70E-1  -> 1\r
+dqcms309 comparesig   7      -.7E+1  -> 1\r
+dqcms310 comparesig   7      -70E-1  -> 1\r
+\r
+dqcms320 comparesig   8.0    -7.0    -> 1\r
+dqcms321 comparesig   8.0    -7      -> 1\r
+dqcms322 comparesig   8      -7.0    -> 1\r
+dqcms323 comparesig   8E+0   -7.0    -> 1\r
+dqcms324 comparesig   80E-1  -7.0    -> 1\r
+dqcms325 comparesig   .8E+1  -7      -> 1\r
+dqcms326 comparesig   80E-1  -7      -> 1\r
+dqcms327 comparesig   8.0    -7E+0   -> 1\r
+dqcms328 comparesig   8.0    -70E-1  -> 1\r
+dqcms329 comparesig   8      -.7E+1  -> 1\r
+dqcms330 comparesig   8      -70E-1  -> 1\r
+\r
+dqcms340 comparesig   8.0    -9.0    -> 1\r
+dqcms341 comparesig   8.0    -9      -> 1\r
+dqcms342 comparesig   8      -9.0    -> 1\r
+dqcms343 comparesig   8E+0   -9.0    -> 1\r
+dqcms344 comparesig   80E-1  -9.0    -> 1\r
+dqcms345 comparesig   .8E+1  -9      -> 1\r
+dqcms346 comparesig   80E-1  -9      -> 1\r
+dqcms347 comparesig   8.0    -9E+0   -> 1\r
+dqcms348 comparesig   8.0    -90E-1  -> 1\r
+dqcms349 comparesig   8      -.9E+1  -> 1\r
+dqcms350 comparesig   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+dqcms400 comparesig   -7.0    -7.0    -> 0\r
+dqcms401 comparesig   -7.0    -7      -> 0\r
+dqcms402 comparesig   -7      -7.0    -> 0\r
+dqcms403 comparesig   -7E+0   -7.0    -> 0\r
+dqcms404 comparesig   -70E-1  -7.0    -> 0\r
+dqcms405 comparesig   -.7E+1  -7      -> 0\r
+dqcms406 comparesig   -70E-1  -7      -> 0\r
+dqcms407 comparesig   -7.0    -7E+0   -> 0\r
+dqcms408 comparesig   -7.0    -70E-1  -> 0\r
+dqcms409 comparesig   -7      -.7E+1  -> 0\r
+dqcms410 comparesig   -7      -70E-1  -> 0\r
+\r
+dqcms420 comparesig   -8.0    -7.0    -> -1\r
+dqcms421 comparesig   -8.0    -7      -> -1\r
+dqcms422 comparesig   -8      -7.0    -> -1\r
+dqcms423 comparesig   -8E+0   -7.0    -> -1\r
+dqcms424 comparesig   -80E-1  -7.0    -> -1\r
+dqcms425 comparesig   -.8E+1  -7      -> -1\r
+dqcms426 comparesig   -80E-1  -7      -> -1\r
+dqcms427 comparesig   -8.0    -7E+0   -> -1\r
+dqcms428 comparesig   -8.0    -70E-1  -> -1\r
+dqcms429 comparesig   -8      -.7E+1  -> -1\r
+dqcms430 comparesig   -8      -70E-1  -> -1\r
+\r
+dqcms440 comparesig   -8.0    -9.0    -> 1\r
+dqcms441 comparesig   -8.0    -9      -> 1\r
+dqcms442 comparesig   -8      -9.0    -> 1\r
+dqcms443 comparesig   -8E+0   -9.0    -> 1\r
+dqcms444 comparesig   -80E-1  -9.0    -> 1\r
+dqcms445 comparesig   -.8E+1  -9      -> 1\r
+dqcms446 comparesig   -80E-1  -9      -> 1\r
+dqcms447 comparesig   -8.0    -9E+0   -> 1\r
+dqcms448 comparesig   -8.0    -90E-1  -> 1\r
+dqcms449 comparesig   -8      -.9E+1  -> 1\r
+dqcms450 comparesig   -8      -90E-1  -> 1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0\r
+dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0\r
+dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0\r
+dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0\r
+dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0\r
+dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0\r
+dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0\r
+dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0\r
+dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0\r
+dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0\r
+dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0\r
+dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0\r
+dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0\r
+dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0\r
+dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0\r
+dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0\r
+dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0\r
+dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0\r
+dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0\r
+dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+dqcms500 comparesig    1     1E-15    -> 1\r
+dqcms501 comparesig    1     1E-14    -> 1\r
+dqcms502 comparesig    1     1E-13    -> 1\r
+dqcms503 comparesig    1     1E-12    -> 1\r
+dqcms504 comparesig    1     1E-11    -> 1\r
+dqcms505 comparesig    1     1E-10    -> 1\r
+dqcms506 comparesig    1     1E-9     -> 1\r
+dqcms507 comparesig    1     1E-8     -> 1\r
+dqcms508 comparesig    1     1E-7     -> 1\r
+dqcms509 comparesig    1     1E-6     -> 1\r
+dqcms510 comparesig    1     1E-5     -> 1\r
+dqcms511 comparesig    1     1E-4     -> 1\r
+dqcms512 comparesig    1     1E-3     -> 1\r
+dqcms513 comparesig    1     1E-2     -> 1\r
+dqcms514 comparesig    1     1E-1     -> 1\r
+dqcms515 comparesig    1     1E-0     -> 0\r
+dqcms516 comparesig    1     1E+1     -> -1\r
+dqcms517 comparesig    1     1E+2     -> -1\r
+dqcms518 comparesig    1     1E+3     -> -1\r
+dqcms519 comparesig    1     1E+4     -> -1\r
+dqcms521 comparesig    1     1E+5     -> -1\r
+dqcms522 comparesig    1     1E+6     -> -1\r
+dqcms523 comparesig    1     1E+7     -> -1\r
+dqcms524 comparesig    1     1E+8     -> -1\r
+dqcms525 comparesig    1     1E+9     -> -1\r
+dqcms526 comparesig    1     1E+10    -> -1\r
+dqcms527 comparesig    1     1E+11    -> -1\r
+dqcms528 comparesig    1     1E+12    -> -1\r
+dqcms529 comparesig    1     1E+13    -> -1\r
+dqcms530 comparesig    1     1E+14    -> -1\r
+dqcms531 comparesig    1     1E+15    -> -1\r
+-- LR swap\r
+dqcms540 comparesig    1E-15  1       -> -1\r
+dqcms541 comparesig    1E-14  1       -> -1\r
+dqcms542 comparesig    1E-13  1       -> -1\r
+dqcms543 comparesig    1E-12  1       -> -1\r
+dqcms544 comparesig    1E-11  1       -> -1\r
+dqcms545 comparesig    1E-10  1       -> -1\r
+dqcms546 comparesig    1E-9   1       -> -1\r
+dqcms547 comparesig    1E-8   1       -> -1\r
+dqcms548 comparesig    1E-7   1       -> -1\r
+dqcms549 comparesig    1E-6   1       -> -1\r
+dqcms550 comparesig    1E-5   1       -> -1\r
+dqcms551 comparesig    1E-4   1       -> -1\r
+dqcms552 comparesig    1E-3   1       -> -1\r
+dqcms553 comparesig    1E-2   1       -> -1\r
+dqcms554 comparesig    1E-1   1       -> -1\r
+dqcms555 comparesig    1E-0   1       ->  0\r
+dqcms556 comparesig    1E+1   1       ->  1\r
+dqcms557 comparesig    1E+2   1       ->  1\r
+dqcms558 comparesig    1E+3   1       ->  1\r
+dqcms559 comparesig    1E+4   1       ->  1\r
+dqcms561 comparesig    1E+5   1       ->  1\r
+dqcms562 comparesig    1E+6   1       ->  1\r
+dqcms563 comparesig    1E+7   1       ->  1\r
+dqcms564 comparesig    1E+8   1       ->  1\r
+dqcms565 comparesig    1E+9   1       ->  1\r
+dqcms566 comparesig    1E+10  1       ->  1\r
+dqcms567 comparesig    1E+11  1       ->  1\r
+dqcms568 comparesig    1E+12  1       ->  1\r
+dqcms569 comparesig    1E+13  1       ->  1\r
+dqcms570 comparesig    1E+14  1       ->  1\r
+dqcms571 comparesig    1E+15  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+dqcms580 comparesig  0.000000987654321     1E-15    -> 1\r
+dqcms581 comparesig  0.000000987654321     1E-14    -> 1\r
+dqcms582 comparesig  0.000000987654321     1E-13    -> 1\r
+dqcms583 comparesig  0.000000987654321     1E-12    -> 1\r
+dqcms584 comparesig  0.000000987654321     1E-11    -> 1\r
+dqcms585 comparesig  0.000000987654321     1E-10    -> 1\r
+dqcms586 comparesig  0.000000987654321     1E-9     -> 1\r
+dqcms587 comparesig  0.000000987654321     1E-8     -> 1\r
+dqcms588 comparesig  0.000000987654321     1E-7     -> 1\r
+dqcms589 comparesig  0.000000987654321     1E-6     -> -1\r
+dqcms590 comparesig  0.000000987654321     1E-5     -> -1\r
+dqcms591 comparesig  0.000000987654321     1E-4     -> -1\r
+dqcms592 comparesig  0.000000987654321     1E-3     -> -1\r
+dqcms593 comparesig  0.000000987654321     1E-2     -> -1\r
+dqcms594 comparesig  0.000000987654321     1E-1     -> -1\r
+dqcms595 comparesig  0.000000987654321     1E-0     -> -1\r
+dqcms596 comparesig  0.000000987654321     1E+1     -> -1\r
+dqcms597 comparesig  0.000000987654321     1E+2     -> -1\r
+dqcms598 comparesig  0.000000987654321     1E+3     -> -1\r
+dqcms599 comparesig  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+dqcms600 comparesig   12            12.2345 -> -1\r
+dqcms601 comparesig   12.0          12.2345 -> -1\r
+dqcms602 comparesig   12.00         12.2345 -> -1\r
+dqcms603 comparesig   12.000        12.2345 -> -1\r
+dqcms604 comparesig   12.0000       12.2345 -> -1\r
+dqcms605 comparesig   12.00000      12.2345 -> -1\r
+dqcms606 comparesig   12.000000     12.2345 -> -1\r
+dqcms607 comparesig   12.0000000    12.2345 -> -1\r
+dqcms608 comparesig   12.00000000   12.2345 -> -1\r
+dqcms609 comparesig   12.000000000  12.2345 -> -1\r
+dqcms610 comparesig   12.1234 12            ->  1\r
+dqcms611 comparesig   12.1234 12.0          ->  1\r
+dqcms612 comparesig   12.1234 12.00         ->  1\r
+dqcms613 comparesig   12.1234 12.000        ->  1\r
+dqcms614 comparesig   12.1234 12.0000       ->  1\r
+dqcms615 comparesig   12.1234 12.00000      ->  1\r
+dqcms616 comparesig   12.1234 12.000000     ->  1\r
+dqcms617 comparesig   12.1234 12.0000000    ->  1\r
+dqcms618 comparesig   12.1234 12.00000000   ->  1\r
+dqcms619 comparesig   12.1234 12.000000000  ->  1\r
+dqcms620 comparesig  -12           -12.2345 ->  1\r
+dqcms621 comparesig  -12.0         -12.2345 ->  1\r
+dqcms622 comparesig  -12.00        -12.2345 ->  1\r
+dqcms623 comparesig  -12.000       -12.2345 ->  1\r
+dqcms624 comparesig  -12.0000      -12.2345 ->  1\r
+dqcms625 comparesig  -12.00000     -12.2345 ->  1\r
+dqcms626 comparesig  -12.000000    -12.2345 ->  1\r
+dqcms627 comparesig  -12.0000000   -12.2345 ->  1\r
+dqcms628 comparesig  -12.00000000  -12.2345 ->  1\r
+dqcms629 comparesig  -12.000000000 -12.2345 ->  1\r
+dqcms630 comparesig  -12.1234 -12           -> -1\r
+dqcms631 comparesig  -12.1234 -12.0         -> -1\r
+dqcms632 comparesig  -12.1234 -12.00        -> -1\r
+dqcms633 comparesig  -12.1234 -12.000       -> -1\r
+dqcms634 comparesig  -12.1234 -12.0000      -> -1\r
+dqcms635 comparesig  -12.1234 -12.00000     -> -1\r
+dqcms636 comparesig  -12.1234 -12.000000    -> -1\r
+dqcms637 comparesig  -12.1234 -12.0000000   -> -1\r
+dqcms638 comparesig  -12.1234 -12.00000000  -> -1\r
+dqcms639 comparesig  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+dqcms640 comparesig   0     0   -> 0\r
+dqcms641 comparesig   0    -0   -> 0\r
+dqcms642 comparesig   0    -0.0 -> 0\r
+dqcms643 comparesig   0     0.0 -> 0\r
+dqcms644 comparesig  -0     0   -> 0\r
+dqcms645 comparesig  -0    -0   -> 0\r
+dqcms646 comparesig  -0    -0.0 -> 0\r
+dqcms647 comparesig  -0     0.0 -> 0\r
+dqcms648 comparesig   0.0   0   -> 0\r
+dqcms649 comparesig   0.0  -0   -> 0\r
+dqcms650 comparesig   0.0  -0.0 -> 0\r
+dqcms651 comparesig   0.0   0.0 -> 0\r
+dqcms652 comparesig  -0.0   0   -> 0\r
+dqcms653 comparesig  -0.0  -0   -> 0\r
+dqcms654 comparesig  -0.0  -0.0 -> 0\r
+dqcms655 comparesig  -0.0   0.0 -> 0\r
+\r
+dqcms656 comparesig  -0E1   0.0 -> 0\r
+dqcms657 comparesig  -0E2   0.0 -> 0\r
+dqcms658 comparesig   0E1   0.0 -> 0\r
+dqcms659 comparesig   0E2   0.0 -> 0\r
+dqcms660 comparesig  -0E1   0   -> 0\r
+dqcms661 comparesig  -0E2   0   -> 0\r
+dqcms662 comparesig   0E1   0   -> 0\r
+dqcms663 comparesig   0E2   0   -> 0\r
+dqcms664 comparesig  -0E1  -0E1 -> 0\r
+dqcms665 comparesig  -0E2  -0E1 -> 0\r
+dqcms666 comparesig   0E1  -0E1 -> 0\r
+dqcms667 comparesig   0E2  -0E1 -> 0\r
+dqcms668 comparesig  -0E1  -0E2 -> 0\r
+dqcms669 comparesig  -0E2  -0E2 -> 0\r
+dqcms670 comparesig   0E1  -0E2 -> 0\r
+dqcms671 comparesig   0E2  -0E2 -> 0\r
+dqcms672 comparesig  -0E1   0E1 -> 0\r
+dqcms673 comparesig  -0E2   0E1 -> 0\r
+dqcms674 comparesig   0E1   0E1 -> 0\r
+dqcms675 comparesig   0E2   0E1 -> 0\r
+dqcms676 comparesig  -0E1   0E2 -> 0\r
+dqcms677 comparesig  -0E2   0E2 -> 0\r
+dqcms678 comparesig   0E1   0E2 -> 0\r
+dqcms679 comparesig   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+dqcms680 comparesig   12    12           -> 0\r
+dqcms681 comparesig   12    12.0         -> 0\r
+dqcms682 comparesig   12    12.00        -> 0\r
+dqcms683 comparesig   12    12.000       -> 0\r
+dqcms684 comparesig   12    12.0000      -> 0\r
+dqcms685 comparesig   12    12.00000     -> 0\r
+dqcms686 comparesig   12    12.000000    -> 0\r
+dqcms687 comparesig   12    12.0000000   -> 0\r
+dqcms688 comparesig   12    12.00000000  -> 0\r
+dqcms689 comparesig   12    12.000000000 -> 0\r
+dqcms690 comparesig   12              12 -> 0\r
+dqcms691 comparesig   12.0            12 -> 0\r
+dqcms692 comparesig   12.00           12 -> 0\r
+dqcms693 comparesig   12.000          12 -> 0\r
+dqcms694 comparesig   12.0000         12 -> 0\r
+dqcms695 comparesig   12.00000        12 -> 0\r
+dqcms696 comparesig   12.000000       12 -> 0\r
+dqcms697 comparesig   12.0000000      12 -> 0\r
+dqcms698 comparesig   12.00000000     12 -> 0\r
+dqcms699 comparesig   12.000000000    12 -> 0\r
+\r
+-- first, second, & last digit\r
+dqcms700 comparesig   1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1\r
+dqcms701 comparesig   1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0\r
+dqcms702 comparesig   1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1\r
+dqcms703 comparesig   1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1\r
+dqcms704 comparesig   1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0\r
+dqcms705 comparesig   1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1\r
+dqcms706 comparesig   1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1\r
+dqcms707 comparesig   1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0\r
+dqcms708 comparesig   1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1\r
+\r
+-- miscellaneous\r
+dqcms721 comparesig 12345678000 1 -> 1\r
+dqcms722 comparesig 1 12345678000 -> -1\r
+dqcms723 comparesig 1234567800  1 -> 1\r
+dqcms724 comparesig 1 1234567800  -> -1\r
+dqcms725 comparesig 1234567890  1 -> 1\r
+dqcms726 comparesig 1 1234567890  -> -1\r
+dqcms727 comparesig 1234567891  1 -> 1\r
+dqcms728 comparesig 1 1234567891  -> -1\r
+dqcms729 comparesig 12345678901 1 -> 1\r
+dqcms730 comparesig 1 12345678901 -> -1\r
+dqcms731 comparesig 1234567896  1 -> 1\r
+dqcms732 comparesig 1 1234567896  -> -1\r
+\r
+-- residue cases at lower precision\r
+dqcms740 comparesig  1  0.9999999  -> 1\r
+dqcms741 comparesig  1  0.999999   -> 1\r
+dqcms742 comparesig  1  0.99999    -> 1\r
+dqcms743 comparesig  1  1.0000     -> 0\r
+dqcms744 comparesig  1  1.00001    -> -1\r
+dqcms745 comparesig  1  1.000001   -> -1\r
+dqcms746 comparesig  1  1.0000001  -> -1\r
+dqcms750 comparesig  0.9999999  1  -> -1\r
+dqcms751 comparesig  0.999999   1  -> -1\r
+dqcms752 comparesig  0.99999    1  -> -1\r
+dqcms753 comparesig  1.0000     1  -> 0\r
+dqcms754 comparesig  1.00001    1  -> 1\r
+dqcms755 comparesig  1.000001   1  -> 1\r
+dqcms756 comparesig  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+dqcms780 comparesig  Inf  -Inf   ->  1\r
+dqcms781 comparesig  Inf  -1000  ->  1\r
+dqcms782 comparesig  Inf  -1     ->  1\r
+dqcms783 comparesig  Inf  -0     ->  1\r
+dqcms784 comparesig  Inf   0     ->  1\r
+dqcms785 comparesig  Inf   1     ->  1\r
+dqcms786 comparesig  Inf   1000  ->  1\r
+dqcms787 comparesig  Inf   Inf   ->  0\r
+dqcms788 comparesig -1000  Inf   -> -1\r
+dqcms789 comparesig -Inf   Inf   -> -1\r
+dqcms790 comparesig -1     Inf   -> -1\r
+dqcms791 comparesig -0     Inf   -> -1\r
+dqcms792 comparesig  0     Inf   -> -1\r
+dqcms793 comparesig  1     Inf   -> -1\r
+dqcms794 comparesig  1000  Inf   -> -1\r
+dqcms795 comparesig  Inf   Inf   ->  0\r
+\r
+dqcms800 comparesig -Inf  -Inf   ->  0\r
+dqcms801 comparesig -Inf  -1000  -> -1\r
+dqcms802 comparesig -Inf  -1     -> -1\r
+dqcms803 comparesig -Inf  -0     -> -1\r
+dqcms804 comparesig -Inf   0     -> -1\r
+dqcms805 comparesig -Inf   1     -> -1\r
+dqcms806 comparesig -Inf   1000  -> -1\r
+dqcms807 comparesig -Inf   Inf   -> -1\r
+dqcms808 comparesig -Inf  -Inf   ->  0\r
+dqcms809 comparesig -1000 -Inf   ->  1\r
+dqcms810 comparesig -1    -Inf   ->  1\r
+dqcms811 comparesig -0    -Inf   ->  1\r
+dqcms812 comparesig  0    -Inf   ->  1\r
+dqcms813 comparesig  1    -Inf   ->  1\r
+dqcms814 comparesig  1000 -Inf   ->  1\r
+dqcms815 comparesig  Inf  -Inf   ->  1\r
+\r
+dqcms821 comparesig  NaN -Inf    ->  NaN  Invalid_operation\r
+dqcms822 comparesig  NaN -1000   ->  NaN  Invalid_operation\r
+dqcms823 comparesig  NaN -1      ->  NaN  Invalid_operation\r
+dqcms824 comparesig  NaN -0      ->  NaN  Invalid_operation\r
+dqcms825 comparesig  NaN  0      ->  NaN  Invalid_operation\r
+dqcms826 comparesig  NaN  1      ->  NaN  Invalid_operation\r
+dqcms827 comparesig  NaN  1000   ->  NaN  Invalid_operation\r
+dqcms828 comparesig  NaN  Inf    ->  NaN  Invalid_operation\r
+dqcms829 comparesig  NaN  NaN    ->  NaN  Invalid_operation\r
+dqcms830 comparesig -Inf  NaN    ->  NaN  Invalid_operation\r
+dqcms831 comparesig -1000 NaN    ->  NaN  Invalid_operation\r
+dqcms832 comparesig -1    NaN    ->  NaN  Invalid_operation\r
+dqcms833 comparesig -0    NaN    ->  NaN  Invalid_operation\r
+dqcms834 comparesig  0    NaN    ->  NaN  Invalid_operation\r
+dqcms835 comparesig  1    NaN    ->  NaN  Invalid_operation\r
+dqcms836 comparesig  1000 NaN    ->  NaN  Invalid_operation\r
+dqcms837 comparesig  Inf  NaN    ->  NaN  Invalid_operation\r
+dqcms838 comparesig -NaN -NaN    -> -NaN  Invalid_operation\r
+dqcms839 comparesig +NaN -NaN    ->  NaN  Invalid_operation\r
+dqcms840 comparesig -NaN +NaN    -> -NaN  Invalid_operation\r
+\r
+dqcms841 comparesig  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqcms842 comparesig  sNaN -1000  ->  NaN  Invalid_operation\r
+dqcms843 comparesig  sNaN -1     ->  NaN  Invalid_operation\r
+dqcms844 comparesig  sNaN -0     ->  NaN  Invalid_operation\r
+dqcms845 comparesig  sNaN  0     ->  NaN  Invalid_operation\r
+dqcms846 comparesig  sNaN  1     ->  NaN  Invalid_operation\r
+dqcms847 comparesig  sNaN  1000  ->  NaN  Invalid_operation\r
+dqcms848 comparesig  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqcms849 comparesig  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqcms850 comparesig  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqcms851 comparesig -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqcms852 comparesig -1000 sNaN   ->  NaN  Invalid_operation\r
+dqcms853 comparesig -1    sNaN   ->  NaN  Invalid_operation\r
+dqcms854 comparesig -0    sNaN   ->  NaN  Invalid_operation\r
+dqcms855 comparesig  0    sNaN   ->  NaN  Invalid_operation\r
+dqcms856 comparesig  1    sNaN   ->  NaN  Invalid_operation\r
+dqcms857 comparesig  1000 sNaN   ->  NaN  Invalid_operation\r
+dqcms858 comparesig  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqcms859 comparesig  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqcms860 comparesig  NaN9 -Inf   ->  NaN9    Invalid_operation\r
+dqcms861 comparesig  NaN8  999   ->  NaN8    Invalid_operation\r
+dqcms862 comparesig  NaN77 Inf   ->  NaN77   Invalid_operation\r
+dqcms863 comparesig -NaN67 NaN5  -> -NaN67   Invalid_operation\r
+dqcms864 comparesig -Inf  -NaN4  -> -NaN4    Invalid_operation\r
+dqcms865 comparesig -999  -NaN33 -> -NaN33   Invalid_operation\r
+dqcms866 comparesig  Inf   NaN2  ->  NaN2    Invalid_operation\r
+dqcms867 comparesig -NaN41 -NaN42 -> -NaN41  Invalid_operation\r
+dqcms868 comparesig +NaN41 -NaN42 ->  NaN41  Invalid_operation\r
+dqcms869 comparesig -NaN41 +NaN42 -> -NaN41  Invalid_operation\r
+dqcms870 comparesig +NaN41 +NaN42 ->  NaN41  Invalid_operation\r
+\r
+dqcms871 comparesig -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqcms872 comparesig  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqcms873 comparesig  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqcms874 comparesig  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+dqcms875 comparesig  NaN85  sNaN83  ->  NaN83 Invalid_operation\r
+dqcms876 comparesig -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqcms877 comparesig  088    sNaN81  ->  NaN81 Invalid_operation\r
+dqcms878 comparesig  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dqcms879 comparesig  NaN   -sNaN89  -> -NaN89 Invalid_operation\r
+\r
+-- wide range\r
+dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1\r
+dqcms881 comparesig 9E+6144 +1.23456789012345E-0 ->  1\r
+dqcms882 comparesig +0.100 9E-6143               ->  1\r
+dqcms883 comparesig 9E-6143 +0.100               -> -1\r
+dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1\r
+dqcms886 comparesig 9E+6144 -1.23456789012345E-0 ->  1\r
+dqcms887 comparesig -0.100 9E-6143               -> -1\r
+dqcms888 comparesig 9E-6143 -0.100               ->  1\r
+\r
+-- signs\r
+dqcms901 comparesig  1e+77  1e+11 ->  1\r
+dqcms902 comparesig  1e+77 -1e+11 ->  1\r
+dqcms903 comparesig -1e+77  1e+11 -> -1\r
+dqcms904 comparesig -1e+77 -1e+11 -> -1\r
+dqcms905 comparesig  1e-77  1e-11 -> -1\r
+dqcms906 comparesig  1e-77 -1e-11 ->  1\r
+dqcms907 comparesig -1e-77  1e-11 -> -1\r
+dqcms908 comparesig -1e-77 -1e-11 ->  1\r
+\r
+-- Null tests\r
+dqcms990 comparesig 10  # -> NaN Invalid_operation\r
+dqcms991 comparesig  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqCompareTotal.decTest b/Lib/test/decimaltestdata/dqCompareTotal.decTest
new file mode 100644 (file)
index 0000000..d4a7c5a
--- /dev/null
@@ -0,0 +1,706 @@
+------------------------------------------------------------------------\r
+-- dqCompareTotal.decTest -- decQuad comparison using total ordering  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+-- Similarly, comparetotal will have some radically different paths\r
+-- than compare.\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqcot001 comparetotal  -2  -2  -> 0\r
+dqcot002 comparetotal  -2  -1  -> -1\r
+dqcot003 comparetotal  -2   0  -> -1\r
+dqcot004 comparetotal  -2   1  -> -1\r
+dqcot005 comparetotal  -2   2  -> -1\r
+dqcot006 comparetotal  -1  -2  -> 1\r
+dqcot007 comparetotal  -1  -1  -> 0\r
+dqcot008 comparetotal  -1   0  -> -1\r
+dqcot009 comparetotal  -1   1  -> -1\r
+dqcot010 comparetotal  -1   2  -> -1\r
+dqcot011 comparetotal   0  -2  -> 1\r
+dqcot012 comparetotal   0  -1  -> 1\r
+dqcot013 comparetotal   0   0  -> 0\r
+dqcot014 comparetotal   0   1  -> -1\r
+dqcot015 comparetotal   0   2  -> -1\r
+dqcot016 comparetotal   1  -2  -> 1\r
+dqcot017 comparetotal   1  -1  -> 1\r
+dqcot018 comparetotal   1   0  -> 1\r
+dqcot019 comparetotal   1   1  -> 0\r
+dqcot020 comparetotal   1   2  -> -1\r
+dqcot021 comparetotal   2  -2  -> 1\r
+dqcot022 comparetotal   2  -1  -> 1\r
+dqcot023 comparetotal   2   0  -> 1\r
+dqcot025 comparetotal   2   1  -> 1\r
+dqcot026 comparetotal   2   2  -> 0\r
+\r
+dqcot031 comparetotal  -20  -20  -> 0\r
+dqcot032 comparetotal  -20  -10  -> -1\r
+dqcot033 comparetotal  -20   00  -> -1\r
+dqcot034 comparetotal  -20   10  -> -1\r
+dqcot035 comparetotal  -20   20  -> -1\r
+dqcot036 comparetotal  -10  -20  -> 1\r
+dqcot037 comparetotal  -10  -10  -> 0\r
+dqcot038 comparetotal  -10   00  -> -1\r
+dqcot039 comparetotal  -10   10  -> -1\r
+dqcot040 comparetotal  -10   20  -> -1\r
+dqcot041 comparetotal   00  -20  -> 1\r
+dqcot042 comparetotal   00  -10  -> 1\r
+dqcot043 comparetotal   00   00  -> 0\r
+dqcot044 comparetotal   00   10  -> -1\r
+dqcot045 comparetotal   00   20  -> -1\r
+dqcot046 comparetotal   10  -20  -> 1\r
+dqcot047 comparetotal   10  -10  -> 1\r
+dqcot048 comparetotal   10   00  -> 1\r
+dqcot049 comparetotal   10   10  -> 0\r
+dqcot050 comparetotal   10   20  -> -1\r
+dqcot051 comparetotal   20  -20  -> 1\r
+dqcot052 comparetotal   20  -10  -> 1\r
+dqcot053 comparetotal   20   00  -> 1\r
+dqcot055 comparetotal   20   10  -> 1\r
+dqcot056 comparetotal   20   20  -> 0\r
+\r
+dqcot061 comparetotal  -2.0  -2.0  -> 0\r
+dqcot062 comparetotal  -2.0  -1.0  -> -1\r
+dqcot063 comparetotal  -2.0   0.0  -> -1\r
+dqcot064 comparetotal  -2.0   1.0  -> -1\r
+dqcot065 comparetotal  -2.0   2.0  -> -1\r
+dqcot066 comparetotal  -1.0  -2.0  -> 1\r
+dqcot067 comparetotal  -1.0  -1.0  -> 0\r
+dqcot068 comparetotal  -1.0   0.0  -> -1\r
+dqcot069 comparetotal  -1.0   1.0  -> -1\r
+dqcot070 comparetotal  -1.0   2.0  -> -1\r
+dqcot071 comparetotal   0.0  -2.0  -> 1\r
+dqcot072 comparetotal   0.0  -1.0  -> 1\r
+dqcot073 comparetotal   0.0   0.0  -> 0\r
+dqcot074 comparetotal   0.0   1.0  -> -1\r
+dqcot075 comparetotal   0.0   2.0  -> -1\r
+dqcot076 comparetotal   1.0  -2.0  -> 1\r
+dqcot077 comparetotal   1.0  -1.0  -> 1\r
+dqcot078 comparetotal   1.0   0.0  -> 1\r
+dqcot079 comparetotal   1.0   1.0  -> 0\r
+dqcot080 comparetotal   1.0   2.0  -> -1\r
+dqcot081 comparetotal   2.0  -2.0  -> 1\r
+dqcot082 comparetotal   2.0  -1.0  -> 1\r
+dqcot083 comparetotal   2.0   0.0  -> 1\r
+dqcot085 comparetotal   2.0   1.0  -> 1\r
+dqcot086 comparetotal   2.0   2.0  -> 0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+dqcot090 comparetotal  9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144  -> 0\r
+dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144  -> -1\r
+dqcot092 comparetotal  9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1\r
+dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+dqcot100 comparetotal   7.0    7.0    -> 0\r
+dqcot101 comparetotal   7.0    7      -> -1\r
+dqcot102 comparetotal   7      7.0    -> 1\r
+dqcot103 comparetotal   7E+0   7.0    -> 1\r
+dqcot104 comparetotal   70E-1  7.0    -> 0\r
+dqcot105 comparetotal   0.7E+1 7      -> 0\r
+dqcot106 comparetotal   70E-1  7      -> -1\r
+dqcot107 comparetotal   7.0    7E+0   -> -1\r
+dqcot108 comparetotal   7.0    70E-1  -> 0\r
+dqcot109 comparetotal   7      0.7E+1 -> 0\r
+dqcot110 comparetotal   7      70E-1  -> 1\r
+\r
+dqcot120 comparetotal   8.0    7.0    -> 1\r
+dqcot121 comparetotal   8.0    7      -> 1\r
+dqcot122 comparetotal   8      7.0    -> 1\r
+dqcot123 comparetotal   8E+0   7.0    -> 1\r
+dqcot124 comparetotal   80E-1  7.0    -> 1\r
+dqcot125 comparetotal   0.8E+1 7      -> 1\r
+dqcot126 comparetotal   80E-1  7      -> 1\r
+dqcot127 comparetotal   8.0    7E+0   -> 1\r
+dqcot128 comparetotal   8.0    70E-1  -> 1\r
+dqcot129 comparetotal   8      0.7E+1  -> 1\r
+dqcot130 comparetotal   8      70E-1  -> 1\r
+\r
+dqcot140 comparetotal   8.0    9.0    -> -1\r
+dqcot141 comparetotal   8.0    9      -> -1\r
+dqcot142 comparetotal   8      9.0    -> -1\r
+dqcot143 comparetotal   8E+0   9.0    -> -1\r
+dqcot144 comparetotal   80E-1  9.0    -> -1\r
+dqcot145 comparetotal   0.8E+1 9      -> -1\r
+dqcot146 comparetotal   80E-1  9      -> -1\r
+dqcot147 comparetotal   8.0    9E+0   -> -1\r
+dqcot148 comparetotal   8.0    90E-1  -> -1\r
+dqcot149 comparetotal   8      0.9E+1 -> -1\r
+dqcot150 comparetotal   8      90E-1  -> -1\r
+\r
+-- and again, with sign changes -+ ..\r
+dqcot200 comparetotal  -7.0    7.0    -> -1\r
+dqcot201 comparetotal  -7.0    7      -> -1\r
+dqcot202 comparetotal  -7      7.0    -> -1\r
+dqcot203 comparetotal  -7E+0   7.0    -> -1\r
+dqcot204 comparetotal  -70E-1  7.0    -> -1\r
+dqcot205 comparetotal  -0.7E+1 7      -> -1\r
+dqcot206 comparetotal  -70E-1  7      -> -1\r
+dqcot207 comparetotal  -7.0    7E+0   -> -1\r
+dqcot208 comparetotal  -7.0    70E-1  -> -1\r
+dqcot209 comparetotal  -7      0.7E+1 -> -1\r
+dqcot210 comparetotal  -7      70E-1  -> -1\r
+\r
+dqcot220 comparetotal  -8.0    7.0    -> -1\r
+dqcot221 comparetotal  -8.0    7      -> -1\r
+dqcot222 comparetotal  -8      7.0    -> -1\r
+dqcot223 comparetotal  -8E+0   7.0    -> -1\r
+dqcot224 comparetotal  -80E-1  7.0    -> -1\r
+dqcot225 comparetotal  -0.8E+1 7      -> -1\r
+dqcot226 comparetotal  -80E-1  7      -> -1\r
+dqcot227 comparetotal  -8.0    7E+0   -> -1\r
+dqcot228 comparetotal  -8.0    70E-1  -> -1\r
+dqcot229 comparetotal  -8      0.7E+1 -> -1\r
+dqcot230 comparetotal  -8      70E-1  -> -1\r
+\r
+dqcot240 comparetotal  -8.0    9.0    -> -1\r
+dqcot241 comparetotal  -8.0    9      -> -1\r
+dqcot242 comparetotal  -8      9.0    -> -1\r
+dqcot243 comparetotal  -8E+0   9.0    -> -1\r
+dqcot244 comparetotal  -80E-1  9.0    -> -1\r
+dqcot245 comparetotal  -0.8E+1 9      -> -1\r
+dqcot246 comparetotal  -80E-1  9      -> -1\r
+dqcot247 comparetotal  -8.0    9E+0   -> -1\r
+dqcot248 comparetotal  -8.0    90E-1  -> -1\r
+dqcot249 comparetotal  -8      0.9E+1 -> -1\r
+dqcot250 comparetotal  -8      90E-1  -> -1\r
+\r
+-- and again, with sign changes +- ..\r
+dqcot300 comparetotal   7.0    -7.0    -> 1\r
+dqcot301 comparetotal   7.0    -7      -> 1\r
+dqcot302 comparetotal   7      -7.0    -> 1\r
+dqcot303 comparetotal   7E+0   -7.0    -> 1\r
+dqcot304 comparetotal   70E-1  -7.0    -> 1\r
+dqcot305 comparetotal   .7E+1  -7      -> 1\r
+dqcot306 comparetotal   70E-1  -7      -> 1\r
+dqcot307 comparetotal   7.0    -7E+0   -> 1\r
+dqcot308 comparetotal   7.0    -70E-1  -> 1\r
+dqcot309 comparetotal   7      -.7E+1  -> 1\r
+dqcot310 comparetotal   7      -70E-1  -> 1\r
+\r
+dqcot320 comparetotal   8.0    -7.0    -> 1\r
+dqcot321 comparetotal   8.0    -7      -> 1\r
+dqcot322 comparetotal   8      -7.0    -> 1\r
+dqcot323 comparetotal   8E+0   -7.0    -> 1\r
+dqcot324 comparetotal   80E-1  -7.0    -> 1\r
+dqcot325 comparetotal   .8E+1  -7      -> 1\r
+dqcot326 comparetotal   80E-1  -7      -> 1\r
+dqcot327 comparetotal   8.0    -7E+0   -> 1\r
+dqcot328 comparetotal   8.0    -70E-1  -> 1\r
+dqcot329 comparetotal   8      -.7E+1  -> 1\r
+dqcot330 comparetotal   8      -70E-1  -> 1\r
+\r
+dqcot340 comparetotal   8.0    -9.0    -> 1\r
+dqcot341 comparetotal   8.0    -9      -> 1\r
+dqcot342 comparetotal   8      -9.0    -> 1\r
+dqcot343 comparetotal   8E+0   -9.0    -> 1\r
+dqcot344 comparetotal   80E-1  -9.0    -> 1\r
+dqcot345 comparetotal   .8E+1  -9      -> 1\r
+dqcot346 comparetotal   80E-1  -9      -> 1\r
+dqcot347 comparetotal   8.0    -9E+0   -> 1\r
+dqcot348 comparetotal   8.0    -90E-1  -> 1\r
+dqcot349 comparetotal   8      -.9E+1  -> 1\r
+dqcot350 comparetotal   8      -90E-1  -> 1\r
+\r
+-- and again, with sign changes -- ..\r
+dqcot400 comparetotal   -7.0    -7.0    -> 0\r
+dqcot401 comparetotal   -7.0    -7      -> 1\r
+dqcot402 comparetotal   -7      -7.0    -> -1\r
+dqcot403 comparetotal   -7E+0   -7.0    -> -1\r
+dqcot404 comparetotal   -70E-1  -7.0    -> 0\r
+dqcot405 comparetotal   -.7E+1  -7      -> 0\r
+dqcot406 comparetotal   -70E-1  -7      -> 1\r
+dqcot407 comparetotal   -7.0    -7E+0   -> 1\r
+dqcot408 comparetotal   -7.0    -70E-1  -> 0\r
+dqcot409 comparetotal   -7      -.7E+1  -> 0\r
+dqcot410 comparetotal   -7      -70E-1  -> -1\r
+\r
+dqcot420 comparetotal   -8.0    -7.0    -> -1\r
+dqcot421 comparetotal   -8.0    -7      -> -1\r
+dqcot422 comparetotal   -8      -7.0    -> -1\r
+dqcot423 comparetotal   -8E+0   -7.0    -> -1\r
+dqcot424 comparetotal   -80E-1  -7.0    -> -1\r
+dqcot425 comparetotal   -.8E+1  -7      -> -1\r
+dqcot426 comparetotal   -80E-1  -7      -> -1\r
+dqcot427 comparetotal   -8.0    -7E+0   -> -1\r
+dqcot428 comparetotal   -8.0    -70E-1  -> -1\r
+dqcot429 comparetotal   -8      -.7E+1  -> -1\r
+dqcot430 comparetotal   -8      -70E-1  -> -1\r
+\r
+dqcot440 comparetotal   -8.0    -9.0    -> 1\r
+dqcot441 comparetotal   -8.0    -9      -> 1\r
+dqcot442 comparetotal   -8      -9.0    -> 1\r
+dqcot443 comparetotal   -8E+0   -9.0    -> 1\r
+dqcot444 comparetotal   -80E-1  -9.0    -> 1\r
+dqcot445 comparetotal   -.8E+1  -9      -> 1\r
+dqcot446 comparetotal   -80E-1  -9      -> 1\r
+dqcot447 comparetotal   -8.0    -9E+0   -> 1\r
+dqcot448 comparetotal   -8.0    -90E-1  -> 1\r
+dqcot449 comparetotal   -8      -.9E+1  -> 1\r
+dqcot450 comparetotal   -8      -90E-1  -> 1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1\r
+dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1\r
+dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1\r
+dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1\r
+dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1\r
+dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1\r
+dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1\r
+dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1\r
+dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1\r
+dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1\r
+dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0\r
+dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1\r
+dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1\r
+dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1\r
+dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1\r
+dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1\r
+dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1\r
+dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1\r
+dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1\r
+dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1\r
+dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1\r
+dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+dqcot498 comparetotal    1     1E-17    -> 1\r
+dqcot499 comparetotal    1     1E-16    -> 1\r
+dqcot500 comparetotal    1     1E-15    -> 1\r
+dqcot501 comparetotal    1     1E-14    -> 1\r
+dqcot502 comparetotal    1     1E-13    -> 1\r
+dqcot503 comparetotal    1     1E-12    -> 1\r
+dqcot504 comparetotal    1     1E-11    -> 1\r
+dqcot505 comparetotal    1     1E-10    -> 1\r
+dqcot506 comparetotal    1     1E-9     -> 1\r
+dqcot507 comparetotal    1     1E-8     -> 1\r
+dqcot508 comparetotal    1     1E-7     -> 1\r
+dqcot509 comparetotal    1     1E-6     -> 1\r
+dqcot510 comparetotal    1     1E-5     -> 1\r
+dqcot511 comparetotal    1     1E-4     -> 1\r
+dqcot512 comparetotal    1     1E-3     -> 1\r
+dqcot513 comparetotal    1     1E-2     -> 1\r
+dqcot514 comparetotal    1     1E-1     -> 1\r
+dqcot515 comparetotal    1     1E-0     -> 0\r
+dqcot516 comparetotal    1     1E+1     -> -1\r
+dqcot517 comparetotal    1     1E+2     -> -1\r
+dqcot518 comparetotal    1     1E+3     -> -1\r
+dqcot519 comparetotal    1     1E+4     -> -1\r
+dqcot521 comparetotal    1     1E+5     -> -1\r
+dqcot522 comparetotal    1     1E+6     -> -1\r
+dqcot523 comparetotal    1     1E+7     -> -1\r
+dqcot524 comparetotal    1     1E+8     -> -1\r
+dqcot525 comparetotal    1     1E+9     -> -1\r
+dqcot526 comparetotal    1     1E+10    -> -1\r
+dqcot527 comparetotal    1     1E+11    -> -1\r
+dqcot528 comparetotal    1     1E+12    -> -1\r
+dqcot529 comparetotal    1     1E+13    -> -1\r
+dqcot530 comparetotal    1     1E+14    -> -1\r
+dqcot531 comparetotal    1     1E+15    -> -1\r
+dqcot532 comparetotal    1     1E+16    -> -1\r
+dqcot533 comparetotal    1     1E+17    -> -1\r
+-- LR swap\r
+dqcot538 comparetotal    1E-17  1       -> -1\r
+dqcot539 comparetotal    1E-16  1       -> -1\r
+dqcot540 comparetotal    1E-15  1       -> -1\r
+dqcot541 comparetotal    1E-14  1       -> -1\r
+dqcot542 comparetotal    1E-13  1       -> -1\r
+dqcot543 comparetotal    1E-12  1       -> -1\r
+dqcot544 comparetotal    1E-11  1       -> -1\r
+dqcot545 comparetotal    1E-10  1       -> -1\r
+dqcot546 comparetotal    1E-9   1       -> -1\r
+dqcot547 comparetotal    1E-8   1       -> -1\r
+dqcot548 comparetotal    1E-7   1       -> -1\r
+dqcot549 comparetotal    1E-6   1       -> -1\r
+dqcot550 comparetotal    1E-5   1       -> -1\r
+dqcot551 comparetotal    1E-4   1       -> -1\r
+dqcot552 comparetotal    1E-3   1       -> -1\r
+dqcot553 comparetotal    1E-2   1       -> -1\r
+dqcot554 comparetotal    1E-1   1       -> -1\r
+dqcot555 comparetotal    1E-0   1       ->  0\r
+dqcot556 comparetotal    1E+1   1       ->  1\r
+dqcot557 comparetotal    1E+2   1       ->  1\r
+dqcot558 comparetotal    1E+3   1       ->  1\r
+dqcot559 comparetotal    1E+4   1       ->  1\r
+dqcot561 comparetotal    1E+5   1       ->  1\r
+dqcot562 comparetotal    1E+6   1       ->  1\r
+dqcot563 comparetotal    1E+7   1       ->  1\r
+dqcot564 comparetotal    1E+8   1       ->  1\r
+dqcot565 comparetotal    1E+9   1       ->  1\r
+dqcot566 comparetotal    1E+10  1       ->  1\r
+dqcot567 comparetotal    1E+11  1       ->  1\r
+dqcot568 comparetotal    1E+12  1       ->  1\r
+dqcot569 comparetotal    1E+13  1       ->  1\r
+dqcot570 comparetotal    1E+14  1       ->  1\r
+dqcot571 comparetotal    1E+15  1       ->  1\r
+dqcot572 comparetotal    1E+16  1       ->  1\r
+dqcot573 comparetotal    1E+17  1       ->  1\r
+-- similar with a useful coefficient, one side only\r
+dqcot578 comparetotal  0.000000987654321     1E-17    -> 1\r
+dqcot579 comparetotal  0.000000987654321     1E-16    -> 1\r
+dqcot580 comparetotal  0.000000987654321     1E-15    -> 1\r
+dqcot581 comparetotal  0.000000987654321     1E-14    -> 1\r
+dqcot582 comparetotal  0.000000987654321     1E-13    -> 1\r
+dqcot583 comparetotal  0.000000987654321     1E-12    -> 1\r
+dqcot584 comparetotal  0.000000987654321     1E-11    -> 1\r
+dqcot585 comparetotal  0.000000987654321     1E-10    -> 1\r
+dqcot586 comparetotal  0.000000987654321     1E-9     -> 1\r
+dqcot587 comparetotal  0.000000987654321     1E-8     -> 1\r
+dqcot588 comparetotal  0.000000987654321     1E-7     -> 1\r
+dqcot589 comparetotal  0.000000987654321     1E-6     -> -1\r
+dqcot590 comparetotal  0.000000987654321     1E-5     -> -1\r
+dqcot591 comparetotal  0.000000987654321     1E-4     -> -1\r
+dqcot592 comparetotal  0.000000987654321     1E-3     -> -1\r
+dqcot593 comparetotal  0.000000987654321     1E-2     -> -1\r
+dqcot594 comparetotal  0.000000987654321     1E-1     -> -1\r
+dqcot595 comparetotal  0.000000987654321     1E-0     -> -1\r
+dqcot596 comparetotal  0.000000987654321     1E+1     -> -1\r
+dqcot597 comparetotal  0.000000987654321     1E+2     -> -1\r
+dqcot598 comparetotal  0.000000987654321     1E+3     -> -1\r
+dqcot599 comparetotal  0.000000987654321     1E+4     -> -1\r
+\r
+-- check some unit-y traps\r
+dqcot600 comparetotal   12            12.2345 -> -1\r
+dqcot601 comparetotal   12.0          12.2345 -> -1\r
+dqcot602 comparetotal   12.00         12.2345 -> -1\r
+dqcot603 comparetotal   12.000        12.2345 -> -1\r
+dqcot604 comparetotal   12.0000       12.2345 -> -1\r
+dqcot605 comparetotal   12.00000      12.2345 -> -1\r
+dqcot606 comparetotal   12.000000     12.2345 -> -1\r
+dqcot607 comparetotal   12.0000000    12.2345 -> -1\r
+dqcot608 comparetotal   12.00000000   12.2345 -> -1\r
+dqcot609 comparetotal   12.000000000  12.2345 -> -1\r
+dqcot610 comparetotal   12.1234 12            ->  1\r
+dqcot611 comparetotal   12.1234 12.0          ->  1\r
+dqcot612 comparetotal   12.1234 12.00         ->  1\r
+dqcot613 comparetotal   12.1234 12.000        ->  1\r
+dqcot614 comparetotal   12.1234 12.0000       ->  1\r
+dqcot615 comparetotal   12.1234 12.00000      ->  1\r
+dqcot616 comparetotal   12.1234 12.000000     ->  1\r
+dqcot617 comparetotal   12.1234 12.0000000    ->  1\r
+dqcot618 comparetotal   12.1234 12.00000000   ->  1\r
+dqcot619 comparetotal   12.1234 12.000000000  ->  1\r
+dqcot620 comparetotal  -12           -12.2345 ->  1\r
+dqcot621 comparetotal  -12.0         -12.2345 ->  1\r
+dqcot622 comparetotal  -12.00        -12.2345 ->  1\r
+dqcot623 comparetotal  -12.000       -12.2345 ->  1\r
+dqcot624 comparetotal  -12.0000      -12.2345 ->  1\r
+dqcot625 comparetotal  -12.00000     -12.2345 ->  1\r
+dqcot626 comparetotal  -12.000000    -12.2345 ->  1\r
+dqcot627 comparetotal  -12.0000000   -12.2345 ->  1\r
+dqcot628 comparetotal  -12.00000000  -12.2345 ->  1\r
+dqcot629 comparetotal  -12.000000000 -12.2345 ->  1\r
+dqcot630 comparetotal  -12.1234 -12           -> -1\r
+dqcot631 comparetotal  -12.1234 -12.0         -> -1\r
+dqcot632 comparetotal  -12.1234 -12.00        -> -1\r
+dqcot633 comparetotal  -12.1234 -12.000       -> -1\r
+dqcot634 comparetotal  -12.1234 -12.0000      -> -1\r
+dqcot635 comparetotal  -12.1234 -12.00000     -> -1\r
+dqcot636 comparetotal  -12.1234 -12.000000    -> -1\r
+dqcot637 comparetotal  -12.1234 -12.0000000   -> -1\r
+dqcot638 comparetotal  -12.1234 -12.00000000  -> -1\r
+dqcot639 comparetotal  -12.1234 -12.000000000 -> -1\r
+\r
+-- extended zeros\r
+dqcot640 comparetotal   0     0   -> 0\r
+dqcot641 comparetotal   0    -0   -> 1\r
+dqcot642 comparetotal   0    -0.0 -> 1\r
+dqcot643 comparetotal   0     0.0 -> 1\r
+dqcot644 comparetotal  -0     0   -> -1\r
+dqcot645 comparetotal  -0    -0   -> 0\r
+dqcot646 comparetotal  -0    -0.0 -> -1\r
+dqcot647 comparetotal  -0     0.0 -> -1\r
+dqcot648 comparetotal   0.0   0   -> -1\r
+dqcot649 comparetotal   0.0  -0   -> 1\r
+dqcot650 comparetotal   0.0  -0.0 -> 1\r
+dqcot651 comparetotal   0.0   0.0 -> 0\r
+dqcot652 comparetotal  -0.0   0   -> -1\r
+dqcot653 comparetotal  -0.0  -0   -> 1\r
+dqcot654 comparetotal  -0.0  -0.0 -> 0\r
+dqcot655 comparetotal  -0.0   0.0 -> -1\r
+\r
+dqcot656 comparetotal  -0E1   0.0 -> -1\r
+dqcot657 comparetotal  -0E2   0.0 -> -1\r
+dqcot658 comparetotal   0E1   0.0 -> 1\r
+dqcot659 comparetotal   0E2   0.0 -> 1\r
+dqcot660 comparetotal  -0E1   0   -> -1\r
+dqcot661 comparetotal  -0E2   0   -> -1\r
+dqcot662 comparetotal   0E1   0   -> 1\r
+dqcot663 comparetotal   0E2   0   -> 1\r
+dqcot664 comparetotal  -0E1  -0E1 -> 0\r
+dqcot665 comparetotal  -0E2  -0E1 -> -1\r
+dqcot666 comparetotal   0E1  -0E1 -> 1\r
+dqcot667 comparetotal   0E2  -0E1 -> 1\r
+dqcot668 comparetotal  -0E1  -0E2 -> 1\r
+dqcot669 comparetotal  -0E2  -0E2 -> 0\r
+dqcot670 comparetotal   0E1  -0E2 -> 1\r
+dqcot671 comparetotal   0E2  -0E2 -> 1\r
+dqcot672 comparetotal  -0E1   0E1 -> -1\r
+dqcot673 comparetotal  -0E2   0E1 -> -1\r
+dqcot674 comparetotal   0E1   0E1 -> 0\r
+dqcot675 comparetotal   0E2   0E1 -> 1\r
+dqcot676 comparetotal  -0E1   0E2 -> -1\r
+dqcot677 comparetotal  -0E2   0E2 -> -1\r
+dqcot678 comparetotal   0E1   0E2 -> -1\r
+dqcot679 comparetotal   0E2   0E2 -> 0\r
+\r
+-- trailing zeros; unit-y\r
+dqcot680 comparetotal   12    12           -> 0\r
+dqcot681 comparetotal   12    12.0         -> 1\r
+dqcot682 comparetotal   12    12.00        -> 1\r
+dqcot683 comparetotal   12    12.000       -> 1\r
+dqcot684 comparetotal   12    12.0000      -> 1\r
+dqcot685 comparetotal   12    12.00000     -> 1\r
+dqcot686 comparetotal   12    12.000000    -> 1\r
+dqcot687 comparetotal   12    12.0000000   -> 1\r
+dqcot688 comparetotal   12    12.00000000  -> 1\r
+dqcot689 comparetotal   12    12.000000000 -> 1\r
+dqcot690 comparetotal   12              12 -> 0\r
+dqcot691 comparetotal   12.0            12 -> -1\r
+dqcot692 comparetotal   12.00           12 -> -1\r
+dqcot693 comparetotal   12.000          12 -> -1\r
+dqcot694 comparetotal   12.0000         12 -> -1\r
+dqcot695 comparetotal   12.00000        12 -> -1\r
+dqcot696 comparetotal   12.000000       12 -> -1\r
+dqcot697 comparetotal   12.0000000      12 -> -1\r
+dqcot698 comparetotal   12.00000000     12 -> -1\r
+dqcot699 comparetotal   12.000000000    12 -> -1\r
+\r
+-- old long operand checks\r
+dqcot701 comparetotal 12345678000  1 ->  1\r
+dqcot702 comparetotal 1 12345678000  -> -1\r
+dqcot703 comparetotal 1234567800   1 ->  1\r
+dqcot704 comparetotal 1 1234567800   -> -1\r
+dqcot705 comparetotal 1234567890   1 ->  1\r
+dqcot706 comparetotal 1 1234567890   -> -1\r
+dqcot707 comparetotal 1234567891   1 ->  1\r
+dqcot708 comparetotal 1 1234567891   -> -1\r
+dqcot709 comparetotal 12345678901  1 ->  1\r
+dqcot710 comparetotal 1 12345678901  -> -1\r
+dqcot711 comparetotal 1234567896   1 ->  1\r
+dqcot712 comparetotal 1 1234567896   -> -1\r
+dqcot713 comparetotal -1234567891  1 -> -1\r
+dqcot714 comparetotal 1 -1234567891  ->  1\r
+dqcot715 comparetotal -12345678901 1 -> -1\r
+dqcot716 comparetotal 1 -12345678901 ->  1\r
+dqcot717 comparetotal -1234567896  1 -> -1\r
+dqcot718 comparetotal 1 -1234567896  ->  1\r
+\r
+-- old residue cases\r
+dqcot740 comparetotal  1  0.9999999  -> 1\r
+dqcot741 comparetotal  1  0.999999   -> 1\r
+dqcot742 comparetotal  1  0.99999    -> 1\r
+dqcot743 comparetotal  1  1.0000     -> 1\r
+dqcot744 comparetotal  1  1.00001    -> -1\r
+dqcot745 comparetotal  1  1.000001   -> -1\r
+dqcot746 comparetotal  1  1.0000001  -> -1\r
+dqcot750 comparetotal  0.9999999  1  -> -1\r
+dqcot751 comparetotal  0.999999   1  -> -1\r
+dqcot752 comparetotal  0.99999    1  -> -1\r
+dqcot753 comparetotal  1.0000     1  -> -1\r
+dqcot754 comparetotal  1.00001    1  -> 1\r
+dqcot755 comparetotal  1.000001   1  -> 1\r
+dqcot756 comparetotal  1.0000001  1  -> 1\r
+\r
+-- Specials\r
+dqcot780 comparetotal  Inf  -Inf   ->  1\r
+dqcot781 comparetotal  Inf  -1000  ->  1\r
+dqcot782 comparetotal  Inf  -1     ->  1\r
+dqcot783 comparetotal  Inf  -0     ->  1\r
+dqcot784 comparetotal  Inf   0     ->  1\r
+dqcot785 comparetotal  Inf   1     ->  1\r
+dqcot786 comparetotal  Inf   1000  ->  1\r
+dqcot787 comparetotal  Inf   Inf   ->  0\r
+dqcot788 comparetotal -1000  Inf   -> -1\r
+dqcot789 comparetotal -Inf   Inf   -> -1\r
+dqcot790 comparetotal -1     Inf   -> -1\r
+dqcot791 comparetotal -0     Inf   -> -1\r
+dqcot792 comparetotal  0     Inf   -> -1\r
+dqcot793 comparetotal  1     Inf   -> -1\r
+dqcot794 comparetotal  1000  Inf   -> -1\r
+dqcot795 comparetotal  Inf   Inf   ->  0\r
+\r
+dqcot800 comparetotal -Inf  -Inf   ->  0\r
+dqcot801 comparetotal -Inf  -1000  -> -1\r
+dqcot802 comparetotal -Inf  -1     -> -1\r
+dqcot803 comparetotal -Inf  -0     -> -1\r
+dqcot804 comparetotal -Inf   0     -> -1\r
+dqcot805 comparetotal -Inf   1     -> -1\r
+dqcot806 comparetotal -Inf   1000  -> -1\r
+dqcot807 comparetotal -Inf   Inf   -> -1\r
+dqcot808 comparetotal -Inf  -Inf   ->  0\r
+dqcot809 comparetotal -1000 -Inf   ->  1\r
+dqcot810 comparetotal -1    -Inf   ->  1\r
+dqcot811 comparetotal -0    -Inf   ->  1\r
+dqcot812 comparetotal  0    -Inf   ->  1\r
+dqcot813 comparetotal  1    -Inf   ->  1\r
+dqcot814 comparetotal  1000 -Inf   ->  1\r
+dqcot815 comparetotal  Inf  -Inf   ->  1\r
+\r
+dqcot821 comparetotal  NaN -Inf    ->  1\r
+dqcot822 comparetotal  NaN -1000   ->  1\r
+dqcot823 comparetotal  NaN -1      ->  1\r
+dqcot824 comparetotal  NaN -0      ->  1\r
+dqcot825 comparetotal  NaN  0      ->  1\r
+dqcot826 comparetotal  NaN  1      ->  1\r
+dqcot827 comparetotal  NaN  1000   ->  1\r
+dqcot828 comparetotal  NaN  Inf    ->  1\r
+dqcot829 comparetotal  NaN  NaN    ->  0\r
+dqcot830 comparetotal -Inf  NaN    ->  -1\r
+dqcot831 comparetotal -1000 NaN    ->  -1\r
+dqcot832 comparetotal -1    NaN    ->  -1\r
+dqcot833 comparetotal -0    NaN    ->  -1\r
+dqcot834 comparetotal  0    NaN    ->  -1\r
+dqcot835 comparetotal  1    NaN    ->  -1\r
+dqcot836 comparetotal  1000 NaN    ->  -1\r
+dqcot837 comparetotal  Inf  NaN    ->  -1\r
+dqcot838 comparetotal -NaN -NaN    ->  0\r
+dqcot839 comparetotal +NaN -NaN    ->  1\r
+dqcot840 comparetotal -NaN +NaN    ->  -1\r
+\r
+dqcot841 comparetotal  sNaN -sNaN  ->  1\r
+dqcot842 comparetotal  sNaN -NaN   ->  1\r
+dqcot843 comparetotal  sNaN -Inf   ->  1\r
+dqcot844 comparetotal  sNaN -1000  ->  1\r
+dqcot845 comparetotal  sNaN -1     ->  1\r
+dqcot846 comparetotal  sNaN -0     ->  1\r
+dqcot847 comparetotal  sNaN  0     ->  1\r
+dqcot848 comparetotal  sNaN  1     ->  1\r
+dqcot849 comparetotal  sNaN  1000  ->  1\r
+dqcot850 comparetotal  sNaN  NaN   ->  -1\r
+dqcot851 comparetotal  sNaN sNaN   ->  0\r
+\r
+dqcot852 comparetotal -sNaN sNaN   ->  -1\r
+dqcot853 comparetotal -NaN  sNaN   ->  -1\r
+dqcot854 comparetotal -Inf  sNaN   ->  -1\r
+dqcot855 comparetotal -1000 sNaN   ->  -1\r
+dqcot856 comparetotal -1    sNaN   ->  -1\r
+dqcot857 comparetotal -0    sNaN   ->  -1\r
+dqcot858 comparetotal  0    sNaN   ->  -1\r
+dqcot859 comparetotal  1    sNaN   ->  -1\r
+dqcot860 comparetotal  1000 sNaN   ->  -1\r
+dqcot861 comparetotal  Inf  sNaN   ->  -1\r
+dqcot862 comparetotal  NaN  sNaN   ->  1\r
+dqcot863 comparetotal  sNaN sNaN   ->  0\r
+\r
+dqcot871 comparetotal  -sNaN -sNaN  ->  0\r
+dqcot872 comparetotal  -sNaN -NaN   ->  1\r
+dqcot873 comparetotal  -sNaN -Inf   ->  -1\r
+dqcot874 comparetotal  -sNaN -1000  ->  -1\r
+dqcot875 comparetotal  -sNaN -1     ->  -1\r
+dqcot876 comparetotal  -sNaN -0     ->  -1\r
+dqcot877 comparetotal  -sNaN  0     ->  -1\r
+dqcot878 comparetotal  -sNaN  1     ->  -1\r
+dqcot879 comparetotal  -sNaN  1000  ->  -1\r
+dqcot880 comparetotal  -sNaN  NaN   ->  -1\r
+dqcot881 comparetotal  -sNaN sNaN   ->  -1\r
+\r
+dqcot882 comparetotal -sNaN -sNaN   ->  0\r
+dqcot883 comparetotal -NaN  -sNaN   ->  -1\r
+dqcot884 comparetotal -Inf  -sNaN   ->  1\r
+dqcot885 comparetotal -1000 -sNaN   ->  1\r
+dqcot886 comparetotal -1    -sNaN   ->  1\r
+dqcot887 comparetotal -0    -sNaN   ->  1\r
+dqcot888 comparetotal  0    -sNaN   ->  1\r
+dqcot889 comparetotal  1    -sNaN   ->  1\r
+dqcot890 comparetotal  1000 -sNaN   ->  1\r
+dqcot891 comparetotal  Inf  -sNaN   ->  1\r
+dqcot892 comparetotal  NaN  -sNaN   ->  1\r
+dqcot893 comparetotal  sNaN -sNaN   ->  1\r
+\r
+-- NaNs with payload\r
+dqcot960 comparetotal  NaN9 -Inf   ->  1\r
+dqcot961 comparetotal  NaN8  999   ->  1\r
+dqcot962 comparetotal  NaN77 Inf   ->  1\r
+dqcot963 comparetotal -NaN67 NaN5  ->  -1\r
+dqcot964 comparetotal -Inf  -NaN4  ->  1\r
+dqcot965 comparetotal -999  -NaN33 ->  1\r
+dqcot966 comparetotal  Inf   NaN2  ->  -1\r
+\r
+dqcot970 comparetotal -NaN41 -NaN42 -> 1\r
+dqcot971 comparetotal +NaN41 -NaN42 -> 1\r
+dqcot972 comparetotal -NaN41 +NaN42 -> -1\r
+dqcot973 comparetotal +NaN41 +NaN42 -> -1\r
+dqcot974 comparetotal -NaN42 -NaN01 -> -1\r
+dqcot975 comparetotal +NaN42 -NaN01 ->  1\r
+dqcot976 comparetotal -NaN42 +NaN01 -> -1\r
+dqcot977 comparetotal +NaN42 +NaN01 ->  1\r
+\r
+dqcot980 comparetotal -sNaN771 -sNaN772 -> 1\r
+dqcot981 comparetotal +sNaN771 -sNaN772 -> 1\r
+dqcot982 comparetotal -sNaN771 +sNaN772 -> -1\r
+dqcot983 comparetotal +sNaN771 +sNaN772 -> -1\r
+dqcot984 comparetotal -sNaN772 -sNaN771 -> -1\r
+dqcot985 comparetotal +sNaN772 -sNaN771 ->  1\r
+dqcot986 comparetotal -sNaN772 +sNaN771 -> -1\r
+dqcot987 comparetotal +sNaN772 +sNaN771 ->  1\r
+\r
+dqcot991 comparetotal -sNaN99 -Inf    -> -1\r
+dqcot992 comparetotal  sNaN98 -11     ->  1\r
+dqcot993 comparetotal  sNaN97  NaN    -> -1\r
+dqcot994 comparetotal  sNaN16 sNaN94  -> -1\r
+dqcot995 comparetotal  NaN85  sNaN83  ->  1\r
+dqcot996 comparetotal -Inf    sNaN92  -> -1\r
+dqcot997 comparetotal  088    sNaN81  -> -1\r
+dqcot998 comparetotal  Inf    sNaN90  -> -1\r
+dqcot999 comparetotal  NaN   -sNaN89  ->  1\r
+\r
+-- spread zeros\r
+dqcot1110 comparetotal   0E-6143  0       -> -1\r
+dqcot1111 comparetotal   0E-6143 -0       ->  1\r
+dqcot1112 comparetotal  -0E-6143  0       -> -1\r
+dqcot1113 comparetotal  -0E-6143 -0       ->  1\r
+dqcot1114 comparetotal   0E-6143  0E+6144  -> -1\r
+dqcot1115 comparetotal   0E-6143 -0E+6144  ->  1\r
+dqcot1116 comparetotal  -0E-6143  0E+6144  -> -1\r
+dqcot1117 comparetotal  -0E-6143 -0E+6144  ->  1\r
+dqcot1118 comparetotal   0       0E+6144  -> -1\r
+dqcot1119 comparetotal   0      -0E+6144  ->  1\r
+dqcot1120 comparetotal  -0       0E+6144  -> -1\r
+dqcot1121 comparetotal  -0      -0E+6144  ->  1\r
+\r
+dqcot1130 comparetotal   0E+6144  0       ->  1\r
+dqcot1131 comparetotal   0E+6144 -0       ->  1\r
+dqcot1132 comparetotal  -0E+6144  0       -> -1\r
+dqcot1133 comparetotal  -0E+6144 -0       -> -1\r
+dqcot1134 comparetotal   0E+6144  0E-6143  ->  1\r
+dqcot1135 comparetotal   0E+6144 -0E-6143  ->  1\r
+dqcot1136 comparetotal  -0E+6144  0E-6143  -> -1\r
+dqcot1137 comparetotal  -0E+6144 -0E-6143  -> -1\r
+dqcot1138 comparetotal   0       0E-6143  ->  1\r
+dqcot1139 comparetotal   0      -0E-6143  ->  1\r
+dqcot1140 comparetotal  -0       0E-6143  -> -1\r
+dqcot1141 comparetotal  -0      -0E-6143  -> -1\r
+\r
+-- Null tests\r
+dqcot9990 comparetotal 10  # -> NaN Invalid_operation\r
+dqcot9991 comparetotal  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqCompareTotalMag.decTest b/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
new file mode 100644 (file)
index 0000000..9461d6b
--- /dev/null
@@ -0,0 +1,706 @@
+------------------------------------------------------------------------\r
+-- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Note that we cannot assume add/subtract tests cover paths adequately,\r
+-- here, because the code might be quite different (comparison cannot\r
+-- overflow or underflow, so actual subtractions are not necessary).\r
+-- Similarly, comparetotal will have some radically different paths\r
+-- than compare.\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqctm001 comparetotmag  -2  -2   ->   0\r
+dqctm002 comparetotmag  -2  -1   ->   1\r
+dqctm003 comparetotmag  -2   0   ->   1\r
+dqctm004 comparetotmag  -2   1   ->   1\r
+dqctm005 comparetotmag  -2   2   ->   0\r
+dqctm006 comparetotmag  -1  -2   ->  -1\r
+dqctm007 comparetotmag  -1  -1   ->   0\r
+dqctm008 comparetotmag  -1   0   ->   1\r
+dqctm009 comparetotmag  -1   1   ->   0\r
+dqctm010 comparetotmag  -1   2   ->  -1\r
+dqctm011 comparetotmag   0  -2   ->  -1\r
+dqctm012 comparetotmag   0  -1   ->  -1\r
+dqctm013 comparetotmag   0   0   ->   0\r
+dqctm014 comparetotmag   0   1   ->  -1\r
+dqctm015 comparetotmag   0   2   ->  -1\r
+dqctm016 comparetotmag   1  -2   ->  -1\r
+dqctm017 comparetotmag   1  -1   ->   0\r
+dqctm018 comparetotmag   1   0   ->   1\r
+dqctm019 comparetotmag   1   1   ->   0\r
+dqctm020 comparetotmag   1   2   ->  -1\r
+dqctm021 comparetotmag   2  -2   ->   0\r
+dqctm022 comparetotmag   2  -1   ->   1\r
+dqctm023 comparetotmag   2   0   ->   1\r
+dqctm025 comparetotmag   2   1   ->   1\r
+dqctm026 comparetotmag   2   2   ->   0\r
+\r
+dqctm031 comparetotmag  -20  -20   ->   0\r
+dqctm032 comparetotmag  -20  -10   ->   1\r
+dqctm033 comparetotmag  -20   00   ->   1\r
+dqctm034 comparetotmag  -20   10   ->   1\r
+dqctm035 comparetotmag  -20   20   ->   0\r
+dqctm036 comparetotmag  -10  -20   ->  -1\r
+dqctm037 comparetotmag  -10  -10   ->   0\r
+dqctm038 comparetotmag  -10   00   ->   1\r
+dqctm039 comparetotmag  -10   10   ->   0\r
+dqctm040 comparetotmag  -10   20   ->  -1\r
+dqctm041 comparetotmag   00  -20   ->  -1\r
+dqctm042 comparetotmag   00  -10   ->  -1\r
+dqctm043 comparetotmag   00   00   ->   0\r
+dqctm044 comparetotmag   00   10   ->  -1\r
+dqctm045 comparetotmag   00   20   ->  -1\r
+dqctm046 comparetotmag   10  -20   ->  -1\r
+dqctm047 comparetotmag   10  -10   ->   0\r
+dqctm048 comparetotmag   10   00   ->   1\r
+dqctm049 comparetotmag   10   10   ->   0\r
+dqctm050 comparetotmag   10   20   ->  -1\r
+dqctm051 comparetotmag   20  -20   ->   0\r
+dqctm052 comparetotmag   20  -10   ->   1\r
+dqctm053 comparetotmag   20   00   ->   1\r
+dqctm055 comparetotmag   20   10   ->   1\r
+dqctm056 comparetotmag   20   20   ->   0\r
+\r
+dqctm061 comparetotmag  -2.0  -2.0   ->   0\r
+dqctm062 comparetotmag  -2.0  -1.0   ->   1\r
+dqctm063 comparetotmag  -2.0   0.0   ->   1\r
+dqctm064 comparetotmag  -2.0   1.0   ->   1\r
+dqctm065 comparetotmag  -2.0   2.0   ->   0\r
+dqctm066 comparetotmag  -1.0  -2.0   ->  -1\r
+dqctm067 comparetotmag  -1.0  -1.0   ->   0\r
+dqctm068 comparetotmag  -1.0   0.0   ->   1\r
+dqctm069 comparetotmag  -1.0   1.0   ->   0\r
+dqctm070 comparetotmag  -1.0   2.0   ->  -1\r
+dqctm071 comparetotmag   0.0  -2.0   ->  -1\r
+dqctm072 comparetotmag   0.0  -1.0   ->  -1\r
+dqctm073 comparetotmag   0.0   0.0   ->   0\r
+dqctm074 comparetotmag   0.0   1.0   ->  -1\r
+dqctm075 comparetotmag   0.0   2.0   ->  -1\r
+dqctm076 comparetotmag   1.0  -2.0   ->  -1\r
+dqctm077 comparetotmag   1.0  -1.0   ->   0\r
+dqctm078 comparetotmag   1.0   0.0   ->   1\r
+dqctm079 comparetotmag   1.0   1.0   ->   0\r
+dqctm080 comparetotmag   1.0   2.0   ->  -1\r
+dqctm081 comparetotmag   2.0  -2.0   ->   0\r
+dqctm082 comparetotmag   2.0  -1.0   ->   1\r
+dqctm083 comparetotmag   2.0   0.0   ->   1\r
+dqctm085 comparetotmag   2.0   1.0   ->   1\r
+dqctm086 comparetotmag   2.0   2.0   ->   0\r
+\r
+-- now some cases which might overflow if subtract were used\r
+dqctm090 comparetotmag  9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144   ->   0\r
+dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144   ->   0\r
+dqctm092 comparetotmag  9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144  ->   0\r
+dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144  ->   0\r
+\r
+-- some differing length/exponent cases\r
+-- in this first group, compare would compare all equal\r
+dqctm100 comparetotmag   7.0    7.0     ->   0\r
+dqctm101 comparetotmag   7.0    7       ->  -1\r
+dqctm102 comparetotmag   7      7.0     ->   1\r
+dqctm103 comparetotmag   7E+0   7.0     ->   1\r
+dqctm104 comparetotmag   70E-1  7.0     ->   0\r
+dqctm105 comparetotmag   0.7E+1 7       ->   0\r
+dqctm106 comparetotmag   70E-1  7       ->  -1\r
+dqctm107 comparetotmag   7.0    7E+0    ->  -1\r
+dqctm108 comparetotmag   7.0    70E-1   ->   0\r
+dqctm109 comparetotmag   7      0.7E+1  ->   0\r
+dqctm110 comparetotmag   7      70E-1   ->   1\r
+\r
+dqctm120 comparetotmag   8.0    7.0     ->   1\r
+dqctm121 comparetotmag   8.0    7       ->   1\r
+dqctm122 comparetotmag   8      7.0     ->   1\r
+dqctm123 comparetotmag   8E+0   7.0     ->   1\r
+dqctm124 comparetotmag   80E-1  7.0     ->   1\r
+dqctm125 comparetotmag   0.8E+1 7       ->   1\r
+dqctm126 comparetotmag   80E-1  7       ->   1\r
+dqctm127 comparetotmag   8.0    7E+0    ->   1\r
+dqctm128 comparetotmag   8.0    70E-1   ->   1\r
+dqctm129 comparetotmag   8      0.7E+1   ->   1\r
+dqctm130 comparetotmag   8      70E-1   ->   1\r
+\r
+dqctm140 comparetotmag   8.0    9.0     ->  -1\r
+dqctm141 comparetotmag   8.0    9       ->  -1\r
+dqctm142 comparetotmag   8      9.0     ->  -1\r
+dqctm143 comparetotmag   8E+0   9.0     ->  -1\r
+dqctm144 comparetotmag   80E-1  9.0     ->  -1\r
+dqctm145 comparetotmag   0.8E+1 9       ->  -1\r
+dqctm146 comparetotmag   80E-1  9       ->  -1\r
+dqctm147 comparetotmag   8.0    9E+0    ->  -1\r
+dqctm148 comparetotmag   8.0    90E-1   ->  -1\r
+dqctm149 comparetotmag   8      0.9E+1  ->  -1\r
+dqctm150 comparetotmag   8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes -+ ..\r
+dqctm200 comparetotmag  -7.0    7.0     ->   0\r
+dqctm201 comparetotmag  -7.0    7       ->  -1\r
+dqctm202 comparetotmag  -7      7.0     ->   1\r
+dqctm203 comparetotmag  -7E+0   7.0     ->   1\r
+dqctm204 comparetotmag  -70E-1  7.0     ->   0\r
+dqctm205 comparetotmag  -0.7E+1 7       ->   0\r
+dqctm206 comparetotmag  -70E-1  7       ->  -1\r
+dqctm207 comparetotmag  -7.0    7E+0    ->  -1\r
+dqctm208 comparetotmag  -7.0    70E-1   ->   0\r
+dqctm209 comparetotmag  -7      0.7E+1  ->   0\r
+dqctm210 comparetotmag  -7      70E-1   ->   1\r
+\r
+dqctm220 comparetotmag  -8.0    7.0     ->   1\r
+dqctm221 comparetotmag  -8.0    7       ->   1\r
+dqctm222 comparetotmag  -8      7.0     ->   1\r
+dqctm223 comparetotmag  -8E+0   7.0     ->   1\r
+dqctm224 comparetotmag  -80E-1  7.0     ->   1\r
+dqctm225 comparetotmag  -0.8E+1 7       ->   1\r
+dqctm226 comparetotmag  -80E-1  7       ->   1\r
+dqctm227 comparetotmag  -8.0    7E+0    ->   1\r
+dqctm228 comparetotmag  -8.0    70E-1   ->   1\r
+dqctm229 comparetotmag  -8      0.7E+1  ->   1\r
+dqctm230 comparetotmag  -8      70E-1   ->   1\r
+\r
+dqctm240 comparetotmag  -8.0    9.0     ->  -1\r
+dqctm241 comparetotmag  -8.0    9       ->  -1\r
+dqctm242 comparetotmag  -8      9.0     ->  -1\r
+dqctm243 comparetotmag  -8E+0   9.0     ->  -1\r
+dqctm244 comparetotmag  -80E-1  9.0     ->  -1\r
+dqctm245 comparetotmag  -0.8E+1 9       ->  -1\r
+dqctm246 comparetotmag  -80E-1  9       ->  -1\r
+dqctm247 comparetotmag  -8.0    9E+0    ->  -1\r
+dqctm248 comparetotmag  -8.0    90E-1   ->  -1\r
+dqctm249 comparetotmag  -8      0.9E+1  ->  -1\r
+dqctm250 comparetotmag  -8      90E-1   ->  -1\r
+\r
+-- and again, with sign changes +- ..\r
+dqctm300 comparetotmag   7.0    -7.0     ->   0\r
+dqctm301 comparetotmag   7.0    -7       ->  -1\r
+dqctm302 comparetotmag   7      -7.0     ->   1\r
+dqctm303 comparetotmag   7E+0   -7.0     ->   1\r
+dqctm304 comparetotmag   70E-1  -7.0     ->   0\r
+dqctm305 comparetotmag   .7E+1  -7       ->   0\r
+dqctm306 comparetotmag   70E-1  -7       ->  -1\r
+dqctm307 comparetotmag   7.0    -7E+0    ->  -1\r
+dqctm308 comparetotmag   7.0    -70E-1   ->   0\r
+dqctm309 comparetotmag   7      -.7E+1   ->   0\r
+dqctm310 comparetotmag   7      -70E-1   ->   1\r
+\r
+dqctm320 comparetotmag   8.0    -7.0     ->   1\r
+dqctm321 comparetotmag   8.0    -7       ->   1\r
+dqctm322 comparetotmag   8      -7.0     ->   1\r
+dqctm323 comparetotmag   8E+0   -7.0     ->   1\r
+dqctm324 comparetotmag   80E-1  -7.0     ->   1\r
+dqctm325 comparetotmag   .8E+1  -7       ->   1\r
+dqctm326 comparetotmag   80E-1  -7       ->   1\r
+dqctm327 comparetotmag   8.0    -7E+0    ->   1\r
+dqctm328 comparetotmag   8.0    -70E-1   ->   1\r
+dqctm329 comparetotmag   8      -.7E+1   ->   1\r
+dqctm330 comparetotmag   8      -70E-1   ->   1\r
+\r
+dqctm340 comparetotmag   8.0    -9.0     ->  -1\r
+dqctm341 comparetotmag   8.0    -9       ->  -1\r
+dqctm342 comparetotmag   8      -9.0     ->  -1\r
+dqctm343 comparetotmag   8E+0   -9.0     ->  -1\r
+dqctm344 comparetotmag   80E-1  -9.0     ->  -1\r
+dqctm345 comparetotmag   .8E+1  -9       ->  -1\r
+dqctm346 comparetotmag   80E-1  -9       ->  -1\r
+dqctm347 comparetotmag   8.0    -9E+0    ->  -1\r
+dqctm348 comparetotmag   8.0    -90E-1   ->  -1\r
+dqctm349 comparetotmag   8      -.9E+1   ->  -1\r
+dqctm350 comparetotmag   8      -90E-1   ->  -1\r
+\r
+-- and again, with sign changes -- ..\r
+dqctm400 comparetotmag   -7.0    -7.0     ->   0\r
+dqctm401 comparetotmag   -7.0    -7       ->  -1\r
+dqctm402 comparetotmag   -7      -7.0     ->   1\r
+dqctm403 comparetotmag   -7E+0   -7.0     ->   1\r
+dqctm404 comparetotmag   -70E-1  -7.0     ->   0\r
+dqctm405 comparetotmag   -.7E+1  -7       ->   0\r
+dqctm406 comparetotmag   -70E-1  -7       ->  -1\r
+dqctm407 comparetotmag   -7.0    -7E+0    ->  -1\r
+dqctm408 comparetotmag   -7.0    -70E-1   ->   0\r
+dqctm409 comparetotmag   -7      -.7E+1   ->   0\r
+dqctm410 comparetotmag   -7      -70E-1   ->   1\r
+\r
+dqctm420 comparetotmag   -8.0    -7.0     ->   1\r
+dqctm421 comparetotmag   -8.0    -7       ->   1\r
+dqctm422 comparetotmag   -8      -7.0     ->   1\r
+dqctm423 comparetotmag   -8E+0   -7.0     ->   1\r
+dqctm424 comparetotmag   -80E-1  -7.0     ->   1\r
+dqctm425 comparetotmag   -.8E+1  -7       ->   1\r
+dqctm426 comparetotmag   -80E-1  -7       ->   1\r
+dqctm427 comparetotmag   -8.0    -7E+0    ->   1\r
+dqctm428 comparetotmag   -8.0    -70E-1   ->   1\r
+dqctm429 comparetotmag   -8      -.7E+1   ->   1\r
+dqctm430 comparetotmag   -8      -70E-1   ->   1\r
+\r
+dqctm440 comparetotmag   -8.0    -9.0     ->  -1\r
+dqctm441 comparetotmag   -8.0    -9       ->  -1\r
+dqctm442 comparetotmag   -8      -9.0     ->  -1\r
+dqctm443 comparetotmag   -8E+0   -9.0     ->  -1\r
+dqctm444 comparetotmag   -80E-1  -9.0     ->  -1\r
+dqctm445 comparetotmag   -.8E+1  -9       ->  -1\r
+dqctm446 comparetotmag   -80E-1  -9       ->  -1\r
+dqctm447 comparetotmag   -8.0    -9E+0    ->  -1\r
+dqctm448 comparetotmag   -8.0    -90E-1   ->  -1\r
+dqctm449 comparetotmag   -8      -.9E+1   ->  -1\r
+dqctm450 comparetotmag   -8      -90E-1   ->  -1\r
+\r
+\r
+-- testcases that subtract to lots of zeros at boundaries [pgr]\r
+dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89  ->  -1\r
+dqctm474 comparetotmag 123.456000000000E+89 123.456E+89  ->  -1\r
+dqctm475 comparetotmag 123.45600000000E-89 123.456E-89  ->  -1\r
+dqctm476 comparetotmag 123.4560000000E+89 123.456E+89  ->  -1\r
+dqctm477 comparetotmag 123.456000000E-89 123.456E-89  ->  -1\r
+dqctm478 comparetotmag 123.45600000E+89 123.456E+89  ->  -1\r
+dqctm479 comparetotmag 123.4560000E-89 123.456E-89  ->  -1\r
+dqctm480 comparetotmag 123.456000E+89 123.456E+89  ->  -1\r
+dqctm481 comparetotmag 123.45600E-89 123.456E-89  ->  -1\r
+dqctm482 comparetotmag 123.4560E+89 123.456E+89  ->  -1\r
+dqctm483 comparetotmag 123.456E-89 123.456E-89  ->   0\r
+dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89  ->   1\r
+dqctm488 comparetotmag 123.456E-89 123.456000000000E-89  ->   1\r
+dqctm489 comparetotmag 123.456E+89 123.45600000000E+89  ->   1\r
+dqctm490 comparetotmag 123.456E-89 123.4560000000E-89  ->   1\r
+dqctm491 comparetotmag 123.456E+89 123.456000000E+89  ->   1\r
+dqctm492 comparetotmag 123.456E-89 123.45600000E-89  ->   1\r
+dqctm493 comparetotmag 123.456E+89 123.4560000E+89  ->   1\r
+dqctm494 comparetotmag 123.456E-89 123.456000E-89  ->   1\r
+dqctm495 comparetotmag 123.456E+89 123.45600E+89  ->   1\r
+dqctm496 comparetotmag 123.456E-89 123.4560E-89  ->   1\r
+dqctm497 comparetotmag 123.456E+89 123.456E+89  ->   0\r
+\r
+-- wide-ranging, around precision; signs equal\r
+dqctm498 comparetotmag    1     1E-17     ->   1\r
+dqctm499 comparetotmag    1     1E-16     ->   1\r
+dqctm500 comparetotmag    1     1E-15     ->   1\r
+dqctm501 comparetotmag    1     1E-14     ->   1\r
+dqctm502 comparetotmag    1     1E-13     ->   1\r
+dqctm503 comparetotmag    1     1E-12     ->   1\r
+dqctm504 comparetotmag    1     1E-11     ->   1\r
+dqctm505 comparetotmag    1     1E-10     ->   1\r
+dqctm506 comparetotmag    1     1E-9      ->   1\r
+dqctm507 comparetotmag    1     1E-8      ->   1\r
+dqctm508 comparetotmag    1     1E-7      ->   1\r
+dqctm509 comparetotmag    1     1E-6      ->   1\r
+dqctm510 comparetotmag    1     1E-5      ->   1\r
+dqctm511 comparetotmag    1     1E-4      ->   1\r
+dqctm512 comparetotmag    1     1E-3      ->   1\r
+dqctm513 comparetotmag    1     1E-2      ->   1\r
+dqctm514 comparetotmag    1     1E-1      ->   1\r
+dqctm515 comparetotmag    1     1E-0      ->   0\r
+dqctm516 comparetotmag    1     1E+1      ->  -1\r
+dqctm517 comparetotmag    1     1E+2      ->  -1\r
+dqctm518 comparetotmag    1     1E+3      ->  -1\r
+dqctm519 comparetotmag    1     1E+4      ->  -1\r
+dqctm521 comparetotmag    1     1E+5      ->  -1\r
+dqctm522 comparetotmag    1     1E+6      ->  -1\r
+dqctm523 comparetotmag    1     1E+7      ->  -1\r
+dqctm524 comparetotmag    1     1E+8      ->  -1\r
+dqctm525 comparetotmag    1     1E+9      ->  -1\r
+dqctm526 comparetotmag    1     1E+10     ->  -1\r
+dqctm527 comparetotmag    1     1E+11     ->  -1\r
+dqctm528 comparetotmag    1     1E+12     ->  -1\r
+dqctm529 comparetotmag    1     1E+13     ->  -1\r
+dqctm530 comparetotmag    1     1E+14     ->  -1\r
+dqctm531 comparetotmag    1     1E+15     ->  -1\r
+dqctm532 comparetotmag    1     1E+16     ->  -1\r
+dqctm533 comparetotmag    1     1E+17     ->  -1\r
+-- LR swap\r
+dqctm538 comparetotmag    1E-17  1        ->  -1\r
+dqctm539 comparetotmag    1E-16  1        ->  -1\r
+dqctm540 comparetotmag    1E-15  1        ->  -1\r
+dqctm541 comparetotmag    1E-14  1        ->  -1\r
+dqctm542 comparetotmag    1E-13  1        ->  -1\r
+dqctm543 comparetotmag    1E-12  1        ->  -1\r
+dqctm544 comparetotmag    1E-11  1        ->  -1\r
+dqctm545 comparetotmag    1E-10  1        ->  -1\r
+dqctm546 comparetotmag    1E-9   1        ->  -1\r
+dqctm547 comparetotmag    1E-8   1        ->  -1\r
+dqctm548 comparetotmag    1E-7   1        ->  -1\r
+dqctm549 comparetotmag    1E-6   1        ->  -1\r
+dqctm550 comparetotmag    1E-5   1        ->  -1\r
+dqctm551 comparetotmag    1E-4   1        ->  -1\r
+dqctm552 comparetotmag    1E-3   1        ->  -1\r
+dqctm553 comparetotmag    1E-2   1        ->  -1\r
+dqctm554 comparetotmag    1E-1   1        ->  -1\r
+dqctm555 comparetotmag    1E-0   1        ->   0\r
+dqctm556 comparetotmag    1E+1   1        ->   1\r
+dqctm557 comparetotmag    1E+2   1        ->   1\r
+dqctm558 comparetotmag    1E+3   1        ->   1\r
+dqctm559 comparetotmag    1E+4   1        ->   1\r
+dqctm561 comparetotmag    1E+5   1        ->   1\r
+dqctm562 comparetotmag    1E+6   1        ->   1\r
+dqctm563 comparetotmag    1E+7   1        ->   1\r
+dqctm564 comparetotmag    1E+8   1        ->   1\r
+dqctm565 comparetotmag    1E+9   1        ->   1\r
+dqctm566 comparetotmag    1E+10  1        ->   1\r
+dqctm567 comparetotmag    1E+11  1        ->   1\r
+dqctm568 comparetotmag    1E+12  1        ->   1\r
+dqctm569 comparetotmag    1E+13  1        ->   1\r
+dqctm570 comparetotmag    1E+14  1        ->   1\r
+dqctm571 comparetotmag    1E+15  1        ->   1\r
+dqctm572 comparetotmag    1E+16  1        ->   1\r
+dqctm573 comparetotmag    1E+17  1        ->   1\r
+-- similar with a useful coefficient, one side only\r
+dqctm578 comparetotmag  0.000000987654321     1E-17     ->   1\r
+dqctm579 comparetotmag  0.000000987654321     1E-16     ->   1\r
+dqctm580 comparetotmag  0.000000987654321     1E-15     ->   1\r
+dqctm581 comparetotmag  0.000000987654321     1E-14     ->   1\r
+dqctm582 comparetotmag  0.000000987654321     1E-13     ->   1\r
+dqctm583 comparetotmag  0.000000987654321     1E-12     ->   1\r
+dqctm584 comparetotmag  0.000000987654321     1E-11     ->   1\r
+dqctm585 comparetotmag  0.000000987654321     1E-10     ->   1\r
+dqctm586 comparetotmag  0.000000987654321     1E-9      ->   1\r
+dqctm587 comparetotmag  0.000000987654321     1E-8      ->   1\r
+dqctm588 comparetotmag  0.000000987654321     1E-7      ->   1\r
+dqctm589 comparetotmag  0.000000987654321     1E-6      ->  -1\r
+dqctm590 comparetotmag  0.000000987654321     1E-5      ->  -1\r
+dqctm591 comparetotmag  0.000000987654321     1E-4      ->  -1\r
+dqctm592 comparetotmag  0.000000987654321     1E-3      ->  -1\r
+dqctm593 comparetotmag  0.000000987654321     1E-2      ->  -1\r
+dqctm594 comparetotmag  0.000000987654321     1E-1      ->  -1\r
+dqctm595 comparetotmag  0.000000987654321     1E-0      ->  -1\r
+dqctm596 comparetotmag  0.000000987654321     1E+1      ->  -1\r
+dqctm597 comparetotmag  0.000000987654321     1E+2      ->  -1\r
+dqctm598 comparetotmag  0.000000987654321     1E+3      ->  -1\r
+dqctm599 comparetotmag  0.000000987654321     1E+4      ->  -1\r
+\r
+-- check some unit-y traps\r
+dqctm600 comparetotmag   12            12.2345  ->  -1\r
+dqctm601 comparetotmag   12.0          12.2345  ->  -1\r
+dqctm602 comparetotmag   12.00         12.2345  ->  -1\r
+dqctm603 comparetotmag   12.000        12.2345  ->  -1\r
+dqctm604 comparetotmag   12.0000       12.2345  ->  -1\r
+dqctm605 comparetotmag   12.00000      12.2345  ->  -1\r
+dqctm606 comparetotmag   12.000000     12.2345  ->  -1\r
+dqctm607 comparetotmag   12.0000000    12.2345  ->  -1\r
+dqctm608 comparetotmag   12.00000000   12.2345  ->  -1\r
+dqctm609 comparetotmag   12.000000000  12.2345  ->  -1\r
+dqctm610 comparetotmag   12.1234 12             ->   1\r
+dqctm611 comparetotmag   12.1234 12.0           ->   1\r
+dqctm612 comparetotmag   12.1234 12.00          ->   1\r
+dqctm613 comparetotmag   12.1234 12.000         ->   1\r
+dqctm614 comparetotmag   12.1234 12.0000        ->   1\r
+dqctm615 comparetotmag   12.1234 12.00000       ->   1\r
+dqctm616 comparetotmag   12.1234 12.000000      ->   1\r
+dqctm617 comparetotmag   12.1234 12.0000000     ->   1\r
+dqctm618 comparetotmag   12.1234 12.00000000    ->   1\r
+dqctm619 comparetotmag   12.1234 12.000000000   ->   1\r
+dqctm620 comparetotmag  -12           -12.2345  ->  -1\r
+dqctm621 comparetotmag  -12.0         -12.2345  ->  -1\r
+dqctm622 comparetotmag  -12.00        -12.2345  ->  -1\r
+dqctm623 comparetotmag  -12.000       -12.2345  ->  -1\r
+dqctm624 comparetotmag  -12.0000      -12.2345  ->  -1\r
+dqctm625 comparetotmag  -12.00000     -12.2345  ->  -1\r
+dqctm626 comparetotmag  -12.000000    -12.2345  ->  -1\r
+dqctm627 comparetotmag  -12.0000000   -12.2345  ->  -1\r
+dqctm628 comparetotmag  -12.00000000  -12.2345  ->  -1\r
+dqctm629 comparetotmag  -12.000000000 -12.2345  ->  -1\r
+dqctm630 comparetotmag  -12.1234 -12            ->   1\r
+dqctm631 comparetotmag  -12.1234 -12.0          ->   1\r
+dqctm632 comparetotmag  -12.1234 -12.00         ->   1\r
+dqctm633 comparetotmag  -12.1234 -12.000        ->   1\r
+dqctm634 comparetotmag  -12.1234 -12.0000       ->   1\r
+dqctm635 comparetotmag  -12.1234 -12.00000      ->   1\r
+dqctm636 comparetotmag  -12.1234 -12.000000     ->   1\r
+dqctm637 comparetotmag  -12.1234 -12.0000000    ->   1\r
+dqctm638 comparetotmag  -12.1234 -12.00000000   ->   1\r
+dqctm639 comparetotmag  -12.1234 -12.000000000  ->   1\r
+\r
+-- extended zeros\r
+dqctm640 comparetotmag   0     0    ->   0\r
+dqctm641 comparetotmag   0    -0    ->   0\r
+dqctm642 comparetotmag   0    -0.0  ->   1\r
+dqctm643 comparetotmag   0     0.0  ->   1\r
+dqctm644 comparetotmag  -0     0    ->   0\r
+dqctm645 comparetotmag  -0    -0    ->   0\r
+dqctm646 comparetotmag  -0    -0.0  ->   1\r
+dqctm647 comparetotmag  -0     0.0  ->   1\r
+dqctm648 comparetotmag   0.0   0    ->  -1\r
+dqctm649 comparetotmag   0.0  -0    ->  -1\r
+dqctm650 comparetotmag   0.0  -0.0  ->   0\r
+dqctm651 comparetotmag   0.0   0.0  ->   0\r
+dqctm652 comparetotmag  -0.0   0    ->  -1\r
+dqctm653 comparetotmag  -0.0  -0    ->  -1\r
+dqctm654 comparetotmag  -0.0  -0.0  ->   0\r
+dqctm655 comparetotmag  -0.0   0.0  ->   0\r
+\r
+dqctm656 comparetotmag  -0E1   0.0  ->   1\r
+dqctm657 comparetotmag  -0E2   0.0  ->   1\r
+dqctm658 comparetotmag   0E1   0.0  ->   1\r
+dqctm659 comparetotmag   0E2   0.0  ->   1\r
+dqctm660 comparetotmag  -0E1   0    ->   1\r
+dqctm661 comparetotmag  -0E2   0    ->   1\r
+dqctm662 comparetotmag   0E1   0    ->   1\r
+dqctm663 comparetotmag   0E2   0    ->   1\r
+dqctm664 comparetotmag  -0E1  -0E1  ->   0\r
+dqctm665 comparetotmag  -0E2  -0E1  ->   1\r
+dqctm666 comparetotmag   0E1  -0E1  ->   0\r
+dqctm667 comparetotmag   0E2  -0E1  ->   1\r
+dqctm668 comparetotmag  -0E1  -0E2  ->  -1\r
+dqctm669 comparetotmag  -0E2  -0E2  ->   0\r
+dqctm670 comparetotmag   0E1  -0E2  ->  -1\r
+dqctm671 comparetotmag   0E2  -0E2  ->   0\r
+dqctm672 comparetotmag  -0E1   0E1  ->   0\r
+dqctm673 comparetotmag  -0E2   0E1  ->   1\r
+dqctm674 comparetotmag   0E1   0E1  ->   0\r
+dqctm675 comparetotmag   0E2   0E1  ->   1\r
+dqctm676 comparetotmag  -0E1   0E2  ->  -1\r
+dqctm677 comparetotmag  -0E2   0E2  ->   0\r
+dqctm678 comparetotmag   0E1   0E2  ->  -1\r
+dqctm679 comparetotmag   0E2   0E2  ->   0\r
+\r
+-- trailing zeros; unit-y\r
+dqctm680 comparetotmag   12    12            ->   0\r
+dqctm681 comparetotmag   12    12.0          ->   1\r
+dqctm682 comparetotmag   12    12.00         ->   1\r
+dqctm683 comparetotmag   12    12.000        ->   1\r
+dqctm684 comparetotmag   12    12.0000       ->   1\r
+dqctm685 comparetotmag   12    12.00000      ->   1\r
+dqctm686 comparetotmag   12    12.000000     ->   1\r
+dqctm687 comparetotmag   12    12.0000000    ->   1\r
+dqctm688 comparetotmag   12    12.00000000   ->   1\r
+dqctm689 comparetotmag   12    12.000000000  ->   1\r
+dqctm690 comparetotmag   12              12  ->   0\r
+dqctm691 comparetotmag   12.0            12  ->  -1\r
+dqctm692 comparetotmag   12.00           12  ->  -1\r
+dqctm693 comparetotmag   12.000          12  ->  -1\r
+dqctm694 comparetotmag   12.0000         12  ->  -1\r
+dqctm695 comparetotmag   12.00000        12  ->  -1\r
+dqctm696 comparetotmag   12.000000       12  ->  -1\r
+dqctm697 comparetotmag   12.0000000      12  ->  -1\r
+dqctm698 comparetotmag   12.00000000     12  ->  -1\r
+dqctm699 comparetotmag   12.000000000    12  ->  -1\r
+\r
+-- old long operand checks\r
+dqctm701 comparetotmag 12345678000  1  ->   1\r
+dqctm702 comparetotmag 1 12345678000   ->  -1\r
+dqctm703 comparetotmag 1234567800   1  ->   1\r
+dqctm704 comparetotmag 1 1234567800    ->  -1\r
+dqctm705 comparetotmag 1234567890   1  ->   1\r
+dqctm706 comparetotmag 1 1234567890    ->  -1\r
+dqctm707 comparetotmag 1234567891   1  ->   1\r
+dqctm708 comparetotmag 1 1234567891    ->  -1\r
+dqctm709 comparetotmag 12345678901  1  ->   1\r
+dqctm710 comparetotmag 1 12345678901   ->  -1\r
+dqctm711 comparetotmag 1234567896   1  ->   1\r
+dqctm712 comparetotmag 1 1234567896    ->  -1\r
+dqctm713 comparetotmag -1234567891  1  ->   1\r
+dqctm714 comparetotmag 1 -1234567891   ->  -1\r
+dqctm715 comparetotmag -12345678901 1  ->   1\r
+dqctm716 comparetotmag 1 -12345678901  ->  -1\r
+dqctm717 comparetotmag -1234567896  1  ->   1\r
+dqctm718 comparetotmag 1 -1234567896   ->  -1\r
+\r
+-- old residue cases\r
+dqctm740 comparetotmag  1  0.9999999   ->   1\r
+dqctm741 comparetotmag  1  0.999999    ->   1\r
+dqctm742 comparetotmag  1  0.99999     ->   1\r
+dqctm743 comparetotmag  1  1.0000      ->   1\r
+dqctm744 comparetotmag  1  1.00001     ->  -1\r
+dqctm745 comparetotmag  1  1.000001    ->  -1\r
+dqctm746 comparetotmag  1  1.0000001   ->  -1\r
+dqctm750 comparetotmag  0.9999999  1   ->  -1\r
+dqctm751 comparetotmag  0.999999   1   ->  -1\r
+dqctm752 comparetotmag  0.99999    1   ->  -1\r
+dqctm753 comparetotmag  1.0000     1   ->  -1\r
+dqctm754 comparetotmag  1.00001    1   ->   1\r
+dqctm755 comparetotmag  1.000001   1   ->   1\r
+dqctm756 comparetotmag  1.0000001  1   ->   1\r
+\r
+-- Specials\r
+dqctm780 comparetotmag  Inf  -Inf   ->  0\r
+dqctm781 comparetotmag  Inf  -1000  ->  1\r
+dqctm782 comparetotmag  Inf  -1     ->  1\r
+dqctm783 comparetotmag  Inf  -0     ->  1\r
+dqctm784 comparetotmag  Inf   0     ->  1\r
+dqctm785 comparetotmag  Inf   1     ->  1\r
+dqctm786 comparetotmag  Inf   1000  ->  1\r
+dqctm787 comparetotmag  Inf   Inf   ->  0\r
+dqctm788 comparetotmag -1000  Inf   -> -1\r
+dqctm789 comparetotmag -Inf   Inf   ->  0\r
+dqctm790 comparetotmag -1     Inf   -> -1\r
+dqctm791 comparetotmag -0     Inf   -> -1\r
+dqctm792 comparetotmag  0     Inf   -> -1\r
+dqctm793 comparetotmag  1     Inf   -> -1\r
+dqctm794 comparetotmag  1000  Inf   -> -1\r
+dqctm795 comparetotmag  Inf   Inf   ->  0\r
+\r
+dqctm800 comparetotmag -Inf  -Inf   ->  0\r
+dqctm801 comparetotmag -Inf  -1000  ->  1\r
+dqctm802 comparetotmag -Inf  -1     ->  1\r
+dqctm803 comparetotmag -Inf  -0     ->  1\r
+dqctm804 comparetotmag -Inf   0     ->  1\r
+dqctm805 comparetotmag -Inf   1     ->  1\r
+dqctm806 comparetotmag -Inf   1000  ->  1\r
+dqctm807 comparetotmag -Inf   Inf   ->  0\r
+dqctm808 comparetotmag -Inf  -Inf   ->  0\r
+dqctm809 comparetotmag -1000 -Inf   -> -1\r
+dqctm810 comparetotmag -1    -Inf   -> -1\r
+dqctm811 comparetotmag -0    -Inf   -> -1\r
+dqctm812 comparetotmag  0    -Inf   -> -1\r
+dqctm813 comparetotmag  1    -Inf   -> -1\r
+dqctm814 comparetotmag  1000 -Inf   -> -1\r
+dqctm815 comparetotmag  Inf  -Inf   ->  0\r
+\r
+dqctm821 comparetotmag  NaN -Inf    ->  1\r
+dqctm822 comparetotmag  NaN -1000   ->  1\r
+dqctm823 comparetotmag  NaN -1      ->  1\r
+dqctm824 comparetotmag  NaN -0      ->  1\r
+dqctm825 comparetotmag  NaN  0      ->  1\r
+dqctm826 comparetotmag  NaN  1      ->  1\r
+dqctm827 comparetotmag  NaN  1000   ->  1\r
+dqctm828 comparetotmag  NaN  Inf    ->  1\r
+dqctm829 comparetotmag  NaN  NaN    ->  0\r
+dqctm830 comparetotmag -Inf  NaN    ->  -1\r
+dqctm831 comparetotmag -1000 NaN    ->  -1\r
+dqctm832 comparetotmag -1    NaN    ->  -1\r
+dqctm833 comparetotmag -0    NaN    ->  -1\r
+dqctm834 comparetotmag  0    NaN    ->  -1\r
+dqctm835 comparetotmag  1    NaN    ->  -1\r
+dqctm836 comparetotmag  1000 NaN    ->  -1\r
+dqctm837 comparetotmag  Inf  NaN    ->  -1\r
+dqctm838 comparetotmag -NaN -NaN    ->  0\r
+dqctm839 comparetotmag +NaN -NaN    ->  0\r
+dqctm840 comparetotmag -NaN +NaN    ->  0\r
+\r
+dqctm841 comparetotmag  sNaN -sNaN  ->  0\r
+dqctm842 comparetotmag  sNaN -NaN   ->  -1\r
+dqctm843 comparetotmag  sNaN -Inf   ->  1\r
+dqctm844 comparetotmag  sNaN -1000  ->  1\r
+dqctm845 comparetotmag  sNaN -1     ->  1\r
+dqctm846 comparetotmag  sNaN -0     ->  1\r
+dqctm847 comparetotmag  sNaN  0     ->  1\r
+dqctm848 comparetotmag  sNaN  1     ->  1\r
+dqctm849 comparetotmag  sNaN  1000  ->  1\r
+dqctm850 comparetotmag  sNaN  NaN   ->  -1\r
+dqctm851 comparetotmag  sNaN sNaN   ->  0\r
+\r
+dqctm852 comparetotmag -sNaN sNaN   ->  0\r
+dqctm853 comparetotmag -NaN  sNaN   ->  1\r
+dqctm854 comparetotmag -Inf  sNaN   ->  -1\r
+dqctm855 comparetotmag -1000 sNaN   ->  -1\r
+dqctm856 comparetotmag -1    sNaN   ->  -1\r
+dqctm857 comparetotmag -0    sNaN   ->  -1\r
+dqctm858 comparetotmag  0    sNaN   ->  -1\r
+dqctm859 comparetotmag  1    sNaN   ->  -1\r
+dqctm860 comparetotmag  1000 sNaN   ->  -1\r
+dqctm861 comparetotmag  Inf  sNaN   ->  -1\r
+dqctm862 comparetotmag  NaN  sNaN   ->  1\r
+dqctm863 comparetotmag  sNaN sNaN   ->  0\r
+\r
+dqctm871 comparetotmag  -sNaN -sNaN  ->  0\r
+dqctm872 comparetotmag  -sNaN -NaN   ->  -1\r
+dqctm873 comparetotmag  -sNaN -Inf   ->  1\r
+dqctm874 comparetotmag  -sNaN -1000  ->  1\r
+dqctm875 comparetotmag  -sNaN -1     ->  1\r
+dqctm876 comparetotmag  -sNaN -0     ->  1\r
+dqctm877 comparetotmag  -sNaN  0     ->  1\r
+dqctm878 comparetotmag  -sNaN  1     ->  1\r
+dqctm879 comparetotmag  -sNaN  1000  ->  1\r
+dqctm880 comparetotmag  -sNaN  NaN   ->  -1\r
+dqctm881 comparetotmag  -sNaN sNaN   ->  0\r
+\r
+dqctm882 comparetotmag -sNaN -sNaN   ->  0\r
+dqctm883 comparetotmag -NaN  -sNaN   ->  1\r
+dqctm884 comparetotmag -Inf  -sNaN   ->  -1\r
+dqctm885 comparetotmag -1000 -sNaN   ->  -1\r
+dqctm886 comparetotmag -1    -sNaN   ->  -1\r
+dqctm887 comparetotmag -0    -sNaN   ->  -1\r
+dqctm888 comparetotmag  0    -sNaN   ->  -1\r
+dqctm889 comparetotmag  1    -sNaN   ->  -1\r
+dqctm890 comparetotmag  1000 -sNaN   ->  -1\r
+dqctm891 comparetotmag  Inf  -sNaN   ->  -1\r
+dqctm892 comparetotmag  NaN  -sNaN   ->  1\r
+dqctm893 comparetotmag  sNaN -sNaN   ->  0\r
+\r
+-- NaNs with payload\r
+dqctm960 comparetotmag  NaN9 -Inf   ->  1\r
+dqctm961 comparetotmag  NaN8  999   ->  1\r
+dqctm962 comparetotmag  NaN77 Inf   ->  1\r
+dqctm963 comparetotmag -NaN67 NaN5  ->  1\r
+dqctm964 comparetotmag -Inf  -NaN4  ->  -1\r
+dqctm965 comparetotmag -999  -NaN33 ->  -1\r
+dqctm966 comparetotmag  Inf   NaN2  ->  -1\r
+\r
+dqctm970 comparetotmag -NaN41 -NaN42 -> -1\r
+dqctm971 comparetotmag +NaN41 -NaN42 -> -1\r
+dqctm972 comparetotmag -NaN41 +NaN42 -> -1\r
+dqctm973 comparetotmag +NaN41 +NaN42 -> -1\r
+dqctm974 comparetotmag -NaN42 -NaN01 ->  1\r
+dqctm975 comparetotmag +NaN42 -NaN01 ->  1\r
+dqctm976 comparetotmag -NaN42 +NaN01 ->  1\r
+dqctm977 comparetotmag +NaN42 +NaN01 ->  1\r
+\r
+dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1\r
+dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1\r
+dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1\r
+dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1\r
+dqctm984 comparetotmag -sNaN772 -sNaN771 ->  1\r
+dqctm985 comparetotmag +sNaN772 -sNaN771 ->  1\r
+dqctm986 comparetotmag -sNaN772 +sNaN771 ->  1\r
+dqctm987 comparetotmag +sNaN772 +sNaN771 ->  1\r
+\r
+dqctm991 comparetotmag -sNaN99 -Inf    ->  1\r
+dqctm992 comparetotmag  sNaN98 -11     ->  1\r
+dqctm993 comparetotmag  sNaN97  NaN    -> -1\r
+dqctm994 comparetotmag  sNaN16 sNaN94  -> -1\r
+dqctm995 comparetotmag  NaN85  sNaN83  ->  1\r
+dqctm996 comparetotmag -Inf    sNaN92  -> -1\r
+dqctm997 comparetotmag  088    sNaN81  -> -1\r
+dqctm998 comparetotmag  Inf    sNaN90  -> -1\r
+dqctm999 comparetotmag  NaN   -sNaN89  ->  1\r
+\r
+-- spread zeros\r
+dqctm1110 comparetotmag   0E-6143  0        ->  -1\r
+dqctm1111 comparetotmag   0E-6143 -0        ->  -1\r
+dqctm1112 comparetotmag  -0E-6143  0        ->  -1\r
+dqctm1113 comparetotmag  -0E-6143 -0        ->  -1\r
+dqctm1114 comparetotmag   0E-6143  0E+6144   ->  -1\r
+dqctm1115 comparetotmag   0E-6143 -0E+6144   ->  -1\r
+dqctm1116 comparetotmag  -0E-6143  0E+6144   ->  -1\r
+dqctm1117 comparetotmag  -0E-6143 -0E+6144   ->  -1\r
+dqctm1118 comparetotmag   0       0E+6144   ->  -1\r
+dqctm1119 comparetotmag   0      -0E+6144   ->  -1\r
+dqctm1120 comparetotmag  -0       0E+6144   ->  -1\r
+dqctm1121 comparetotmag  -0      -0E+6144   ->  -1\r
+\r
+dqctm1130 comparetotmag   0E+6144  0        ->   1\r
+dqctm1131 comparetotmag   0E+6144 -0        ->   1\r
+dqctm1132 comparetotmag  -0E+6144  0        ->   1\r
+dqctm1133 comparetotmag  -0E+6144 -0        ->   1\r
+dqctm1134 comparetotmag   0E+6144  0E-6143   ->   1\r
+dqctm1135 comparetotmag   0E+6144 -0E-6143   ->   1\r
+dqctm1136 comparetotmag  -0E+6144  0E-6143   ->   1\r
+dqctm1137 comparetotmag  -0E+6144 -0E-6143   ->   1\r
+dqctm1138 comparetotmag   0       0E-6143   ->   1\r
+dqctm1139 comparetotmag   0      -0E-6143   ->   1\r
+dqctm1140 comparetotmag  -0       0E-6143   ->   1\r
+dqctm1141 comparetotmag  -0      -0E-6143   ->   1\r
+\r
+-- Null tests\r
+dqctm9990 comparetotmag 10  # -> NaN Invalid_operation\r
+dqctm9991 comparetotmag  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqCopy.decTest b/Lib/test/decimaltestdata/dqCopy.decTest
new file mode 100644 (file)
index 0000000..b833776
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- dqCopy.decTest -- quiet decQuad copy                               --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqcpy001 copy       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+dqcpy011 copy  Infinity    -> Infinity\r
+dqcpy012 copy  -Infinity   -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqcpy021 copy         NaN  -> NaN\r
+dqcpy022 copy        -NaN  -> -NaN\r
+dqcpy023 copy        sNaN  -> sNaN\r
+dqcpy024 copy       -sNaN  -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+dqcpy031 copy       NaN10  -> NaN10\r
+dqcpy032 copy      -NaN10  -> -NaN10\r
+dqcpy033 copy      sNaN10  -> sNaN10\r
+dqcpy034 copy     -sNaN10  -> -sNaN10\r
+dqcpy035 copy       NaN7   -> NaN7\r
+dqcpy036 copy      -NaN7   -> -NaN7\r
+dqcpy037 copy      sNaN101 -> sNaN101\r
+dqcpy038 copy     -sNaN101 -> -sNaN101\r
+\r
+-- finites\r
+dqcpy101 copy          7   -> 7\r
+dqcpy102 copy         -7   -> -7\r
+dqcpy103 copy         75   -> 75\r
+dqcpy104 copy        -75   -> -75\r
+dqcpy105 copy       7.50   -> 7.50\r
+dqcpy106 copy      -7.50   -> -7.50\r
+dqcpy107 copy       7.500  -> 7.500\r
+dqcpy108 copy      -7.500  -> -7.500\r
+\r
+-- zeros\r
+dqcpy111 copy          0   -> 0\r
+dqcpy112 copy         -0   -> -0\r
+dqcpy113 copy       0E+4   -> 0E+4\r
+dqcpy114 copy      -0E+4   -> -0E+4\r
+dqcpy115 copy     0.0000   -> 0.0000\r
+dqcpy116 copy    -0.0000   -> -0.0000\r
+dqcpy117 copy      0E-141  -> 0E-141\r
+dqcpy118 copy     -0E-141  -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqcpy121 copy   2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqcpy122 copy  -2682682682682682682682682682682682    -> -2682682682682682682682682682682682\r
+dqcpy123 copy   1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+dqcpy124 copy  -1341341341341341341341341341341341    -> -1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqcpy131 copy  9.999999999999999999999999999999999E+6144   ->  9.999999999999999999999999999999999E+6144\r
+dqcpy132 copy  1E-6143                                     ->  1E-6143\r
+dqcpy133 copy  1.000000000000000000000000000000000E-6143   ->  1.000000000000000000000000000000000E-6143\r
+dqcpy134 copy  1E-6176                                     ->  1E-6176\r
+\r
+dqcpy135 copy  -1E-6176                                    -> -1E-6176\r
+dqcpy136 copy  -1.000000000000000000000000000000000E-6143  -> -1.000000000000000000000000000000000E-6143\r
+dqcpy137 copy  -1E-6143                                    -> -1E-6143\r
+dqcpy138 copy  -9.999999999999999999999999999999999E+6144  -> -9.999999999999999999999999999999999E+6144\r
diff --git a/Lib/test/decimaltestdata/dqCopyAbs.decTest b/Lib/test/decimaltestdata/dqCopyAbs.decTest
new file mode 100644 (file)
index 0000000..91f4a68
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero       --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqcpa001 copyabs       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+dqcpa011 copyabs  Infinity    -> Infinity\r
+dqcpa012 copyabs  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqcpa021 copyabs         NaN  -> NaN\r
+dqcpa022 copyabs        -NaN  -> NaN\r
+dqcpa023 copyabs        sNaN  -> sNaN\r
+dqcpa024 copyabs       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+dqcpa031 copyabs       NaN10  -> NaN10\r
+dqcpa032 copyabs      -NaN15  -> NaN15\r
+dqcpa033 copyabs      sNaN15  -> sNaN15\r
+dqcpa034 copyabs     -sNaN10  -> sNaN10\r
+dqcpa035 copyabs       NaN7   -> NaN7\r
+dqcpa036 copyabs      -NaN7   -> NaN7\r
+dqcpa037 copyabs      sNaN101 -> sNaN101\r
+dqcpa038 copyabs     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+dqcpa101 copyabs          7   -> 7\r
+dqcpa102 copyabs         -7   -> 7\r
+dqcpa103 copyabs         75   -> 75\r
+dqcpa104 copyabs        -75   -> 75\r
+dqcpa105 copyabs       7.10   -> 7.10\r
+dqcpa106 copyabs      -7.10   -> 7.10\r
+dqcpa107 copyabs       7.500  -> 7.500\r
+dqcpa108 copyabs      -7.500  -> 7.500\r
+\r
+-- zeros\r
+dqcpa111 copyabs          0   -> 0\r
+dqcpa112 copyabs         -0   -> 0\r
+dqcpa113 copyabs       0E+6   -> 0E+6\r
+dqcpa114 copyabs      -0E+6   -> 0E+6\r
+dqcpa115 copyabs     0.0000   -> 0.0000\r
+dqcpa116 copyabs    -0.0000   -> 0.0000\r
+dqcpa117 copyabs      0E-141  -> 0E-141\r
+dqcpa118 copyabs     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqcpa121 copyabs   2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqcpa122 copyabs  -2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqcpa123 copyabs   1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+dqcpa124 copyabs  -1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqcpa131 copyabs  9.999999999999999999999999999999999E+6144   ->  9.999999999999999999999999999999999E+6144\r
+dqcpa132 copyabs  1E-6143                                     ->  1E-6143\r
+dqcpa133 copyabs  1.000000000000000000000000000000000E-6143   ->  1.000000000000000000000000000000000E-6143\r
+dqcpa134 copyabs  1E-6176                                     ->  1E-6176\r
+\r
+dqcpa135 copyabs  -1E-6176                                    ->  1E-6176\r
+dqcpa136 copyabs  -1.000000000000000000000000000000000E-6143  ->  1.000000000000000000000000000000000E-6143\r
+dqcpa137 copyabs  -1E-6143                                    ->  1E-6143\r
+dqcpa138 copyabs  -9.999999999999999999999999999999999E+6144  ->  9.999999999999999999999999999999999E+6144\r
diff --git a/Lib/test/decimaltestdata/dqCopyNegate.decTest b/Lib/test/decimaltestdata/dqCopyNegate.decTest
new file mode 100644 (file)
index 0000000..22ac89c
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- dqCopyNegate.decTest -- quiet decQuad copy and negate              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqcpn001 copynegate       +7.50  -> -7.50\r
+\r
+-- Infinities\r
+dqcpn011 copynegate  Infinity    -> -Infinity\r
+dqcpn012 copynegate  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqcpn021 copynegate         NaN  -> -NaN\r
+dqcpn022 copynegate        -NaN  -> NaN\r
+dqcpn023 copynegate        sNaN  -> -sNaN\r
+dqcpn024 copynegate       -sNaN  -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+dqcpn031 copynegate       NaN13  -> -NaN13\r
+dqcpn032 copynegate      -NaN13  -> NaN13\r
+dqcpn033 copynegate      sNaN13  -> -sNaN13\r
+dqcpn034 copynegate     -sNaN13  -> sNaN13\r
+dqcpn035 copynegate       NaN70  -> -NaN70\r
+dqcpn036 copynegate      -NaN70  -> NaN70\r
+dqcpn037 copynegate      sNaN101 -> -sNaN101\r
+dqcpn038 copynegate     -sNaN101 -> sNaN101\r
+\r
+-- finites\r
+dqcpn101 copynegate          7   -> -7\r
+dqcpn102 copynegate         -7   -> 7\r
+dqcpn103 copynegate         75   -> -75\r
+dqcpn104 copynegate        -75   -> 75\r
+dqcpn105 copynegate       7.50   -> -7.50\r
+dqcpn106 copynegate      -7.50   -> 7.50\r
+dqcpn107 copynegate       7.500  -> -7.500\r
+dqcpn108 copynegate      -7.500  -> 7.500\r
+\r
+-- zeros\r
+dqcpn111 copynegate          0   -> -0\r
+dqcpn112 copynegate         -0   -> 0\r
+dqcpn113 copynegate       0E+4   -> -0E+4\r
+dqcpn114 copynegate      -0E+4   -> 0E+4\r
+dqcpn115 copynegate     0.0000   -> -0.0000\r
+dqcpn116 copynegate    -0.0000   -> 0.0000\r
+dqcpn117 copynegate      0E-141  -> -0E-141\r
+dqcpn118 copynegate     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqcpn121 copynegate   2682682682682682682682682682682682    -> -2682682682682682682682682682682682\r
+dqcpn122 copynegate  -2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqcpn123 copynegate   1341341341341341341341341341341341    -> -1341341341341341341341341341341341\r
+dqcpn124 copynegate  -1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqcpn131 copynegate  9.999999999999999999999999999999999E+6144   -> -9.999999999999999999999999999999999E+6144\r
+dqcpn132 copynegate  1E-6143                                     -> -1E-6143\r
+dqcpn133 copynegate  1.000000000000000000000000000000000E-6143   -> -1.000000000000000000000000000000000E-6143\r
+dqcpn134 copynegate  1E-6176                                     -> -1E-6176\r
+\r
+dqcpn135 copynegate  -1E-6176                                    ->  1E-6176\r
+dqcpn136 copynegate  -1.000000000000000000000000000000000E-6143  ->  1.000000000000000000000000000000000E-6143\r
+dqcpn137 copynegate  -1E-6143                                    ->  1E-6143\r
+dqcpn138 copynegate  -9.999999999999999999999999999999999E+6144  ->  9.999999999999999999999999999999999E+6144\r
diff --git a/Lib/test/decimaltestdata/dqCopySign.decTest b/Lib/test/decimaltestdata/dqCopySign.decTest
new file mode 100644 (file)
index 0000000..8f275cd
--- /dev/null
@@ -0,0 +1,175 @@
+------------------------------------------------------------------------\r
+-- dqCopySign.decTest -- quiet decQuad copy with sign from rhs        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqcps001 copysign       +7.50     11 -> 7.50\r
+\r
+-- Infinities\r
+dqcps011 copysign  Infinity       11 -> Infinity\r
+dqcps012 copysign  -Infinity      11 -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqcps021 copysign         NaN     11 -> NaN\r
+dqcps022 copysign        -NaN     11 -> NaN\r
+dqcps023 copysign        sNaN     11 -> sNaN\r
+dqcps024 copysign       -sNaN     11 -> sNaN\r
+\r
+-- NaNs, non-0 payload\r
+dqcps031 copysign       NaN10     11 -> NaN10\r
+dqcps032 copysign      -NaN10     11 -> NaN10\r
+dqcps033 copysign      sNaN10     11 -> sNaN10\r
+dqcps034 copysign     -sNaN10     11 -> sNaN10\r
+dqcps035 copysign       NaN7      11 -> NaN7\r
+dqcps036 copysign      -NaN7      11 -> NaN7\r
+dqcps037 copysign      sNaN101    11 -> sNaN101\r
+dqcps038 copysign     -sNaN101    11 -> sNaN101\r
+\r
+-- finites\r
+dqcps101 copysign          7      11 -> 7\r
+dqcps102 copysign         -7      11 -> 7\r
+dqcps103 copysign         75      11 -> 75\r
+dqcps104 copysign        -75      11 -> 75\r
+dqcps105 copysign       7.50      11 -> 7.50\r
+dqcps106 copysign      -7.50      11 -> 7.50\r
+dqcps107 copysign       7.500     11 -> 7.500\r
+dqcps108 copysign      -7.500     11 -> 7.500\r
+\r
+-- zeros\r
+dqcps111 copysign          0      11 -> 0\r
+dqcps112 copysign         -0      11 -> 0\r
+dqcps113 copysign       0E+4      11 -> 0E+4\r
+dqcps114 copysign      -0E+4      11 -> 0E+4\r
+dqcps115 copysign     0.0000      11 -> 0.0000\r
+dqcps116 copysign    -0.0000      11 -> 0.0000\r
+dqcps117 copysign      0E-141     11 -> 0E-141\r
+dqcps118 copysign     -0E-141     11 -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqcps121 copysign   2682682682682682682682682682682682 8  ->  2682682682682682682682682682682682\r
+dqcps122 copysign  -2682682682682682682682682682682682 8  ->  2682682682682682682682682682682682\r
+dqcps123 copysign   1341341341341341341341341341341341 8  ->  1341341341341341341341341341341341\r
+dqcps124 copysign  -1341341341341341341341341341341341 8  ->  1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqcps131 copysign  9.999999999999999999999999999999999E+6144 8 ->  9.999999999999999999999999999999999E+6144\r
+dqcps132 copysign  1E-6143                                   8 ->  1E-6143\r
+dqcps133 copysign  1.000000000000000000000000000000000E-6143 8 ->  1.000000000000000000000000000000000E-6143\r
+dqcps134 copysign  1E-6176                                   8 ->  1E-6176\r
+\r
+dqcps135 copysign  -1E-6176                                   8 ->  1E-6176\r
+dqcps136 copysign  -1.000000000000000000000000000000000E-6143 8 ->  1.000000000000000000000000000000000E-6143\r
+dqcps137 copysign  -1E-6143                                   8 ->  1E-6143\r
+dqcps138 copysign  -9.999999999999999999999999999999999E+6144 8 ->  9.999999999999999999999999999999999E+6144\r
+\r
+-- repeat with negative RHS\r
+\r
+-- Infinities\r
+dqcps211 copysign  Infinity       -34 -> -Infinity\r
+dqcps212 copysign  -Infinity      -34 -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqcps221 copysign         NaN     -34 -> -NaN\r
+dqcps222 copysign        -NaN     -34 -> -NaN\r
+dqcps223 copysign        sNaN     -34 -> -sNaN\r
+dqcps224 copysign       -sNaN     -34 -> -sNaN\r
+\r
+-- NaNs, non-0 payload\r
+dqcps231 copysign       NaN10     -34 -> -NaN10\r
+dqcps232 copysign      -NaN10     -34 -> -NaN10\r
+dqcps233 copysign      sNaN10     -34 -> -sNaN10\r
+dqcps234 copysign     -sNaN10     -34 -> -sNaN10\r
+dqcps235 copysign       NaN7      -34 -> -NaN7\r
+dqcps236 copysign      -NaN7      -34 -> -NaN7\r
+dqcps237 copysign      sNaN101    -34 -> -sNaN101\r
+dqcps238 copysign     -sNaN101    -34 -> -sNaN101\r
+\r
+-- finites\r
+dqcps301 copysign          7      -34 -> -7\r
+dqcps302 copysign         -7      -34 -> -7\r
+dqcps303 copysign         75      -34 -> -75\r
+dqcps304 copysign        -75      -34 -> -75\r
+dqcps305 copysign       7.50      -34 -> -7.50\r
+dqcps306 copysign      -7.50      -34 -> -7.50\r
+dqcps307 copysign       7.500     -34 -> -7.500\r
+dqcps308 copysign      -7.500     -34 -> -7.500\r
+\r
+-- zeros\r
+dqcps311 copysign          0      -34 -> -0\r
+dqcps312 copysign         -0      -34 -> -0\r
+dqcps313 copysign       0E+4      -34 -> -0E+4\r
+dqcps314 copysign      -0E+4      -34 -> -0E+4\r
+dqcps315 copysign     0.0000      -34 -> -0.0000\r
+dqcps316 copysign    -0.0000      -34 -> -0.0000\r
+dqcps317 copysign      0E-141     -34 -> -0E-141\r
+dqcps318 copysign     -0E-141     -34 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqcps321 copysign   2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682\r
+dqcps322 copysign  -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682\r
+dqcps323 copysign   1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341\r
+dqcps324 copysign  -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqcps331 copysign  9.999999999999999999999999999999999E+6144 -1  -> -9.999999999999999999999999999999999E+6144\r
+dqcps332 copysign  1E-6143                                   -1  -> -1E-6143\r
+dqcps333 copysign  1.000000000000000000000000000000000E-6143 -1  -> -1.000000000000000000000000000000000E-6143\r
+dqcps334 copysign  1E-6176                                   -1  -> -1E-6176\r
+\r
+dqcps335 copysign  -1E-6176                                   -3 -> -1E-6176\r
+dqcps336 copysign  -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143\r
+dqcps337 copysign  -1E-6143                                   -3 -> -1E-6143\r
+dqcps338 copysign  -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144\r
+\r
+-- Other kinds of RHS\r
+dqcps401 copysign          701    -34 -> -701\r
+dqcps402 copysign         -720    -34 -> -720\r
+dqcps403 copysign          701    -0  -> -701\r
+dqcps404 copysign         -720    -0  -> -720\r
+dqcps405 copysign          701    +0  ->  701\r
+dqcps406 copysign         -720    +0  ->  720\r
+dqcps407 copysign          701    +34 ->  701\r
+dqcps408 copysign         -720    +34 ->  720\r
+\r
+dqcps413 copysign          701    -Inf  -> -701\r
+dqcps414 copysign         -720    -Inf  -> -720\r
+dqcps415 copysign          701    +Inf  ->  701\r
+dqcps416 copysign         -720    +Inf  ->  720\r
+\r
+dqcps420 copysign          701    -NaN  -> -701\r
+dqcps421 copysign         -720    -NaN  -> -720\r
+dqcps422 copysign          701    +NaN  ->  701\r
+dqcps423 copysign         -720    +NaN  ->  720\r
+dqcps425 copysign         -720    +NaN8 ->  720\r
+\r
+dqcps426 copysign          701    -sNaN  -> -701\r
+dqcps427 copysign         -720    -sNaN  -> -720\r
+dqcps428 copysign          701    +sNaN  ->  701\r
+dqcps429 copysign         -720    +sNaN  ->  720\r
+dqcps430 copysign         -720    +sNaN3 ->  720\r
+\r
diff --git a/Lib/test/decimaltestdata/dqDivide.decTest b/Lib/test/decimaltestdata/dqDivide.decTest
new file mode 100644 (file)
index 0000000..a84e1d0
--- /dev/null
@@ -0,0 +1,808 @@
+------------------------------------------------------------------------\r
+-- dqDivide.decTest -- decQuad division                               --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqdiv001 divide  1     1    ->  1\r
+dqdiv002 divide  2     1    ->  2\r
+dqdiv003 divide  1     2    ->  0.5\r
+dqdiv004 divide  2     2    ->  1\r
+dqdiv005 divide  0     1    ->  0\r
+dqdiv006 divide  0     2    ->  0\r
+dqdiv007 divide  1     3    ->  0.3333333333333333333333333333333333 Inexact Rounded\r
+dqdiv008 divide  2     3    ->  0.6666666666666666666666666666666667 Inexact Rounded\r
+dqdiv009 divide  3     3    ->  1\r
+\r
+dqdiv010 divide  2.4   1    ->  2.4\r
+dqdiv011 divide  2.4   -1   ->  -2.4\r
+dqdiv012 divide  -2.4  1    ->  -2.4\r
+dqdiv013 divide  -2.4  -1   ->  2.4\r
+dqdiv014 divide  2.40  1    ->  2.40\r
+dqdiv015 divide  2.400 1    ->  2.400\r
+dqdiv016 divide  2.4   2    ->  1.2\r
+dqdiv017 divide  2.400 2    ->  1.200\r
+dqdiv018 divide  2.    2    ->  1\r
+dqdiv019 divide  20    20   ->  1\r
+\r
+dqdiv020 divide  187   187    ->  1\r
+dqdiv021 divide  5     2      ->  2.5\r
+dqdiv022 divide  50    20     ->  2.5\r
+dqdiv023 divide  500   200    ->  2.5\r
+dqdiv024 divide  50.0  20.0   ->  2.5\r
+dqdiv025 divide  5.00  2.00   ->  2.5\r
+dqdiv026 divide  5     2.0    ->  2.5\r
+dqdiv027 divide  5     2.000  ->  2.5\r
+dqdiv028 divide  5     0.20   ->  25\r
+dqdiv029 divide  5     0.200  ->  25\r
+dqdiv030 divide  10    1      ->  10\r
+dqdiv031 divide  100   1      ->  100\r
+dqdiv032 divide  1000  1      ->  1000\r
+dqdiv033 divide  1000  100    ->  10\r
+\r
+dqdiv035 divide  1     2      ->  0.5\r
+dqdiv036 divide  1     4      ->  0.25\r
+dqdiv037 divide  1     8      ->  0.125\r
+dqdiv038 divide  1     16     ->  0.0625\r
+dqdiv039 divide  1     32     ->  0.03125\r
+dqdiv040 divide  1     64     ->  0.015625\r
+dqdiv041 divide  1    -2      ->  -0.5\r
+dqdiv042 divide  1    -4      ->  -0.25\r
+dqdiv043 divide  1    -8      ->  -0.125\r
+dqdiv044 divide  1    -16     ->  -0.0625\r
+dqdiv045 divide  1    -32     ->  -0.03125\r
+dqdiv046 divide  1    -64     ->  -0.015625\r
+dqdiv047 divide -1     2      ->  -0.5\r
+dqdiv048 divide -1     4      ->  -0.25\r
+dqdiv049 divide -1     8      ->  -0.125\r
+dqdiv050 divide -1     16     ->  -0.0625\r
+dqdiv051 divide -1     32     ->  -0.03125\r
+dqdiv052 divide -1     64     ->  -0.015625\r
+dqdiv053 divide -1    -2      ->  0.5\r
+dqdiv054 divide -1    -4      ->  0.25\r
+dqdiv055 divide -1    -8      ->  0.125\r
+dqdiv056 divide -1    -16     ->  0.0625\r
+dqdiv057 divide -1    -32     ->  0.03125\r
+dqdiv058 divide -1    -64     ->  0.015625\r
+\r
+-- bcdTime\r
+dqdiv060 divide  1 7                   -> 0.1428571428571428571428571428571429 Inexact Rounded\r
+dqdiv061 divide 1.2345678  1.9876543   -> 0.6211179680490717123193907511985359 Inexact Rounded\r
+\r
+--               1234567890123456\r
+dqdiv067 divide  9999999999999999999999999999999999  1 ->  9999999999999999999999999999999999\r
+dqdiv068 divide  999999999999999999999999999999999   1 ->  999999999999999999999999999999999\r
+dqdiv069 divide  99999999999999999999999999999999    1 ->  99999999999999999999999999999999\r
+dqdiv070 divide  99999999999999999                   1 ->  99999999999999999\r
+dqdiv071 divide  9999999999999999                    1 ->  9999999999999999\r
+dqdiv072 divide  999999999999999                     1 ->  999999999999999\r
+dqdiv073 divide  99999999999999                      1 ->  99999999999999\r
+dqdiv074 divide  9999999999999                       1 ->  9999999999999\r
+dqdiv075 divide  999999999999                        1 ->  999999999999\r
+dqdiv076 divide  99999999999                         1 ->  99999999999\r
+dqdiv077 divide  9999999999                          1 ->  9999999999\r
+dqdiv078 divide  999999999                           1 ->  999999999\r
+dqdiv079 divide  99999999                            1 ->  99999999\r
+dqdiv080 divide  9999999                             1 ->  9999999\r
+dqdiv081 divide  999999                              1 ->  999999\r
+dqdiv082 divide  99999                               1 ->  99999\r
+dqdiv083 divide  9999                                1 ->  9999\r
+dqdiv084 divide  999                                 1 ->  999\r
+dqdiv085 divide  99                                  1 ->  99\r
+dqdiv086 divide  9                                   1 ->  9\r
+\r
+dqdiv090 divide  0.            1    ->  0\r
+dqdiv091 divide  .0            1    ->  0.0\r
+dqdiv092 divide  0.00          1    ->  0.00\r
+dqdiv093 divide  0.00E+9       1    ->  0E+7\r
+dqdiv094 divide  0.0000E-50    1    ->  0E-54\r
+\r
+dqdiv095 divide  1            1E-8  ->  1E+8\r
+dqdiv096 divide  1            1E-9  ->  1E+9\r
+dqdiv097 divide  1            1E-10 ->  1E+10\r
+dqdiv098 divide  1            1E-11 ->  1E+11\r
+dqdiv099 divide  1            1E-12 ->  1E+12\r
+\r
+dqdiv100 divide  1  1   -> 1\r
+dqdiv101 divide  1  2   -> 0.5\r
+dqdiv102 divide  1  3   -> 0.3333333333333333333333333333333333 Inexact Rounded\r
+dqdiv103 divide  1  4   -> 0.25\r
+dqdiv104 divide  1  5   -> 0.2\r
+dqdiv105 divide  1  6   -> 0.1666666666666666666666666666666667 Inexact Rounded\r
+dqdiv106 divide  1  7   -> 0.1428571428571428571428571428571429 Inexact Rounded\r
+dqdiv107 divide  1  8   -> 0.125\r
+dqdiv108 divide  1  9   -> 0.1111111111111111111111111111111111 Inexact Rounded\r
+dqdiv109 divide  1  10  -> 0.1\r
+dqdiv110 divide  1  1   -> 1\r
+dqdiv111 divide  2  1   -> 2\r
+dqdiv112 divide  3  1   -> 3\r
+dqdiv113 divide  4  1   -> 4\r
+dqdiv114 divide  5  1   -> 5\r
+dqdiv115 divide  6  1   -> 6\r
+dqdiv116 divide  7  1   -> 7\r
+dqdiv117 divide  8  1   -> 8\r
+dqdiv118 divide  9  1   -> 9\r
+dqdiv119 divide  10 1   -> 10\r
+\r
+dqdiv120 divide  3E+1 0.001  -> 3E+4\r
+dqdiv121 divide  2.200 2     -> 1.100\r
+\r
+dqdiv130 divide  12345  4.999  -> 2469.493898779755951190238047609522  Inexact Rounded\r
+dqdiv131 divide  12345  4.99   -> 2473.947895791583166332665330661323  Inexact Rounded\r
+dqdiv132 divide  12345  4.9    -> 2519.387755102040816326530612244898  Inexact Rounded\r
+dqdiv133 divide  12345  5      -> 2469\r
+dqdiv134 divide  12345  5.1    -> 2420.588235294117647058823529411765  Inexact Rounded\r
+dqdiv135 divide  12345  5.01   -> 2464.071856287425149700598802395210  Inexact Rounded\r
+dqdiv136 divide  12345  5.001  -> 2468.506298740251949610077984403119  Inexact Rounded\r
+\r
+-- test possibly imprecise results\r
+dqdiv220 divide 391   597 ->  0.6549413735343383584589614740368509  Inexact Rounded\r
+dqdiv221 divide 391  -597 -> -0.6549413735343383584589614740368509  Inexact Rounded\r
+dqdiv222 divide -391  597 -> -0.6549413735343383584589614740368509  Inexact Rounded\r
+dqdiv223 divide -391 -597 ->  0.6549413735343383584589614740368509  Inexact Rounded\r
+\r
+-- test some cases that are close to exponent overflow\r
+dqdiv270 divide 1 1e6144                  -> 1E-6144                 Subnormal\r
+dqdiv271 divide 1 0.9e6144                -> 1.11111111111111111111111111111111E-6144  Rounded Inexact Subnormal Underflow\r
+dqdiv272 divide 1 0.99e6144               -> 1.01010101010101010101010101010101E-6144  Rounded Inexact Subnormal Underflow\r
+dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144  Rounded Inexact Subnormal Underflow\r
+dqdiv274 divide 9e6144    1               -> 9.000000000000000000000000000000000E+6144 Clamped\r
+dqdiv275 divide 9.9e6144  1               -> 9.900000000000000000000000000000000E+6144 Clamped\r
+dqdiv276 divide 9.99e6144 1               -> 9.990000000000000000000000000000000E+6144 Clamped\r
+dqdiv277 divide 9.999999999999999e6144 1  -> 9.999999999999999000000000000000000E+6144 Clamped\r
+\r
+dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144  Rounded Inexact Subnormal Underflow\r
+dqdiv279 divide 9.999999999999999999999999999999999e6144 1  -> 9.999999999999999999999999999999999E+6144\r
+\r
+-- Divide into 0 tests\r
+dqdiv301 divide    0    7     -> 0\r
+dqdiv302 divide    0    7E-5  -> 0E+5\r
+dqdiv303 divide    0    7E-1  -> 0E+1\r
+dqdiv304 divide    0    7E+1  -> 0.0\r
+dqdiv305 divide    0    7E+5  -> 0.00000\r
+dqdiv306 divide    0    7E+6  -> 0.000000\r
+dqdiv307 divide    0    7E+7  -> 0E-7\r
+dqdiv308 divide    0   70E-5  -> 0E+5\r
+dqdiv309 divide    0   70E-1  -> 0E+1\r
+dqdiv310 divide    0   70E+0  -> 0\r
+dqdiv311 divide    0   70E+1  -> 0.0\r
+dqdiv312 divide    0   70E+5  -> 0.00000\r
+dqdiv313 divide    0   70E+6  -> 0.000000\r
+dqdiv314 divide    0   70E+7  -> 0E-7\r
+dqdiv315 divide    0  700E-5  -> 0E+5\r
+dqdiv316 divide    0  700E-1  -> 0E+1\r
+dqdiv317 divide    0  700E+0  -> 0\r
+dqdiv318 divide    0  700E+1  -> 0.0\r
+dqdiv319 divide    0  700E+5  -> 0.00000\r
+dqdiv320 divide    0  700E+6  -> 0.000000\r
+dqdiv321 divide    0  700E+7  -> 0E-7\r
+dqdiv322 divide    0  700E+77 -> 0E-77\r
+\r
+dqdiv331 divide 0E-3    7E-5  -> 0E+2\r
+dqdiv332 divide 0E-3    7E-1  -> 0.00\r
+dqdiv333 divide 0E-3    7E+1  -> 0.0000\r
+dqdiv334 divide 0E-3    7E+5  -> 0E-8\r
+dqdiv335 divide 0E-1    7E-5  -> 0E+4\r
+dqdiv336 divide 0E-1    7E-1  -> 0\r
+dqdiv337 divide 0E-1    7E+1  -> 0.00\r
+dqdiv338 divide 0E-1    7E+5  -> 0.000000\r
+dqdiv339 divide 0E+1    7E-5  -> 0E+6\r
+dqdiv340 divide 0E+1    7E-1  -> 0E+2\r
+dqdiv341 divide 0E+1    7E+1  -> 0\r
+dqdiv342 divide 0E+1    7E+5  -> 0.0000\r
+dqdiv343 divide 0E+3    7E-5  -> 0E+8\r
+dqdiv344 divide 0E+3    7E-1  -> 0E+4\r
+dqdiv345 divide 0E+3    7E+1  -> 0E+2\r
+dqdiv346 divide 0E+3    7E+5  -> 0.00\r
+\r
+-- These were 'input rounding'\r
+dqdiv441 divide 12345678000 1 -> 12345678000\r
+dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded\r
+dqdiv443 divide 1234567800  1 -> 1234567800\r
+dqdiv444 divide 1 1234567800  -> 8.100000664200054464404466081166219E-10 Inexact Rounded\r
+dqdiv445 divide 1234567890  1 -> 1234567890\r
+dqdiv446 divide 1 1234567890  -> 8.100000073710000670761006103925156E-10 Inexact Rounded\r
+dqdiv447 divide 1234567891  1 -> 1234567891\r
+dqdiv448 divide 1 1234567891  -> 8.100000067149000556665214614754629E-10 Inexact Rounded\r
+dqdiv449 divide 12345678901 1 -> 12345678901\r
+dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded\r
+dqdiv451 divide 1234567896  1 -> 1234567896\r
+dqdiv452 divide 1 1234567896  -> 8.100000034344000145618560617422697E-10 Inexact Rounded\r
+\r
+-- high-lows\r
+dqdiv453 divide 1e+1   1    ->   1E+1\r
+dqdiv454 divide 1e+1   1.0  ->   1E+1\r
+dqdiv455 divide 1e+1   1.00 ->   1E+1\r
+dqdiv456 divide 1e+2   2    ->   5E+1\r
+dqdiv457 divide 1e+2   2.0  ->   5E+1\r
+dqdiv458 divide 1e+2   2.00 ->   5E+1\r
+\r
+-- some from IEEE discussions\r
+dqdiv460 divide 3e0      2e0     -> 1.5\r
+dqdiv461 divide 30e-1    2e0     -> 1.5\r
+dqdiv462 divide 300e-2   2e0     -> 1.50\r
+dqdiv464 divide 3000e-3  2e0     -> 1.500\r
+dqdiv465 divide 3e0      20e-1   -> 1.5\r
+dqdiv466 divide 30e-1    20e-1   -> 1.5\r
+dqdiv467 divide 300e-2   20e-1   -> 1.5\r
+dqdiv468 divide 3000e-3  20e-1   -> 1.50\r
+dqdiv469 divide 3e0      200e-2  -> 1.5\r
+dqdiv470 divide 30e-1    200e-2  -> 1.5\r
+dqdiv471 divide 300e-2   200e-2  -> 1.5\r
+dqdiv472 divide 3000e-3  200e-2  -> 1.5\r
+dqdiv473 divide 3e0      2000e-3 -> 1.5\r
+dqdiv474 divide 30e-1    2000e-3 -> 1.5\r
+dqdiv475 divide 300e-2   2000e-3 -> 1.5\r
+dqdiv476 divide 3000e-3  2000e-3 -> 1.5\r
+\r
+-- some reciprocals\r
+dqdiv480 divide 1        1.0E+33 -> 1E-33\r
+dqdiv481 divide 1        10E+33  -> 1E-34\r
+dqdiv482 divide 1        1.0E-33 -> 1E+33\r
+dqdiv483 divide 1        10E-33  -> 1E+32\r
+\r
+-- RMS discussion table\r
+dqdiv484 divide 0e5     1e3 ->   0E+2\r
+dqdiv485 divide 0e5     2e3 ->   0E+2\r
+dqdiv486 divide 0e5    10e2 ->   0E+3\r
+dqdiv487 divide 0e5    20e2 ->   0E+3\r
+dqdiv488 divide 0e5   100e1 ->   0E+4\r
+dqdiv489 divide 0e5   200e1 ->   0E+4\r
+\r
+dqdiv491 divide 1e5     1e3 ->   1E+2\r
+dqdiv492 divide 1e5     2e3 ->   5E+1\r
+dqdiv493 divide 1e5    10e2 ->   1E+2\r
+dqdiv494 divide 1e5    20e2 ->   5E+1\r
+dqdiv495 divide 1e5   100e1 ->   1E+2\r
+dqdiv496 divide 1e5   200e1 ->   5E+1\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+dqdiv497  divide  0E+6108 1000E-33  -> 0E+6111 Clamped\r
+dqdiv498  divide  0E-6170 1000E+33  -> 0E-6176 Clamped\r
+\r
+rounding:    half_up\r
+\r
+-- focus on trailing zeros issues\r
+dqdiv500 divide  1      9.9    ->  0.1010101010101010101010101010101010  Inexact Rounded\r
+dqdiv501 divide  1      9.09   ->  0.1100110011001100110011001100110011  Inexact Rounded\r
+dqdiv502 divide  1      9.009  ->  0.1110001110001110001110001110001110  Inexact Rounded\r
+\r
+dqdiv511 divide 1         2    -> 0.5\r
+dqdiv512 divide 1.0       2    -> 0.5\r
+dqdiv513 divide 1.00      2    -> 0.50\r
+dqdiv514 divide 1.000     2    -> 0.500\r
+dqdiv515 divide 1.0000    2    -> 0.5000\r
+dqdiv516 divide 1.00000   2    -> 0.50000\r
+dqdiv517 divide 1.000000  2    -> 0.500000\r
+dqdiv518 divide 1.0000000 2    -> 0.5000000\r
+dqdiv519 divide 1.00      2.00 -> 0.5\r
+\r
+dqdiv521 divide 2    1         -> 2\r
+dqdiv522 divide 2    1.0       -> 2\r
+dqdiv523 divide 2    1.00      -> 2\r
+dqdiv524 divide 2    1.000     -> 2\r
+dqdiv525 divide 2    1.0000    -> 2\r
+dqdiv526 divide 2    1.00000   -> 2\r
+dqdiv527 divide 2    1.000000  -> 2\r
+dqdiv528 divide 2    1.0000000 -> 2\r
+dqdiv529 divide 2.00 1.00      -> 2\r
+\r
+dqdiv530 divide  2.40   2      ->  1.20\r
+dqdiv531 divide  2.40   4      ->  0.60\r
+dqdiv532 divide  2.40  10      ->  0.24\r
+dqdiv533 divide  2.40   2.0    ->  1.2\r
+dqdiv534 divide  2.40   4.0    ->  0.6\r
+dqdiv535 divide  2.40  10.0    ->  0.24\r
+dqdiv536 divide  2.40   2.00   ->  1.2\r
+dqdiv537 divide  2.40   4.00   ->  0.6\r
+dqdiv538 divide  2.40  10.00   ->  0.24\r
+dqdiv539 divide  0.9    0.1    ->  9\r
+dqdiv540 divide  0.9    0.01   ->  9E+1\r
+dqdiv541 divide  0.9    0.001  ->  9E+2\r
+dqdiv542 divide  5      2      ->  2.5\r
+dqdiv543 divide  5      2.0    ->  2.5\r
+dqdiv544 divide  5      2.00   ->  2.5\r
+dqdiv545 divide  5      20     ->  0.25\r
+dqdiv546 divide  5      20.0   ->  0.25\r
+dqdiv547 divide  2.400  2      ->  1.200\r
+dqdiv548 divide  2.400  2.0    ->  1.20\r
+dqdiv549 divide  2.400  2.400  ->  1\r
+\r
+dqdiv550 divide  240    1      ->  240\r
+dqdiv551 divide  240    10     ->  24\r
+dqdiv552 divide  240    100    ->  2.4\r
+dqdiv553 divide  240    1000   ->  0.24\r
+dqdiv554 divide  2400   1      ->  2400\r
+dqdiv555 divide  2400   10     ->  240\r
+dqdiv556 divide  2400   100    ->  24\r
+dqdiv557 divide  2400   1000   ->  2.4\r
+\r
+-- +ve exponent\r
+dqdiv600 divide  2.4E+9     2  ->  1.2E+9\r
+dqdiv601 divide  2.40E+9    2  ->  1.20E+9\r
+dqdiv602 divide  2.400E+9   2  ->  1.200E+9\r
+dqdiv603 divide  2.4000E+9  2  ->  1.2000E+9\r
+dqdiv604 divide  24E+8      2  ->  1.2E+9\r
+dqdiv605 divide  240E+7     2  ->  1.20E+9\r
+dqdiv606 divide  2400E+6    2  ->  1.200E+9\r
+dqdiv607 divide  24000E+5   2  ->  1.2000E+9\r
+\r
+-- more zeros, etc.\r
+dqdiv731 divide 5.00 1E-3    -> 5.00E+3\r
+dqdiv732 divide 00.00 0.000  -> NaN Division_undefined\r
+dqdiv733 divide 00.00 0E-3   -> NaN Division_undefined\r
+dqdiv734 divide  0    -0     -> NaN Division_undefined\r
+dqdiv735 divide -0     0     -> NaN Division_undefined\r
+dqdiv736 divide -0    -0     -> NaN Division_undefined\r
+\r
+dqdiv741 divide  0    -1     -> -0\r
+dqdiv742 divide -0    -1     ->  0\r
+dqdiv743 divide  0     1     ->  0\r
+dqdiv744 divide -0     1     -> -0\r
+dqdiv745 divide -1     0     -> -Infinity Division_by_zero\r
+dqdiv746 divide -1    -0     ->  Infinity Division_by_zero\r
+dqdiv747 divide  1     0     ->  Infinity Division_by_zero\r
+dqdiv748 divide  1    -0     -> -Infinity Division_by_zero\r
+\r
+dqdiv751 divide  0.0  -1     -> -0.0\r
+dqdiv752 divide -0.0  -1     ->  0.0\r
+dqdiv753 divide  0.0   1     ->  0.0\r
+dqdiv754 divide -0.0   1     -> -0.0\r
+dqdiv755 divide -1.0   0     -> -Infinity Division_by_zero\r
+dqdiv756 divide -1.0  -0     ->  Infinity Division_by_zero\r
+dqdiv757 divide  1.0   0     ->  Infinity Division_by_zero\r
+dqdiv758 divide  1.0  -0     -> -Infinity Division_by_zero\r
+\r
+dqdiv761 divide  0    -1.0   -> -0E+1\r
+dqdiv762 divide -0    -1.0   ->  0E+1\r
+dqdiv763 divide  0     1.0   ->  0E+1\r
+dqdiv764 divide -0     1.0   -> -0E+1\r
+dqdiv765 divide -1     0.0   -> -Infinity Division_by_zero\r
+dqdiv766 divide -1    -0.0   ->  Infinity Division_by_zero\r
+dqdiv767 divide  1     0.0   ->  Infinity Division_by_zero\r
+dqdiv768 divide  1    -0.0   -> -Infinity Division_by_zero\r
+\r
+dqdiv771 divide  0.0  -1.0   -> -0\r
+dqdiv772 divide -0.0  -1.0   ->  0\r
+dqdiv773 divide  0.0   1.0   ->  0\r
+dqdiv774 divide -0.0   1.0   -> -0\r
+dqdiv775 divide -1.0   0.0   -> -Infinity Division_by_zero\r
+dqdiv776 divide -1.0  -0.0   ->  Infinity Division_by_zero\r
+dqdiv777 divide  1.0   0.0   ->  Infinity Division_by_zero\r
+dqdiv778 divide  1.0  -0.0   -> -Infinity Division_by_zero\r
+\r
+-- Specials\r
+dqdiv780 divide  Inf  -Inf   ->  NaN Invalid_operation\r
+dqdiv781 divide  Inf  -1000  -> -Infinity\r
+dqdiv782 divide  Inf  -1     -> -Infinity\r
+dqdiv783 divide  Inf  -0     -> -Infinity\r
+dqdiv784 divide  Inf   0     ->  Infinity\r
+dqdiv785 divide  Inf   1     ->  Infinity\r
+dqdiv786 divide  Inf   1000  ->  Infinity\r
+dqdiv787 divide  Inf   Inf   ->  NaN Invalid_operation\r
+dqdiv788 divide -1000  Inf   -> -0E-6176 Clamped\r
+dqdiv789 divide -Inf   Inf   ->  NaN Invalid_operation\r
+dqdiv790 divide -1     Inf   -> -0E-6176 Clamped\r
+dqdiv791 divide -0     Inf   -> -0E-6176 Clamped\r
+dqdiv792 divide  0     Inf   ->  0E-6176 Clamped\r
+dqdiv793 divide  1     Inf   ->  0E-6176 Clamped\r
+dqdiv794 divide  1000  Inf   ->  0E-6176 Clamped\r
+dqdiv795 divide  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dqdiv800 divide -Inf  -Inf   ->  NaN Invalid_operation\r
+dqdiv801 divide -Inf  -1000  ->  Infinity\r
+dqdiv802 divide -Inf  -1     ->  Infinity\r
+dqdiv803 divide -Inf  -0     ->  Infinity\r
+dqdiv804 divide -Inf   0     -> -Infinity\r
+dqdiv805 divide -Inf   1     -> -Infinity\r
+dqdiv806 divide -Inf   1000  -> -Infinity\r
+dqdiv807 divide -Inf   Inf   ->  NaN Invalid_operation\r
+dqdiv808 divide -1000  Inf   -> -0E-6176 Clamped\r
+dqdiv809 divide -Inf  -Inf   ->  NaN Invalid_operation\r
+dqdiv810 divide -1    -Inf   ->  0E-6176 Clamped\r
+dqdiv811 divide -0    -Inf   ->  0E-6176 Clamped\r
+dqdiv812 divide  0    -Inf   -> -0E-6176 Clamped\r
+dqdiv813 divide  1    -Inf   -> -0E-6176 Clamped\r
+dqdiv814 divide  1000 -Inf   -> -0E-6176 Clamped\r
+dqdiv815 divide  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dqdiv821 divide  NaN -Inf    ->  NaN\r
+dqdiv822 divide  NaN -1000   ->  NaN\r
+dqdiv823 divide  NaN -1      ->  NaN\r
+dqdiv824 divide  NaN -0      ->  NaN\r
+dqdiv825 divide  NaN  0      ->  NaN\r
+dqdiv826 divide  NaN  1      ->  NaN\r
+dqdiv827 divide  NaN  1000   ->  NaN\r
+dqdiv828 divide  NaN  Inf    ->  NaN\r
+dqdiv829 divide  NaN  NaN    ->  NaN\r
+dqdiv830 divide -Inf  NaN    ->  NaN\r
+dqdiv831 divide -1000 NaN    ->  NaN\r
+dqdiv832 divide -1    NaN    ->  NaN\r
+dqdiv833 divide -0    NaN    ->  NaN\r
+dqdiv834 divide  0    NaN    ->  NaN\r
+dqdiv835 divide  1    NaN    ->  NaN\r
+dqdiv836 divide  1000 NaN    ->  NaN\r
+dqdiv837 divide  Inf  NaN    ->  NaN\r
+\r
+dqdiv841 divide  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqdiv842 divide  sNaN -1000  ->  NaN  Invalid_operation\r
+dqdiv843 divide  sNaN -1     ->  NaN  Invalid_operation\r
+dqdiv844 divide  sNaN -0     ->  NaN  Invalid_operation\r
+dqdiv845 divide  sNaN  0     ->  NaN  Invalid_operation\r
+dqdiv846 divide  sNaN  1     ->  NaN  Invalid_operation\r
+dqdiv847 divide  sNaN  1000  ->  NaN  Invalid_operation\r
+dqdiv848 divide  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqdiv849 divide  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqdiv850 divide  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqdiv851 divide -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqdiv852 divide -1000 sNaN   ->  NaN  Invalid_operation\r
+dqdiv853 divide -1    sNaN   ->  NaN  Invalid_operation\r
+dqdiv854 divide -0    sNaN   ->  NaN  Invalid_operation\r
+dqdiv855 divide  0    sNaN   ->  NaN  Invalid_operation\r
+dqdiv856 divide  1    sNaN   ->  NaN  Invalid_operation\r
+dqdiv857 divide  1000 sNaN   ->  NaN  Invalid_operation\r
+dqdiv858 divide  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqdiv859 divide  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqdiv861 divide  NaN9 -Inf   ->  NaN9\r
+dqdiv862 divide  NaN8  1000  ->  NaN8\r
+dqdiv863 divide  NaN7  Inf   ->  NaN7\r
+dqdiv864 divide  NaN6  NaN5  ->  NaN6\r
+dqdiv865 divide -Inf   NaN4  ->  NaN4\r
+dqdiv866 divide -1000  NaN3  ->  NaN3\r
+dqdiv867 divide  Inf   NaN2  ->  NaN2\r
+\r
+dqdiv871 divide  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqdiv872 divide  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dqdiv873 divide  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqdiv874 divide  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dqdiv875 divide  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqdiv876 divide -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqdiv877 divide  0      sNaN91  ->  NaN91 Invalid_operation\r
+dqdiv878 divide  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dqdiv879 divide  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+dqdiv881 divide  -NaN9  -Inf   ->  -NaN9\r
+dqdiv882 divide  -NaN8   1000  ->  -NaN8\r
+dqdiv883 divide  -NaN7   Inf   ->  -NaN7\r
+dqdiv884 divide  -NaN6  -NaN5  ->  -NaN6\r
+dqdiv885 divide  -Inf   -NaN4  ->  -NaN4\r
+dqdiv886 divide  -1000  -NaN3  ->  -NaN3\r
+dqdiv887 divide   Inf   -NaN2  ->  -NaN2\r
+\r
+dqdiv891 divide -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqdiv892 divide -sNaN98 -1      -> -NaN98 Invalid_operation\r
+dqdiv893 divide -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation\r
+dqdiv895 divide -NaN95  -sNaN93 -> -NaN93 Invalid_operation\r
+dqdiv896 divide -Inf    -sNaN92 -> -NaN92 Invalid_operation\r
+dqdiv897 divide  0      -sNaN91 -> -NaN91 Invalid_operation\r
+dqdiv898 divide  Inf    -sNaN90 -> -NaN90 Invalid_operation\r
+dqdiv899 divide -NaN    -sNaN89 -> -NaN89 Invalid_operation\r
+\r
+-- Various flavours of divide by 0\r
+dqdiv901 divide    0       0   ->  NaN Division_undefined\r
+dqdiv902 divide    0.0E5   0   ->  NaN Division_undefined\r
+dqdiv903 divide    0.000   0   ->  NaN Division_undefined\r
+dqdiv904 divide    0.0001  0   ->  Infinity Division_by_zero\r
+dqdiv905 divide    0.01    0   ->  Infinity Division_by_zero\r
+dqdiv906 divide    0.1     0   ->  Infinity Division_by_zero\r
+dqdiv907 divide    1       0   ->  Infinity Division_by_zero\r
+dqdiv908 divide    1       0.0 ->  Infinity Division_by_zero\r
+dqdiv909 divide   10       0.0 ->  Infinity Division_by_zero\r
+dqdiv910 divide   1E+100   0.0 ->  Infinity Division_by_zero\r
+dqdiv911 divide   1E+100   0   ->  Infinity Division_by_zero\r
+\r
+dqdiv921 divide   -0.0001  0   -> -Infinity Division_by_zero\r
+dqdiv922 divide   -0.01    0   -> -Infinity Division_by_zero\r
+dqdiv923 divide   -0.1     0   -> -Infinity Division_by_zero\r
+dqdiv924 divide   -1       0   -> -Infinity Division_by_zero\r
+dqdiv925 divide   -1       0.0 -> -Infinity Division_by_zero\r
+dqdiv926 divide  -10       0.0 -> -Infinity Division_by_zero\r
+dqdiv927 divide  -1E+100   0.0 -> -Infinity Division_by_zero\r
+dqdiv928 divide  -1E+100   0   -> -Infinity Division_by_zero\r
+\r
+dqdiv931 divide    0.0001 -0   -> -Infinity Division_by_zero\r
+dqdiv932 divide    0.01   -0   -> -Infinity Division_by_zero\r
+dqdiv933 divide    0.1    -0   -> -Infinity Division_by_zero\r
+dqdiv934 divide    1      -0   -> -Infinity Division_by_zero\r
+dqdiv935 divide    1      -0.0 -> -Infinity Division_by_zero\r
+dqdiv936 divide   10      -0.0 -> -Infinity Division_by_zero\r
+dqdiv937 divide   1E+100  -0.0 -> -Infinity Division_by_zero\r
+dqdiv938 divide   1E+100  -0   -> -Infinity Division_by_zero\r
+\r
+dqdiv941 divide   -0.0001 -0   ->  Infinity Division_by_zero\r
+dqdiv942 divide   -0.01   -0   ->  Infinity Division_by_zero\r
+dqdiv943 divide   -0.1    -0   ->  Infinity Division_by_zero\r
+dqdiv944 divide   -1      -0   ->  Infinity Division_by_zero\r
+dqdiv945 divide   -1      -0.0 ->  Infinity Division_by_zero\r
+dqdiv946 divide  -10      -0.0 ->  Infinity Division_by_zero\r
+dqdiv947 divide  -1E+100  -0.0 ->  Infinity Division_by_zero\r
+dqdiv948 divide  -1E+100  -0   ->  Infinity Division_by_zero\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+dqdiv1021  divide 1E0          1E0 -> 1\r
+dqdiv1022  divide 1E0          2E0 -> 0.5\r
+dqdiv1023  divide 1E0          3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded\r
+dqdiv1024  divide 100E-2   1000E-3 -> 1\r
+dqdiv1025  divide 24E-1        2E0 -> 1.2\r
+dqdiv1026  divide 2400E-3      2E0 -> 1.200\r
+dqdiv1027  divide 5E0          2E0 -> 2.5\r
+dqdiv1028  divide 5E0        20E-1 -> 2.5\r
+dqdiv1029  divide 5E0      2000E-3 -> 2.5\r
+dqdiv1030  divide 5E0         2E-1 -> 25\r
+dqdiv1031  divide 5E0        20E-2 -> 25\r
+dqdiv1032  divide 480E-2       3E0 -> 1.60\r
+dqdiv1033  divide 47E-1        2E0 -> 2.35\r
+\r
+-- ECMAScript bad examples\r
+rounding:    half_down\r
+dqdiv1040  divide 5 9  -> 0.5555555555555555555555555555555556 Inexact Rounded\r
+rounding:    half_even\r
+dqdiv1041  divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded\r
+\r
+-- Gyuris example\r
+dqdiv1050  divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+dqdiv1751 divide  1e+4277  1e-3311 ->  Infinity Overflow Inexact Rounded\r
+dqdiv1752 divide  1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded\r
+dqdiv1753 divide -1e+4277  1e-3311 -> -Infinity Overflow Inexact Rounded\r
+dqdiv1754 divide -1e+4277 -1e-3311 ->  Infinity Overflow Inexact Rounded\r
+dqdiv1755 divide  1e-4277  1e+3311 ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1756 divide  1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1757 divide -1e-4277  1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1758 divide -1e-4277 -1e+3311 ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal\r
+dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal\r
+dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal\r
+dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal\r
+dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal\r
+dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal\r
+dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal\r
+dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped\r
+dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142  Clamped\r
+dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143  Clamped\r
+dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144  Clamped\r
+dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded\r
+dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded\r
+dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded\r
+dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded\r
+dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded\r
+dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded\r
+\r
+dqdiv1801 divide  1.0000E-6172  1     -> 1.0000E-6172 Subnormal\r
+dqdiv1802 divide  1.000E-6172   1e+1  -> 1.000E-6173  Subnormal\r
+dqdiv1803 divide  1.00E-6172    1e+2  -> 1.00E-6174   Subnormal\r
+dqdiv1804 divide  1.0E-6172     1e+3  -> 1.0E-6175    Subnormal\r
+dqdiv1805 divide  1.0E-6172     1e+4  -> 1E-6176     Subnormal Rounded\r
+dqdiv1806 divide  1.3E-6172     1e+4  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1807 divide  1.5E-6172     1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1808 divide  1.7E-6172     1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1809 divide  2.3E-6172     1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1810 divide  2.5E-6172     1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1811 divide  2.7E-6172     1e+4  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1812 divide  1.49E-6172    1e+4  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1813 divide  1.50E-6172    1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1814 divide  1.51E-6172    1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1815 divide  2.49E-6172    1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1816 divide  2.50E-6172    1e+4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1817 divide  2.51E-6172    1e+4  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqdiv1818 divide  1E-6172       1e+4  -> 1E-6176     Subnormal\r
+dqdiv1819 divide  3E-6172       1e+5  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1820 divide  5E-6172       1e+5  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1821 divide  7E-6172       1e+5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1822 divide  9E-6172       1e+5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqdiv1823 divide  9.9E-6172     1e+5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqdiv1824 divide  1E-6172      -1e+4  -> -1E-6176    Subnormal\r
+dqdiv1825 divide  3E-6172      -1e+5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1826 divide -5E-6172       1e+5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1827 divide  7E-6172      -1e+5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqdiv1828 divide -9E-6172       1e+5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqdiv1829 divide  9.9E-6172    -1e+5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqdiv1830 divide  3.0E-6172    -1e+5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dqdiv1831 divide  1.0E-5977     1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqdiv1832 divide  1.0E-5977     1e+199 -> 1E-6176   Subnormal Rounded\r
+dqdiv1833 divide  1.0E-5977     1e+198 -> 1.0E-6175 Subnormal\r
+dqdiv1834 divide  2.0E-5977     2e+198 -> 1.0E-6175 Subnormal\r
+dqdiv1835 divide  4.0E-5977     4e+198 -> 1.0E-6175 Subnormal\r
+dqdiv1836 divide 10.0E-5977    10e+198 -> 1.0E-6175 Subnormal\r
+dqdiv1837 divide 30.0E-5977    30e+198 -> 1.0E-6175 Subnormal\r
+dqdiv1838 divide 40.0E-5982    40e+166 -> 1.0E-6148 Subnormal\r
+dqdiv1839 divide 40.0E-5982    40e+165 -> 1.0E-6147 Subnormal\r
+dqdiv1840 divide 40.0E-5982    40e+164 -> 1.0E-6146 Subnormal\r
+\r
+-- randoms\r
+rounding:  half_even\r
+dqdiv2010  divide  -5231195652931651968034356117118850         -7243718664422548573203260970.34995          ->   722169.9095831284624736051460550680 Inexact Rounded\r
+dqdiv2011  divide  -89584669773927.82711237350022515352        -42077943728529635884.21142627532985         ->   0.000002129017291146471565928125887527266 Inexact Rounded\r
+dqdiv2012  divide  -2.828201693360723203806974891946180E-232    812596541221823960386384403089240.9         ->  -3.480450075640521320040055759125120E-265 Inexact Rounded\r
+dqdiv2013  divide  -6442775372761069267502937539408720          24904085056.69185465145182606089196         ->  -258703556388226463687701.4884719589 Inexact Rounded\r
+dqdiv2014  divide   5.535520011272625629610079879714705        -44343664650.57203052003068113531208         ->  -1.248322630728089308975940533493562E-10 Inexact Rounded\r
+dqdiv2015  divide   65919273712517865964325.99419625010        -314733354141381737378622515.7789054         ->  -0.0002094448295521490616379784758911632 Inexact Rounded\r
+dqdiv2016  divide  -7.779172568193197107115275140431129E+759   -140453015639.3988987652895178782143         ->   5.538629792161641534962774244238115E+748 Inexact Rounded\r
+dqdiv2017  divide   644314832597569.0181226067518178797        -115024585257425.1635759521565201075         ->  -5.601540150356479257367687450922795 Inexact Rounded\r
+dqdiv2018  divide   6.898640941579611450676592553286870E-47    -11272429881407851485163914999.25943         ->  -6.119923578285338689371137648319280E-75 Inexact Rounded\r
+dqdiv2019  divide  -3591344544888727133.30819750163254          5329395.423792795661446561090331037         ->  -673874662941.1968525589460533725290 Inexact Rounded\r
+dqdiv2020  divide  -7.682356781384631313156462724425838E+747   -6.60375855512219057281922141809940E+703     ->   1.163330960279556016678379128875149E+44 Inexact Rounded\r
+dqdiv2021  divide  -4511495596596941820863224.274679699         3365395017.263329795449661616090724         ->  -1340554548115304.904166888018346299 Inexact Rounded\r
+dqdiv2022  divide   5.211164127840931517263639608151299         164.5566381356276567012533847006453         ->   0.03166790587655228864478260157156510 Inexact Rounded\r
+dqdiv2023  divide  -49891.2243893458830384077684620383         -47179.9312961860747554053371171530          ->   1.057467084386767291602189656430268 Inexact Rounded\r
+dqdiv2024  divide   15065477.47214268488077415462413353         4366211.120892953261309529740552596         ->   3.450469309661227984244545513441359 Inexact Rounded\r
+dqdiv2025  divide   1.575670269440761846109602429612644E+370    653199649324740300.006185482643439          ->   2.412233795700359170904588548041481E+352 Inexact Rounded\r
+dqdiv2026  divide  -2112422311733448924573432192.620145        -80067206.03590693153848215848613406         ->   26383115089417660175.20102646756574 Inexact Rounded\r
+dqdiv2027  divide  -67096536051279809.32218611548721839        -869685412881941081664251990181.1049         ->   7.715035236584805921278566365231168E-14 Inexact Rounded\r
+dqdiv2028  divide  -58612908548962047.21866913425488972        -978449597531.3873665583475633831644         ->   59903.86085991703091236507859837023 Inexact Rounded\r
+dqdiv2029  divide  -133032412010942.1476864138213319796        -7.882059293498670705446528648201359E-428    ->   1.687787506504433064549515681693715E+441 Inexact Rounded\r
+dqdiv2030  divide   1.83746698338966029492299716360513E+977    -9.897926608979649951672839879128603E+154    ->  -1.856416051542212552042390218062458E+822 Inexact Rounded\r
+dqdiv2031  divide  -113742475841399236307128962.1507063         8298602.203049834732657567965262989         ->  -13706221006665137826.16557393919929 Inexact Rounded\r
+dqdiv2032  divide   196.4787574650754152995941808331862         929.6553388472318094427422117172394         ->   0.2113458066176526651006917922814018 Inexact Rounded\r
+dqdiv2033  divide   71931221465.43867996282803628130350         3838685934206426257090718.402248853         ->   1.873850132527423413607199513324021E-14 Inexact Rounded\r
+dqdiv2034  divide   488.4282502289651653783596246312885        -80.68940956806634280078706577953188         ->  -6.053189047280693318844801899473272 Inexact Rounded\r
+dqdiv2035  divide   9.001764344963921754981762913247394E-162   -8.585540973667205753734967645386919E-729    ->  -1.048479574271827326396012573232934E+567 Inexact Rounded\r
+dqdiv2036  divide  -7.404133959409894743706402857145471E-828   -51.38159929460289711134684843086265         ->   1.441008855516029461032061785219773E-829 Inexact Rounded\r
+dqdiv2037  divide   2.967520235574419794048994436040717E-613   -6252513855.91394894949879262731889          ->  -4.746123405656409127572998751885338E-623 Inexact Rounded\r
+dqdiv2038  divide  -18826852654824040505.83920366765051        -6336924877942437992590557460147340          ->   2.970976146546494669807886278519194E-15 Inexact Rounded\r
+dqdiv2039  divide  -8.101406784809197604949584001735949E+561    4.823300306948942821076681658771635E+361    ->  -1.679639721610839204738445747238987E+200 Inexact Rounded\r
+dqdiv2040  divide  -6.11981977773094052331062585191723E+295     1.507610253755339328302779005586534E+238    ->  -4.059285058911577244044418416044763E+57 Inexact Rounded\r
+dqdiv2041  divide   6.472638850046815880599220534274055E-596   -4.475233712083047516933911786159972         ->  -1.446324207062261745520496475778879E-596 Inexact Rounded\r
+dqdiv2042  divide  -84438593330.71277839631144509397112        -586684596204401664208947.4054879633         ->   1.439250218550041228759983937772504E-13 Inexact Rounded\r
+dqdiv2043  divide   9.354533233294022616695815656704369E-24     405.500390626135304252144163591746          ->   2.306911028827774549740571229736198E-26 Inexact Rounded\r
+dqdiv2044  divide   985606423350210.7374876650149957881        -36811563697.41925681866694859828794         ->  -26774.36990864119445335813354717711 Inexact Rounded\r
+dqdiv2045  divide  -8.187280774177715706278002247766311E-123   -38784124393.91212870828430001300068         ->   2.110987653356139147357240727794365E-133 Inexact Rounded\r
+dqdiv2046  divide  -4.612203126350070903459245798371657E+912    7.971562182727956290901984736800519E+64     ->  -5.785820922708683237098826662769748E+847 Inexact Rounded\r
+dqdiv2047  divide   4.661015909421485298247928967977089E+888   -6.360911253323922338737311563845581E+388    ->  -7.327591478321365980156654539638836E+499 Inexact Rounded\r
+dqdiv2048  divide   9156078172903.257500003260710833030         7.189796653262147139071634237964074E-90     ->   1.273482215766000994365201545096026E+102 Inexact Rounded\r
+dqdiv2049  divide  -1.710722303327476586373477781276586E-311   -3167561628260156837329323.729380695         ->   5.400754599578613984875752958645655E-336 Inexact Rounded\r
+dqdiv2050  divide  -4.647935210881806238321616345413021E-878    209388.5431867744648177308460639582         ->  -2.219765771394593733140494297388140E-883 Inexact Rounded\r
+dqdiv2051  divide   5958.694728395760992719084781582700         4.541510156564315632536353171846096E-746    ->   1.312051393253638664947852693005480E+749 Inexact Rounded\r
+dqdiv2052  divide  -7.935732544649702175256699886872093E-489   -7.433329073664793138998765647467971E+360    ->   1.067587949626076917672271619664656E-849 Inexact Rounded\r
+dqdiv2053  divide  -2746650864601157.863589959939901350         7.016684945507647528907184694359598E+548    ->  -3.914456593009309529351254950429932E-534 Inexact Rounded\r
+dqdiv2054  divide   3605149408631197365447953.994569178        -75614025825649082.78264864428237833         ->  -47678315.88472693507060063188020532 Inexact Rounded\r
+dqdiv2055  divide   788194320921798404906375214.196349         -6.222718148433247384932573401976337E-418    ->  -1.266639918634671803982222244977287E+444 Inexact Rounded\r
+dqdiv2056  divide   5620722730534752.758208943447603211         6.843552841168538319123000917657759E-139    ->   8.213164800485434666629970443739554E+153 Inexact Rounded\r
+dqdiv2057  divide   7304534676713703938102.403949019402        -576169.3685010935108153023803590835         ->  -12677756014201995.31969237144394772 Inexact Rounded\r
+dqdiv2058  divide   8067918762.134621639254916786945547        -8.774771480055536009105596163864758E+954    ->  -9.194448858836332156766764605125245E-946 Inexact Rounded\r
+dqdiv2059  divide   8.702093454123046507578256899537563E-324   -5.875399733016018404580201176576293E-401    ->  -1.481106622452052581470443526957335E+77 Inexact Rounded\r
+dqdiv2060  divide  -41426.01662518451861386352415092356         90.00146621684478300510769802013464         ->  -460.2815750287318692732067709176200 Inexact Rounded\r
+\r
+-- random divide tests with result near 1\r
+dqdiv4001 divide  2003100352770753969878925664524900   2003100352770753969878925664497824  ->  1.000000000000000000000000000013517  Inexact Rounded\r
+dqdiv4002 divide  4817785793916490652579552318371645   4817785793916490652579552318362097  ->  1.000000000000000000000000000001982  Inexact Rounded\r
+dqdiv4003 divide  8299187410920067325648068439560282   8299187410920067325648068439591159  ->  0.9999999999999999999999999999962795  Inexact Rounded\r
+dqdiv4004 divide  5641088455897407044544461785365899   5641088455897407044544461785389965  ->  0.9999999999999999999999999999957338  Inexact Rounded\r
+dqdiv4005 divide  5752274694706545359326361313490424   5752274694706545359326361313502723  ->  0.9999999999999999999999999999978619  Inexact Rounded\r
+dqdiv4006 divide  6762079477373670594829319346099665   6762079477373670594829319346132579  ->  0.9999999999999999999999999999951326  Inexact Rounded\r
+dqdiv4007 divide  7286425153691890341633023222602916   7286425153691890341633023222606556  ->  0.9999999999999999999999999999995004  Inexact Rounded\r
+dqdiv4008 divide  9481233991901305727648306421946655   9481233991901305727648306421919124  ->  1.000000000000000000000000000002904  Inexact Rounded\r
+dqdiv4009 divide  4282053941893951742029444065614311   4282053941893951742029444065583077  ->  1.000000000000000000000000000007294  Inexact Rounded\r
+dqdiv4010 divide   626888225441250639741781850338695    626888225441250639741781850327299  ->  1.000000000000000000000000000018179  Inexact Rounded\r
+dqdiv4011 divide  3860973649222028009456598604468547   3860973649222028009456598604476849  ->  0.9999999999999999999999999999978498  Inexact Rounded\r
+dqdiv4012 divide  4753157080127468127908060607821839   4753157080127468127908060607788379  ->  1.000000000000000000000000000007040  Inexact Rounded\r
+dqdiv4013 divide   552448546203754062805706277880419    552448546203754062805706277881903  ->  0.9999999999999999999999999999973138  Inexact Rounded\r
+dqdiv4014 divide  8405954527952158455323713728917395   8405954527952158455323713728933866  ->  0.9999999999999999999999999999980406  Inexact Rounded\r
+dqdiv4015 divide  7554096502235321142555802238016116   7554096502235321142555802238026546  ->  0.9999999999999999999999999999986193  Inexact Rounded\r
+dqdiv4016 divide  4053257674127518606871054934746782   4053257674127518606871054934767355  ->  0.9999999999999999999999999999949243  Inexact Rounded\r
+dqdiv4017 divide  7112419420755090454716888844011582   7112419420755090454716888844038105  ->  0.9999999999999999999999999999962709  Inexact Rounded\r
+dqdiv4018 divide  3132302137520072728164549730911846   3132302137520072728164549730908416  ->  1.000000000000000000000000000001095  Inexact Rounded\r
+dqdiv4019 divide  4788374045841416355706715048161013   4788374045841416355706715048190077  ->  0.9999999999999999999999999999939303  Inexact Rounded\r
+dqdiv4020 divide  9466021636047630218238075099510597   9466021636047630218238075099484053  ->  1.000000000000000000000000000002804  Inexact Rounded\r
+dqdiv4021 divide   912742745646765625597399692138650    912742745646765625597399692139042  ->  0.9999999999999999999999999999995705  Inexact Rounded\r
+dqdiv4022 divide  9508402742933643208806264897188504   9508402742933643208806264897195973  ->  0.9999999999999999999999999999992145  Inexact Rounded\r
+dqdiv4023 divide  1186956795727233704962361914360895   1186956795727233704962361914329577  ->  1.000000000000000000000000000026385  Inexact Rounded\r
+dqdiv4024 divide  5972210268839014812696916170967938   5972210268839014812696916170954974  ->  1.000000000000000000000000000002171  Inexact Rounded\r
+dqdiv4025 divide  2303801625521619930894460139793140   2303801625521619930894460139799643  ->  0.9999999999999999999999999999971773  Inexact Rounded\r
+dqdiv4026 divide  6022231560002898264777393473966595   6022231560002898264777393473947198  ->  1.000000000000000000000000000003221  Inexact Rounded\r
+dqdiv4027 divide  8426148335801396199969346032210893   8426148335801396199969346032203179  ->  1.000000000000000000000000000000915  Inexact Rounded\r
+dqdiv4028 divide  8812278947028784637382847098411749   8812278947028784637382847098385317  ->  1.000000000000000000000000000002999  Inexact Rounded\r
+dqdiv4029 divide  8145282002348367383264197170116146   8145282002348367383264197170083988  ->  1.000000000000000000000000000003948  Inexact Rounded\r
+dqdiv4030 divide  6821577571876840153123510107387026   6821577571876840153123510107418008  ->  0.9999999999999999999999999999954582  Inexact Rounded\r
+dqdiv4031 divide  9018555319518966970480565482023720   9018555319518966970480565482013346  ->  1.000000000000000000000000000001150  Inexact Rounded\r
+dqdiv4032 divide  4602155712998228449640717252788864   4602155712998228449640717252818502  ->  0.9999999999999999999999999999935600  Inexact Rounded\r
+dqdiv4033 divide  6675607481522785614506828292264472   6675607481522785614506828292277100  ->  0.9999999999999999999999999999981083  Inexact Rounded\r
+dqdiv4034 divide  4015881516871833897766945836264472   4015881516871833897766945836262645  ->  1.000000000000000000000000000000455  Inexact Rounded\r
+dqdiv4035 divide  1415580205933411837595459716910365   1415580205933411837595459716880139  ->  1.000000000000000000000000000021352  Inexact Rounded\r
+dqdiv4036 divide  9432968297069542816752035276361552   9432968297069542816752035276353054  ->  1.000000000000000000000000000000901  Inexact Rounded\r
+dqdiv4037 divide  4799319591303848500532766682140658   4799319591303848500532766682172655  ->  0.9999999999999999999999999999933330  Inexact Rounded\r
+dqdiv4038 divide   316854270732839529790584284987472    316854270732839529790584285004832  ->  0.9999999999999999999999999999452114  Inexact Rounded\r
+dqdiv4039 divide  3598981300592490427826027975697415   3598981300592490427826027975686712  ->  1.000000000000000000000000000002974  Inexact Rounded\r
+dqdiv4040 divide  1664315435694461371155800682196520   1664315435694461371155800682195617  ->  1.000000000000000000000000000000543  Inexact Rounded\r
+dqdiv4041 divide  1680872316531128890102855316510581   1680872316531128890102855316495545  ->  1.000000000000000000000000000008945  Inexact Rounded\r
+dqdiv4042 divide  9881274879566405475755499281644730   9881274879566405475755499281615743  ->  1.000000000000000000000000000002934  Inexact Rounded\r
+dqdiv4043 divide  4737225957717466960447204232279216   4737225957717466960447204232277452  ->  1.000000000000000000000000000000372  Inexact Rounded\r
+dqdiv4044 divide  2482097379414867061213319346418288   2482097379414867061213319346387936  ->  1.000000000000000000000000000012228  Inexact Rounded\r
+dqdiv4045 divide  7406977595233762723576434122161868   7406977595233762723576434122189042  ->  0.9999999999999999999999999999963313  Inexact Rounded\r
+dqdiv4046 divide   228782057757566047086593281773577    228782057757566047086593281769727  ->  1.000000000000000000000000000016828  Inexact Rounded\r
+dqdiv4047 divide  2956594270240579648823270540367653   2956594270240579648823270540368556  ->  0.9999999999999999999999999999996946  Inexact Rounded\r
+dqdiv4048 divide  6326964098897620620534136767634340   6326964098897620620534136767619339  ->  1.000000000000000000000000000002371  Inexact Rounded\r
+dqdiv4049 divide   414586440456590215247002678327800    414586440456590215247002678316922  ->  1.000000000000000000000000000026238  Inexact Rounded\r
+dqdiv4050 divide  7364552208570039386220505636779125   7364552208570039386220505636803548  ->  0.9999999999999999999999999999966837  Inexact Rounded\r
+dqdiv4051 divide  5626266749902369710022824950590056   5626266749902369710022824950591008  ->  0.9999999999999999999999999999998308  Inexact Rounded\r
+dqdiv4052 divide  4863278293916197454987481343460484   4863278293916197454987481343442522  ->  1.000000000000000000000000000003693  Inexact Rounded\r
+dqdiv4053 divide  1170713582030637359713249796835483   1170713582030637359713249796823345  ->  1.000000000000000000000000000010368  Inexact Rounded\r
+dqdiv4054 divide  9838062494725965667776326556052931   9838062494725965667776326556061002  ->  0.9999999999999999999999999999991796  Inexact Rounded\r
+dqdiv4055 divide  4071388731298861093005687091498922   4071388731298861093005687091498278  ->  1.000000000000000000000000000000158  Inexact Rounded\r
+dqdiv4056 divide  8753155722324706795855038590272526   8753155722324706795855038590276656  ->  0.9999999999999999999999999999995282  Inexact Rounded\r
+dqdiv4057 divide  4399941911533273418844742658240485   4399941911533273418844742658219891  ->  1.000000000000000000000000000004681  Inexact Rounded\r
+dqdiv4058 divide  4127884159949503677776430620050269   4127884159949503677776430620026091  ->  1.000000000000000000000000000005857  Inexact Rounded\r
+dqdiv4059 divide  5536160822360800067042528317438808   5536160822360800067042528317450687  ->  0.9999999999999999999999999999978543  Inexact Rounded\r
+dqdiv4060 divide  3973234998468664936671088237710246   3973234998468664936671088237741886  ->  0.9999999999999999999999999999920367  Inexact Rounded\r
+dqdiv4061 divide  9824855935638263593410444142327358   9824855935638263593410444142328576  ->  0.9999999999999999999999999999998760  Inexact Rounded\r
+dqdiv4062 divide  5917078517340218131867327300814867   5917078517340218131867327300788701  ->  1.000000000000000000000000000004422  Inexact Rounded\r
+dqdiv4063 divide  4354236601830544882286139612521362   4354236601830544882286139612543223  ->  0.9999999999999999999999999999949794  Inexact Rounded\r
+dqdiv4064 divide  8058474772375259017342110013891294   8058474772375259017342110013906792  ->  0.9999999999999999999999999999980768  Inexact Rounded\r
+dqdiv4065 divide  5519604020981748170517093746166328   5519604020981748170517093746181763  ->  0.9999999999999999999999999999972036  Inexact Rounded\r
+dqdiv4066 divide  1502130966879805458831323782443139   1502130966879805458831323782412213  ->  1.000000000000000000000000000020588  Inexact Rounded\r
+dqdiv4067 divide   562795633719481212915159787980270    562795633719481212915159788007066  ->  0.9999999999999999999999999999523877  Inexact Rounded\r
+dqdiv4068 divide  6584743324494664273941281557268878   6584743324494664273941281557258945  ->  1.000000000000000000000000000001508  Inexact Rounded\r
+dqdiv4069 divide  3632000327285743997976431109416500   3632000327285743997976431109408107  ->  1.000000000000000000000000000002311  Inexact Rounded\r
+dqdiv4070 divide  1145827237315430089388953838561450   1145827237315430089388953838527332  ->  1.000000000000000000000000000029776  Inexact Rounded\r
+dqdiv4071 divide  8874431010357691869725372317350380   8874431010357691869725372317316472  ->  1.000000000000000000000000000003821  Inexact Rounded\r
+dqdiv4072 divide   992948718902804648119753141202196    992948718902804648119753141235222  ->  0.9999999999999999999999999999667395  Inexact Rounded\r
+dqdiv4073 divide  2522735183374218505142417265439989   2522735183374218505142417265453779  ->  0.9999999999999999999999999999945337  Inexact Rounded\r
+dqdiv4074 divide  2668419161912936508006872303501052   2668419161912936508006872303471036  ->  1.000000000000000000000000000011249  Inexact Rounded\r
+dqdiv4075 divide  3036169085665186712590941111775092   3036169085665186712590941111808846  ->  0.9999999999999999999999999999888827  Inexact Rounded\r
+dqdiv4076 divide  9441634604917231638508898934006147   9441634604917231638508898934000288  ->  1.000000000000000000000000000000621  Inexact Rounded\r
+dqdiv4077 divide  2677301353164377091111458811839190   2677301353164377091111458811867722  ->  0.9999999999999999999999999999893430  Inexact Rounded\r
+dqdiv4078 divide  6844979203112066166583765857171426   6844979203112066166583765857189682  ->  0.9999999999999999999999999999973329  Inexact Rounded\r
+dqdiv4079 divide  2220337435141796724323783960231661   2220337435141796724323783960208778  ->  1.000000000000000000000000000010306  Inexact Rounded\r
+dqdiv4080 divide  6447424700019783931569996989561380   6447424700019783931569996989572454  ->  0.9999999999999999999999999999982824  Inexact Rounded\r
+dqdiv4081 divide  7512856762696607119847092195587180   7512856762696607119847092195557346  ->  1.000000000000000000000000000003971  Inexact Rounded\r
+dqdiv4082 divide  7395261981193960399087819077237482   7395261981193960399087819077242487  ->  0.9999999999999999999999999999993232  Inexact Rounded\r
+dqdiv4083 divide  2253442467682584035792724884376735   2253442467682584035792724884407178  ->  0.9999999999999999999999999999864904  Inexact Rounded\r
+dqdiv4084 divide  8153138680300213135577336466190997   8153138680300213135577336466220607  ->  0.9999999999999999999999999999963683  Inexact Rounded\r
+dqdiv4085 divide  4668731252254148074041022681801390   4668731252254148074041022681778101  ->  1.000000000000000000000000000004988  Inexact Rounded\r
+dqdiv4086 divide  6078404557993669696040425501815056   6078404557993669696040425501797612  ->  1.000000000000000000000000000002870  Inexact Rounded\r
+dqdiv4087 divide  2306352359874261623223356878316278   2306352359874261623223356878335612  ->  0.9999999999999999999999999999916171  Inexact Rounded\r
+dqdiv4088 divide  3264842186668480362900909564091908   3264842186668480362900909564058658  ->  1.000000000000000000000000000010184  Inexact Rounded\r
+dqdiv4089 divide  6971985047279636878957959608612204   6971985047279636878957959608615088  ->  0.9999999999999999999999999999995863  Inexact Rounded\r
+dqdiv4090 divide  5262810889952721235466445973816257   5262810889952721235466445973783077  ->  1.000000000000000000000000000006305  Inexact Rounded\r
+dqdiv4091 divide  7947944731035267178548357070080288   7947944731035267178548357070061339  ->  1.000000000000000000000000000002384  Inexact Rounded\r
+dqdiv4092 divide  5071808908395375108383035800443229   5071808908395375108383035800412429  ->  1.000000000000000000000000000006073  Inexact Rounded\r
+dqdiv4093 divide  2043146542084503655511507209262969   2043146542084503655511507209249263  ->  1.000000000000000000000000000006708  Inexact Rounded\r
+dqdiv4094 divide  4097632735384534181661959731264802   4097632735384534181661959731234499  ->  1.000000000000000000000000000007395  Inexact Rounded\r
+dqdiv4095 divide  3061477642831387489729464587044430   3061477642831387489729464587059452  ->  0.9999999999999999999999999999950932  Inexact Rounded\r
+dqdiv4096 divide  3429854941039776159498802936252638   3429854941039776159498802936246415  ->  1.000000000000000000000000000001814  Inexact Rounded\r
+dqdiv4097 divide  4874324979578599700024133278284545   4874324979578599700024133278262131  ->  1.000000000000000000000000000004598  Inexact Rounded\r
+dqdiv4098 divide  5701652369691833541455978515820882   5701652369691833541455978515834854  ->  0.9999999999999999999999999999975495  Inexact Rounded\r
+dqdiv4099 divide  2928205728402945266953255632343113   2928205728402945266953255632373794  ->  0.9999999999999999999999999999895223  Inexact Rounded\r
+\r
+-- Null tests\r
+dqdiv9998 divide 10  # -> NaN Invalid_operation\r
+dqdiv9999 divide  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqDivideInt.decTest b/Lib/test/decimaltestdata/dqDivideInt.decTest
new file mode 100644 (file)
index 0000000..953c1e0
--- /dev/null
@@ -0,0 +1,453 @@
+------------------------------------------------------------------------\r
+-- dqDivideInt.decTest -- decQuad integer division                    --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+\r
+dqdvi001 divideint  1     1    ->  1\r
+dqdvi002 divideint  2     1    ->  2\r
+dqdvi003 divideint  1     2    ->  0\r
+dqdvi004 divideint  2     2    ->  1\r
+dqdvi005 divideint  0     1    ->  0\r
+dqdvi006 divideint  0     2    ->  0\r
+dqdvi007 divideint  1     3    ->  0\r
+dqdvi008 divideint  2     3    ->  0\r
+dqdvi009 divideint  3     3    ->  1\r
+\r
+dqdvi010 divideint  2.4   1    ->  2\r
+dqdvi011 divideint  2.4   -1   ->  -2\r
+dqdvi012 divideint  -2.4  1    ->  -2\r
+dqdvi013 divideint  -2.4  -1   ->  2\r
+dqdvi014 divideint  2.40  1    ->  2\r
+dqdvi015 divideint  2.400 1    ->  2\r
+dqdvi016 divideint  2.4   2    ->  1\r
+dqdvi017 divideint  2.400 2    ->  1\r
+dqdvi018 divideint  2.    2    ->  1\r
+dqdvi019 divideint  20    20   ->  1\r
+\r
+dqdvi020 divideint  187   187  ->  1\r
+dqdvi021 divideint  5     2    ->  2\r
+dqdvi022 divideint  5     2.0    ->  2\r
+dqdvi023 divideint  5     2.000  ->  2\r
+dqdvi024 divideint  5     0.200  ->  25\r
+dqdvi025 divideint  5     0.200  ->  25\r
+\r
+dqdvi030 divideint  1     2      ->  0\r
+dqdvi031 divideint  1     4      ->  0\r
+dqdvi032 divideint  1     8      ->  0\r
+dqdvi033 divideint  1     16     ->  0\r
+dqdvi034 divideint  1     32     ->  0\r
+dqdvi035 divideint  1     64     ->  0\r
+dqdvi040 divideint  1    -2      -> -0\r
+dqdvi041 divideint  1    -4      -> -0\r
+dqdvi042 divideint  1    -8      -> -0\r
+dqdvi043 divideint  1    -16     -> -0\r
+dqdvi044 divideint  1    -32     -> -0\r
+dqdvi045 divideint  1    -64     -> -0\r
+dqdvi050 divideint -1     2      -> -0\r
+dqdvi051 divideint -1     4      -> -0\r
+dqdvi052 divideint -1     8      -> -0\r
+dqdvi053 divideint -1     16     -> -0\r
+dqdvi054 divideint -1     32     -> -0\r
+dqdvi055 divideint -1     64     -> -0\r
+dqdvi060 divideint -1    -2      ->  0\r
+dqdvi061 divideint -1    -4      ->  0\r
+dqdvi062 divideint -1    -8      ->  0\r
+dqdvi063 divideint -1    -16     ->  0\r
+dqdvi064 divideint -1    -32     ->  0\r
+dqdvi065 divideint -1    -64     ->  0\r
+\r
+-- similar with powers of ten\r
+dqdvi160 divideint  1     1         ->  1\r
+dqdvi161 divideint  1     10        ->  0\r
+dqdvi162 divideint  1     100       ->  0\r
+dqdvi163 divideint  1     1000      ->  0\r
+dqdvi164 divideint  1     10000     ->  0\r
+dqdvi165 divideint  1     100000    ->  0\r
+dqdvi166 divideint  1     1000000   ->  0\r
+dqdvi167 divideint  1     10000000  ->  0\r
+dqdvi168 divideint  1     100000000 ->  0\r
+dqdvi170 divideint  1    -1         -> -1\r
+dqdvi171 divideint  1    -10        -> -0\r
+dqdvi172 divideint  1    -100       -> -0\r
+dqdvi173 divideint  1    -1000      -> -0\r
+dqdvi174 divideint  1    -10000     -> -0\r
+dqdvi175 divideint  1    -100000    -> -0\r
+dqdvi176 divideint  1    -1000000   -> -0\r
+dqdvi177 divideint  1    -10000000  -> -0\r
+dqdvi178 divideint  1    -100000000 -> -0\r
+dqdvi180 divideint -1     1         -> -1\r
+dqdvi181 divideint -1     10        -> -0\r
+dqdvi182 divideint -1     100       -> -0\r
+dqdvi183 divideint -1     1000      -> -0\r
+dqdvi184 divideint -1     10000     -> -0\r
+dqdvi185 divideint -1     100000    -> -0\r
+dqdvi186 divideint -1     1000000   -> -0\r
+dqdvi187 divideint -1     10000000  -> -0\r
+dqdvi188 divideint -1     100000000 -> -0\r
+dqdvi190 divideint -1    -1         ->  1\r
+dqdvi191 divideint -1    -10        ->  0\r
+dqdvi192 divideint -1    -100       ->  0\r
+dqdvi193 divideint -1    -1000      ->  0\r
+dqdvi194 divideint -1    -10000     ->  0\r
+dqdvi195 divideint -1    -100000    ->  0\r
+dqdvi196 divideint -1    -1000000   ->  0\r
+dqdvi197 divideint -1    -10000000  ->  0\r
+dqdvi198 divideint -1    -100000000 ->  0\r
+\r
+-- some long operand (at p=9) cases\r
+dqdvi070 divideint  999999999     1  ->  999999999\r
+dqdvi071 divideint  999999999.4   1  ->  999999999\r
+dqdvi072 divideint  999999999.5   1  ->  999999999\r
+dqdvi073 divideint  999999999.9   1  ->  999999999\r
+dqdvi074 divideint  999999999.999 1  ->  999999999\r
+\r
+dqdvi090 divideint  0.            1    ->  0\r
+dqdvi091 divideint  .0            1    ->  0\r
+dqdvi092 divideint  0.00          1    ->  0\r
+dqdvi093 divideint  0.00E+9       1    ->  0\r
+dqdvi094 divideint  0.0000E-50    1    ->  0\r
+\r
+dqdvi100 divideint  1  1   -> 1\r
+dqdvi101 divideint  1  2   -> 0\r
+dqdvi102 divideint  1  3   -> 0\r
+dqdvi103 divideint  1  4   -> 0\r
+dqdvi104 divideint  1  5   -> 0\r
+dqdvi105 divideint  1  6   -> 0\r
+dqdvi106 divideint  1  7   -> 0\r
+dqdvi107 divideint  1  8   -> 0\r
+dqdvi108 divideint  1  9   -> 0\r
+dqdvi109 divideint  1  10  -> 0\r
+dqdvi110 divideint  1  1   -> 1\r
+dqdvi111 divideint  2  1   -> 2\r
+dqdvi112 divideint  3  1   -> 3\r
+dqdvi113 divideint  4  1   -> 4\r
+dqdvi114 divideint  5  1   -> 5\r
+dqdvi115 divideint  6  1   -> 6\r
+dqdvi116 divideint  7  1   -> 7\r
+dqdvi117 divideint  8  1   -> 8\r
+dqdvi118 divideint  9  1   -> 9\r
+dqdvi119 divideint  10 1   -> 10\r
+\r
+-- from DiagBigDecimal\r
+dqdvi131 divideint  101.3   1     ->  101\r
+dqdvi132 divideint  101.0   1     ->  101\r
+dqdvi133 divideint  101.3   3     ->  33\r
+dqdvi134 divideint  101.0   3     ->  33\r
+dqdvi135 divideint  2.4     1     ->  2\r
+dqdvi136 divideint  2.400   1     ->  2\r
+dqdvi137 divideint  18      18    ->  1\r
+dqdvi138 divideint  1120    1000  ->  1\r
+dqdvi139 divideint  2.4     2     ->  1\r
+dqdvi140 divideint  2.400   2     ->  1\r
+dqdvi141 divideint  0.5     2.000 ->  0\r
+dqdvi142 divideint  8.005   7     ->  1\r
+dqdvi143 divideint  5       2     ->  2\r
+dqdvi144 divideint  0       2     ->  0\r
+dqdvi145 divideint  0.00    2     ->  0\r
+\r
+-- Others\r
+dqdvi150 divideint  12345  4.999  ->  2469\r
+dqdvi151 divideint  12345  4.99   ->  2473\r
+dqdvi152 divideint  12345  4.9    ->  2519\r
+dqdvi153 divideint  12345  5      ->  2469\r
+dqdvi154 divideint  12345  5.1    ->  2420\r
+dqdvi155 divideint  12345  5.01   ->  2464\r
+dqdvi156 divideint  12345  5.001  ->  2468\r
+dqdvi157 divideint    101  7.6    ->  13\r
+\r
+-- Various flavours of divideint by 0\r
+dqdvi201 divideint  0      0   -> NaN Division_undefined\r
+dqdvi202 divideint  0.0E5  0   -> NaN Division_undefined\r
+dqdvi203 divideint  0.000  0   -> NaN Division_undefined\r
+dqdvi204 divideint  0.0001 0   -> Infinity Division_by_zero\r
+dqdvi205 divideint  0.01   0   -> Infinity Division_by_zero\r
+dqdvi206 divideint  0.1    0   -> Infinity Division_by_zero\r
+dqdvi207 divideint  1      0   -> Infinity Division_by_zero\r
+dqdvi208 divideint  1      0.0 -> Infinity Division_by_zero\r
+dqdvi209 divideint 10      0.0 -> Infinity Division_by_zero\r
+dqdvi210 divideint 1E+100  0.0 -> Infinity Division_by_zero\r
+dqdvi211 divideint 1E+380  0   -> Infinity Division_by_zero\r
+dqdvi214 divideint  -0.0001 0   -> -Infinity Division_by_zero\r
+dqdvi215 divideint  -0.01   0   -> -Infinity Division_by_zero\r
+dqdvi216 divideint  -0.1    0   -> -Infinity Division_by_zero\r
+dqdvi217 divideint  -1      0   -> -Infinity Division_by_zero\r
+dqdvi218 divideint  -1      0.0 -> -Infinity Division_by_zero\r
+dqdvi219 divideint -10      0.0 -> -Infinity Division_by_zero\r
+dqdvi220 divideint -1E+100  0.0 -> -Infinity Division_by_zero\r
+dqdvi221 divideint -1E+380  0   -> -Infinity Division_by_zero\r
+\r
+-- test some cases that are close to exponent overflow\r
+dqdvi270 divideint 1 1e384          -> 0\r
+dqdvi271 divideint 1 0.9e384        -> 0\r
+dqdvi272 divideint 1 0.99e384       -> 0\r
+dqdvi273 divideint 1 0.9999999999999999e384       -> 0\r
+dqdvi274 divideint 9e384    1       -> NaN Division_impossible\r
+dqdvi275 divideint 9.9e384  1       -> NaN Division_impossible\r
+dqdvi276 divideint 9.99e384 1       -> NaN Division_impossible\r
+dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible\r
+\r
+dqdvi280 divideint 0.1 9e-383       -> NaN Division_impossible\r
+dqdvi281 divideint 0.1 99e-383      -> NaN Division_impossible\r
+dqdvi282 divideint 0.1 999e-383     -> NaN Division_impossible\r
+dqdvi283 divideint 0.1 9e-382       -> NaN Division_impossible\r
+dqdvi284 divideint 0.1 99e-382      -> NaN Division_impossible\r
+\r
+-- GD edge cases: lhs smaller than rhs but more digits\r
+dqdvi301  divideint  0.9      2      ->  0\r
+dqdvi302  divideint  0.9      2.0    ->  0\r
+dqdvi303  divideint  0.9      2.1    ->  0\r
+dqdvi304  divideint  0.9      2.00   ->  0\r
+dqdvi305  divideint  0.9      2.01   ->  0\r
+dqdvi306  divideint  0.12     1      ->  0\r
+dqdvi307  divideint  0.12     1.0    ->  0\r
+dqdvi308  divideint  0.12     1.00   ->  0\r
+dqdvi309  divideint  0.12     1.0    ->  0\r
+dqdvi310  divideint  0.12     1.00   ->  0\r
+dqdvi311  divideint  0.12     2      ->  0\r
+dqdvi312  divideint  0.12     2.0    ->  0\r
+dqdvi313  divideint  0.12     2.1    ->  0\r
+dqdvi314  divideint  0.12     2.00   ->  0\r
+dqdvi315  divideint  0.12     2.01   ->  0\r
+\r
+-- edge cases of impossible\r
+dqdvi330  divideint  1234567987654321987654321890123456  10    ->  123456798765432198765432189012345\r
+dqdvi331  divideint  1234567987654321987654321890123456   1    ->  1234567987654321987654321890123456\r
+dqdvi332  divideint  1234567987654321987654321890123456   0.1  ->  NaN Division_impossible\r
+dqdvi333  divideint  1234567987654321987654321890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- overflow and underflow tests [from divide]\r
+dqdvi1051 divideint  1e+277  1e-311 ->  NaN Division_impossible\r
+dqdvi1052 divideint  1e+277 -1e-311 ->  NaN Division_impossible\r
+dqdvi1053 divideint -1e+277  1e-311 ->  NaN Division_impossible\r
+dqdvi1054 divideint -1e+277 -1e-311 ->  NaN Division_impossible\r
+dqdvi1055 divideint  1e-277  1e+311 ->  0\r
+dqdvi1056 divideint  1e-277 -1e+311 -> -0\r
+dqdvi1057 divideint -1e-277  1e+311 -> -0\r
+dqdvi1058 divideint -1e-277 -1e+311 ->  0\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dqdvi1060 divideint 1e-291 1e+101 -> 0\r
+dqdvi1061 divideint 1e-291 1e+102 -> 0\r
+dqdvi1062 divideint 1e-291 1e+103 -> 0\r
+dqdvi1063 divideint 1e-291 1e+104 -> 0\r
+dqdvi1064 divideint 1e-291 1e+105 -> 0\r
+dqdvi1065 divideint 1e-291 1e+106 -> 0\r
+dqdvi1066 divideint 1e-291 1e+107 -> 0\r
+dqdvi1067 divideint 1e-291 1e+108 -> 0\r
+dqdvi1068 divideint 1e-291 1e+109 -> 0\r
+dqdvi1069 divideint 1e-291 1e+110 -> 0\r
+\r
+dqdvi1101 divideint  1.0000E-394  1     -> 0\r
+dqdvi1102 divideint  1.000E-394   1e+1  -> 0\r
+dqdvi1103 divideint  1.00E-394    1e+2  -> 0\r
+\r
+dqdvi1118 divideint  1E-394       1e+4  -> 0\r
+dqdvi1119 divideint  3E-394      -1e+5  -> -0\r
+dqdvi1120 divideint  5E-394       1e+5  -> 0\r
+\r
+dqdvi1124 divideint  1E-394      -1e+4  -> -0\r
+dqdvi1130 divideint  3.0E-394    -1e+5  -> -0\r
+\r
+dqdvi1131 divideint  1.0E-199     1e+200 -> 0\r
+dqdvi1132 divideint  1.0E-199     1e+199 -> 0\r
+dqdvi1133 divideint  1.0E-199     1e+198 -> 0\r
+dqdvi1134 divideint  2.0E-199     2e+198 -> 0\r
+dqdvi1135 divideint  4.0E-199     4e+198 -> 0\r
+\r
+-- long operand checks\r
+dqdvi401 divideint 12345678000 100 -> 123456780\r
+dqdvi402 divideint 1 12345678000   -> 0\r
+dqdvi403 divideint 1234567800  10  -> 123456780\r
+dqdvi404 divideint 1 1234567800    -> 0\r
+dqdvi405 divideint 1234567890  10  -> 123456789\r
+dqdvi406 divideint 1 1234567890    -> 0\r
+dqdvi407 divideint 1234567891  10  -> 123456789\r
+dqdvi408 divideint 1 1234567891    -> 0\r
+dqdvi409 divideint 12345678901 100 -> 123456789\r
+dqdvi410 divideint 1 12345678901   -> 0\r
+dqdvi411 divideint 1234567896  10  -> 123456789\r
+dqdvi412 divideint 1 1234567896    -> 0\r
+dqdvi413 divideint 12345678948 100 -> 123456789\r
+dqdvi414 divideint 12345678949 100 -> 123456789\r
+dqdvi415 divideint 12345678950 100 -> 123456789\r
+dqdvi416 divideint 12345678951 100 -> 123456789\r
+dqdvi417 divideint 12345678999 100 -> 123456789\r
+dqdvi441 divideint 12345678000 1 -> 12345678000\r
+dqdvi442 divideint 1 12345678000 -> 0\r
+dqdvi443 divideint 1234567800  1 -> 1234567800\r
+dqdvi444 divideint 1 1234567800  -> 0\r
+dqdvi445 divideint 1234567890  1 -> 1234567890\r
+dqdvi446 divideint 1 1234567890  -> 0\r
+dqdvi447 divideint 1234567891  1 -> 1234567891\r
+dqdvi448 divideint 1 1234567891  -> 0\r
+dqdvi449 divideint 12345678901 1 -> 12345678901\r
+dqdvi450 divideint 1 12345678901 -> 0\r
+dqdvi451 divideint 1234567896  1 -> 1234567896\r
+dqdvi452 divideint 1 1234567896  -> 0\r
+\r
+-- more zeros, etc.\r
+dqdvi531 divideint 5.00 1E-3    -> 5000\r
+dqdvi532 divideint 00.00 0.000  -> NaN Division_undefined\r
+dqdvi533 divideint 00.00 0E-3   -> NaN Division_undefined\r
+dqdvi534 divideint  0    -0     -> NaN Division_undefined\r
+dqdvi535 divideint -0     0     -> NaN Division_undefined\r
+dqdvi536 divideint -0    -0     -> NaN Division_undefined\r
+\r
+dqdvi541 divideint  0    -1     -> -0\r
+dqdvi542 divideint -0    -1     ->  0\r
+dqdvi543 divideint  0     1     ->  0\r
+dqdvi544 divideint -0     1     -> -0\r
+dqdvi545 divideint -1     0     -> -Infinity Division_by_zero\r
+dqdvi546 divideint -1    -0     ->  Infinity Division_by_zero\r
+dqdvi547 divideint  1     0     ->  Infinity Division_by_zero\r
+dqdvi548 divideint  1    -0     -> -Infinity Division_by_zero\r
+\r
+dqdvi551 divideint  0.0  -1     -> -0\r
+dqdvi552 divideint -0.0  -1     ->  0\r
+dqdvi553 divideint  0.0   1     ->  0\r
+dqdvi554 divideint -0.0   1     -> -0\r
+dqdvi555 divideint -1.0   0     -> -Infinity Division_by_zero\r
+dqdvi556 divideint -1.0  -0     ->  Infinity Division_by_zero\r
+dqdvi557 divideint  1.0   0     ->  Infinity Division_by_zero\r
+dqdvi558 divideint  1.0  -0     -> -Infinity Division_by_zero\r
+\r
+dqdvi561 divideint  0    -1.0   -> -0\r
+dqdvi562 divideint -0    -1.0   ->  0\r
+dqdvi563 divideint  0     1.0   ->  0\r
+dqdvi564 divideint -0     1.0   -> -0\r
+dqdvi565 divideint -1     0.0   -> -Infinity Division_by_zero\r
+dqdvi566 divideint -1    -0.0   ->  Infinity Division_by_zero\r
+dqdvi567 divideint  1     0.0   ->  Infinity Division_by_zero\r
+dqdvi568 divideint  1    -0.0   -> -Infinity Division_by_zero\r
+\r
+dqdvi571 divideint  0.0  -1.0   -> -0\r
+dqdvi572 divideint -0.0  -1.0   ->  0\r
+dqdvi573 divideint  0.0   1.0   ->  0\r
+dqdvi574 divideint -0.0   1.0   -> -0\r
+dqdvi575 divideint -1.0   0.0   -> -Infinity Division_by_zero\r
+dqdvi576 divideint -1.0  -0.0   ->  Infinity Division_by_zero\r
+dqdvi577 divideint  1.0   0.0   ->  Infinity Division_by_zero\r
+dqdvi578 divideint  1.0  -0.0   -> -Infinity Division_by_zero\r
+\r
+-- Specials\r
+dqdvi580 divideint  Inf  -Inf   ->  NaN Invalid_operation\r
+dqdvi581 divideint  Inf  -1000  -> -Infinity\r
+dqdvi582 divideint  Inf  -1     -> -Infinity\r
+dqdvi583 divideint  Inf  -0     -> -Infinity\r
+dqdvi584 divideint  Inf   0     ->  Infinity\r
+dqdvi585 divideint  Inf   1     ->  Infinity\r
+dqdvi586 divideint  Inf   1000  ->  Infinity\r
+dqdvi587 divideint  Inf   Inf   ->  NaN Invalid_operation\r
+dqdvi588 divideint -1000  Inf   -> -0\r
+dqdvi589 divideint -Inf   Inf   ->  NaN Invalid_operation\r
+dqdvi590 divideint -1     Inf   -> -0\r
+dqdvi591 divideint -0     Inf   -> -0\r
+dqdvi592 divideint  0     Inf   ->  0\r
+dqdvi593 divideint  1     Inf   ->  0\r
+dqdvi594 divideint  1000  Inf   ->  0\r
+dqdvi595 divideint  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dqdvi600 divideint -Inf  -Inf   ->  NaN Invalid_operation\r
+dqdvi601 divideint -Inf  -1000  ->  Infinity\r
+dqdvi602 divideint -Inf  -1     ->  Infinity\r
+dqdvi603 divideint -Inf  -0     ->  Infinity\r
+dqdvi604 divideint -Inf   0     -> -Infinity\r
+dqdvi605 divideint -Inf   1     -> -Infinity\r
+dqdvi606 divideint -Inf   1000  -> -Infinity\r
+dqdvi607 divideint -Inf   Inf   ->  NaN Invalid_operation\r
+dqdvi608 divideint -1000  Inf   -> -0\r
+dqdvi609 divideint -Inf  -Inf   ->  NaN Invalid_operation\r
+dqdvi610 divideint -1    -Inf   ->  0\r
+dqdvi611 divideint -0    -Inf   ->  0\r
+dqdvi612 divideint  0    -Inf   -> -0\r
+dqdvi613 divideint  1    -Inf   -> -0\r
+dqdvi614 divideint  1000 -Inf   -> -0\r
+dqdvi615 divideint  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dqdvi621 divideint  NaN -Inf    ->  NaN\r
+dqdvi622 divideint  NaN -1000   ->  NaN\r
+dqdvi623 divideint  NaN -1      ->  NaN\r
+dqdvi624 divideint  NaN -0      ->  NaN\r
+dqdvi625 divideint  NaN  0      ->  NaN\r
+dqdvi626 divideint  NaN  1      ->  NaN\r
+dqdvi627 divideint  NaN  1000   ->  NaN\r
+dqdvi628 divideint  NaN  Inf    ->  NaN\r
+dqdvi629 divideint  NaN  NaN    ->  NaN\r
+dqdvi630 divideint -Inf  NaN    ->  NaN\r
+dqdvi631 divideint -1000 NaN    ->  NaN\r
+dqdvi632 divideint -1    NaN    ->  NaN\r
+dqdvi633 divideint -0    NaN    ->  NaN\r
+dqdvi634 divideint  0    NaN    ->  NaN\r
+dqdvi635 divideint  1    NaN    ->  NaN\r
+dqdvi636 divideint  1000 NaN    ->  NaN\r
+dqdvi637 divideint  Inf  NaN    ->  NaN\r
+\r
+dqdvi641 divideint  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqdvi642 divideint  sNaN -1000  ->  NaN  Invalid_operation\r
+dqdvi643 divideint  sNaN -1     ->  NaN  Invalid_operation\r
+dqdvi644 divideint  sNaN -0     ->  NaN  Invalid_operation\r
+dqdvi645 divideint  sNaN  0     ->  NaN  Invalid_operation\r
+dqdvi646 divideint  sNaN  1     ->  NaN  Invalid_operation\r
+dqdvi647 divideint  sNaN  1000  ->  NaN  Invalid_operation\r
+dqdvi648 divideint  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqdvi649 divideint  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqdvi650 divideint  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqdvi651 divideint -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqdvi652 divideint -1000 sNaN   ->  NaN  Invalid_operation\r
+dqdvi653 divideint -1    sNaN   ->  NaN  Invalid_operation\r
+dqdvi654 divideint -0    sNaN   ->  NaN  Invalid_operation\r
+dqdvi655 divideint  0    sNaN   ->  NaN  Invalid_operation\r
+dqdvi656 divideint  1    sNaN   ->  NaN  Invalid_operation\r
+dqdvi657 divideint  1000 sNaN   ->  NaN  Invalid_operation\r
+dqdvi658 divideint  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqdvi659 divideint  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqdvi661 divideint  NaN9 -Inf   ->  NaN9\r
+dqdvi662 divideint  NaN8  1000  ->  NaN8\r
+dqdvi663 divideint  NaN7  Inf   ->  NaN7\r
+dqdvi664 divideint -NaN6  NaN5  -> -NaN6\r
+dqdvi665 divideint -Inf   NaN4  ->  NaN4\r
+dqdvi666 divideint -1000  NaN3  ->  NaN3\r
+dqdvi667 divideint  Inf  -NaN2  -> -NaN2\r
+\r
+dqdvi671 divideint -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqdvi672 divideint  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dqdvi673 divideint  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqdvi674 divideint  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dqdvi675 divideint  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqdvi676 divideint -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqdvi677 divideint  0      sNaN91  ->  NaN91 Invalid_operation\r
+dqdvi678 divideint  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqdvi679 divideint  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- Gyuris example\r
+dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0\r
+\r
+-- Null tests\r
+dqdvi900 divideint  10  # -> NaN Invalid_operation\r
+dqdvi901 divideint   # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqEncode.decTest b/Lib/test/decimaltestdata/dqEncode.decTest
new file mode 100644 (file)
index 0000000..ed3f328
--- /dev/null
@@ -0,0 +1,470 @@
+------------------------------------------------------------------------\r
+-- dqEncode.decTest -- decimal sixteen-byte format testcases          --\r
+-- Copyright (c) IBM Corporation, 2000, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+-- [Previously called decimal128.decTest]\r
+version: 2.56\r
+\r
+-- This set of tests is for the sixteen-byte concrete representation.\r
+-- Its characteristics are:\r
+--\r
+--   1 bit  sign\r
+--   5 bits combination field\r
+--  12 bits exponent continuation\r
+-- 110 bits coefficient continuation\r
+--\r
+-- Total exponent length 14 bits\r
+-- Total coefficient length 114 bits (34 digits)\r
+--\r
+-- Elimit = 12287 (maximum encoded exponent)\r
+-- Emax   =  6144 (largest exponent value)\r
+-- Emin   = -6143 (smallest exponent value)\r
+-- bias   =  6176 (subtracted from encoded exponent) = -Etiny\r
+\r
+-- The testcases here have only exactly representable data on the\r
+-- 'left-hand-side'; rounding from strings is tested in 'base'\r
+-- testcase groups.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+rounding:    half_up\r
+maxExponent: 6144\r
+minExponent: -6143\r
+\r
+-- General testcases\r
+-- (mostly derived from the Strawman 4 document and examples)\r
+decq001 apply   #A20780000000000000000000000003D0 -> -7.50\r
+decq002 apply   -7.50             -> #A20780000000000000000000000003D0\r
+-- derivative canonical plain strings\r
+decq003 apply   #A20840000000000000000000000003D0 -> -7.50E+3\r
+decq004 apply   -7.50E+3          -> #A20840000000000000000000000003D0\r
+decq005 apply   #A20800000000000000000000000003D0 -> -750\r
+decq006 apply   -750              -> #A20800000000000000000000000003D0\r
+decq007 apply   #A207c0000000000000000000000003D0 -> -75.0\r
+decq008 apply   -75.0             -> #A207c0000000000000000000000003D0\r
+decq009 apply   #A20740000000000000000000000003D0 -> -0.750\r
+decq010 apply   -0.750            -> #A20740000000000000000000000003D0\r
+decq011 apply   #A20700000000000000000000000003D0 -> -0.0750\r
+decq012 apply   -0.0750           -> #A20700000000000000000000000003D0\r
+decq013 apply   #A20680000000000000000000000003D0 -> -0.000750\r
+decq014 apply   -0.000750         -> #A20680000000000000000000000003D0\r
+decq015 apply   #A20600000000000000000000000003D0 -> -0.00000750\r
+decq016 apply   -0.00000750       -> #A20600000000000000000000000003D0\r
+decq017 apply   #A205c0000000000000000000000003D0 -> -7.50E-7\r
+decq018 apply   -7.50E-7          -> #A205c0000000000000000000000003D0\r
+\r
+-- Normality\r
+decq020 apply   1234567890123456789012345678901234   -> #2608134b9c1e28e56f3c127177823534\r
+decq021 apply  -1234567890123456789012345678901234   -> #a608134b9c1e28e56f3c127177823534\r
+decq022 apply   1111111111111111111111111111111111   -> #26080912449124491244912449124491\r
+\r
+-- Nmax and similar\r
+decq031 apply   9.999999999999999999999999999999999E+6144  -> #77ffcff3fcff3fcff3fcff3fcff3fcff\r
+decq032 apply   #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144\r
+decq033 apply   1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534\r
+decq034 apply   #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144\r
+-- fold-downs (more below)\r
+decq035 apply   1.23E+6144    -> #47ffd300000000000000000000000000 Clamped\r
+decq036 apply   #47ffd300000000000000000000000000       -> 1.230000000000000000000000000000000E+6144\r
+decq037 apply   1E+6144       -> #47ffc000000000000000000000000000 Clamped\r
+decq038 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144\r
+\r
+decq051 apply   12345                   -> #220800000000000000000000000049c5\r
+decq052 apply   #220800000000000000000000000049c5       -> 12345\r
+decq053 apply   1234                    -> #22080000000000000000000000000534\r
+decq054 apply   #22080000000000000000000000000534       -> 1234\r
+decq055 apply   123                     -> #220800000000000000000000000000a3\r
+decq056 apply   #220800000000000000000000000000a3       -> 123\r
+decq057 apply   12                      -> #22080000000000000000000000000012\r
+decq058 apply   #22080000000000000000000000000012       -> 12\r
+decq059 apply   1                       -> #22080000000000000000000000000001\r
+decq060 apply   #22080000000000000000000000000001       -> 1\r
+decq061 apply   1.23                    -> #220780000000000000000000000000a3\r
+decq062 apply   #220780000000000000000000000000a3       -> 1.23\r
+decq063 apply   123.45                  -> #220780000000000000000000000049c5\r
+decq064 apply   #220780000000000000000000000049c5       -> 123.45\r
+\r
+-- Nmin and below\r
+decq071 apply   1E-6143                                    -> #00084000000000000000000000000001\r
+decq072 apply   #00084000000000000000000000000001          -> 1E-6143\r
+decq073 apply   1.000000000000000000000000000000000E-6143  -> #04000000000000000000000000000000\r
+decq074 apply   #04000000000000000000000000000000          -> 1.000000000000000000000000000000000E-6143\r
+decq075 apply   1.000000000000000000000000000000001E-6143  -> #04000000000000000000000000000001\r
+decq076 apply   #04000000000000000000000000000001          -> 1.000000000000000000000000000000001E-6143\r
+\r
+decq077 apply   0.100000000000000000000000000000000E-6143  -> #00000800000000000000000000000000      Subnormal\r
+decq078 apply   #00000800000000000000000000000000          -> 1.00000000000000000000000000000000E-6144  Subnormal\r
+decq079 apply   0.000000000000000000000000000000010E-6143  -> #00000000000000000000000000000010      Subnormal\r
+decq080 apply   #00000000000000000000000000000010          -> 1.0E-6175              Subnormal\r
+decq081 apply   0.00000000000000000000000000000001E-6143   -> #00004000000000000000000000000001      Subnormal\r
+decq082 apply   #00004000000000000000000000000001          -> 1E-6175                Subnormal\r
+decq083 apply   0.000000000000000000000000000000001E-6143  -> #00000000000000000000000000000001      Subnormal\r
+decq084 apply   #00000000000000000000000000000001          -> 1E-6176                 Subnormal\r
+\r
+-- underflows cannot be tested for simple copies, check edge cases\r
+decq090 apply   1e-6176                  -> #00000000000000000000000000000001  Subnormal\r
+decq100 apply   999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff  Subnormal\r
+\r
+-- same again, negatives\r
+-- Nmax and similar\r
+decq122 apply  -9.999999999999999999999999999999999E+6144  -> #f7ffcff3fcff3fcff3fcff3fcff3fcff\r
+decq123 apply   #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144\r
+decq124 apply  -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534\r
+decq125 apply   #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144\r
+-- fold-downs (more below)\r
+decq130 apply  -1.23E+6144    -> #c7ffd300000000000000000000000000 Clamped\r
+decq131 apply   #c7ffd300000000000000000000000000       -> -1.230000000000000000000000000000000E+6144\r
+decq132 apply  -1E+6144       -> #c7ffc000000000000000000000000000 Clamped\r
+decq133 apply   #c7ffc000000000000000000000000000       -> -1.000000000000000000000000000000000E+6144\r
+\r
+decq151 apply  -12345                   -> #a20800000000000000000000000049c5\r
+decq152 apply   #a20800000000000000000000000049c5       -> -12345\r
+decq153 apply  -1234                    -> #a2080000000000000000000000000534\r
+decq154 apply   #a2080000000000000000000000000534       -> -1234\r
+decq155 apply  -123                     -> #a20800000000000000000000000000a3\r
+decq156 apply   #a20800000000000000000000000000a3       -> -123\r
+decq157 apply  -12                      -> #a2080000000000000000000000000012\r
+decq158 apply   #a2080000000000000000000000000012       -> -12\r
+decq159 apply  -1                       -> #a2080000000000000000000000000001\r
+decq160 apply   #a2080000000000000000000000000001       -> -1\r
+decq161 apply  -1.23                    -> #a20780000000000000000000000000a3\r
+decq162 apply   #a20780000000000000000000000000a3       -> -1.23\r
+decq163 apply  -123.45                  -> #a20780000000000000000000000049c5\r
+decq164 apply   #a20780000000000000000000000049c5       -> -123.45\r
+\r
+-- Nmin and below\r
+decq171 apply  -1E-6143                                    -> #80084000000000000000000000000001\r
+decq172 apply   #80084000000000000000000000000001          -> -1E-6143\r
+decq173 apply  -1.000000000000000000000000000000000E-6143  -> #84000000000000000000000000000000\r
+decq174 apply   #84000000000000000000000000000000          -> -1.000000000000000000000000000000000E-6143\r
+decq175 apply  -1.000000000000000000000000000000001E-6143  -> #84000000000000000000000000000001\r
+decq176 apply   #84000000000000000000000000000001          -> -1.000000000000000000000000000000001E-6143\r
+\r
+decq177 apply  -0.100000000000000000000000000000000E-6143  -> #80000800000000000000000000000000      Subnormal\r
+decq178 apply   #80000800000000000000000000000000          -> -1.00000000000000000000000000000000E-6144  Subnormal\r
+decq179 apply  -0.000000000000000000000000000000010E-6143  -> #80000000000000000000000000000010      Subnormal\r
+decq180 apply   #80000000000000000000000000000010          -> -1.0E-6175              Subnormal\r
+decq181 apply  -0.00000000000000000000000000000001E-6143   -> #80004000000000000000000000000001      Subnormal\r
+decq182 apply   #80004000000000000000000000000001          -> -1E-6175                Subnormal\r
+decq183 apply  -0.000000000000000000000000000000001E-6143  -> #80000000000000000000000000000001      Subnormal\r
+decq184 apply   #80000000000000000000000000000001          -> -1E-6176                 Subnormal\r
+\r
+-- underflow edge cases\r
+decq190 apply   -1e-6176                  -> #80000000000000000000000000000001  Subnormal\r
+decq200 apply   -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff  Subnormal\r
+\r
+-- zeros\r
+decq400 apply   0E-8000                 -> #00000000000000000000000000000000  Clamped\r
+decq401 apply   0E-6177                 -> #00000000000000000000000000000000  Clamped\r
+decq402 apply   0E-6176                 -> #00000000000000000000000000000000\r
+decq403 apply   #00000000000000000000000000000000       -> 0E-6176\r
+decq404 apply   0.000000000000000000000000000000000E-6143  -> #00000000000000000000000000000000\r
+decq405 apply   #00000000000000000000000000000000       -> 0E-6176\r
+decq406 apply   0E-2                    -> #22078000000000000000000000000000\r
+decq407 apply   #22078000000000000000000000000000       -> 0.00\r
+decq408 apply   0                       -> #22080000000000000000000000000000\r
+decq409 apply   #22080000000000000000000000000000       -> 0\r
+decq410 apply   0E+3                    -> #2208c000000000000000000000000000\r
+decq411 apply   #2208c000000000000000000000000000       -> 0E+3\r
+decq412 apply   0E+6111                 -> #43ffc000000000000000000000000000\r
+decq413 apply   #43ffc000000000000000000000000000       -> 0E+6111\r
+-- clamped zeros...\r
+decq414 apply   0E+6112                 -> #43ffc000000000000000000000000000  Clamped\r
+decq415 apply   #43ffc000000000000000000000000000       -> 0E+6111\r
+decq416 apply   0E+6144                 -> #43ffc000000000000000000000000000  Clamped\r
+decq417 apply   #43ffc000000000000000000000000000       -> 0E+6111\r
+decq418 apply   0E+8000                 -> #43ffc000000000000000000000000000  Clamped\r
+decq419 apply   #43ffc000000000000000000000000000       -> 0E+6111\r
+\r
+-- negative zeros\r
+decq420 apply  -0E-8000                 -> #80000000000000000000000000000000  Clamped\r
+decq421 apply  -0E-6177                 -> #80000000000000000000000000000000  Clamped\r
+decq422 apply  -0E-6176                 -> #80000000000000000000000000000000\r
+decq423 apply   #80000000000000000000000000000000       -> -0E-6176\r
+decq424 apply  -0.000000000000000000000000000000000E-6143  -> #80000000000000000000000000000000\r
+decq425 apply   #80000000000000000000000000000000       -> -0E-6176\r
+decq426 apply  -0E-2                    -> #a2078000000000000000000000000000\r
+decq427 apply   #a2078000000000000000000000000000       -> -0.00\r
+decq428 apply  -0                       -> #a2080000000000000000000000000000\r
+decq429 apply   #a2080000000000000000000000000000       -> -0\r
+decq430 apply  -0E+3                    -> #a208c000000000000000000000000000\r
+decq431 apply   #a208c000000000000000000000000000       -> -0E+3\r
+decq432 apply  -0E+6111                 -> #c3ffc000000000000000000000000000\r
+decq433 apply   #c3ffc000000000000000000000000000       -> -0E+6111\r
+-- clamped zeros...\r
+decq434 apply  -0E+6112                 -> #c3ffc000000000000000000000000000  Clamped\r
+decq435 apply   #c3ffc000000000000000000000000000       -> -0E+6111\r
+decq436 apply  -0E+6144                 -> #c3ffc000000000000000000000000000  Clamped\r
+decq437 apply   #c3ffc000000000000000000000000000       -> -0E+6111\r
+decq438 apply  -0E+8000                 -> #c3ffc000000000000000000000000000  Clamped\r
+decq439 apply   #c3ffc000000000000000000000000000       -> -0E+6111\r
+\r
+-- exponent lengths\r
+decq440 apply   #22080000000000000000000000000007       -> 7\r
+decq441 apply   7 -> #22080000000000000000000000000007\r
+decq442 apply   #220a4000000000000000000000000007       -> 7E+9\r
+decq443 apply   7E+9 -> #220a4000000000000000000000000007\r
+decq444 apply   #2220c000000000000000000000000007       -> 7E+99\r
+decq445 apply   7E+99 -> #2220c000000000000000000000000007\r
+decq446 apply   #2301c000000000000000000000000007       -> 7E+999\r
+decq447 apply   7E+999 -> #2301c000000000000000000000000007\r
+decq448 apply   #43e3c000000000000000000000000007       -> 7E+5999\r
+decq449 apply   7E+5999 -> #43e3c000000000000000000000000007\r
+\r
+-- Specials\r
+decq500 apply   Infinity                          -> #78000000000000000000000000000000\r
+decq501 apply   #78787878787878787878787878787878 -> #78000000000000000000000000000000\r
+decq502 apply   #78000000000000000000000000000000 -> Infinity\r
+decq503 apply   #79797979797979797979797979797979 -> #78000000000000000000000000000000\r
+decq504 apply   #79000000000000000000000000000000 -> Infinity\r
+decq505 apply   #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000\r
+decq506 apply   #7a000000000000000000000000000000 -> Infinity\r
+decq507 apply   #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000\r
+decq508 apply   #7b000000000000000000000000000000 -> Infinity\r
+\r
+decq509 apply   NaN                               -> #7c000000000000000000000000000000\r
+decq510 apply   #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c\r
+decq511 apply   #7c000000000000000000000000000000 -> NaN\r
+decq512 apply   #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d\r
+decq513 apply   #7d000000000000000000000000000000 -> NaN\r
+decq514 apply   #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e\r
+decq515 apply   #7e000000000000000000000000000000 -> sNaN\r
+decq516 apply   #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f\r
+decq517 apply   #7f000000000000000000000000000000 -> sNaN\r
+decq518 apply   #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999\r
+decq519 apply   #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff\r
+\r
+decq520 apply   -Infinity                         -> #f8000000000000000000000000000000\r
+decq521 apply   #f8787878787878787878787878787878 -> #f8000000000000000000000000000000\r
+decq522 apply   #f8000000000000000000000000000000 -> -Infinity\r
+decq523 apply   #f9797979797979797979797979797979 -> #f8000000000000000000000000000000\r
+decq524 apply   #f9000000000000000000000000000000 -> -Infinity\r
+decq525 apply   #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000\r
+decq526 apply   #fa000000000000000000000000000000 -> -Infinity\r
+decq527 apply   #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000\r
+decq528 apply   #fb000000000000000000000000000000 -> -Infinity\r
+\r
+decq529 apply   -NaN                              -> #fc000000000000000000000000000000\r
+decq530 apply   #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c\r
+decq531 apply   #fc000000000000000000000000000000 -> -NaN\r
+decq532 apply   #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d\r
+decq533 apply   #fd000000000000000000000000000000 -> -NaN\r
+decq534 apply   #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e\r
+decq535 apply   #fe000000000000000000000000000000 -> -sNaN\r
+decq536 apply   #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f\r
+decq537 apply   #ff000000000000000000000000000000 -> -sNaN\r
+decq538 apply   #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999\r
+decq539 apply   #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff\r
+\r
+decq540 apply   NaN               -> #7c000000000000000000000000000000\r
+decq541 apply   NaN0              -> #7c000000000000000000000000000000\r
+decq542 apply   NaN1              -> #7c000000000000000000000000000001\r
+decq543 apply   NaN12             -> #7c000000000000000000000000000012\r
+decq544 apply   NaN79             -> #7c000000000000000000000000000079\r
+decq545 apply   NaN12345          -> #7c0000000000000000000000000049c5\r
+decq546 apply   NaN123456         -> #7c000000000000000000000000028e56\r
+decq547 apply   NaN799799         -> #7c0000000000000000000000000f7fdf\r
+decq548 apply   NaN799799799799799799799799799799799  -> #7c003dff7fdff7fdff7fdff7fdff7fdf\r
+decq549 apply   NaN999999999999999999999999999999999  -> #7c000ff3fcff3fcff3fcff3fcff3fcff\r
+decq550 apply     9999999999999999999999999999999999  -> #6e080ff3fcff3fcff3fcff3fcff3fcff\r
+\r
+-- fold-down full sequence\r
+decq601 apply   1E+6144                 -> #47ffc000000000000000000000000000 Clamped\r
+decq602 apply   #47ffc000000000000000000000000000       -> 1.000000000000000000000000000000000E+6144\r
+decq603 apply   1E+6143                 -> #43ffc800000000000000000000000000 Clamped\r
+decq604 apply   #43ffc800000000000000000000000000       -> 1.00000000000000000000000000000000E+6143\r
+decq605 apply   1E+6142                 -> #43ffc100000000000000000000000000 Clamped\r
+decq606 apply   #43ffc100000000000000000000000000       -> 1.0000000000000000000000000000000E+6142\r
+decq607 apply   1E+6141                 -> #43ffc010000000000000000000000000 Clamped\r
+decq608 apply   #43ffc010000000000000000000000000       -> 1.000000000000000000000000000000E+6141\r
+decq609 apply   1E+6140                 -> #43ffc002000000000000000000000000 Clamped\r
+decq610 apply   #43ffc002000000000000000000000000       -> 1.00000000000000000000000000000E+6140\r
+decq611 apply   1E+6139                 -> #43ffc000400000000000000000000000 Clamped\r
+decq612 apply   #43ffc000400000000000000000000000       -> 1.0000000000000000000000000000E+6139\r
+decq613 apply   1E+6138                 -> #43ffc000040000000000000000000000 Clamped\r
+decq614 apply   #43ffc000040000000000000000000000       -> 1.000000000000000000000000000E+6138\r
+decq615 apply   1E+6137                 -> #43ffc000008000000000000000000000 Clamped\r
+decq616 apply   #43ffc000008000000000000000000000       -> 1.00000000000000000000000000E+6137\r
+decq617 apply   1E+6136                 -> #43ffc000001000000000000000000000 Clamped\r
+decq618 apply   #43ffc000001000000000000000000000       -> 1.0000000000000000000000000E+6136\r
+decq619 apply   1E+6135                 -> #43ffc000000100000000000000000000 Clamped\r
+decq620 apply   #43ffc000000100000000000000000000       -> 1.000000000000000000000000E+6135\r
+decq621 apply   1E+6134                 -> #43ffc000000020000000000000000000 Clamped\r
+decq622 apply   #43ffc000000020000000000000000000       -> 1.00000000000000000000000E+6134\r
+decq623 apply   1E+6133                 -> #43ffc000000004000000000000000000 Clamped\r
+decq624 apply   #43ffc000000004000000000000000000       -> 1.0000000000000000000000E+6133\r
+decq625 apply   1E+6132                 -> #43ffc000000000400000000000000000 Clamped\r
+decq626 apply   #43ffc000000000400000000000000000       -> 1.000000000000000000000E+6132\r
+decq627 apply   1E+6131                 -> #43ffc000000000080000000000000000 Clamped\r
+decq628 apply   #43ffc000000000080000000000000000       -> 1.00000000000000000000E+6131\r
+decq629 apply   1E+6130                 -> #43ffc000000000010000000000000000 Clamped\r
+decq630 apply   #43ffc000000000010000000000000000       -> 1.0000000000000000000E+6130\r
+decq631 apply   1E+6129                 -> #43ffc000000000001000000000000000 Clamped\r
+decq632 apply   #43ffc000000000001000000000000000       -> 1.000000000000000000E+6129\r
+decq633 apply   1E+6128                 -> #43ffc000000000000200000000000000 Clamped\r
+decq634 apply   #43ffc000000000000200000000000000       -> 1.00000000000000000E+6128\r
+decq635 apply   1E+6127                 -> #43ffc000000000000040000000000000 Clamped\r
+decq636 apply   #43ffc000000000000040000000000000       -> 1.0000000000000000E+6127\r
+decq637 apply   1E+6126                 -> #43ffc000000000000004000000000000 Clamped\r
+decq638 apply   #43ffc000000000000004000000000000       -> 1.000000000000000E+6126\r
+decq639 apply   1E+6125                 -> #43ffc000000000000000800000000000 Clamped\r
+decq640 apply   #43ffc000000000000000800000000000       -> 1.00000000000000E+6125\r
+decq641 apply   1E+6124                 -> #43ffc000000000000000100000000000 Clamped\r
+decq642 apply   #43ffc000000000000000100000000000       -> 1.0000000000000E+6124\r
+decq643 apply   1E+6123                 -> #43ffc000000000000000010000000000 Clamped\r
+decq644 apply   #43ffc000000000000000010000000000       -> 1.000000000000E+6123\r
+decq645 apply   1E+6122                 -> #43ffc000000000000000002000000000 Clamped\r
+decq646 apply   #43ffc000000000000000002000000000       -> 1.00000000000E+6122\r
+decq647 apply   1E+6121                 -> #43ffc000000000000000000400000000 Clamped\r
+decq648 apply   #43ffc000000000000000000400000000       -> 1.0000000000E+6121\r
+decq649 apply   1E+6120                 -> #43ffc000000000000000000040000000 Clamped\r
+decq650 apply   #43ffc000000000000000000040000000       -> 1.000000000E+6120\r
+decq651 apply   1E+6119                 -> #43ffc000000000000000000008000000 Clamped\r
+decq652 apply   #43ffc000000000000000000008000000       -> 1.00000000E+6119\r
+decq653 apply   1E+6118                 -> #43ffc000000000000000000001000000 Clamped\r
+decq654 apply   #43ffc000000000000000000001000000       -> 1.0000000E+6118\r
+decq655 apply   1E+6117                 -> #43ffc000000000000000000000100000 Clamped\r
+decq656 apply   #43ffc000000000000000000000100000       -> 1.000000E+6117\r
+decq657 apply   1E+6116                 -> #43ffc000000000000000000000020000 Clamped\r
+decq658 apply   #43ffc000000000000000000000020000       -> 1.00000E+6116\r
+decq659 apply   1E+6115                 -> #43ffc000000000000000000000004000 Clamped\r
+decq660 apply   #43ffc000000000000000000000004000       -> 1.0000E+6115\r
+decq661 apply   1E+6114                 -> #43ffc000000000000000000000000400 Clamped\r
+decq662 apply   #43ffc000000000000000000000000400       -> 1.000E+6114\r
+decq663 apply   1E+6113                 -> #43ffc000000000000000000000000080 Clamped\r
+decq664 apply   #43ffc000000000000000000000000080       -> 1.00E+6113\r
+decq665 apply   1E+6112                 -> #43ffc000000000000000000000000010 Clamped\r
+decq666 apply   #43ffc000000000000000000000000010       -> 1.0E+6112\r
+decq667 apply   1E+6111                 -> #43ffc000000000000000000000000001\r
+decq668 apply   #43ffc000000000000000000000000001       -> 1E+6111\r
+decq669 apply   1E+6110                 -> #43ff8000000000000000000000000001\r
+decq670 apply   #43ff8000000000000000000000000001       -> 1E+6110\r
+\r
+-- Selected DPD codes\r
+decq700 apply   #22080000000000000000000000000000       -> 0\r
+decq701 apply   #22080000000000000000000000000009       -> 9\r
+decq702 apply   #22080000000000000000000000000010       -> 10\r
+decq703 apply   #22080000000000000000000000000019       -> 19\r
+decq704 apply   #22080000000000000000000000000020       -> 20\r
+decq705 apply   #22080000000000000000000000000029       -> 29\r
+decq706 apply   #22080000000000000000000000000030       -> 30\r
+decq707 apply   #22080000000000000000000000000039       -> 39\r
+decq708 apply   #22080000000000000000000000000040       -> 40\r
+decq709 apply   #22080000000000000000000000000049       -> 49\r
+decq710 apply   #22080000000000000000000000000050       -> 50\r
+decq711 apply   #22080000000000000000000000000059       -> 59\r
+decq712 apply   #22080000000000000000000000000060       -> 60\r
+decq713 apply   #22080000000000000000000000000069       -> 69\r
+decq714 apply   #22080000000000000000000000000070       -> 70\r
+decq715 apply   #22080000000000000000000000000071       -> 71\r
+decq716 apply   #22080000000000000000000000000072       -> 72\r
+decq717 apply   #22080000000000000000000000000073       -> 73\r
+decq718 apply   #22080000000000000000000000000074       -> 74\r
+decq719 apply   #22080000000000000000000000000075       -> 75\r
+decq720 apply   #22080000000000000000000000000076       -> 76\r
+decq721 apply   #22080000000000000000000000000077       -> 77\r
+decq722 apply   #22080000000000000000000000000078       -> 78\r
+decq723 apply   #22080000000000000000000000000079       -> 79\r
+\r
+decq730 apply   #2208000000000000000000000000029e       -> 994\r
+decq731 apply   #2208000000000000000000000000029f       -> 995\r
+decq732 apply   #220800000000000000000000000002a0       -> 520\r
+decq733 apply   #220800000000000000000000000002a1       -> 521\r
+\r
+-- DPD: one of each of the huffman groups\r
+decq740 apply   #220800000000000000000000000003f7       -> 777\r
+decq741 apply   #220800000000000000000000000003f8       -> 778\r
+decq742 apply   #220800000000000000000000000003eb       -> 787\r
+decq743 apply   #2208000000000000000000000000037d       -> 877\r
+decq744 apply   #2208000000000000000000000000039f       -> 997\r
+decq745 apply   #220800000000000000000000000003bf       -> 979\r
+decq746 apply   #220800000000000000000000000003df       -> 799\r
+decq747 apply   #2208000000000000000000000000006e       -> 888\r
+\r
+\r
+-- DPD all-highs cases (includes the 24 redundant codes)\r
+decq750 apply   #2208000000000000000000000000006e       -> 888\r
+decq751 apply   #2208000000000000000000000000016e       -> 888\r
+decq752 apply   #2208000000000000000000000000026e       -> 888\r
+decq753 apply   #2208000000000000000000000000036e       -> 888\r
+decq754 apply   #2208000000000000000000000000006f       -> 889\r
+decq755 apply   #2208000000000000000000000000016f       -> 889\r
+decq756 apply   #2208000000000000000000000000026f       -> 889\r
+decq757 apply   #2208000000000000000000000000036f       -> 889\r
+\r
+decq760 apply   #2208000000000000000000000000007e       -> 898\r
+decq761 apply   #2208000000000000000000000000017e       -> 898\r
+decq762 apply   #2208000000000000000000000000027e       -> 898\r
+decq763 apply   #2208000000000000000000000000037e       -> 898\r
+decq764 apply   #2208000000000000000000000000007f       -> 899\r
+decq765 apply   #2208000000000000000000000000017f       -> 899\r
+decq766 apply   #2208000000000000000000000000027f       -> 899\r
+decq767 apply   #2208000000000000000000000000037f       -> 899\r
+\r
+decq770 apply   #220800000000000000000000000000ee       -> 988\r
+decq771 apply   #220800000000000000000000000001ee       -> 988\r
+decq772 apply   #220800000000000000000000000002ee       -> 988\r
+decq773 apply   #220800000000000000000000000003ee       -> 988\r
+decq774 apply   #220800000000000000000000000000ef       -> 989\r
+decq775 apply   #220800000000000000000000000001ef       -> 989\r
+decq776 apply   #220800000000000000000000000002ef       -> 989\r
+decq777 apply   #220800000000000000000000000003ef       -> 989\r
+\r
+decq780 apply   #220800000000000000000000000000fe       -> 998\r
+decq781 apply   #220800000000000000000000000001fe       -> 998\r
+decq782 apply   #220800000000000000000000000002fe       -> 998\r
+decq783 apply   #220800000000000000000000000003fe       -> 998\r
+decq784 apply   #220800000000000000000000000000ff       -> 999\r
+decq785 apply   #220800000000000000000000000001ff       -> 999\r
+decq786 apply   #220800000000000000000000000002ff       -> 999\r
+decq787 apply   #220800000000000000000000000003ff       -> 999\r
+\r
+-- Miscellaneous (testers' queries, etc.)\r
+\r
+decq790 apply   #2208000000000000000000000000c000       -> 30000\r
+decq791 apply   #22080000000000000000000000007800       -> 890000\r
+decq792 apply   30000 -> #2208000000000000000000000000c000\r
+decq793 apply   890000 -> #22080000000000000000000000007800\r
+\r
+-- values around [u]int32 edges (zeros done earlier)\r
+decq800 apply -2147483646  -> #a208000000000000000000008c78af46\r
+decq801 apply -2147483647  -> #a208000000000000000000008c78af47\r
+decq802 apply -2147483648  -> #a208000000000000000000008c78af48\r
+decq803 apply -2147483649  -> #a208000000000000000000008c78af49\r
+decq804 apply  2147483646  -> #2208000000000000000000008c78af46\r
+decq805 apply  2147483647  -> #2208000000000000000000008c78af47\r
+decq806 apply  2147483648  -> #2208000000000000000000008c78af48\r
+decq807 apply  2147483649  -> #2208000000000000000000008c78af49\r
+decq808 apply  4294967294  -> #22080000000000000000000115afb55a\r
+decq809 apply  4294967295  -> #22080000000000000000000115afb55b\r
+decq810 apply  4294967296  -> #22080000000000000000000115afb57a\r
+decq811 apply  4294967297  -> #22080000000000000000000115afb57b\r
+\r
+decq820 apply  #a208000000000000000000008c78af46 -> -2147483646\r
+decq821 apply  #a208000000000000000000008c78af47 -> -2147483647\r
+decq822 apply  #a208000000000000000000008c78af48 -> -2147483648\r
+decq823 apply  #a208000000000000000000008c78af49 -> -2147483649\r
+decq824 apply  #2208000000000000000000008c78af46 ->  2147483646\r
+decq825 apply  #2208000000000000000000008c78af47 ->  2147483647\r
+decq826 apply  #2208000000000000000000008c78af48 ->  2147483648\r
+decq827 apply  #2208000000000000000000008c78af49 ->  2147483649\r
+decq828 apply  #22080000000000000000000115afb55a ->  4294967294\r
+decq829 apply  #22080000000000000000000115afb55b ->  4294967295\r
+decq830 apply  #22080000000000000000000115afb57a ->  4294967296\r
+decq831 apply  #22080000000000000000000115afb57b ->  4294967297\r
diff --git a/Lib/test/decimaltestdata/dqFMA.decTest b/Lib/test/decimaltestdata/dqFMA.decTest
new file mode 100644 (file)
index 0000000..37d7749
--- /dev/null
@@ -0,0 +1,1761 @@
+------------------------------------------------------------------------\r
+-- dqFMA.decTest -- decQuad Fused Multiply Add                        --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- These tests comprese three parts:\r
+--   1. Sanity checks and other three-operand tests (especially those\r
+--      where the fused operation makes a difference)\r
+--   2. Multiply tests (third operand is neutral zero [0E+emax])\r
+--   3. Addition tests (first operand is 1)\r
+-- The multiply and addition tests are extensive because FMA may have\r
+-- its own dedicated multiplication or addition routine(s), and they\r
+-- also inherently check the left-to-right properties.\r
+\r
+-- Sanity checks\r
+dqfma0001 fma  1   1   1 ->   2\r
+dqfma0002 fma  1   1   2 ->   3\r
+dqfma0003 fma  2   2   3 ->   7\r
+dqfma0004 fma  9   9   9 ->  90\r
+dqfma0005 fma -1   1   1 ->   0\r
+dqfma0006 fma -1   1   2 ->   1\r
+dqfma0007 fma -2   2   3 ->  -1\r
+dqfma0008 fma -9   9   9 -> -72\r
+dqfma0011 fma  1  -1   1 ->   0\r
+dqfma0012 fma  1  -1   2 ->   1\r
+dqfma0013 fma  2  -2   3 ->  -1\r
+dqfma0014 fma  9  -9   9 -> -72\r
+dqfma0015 fma  1   1  -1 ->   0\r
+dqfma0016 fma  1   1  -2 ->  -1\r
+dqfma0017 fma  2   2  -3 ->   1\r
+dqfma0018 fma  9   9  -9 ->  72\r
+\r
+-- non-integer exacts\r
+dqfma0100  fma    25.2   63.6   -438  ->  1164.72\r
+dqfma0101  fma   0.301  0.380    334  ->  334.114380\r
+dqfma0102  fma    49.2   -4.8   23.3  ->  -212.86\r
+dqfma0103  fma    4.22  0.079  -94.6  ->  -94.26662\r
+dqfma0104  fma     903  0.797  0.887  ->  720.578\r
+dqfma0105  fma    6.13   -161   65.9  ->  -921.03\r
+dqfma0106  fma    28.2    727   5.45  ->  20506.85\r
+dqfma0107  fma       4    605    688  ->  3108\r
+dqfma0108  fma    93.3   0.19  0.226  ->  17.953\r
+dqfma0109  fma   0.169   -341   5.61  ->  -52.019\r
+dqfma0110  fma   -72.2     30  -51.2  ->  -2217.2\r
+dqfma0111  fma  -0.409     13   20.4  ->  15.083\r
+dqfma0112  fma     317   77.0   19.0  ->  24428.0\r
+dqfma0113  fma      47   6.58   1.62  ->  310.88\r
+dqfma0114  fma    1.36  0.984  0.493  ->  1.83124\r
+dqfma0115  fma    72.7    274   1.56  ->  19921.36\r
+dqfma0116  fma     335    847     83  ->  283828\r
+dqfma0117  fma     666  0.247   25.4  ->  189.902\r
+dqfma0118  fma   -3.87   3.06   78.0  ->  66.1578\r
+dqfma0119  fma   0.742    192   35.6  ->  178.064\r
+dqfma0120  fma   -91.6   5.29  0.153  ->  -484.411\r
+\r
+-- cases where result is different from separate multiply + add; each\r
+-- is preceded by the result of unfused multiply and add\r
+-- [this is about 20% of all similar  cases in general]\r
+--                                                                                                            ->  4.500119002100000209469729375698778E+38\r
+dqfma0202  fma       68537985861355864457.5694      6565875762972086605.85969       35892634447236753.172812  ->  4.500119002100000209469729375698779E+38 Inexact Rounded\r
+--                                                                                                            ->  5.996248469584594346858881620185514E+41\r
+dqfma0208  fma          89261822344727628571.9      6717595845654131383336.89      5061036497288796076266.11  ->  5.996248469584594346858881620185513E+41 Inexact Rounded\r
+--                                                                                                            ->  1.899242968678256924021594770874070E+34\r
+dqfma0210  fma       320506237232448685.495971       59257597764017967.984448      3205615239077711589912.85  ->  1.899242968678256924021594770874071E+34 Inexact Rounded\r
+--                                                                                                            ->  7.078596978842809537929699954860309E+37\r
+dqfma0215  fma        220247843259112263.17995       321392340287987979002.80        47533279819997167655440  ->  7.078596978842809537929699954860308E+37 Inexact Rounded\r
+--                                                                                                            ->  1.224955667581427559754106862350743E+37\r
+dqfma0226  fma       23880729790368880412.1449       512947333827064719.55407      217117438419590824502.963  ->  1.224955667581427559754106862350744E+37 Inexact Rounded\r
+--                                                                                                            ->  -2.530094043253148806272276368579144E+42\r
+dqfma0229  fma        2539892357016099706.4126      -996142232667504817717435       53682082598315949425.937  ->  -2.530094043253148806272276368579143E+42 Inexact Rounded\r
+--                                                                                                            ->  1.713387085759711954319391412788454E+37\r
+dqfma0233  fma        4546339491341624464.0804            3768717864169205581       83578980278690395184.620  ->  1.713387085759711954319391412788453E+37 Inexact Rounded\r
+--                                                                                                            ->  4.062275663405823716411579117771547E+35\r
+dqfma0235  fma        409242119433816131.42253      992633815166741501.477249        70179636544416756129546  ->  4.062275663405823716411579117771548E+35 Inexact Rounded\r
+--                                                                                                            ->  6.002604327732568490562249875306823E+47\r
+dqfma0258  fma        817941336593541742159684       733867339769310729266598      78563844650942419311830.8  ->  6.002604327732568490562249875306822E+47 Inexact Rounded\r
+--                                                                                                            ->  -2.027022514381452197510103395283874E+39\r
+dqfma0264  fma       387617310169161270.737532     -5229442703414956061216.62      57665666816652967150473.5  ->  -2.027022514381452197510103395283873E+39 Inexact Rounded\r
+--                                                                                                            ->  -7.856525039803554001144089842730361E+37\r
+dqfma0267  fma      -847655845720565274701.210        92685316564117739.83984      22780950041376424429.5686  ->  -7.856525039803554001144089842730360E+37 Inexact Rounded\r
+--                                                                                                            ->  1.695515562011520746125607502237559E+38\r
+dqfma0268  fma          21590290365127685.3675       7853139227576541379426.8       -3275859437236180.761544  ->  1.695515562011520746125607502237558E+38 Inexact Rounded\r
+--                                                                                                            ->  -8.448422935783289219748115038014710E+38\r
+dqfma0269  fma      -974320636272862697.971586      867109103641860247440.756        -9775170775902454762.98  ->  -8.448422935783289219748115038014709E+38 Inexact Rounded\r
+\r
+-- Cases where multiply would overflow or underflow if separate\r
+dqfma0300  fma   9e+6144    10   0         -> Infinity  Overflow Inexact Rounded\r
+dqfma0301  fma   1e+6144    10   0         -> Infinity  Overflow Inexact Rounded\r
+dqfma0302  fma   1e+6144    10   -1e+6144  -> 9.000000000000000000000000000000000E+6144 Clamped\r
+dqfma0303  fma   1e+6144    10   -9e+6144  -> 1.000000000000000000000000000000000E+6144 Clamped\r
+-- subnormal etc.\r
+dqfma0305  fma   1e-6176    0.1  0         -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma0306  fma   1e-6176    0.1  1         -> 1.000000000000000000000000000000000 Inexact Rounded\r
+dqfma0307  fma   1e-6176    0.1  1e-6176   -> 1E-6176 Underflow Subnormal Inexact Rounded\r
+\r
+-- Infinite combinations\r
+dqfma0800 fma  Inf   Inf   Inf    ->  Infinity\r
+dqfma0801 fma  Inf   Inf  -Inf    ->  NaN Invalid_operation\r
+dqfma0802 fma  Inf  -Inf   Inf    ->  NaN Invalid_operation\r
+dqfma0803 fma  Inf  -Inf  -Inf    -> -Infinity\r
+dqfma0804 fma -Inf   Inf   Inf    ->  NaN Invalid_operation\r
+dqfma0805 fma -Inf   Inf  -Inf    -> -Infinity\r
+dqfma0806 fma -Inf  -Inf   Inf    ->  Infinity\r
+dqfma0807 fma -Inf  -Inf  -Inf    ->  NaN Invalid_operation\r
+\r
+-- Triple NaN propagation\r
+dqfma0900 fma  NaN2  NaN3  NaN5   ->  NaN2\r
+dqfma0901 fma  0     NaN3  NaN5   ->  NaN3\r
+dqfma0902 fma  0     0     NaN5   ->  NaN5\r
+-- first sNaN wins (consider qNaN from earlier sNaN being\r
+-- overridden by an sNaN in third operand)\r
+dqfma0903 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+dqfma0904 fma  0     sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+dqfma0905 fma  0     0     sNaN3  ->  NaN3 Invalid_operation\r
+dqfma0906 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+dqfma0907 fma  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+dqfma0908 fma  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation\r
+\r
+-- MULTIPLICATION TESTS ------------------------------------------------\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqfma2000 fma  2      2   0e+6144  -> 4\r
+dqfma2001 fma  2      3   0e+6144  -> 6\r
+dqfma2002 fma  5      1   0e+6144  -> 5\r
+dqfma2003 fma  5      2   0e+6144  -> 10\r
+dqfma2004 fma  1.20   2   0e+6144  -> 2.40\r
+dqfma2005 fma  1.20   0   0e+6144  -> 0.00\r
+dqfma2006 fma  1.20  -2   0e+6144  -> -2.40\r
+dqfma2007 fma  -1.20  2   0e+6144  -> -2.40\r
+dqfma2008 fma  -1.20  0   0e+6144  -> 0.00\r
+dqfma2009 fma  -1.20 -2   0e+6144  -> 2.40\r
+dqfma2010 fma  5.09 7.1   0e+6144  -> 36.139\r
+dqfma2011 fma  2.5    4   0e+6144  -> 10.0\r
+dqfma2012 fma  2.50   4   0e+6144  -> 10.00\r
+dqfma2013 fma  1.23456789 1.0000000000000000000000000000   0e+6144  -> 1.234567890000000000000000000000000 Rounded\r
+dqfma2015 fma  2.50   4   0e+6144  -> 10.00\r
+dqfma2016 fma   9.99999999999999999  9.99999999999999999   0e+6144  ->  99.99999999999999980000000000000000 Inexact Rounded\r
+dqfma2017 fma   9.99999999999999999 -9.99999999999999999   0e+6144  -> -99.99999999999999980000000000000000 Inexact Rounded\r
+dqfma2018 fma  -9.99999999999999999  9.99999999999999999   0e+6144  -> -99.99999999999999980000000000000000 Inexact Rounded\r
+dqfma2019 fma  -9.99999999999999999 -9.99999999999999999   0e+6144  ->  99.99999999999999980000000000000000 Inexact Rounded\r
+\r
+-- zeros, etc.\r
+dqfma2021 fma   0      0       0e+6144  ->  0\r
+dqfma2022 fma   0     -0       0e+6144  ->  0\r
+dqfma2023 fma  -0      0       0e+6144  ->  0\r
+dqfma2024 fma  -0     -0       0e+6144  ->  0\r
+dqfma2025 fma  -0.0   -0.0     0e+6144  ->  0.00\r
+dqfma2026 fma  -0.0   -0.0     0e+6144  ->  0.00\r
+dqfma2027 fma  -0.0   -0.0     0e+6144  ->  0.00\r
+dqfma2028 fma  -0.0   -0.0     0e+6144  ->  0.00\r
+dqfma2030 fma   5.00   1E-3    0e+6144  ->  0.00500\r
+dqfma2031 fma   00.00  0.000   0e+6144  ->  0.00000\r
+dqfma2032 fma   00.00  0E-3    0e+6144  ->  0.00000     -- rhs is 0\r
+dqfma2033 fma   0E-3   00.00   0e+6144  ->  0.00000     -- lhs is 0\r
+dqfma2034 fma  -5.00   1E-3    0e+6144  -> -0.00500\r
+dqfma2035 fma  -00.00  0.000   0e+6144  ->  0.00000\r
+dqfma2036 fma  -00.00  0E-3    0e+6144  ->  0.00000     -- rhs is 0\r
+dqfma2037 fma  -0E-3   00.00   0e+6144  ->  0.00000     -- lhs is 0\r
+dqfma2038 fma   5.00  -1E-3    0e+6144  -> -0.00500\r
+dqfma2039 fma   00.00 -0.000   0e+6144  ->  0.00000\r
+dqfma2040 fma   00.00 -0E-3    0e+6144  ->  0.00000     -- rhs is 0\r
+dqfma2041 fma   0E-3  -00.00   0e+6144  ->  0.00000     -- lhs is 0\r
+dqfma2042 fma  -5.00  -1E-3    0e+6144  ->  0.00500\r
+dqfma2043 fma  -00.00 -0.000   0e+6144  ->  0.00000\r
+dqfma2044 fma  -00.00 -0E-3    0e+6144  ->  0.00000     -- rhs is 0\r
+dqfma2045 fma  -0E-3  -00.00   0e+6144  ->  0.00000     -- lhs is 0\r
+\r
+-- examples from decarith\r
+dqfma2050 fma  1.20 3          0e+6144  -> 3.60\r
+dqfma2051 fma  7    3          0e+6144  -> 21\r
+dqfma2052 fma  0.9  0.8        0e+6144  -> 0.72\r
+dqfma2053 fma  0.9  -0         0e+6144  -> 0.0\r
+dqfma2054 fma  654321 654321   0e+6144  -> 428135971041\r
+\r
+dqfma2060 fma  123.45 1e7    0e+6144  ->  1.2345E+9\r
+dqfma2061 fma  123.45 1e8    0e+6144  ->  1.2345E+10\r
+dqfma2062 fma  123.45 1e+9   0e+6144  ->  1.2345E+11\r
+dqfma2063 fma  123.45 1e10   0e+6144  ->  1.2345E+12\r
+dqfma2064 fma  123.45 1e11   0e+6144  ->  1.2345E+13\r
+dqfma2065 fma  123.45 1e12   0e+6144  ->  1.2345E+14\r
+dqfma2066 fma  123.45 1e13   0e+6144  ->  1.2345E+15\r
+\r
+\r
+-- test some intermediate lengths\r
+--                    1234567890123456\r
+dqfma2080 fma  0.1 1230123456456789       0e+6144  -> 123012345645678.9\r
+dqfma2084 fma  0.1 1230123456456789       0e+6144  -> 123012345645678.9\r
+dqfma2090 fma  1230123456456789     0.1   0e+6144  -> 123012345645678.9\r
+dqfma2094 fma  1230123456456789     0.1   0e+6144  -> 123012345645678.9\r
+\r
+-- test some more edge cases and carries\r
+dqfma2101 fma  9 9     0e+6144  -> 81\r
+dqfma2102 fma  9 90     0e+6144  -> 810\r
+dqfma2103 fma  9 900     0e+6144  -> 8100\r
+dqfma2104 fma  9 9000     0e+6144  -> 81000\r
+dqfma2105 fma  9 90000     0e+6144  -> 810000\r
+dqfma2106 fma  9 900000     0e+6144  -> 8100000\r
+dqfma2107 fma  9 9000000     0e+6144  -> 81000000\r
+dqfma2108 fma  9 90000000     0e+6144  -> 810000000\r
+dqfma2109 fma  9 900000000     0e+6144  -> 8100000000\r
+dqfma2110 fma  9 9000000000     0e+6144  -> 81000000000\r
+dqfma2111 fma  9 90000000000     0e+6144  -> 810000000000\r
+dqfma2112 fma  9 900000000000     0e+6144  -> 8100000000000\r
+dqfma2113 fma  9 9000000000000     0e+6144  -> 81000000000000\r
+dqfma2114 fma  9 90000000000000     0e+6144  -> 810000000000000\r
+dqfma2115 fma  9 900000000000000     0e+6144  -> 8100000000000000\r
+--dqfma2116 fma  9 9000000000000000     0e+6144  -> 81000000000000000\r
+--dqfma2117 fma  9 90000000000000000     0e+6144  -> 810000000000000000\r
+--dqfma2118 fma  9 900000000000000000     0e+6144  -> 8100000000000000000\r
+--dqfma2119 fma  9 9000000000000000000     0e+6144  -> 81000000000000000000\r
+--dqfma2120 fma  9 90000000000000000000     0e+6144  -> 810000000000000000000\r
+--dqfma2121 fma  9 900000000000000000000     0e+6144  -> 8100000000000000000000\r
+--dqfma2122 fma  9 9000000000000000000000     0e+6144  -> 81000000000000000000000\r
+--dqfma2123 fma  9 90000000000000000000000     0e+6144  -> 810000000000000000000000\r
+-- test some more edge cases without carries\r
+dqfma2131 fma  3 3     0e+6144  -> 9\r
+dqfma2132 fma  3 30     0e+6144  -> 90\r
+dqfma2133 fma  3 300     0e+6144  -> 900\r
+dqfma2134 fma  3 3000     0e+6144  -> 9000\r
+dqfma2135 fma  3 30000     0e+6144  -> 90000\r
+dqfma2136 fma  3 300000     0e+6144  -> 900000\r
+dqfma2137 fma  3 3000000     0e+6144  -> 9000000\r
+dqfma2138 fma  3 30000000     0e+6144  -> 90000000\r
+dqfma2139 fma  3 300000000     0e+6144  -> 900000000\r
+dqfma2140 fma  3 3000000000     0e+6144  -> 9000000000\r
+dqfma2141 fma  3 30000000000     0e+6144  -> 90000000000\r
+dqfma2142 fma  3 300000000000     0e+6144  -> 900000000000\r
+dqfma2143 fma  3 3000000000000     0e+6144  -> 9000000000000\r
+dqfma2144 fma  3 30000000000000     0e+6144  -> 90000000000000\r
+dqfma2145 fma  3 300000000000000     0e+6144  -> 900000000000000\r
+dqfma2146 fma  3 3000000000000000     0e+6144  -> 9000000000000000\r
+dqfma2147 fma  3 30000000000000000     0e+6144  -> 90000000000000000\r
+dqfma2148 fma  3 300000000000000000     0e+6144  -> 900000000000000000\r
+dqfma2149 fma  3 3000000000000000000     0e+6144  -> 9000000000000000000\r
+dqfma2150 fma  3 30000000000000000000     0e+6144  -> 90000000000000000000\r
+dqfma2151 fma  3 300000000000000000000     0e+6144  -> 900000000000000000000\r
+dqfma2152 fma  3 3000000000000000000000     0e+6144  -> 9000000000000000000000\r
+dqfma2153 fma  3 30000000000000000000000     0e+6144  -> 90000000000000000000000\r
+\r
+dqfma2263 fma  30269.587755640502150977251770554 4.8046009735990873395936309640543   0e+6144  -> 145433.2908011933696719165119928296 Inexact Rounded\r
+\r
+-- test some edge cases with exact rounding\r
+dqfma2301 fma  900000000000000000 9     0e+6144  -> 8100000000000000000\r
+dqfma2302 fma  900000000000000000 90     0e+6144  -> 81000000000000000000\r
+dqfma2303 fma  900000000000000000 900     0e+6144  -> 810000000000000000000\r
+dqfma2304 fma  900000000000000000 9000     0e+6144  -> 8100000000000000000000\r
+dqfma2305 fma  900000000000000000 90000     0e+6144  -> 81000000000000000000000\r
+dqfma2306 fma  900000000000000000 900000     0e+6144  -> 810000000000000000000000\r
+dqfma2307 fma  900000000000000000 9000000     0e+6144  -> 8100000000000000000000000\r
+dqfma2308 fma  900000000000000000 90000000     0e+6144  -> 81000000000000000000000000\r
+dqfma2309 fma  900000000000000000 900000000     0e+6144  -> 810000000000000000000000000\r
+dqfma2310 fma  900000000000000000 9000000000     0e+6144  -> 8100000000000000000000000000\r
+dqfma2311 fma  900000000000000000 90000000000     0e+6144  -> 81000000000000000000000000000\r
+dqfma2312 fma  900000000000000000 900000000000     0e+6144  -> 810000000000000000000000000000\r
+dqfma2313 fma  900000000000000000 9000000000000     0e+6144  -> 8100000000000000000000000000000\r
+dqfma2314 fma  900000000000000000 90000000000000     0e+6144  -> 81000000000000000000000000000000\r
+dqfma2315 fma  900000000000000000 900000000000000     0e+6144  -> 810000000000000000000000000000000\r
+dqfma2316 fma  900000000000000000 9000000000000000     0e+6144  -> 8100000000000000000000000000000000\r
+dqfma2317 fma  9000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+34  Rounded\r
+dqfma2318 fma  90000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+35  Rounded\r
+dqfma2319 fma  900000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+36  Rounded\r
+dqfma2320 fma  9000000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+37  Rounded\r
+dqfma2321 fma  90000000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+38  Rounded\r
+dqfma2322 fma  900000000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+39  Rounded\r
+dqfma2323 fma  9000000000000000000000000 9000000000000000     0e+6144  -> 8.100000000000000000000000000000000E+40  Rounded\r
+\r
+-- tryzeros cases\r
+dqfma2504  fma   0E-4260 1000E-4260    0e+6144  -> 0E-6176 Clamped\r
+dqfma2505  fma   100E+4260 0E+4260     0e+6144  -> 0E+6111 Clamped\r
+\r
+-- mixed with zeros\r
+dqfma2541 fma   0    -1       0e+6144  ->  0\r
+dqfma2542 fma  -0    -1       0e+6144  ->  0\r
+dqfma2543 fma   0     1       0e+6144  ->  0\r
+dqfma2544 fma  -0     1       0e+6144  ->  0\r
+dqfma2545 fma  -1     0       0e+6144  ->  0\r
+dqfma2546 fma  -1    -0       0e+6144  ->  0\r
+dqfma2547 fma   1     0       0e+6144  ->  0\r
+dqfma2548 fma   1    -0       0e+6144  ->  0\r
+\r
+dqfma2551 fma   0.0  -1       0e+6144  ->  0.0\r
+dqfma2552 fma  -0.0  -1       0e+6144  ->  0.0\r
+dqfma2553 fma   0.0   1       0e+6144  ->  0.0\r
+dqfma2554 fma  -0.0   1       0e+6144  ->  0.0\r
+dqfma2555 fma  -1.0   0       0e+6144  ->  0.0\r
+dqfma2556 fma  -1.0  -0       0e+6144  ->  0.0\r
+dqfma2557 fma   1.0   0       0e+6144  ->  0.0\r
+dqfma2558 fma   1.0  -0       0e+6144  ->  0.0\r
+\r
+dqfma2561 fma   0    -1.0     0e+6144  ->  0.0\r
+dqfma2562 fma  -0    -1.0     0e+6144  ->  0.0\r
+dqfma2563 fma   0     1.0     0e+6144  ->  0.0\r
+dqfma2564 fma  -0     1.0     0e+6144  ->  0.0\r
+dqfma2565 fma  -1     0.0     0e+6144  ->  0.0\r
+dqfma2566 fma  -1    -0.0     0e+6144  ->  0.0\r
+dqfma2567 fma   1     0.0     0e+6144  ->  0.0\r
+dqfma2568 fma   1    -0.0     0e+6144  ->  0.0\r
+\r
+dqfma2571 fma   0.0  -1.0     0e+6144  ->  0.00\r
+dqfma2572 fma  -0.0  -1.0     0e+6144  ->  0.00\r
+dqfma2573 fma   0.0   1.0     0e+6144  ->  0.00\r
+dqfma2574 fma  -0.0   1.0     0e+6144  ->  0.00\r
+dqfma2575 fma  -1.0   0.0     0e+6144  ->  0.00\r
+dqfma2576 fma  -1.0  -0.0     0e+6144  ->  0.00\r
+dqfma2577 fma   1.0   0.0     0e+6144  ->  0.00\r
+dqfma2578 fma   1.0  -0.0     0e+6144  ->  0.00\r
+dqfma2579 fma   1.0   0.0     0e+6144  ->  0.00\r
+dqfma2530 fma  -1.0  -0.0     0e+6144  ->  0.00\r
+dqfma2531 fma  -1.0   0.0     0e+6144  ->  0.00\r
+dqfma2532 fma   1.0  -0.0    -0e+6144  -> -0.00\r
+dqfma2533 fma   1.0   0.0    -0e+6144  ->  0.00\r
+dqfma2534 fma  -1.0  -0.0    -0e+6144  ->  0.00\r
+dqfma2535 fma  -1.0   0.0    -0e+6144  -> -0.00\r
+\r
+\r
+-- Specials\r
+dqfma2580 fma   Inf  -Inf     0e+6144  -> -Infinity\r
+dqfma2581 fma   Inf  -1000    0e+6144  -> -Infinity\r
+dqfma2582 fma   Inf  -1       0e+6144  -> -Infinity\r
+dqfma2583 fma   Inf  -0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2584 fma   Inf   0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2585 fma   Inf   1       0e+6144  ->  Infinity\r
+dqfma2586 fma   Inf   1000    0e+6144  ->  Infinity\r
+dqfma2587 fma   Inf   Inf     0e+6144  ->  Infinity\r
+dqfma2588 fma  -1000  Inf     0e+6144  -> -Infinity\r
+dqfma2589 fma  -Inf   Inf     0e+6144  -> -Infinity\r
+dqfma2590 fma  -1     Inf     0e+6144  -> -Infinity\r
+dqfma2591 fma  -0     Inf     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2592 fma   0     Inf     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2593 fma   1     Inf     0e+6144  ->  Infinity\r
+dqfma2594 fma   1000  Inf     0e+6144  ->  Infinity\r
+dqfma2595 fma   Inf   Inf     0e+6144  ->  Infinity\r
+\r
+dqfma2600 fma  -Inf  -Inf     0e+6144  ->  Infinity\r
+dqfma2601 fma  -Inf  -1000    0e+6144  ->  Infinity\r
+dqfma2602 fma  -Inf  -1       0e+6144  ->  Infinity\r
+dqfma2603 fma  -Inf  -0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2604 fma  -Inf   0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2605 fma  -Inf   1       0e+6144  -> -Infinity\r
+dqfma2606 fma  -Inf   1000    0e+6144  -> -Infinity\r
+dqfma2607 fma  -Inf   Inf     0e+6144  -> -Infinity\r
+dqfma2608 fma  -1000  Inf     0e+6144  -> -Infinity\r
+dqfma2609 fma  -Inf  -Inf     0e+6144  ->  Infinity\r
+dqfma2610 fma  -1    -Inf     0e+6144  ->  Infinity\r
+dqfma2611 fma  -0    -Inf     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2612 fma   0    -Inf     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2613 fma   1    -Inf     0e+6144  -> -Infinity\r
+dqfma2614 fma   1000 -Inf     0e+6144  -> -Infinity\r
+dqfma2615 fma   Inf  -Inf     0e+6144  -> -Infinity\r
+\r
+dqfma2621 fma   NaN -Inf      0e+6144  ->  NaN\r
+dqfma2622 fma   NaN -1000     0e+6144  ->  NaN\r
+dqfma2623 fma   NaN -1        0e+6144  ->  NaN\r
+dqfma2624 fma   NaN -0        0e+6144  ->  NaN\r
+dqfma2625 fma   NaN  0        0e+6144  ->  NaN\r
+dqfma2626 fma   NaN  1        0e+6144  ->  NaN\r
+dqfma2627 fma   NaN  1000     0e+6144  ->  NaN\r
+dqfma2628 fma   NaN  Inf      0e+6144  ->  NaN\r
+dqfma2629 fma   NaN  NaN      0e+6144  ->  NaN\r
+dqfma2630 fma  -Inf  NaN      0e+6144  ->  NaN\r
+dqfma2631 fma  -1000 NaN      0e+6144  ->  NaN\r
+dqfma2632 fma  -1    NaN      0e+6144  ->  NaN\r
+dqfma2633 fma  -0    NaN      0e+6144  ->  NaN\r
+dqfma2634 fma   0    NaN      0e+6144  ->  NaN\r
+dqfma2635 fma   1    NaN      0e+6144  ->  NaN\r
+dqfma2636 fma   1000 NaN      0e+6144  ->  NaN\r
+dqfma2637 fma   Inf  NaN      0e+6144  ->  NaN\r
+\r
+dqfma2641 fma   sNaN -Inf     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2642 fma   sNaN -1000    0e+6144  ->  NaN  Invalid_operation\r
+dqfma2643 fma   sNaN -1       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2644 fma   sNaN -0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2645 fma   sNaN  0       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2646 fma   sNaN  1       0e+6144  ->  NaN  Invalid_operation\r
+dqfma2647 fma   sNaN  1000    0e+6144  ->  NaN  Invalid_operation\r
+dqfma2648 fma   sNaN  NaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2649 fma   sNaN sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2650 fma   NaN  sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2651 fma  -Inf  sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2652 fma  -1000 sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2653 fma  -1    sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2654 fma  -0    sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2655 fma   0    sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2656 fma   1    sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2657 fma   1000 sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2658 fma   Inf  sNaN     0e+6144  ->  NaN  Invalid_operation\r
+dqfma2659 fma   NaN  sNaN     0e+6144  ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqfma2661 fma   NaN9 -Inf     0e+6144  ->  NaN9\r
+dqfma2662 fma   NaN8  999     0e+6144  ->  NaN8\r
+dqfma2663 fma   NaN71 Inf     0e+6144  ->  NaN71\r
+dqfma2664 fma   NaN6  NaN5    0e+6144  ->  NaN6\r
+dqfma2665 fma  -Inf   NaN4    0e+6144  ->  NaN4\r
+dqfma2666 fma  -999   NaN33   0e+6144  ->  NaN33\r
+dqfma2667 fma   Inf   NaN2    0e+6144  ->  NaN2\r
+\r
+dqfma2671 fma   sNaN99 -Inf      0e+6144  ->  NaN99 Invalid_operation\r
+dqfma2672 fma   sNaN98 -11       0e+6144  ->  NaN98 Invalid_operation\r
+dqfma2673 fma   sNaN97  NaN      0e+6144  ->  NaN97 Invalid_operation\r
+dqfma2674 fma   sNaN16 sNaN94    0e+6144  ->  NaN16 Invalid_operation\r
+dqfma2675 fma   NaN95  sNaN93    0e+6144  ->  NaN93 Invalid_operation\r
+dqfma2676 fma  -Inf    sNaN92    0e+6144  ->  NaN92 Invalid_operation\r
+dqfma2677 fma   088    sNaN91    0e+6144  ->  NaN91 Invalid_operation\r
+dqfma2678 fma   Inf    sNaN90    0e+6144  ->  NaN90 Invalid_operation\r
+dqfma2679 fma   NaN    sNaN89    0e+6144  ->  NaN89 Invalid_operation\r
+\r
+dqfma2681 fma  -NaN9 -Inf     0e+6144  -> -NaN9\r
+dqfma2682 fma  -NaN8  999     0e+6144  -> -NaN8\r
+dqfma2683 fma  -NaN71 Inf     0e+6144  -> -NaN71\r
+dqfma2684 fma  -NaN6 -NaN5    0e+6144  -> -NaN6\r
+dqfma2685 fma  -Inf  -NaN4    0e+6144  -> -NaN4\r
+dqfma2686 fma  -999  -NaN33   0e+6144  -> -NaN33\r
+dqfma2687 fma   Inf  -NaN2    0e+6144  -> -NaN2\r
+\r
+dqfma2691 fma  -sNaN99 -Inf      0e+6144  -> -NaN99 Invalid_operation\r
+dqfma2692 fma  -sNaN98 -11       0e+6144  -> -NaN98 Invalid_operation\r
+dqfma2693 fma  -sNaN97  NaN      0e+6144  -> -NaN97 Invalid_operation\r
+dqfma2694 fma  -sNaN16 -sNaN94   0e+6144  -> -NaN16 Invalid_operation\r
+dqfma2695 fma  -NaN95  -sNaN93   0e+6144  -> -NaN93 Invalid_operation\r
+dqfma2696 fma  -Inf    -sNaN92   0e+6144  -> -NaN92 Invalid_operation\r
+dqfma2697 fma   088    -sNaN91   0e+6144  -> -NaN91 Invalid_operation\r
+dqfma2698 fma   Inf    -sNaN90   0e+6144  -> -NaN90 Invalid_operation\r
+dqfma2699 fma  -NaN    -sNaN89   0e+6144  -> -NaN89 Invalid_operation\r
+\r
+dqfma2701 fma  -NaN  -Inf     0e+6144  -> -NaN\r
+dqfma2702 fma  -NaN   999     0e+6144  -> -NaN\r
+dqfma2703 fma  -NaN   Inf     0e+6144  -> -NaN\r
+dqfma2704 fma  -NaN  -NaN     0e+6144  -> -NaN\r
+dqfma2705 fma  -Inf  -NaN0    0e+6144  -> -NaN\r
+dqfma2706 fma  -999  -NaN     0e+6144  -> -NaN\r
+dqfma2707 fma   Inf  -NaN     0e+6144  -> -NaN\r
+\r
+dqfma2711 fma  -sNaN   -Inf      0e+6144  -> -NaN Invalid_operation\r
+dqfma2712 fma  -sNaN   -11       0e+6144  -> -NaN Invalid_operation\r
+dqfma2713 fma  -sNaN00  NaN      0e+6144  -> -NaN Invalid_operation\r
+dqfma2714 fma  -sNaN   -sNaN     0e+6144  -> -NaN Invalid_operation\r
+dqfma2715 fma  -NaN    -sNaN     0e+6144  -> -NaN Invalid_operation\r
+dqfma2716 fma  -Inf    -sNaN     0e+6144  -> -NaN Invalid_operation\r
+dqfma2717 fma   088    -sNaN     0e+6144  -> -NaN Invalid_operation\r
+dqfma2718 fma   Inf    -sNaN     0e+6144  -> -NaN Invalid_operation\r
+dqfma2719 fma  -NaN    -sNaN     0e+6144  -> -NaN Invalid_operation\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+dqfma2751 fma   1e+4277  1e+3311   0e+6144  ->  Infinity Overflow Inexact Rounded\r
+dqfma2752 fma   1e+4277 -1e+3311   0e+6144  -> -Infinity Overflow Inexact Rounded\r
+dqfma2753 fma  -1e+4277  1e+3311   0e+6144  -> -Infinity Overflow Inexact Rounded\r
+dqfma2754 fma  -1e+4277 -1e+3311   0e+6144  ->  Infinity Overflow Inexact Rounded\r
+dqfma2755 fma   1e-4277  1e-3311   0e+6144  ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2756 fma   1e-4277 -1e-3311   0e+6144  -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2757 fma  -1e-4277  1e-3311   0e+6144  -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2758 fma  -1e-4277 -1e-3311   0e+6144  ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dqfma2760 fma  1e-6069 1e-101   0e+6144  -> 1E-6170 Subnormal\r
+dqfma2761 fma  1e-6069 1e-102   0e+6144  -> 1E-6171 Subnormal\r
+dqfma2762 fma  1e-6069 1e-103   0e+6144  -> 1E-6172 Subnormal\r
+dqfma2763 fma  1e-6069 1e-104   0e+6144  -> 1E-6173 Subnormal\r
+dqfma2764 fma  1e-6069 1e-105   0e+6144  -> 1E-6174 Subnormal\r
+dqfma2765 fma  1e-6069 1e-106   0e+6144  -> 1E-6175 Subnormal\r
+dqfma2766 fma  1e-6069 1e-107   0e+6144  -> 1E-6176 Subnormal\r
+dqfma2767 fma  1e-6069 1e-108   0e+6144  -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2768 fma  1e-6069 1e-109   0e+6144  -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2769 fma  1e-6069 1e-110   0e+6144  -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+dqfma2770 fma  1e+40 1e+6101   0e+6144  -> 1.000000000000000000000000000000E+6141 Clamped\r
+dqfma2771 fma  1e+40 1e+6102   0e+6144  -> 1.0000000000000000000000000000000E+6142  Clamped\r
+dqfma2772 fma  1e+40 1e+6103   0e+6144  -> 1.00000000000000000000000000000000E+6143  Clamped\r
+dqfma2773 fma  1e+40 1e+6104   0e+6144  -> 1.000000000000000000000000000000000E+6144  Clamped\r
+dqfma2774 fma  1e+40 1e+6105   0e+6144  -> Infinity Overflow Inexact Rounded\r
+dqfma2775 fma  1e+40 1e+6106   0e+6144  -> Infinity Overflow Inexact Rounded\r
+dqfma2776 fma  1e+40 1e+6107   0e+6144  -> Infinity Overflow Inexact Rounded\r
+dqfma2777 fma  1e+40 1e+6108   0e+6144  -> Infinity Overflow Inexact Rounded\r
+dqfma2778 fma  1e+40 1e+6109   0e+6144  -> Infinity Overflow Inexact Rounded\r
+dqfma2779 fma  1e+40 1e+6110   0e+6144  -> Infinity Overflow Inexact Rounded\r
+\r
+dqfma2801 fma   1.0000E-6172  1       0e+6144  -> 1.0000E-6172 Subnormal\r
+dqfma2802 fma   1.000E-6172   1e-1    0e+6144  -> 1.000E-6173  Subnormal\r
+dqfma2803 fma   1.00E-6172    1e-2    0e+6144  -> 1.00E-6174   Subnormal\r
+dqfma2804 fma   1.0E-6172     1e-3    0e+6144  -> 1.0E-6175    Subnormal\r
+dqfma2805 fma   1.0E-6172     1e-4    0e+6144  -> 1E-6176     Subnormal Rounded\r
+dqfma2806 fma   1.3E-6172     1e-4    0e+6144  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2807 fma   1.5E-6172     1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2808 fma   1.7E-6172     1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2809 fma   2.3E-6172     1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2810 fma   2.5E-6172     1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2811 fma   2.7E-6172     1e-4    0e+6144  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2812 fma   1.49E-6172    1e-4    0e+6144  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2813 fma   1.50E-6172    1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2814 fma   1.51E-6172    1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2815 fma   2.49E-6172    1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2816 fma   2.50E-6172    1e-4    0e+6144  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2817 fma   2.51E-6172    1e-4    0e+6144  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqfma2818 fma   1E-6172       1e-4    0e+6144  -> 1E-6176     Subnormal\r
+dqfma2819 fma   3E-6172       1e-5    0e+6144  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2820 fma   5E-6172       1e-5    0e+6144  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2821 fma   7E-6172       1e-5    0e+6144  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2822 fma   9E-6172       1e-5    0e+6144  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqfma2823 fma   9.9E-6172     1e-5    0e+6144  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqfma2824 fma   1E-6172      -1e-4    0e+6144  -> -1E-6176    Subnormal\r
+dqfma2825 fma   3E-6172      -1e-5    0e+6144  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2826 fma  -5E-6172       1e-5    0e+6144  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2827 fma   7E-6172      -1e-5    0e+6144  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqfma2828 fma  -9E-6172       1e-5    0e+6144  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqfma2829 fma   9.9E-6172    -1e-5    0e+6144  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqfma2830 fma   3.0E-6172    -1e-5    0e+6144  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dqfma2831 fma   1.0E-5977     1e-200   0e+6144  -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqfma2832 fma   1.0E-5977     1e-199   0e+6144  -> 1E-6176    Subnormal Rounded\r
+dqfma2833 fma   1.0E-5977     1e-198   0e+6144  -> 1.0E-6175    Subnormal\r
+dqfma2834 fma   2.0E-5977     2e-198   0e+6144  -> 4.0E-6175    Subnormal\r
+dqfma2835 fma   4.0E-5977     4e-198   0e+6144  -> 1.60E-6174   Subnormal\r
+dqfma2836 fma  10.0E-5977    10e-198   0e+6144  -> 1.000E-6173  Subnormal\r
+dqfma2837 fma  30.0E-5977    30e-198   0e+6144  -> 9.000E-6173  Subnormal\r
+dqfma2838 fma  40.0E-5982    40e-166   0e+6144  -> 1.6000E-6145 Subnormal\r
+dqfma2839 fma  40.0E-5982    40e-165   0e+6144  -> 1.6000E-6144 Subnormal\r
+dqfma2840 fma  40.0E-5982    40e-164   0e+6144  -> 1.6000E-6143\r
+\r
+-- Long operand overflow may be a different path\r
+dqfma2870 fma  100  9.999E+6143       0e+6144  ->  Infinity Inexact Overflow Rounded\r
+dqfma2871 fma  100 -9.999E+6143       0e+6144  -> -Infinity Inexact Overflow Rounded\r
+dqfma2872 fma       9.999E+6143 100   0e+6144  ->  Infinity Inexact Overflow Rounded\r
+dqfma2873 fma      -9.999E+6143 100   0e+6144  -> -Infinity Inexact Overflow Rounded\r
+\r
+-- check for double-rounded subnormals\r
+dqfma2881 fma   1.2347E-6133 1.2347E-40    0e+6144  ->  1.524E-6173 Inexact Rounded Subnormal Underflow\r
+dqfma2882 fma   1.234E-6133 1.234E-40      0e+6144  ->  1.523E-6173 Inexact Rounded Subnormal Underflow\r
+dqfma2883 fma   1.23E-6133  1.23E-40       0e+6144  ->  1.513E-6173 Inexact Rounded Subnormal Underflow\r
+dqfma2884 fma   1.2E-6133   1.2E-40        0e+6144  ->  1.44E-6173  Subnormal\r
+dqfma2885 fma   1.2E-6133   1.2E-41        0e+6144  ->  1.44E-6174  Subnormal\r
+dqfma2886 fma   1.2E-6133   1.2E-42        0e+6144  ->  1.4E-6175   Subnormal Inexact Rounded Underflow\r
+dqfma2887 fma   1.2E-6133   1.3E-42        0e+6144  ->  1.6E-6175   Subnormal Inexact Rounded Underflow\r
+dqfma2888 fma   1.3E-6133   1.3E-42        0e+6144  ->  1.7E-6175   Subnormal Inexact Rounded Underflow\r
+dqfma2889 fma   1.3E-6133   1.3E-43        0e+6144  ->    2E-6176   Subnormal Inexact Rounded Underflow\r
+dqfma2890 fma   1.3E-6134   1.3E-43        0e+6144  ->    0E-6176   Clamped Subnormal Inexact Rounded Underflow\r
+\r
+dqfma2891 fma   1.2345E-39    1.234E-6133   0e+6144  ->  1.5234E-6172 Inexact Rounded Subnormal Underflow\r
+dqfma2892 fma   1.23456E-39   1.234E-6133   0e+6144  ->  1.5234E-6172 Inexact Rounded Subnormal Underflow\r
+dqfma2893 fma   1.2345E-40   1.234E-6133   0e+6144  ->  1.523E-6173  Inexact Rounded Subnormal Underflow\r
+dqfma2894 fma   1.23456E-40  1.234E-6133   0e+6144  ->  1.523E-6173  Inexact Rounded Subnormal Underflow\r
+dqfma2895 fma   1.2345E-41   1.234E-6133   0e+6144  ->  1.52E-6174   Inexact Rounded Subnormal Underflow\r
+dqfma2896 fma   1.23456E-41  1.234E-6133   0e+6144  ->  1.52E-6174   Inexact Rounded Subnormal Underflow\r
+\r
+-- Now explore the case where we get a normal result with Underflow\r
+-- prove operands are exact\r
+dqfma2906 fma   9.999999999999999999999999999999999E-6143  1                         0e+6144  -> 9.999999999999999999999999999999999E-6143\r
+dqfma2907 fma                        1  0.09999999999999999999999999999999999       0e+6144  -> 0.09999999999999999999999999999999999\r
+-- the next rounds to Nmin\r
+dqfma2908 fma   9.999999999999999999999999999999999E-6143  0.09999999999999999999999999999999999       0e+6144  -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded\r
+\r
+-- hugest\r
+dqfma2909 fma  9999999999999999999999999999999999 9999999999999999999999999999999999   0e+6144  -> 9.999999999999999999999999999999998E+67 Inexact Rounded\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+precision:   34\r
+rounding:    half_up\r
+maxExponent: 6144\r
+minExponent: -6143\r
+dqfma21001  fma  130E-2  120E-2   0e+6144  -> 1.5600\r
+dqfma21002  fma  130E-2  12E-1    0e+6144  -> 1.560\r
+dqfma21003  fma  130E-2  1E0      0e+6144  -> 1.30\r
+dqfma21004  fma  1E2     1E4      0e+6144  -> 1E+6\r
+\r
+-- Null tests\r
+dqfma2990 fma  10  #   0e+6144  -> NaN Invalid_operation\r
+dqfma2991 fma   # 10   0e+6144  -> NaN Invalid_operation\r
+\r
+\r
+-- ADDITION TESTS ------------------------------------------------------\r
+rounding:    half_even\r
+\r
+-- [first group are 'quick confidence check']\r
+dqadd3001 fma  1  1       1       ->  2\r
+dqadd3002 fma  1  2       3       ->  5\r
+dqadd3003 fma  1  '5.75'  '3.3'   ->  9.05\r
+dqadd3004 fma  1  '5'     '-3'    ->  2\r
+dqadd3005 fma  1  '-5'    '-3'    ->  -8\r
+dqadd3006 fma  1  '-7'    '2.5'   ->  -4.5\r
+dqadd3007 fma  1  '0.7'   '0.3'   ->  1.0\r
+dqadd3008 fma  1  '1.25'  '1.25'  ->  2.50\r
+dqadd3009 fma  1  '1.23456789'  '1.00000000' -> '2.23456789'\r
+dqadd3010 fma  1  '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+--             1234567890123456      1234567890123456\r
+dqadd3011 fma  1  '0.4444444444444444444444444444444446'  '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqadd3012 fma  1  '0.4444444444444444444444444444444445'  '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded\r
+dqadd3013 fma  1  '0.4444444444444444444444444444444444'  '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'\r
+dqadd3014 fma  1    '4444444444444444444444444444444444' '0.49'   -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd3015 fma  1    '4444444444444444444444444444444444' '0.499'  -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd3016 fma  1    '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd3017 fma  1    '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded\r
+dqadd3018 fma  1    '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded\r
+dqadd3019 fma  1    '4444444444444444444444444444444444' '0.501'  -> '4444444444444444444444444444444445' Inexact Rounded\r
+dqadd3020 fma  1    '4444444444444444444444444444444444' '0.51'   -> '4444444444444444444444444444444445' Inexact Rounded\r
+\r
+dqadd3021 fma  1  0 1 -> 1\r
+dqadd3022 fma  1  1 1 -> 2\r
+dqadd3023 fma  1  2 1 -> 3\r
+dqadd3024 fma  1  3 1 -> 4\r
+dqadd3025 fma  1  4 1 -> 5\r
+dqadd3026 fma  1  5 1 -> 6\r
+dqadd3027 fma  1  6 1 -> 7\r
+dqadd3028 fma  1  7 1 -> 8\r
+dqadd3029 fma  1  8 1 -> 9\r
+dqadd3030 fma  1  9 1 -> 10\r
+\r
+-- some carrying effects\r
+dqadd3031 fma  1  '0.9998'  '0.0000' -> '0.9998'\r
+dqadd3032 fma  1  '0.9998'  '0.0001' -> '0.9999'\r
+dqadd3033 fma  1  '0.9998'  '0.0002' -> '1.0000'\r
+dqadd3034 fma  1  '0.9998'  '0.0003' -> '1.0001'\r
+\r
+dqadd3035 fma  1  '70'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3036 fma  1  '700'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3037 fma  1  '7000'  '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3038 fma  1  '70000'  '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded\r
+dqadd3039 fma  1  '700000'  '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded\r
+\r
+-- symmetry:\r
+dqadd3040 fma  1  '10000e+34'  '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3041 fma  1  '10000e+34'  '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3042 fma  1  '10000e+34'  '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqadd3044 fma  1  '10000e+34'  '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded\r
+dqadd3045 fma  1  '10000e+34'  '700000' -> '1.000000000000000000000000000000007E+38' Rounded\r
+\r
+-- same, without rounding\r
+dqadd3046 fma  1  '10000e+9'  '7' -> '10000000000007'\r
+dqadd3047 fma  1  '10000e+9'  '70' -> '10000000000070'\r
+dqadd3048 fma  1  '10000e+9'  '700' -> '10000000000700'\r
+dqadd3049 fma  1  '10000e+9'  '7000' -> '10000000007000'\r
+dqadd3050 fma  1  '10000e+9'  '70000' -> '10000000070000'\r
+dqadd3051 fma  1  '10000e+9'  '700000' -> '10000000700000'\r
+dqadd3052 fma  1  '10000e+9'  '7000000' -> '10000007000000'\r
+\r
+-- examples from decarith\r
+dqadd3053 fma  1  '12' '7.00' -> '19.00'\r
+dqadd3054 fma  1  '1.3' '-1.07' -> '0.23'\r
+dqadd3055 fma  1  '1.3' '-1.30' -> '0.00'\r
+dqadd3056 fma  1  '1.3' '-2.07' -> '-0.77'\r
+dqadd3057 fma  1  '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- leading zero preservation\r
+dqadd3061 fma  1  1 '0.0001' -> '1.0001'\r
+dqadd3062 fma  1  1 '0.00001' -> '1.00001'\r
+dqadd3063 fma  1  1 '0.000001' -> '1.000001'\r
+dqadd3064 fma  1  1 '0.0000001' -> '1.0000001'\r
+dqadd3065 fma  1  1 '0.00000001' -> '1.00000001'\r
+\r
+-- some funny zeros [in case of bad signum]\r
+dqadd3070 fma  1  1  0    -> 1\r
+dqadd3071 fma  1  1 0.    -> 1\r
+dqadd3072 fma  1  1  .0   -> 1.0\r
+dqadd3073 fma  1  1 0.0   -> 1.0\r
+dqadd3074 fma  1  1 0.00  -> 1.00\r
+dqadd3075 fma  1   0  1   -> 1\r
+dqadd3076 fma  1  0.  1   -> 1\r
+dqadd3077 fma  1   .0 1   -> 1.0\r
+dqadd3078 fma  1  0.0 1   -> 1.0\r
+dqadd3079 fma  1  0.00 1  -> 1.00\r
+\r
+-- some carries\r
+dqadd3080 fma  1  999999998 1  -> 999999999\r
+dqadd3081 fma  1  999999999 1  -> 1000000000\r
+dqadd3082 fma  1   99999999 1  -> 100000000\r
+dqadd3083 fma  1    9999999 1  -> 10000000\r
+dqadd3084 fma  1     999999 1  -> 1000000\r
+dqadd3085 fma  1      99999 1  -> 100000\r
+dqadd3086 fma  1       9999 1  -> 10000\r
+dqadd3087 fma  1        999 1  -> 1000\r
+dqadd3088 fma  1         99 1  -> 100\r
+dqadd3089 fma  1          9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+dqadd3090 fma  1  '-56267E-10'   0 ->  '-0.0000056267'\r
+dqadd3091 fma  1  '-56267E-6'    0 ->  '-0.056267'\r
+dqadd3092 fma  1  '-56267E-5'    0 ->  '-0.56267'\r
+dqadd3093 fma  1  '-56267E-4'    0 ->  '-5.6267'\r
+dqadd3094 fma  1  '-56267E-3'    0 ->  '-56.267'\r
+dqadd3095 fma  1  '-56267E-2'    0 ->  '-562.67'\r
+dqadd3096 fma  1  '-56267E-1'    0 ->  '-5626.7'\r
+dqadd3097 fma  1  '-56267E-0'    0 ->  '-56267'\r
+dqadd3098 fma  1  '-5E-10'       0 ->  '-5E-10'\r
+dqadd3099 fma  1  '-5E-7'        0 ->  '-5E-7'\r
+dqadd3100 fma  1  '-5E-6'        0 ->  '-0.000005'\r
+dqadd3101 fma  1  '-5E-5'        0 ->  '-0.00005'\r
+dqadd3102 fma  1  '-5E-4'        0 ->  '-0.0005'\r
+dqadd3103 fma  1  '-5E-1'        0 ->  '-0.5'\r
+dqadd3104 fma  1  '-5E0'         0 ->  '-5'\r
+dqadd3105 fma  1  '-5E1'         0 ->  '-50'\r
+dqadd3106 fma  1  '-5E5'         0 ->  '-500000'\r
+dqadd3107 fma  1  '-5E33'        0 ->  '-5000000000000000000000000000000000'\r
+dqadd3108 fma  1  '-5E34'        0 ->  '-5.000000000000000000000000000000000E+34'  Rounded\r
+dqadd3109 fma  1  '-5E35'        0 ->  '-5.000000000000000000000000000000000E+35'  Rounded\r
+dqadd3110 fma  1  '-5E36'        0 ->  '-5.000000000000000000000000000000000E+36'  Rounded\r
+dqadd3111 fma  1  '-5E100'       0 ->  '-5.000000000000000000000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+dqadd3113 fma  1  0  '-56267E-10' ->  '-0.0000056267'\r
+dqadd3114 fma  1  0  '-56267E-6'  ->  '-0.056267'\r
+dqadd3116 fma  1  0  '-56267E-5'  ->  '-0.56267'\r
+dqadd3117 fma  1  0  '-56267E-4'  ->  '-5.6267'\r
+dqadd3119 fma  1  0  '-56267E-3'  ->  '-56.267'\r
+dqadd3120 fma  1  0  '-56267E-2'  ->  '-562.67'\r
+dqadd3121 fma  1  0  '-56267E-1'  ->  '-5626.7'\r
+dqadd3122 fma  1  0  '-56267E-0'  ->  '-56267'\r
+dqadd3123 fma  1  0  '-5E-10'     ->  '-5E-10'\r
+dqadd3124 fma  1  0  '-5E-7'      ->  '-5E-7'\r
+dqadd3125 fma  1  0  '-5E-6'      ->  '-0.000005'\r
+dqadd3126 fma  1  0  '-5E-5'      ->  '-0.00005'\r
+dqadd3127 fma  1  0  '-5E-4'      ->  '-0.0005'\r
+dqadd3128 fma  1  0  '-5E-1'      ->  '-0.5'\r
+dqadd3129 fma  1  0  '-5E0'       ->  '-5'\r
+dqadd3130 fma  1  0  '-5E1'       ->  '-50'\r
+dqadd3131 fma  1  0  '-5E5'       ->  '-500000'\r
+dqadd3132 fma  1  0  '-5E33'      ->  '-5000000000000000000000000000000000'\r
+dqadd3133 fma  1  0  '-5E34'      ->  '-5.000000000000000000000000000000000E+34'   Rounded\r
+dqadd3134 fma  1  0  '-5E35'      ->  '-5.000000000000000000000000000000000E+35'   Rounded\r
+dqadd3135 fma  1  0  '-5E36'      ->  '-5.000000000000000000000000000000000E+36'   Rounded\r
+dqadd3136 fma  1  0  '-5E100'     ->  '-5.000000000000000000000000000000000E+100'  Rounded\r
+\r
+-- related\r
+dqadd3137 fma  1   1  '0E-39'      ->  '1.000000000000000000000000000000000'  Rounded\r
+dqadd3138 fma  1  -1  '0E-39'      ->  '-1.000000000000000000000000000000000' Rounded\r
+dqadd3139 fma  1  '0E-39' 1        ->  '1.000000000000000000000000000000000'  Rounded\r
+dqadd3140 fma  1  '0E-39' -1       ->  '-1.000000000000000000000000000000000' Rounded\r
+dqadd3141 fma  1  1E+29   0.0000   ->  '100000000000000000000000000000.0000'\r
+dqadd3142 fma  1  1E+29   0.00000  ->  '100000000000000000000000000000.0000'  Rounded\r
+dqadd3143 fma  1  0.000   1E+30    ->  '1000000000000000000000000000000.000'\r
+dqadd3144 fma  1  0.0000  1E+30    ->  '1000000000000000000000000000000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+dqadd3146 fma  1  '00.0'  0       ->  '0.0'\r
+dqadd3147 fma  1  '0.00'  0       ->  '0.00'\r
+dqadd3148 fma  1   0      '0.00'  ->  '0.00'\r
+dqadd3149 fma  1   0      '00.0'  ->  '0.0'\r
+dqadd3150 fma  1  '00.0'  '0.00'  ->  '0.00'\r
+dqadd3151 fma  1  '0.00'  '00.0'  ->  '0.00'\r
+dqadd3152 fma  1  '3'     '.3'    ->  '3.3'\r
+dqadd3153 fma  1  '3.'    '.3'    ->  '3.3'\r
+dqadd3154 fma  1  '3.0'   '.3'    ->  '3.3'\r
+dqadd3155 fma  1  '3.00'  '.3'    ->  '3.30'\r
+dqadd3156 fma  1  '3'     '3'     ->  '6'\r
+dqadd3157 fma  1  '3'     '+3'    ->  '6'\r
+dqadd3158 fma  1  '3'     '-3'    ->  '0'\r
+dqadd3159 fma  1  '0.3'   '-0.3'  ->  '0.0'\r
+dqadd3160 fma  1  '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+dqadd3161 fma  1  '1E+12' '-1'    -> '999999999999'\r
+dqadd3162 fma  1  '1E+12'  '1.11' -> '1000000000001.11'\r
+dqadd3163 fma  1  '1.11'  '1E+12' -> '1000000000001.11'\r
+dqadd3164 fma  1  '-1'    '1E+12' -> '999999999999'\r
+dqadd3165 fma  1  '7E+12' '-1'    -> '6999999999999'\r
+dqadd3166 fma  1  '7E+12'  '1.11' -> '7000000000001.11'\r
+dqadd3167 fma  1  '1.11'  '7E+12' -> '7000000000001.11'\r
+dqadd3168 fma  1  '-1'    '7E+12' -> '6999999999999'\r
+\r
+rounding: half_up\r
+dqadd3170 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd3171 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd3172 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded\r
+dqadd3173 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded\r
+dqadd3174 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd3175 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd3176 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd3177 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded\r
+dqadd3178 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded\r
+dqadd3179 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd3180 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd3181 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd3182 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded\r
+dqadd3183 fma  1  '4.444444444444444444444444444444444'  '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+dqadd3200 fma  1  '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd3201 fma  1  '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3202 fma  1  '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3203 fma  1  '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3204 fma  1  '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3205 fma  1  '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3206 fma  1  '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3207 fma  1  '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3208 fma  1  '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3209 fma  1  '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3210 fma  1  '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3211 fma  1  '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3212 fma  1  '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3213 fma  1  '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3214 fma  1  '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3215 fma  1  '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3216 fma  1  '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd3217 fma  1  '1231234567890123456784560123456789' 1.000000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3218 fma  1  '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3219 fma  1  '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqadd3220 fma  1  '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd3221 fma  1  '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3222 fma  1  '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3223 fma  1  '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3224 fma  1  '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3225 fma  1  '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3226 fma  1  '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3227 fma  1  '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3228 fma  1  '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3229 fma  1  '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3230 fma  1  '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3231 fma  1  '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3232 fma  1  '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3233 fma  1  '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3234 fma  1  '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3235 fma  1  '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3236 fma  1  '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd3237 fma  1  '1231234567890123456784560123456789' 1.00000001    -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3238 fma  1  '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3239 fma  1  '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+dqadd3240 fma  1  '1231234567890123456784560123456788' 0.499999999   -> '1231234567890123456784560123456788' Inexact Rounded\r
+dqadd3241 fma  1  '1231234567890123456784560123456788' 0.5           -> '1231234567890123456784560123456788' Inexact Rounded\r
+dqadd3242 fma  1  '1231234567890123456784560123456788' 0.500000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+\r
+rounding: down\r
+dqadd3250 fma  1  '1231234567890123456784560123456789' 0             -> '1231234567890123456784560123456789'\r
+dqadd3251 fma  1  '1231234567890123456784560123456789' 0.000000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3252 fma  1  '1231234567890123456784560123456789' 0.000001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3253 fma  1  '1231234567890123456784560123456789' 0.1           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3254 fma  1  '1231234567890123456784560123456789' 0.4           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3255 fma  1  '1231234567890123456784560123456789' 0.49          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3256 fma  1  '1231234567890123456784560123456789' 0.499999      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3257 fma  1  '1231234567890123456784560123456789' 0.499999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3258 fma  1  '1231234567890123456784560123456789' 0.5           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3259 fma  1  '1231234567890123456784560123456789' 0.500000001   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3260 fma  1  '1231234567890123456784560123456789' 0.500001      -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3261 fma  1  '1231234567890123456784560123456789' 0.51          -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3262 fma  1  '1231234567890123456784560123456789' 0.6           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3263 fma  1  '1231234567890123456784560123456789' 0.9           -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3264 fma  1  '1231234567890123456784560123456789' 0.99999       -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3265 fma  1  '1231234567890123456784560123456789' 0.999999999   -> '1231234567890123456784560123456789' Inexact Rounded\r
+dqadd3266 fma  1  '1231234567890123456784560123456789' 1             -> '1231234567890123456784560123456790'\r
+dqadd3267 fma  1  '1231234567890123456784560123456789' 1.00000001    -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3268 fma  1  '1231234567890123456784560123456789' 1.00001       -> '1231234567890123456784560123456790' Inexact Rounded\r
+dqadd3269 fma  1  '1231234567890123456784560123456789' 1.1           -> '1231234567890123456784560123456790' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_up\r
+dqadd3301 fma  1   -1   1      ->   0\r
+dqadd3302 fma  1    0   1      ->   1\r
+dqadd3303 fma  1    1   1      ->   2\r
+dqadd3304 fma  1   12   1      ->  13\r
+dqadd3305 fma  1   98   1      ->  99\r
+dqadd3306 fma  1   99   1      -> 100\r
+dqadd3307 fma  1  100   1      -> 101\r
+dqadd3308 fma  1  101   1      -> 102\r
+dqadd3309 fma  1   -1  -1      ->  -2\r
+dqadd3310 fma  1    0  -1      ->  -1\r
+dqadd3311 fma  1    1  -1      ->   0\r
+dqadd3312 fma  1   12  -1      ->  11\r
+dqadd3313 fma  1   98  -1      ->  97\r
+dqadd3314 fma  1   99  -1      ->  98\r
+dqadd3315 fma  1  100  -1      ->  99\r
+dqadd3316 fma  1  101  -1      -> 100\r
+\r
+dqadd3321 fma  1  -0.01  0.01    ->  0.00\r
+dqadd3322 fma  1   0.00  0.01    ->  0.01\r
+dqadd3323 fma  1   0.01  0.01    ->  0.02\r
+dqadd3324 fma  1   0.12  0.01    ->  0.13\r
+dqadd3325 fma  1   0.98  0.01    ->  0.99\r
+dqadd3326 fma  1   0.99  0.01    ->  1.00\r
+dqadd3327 fma  1   1.00  0.01    ->  1.01\r
+dqadd3328 fma  1   1.01  0.01    ->  1.02\r
+dqadd3329 fma  1  -0.01 -0.01    -> -0.02\r
+dqadd3330 fma  1   0.00 -0.01    -> -0.01\r
+dqadd3331 fma  1   0.01 -0.01    ->  0.00\r
+dqadd3332 fma  1   0.12 -0.01    ->  0.11\r
+dqadd3333 fma  1   0.98 -0.01    ->  0.97\r
+dqadd3334 fma  1   0.99 -0.01    ->  0.98\r
+dqadd3335 fma  1   1.00 -0.01    ->  0.99\r
+dqadd3336 fma  1   1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where adding 0 affects the coefficient\r
+dqadd3340 fma  1  1E+3    0    ->         1000\r
+dqadd3341 fma  1  1E+33   0    ->    1000000000000000000000000000000000\r
+dqadd3342 fma  1  1E+34   0    ->   1.000000000000000000000000000000000E+34  Rounded\r
+dqadd3343 fma  1  1E+35   0    ->   1.000000000000000000000000000000000E+35  Rounded\r
+-- which simply follow from these cases ...\r
+dqadd3344 fma  1  1E+3    1    ->         1001\r
+dqadd3345 fma  1  1E+33   1    ->    1000000000000000000000000000000001\r
+dqadd3346 fma  1  1E+34   1    ->   1.000000000000000000000000000000000E+34  Inexact Rounded\r
+dqadd3347 fma  1  1E+35   1    ->   1.000000000000000000000000000000000E+35  Inexact Rounded\r
+dqadd3348 fma  1  1E+3    7    ->         1007\r
+dqadd3349 fma  1  1E+33   7    ->    1000000000000000000000000000000007\r
+dqadd3350 fma  1  1E+34   7    ->   1.000000000000000000000000000000001E+34  Inexact Rounded\r
+dqadd3351 fma  1  1E+35   7    ->   1.000000000000000000000000000000000E+35  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+rounding:    half_up\r
+dqadd3360  fma  1  0E+50 10000E+1  -> 1.0000E+5\r
+dqadd3361  fma  1  0E-50 10000E+1  -> 100000.0000000000000000000000000000 Rounded\r
+dqadd3362  fma  1  10000E+1 0E-50  -> 100000.0000000000000000000000000000 Rounded\r
+dqadd3363  fma  1  10000E+1 10000E-50  -> 100000.0000000000000000000000000000 Rounded Inexact\r
+dqadd3364  fma  1  9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111\r
+--            1 234567890123456789012345678901234\r
+\r
+-- a curiosity from JSR 13 testing\r
+rounding:    half_down\r
+dqadd3370 fma  1   999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd3371 fma  1  9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+rounding:    half_up\r
+dqadd3372 fma  1   999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd3373 fma  1  9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+rounding:    half_even\r
+dqadd3374 fma  1   999999999999999999999999999999999 815 -> 1000000000000000000000000000000814\r
+dqadd3375 fma  1  9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact\r
+\r
+-- ulp replacement tests\r
+dqadd3400 fma  1    1   77e-32      ->  1.00000000000000000000000000000077\r
+dqadd3401 fma  1    1   77e-33      ->  1.000000000000000000000000000000077\r
+dqadd3402 fma  1    1   77e-34      ->  1.000000000000000000000000000000008 Inexact Rounded\r
+dqadd3403 fma  1    1   77e-35      ->  1.000000000000000000000000000000001 Inexact Rounded\r
+dqadd3404 fma  1    1   77e-36      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd3405 fma  1    1   77e-37      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd3406 fma  1    1   77e-299     ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd3410 fma  1   10   77e-32      ->  10.00000000000000000000000000000077\r
+dqadd3411 fma  1   10   77e-33      ->  10.00000000000000000000000000000008 Inexact Rounded\r
+dqadd3412 fma  1   10   77e-34      ->  10.00000000000000000000000000000001 Inexact Rounded\r
+dqadd3413 fma  1   10   77e-35      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3414 fma  1   10   77e-36      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3415 fma  1   10   77e-37      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3416 fma  1   10   77e-299     ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd3420 fma  1   77e-32       1   ->  1.00000000000000000000000000000077\r
+dqadd3421 fma  1   77e-33       1   ->  1.000000000000000000000000000000077\r
+dqadd3422 fma  1   77e-34       1   ->  1.000000000000000000000000000000008 Inexact Rounded\r
+dqadd3423 fma  1   77e-35       1   ->  1.000000000000000000000000000000001 Inexact Rounded\r
+dqadd3424 fma  1   77e-36       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd3425 fma  1   77e-37       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd3426 fma  1   77e-299      1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd3430 fma  1   77e-32      10   ->  10.00000000000000000000000000000077\r
+dqadd3431 fma  1   77e-33      10   ->  10.00000000000000000000000000000008 Inexact Rounded\r
+dqadd3432 fma  1   77e-34      10   ->  10.00000000000000000000000000000001 Inexact Rounded\r
+dqadd3433 fma  1   77e-35      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3434 fma  1   77e-36      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3435 fma  1   77e-37      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd3436 fma  1   77e-299     10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+dqadd36440 fma  1    1   -77e-32      ->  0.99999999999999999999999999999923\r
+dqadd36441 fma  1    1   -77e-33      ->  0.999999999999999999999999999999923\r
+dqadd36442 fma  1    1   -77e-34      ->  0.9999999999999999999999999999999923\r
+dqadd36443 fma  1    1   -77e-35      ->  0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd36444 fma  1    1   -77e-36      ->  0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd36445 fma  1    1   -77e-37      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd36446 fma  1    1   -77e-99      ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36450 fma  1   10   -77e-32      ->   9.99999999999999999999999999999923\r
+dqadd36451 fma  1   10   -77e-33      ->   9.999999999999999999999999999999923\r
+dqadd36452 fma  1   10   -77e-34      ->   9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd36453 fma  1   10   -77e-35      ->   9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd36454 fma  1   10   -77e-36      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36455 fma  1   10   -77e-37      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36456 fma  1   10   -77e-99      ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36460 fma  1   -77e-32       1   ->  0.99999999999999999999999999999923\r
+dqadd36461 fma  1   -77e-33       1   ->  0.999999999999999999999999999999923\r
+dqadd36462 fma  1   -77e-34       1   ->  0.9999999999999999999999999999999923\r
+dqadd36463 fma  1   -77e-35       1   ->  0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd36464 fma  1   -77e-36       1   ->  0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd36465 fma  1   -77e-37       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd36466 fma  1   -77e-99       1   ->  1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36470 fma  1   -77e-32      10   ->   9.99999999999999999999999999999923\r
+dqadd36471 fma  1   -77e-33      10   ->   9.999999999999999999999999999999923\r
+dqadd36472 fma  1   -77e-34      10   ->   9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd36473 fma  1   -77e-35      10   ->   9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd36474 fma  1   -77e-36      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36475 fma  1   -77e-37      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36476 fma  1   -77e-99      10   ->  10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+dqadd36480 fma  1   -1    77e-32      ->  -0.99999999999999999999999999999923\r
+dqadd36481 fma  1   -1    77e-33      ->  -0.999999999999999999999999999999923\r
+dqadd36482 fma  1   -1    77e-34      ->  -0.9999999999999999999999999999999923\r
+dqadd36483 fma  1   -1    77e-35      ->  -0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd36484 fma  1   -1    77e-36      ->  -0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd36485 fma  1   -1    77e-37      ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd36486 fma  1   -1    77e-99      ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36490 fma  1  -10    77e-32      ->   -9.99999999999999999999999999999923\r
+dqadd36491 fma  1  -10    77e-33      ->   -9.999999999999999999999999999999923\r
+dqadd36492 fma  1  -10    77e-34      ->   -9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd36493 fma  1  -10    77e-35      ->   -9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd36494 fma  1  -10    77e-36      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36495 fma  1  -10    77e-37      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36496 fma  1  -10    77e-99      ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36500 fma  1    77e-32      -1   ->  -0.99999999999999999999999999999923\r
+dqadd36501 fma  1    77e-33      -1   ->  -0.999999999999999999999999999999923\r
+dqadd36502 fma  1    77e-34      -1   ->  -0.9999999999999999999999999999999923\r
+dqadd36503 fma  1    77e-35      -1   ->  -0.9999999999999999999999999999999992 Inexact Rounded\r
+dqadd36504 fma  1    77e-36      -1   ->  -0.9999999999999999999999999999999999 Inexact Rounded\r
+dqadd36505 fma  1    77e-37      -1   ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+dqadd36506 fma  1    77e-99      -1   ->  -1.000000000000000000000000000000000 Inexact Rounded\r
+\r
+dqadd36510 fma  1    77e-32      -10  ->   -9.99999999999999999999999999999923\r
+dqadd36511 fma  1    77e-33      -10  ->   -9.999999999999999999999999999999923\r
+dqadd36512 fma  1    77e-34      -10  ->   -9.999999999999999999999999999999992 Inexact Rounded\r
+dqadd36513 fma  1    77e-35      -10  ->   -9.999999999999999999999999999999999 Inexact Rounded\r
+dqadd36514 fma  1    77e-36      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36515 fma  1    77e-37      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+dqadd36516 fma  1    77e-99      -10  ->  -10.00000000000000000000000000000000 Inexact Rounded\r
+\r
+-- and some more residue effects and different roundings\r
+rounding: half_up\r
+dqadd36540 fma  1  '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd36541 fma  1  '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36542 fma  1  '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36543 fma  1  '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36544 fma  1  '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36545 fma  1  '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36546 fma  1  '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36547 fma  1  '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36548 fma  1  '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36549 fma  1  '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36550 fma  1  '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36551 fma  1  '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36552 fma  1  '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36553 fma  1  '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36554 fma  1  '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36555 fma  1  '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36556 fma  1  '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd36557 fma  1  '9876543219876543216543210123456789' 1.000000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36558 fma  1  '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36559 fma  1  '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqadd36560 fma  1  '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd36561 fma  1  '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36562 fma  1  '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36563 fma  1  '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36564 fma  1  '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36565 fma  1  '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36566 fma  1  '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36567 fma  1  '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd36568 fma  1  '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36569 fma  1  '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36570 fma  1  '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36571 fma  1  '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36572 fma  1  '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36573 fma  1  '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36574 fma  1  '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36575 fma  1  '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36576 fma  1  '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd36577 fma  1  '9876543219876543216543210123456789' 1.00000001    -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36578 fma  1  '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd36579 fma  1  '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+-- critical few with even bottom digit...\r
+dqadd37540 fma  1  '9876543219876543216543210123456788' 0.499999999   -> '9876543219876543216543210123456788' Inexact Rounded\r
+dqadd37541 fma  1  '9876543219876543216543210123456788' 0.5           -> '9876543219876543216543210123456788' Inexact Rounded\r
+dqadd37542 fma  1  '9876543219876543216543210123456788' 0.500000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+\r
+rounding: down\r
+dqadd37550 fma  1  '9876543219876543216543210123456789' 0             -> '9876543219876543216543210123456789'\r
+dqadd37551 fma  1  '9876543219876543216543210123456789' 0.000000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37552 fma  1  '9876543219876543216543210123456789' 0.000001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37553 fma  1  '9876543219876543216543210123456789' 0.1           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37554 fma  1  '9876543219876543216543210123456789' 0.4           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37555 fma  1  '9876543219876543216543210123456789' 0.49          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37556 fma  1  '9876543219876543216543210123456789' 0.499999      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37557 fma  1  '9876543219876543216543210123456789' 0.499999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37558 fma  1  '9876543219876543216543210123456789' 0.5           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37559 fma  1  '9876543219876543216543210123456789' 0.500000001   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37560 fma  1  '9876543219876543216543210123456789' 0.500001      -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37561 fma  1  '9876543219876543216543210123456789' 0.51          -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37562 fma  1  '9876543219876543216543210123456789' 0.6           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37563 fma  1  '9876543219876543216543210123456789' 0.9           -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37564 fma  1  '9876543219876543216543210123456789' 0.99999       -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37565 fma  1  '9876543219876543216543210123456789' 0.999999999   -> '9876543219876543216543210123456789' Inexact Rounded\r
+dqadd37566 fma  1  '9876543219876543216543210123456789' 1             -> '9876543219876543216543210123456790'\r
+dqadd37567 fma  1  '9876543219876543216543210123456789' 1.00000001    -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd37568 fma  1  '9876543219876543216543210123456789' 1.00001       -> '9876543219876543216543210123456790' Inexact Rounded\r
+dqadd37569 fma  1  '9876543219876543216543210123456789' 1.1           -> '9876543219876543216543210123456790' Inexact Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_even\r
+\r
+dqadd37701 fma  1  5.00 1.00E-3 -> 5.00100\r
+dqadd37702 fma  1  00.00 0.000  -> 0.000\r
+dqadd37703 fma  1  00.00 0E-3   -> 0.000\r
+dqadd37704 fma  1  0E-3  00.00  -> 0.000\r
+\r
+dqadd37710 fma  1  0E+3  00.00  -> 0.00\r
+dqadd37711 fma  1  0E+3  00.0   -> 0.0\r
+dqadd37712 fma  1  0E+3  00.    -> 0\r
+dqadd37713 fma  1  0E+3  00.E+1 -> 0E+1\r
+dqadd37714 fma  1  0E+3  00.E+2 -> 0E+2\r
+dqadd37715 fma  1  0E+3  00.E+3 -> 0E+3\r
+dqadd37716 fma  1  0E+3  00.E+4 -> 0E+3\r
+dqadd37717 fma  1  0E+3  00.E+5 -> 0E+3\r
+dqadd37718 fma  1  0E+3  -00.0   -> 0.0\r
+dqadd37719 fma  1  0E+3  -00.    -> 0\r
+dqadd37731 fma  1  0E+3  -00.E+1 -> 0E+1\r
+\r
+dqadd37720 fma  1  00.00  0E+3  -> 0.00\r
+dqadd37721 fma  1  00.0   0E+3  -> 0.0\r
+dqadd37722 fma  1  00.    0E+3  -> 0\r
+dqadd37723 fma  1  00.E+1 0E+3  -> 0E+1\r
+dqadd37724 fma  1  00.E+2 0E+3  -> 0E+2\r
+dqadd37725 fma  1  00.E+3 0E+3  -> 0E+3\r
+dqadd37726 fma  1  00.E+4 0E+3  -> 0E+3\r
+dqadd37727 fma  1  00.E+5 0E+3  -> 0E+3\r
+dqadd37728 fma  1  -00.00 0E+3  -> 0.00\r
+dqadd37729 fma  1  -00.0  0E+3  -> 0.0\r
+dqadd37730 fma  1  -00.   0E+3  -> 0\r
+\r
+dqadd37732 fma  1   0     0     ->  0\r
+dqadd37733 fma  1   0    -0     ->  0\r
+dqadd37734 fma  1  -0     0     ->  0\r
+dqadd37735 fma  1  -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+dqadd37736 fma  1   1    -1     ->  0\r
+dqadd37737 fma  1  -1    -1     -> -2\r
+dqadd37738 fma  1   1     1     ->  2\r
+dqadd37739 fma  1  -1     1     ->  0\r
+\r
+dqadd37741 fma  1   0    -1     -> -1\r
+dqadd37742 fma  1  -0    -1     -> -1\r
+dqadd37743 fma  1   0     1     ->  1\r
+dqadd37744 fma  1  -0     1     ->  1\r
+dqadd37745 fma  1  -1     0     -> -1\r
+dqadd37746 fma  1  -1    -0     -> -1\r
+dqadd37747 fma  1   1     0     ->  1\r
+dqadd37748 fma  1   1    -0     ->  1\r
+\r
+dqadd37751 fma  1   0.0  -1     -> -1.0\r
+dqadd37752 fma  1  -0.0  -1     -> -1.0\r
+dqadd37753 fma  1   0.0   1     ->  1.0\r
+dqadd37754 fma  1  -0.0   1     ->  1.0\r
+dqadd37755 fma  1  -1.0   0     -> -1.0\r
+dqadd37756 fma  1  -1.0  -0     -> -1.0\r
+dqadd37757 fma  1   1.0   0     ->  1.0\r
+dqadd37758 fma  1   1.0  -0     ->  1.0\r
+\r
+dqadd37761 fma  1   0    -1.0   -> -1.0\r
+dqadd37762 fma  1  -0    -1.0   -> -1.0\r
+dqadd37763 fma  1   0     1.0   ->  1.0\r
+dqadd37764 fma  1  -0     1.0   ->  1.0\r
+dqadd37765 fma  1  -1     0.0   -> -1.0\r
+dqadd37766 fma  1  -1    -0.0   -> -1.0\r
+dqadd37767 fma  1   1     0.0   ->  1.0\r
+dqadd37768 fma  1   1    -0.0   ->  1.0\r
+\r
+dqadd37771 fma  1   0.0  -1.0   -> -1.0\r
+dqadd37772 fma  1  -0.0  -1.0   -> -1.0\r
+dqadd37773 fma  1   0.0   1.0   ->  1.0\r
+dqadd37774 fma  1  -0.0   1.0   ->  1.0\r
+dqadd37775 fma  1  -1.0   0.0   -> -1.0\r
+dqadd37776 fma  1  -1.0  -0.0   -> -1.0\r
+dqadd37777 fma  1   1.0   0.0   ->  1.0\r
+dqadd37778 fma  1   1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+dqadd37780 fma  1  -Inf  -Inf   -> -Infinity\r
+dqadd37781 fma  1  -Inf  -1000  -> -Infinity\r
+dqadd37782 fma  1  -Inf  -1     -> -Infinity\r
+dqadd37783 fma  1  -Inf  -0     -> -Infinity\r
+dqadd37784 fma  1  -Inf   0     -> -Infinity\r
+dqadd37785 fma  1  -Inf   1     -> -Infinity\r
+dqadd37786 fma  1  -Inf   1000  -> -Infinity\r
+dqadd37787 fma  1  -1000 -Inf   -> -Infinity\r
+dqadd37788 fma  1  -Inf  -Inf   -> -Infinity\r
+dqadd37789 fma  1  -1    -Inf   -> -Infinity\r
+dqadd37790 fma  1  -0    -Inf   -> -Infinity\r
+dqadd37791 fma  1   0    -Inf   -> -Infinity\r
+dqadd37792 fma  1   1    -Inf   -> -Infinity\r
+dqadd37793 fma  1   1000 -Inf   -> -Infinity\r
+dqadd37794 fma  1   Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+dqadd37800 fma  1   Inf  -Inf   ->  NaN  Invalid_operation\r
+dqadd37801 fma  1   Inf  -1000  ->  Infinity\r
+dqadd37802 fma  1   Inf  -1     ->  Infinity\r
+dqadd37803 fma  1   Inf  -0     ->  Infinity\r
+dqadd37804 fma  1   Inf   0     ->  Infinity\r
+dqadd37805 fma  1   Inf   1     ->  Infinity\r
+dqadd37806 fma  1   Inf   1000  ->  Infinity\r
+dqadd37807 fma  1   Inf   Inf   ->  Infinity\r
+dqadd37808 fma  1  -1000  Inf   ->  Infinity\r
+dqadd37809 fma  1  -Inf   Inf   ->  NaN  Invalid_operation\r
+dqadd37810 fma  1  -1     Inf   ->  Infinity\r
+dqadd37811 fma  1  -0     Inf   ->  Infinity\r
+dqadd37812 fma  1   0     Inf   ->  Infinity\r
+dqadd37813 fma  1   1     Inf   ->  Infinity\r
+dqadd37814 fma  1   1000  Inf   ->  Infinity\r
+dqadd37815 fma  1   Inf   Inf   ->  Infinity\r
+\r
+dqadd37821 fma  1   NaN -Inf    ->  NaN\r
+dqadd37822 fma  1   NaN -1000   ->  NaN\r
+dqadd37823 fma  1   NaN -1      ->  NaN\r
+dqadd37824 fma  1   NaN -0      ->  NaN\r
+dqadd37825 fma  1   NaN  0      ->  NaN\r
+dqadd37826 fma  1   NaN  1      ->  NaN\r
+dqadd37827 fma  1   NaN  1000   ->  NaN\r
+dqadd37828 fma  1   NaN  Inf    ->  NaN\r
+dqadd37829 fma  1   NaN  NaN    ->  NaN\r
+dqadd37830 fma  1  -Inf  NaN    ->  NaN\r
+dqadd37831 fma  1  -1000 NaN    ->  NaN\r
+dqadd37832 fma  1  -1    NaN    ->  NaN\r
+dqadd37833 fma  1  -0    NaN    ->  NaN\r
+dqadd37834 fma  1   0    NaN    ->  NaN\r
+dqadd37835 fma  1   1    NaN    ->  NaN\r
+dqadd37836 fma  1   1000 NaN    ->  NaN\r
+dqadd37837 fma  1   Inf  NaN    ->  NaN\r
+\r
+dqadd37841 fma  1   sNaN -Inf   ->  NaN  Invalid_operation\r
+dqadd37842 fma  1   sNaN -1000  ->  NaN  Invalid_operation\r
+dqadd37843 fma  1   sNaN -1     ->  NaN  Invalid_operation\r
+dqadd37844 fma  1   sNaN -0     ->  NaN  Invalid_operation\r
+dqadd37845 fma  1   sNaN  0     ->  NaN  Invalid_operation\r
+dqadd37846 fma  1   sNaN  1     ->  NaN  Invalid_operation\r
+dqadd37847 fma  1   sNaN  1000  ->  NaN  Invalid_operation\r
+dqadd37848 fma  1   sNaN  NaN   ->  NaN  Invalid_operation\r
+dqadd37849 fma  1   sNaN sNaN   ->  NaN  Invalid_operation\r
+dqadd37850 fma  1   NaN  sNaN   ->  NaN  Invalid_operation\r
+dqadd37851 fma  1  -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqadd37852 fma  1  -1000 sNaN   ->  NaN  Invalid_operation\r
+dqadd37853 fma  1  -1    sNaN   ->  NaN  Invalid_operation\r
+dqadd37854 fma  1  -0    sNaN   ->  NaN  Invalid_operation\r
+dqadd37855 fma  1   0    sNaN   ->  NaN  Invalid_operation\r
+dqadd37856 fma  1   1    sNaN   ->  NaN  Invalid_operation\r
+dqadd37857 fma  1   1000 sNaN   ->  NaN  Invalid_operation\r
+dqadd37858 fma  1   Inf  sNaN   ->  NaN  Invalid_operation\r
+dqadd37859 fma  1   NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqadd37861 fma  1   NaN1   -Inf    ->  NaN1\r
+dqadd37862 fma  1  +NaN2   -1000   ->  NaN2\r
+dqadd37863 fma  1   NaN3    1000   ->  NaN3\r
+dqadd37864 fma  1   NaN4    Inf    ->  NaN4\r
+dqadd37865 fma  1   NaN5   +NaN6   ->  NaN5\r
+dqadd37866 fma  1  -Inf     NaN7   ->  NaN7\r
+dqadd37867 fma  1  -1000    NaN8   ->  NaN8\r
+dqadd37868 fma  1   1000    NaN9   ->  NaN9\r
+dqadd37869 fma  1   Inf    +NaN10  ->  NaN10\r
+dqadd37871 fma  1   sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+dqadd37872 fma  1   sNaN12  -1000  ->  NaN12  Invalid_operation\r
+dqadd37873 fma  1   sNaN13   1000  ->  NaN13  Invalid_operation\r
+dqadd37874 fma  1   sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+dqadd37875 fma  1   sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+dqadd37876 fma  1   NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+dqadd37877 fma  1  -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+dqadd37878 fma  1  -1000    sNaN21 ->  NaN21  Invalid_operation\r
+dqadd37879 fma  1   1000    sNaN22 ->  NaN22  Invalid_operation\r
+dqadd37880 fma  1   Inf     sNaN23 ->  NaN23  Invalid_operation\r
+dqadd37881 fma  1  +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+dqadd37882 fma  1  -NaN26    NaN28 -> -NaN26\r
+dqadd37883 fma  1  -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+dqadd37884 fma  1   1000    -NaN30 -> -NaN30\r
+dqadd37885 fma  1   1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Here we explore near the boundary of rounding a subnormal to Nmin\r
+dqadd37575 fma  1   1E-6143 -1E-6176 ->  9.99999999999999999999999999999999E-6144 Subnormal\r
+dqadd37576 fma  1  -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal\r
+\r
+-- check overflow edge case\r
+--               1234567890123456\r
+dqadd37972 apply       9.999999999999999999999999999999999E+6144         -> 9.999999999999999999999999999999999E+6144\r
+dqadd37973 fma  1      9.999999999999999999999999999999999E+6144  1      -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37974 fma  1       9999999999999999999999999999999999E+6111  1      -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37975 fma  1       9999999999999999999999999999999999E+6111  1E+6111  -> Infinity Overflow Inexact Rounded\r
+dqadd37976 fma  1       9999999999999999999999999999999999E+6111  9E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd37977 fma  1       9999999999999999999999999999999999E+6111  8E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd37978 fma  1       9999999999999999999999999999999999E+6111  7E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd37979 fma  1       9999999999999999999999999999999999E+6111  6E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd37980 fma  1       9999999999999999999999999999999999E+6111  5E+6110  -> Infinity Overflow Inexact Rounded\r
+dqadd37981 fma  1       9999999999999999999999999999999999E+6111  4E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37982 fma  1       9999999999999999999999999999999999E+6111  3E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37983 fma  1       9999999999999999999999999999999999E+6111  2E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37984 fma  1       9999999999999999999999999999999999E+6111  1E+6110  -> 9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+\r
+dqadd37985 apply      -9.999999999999999999999999999999999E+6144         -> -9.999999999999999999999999999999999E+6144\r
+dqadd37986 fma  1     -9.999999999999999999999999999999999E+6144 -1      -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37987 fma  1      -9999999999999999999999999999999999E+6111 -1      -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37988 fma  1      -9999999999999999999999999999999999E+6111 -1E+6111  -> -Infinity Overflow Inexact Rounded\r
+dqadd37989 fma  1      -9999999999999999999999999999999999E+6111 -9E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd37990 fma  1      -9999999999999999999999999999999999E+6111 -8E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd37991 fma  1      -9999999999999999999999999999999999E+6111 -7E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd37992 fma  1      -9999999999999999999999999999999999E+6111 -6E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd37993 fma  1      -9999999999999999999999999999999999E+6111 -5E+6110  -> -Infinity Overflow Inexact Rounded\r
+dqadd37994 fma  1      -9999999999999999999999999999999999E+6111 -4E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37995 fma  1      -9999999999999999999999999999999999E+6111 -3E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37996 fma  1      -9999999999999999999999999999999999E+6111 -2E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+dqadd37997 fma  1      -9999999999999999999999999999999999E+6111 -1E+6110  -> -9.999999999999999999999999999999999E+6144 Inexact Rounded\r
+\r
+-- And for round down full and subnormal results\r
+rounding:     down\r
+dqadd371100 fma  1  1e+2 -1e-6143    -> 99.99999999999999999999999999999999 Rounded Inexact\r
+dqadd371101 fma  1  1e+1 -1e-6143    -> 9.999999999999999999999999999999999  Rounded Inexact\r
+dqadd371103 fma  1    +1 -1e-6143    -> 0.9999999999999999999999999999999999  Rounded Inexact\r
+dqadd371104 fma  1  1e-1 -1e-6143    -> 0.09999999999999999999999999999999999  Rounded Inexact\r
+dqadd371105 fma  1  1e-2 -1e-6143    -> 0.009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371106 fma  1  1e-3 -1e-6143    -> 0.0009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371107 fma  1  1e-4 -1e-6143    -> 0.00009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371108 fma  1  1e-5 -1e-6143    -> 0.000009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371109 fma  1  1e-6 -1e-6143    -> 9.999999999999999999999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+dqadd371110 fma  1  -1e+2 +1e-6143   -> -99.99999999999999999999999999999999 Rounded Inexact\r
+dqadd371111 fma  1  -1e+1 +1e-6143   -> -9.999999999999999999999999999999999  Rounded Inexact\r
+dqadd371113 fma  1     -1 +1e-6143   -> -0.9999999999999999999999999999999999  Rounded Inexact\r
+dqadd371114 fma  1  -1e-1 +1e-6143   -> -0.09999999999999999999999999999999999  Rounded Inexact\r
+dqadd371115 fma  1  -1e-2 +1e-6143   -> -0.009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371116 fma  1  -1e-3 +1e-6143   -> -0.0009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371117 fma  1  -1e-4 +1e-6143   -> -0.00009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371118 fma  1  -1e-5 +1e-6143   -> -0.000009999999999999999999999999999999999  Rounded Inexact\r
+dqadd371119 fma  1  -1e-6 +1e-6143   -> -9.999999999999999999999999999999999E-7  Rounded Inexact\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+rounding:     half_even\r
+\r
+dqadd371300 fma  1  1E34  -0.5                 ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371310 fma  1  1E34  -0.51                ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371311 fma  1  1E34  -0.501               ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371312 fma  1  1E34  -0.5001              ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371313 fma  1  1E34  -0.50001             ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371314 fma  1  1E34  -0.500001            ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371315 fma  1  1E34  -0.5000001           ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371316 fma  1  1E34  -0.50000001          ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371317 fma  1  1E34  -0.500000001         ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371318 fma  1  1E34  -0.5000000001        ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371319 fma  1  1E34  -0.50000000001       ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371320 fma  1  1E34  -0.500000000001      ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371321 fma  1  1E34  -0.5000000000001     ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371322 fma  1  1E34  -0.50000000000001    ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371323 fma  1  1E34  -0.500000000000001   ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371324 fma  1  1E34  -0.5000000000000001  ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371325 fma  1  1E34  -0.5000000000000000  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371326 fma  1  1E34  -0.500000000000000   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371327 fma  1  1E34  -0.50000000000000    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371328 fma  1  1E34  -0.5000000000000     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371329 fma  1  1E34  -0.500000000000      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371330 fma  1  1E34  -0.50000000000       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371331 fma  1  1E34  -0.5000000000        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371332 fma  1  1E34  -0.500000000         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371333 fma  1  1E34  -0.50000000          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371334 fma  1  1E34  -0.5000000           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371335 fma  1  1E34  -0.500000            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371336 fma  1  1E34  -0.50000             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371337 fma  1  1E34  -0.5000              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371338 fma  1  1E34  -0.500               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371339 fma  1  1E34  -0.50                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+\r
+dqadd371340 fma  1  1E34  -5000000.000010001   ->  9999999999999999999999999995000000      Inexact Rounded\r
+dqadd371341 fma  1  1E34  -5000000.000000001   ->  9999999999999999999999999995000000      Inexact Rounded\r
+\r
+dqadd371349 fma  1  9999999999999999999999999999999999 0.4                 ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371350 fma  1  9999999999999999999999999999999999 0.49                ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371351 fma  1  9999999999999999999999999999999999 0.499               ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371352 fma  1  9999999999999999999999999999999999 0.4999              ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371353 fma  1  9999999999999999999999999999999999 0.49999             ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371354 fma  1  9999999999999999999999999999999999 0.499999            ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371355 fma  1  9999999999999999999999999999999999 0.4999999           ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371356 fma  1  9999999999999999999999999999999999 0.49999999          ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371357 fma  1  9999999999999999999999999999999999 0.499999999         ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371358 fma  1  9999999999999999999999999999999999 0.4999999999        ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371359 fma  1  9999999999999999999999999999999999 0.49999999999       ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371360 fma  1  9999999999999999999999999999999999 0.499999999999      ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371361 fma  1  9999999999999999999999999999999999 0.4999999999999     ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371362 fma  1  9999999999999999999999999999999999 0.49999999999999    ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371363 fma  1  9999999999999999999999999999999999 0.499999999999999   ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371364 fma  1  9999999999999999999999999999999999 0.4999999999999999  ->  9999999999999999999999999999999999      Inexact Rounded\r
+dqadd371365 fma  1  9999999999999999999999999999999999 0.5000000000000000  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371367 fma  1  9999999999999999999999999999999999 0.500000000000000   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371368 fma  1  9999999999999999999999999999999999 0.50000000000000    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371369 fma  1  9999999999999999999999999999999999 0.5000000000000     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371370 fma  1  9999999999999999999999999999999999 0.500000000000      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371371 fma  1  9999999999999999999999999999999999 0.50000000000       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371372 fma  1  9999999999999999999999999999999999 0.5000000000        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371373 fma  1  9999999999999999999999999999999999 0.500000000         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371374 fma  1  9999999999999999999999999999999999 0.50000000          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371375 fma  1  9999999999999999999999999999999999 0.5000000           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371376 fma  1  9999999999999999999999999999999999 0.500000            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371377 fma  1  9999999999999999999999999999999999 0.50000             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371378 fma  1  9999999999999999999999999999999999 0.5000              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371379 fma  1  9999999999999999999999999999999999 0.500               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371380 fma  1  9999999999999999999999999999999999 0.50                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371381 fma  1  9999999999999999999999999999999999 0.5                 ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371382 fma  1  9999999999999999999999999999999999 0.5000000000000001  ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371383 fma  1  9999999999999999999999999999999999 0.500000000000001   ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371384 fma  1  9999999999999999999999999999999999 0.50000000000001    ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371385 fma  1  9999999999999999999999999999999999 0.5000000000001     ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371386 fma  1  9999999999999999999999999999999999 0.500000000001      ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371387 fma  1  9999999999999999999999999999999999 0.50000000001       ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371388 fma  1  9999999999999999999999999999999999 0.5000000001        ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371389 fma  1  9999999999999999999999999999999999 0.500000001         ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371390 fma  1  9999999999999999999999999999999999 0.50000001          ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371391 fma  1  9999999999999999999999999999999999 0.5000001           ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371392 fma  1  9999999999999999999999999999999999 0.500001            ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371393 fma  1  9999999999999999999999999999999999 0.50001             ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371394 fma  1  9999999999999999999999999999999999 0.5001              ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371395 fma  1  9999999999999999999999999999999999 0.501               ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+dqadd371396 fma  1  9999999999999999999999999999999999 0.51                ->  1.000000000000000000000000000000000E+34 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+dqadd371420 fma  1   0 1.123456789987654321123456789012345     -> 1.123456789987654321123456789012345\r
+dqadd371421 fma  1   0 1.123456789987654321123456789012345E-1  -> 0.1123456789987654321123456789012345\r
+dqadd371422 fma  1   0 1.123456789987654321123456789012345E-2  -> 0.01123456789987654321123456789012345\r
+dqadd371423 fma  1   0 1.123456789987654321123456789012345E-3  -> 0.001123456789987654321123456789012345\r
+dqadd371424 fma  1   0 1.123456789987654321123456789012345E-4  -> 0.0001123456789987654321123456789012345\r
+dqadd371425 fma  1   0 1.123456789987654321123456789012345E-5  -> 0.00001123456789987654321123456789012345\r
+dqadd371426 fma  1   0 1.123456789987654321123456789012345E-6  -> 0.000001123456789987654321123456789012345\r
+dqadd371427 fma  1   0 1.123456789987654321123456789012345E-7  -> 1.123456789987654321123456789012345E-7\r
+dqadd371428 fma  1   0 1.123456789987654321123456789012345E-8  -> 1.123456789987654321123456789012345E-8\r
+dqadd371429 fma  1   0 1.123456789987654321123456789012345E-9  -> 1.123456789987654321123456789012345E-9\r
+dqadd371430 fma  1   0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10\r
+dqadd371431 fma  1   0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11\r
+dqadd371432 fma  1   0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12\r
+dqadd371433 fma  1   0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13\r
+dqadd371434 fma  1   0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14\r
+dqadd371435 fma  1   0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15\r
+dqadd371436 fma  1   0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16\r
+dqadd371437 fma  1   0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17\r
+dqadd371438 fma  1   0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18\r
+dqadd371439 fma  1   0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19\r
+dqadd371440 fma  1   0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20\r
+dqadd371441 fma  1   0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21\r
+dqadd371442 fma  1   0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22\r
+dqadd371443 fma  1   0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23\r
+dqadd371444 fma  1   0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24\r
+dqadd371445 fma  1   0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25\r
+dqadd371446 fma  1   0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26\r
+dqadd371447 fma  1   0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27\r
+dqadd371448 fma  1   0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28\r
+dqadd371449 fma  1   0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29\r
+dqadd371450 fma  1   0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30\r
+dqadd371451 fma  1   0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31\r
+dqadd371452 fma  1   0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32\r
+dqadd371453 fma  1   0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33\r
+dqadd371454 fma  1   0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34\r
+dqadd371455 fma  1   0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35\r
+dqadd371456 fma  1   0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36\r
+\r
+-- same, reversed 0\r
+dqadd371460 fma  1  1.123456789987654321123456789012345     0 -> 1.123456789987654321123456789012345\r
+dqadd371461 fma  1  1.123456789987654321123456789012345E-1  0 -> 0.1123456789987654321123456789012345\r
+dqadd371462 fma  1  1.123456789987654321123456789012345E-2  0 -> 0.01123456789987654321123456789012345\r
+dqadd371463 fma  1  1.123456789987654321123456789012345E-3  0 -> 0.001123456789987654321123456789012345\r
+dqadd371464 fma  1  1.123456789987654321123456789012345E-4  0 -> 0.0001123456789987654321123456789012345\r
+dqadd371465 fma  1  1.123456789987654321123456789012345E-5  0 -> 0.00001123456789987654321123456789012345\r
+dqadd371466 fma  1  1.123456789987654321123456789012345E-6  0 -> 0.000001123456789987654321123456789012345\r
+dqadd371467 fma  1  1.123456789987654321123456789012345E-7  0 -> 1.123456789987654321123456789012345E-7\r
+dqadd371468 fma  1  1.123456789987654321123456789012345E-8  0 -> 1.123456789987654321123456789012345E-8\r
+dqadd371469 fma  1  1.123456789987654321123456789012345E-9  0 -> 1.123456789987654321123456789012345E-9\r
+dqadd371470 fma  1  1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10\r
+dqadd371471 fma  1  1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11\r
+dqadd371472 fma  1  1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12\r
+dqadd371473 fma  1  1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13\r
+dqadd371474 fma  1  1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14\r
+dqadd371475 fma  1  1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15\r
+dqadd371476 fma  1  1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16\r
+dqadd371477 fma  1  1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17\r
+dqadd371478 fma  1  1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18\r
+dqadd371479 fma  1  1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19\r
+dqadd371480 fma  1  1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20\r
+dqadd371481 fma  1  1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21\r
+dqadd371482 fma  1  1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22\r
+dqadd371483 fma  1  1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23\r
+dqadd371484 fma  1  1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24\r
+dqadd371485 fma  1  1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25\r
+dqadd371486 fma  1  1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26\r
+dqadd371487 fma  1  1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27\r
+dqadd371488 fma  1  1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28\r
+dqadd371489 fma  1  1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29\r
+dqadd371490 fma  1  1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30\r
+dqadd371491 fma  1  1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31\r
+dqadd371492 fma  1  1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32\r
+dqadd371493 fma  1  1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33\r
+dqadd371494 fma  1  1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34\r
+dqadd371495 fma  1  1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35\r
+dqadd371496 fma  1  1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36\r
+\r
+-- same, Es on the 0\r
+dqadd371500 fma  1  1.123456789987654321123456789012345  0E-0   -> 1.123456789987654321123456789012345\r
+dqadd371501 fma  1  1.123456789987654321123456789012345  0E-1   -> 1.123456789987654321123456789012345\r
+dqadd371502 fma  1  1.123456789987654321123456789012345  0E-2   -> 1.123456789987654321123456789012345\r
+dqadd371503 fma  1  1.123456789987654321123456789012345  0E-3   -> 1.123456789987654321123456789012345\r
+dqadd371504 fma  1  1.123456789987654321123456789012345  0E-4   -> 1.123456789987654321123456789012345\r
+dqadd371505 fma  1  1.123456789987654321123456789012345  0E-5   -> 1.123456789987654321123456789012345\r
+dqadd371506 fma  1  1.123456789987654321123456789012345  0E-6   -> 1.123456789987654321123456789012345\r
+dqadd371507 fma  1  1.123456789987654321123456789012345  0E-7   -> 1.123456789987654321123456789012345\r
+dqadd371508 fma  1  1.123456789987654321123456789012345  0E-8   -> 1.123456789987654321123456789012345\r
+dqadd371509 fma  1  1.123456789987654321123456789012345  0E-9   -> 1.123456789987654321123456789012345\r
+dqadd371510 fma  1  1.123456789987654321123456789012345  0E-10  -> 1.123456789987654321123456789012345\r
+dqadd371511 fma  1  1.123456789987654321123456789012345  0E-11  -> 1.123456789987654321123456789012345\r
+dqadd371512 fma  1  1.123456789987654321123456789012345  0E-12  -> 1.123456789987654321123456789012345\r
+dqadd371513 fma  1  1.123456789987654321123456789012345  0E-13  -> 1.123456789987654321123456789012345\r
+dqadd371514 fma  1  1.123456789987654321123456789012345  0E-14  -> 1.123456789987654321123456789012345\r
+dqadd371515 fma  1  1.123456789987654321123456789012345  0E-15  -> 1.123456789987654321123456789012345\r
+dqadd371516 fma  1  1.123456789987654321123456789012345  0E-16  -> 1.123456789987654321123456789012345\r
+dqadd371517 fma  1  1.123456789987654321123456789012345  0E-17  -> 1.123456789987654321123456789012345\r
+dqadd371518 fma  1  1.123456789987654321123456789012345  0E-18  -> 1.123456789987654321123456789012345\r
+dqadd371519 fma  1  1.123456789987654321123456789012345  0E-19  -> 1.123456789987654321123456789012345\r
+dqadd371520 fma  1  1.123456789987654321123456789012345  0E-20  -> 1.123456789987654321123456789012345\r
+dqadd371521 fma  1  1.123456789987654321123456789012345  0E-21  -> 1.123456789987654321123456789012345\r
+dqadd371522 fma  1  1.123456789987654321123456789012345  0E-22  -> 1.123456789987654321123456789012345\r
+dqadd371523 fma  1  1.123456789987654321123456789012345  0E-23  -> 1.123456789987654321123456789012345\r
+dqadd371524 fma  1  1.123456789987654321123456789012345  0E-24  -> 1.123456789987654321123456789012345\r
+dqadd371525 fma  1  1.123456789987654321123456789012345  0E-25  -> 1.123456789987654321123456789012345\r
+dqadd371526 fma  1  1.123456789987654321123456789012345  0E-26  -> 1.123456789987654321123456789012345\r
+dqadd371527 fma  1  1.123456789987654321123456789012345  0E-27  -> 1.123456789987654321123456789012345\r
+dqadd371528 fma  1  1.123456789987654321123456789012345  0E-28  -> 1.123456789987654321123456789012345\r
+dqadd371529 fma  1  1.123456789987654321123456789012345  0E-29  -> 1.123456789987654321123456789012345\r
+dqadd371530 fma  1  1.123456789987654321123456789012345  0E-30  -> 1.123456789987654321123456789012345\r
+dqadd371531 fma  1  1.123456789987654321123456789012345  0E-31  -> 1.123456789987654321123456789012345\r
+dqadd371532 fma  1  1.123456789987654321123456789012345  0E-32  -> 1.123456789987654321123456789012345\r
+dqadd371533 fma  1  1.123456789987654321123456789012345  0E-33  -> 1.123456789987654321123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+dqadd371534 fma  1  1.123456789987654321123456789012345  0E-34  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd371535 fma  1  1.123456789987654321123456789012345  0E-35  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd371536 fma  1  1.123456789987654321123456789012345  0E-36  -> 1.123456789987654321123456789012345 Rounded\r
+dqadd371537 fma  1  1.123456789987654321123456789012345  0E-37  -> 1.123456789987654321123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+dqadd371600 fma  1   0        0E-19  ->  0E-19\r
+dqadd371601 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371602 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371603 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371611 fma  1  -11      11    ->  0\r
+dqadd371612 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371613 fma  9E6144 10   1     ->  Infinity Overflow Inexact Rounded\r
+dqadd371614 fma -9E6144 10   1     -> -Infinity Overflow Inexact Rounded\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+dqadd371620 fma  1   0        0E-19  ->  0E-19\r
+dqadd371621 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371622 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371623 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371631 fma  1  -11      11    ->  0\r
+dqadd371632 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371633 fma  9E6144 10   1     ->  Infinity Overflow Inexact Rounded\r
+dqadd371634 fma -9E6144 10   1     -> -Infinity Overflow Inexact Rounded\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+dqadd371640 fma  1   0        0E-19  ->  0E-19\r
+dqadd371641 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371642 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371643 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371651 fma  1  -11      11    ->  0\r
+dqadd371652 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371653 fma  9E6144 10   1     ->  Infinity Overflow Inexact Rounded\r
+dqadd371654 fma -9E6144 10   1     -> -Infinity Overflow Inexact Rounded\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+dqadd371660 fma  1   0        0E-19  ->  0E-19\r
+dqadd371661 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371662 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371663 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371671 fma  1  -11      11    ->  0\r
+dqadd371672 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371673 fma  9E6144 10   1     ->  Infinity Overflow Inexact Rounded\r
+dqadd371674 fma -9E6144 10   1     -> -Infinity Overflow Inexact Rounded\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+dqadd371680 fma  1   0        0E-19  ->  0E-19\r
+dqadd371681 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371682 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371683 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371691 fma  1  -11      11    ->  0\r
+dqadd371692 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371693 fma  9E6144 10   1     ->  9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+dqadd371694 fma -9E6144 10   1     -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+dqadd371700 fma  1   0        0E-19  ->  0E-19\r
+dqadd371701 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371702 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371703 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371711 fma  1  -11      11    ->  0\r
+dqadd371712 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371713 fma  9E6144 10   1     ->  Infinity Overflow Inexact Rounded\r
+dqadd371714 fma -9E6144 10   1     -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+dqadd371720 fma  1   0        0E-19  ->  0E-19\r
+dqadd371721 fma  1  -0        0E-19  -> -0E-19           -- *\r
+dqadd371722 fma  1   0       -0E-19  -> -0E-19           -- *\r
+dqadd371723 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371731 fma  1  -11      11    ->  -0                -- *\r
+dqadd371732 fma  1   11     -11    ->  -0                -- *\r
+-- overflow\r
+dqadd371733 fma  9E6144 10   1     ->  9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+dqadd371734 fma -9E6144 10   1     -> -Infinity Overflow Inexact Rounded\r
+\r
+rounding:    05up\r
+-- exact zeros from zeros\r
+dqadd371740 fma  1   0        0E-19  ->  0E-19\r
+dqadd371741 fma  1  -0        0E-19  ->  0E-19\r
+dqadd371742 fma  1   0       -0E-19  ->  0E-19\r
+dqadd371743 fma  1  -0       -0E-19  -> -0E-19\r
+-- exact zeros from non-zeros\r
+dqadd371751 fma  1  -11      11    ->  0\r
+dqadd371752 fma  1   11     -11    ->  0\r
+-- overflow\r
+dqadd371753 fma  9E6144 10   1     ->  9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+dqadd371754 fma -9E6144 10   1     -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+dqadd371761 fma  1  130E-2    120E-2    -> 2.50\r
+dqadd371762 fma  1  130E-2    12E-1     -> 2.50\r
+dqadd371763 fma  1  130E-2    1E0       -> 2.30\r
+dqadd371764 fma  1  1E2       1E4       -> 1.01E+4\r
+dqadd371765 fma  1  130E-2   -120E-2 -> 0.10\r
+dqadd371766 fma  1  130E-2   -12E-1  -> 0.10\r
+dqadd371767 fma  1  130E-2   -1E0    -> 0.30\r
+dqadd371768 fma  1  1E2      -1E4    -> -9.9E+3\r
+\r
+-- Gappy coefficients; check residue handling even with full coefficient gap\r
+rounding: half_even\r
+\r
+dqadd375001 fma  1  1239876543211234567894567890123456 1      -> 1239876543211234567894567890123457\r
+dqadd375002 fma  1  1239876543211234567894567890123456 0.6    -> 1239876543211234567894567890123457  Inexact Rounded\r
+dqadd375003 fma  1  1239876543211234567894567890123456 0.06   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375004 fma  1  1239876543211234567894567890123456 6E-3   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375005 fma  1  1239876543211234567894567890123456 6E-4   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375006 fma  1  1239876543211234567894567890123456 6E-5   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375007 fma  1  1239876543211234567894567890123456 6E-6   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375008 fma  1  1239876543211234567894567890123456 6E-7   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375009 fma  1  1239876543211234567894567890123456 6E-8   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375010 fma  1  1239876543211234567894567890123456 6E-9   -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375011 fma  1  1239876543211234567894567890123456 6E-10  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375012 fma  1  1239876543211234567894567890123456 6E-11  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375013 fma  1  1239876543211234567894567890123456 6E-12  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375014 fma  1  1239876543211234567894567890123456 6E-13  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375015 fma  1  1239876543211234567894567890123456 6E-14  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375016 fma  1  1239876543211234567894567890123456 6E-15  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375017 fma  1  1239876543211234567894567890123456 6E-16  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375018 fma  1  1239876543211234567894567890123456 6E-17  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375019 fma  1  1239876543211234567894567890123456 6E-18  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375020 fma  1  1239876543211234567894567890123456 6E-19  -> 1239876543211234567894567890123456  Inexact Rounded\r
+dqadd375021 fma  1  1239876543211234567894567890123456 6E-20  -> 1239876543211234567894567890123456  Inexact Rounded\r
+\r
+-- widening second argument at gap\r
+dqadd375030 fma  1  12398765432112345678945678 1                       -> 12398765432112345678945679\r
+dqadd375031 fma  1  12398765432112345678945678 0.1                     -> 12398765432112345678945678.1\r
+dqadd375032 fma  1  12398765432112345678945678 0.12                    -> 12398765432112345678945678.12\r
+dqadd375033 fma  1  12398765432112345678945678 0.123                   -> 12398765432112345678945678.123\r
+dqadd375034 fma  1  12398765432112345678945678 0.1234                  -> 12398765432112345678945678.1234\r
+dqadd375035 fma  1  12398765432112345678945678 0.12345                 -> 12398765432112345678945678.12345\r
+dqadd375036 fma  1  12398765432112345678945678 0.123456                -> 12398765432112345678945678.123456\r
+dqadd375037 fma  1  12398765432112345678945678 0.1234567               -> 12398765432112345678945678.1234567\r
+dqadd375038 fma  1  12398765432112345678945678 0.12345678              -> 12398765432112345678945678.12345678\r
+dqadd375039 fma  1  12398765432112345678945678 0.123456789             -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375040 fma  1  12398765432112345678945678 0.123456785             -> 12398765432112345678945678.12345678 Inexact Rounded\r
+dqadd375041 fma  1  12398765432112345678945678 0.1234567850            -> 12398765432112345678945678.12345678 Inexact Rounded\r
+dqadd375042 fma  1  12398765432112345678945678 0.1234567851            -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375043 fma  1  12398765432112345678945678 0.12345678501           -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375044 fma  1  12398765432112345678945678 0.123456785001          -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375045 fma  1  12398765432112345678945678 0.1234567850001         -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375046 fma  1  12398765432112345678945678 0.12345678500001        -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375047 fma  1  12398765432112345678945678 0.123456785000001       -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375048 fma  1  12398765432112345678945678 0.1234567850000001      -> 12398765432112345678945678.12345679 Inexact Rounded\r
+dqadd375049 fma  1  12398765432112345678945678 0.1234567850000000      -> 12398765432112345678945678.12345678 Inexact Rounded\r
+--                               90123456\r
+rounding: half_even\r
+dqadd375050 fma  1  12398765432112345678945678 0.0234567750000000      -> 12398765432112345678945678.02345678 Inexact Rounded\r
+dqadd375051 fma  1  12398765432112345678945678 0.0034567750000000      -> 12398765432112345678945678.00345678 Inexact Rounded\r
+dqadd375052 fma  1  12398765432112345678945678 0.0004567750000000      -> 12398765432112345678945678.00045678 Inexact Rounded\r
+dqadd375053 fma  1  12398765432112345678945678 0.0000567750000000      -> 12398765432112345678945678.00005678 Inexact Rounded\r
+dqadd375054 fma  1  12398765432112345678945678 0.0000067750000000      -> 12398765432112345678945678.00000678 Inexact Rounded\r
+dqadd375055 fma  1  12398765432112345678945678 0.0000007750000000      -> 12398765432112345678945678.00000078 Inexact Rounded\r
+dqadd375056 fma  1  12398765432112345678945678 0.0000000750000000      -> 12398765432112345678945678.00000008 Inexact Rounded\r
+dqadd375057 fma  1  12398765432112345678945678 0.0000000050000000      -> 12398765432112345678945678.00000000 Inexact Rounded\r
+dqadd375060 fma  1  12398765432112345678945678 0.0234567750000001      -> 12398765432112345678945678.02345678 Inexact Rounded\r
+dqadd375061 fma  1  12398765432112345678945678 0.0034567750000001      -> 12398765432112345678945678.00345678 Inexact Rounded\r
+dqadd375062 fma  1  12398765432112345678945678 0.0004567750000001      -> 12398765432112345678945678.00045678 Inexact Rounded\r
+dqadd375063 fma  1  12398765432112345678945678 0.0000567750000001      -> 12398765432112345678945678.00005678 Inexact Rounded\r
+dqadd375064 fma  1  12398765432112345678945678 0.0000067750000001      -> 12398765432112345678945678.00000678 Inexact Rounded\r
+dqadd375065 fma  1  12398765432112345678945678 0.0000007750000001      -> 12398765432112345678945678.00000078 Inexact Rounded\r
+dqadd375066 fma  1  12398765432112345678945678 0.0000000750000001      -> 12398765432112345678945678.00000008 Inexact Rounded\r
+dqadd375067 fma  1  12398765432112345678945678 0.0000000050000001      -> 12398765432112345678945678.00000001 Inexact Rounded\r
+-- far-out residues (full coefficient gap is 16+15 digits)\r
+rounding: up\r
+dqadd375070 fma  1  12398765432112345678945678 1E-8                    -> 12398765432112345678945678.00000001\r
+dqadd375071 fma  1  12398765432112345678945678 1E-9                    -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375072 fma  1  12398765432112345678945678 1E-10                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375073 fma  1  12398765432112345678945678 1E-11                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375074 fma  1  12398765432112345678945678 1E-12                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375075 fma  1  12398765432112345678945678 1E-13                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375076 fma  1  12398765432112345678945678 1E-14                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375077 fma  1  12398765432112345678945678 1E-15                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375078 fma  1  12398765432112345678945678 1E-16                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375079 fma  1  12398765432112345678945678 1E-17                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375080 fma  1  12398765432112345678945678 1E-18                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375081 fma  1  12398765432112345678945678 1E-19                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375082 fma  1  12398765432112345678945678 1E-20                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375083 fma  1  12398765432112345678945678 1E-25                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375084 fma  1  12398765432112345678945678 1E-30                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375085 fma  1  12398765432112345678945678 1E-31                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375086 fma  1  12398765432112345678945678 1E-32                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375087 fma  1  12398765432112345678945678 1E-33                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375088 fma  1  12398765432112345678945678 1E-34                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+dqadd375089 fma  1  12398765432112345678945678 1E-35                   -> 12398765432112345678945678.00000001 Inexact Rounded\r
+\r
+-- Null tests\r
+dqadd39990 fma  1  10  # -> NaN Invalid_operation\r
+dqadd39991 fma  1   # 10 -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dqInvert.decTest b/Lib/test/decimaltestdata/dqInvert.decTest
new file mode 100644 (file)
index 0000000..94ba93c
--- /dev/null
@@ -0,0 +1,245 @@
+------------------------------------------------------------------------\r
+-- dqInvert.decTest -- digitwise logical INVERT for decQuads          --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+dqinv001 invert             0 -> 1111111111111111111111111111111111\r
+dqinv002 invert             1 -> 1111111111111111111111111111111110\r
+dqinv003 invert            10 -> 1111111111111111111111111111111101\r
+dqinv004 invert     111111111 -> 1111111111111111111111111000000000\r
+dqinv005 invert     000000000 -> 1111111111111111111111111111111111\r
+-- and at msd and msd-1\r
+dqinv007 invert 0000000000000000000000000000000000 ->   1111111111111111111111111111111111\r
+dqinv008 invert 1000000000000000000000000000000000 ->    111111111111111111111111111111111\r
+dqinv009 invert 0000000000000000000000000000000000 ->   1111111111111111111111111111111111\r
+dqinv010 invert 0100000000000000000000000000000000 ->   1011111111111111111111111111111111\r
+dqinv011 invert 0111111111111111111111111111111111 ->   1000000000000000000000000000000000\r
+dqinv012 invert 1111111111111111111111111111111111 ->                  0\r
+dqinv013 invert 0011111111111111111111111111111111 ->   1100000000000000000000000000000000\r
+dqinv014 invert 0111111111111111111111111111111111 ->   1000000000000000000000000000000000\r
+\r
+-- Various lengths\r
+dqinv600 invert 0111111111111111111011111111111111 ->   1000000000000000000100000000000000\r
+dqinv601 invert 0011111111111111110101111111111111 ->   1100000000000000001010000000000000\r
+dqinv602 invert 0101111111111111101110111111111111 ->   1010000000000000010001000000000000\r
+dqinv603 invert 0110111111111111011111011111111111 ->   1001000000000000100000100000000000\r
+dqinv604 invert 0111011111111110111111101111111111 ->   1000100000000001000000010000000000\r
+dqinv605 invert 0111101111111101111111110111111111 ->   1000010000000010000000001000000000\r
+dqinv606 invert 0111110111111011111111111011111111 ->   1000001000000100000000000100000000\r
+dqinv607 invert 0111111011110111111111111101111111 ->   1000000100001000000000000010000000\r
+dqinv608 invert 0111111101101111111111111110111111 ->   1000000010010000000000000001000000\r
+dqinv609 invert 0111111110011111111111111111011111 ->   1000000001100000000000000000100000\r
+dqinv610 invert 0111111110011111111111111111101111 ->   1000000001100000000000000000010000\r
+dqinv611 invert 0111111101101111111111111111110111 ->   1000000010010000000000000000001000\r
+dqinv612 invert 0111111011110111111111111111111011 ->   1000000100001000000000000000000100\r
+dqinv613 invert 0111110111111011111111111111111101 ->   1000001000000100000000000000000010\r
+dqinv614 invert 0111101111111101111111111111111110 ->   1000010000000010000000000000000001\r
+dqinv615 invert 0111011111111110111111111111111111 ->   1000100000000001000000000000000000\r
+dqinv616 invert 0110111111111111011111111111111110 ->   1001000000000000100000000000000001\r
+dqinv617 invert 0101111111111111101111111111111101 ->   1010000000000000010000000000000010\r
+dqinv618 invert 0011111111111111110111111111111011 ->   1100000000000000001000000000000100\r
+dqinv619 invert 0101111111111111111011111111110111 ->   1010000000000000000100000000001000\r
+dqinv620 invert 0110111111111111111101111111101111 ->   1001000000000000000010000000010000\r
+dqinv621 invert 0111011111111111111110111111011111 ->   1000100000000000000001000000100000\r
+dqinv622 invert 0111101111111111111111011110111111 ->   1000010000000000000000100001000000\r
+dqinv623 invert 0111110111111111111111101101111111 ->   1000001000000000000000010010000000\r
+dqinv624 invert 0111111011111111111111110011111111 ->   1000000100000000000000001100000000\r
+dqinv625 invert 0111111101111111111111110011111111 ->   1000000010000000000000001100000000\r
+dqinv626 invert 0111111110111111111111101101111111 ->   1000000001000000000000010010000000\r
+dqinv627 invert 0111111111011111111111011110111111 ->   1000000000100000000000100001000000\r
+dqinv628 invert 0111111111101111111110111111011111 ->   1000000000010000000001000000100000\r
+dqinv629 invert 0111111111110111111101111111101111 ->   1000000000001000000010000000010000\r
+dqinv630 invert 0111111111111011111011111111110111 ->   1000000000000100000100000000001000\r
+dqinv631 invert 0111111111111101110111111111111011 ->   1000000000000010001000000000000100\r
+dqinv632 invert 0111111111111110101111111111111101 ->   1000000000000001010000000000000010\r
+dqinv633 invert 0111111111111111011111111111111110 ->   1000000000000000100000000000000001\r
+\r
+dqinv021 invert 111111111     -> 1111111111111111111111111000000000\r
+dqinv022 invert 111111111111  -> 1111111111111111111111000000000000\r
+dqinv023 invert  11111111     -> 1111111111111111111111111100000000\r
+dqinv025 invert   1111111     -> 1111111111111111111111111110000000\r
+dqinv026 invert    111111     -> 1111111111111111111111111111000000\r
+dqinv027 invert     11111     -> 1111111111111111111111111111100000\r
+dqinv028 invert      1111     -> 1111111111111111111111111111110000\r
+dqinv029 invert       111     -> 1111111111111111111111111111111000\r
+dqinv031 invert        11     -> 1111111111111111111111111111111100\r
+dqinv032 invert         1     -> 1111111111111111111111111111111110\r
+dqinv033 invert 111111111111  -> 1111111111111111111111000000000000\r
+dqinv034 invert 11111111111   -> 1111111111111111111111100000000000\r
+dqinv035 invert 1111111111    -> 1111111111111111111111110000000000\r
+dqinv036 invert 111111111     -> 1111111111111111111111111000000000\r
+\r
+dqinv040 invert 011111111   -> 1111111111111111111111111100000000\r
+dqinv041 invert 101111111   -> 1111111111111111111111111010000000\r
+dqinv042 invert 110111111   -> 1111111111111111111111111001000000\r
+dqinv043 invert 111011111   -> 1111111111111111111111111000100000\r
+dqinv044 invert 111101111   -> 1111111111111111111111111000010000\r
+dqinv045 invert 111110111   -> 1111111111111111111111111000001000\r
+dqinv046 invert 111111011   -> 1111111111111111111111111000000100\r
+dqinv047 invert 111111101   -> 1111111111111111111111111000000010\r
+dqinv048 invert 111111110   -> 1111111111111111111111111000000001\r
+dqinv049 invert 011111011   -> 1111111111111111111111111100000100\r
+dqinv050 invert 101111101   -> 1111111111111111111111111010000010\r
+dqinv051 invert 110111110   -> 1111111111111111111111111001000001\r
+dqinv052 invert 111011101   -> 1111111111111111111111111000100010\r
+dqinv053 invert 111101011   -> 1111111111111111111111111000010100\r
+dqinv054 invert 111110111   -> 1111111111111111111111111000001000\r
+dqinv055 invert 111101011   -> 1111111111111111111111111000010100\r
+dqinv056 invert 111011101   -> 1111111111111111111111111000100010\r
+dqinv057 invert 110111110   -> 1111111111111111111111111001000001\r
+dqinv058 invert 101111101   -> 1111111111111111111111111010000010\r
+dqinv059 invert 011111011   -> 1111111111111111111111111100000100\r
+\r
+dqinv080 invert 1000000011111111   -> 1111111111111111110111111100000000\r
+dqinv081 invert 0100000101111111   -> 1111111111111111111011111010000000\r
+dqinv082 invert 0010000110111111   -> 1111111111111111111101111001000000\r
+dqinv083 invert 0001000111011111   -> 1111111111111111111110111000100000\r
+dqinv084 invert 0000100111101111   -> 1111111111111111111111011000010000\r
+dqinv085 invert 0000010111110111   -> 1111111111111111111111101000001000\r
+dqinv086 invert 0000001111111011   -> 1111111111111111111111110000000100\r
+dqinv087 invert 0000010111111101   -> 1111111111111111111111101000000010\r
+dqinv088 invert 0000100111111110   -> 1111111111111111111111011000000001\r
+dqinv089 invert 0001000011111011   -> 1111111111111111111110111100000100\r
+dqinv090 invert 0010000101111101   -> 1111111111111111111101111010000010\r
+dqinv091 invert 0100000110111110   -> 1111111111111111111011111001000001\r
+dqinv092 invert 1000000111011101   -> 1111111111111111110111111000100010\r
+dqinv093 invert 0100000111101011   -> 1111111111111111111011111000010100\r
+dqinv094 invert 0010000111110111   -> 1111111111111111111101111000001000\r
+dqinv095 invert 0001000111101011   -> 1111111111111111111110111000010100\r
+dqinv096 invert 0000100111011101   -> 1111111111111111111111011000100010\r
+dqinv097 invert 0000010110111110   -> 1111111111111111111111101001000001\r
+dqinv098 invert 0000001101111101   -> 1111111111111111111111110010000010\r
+dqinv099 invert 0000010011111011   -> 1111111111111111111111101100000100\r
+\r
+-- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...]\r
+dqinv151 invert 1111111111111111111111111111111110 ->                                   1\r
+dqinv152 invert 1111111111111111110000000000000000 ->                    1111111111111111\r
+dqinv153 invert 1000000000000000001111111111111111 ->   111111111111111110000000000000000\r
+dqinv154 invert 1111111111111111111000000000000000 ->                     111111111111111\r
+dqinv155 invert 0100000000000000000111111111111111 ->  1011111111111111111000000000000000\r
+dqinv156 invert 1011111111111111110100000000000000 ->   100000000000000001011111111111111\r
+dqinv157 invert 1101111111111111110111111111111111 ->    10000000000000001000000000000000\r
+dqinv158 invert 1110111111111111110011111111111111 ->     1000000000000001100000000000000\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+dqinv220 invert 111111112   ->  NaN Invalid_operation\r
+dqinv221 invert 333333333   ->  NaN Invalid_operation\r
+dqinv222 invert 555555555   ->  NaN Invalid_operation\r
+dqinv223 invert 777777777   ->  NaN Invalid_operation\r
+dqinv224 invert 999999999   ->  NaN Invalid_operation\r
+dqinv225 invert 222222222   ->  NaN Invalid_operation\r
+dqinv226 invert 444444444   ->  NaN Invalid_operation\r
+dqinv227 invert 666666666   ->  NaN Invalid_operation\r
+dqinv228 invert 888888888   ->  NaN Invalid_operation\r
+dqinv229 invert 999999999   ->  NaN Invalid_operation\r
+dqinv230 invert 999999999   ->  NaN Invalid_operation\r
+dqinv231 invert 999999999   ->  NaN Invalid_operation\r
+dqinv232 invert 999999999   ->  NaN Invalid_operation\r
+-- a few randoms\r
+dqinv240 invert  567468689  ->  NaN Invalid_operation\r
+dqinv241 invert  567367689  ->  NaN Invalid_operation\r
+dqinv242 invert -631917772  ->  NaN Invalid_operation\r
+dqinv243 invert -756253257  ->  NaN Invalid_operation\r
+dqinv244 invert  835590149  ->  NaN Invalid_operation\r
+-- test MSD\r
+dqinv250 invert  2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv251 invert  3000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv252 invert  4000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv253 invert  5000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv254 invert  6000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv255 invert  7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv256 invert  8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqinv257 invert  9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+dqinv270 invert  0200000111000111000111001000000000 ->  NaN Invalid_operation\r
+dqinv271 invert  0300000111000111000111000100000000 ->  NaN Invalid_operation\r
+dqinv272 invert  0400000111000111000111000010000000 ->  NaN Invalid_operation\r
+dqinv273 invert  0500000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqinv274 invert  1600000111000111000111000000100000 ->  NaN Invalid_operation\r
+dqinv275 invert  1700000111000111000111000000010000 ->  NaN Invalid_operation\r
+dqinv276 invert  1800000111000111000111000000001000 ->  NaN Invalid_operation\r
+dqinv277 invert  1900000111000111000111000000000100 ->  NaN Invalid_operation\r
+-- test LSD\r
+dqinv280 invert  0010000111000111000111000000000002 ->  NaN Invalid_operation\r
+dqinv281 invert  0001000111000111000111000000000003 ->  NaN Invalid_operation\r
+dqinv282 invert  0000000111000111000111100000000004 ->  NaN Invalid_operation\r
+dqinv283 invert  0000000111000111000111010000000005 ->  NaN Invalid_operation\r
+dqinv284 invert  1000000111000111000111001000000006 ->  NaN Invalid_operation\r
+dqinv285 invert  1000000111000111000111000100000007 ->  NaN Invalid_operation\r
+dqinv286 invert  1000000111000111000111000010000008 ->  NaN Invalid_operation\r
+dqinv287 invert  1000000111000111000111000001000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+dqinv288 invert  0010000111000111000111000020000000 ->  NaN Invalid_operation\r
+dqinv289 invert  0001000111000111000111000030000001 ->  NaN Invalid_operation\r
+dqinv290 invert  0000000111000111000111100040000010 ->  NaN Invalid_operation\r
+dqinv291 invert  0000000111000111000111010050000100 ->  NaN Invalid_operation\r
+dqinv292 invert  1000000111000111000111001060001000 ->  NaN Invalid_operation\r
+dqinv293 invert  1000000111000111000111000170010000 ->  NaN Invalid_operation\r
+dqinv294 invert  1000000111000111000111000080100000 ->  NaN Invalid_operation\r
+dqinv295 invert  1000000111000111000111000091000000 ->  NaN Invalid_operation\r
+-- signs\r
+dqinv296 invert -1000000111000111000111000001000000  ->  NaN Invalid_operation\r
+dqinv299 invert  1000000111000111000111000001000000  ->  111111000111000111000111110111111\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+dqinv341 invert  9.99999999E+2998  -> NaN Invalid_operation\r
+dqinv342 invert  1E-2998           -> NaN Invalid_operation\r
+dqinv343 invert  1.00000000E-2998  -> NaN Invalid_operation\r
+dqinv344 invert  1E-2078           -> NaN Invalid_operation\r
+dqinv345 invert  -1E-2078          -> NaN Invalid_operation\r
+dqinv346 invert  -1.00000000E-2998 -> NaN Invalid_operation\r
+dqinv347 invert  -1E-2998          -> NaN Invalid_operation\r
+dqinv348 invert  -9.99999999E+2998 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+dqinv361 invert  1.0               -> NaN Invalid_operation\r
+dqinv362 invert  1E+1              -> NaN Invalid_operation\r
+dqinv363 invert  0.0               -> NaN Invalid_operation\r
+dqinv364 invert  0E+1              -> NaN Invalid_operation\r
+dqinv365 invert  9.9               -> NaN Invalid_operation\r
+dqinv366 invert  9E+1              -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+dqinv788 invert -Inf     -> NaN  Invalid_operation\r
+dqinv794 invert  Inf     -> NaN  Invalid_operation\r
+dqinv821 invert  NaN     -> NaN  Invalid_operation\r
+dqinv841 invert  sNaN    -> NaN  Invalid_operation\r
+-- propagating NaNs\r
+dqinv861 invert  NaN1    -> NaN Invalid_operation\r
+dqinv862 invert +NaN2    -> NaN Invalid_operation\r
+dqinv863 invert  NaN3    -> NaN Invalid_operation\r
+dqinv864 invert  NaN4    -> NaN Invalid_operation\r
+dqinv865 invert  NaN5    -> NaN Invalid_operation\r
+dqinv871 invert  sNaN11  -> NaN Invalid_operation\r
+dqinv872 invert  sNaN12  -> NaN Invalid_operation\r
+dqinv873 invert  sNaN13  -> NaN Invalid_operation\r
+dqinv874 invert  sNaN14  -> NaN Invalid_operation\r
+dqinv875 invert  sNaN15  -> NaN Invalid_operation\r
+dqinv876 invert  NaN16   -> NaN Invalid_operation\r
+dqinv881 invert +NaN25   -> NaN Invalid_operation\r
+dqinv882 invert -NaN26   -> NaN Invalid_operation\r
+dqinv883 invert -sNaN27  -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqLogB.decTest b/Lib/test/decimaltestdata/dqLogB.decTest
new file mode 100644 (file)
index 0000000..baa6d1e
--- /dev/null
@@ -0,0 +1,160 @@
+------------------------------------------------------------------------\r
+-- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads    --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- basics\r
+dqlogb000 logb  0                 -> -Infinity  Division_by_zero\r
+dqlogb001 logb  1E-6176           -> -6176\r
+dqlogb002 logb  1E-6143           -> -6143\r
+dqlogb003 logb  0.001             -> -3\r
+dqlogb004 logb  0.03              -> -2\r
+dqlogb005 logb  1                 ->  0\r
+dqlogb006 logb  2                 ->  0\r
+dqlogb007 logb  2.5               ->  0\r
+dqlogb008 logb  2.50              ->  0\r
+dqlogb009 logb  2.500             ->  0\r
+dqlogb010 logb  10                ->  1\r
+dqlogb011 logb  70                ->  1\r
+dqlogb012 logb  100               ->  2\r
+dqlogb013 logb  250               ->  2\r
+dqlogb014 logb  9E+6144           ->  6144\r
+dqlogb015 logb +Infinity          ->  Infinity\r
+\r
+-- negatives appear to be treated as positives\r
+dqlogb021 logb -0                 -> -Infinity  Division_by_zero\r
+dqlogb022 logb -1E-6176           -> -6176\r
+dqlogb023 logb -9E-6143           -> -6143\r
+dqlogb024 logb -0.001             -> -3\r
+dqlogb025 logb -1                 ->  0\r
+dqlogb026 logb -2                 ->  0\r
+dqlogb027 logb -10                ->  1\r
+dqlogb028 logb -70                ->  1\r
+dqlogb029 logb -100               ->  2\r
+dqlogb030 logb -9E+6144           ->  6144\r
+dqlogb031 logb -Infinity          ->  Infinity\r
+\r
+-- zeros\r
+dqlogb111 logb          0   -> -Infinity  Division_by_zero\r
+dqlogb112 logb         -0   -> -Infinity  Division_by_zero\r
+dqlogb113 logb       0E+4   -> -Infinity  Division_by_zero\r
+dqlogb114 logb      -0E+4   -> -Infinity  Division_by_zero\r
+dqlogb115 logb     0.0000   -> -Infinity  Division_by_zero\r
+dqlogb116 logb    -0.0000   -> -Infinity  Division_by_zero\r
+dqlogb117 logb      0E-141  -> -Infinity  Division_by_zero\r
+dqlogb118 logb     -0E-141  -> -Infinity  Division_by_zero\r
+\r
+-- full coefficients, alternating bits\r
+dqlogb121 logb   268268268        -> 8\r
+dqlogb122 logb  -268268268        -> 8\r
+dqlogb123 logb   134134134        -> 8\r
+dqlogb124 logb  -134134134        -> 8\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqlogb131 logb  9.999999999999999999999999999999999E+6144   ->  6144\r
+dqlogb132 logb  1E-6143                   -> -6143\r
+dqlogb133 logb  1.000000000000000000000000000000000E-6143   -> -6143\r
+dqlogb134 logb  1E-6176                   -> -6176\r
+\r
+dqlogb135 logb  -1E-6176                  -> -6176\r
+dqlogb136 logb  -1.000000000000000000000000000000000E-6143  -> -6143\r
+dqlogb137 logb  -1E-6143                  -> -6143\r
+dqlogb1614 logb  -9.999999999999999999999999999999999E+6144  ->  6144\r
+\r
+-- ones\r
+dqlogb0061 logb  1                 ->   0\r
+dqlogb0062 logb  1.0               ->   0\r
+dqlogb0063 logb  1.000000000000000 ->   0\r
+\r
+-- notable cases -- exact powers of 10\r
+dqlogb1100 logb 1             -> 0\r
+dqlogb1101 logb 10            -> 1\r
+dqlogb1102 logb 100           -> 2\r
+dqlogb1103 logb 1000          -> 3\r
+dqlogb1104 logb 10000         -> 4\r
+dqlogb1105 logb 100000        -> 5\r
+dqlogb1106 logb 1000000       -> 6\r
+dqlogb1107 logb 10000000      -> 7\r
+dqlogb1108 logb 100000000     -> 8\r
+dqlogb1109 logb 1000000000    -> 9\r
+dqlogb1110 logb 10000000000   -> 10\r
+dqlogb1111 logb 100000000000  -> 11\r
+dqlogb1112 logb 1000000000000 -> 12\r
+dqlogb1113 logb 0.00000000001 -> -11\r
+dqlogb1114 logb 0.0000000001 -> -10\r
+dqlogb1115 logb 0.000000001 -> -9\r
+dqlogb1116 logb 0.00000001 -> -8\r
+dqlogb1117 logb 0.0000001 -> -7\r
+dqlogb1118 logb 0.000001 -> -6\r
+dqlogb1119 logb 0.00001 -> -5\r
+dqlogb1120 logb 0.0001 -> -4\r
+dqlogb1121 logb 0.001 -> -3\r
+dqlogb1122 logb 0.01 -> -2\r
+dqlogb1123 logb 0.1 -> -1\r
+dqlogb1124 logb 1E-99  -> -99\r
+dqlogb1125 logb 1E-100 -> -100\r
+dqlogb1127 logb 1E-299 -> -299\r
+dqlogb1126 logb 1E-6143 -> -6143\r
+\r
+-- suggestions from Ilan Nehama\r
+dqlogb1400 logb 10E-3    -> -2\r
+dqlogb1401 logb 10E-2    -> -1\r
+dqlogb1402 logb 100E-2   ->  0\r
+dqlogb1403 logb 1000E-2  ->  1\r
+dqlogb1404 logb 10000E-2 ->  2\r
+dqlogb1405 logb 10E-1    ->  0\r
+dqlogb1406 logb 100E-1   ->  1\r
+dqlogb1407 logb 1000E-1  ->  2\r
+dqlogb1408 logb 10000E-1 ->  3\r
+dqlogb1409 logb 10E0     ->  1\r
+dqlogb1410 logb 100E0    ->  2\r
+dqlogb1411 logb 1000E0   ->  3\r
+dqlogb1412 logb 10000E0  ->  4\r
+dqlogb1413 logb 10E1     ->  2\r
+dqlogb1414 logb 100E1    ->  3\r
+dqlogb1415 logb 1000E1   ->  4\r
+dqlogb1416 logb 10000E1  ->  5\r
+dqlogb1417 logb 10E2     ->  3\r
+dqlogb1418 logb 100E2    ->  4\r
+dqlogb1419 logb 1000E2   ->  5\r
+dqlogb1420 logb 10000E2  ->  6\r
+\r
+-- special values\r
+dqlogb820  logb   Infinity ->   Infinity\r
+dqlogb821  logb   0        ->  -Infinity Division_by_zero\r
+dqlogb822  logb   NaN      ->   NaN\r
+dqlogb823  logb   sNaN     ->   NaN     Invalid_operation\r
+-- propagating NaNs\r
+dqlogb824  logb   sNaN123  ->   NaN123  Invalid_operation\r
+dqlogb825  logb   -sNaN321 ->  -NaN321  Invalid_operation\r
+dqlogb826  logb   NaN456   ->   NaN456\r
+dqlogb827  logb   -NaN654  ->  -NaN654\r
+dqlogb828  logb   NaN1     ->   NaN1\r
+\r
+-- Null test\r
+dqlogb900  logb #   -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dqMax.decTest b/Lib/test/decimaltestdata/dqMax.decTest
new file mode 100644 (file)
index 0000000..a00ec1c
--- /dev/null
@@ -0,0 +1,322 @@
+------------------------------------------------------------------------\r
+-- dqMax.decTest -- decQuad maxnum                                    --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqmax001 max  -2  -2  -> -2\r
+dqmax002 max  -2  -1  -> -1\r
+dqmax003 max  -2   0  ->  0\r
+dqmax004 max  -2   1  ->  1\r
+dqmax005 max  -2   2  ->  2\r
+dqmax006 max  -1  -2  -> -1\r
+dqmax007 max  -1  -1  -> -1\r
+dqmax008 max  -1   0  ->  0\r
+dqmax009 max  -1   1  ->  1\r
+dqmax010 max  -1   2  ->  2\r
+dqmax011 max   0  -2  ->  0\r
+dqmax012 max   0  -1  ->  0\r
+dqmax013 max   0   0  ->  0\r
+dqmax014 max   0   1  ->  1\r
+dqmax015 max   0   2  ->  2\r
+dqmax016 max   1  -2  ->  1\r
+dqmax017 max   1  -1  ->  1\r
+dqmax018 max   1   0  ->  1\r
+dqmax019 max   1   1  ->  1\r
+dqmax020 max   1   2  ->  2\r
+dqmax021 max   2  -2  ->  2\r
+dqmax022 max   2  -1  ->  2\r
+dqmax023 max   2   0  ->  2\r
+dqmax025 max   2   1  ->  2\r
+dqmax026 max   2   2  ->  2\r
+\r
+-- extended zeros\r
+dqmax030 max   0     0   ->  0\r
+dqmax031 max   0    -0   ->  0\r
+dqmax032 max   0    -0.0 ->  0\r
+dqmax033 max   0     0.0 ->  0\r
+dqmax034 max  -0     0   ->  0    -- note: -0 = 0, but 0 chosen\r
+dqmax035 max  -0    -0   -> -0\r
+dqmax036 max  -0    -0.0 -> -0.0\r
+dqmax037 max  -0     0.0 ->  0.0\r
+dqmax038 max   0.0   0   ->  0\r
+dqmax039 max   0.0  -0   ->  0.0\r
+dqmax040 max   0.0  -0.0 ->  0.0\r
+dqmax041 max   0.0   0.0 ->  0.0\r
+dqmax042 max  -0.0   0   ->  0\r
+dqmax043 max  -0.0  -0   -> -0.0\r
+dqmax044 max  -0.0  -0.0 -> -0.0\r
+dqmax045 max  -0.0   0.0 ->  0.0\r
+\r
+dqmax050 max  -0E1   0E1 ->  0E+1\r
+dqmax051 max  -0E2   0E2 ->  0E+2\r
+dqmax052 max  -0E2   0E1 ->  0E+1\r
+dqmax053 max  -0E1   0E2 ->  0E+2\r
+dqmax054 max   0E1  -0E1 ->  0E+1\r
+dqmax055 max   0E2  -0E2 ->  0E+2\r
+dqmax056 max   0E2  -0E1 ->  0E+2\r
+dqmax057 max   0E1  -0E2 ->  0E+1\r
+\r
+dqmax058 max   0E1   0E1 ->  0E+1\r
+dqmax059 max   0E2   0E2 ->  0E+2\r
+dqmax060 max   0E2   0E1 ->  0E+2\r
+dqmax061 max   0E1   0E2 ->  0E+2\r
+dqmax062 max  -0E1  -0E1 -> -0E+1\r
+dqmax063 max  -0E2  -0E2 -> -0E+2\r
+dqmax064 max  -0E2  -0E1 -> -0E+1\r
+dqmax065 max  -0E1  -0E2 -> -0E+1\r
+\r
+-- Specials\r
+dqmax090 max  Inf  -Inf   ->  Infinity\r
+dqmax091 max  Inf  -1000  ->  Infinity\r
+dqmax092 max  Inf  -1     ->  Infinity\r
+dqmax093 max  Inf  -0     ->  Infinity\r
+dqmax094 max  Inf   0     ->  Infinity\r
+dqmax095 max  Inf   1     ->  Infinity\r
+dqmax096 max  Inf   1000  ->  Infinity\r
+dqmax097 max  Inf   Inf   ->  Infinity\r
+dqmax098 max -1000  Inf   ->  Infinity\r
+dqmax099 max -Inf   Inf   ->  Infinity\r
+dqmax100 max -1     Inf   ->  Infinity\r
+dqmax101 max -0     Inf   ->  Infinity\r
+dqmax102 max  0     Inf   ->  Infinity\r
+dqmax103 max  1     Inf   ->  Infinity\r
+dqmax104 max  1000  Inf   ->  Infinity\r
+dqmax105 max  Inf   Inf   ->  Infinity\r
+\r
+dqmax120 max -Inf  -Inf   -> -Infinity\r
+dqmax121 max -Inf  -1000  -> -1000\r
+dqmax122 max -Inf  -1     -> -1\r
+dqmax123 max -Inf  -0     -> -0\r
+dqmax124 max -Inf   0     ->  0\r
+dqmax125 max -Inf   1     ->  1\r
+dqmax126 max -Inf   1000  ->  1000\r
+dqmax127 max -Inf   Inf   ->  Infinity\r
+dqmax128 max -Inf  -Inf   ->  -Infinity\r
+dqmax129 max -1000 -Inf   ->  -1000\r
+dqmax130 max -1    -Inf   ->  -1\r
+dqmax131 max -0    -Inf   ->  -0\r
+dqmax132 max  0    -Inf   ->  0\r
+dqmax133 max  1    -Inf   ->  1\r
+dqmax134 max  1000 -Inf   ->  1000\r
+dqmax135 max  Inf  -Inf   ->  Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+dqmax141 max  NaN -Inf    -> -Infinity\r
+dqmax142 max  NaN -1000   -> -1000\r
+dqmax143 max  NaN -1      -> -1\r
+dqmax144 max  NaN -0      -> -0\r
+dqmax145 max  NaN  0      ->  0\r
+dqmax146 max  NaN  1      ->  1\r
+dqmax147 max  NaN  1000   ->  1000\r
+dqmax148 max  NaN  Inf    ->  Infinity\r
+dqmax149 max  NaN  NaN    ->  NaN\r
+dqmax150 max -Inf  NaN    -> -Infinity\r
+dqmax151 max -1000 NaN    -> -1000\r
+dqmax152 max -1    NaN    -> -1\r
+dqmax153 max -0    NaN    -> -0\r
+dqmax154 max  0    NaN    ->  0\r
+dqmax155 max  1    NaN    ->  1\r
+dqmax156 max  1000 NaN    ->  1000\r
+dqmax157 max  Inf  NaN    ->  Infinity\r
+\r
+dqmax161 max  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqmax162 max  sNaN -1000  ->  NaN  Invalid_operation\r
+dqmax163 max  sNaN -1     ->  NaN  Invalid_operation\r
+dqmax164 max  sNaN -0     ->  NaN  Invalid_operation\r
+dqmax165 max  sNaN  0     ->  NaN  Invalid_operation\r
+dqmax166 max  sNaN  1     ->  NaN  Invalid_operation\r
+dqmax167 max  sNaN  1000  ->  NaN  Invalid_operation\r
+dqmax168 max  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqmax169 max  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqmax170 max  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqmax171 max -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmax172 max -1000 sNaN   ->  NaN  Invalid_operation\r
+dqmax173 max -1    sNaN   ->  NaN  Invalid_operation\r
+dqmax174 max -0    sNaN   ->  NaN  Invalid_operation\r
+dqmax175 max  0    sNaN   ->  NaN  Invalid_operation\r
+dqmax176 max  1    sNaN   ->  NaN  Invalid_operation\r
+dqmax177 max  1000 sNaN   ->  NaN  Invalid_operation\r
+dqmax178 max  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmax179 max  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqmax181 max  NaN9  -Inf   -> -Infinity\r
+dqmax182 max  NaN8     9   ->  9\r
+dqmax183 max -NaN7   Inf   ->  Infinity\r
+\r
+dqmax184 max -NaN1   NaN11 -> -NaN1\r
+dqmax185 max  NaN2   NaN12 ->  NaN2\r
+dqmax186 max -NaN13 -NaN7  -> -NaN13\r
+dqmax187 max  NaN14 -NaN5  ->  NaN14\r
+\r
+dqmax188 max -Inf    NaN4  -> -Infinity\r
+dqmax189 max -9     -NaN3  -> -9\r
+dqmax190 max  Inf    NaN2  ->  Infinity\r
+\r
+dqmax191 max  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqmax192 max  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dqmax193 max -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dqmax194 max  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dqmax195 max  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqmax196 max -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqmax197 max  0      sNaN91  ->  NaN91 Invalid_operation\r
+dqmax198 max  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqmax199 max  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- old rounding checks\r
+dqmax221 max 12345678000 1  -> 12345678000\r
+dqmax222 max 1 12345678000  -> 12345678000\r
+dqmax223 max 1234567800  1  -> 1234567800\r
+dqmax224 max 1 1234567800   -> 1234567800\r
+dqmax225 max 1234567890  1  -> 1234567890\r
+dqmax226 max 1 1234567890   -> 1234567890\r
+dqmax227 max 1234567891  1  -> 1234567891\r
+dqmax228 max 1 1234567891   -> 1234567891\r
+dqmax229 max 12345678901 1  -> 12345678901\r
+dqmax230 max 1 12345678901  -> 12345678901\r
+dqmax231 max 1234567896  1  -> 1234567896\r
+dqmax232 max 1 1234567896   -> 1234567896\r
+dqmax233 max -1234567891  1 -> 1\r
+dqmax234 max 1 -1234567891  -> 1\r
+dqmax235 max -12345678901 1 -> 1\r
+dqmax236 max 1 -12345678901 -> 1\r
+dqmax237 max -1234567896  1 -> 1\r
+dqmax238 max 1 -1234567896  -> 1\r
+\r
+-- from examples\r
+dqmax280 max '3'   '2'  ->  '3'\r
+dqmax281 max '-10' '3'  ->  '3'\r
+dqmax282 max '1.0' '1'  ->  '1'\r
+dqmax283 max '1' '1.0'  ->  '1'\r
+dqmax284 max '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+dqmax401 max  Inf    1.1     ->  Infinity\r
+dqmax402 max  1.1    1       ->  1.1\r
+dqmax403 max  1      1.0     ->  1\r
+dqmax404 max  1.0    0.1     ->  1.0\r
+dqmax405 max  0.1    0.10    ->  0.1\r
+dqmax406 max  0.10   0.100   ->  0.10\r
+dqmax407 max  0.10   0       ->  0.10\r
+dqmax408 max  0      0.0     ->  0\r
+dqmax409 max  0.0   -0       ->  0.0\r
+dqmax410 max  0.0   -0.0     ->  0.0\r
+dqmax411 max  0.00  -0.0     ->  0.00\r
+dqmax412 max  0.0   -0.00    ->  0.0\r
+dqmax413 max  0     -0.0     ->  0\r
+dqmax414 max  0     -0       ->  0\r
+dqmax415 max -0.0   -0       -> -0.0\r
+dqmax416 max -0     -0.100   -> -0\r
+dqmax417 max -0.100 -0.10    -> -0.100\r
+dqmax418 max -0.10  -0.1     -> -0.10\r
+dqmax419 max -0.1   -1.0     -> -0.1\r
+dqmax420 max -1.0   -1       -> -1.0\r
+dqmax421 max -1     -1.1     -> -1\r
+dqmax423 max -1.1   -Inf     -> -1.1\r
+-- same with operands reversed\r
+dqmax431 max  1.1    Inf     ->  Infinity\r
+dqmax432 max  1      1.1     ->  1.1\r
+dqmax433 max  1.0    1       ->  1\r
+dqmax434 max  0.1    1.0     ->  1.0\r
+dqmax435 max  0.10   0.1     ->  0.1\r
+dqmax436 max  0.100  0.10    ->  0.10\r
+dqmax437 max  0      0.10    ->  0.10\r
+dqmax438 max  0.0    0       ->  0\r
+dqmax439 max -0      0.0     ->  0.0\r
+dqmax440 max -0.0    0.0     ->  0.0\r
+dqmax441 max -0.0    0.00    ->  0.00\r
+dqmax442 max -0.00   0.0     ->  0.0\r
+dqmax443 max -0.0    0       ->  0\r
+dqmax444 max -0      0       ->  0\r
+dqmax445 max -0     -0.0     -> -0.0\r
+dqmax446 max -0.100 -0       -> -0\r
+dqmax447 max -0.10  -0.100   -> -0.100\r
+dqmax448 max -0.1   -0.10    -> -0.10\r
+dqmax449 max -1.0   -0.1     -> -0.1\r
+dqmax450 max -1     -1.0     -> -1.0\r
+dqmax451 max -1.1   -1       -> -1\r
+dqmax453 max -Inf   -1.1     -> -1.1\r
+-- largies\r
+dqmax460 max  1000   1E+3    ->  1E+3\r
+dqmax461 max  1E+3   1000    ->  1E+3\r
+dqmax462 max  1000  -1E+3    ->  1000\r
+dqmax463 max  1E+3  -1000    ->  1E+3\r
+dqmax464 max -1000   1E+3    ->  1E+3\r
+dqmax465 max -1E+3   1000    ->  1000\r
+dqmax466 max -1000  -1E+3    -> -1000\r
+dqmax467 max -1E+3  -1000    -> -1000\r
+\r
+-- misalignment traps for little-endian\r
+dqmax471 max      1.0       0.1  -> 1.0\r
+dqmax472 max      0.1       1.0  -> 1.0\r
+dqmax473 max     10.0       0.1  -> 10.0\r
+dqmax474 max      0.1      10.0  -> 10.0\r
+dqmax475 max      100       1.0  -> 100\r
+dqmax476 max      1.0       100  -> 100\r
+dqmax477 max     1000      10.0  -> 1000\r
+dqmax478 max     10.0      1000  -> 1000\r
+dqmax479 max    10000     100.0  -> 10000\r
+dqmax480 max    100.0     10000  -> 10000\r
+dqmax481 max   100000    1000.0  -> 100000\r
+dqmax482 max   1000.0    100000  -> 100000\r
+dqmax483 max  1000000   10000.0  -> 1000000\r
+dqmax484 max  10000.0   1000000  -> 1000000\r
+\r
+-- subnormals\r
+dqmax510 max  1.00E-6143       0  ->   1.00E-6143\r
+dqmax511 max  0.1E-6143        0  ->   1E-6144    Subnormal\r
+dqmax512 max  0.10E-6143       0  ->   1.0E-6144  Subnormal\r
+dqmax513 max  0.100E-6143      0  ->   1.00E-6144 Subnormal\r
+dqmax514 max  0.01E-6143       0  ->   1E-6145    Subnormal\r
+dqmax515 max  0.999E-6143      0  ->   9.99E-6144 Subnormal\r
+dqmax516 max  0.099E-6143      0  ->   9.9E-6145  Subnormal\r
+dqmax517 max  0.009E-6143      0  ->   9E-6146    Subnormal\r
+dqmax518 max  0.001E-6143      0  ->   1E-6146    Subnormal\r
+dqmax519 max  0.0009E-6143     0  ->   9E-6147    Subnormal\r
+dqmax520 max  0.0001E-6143     0  ->   1E-6147    Subnormal\r
+\r
+dqmax530 max -1.00E-6143       0  ->   0\r
+dqmax531 max -0.1E-6143        0  ->   0\r
+dqmax532 max -0.10E-6143       0  ->   0\r
+dqmax533 max -0.100E-6143      0  ->   0\r
+dqmax534 max -0.01E-6143       0  ->   0\r
+dqmax535 max -0.999E-6143      0  ->   0\r
+dqmax536 max -0.099E-6143      0  ->   0\r
+dqmax537 max -0.009E-6143      0  ->   0\r
+dqmax538 max -0.001E-6143      0  ->   0\r
+dqmax539 max -0.0009E-6143     0  ->   0\r
+dqmax540 max -0.0001E-6143     0  ->   0\r
+\r
+-- Null tests\r
+dqmax900 max 10  #  -> NaN Invalid_operation\r
+dqmax901 max  # 10  -> NaN Invalid_operation\r
+\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dqMaxMag.decTest b/Lib/test/decimaltestdata/dqMaxMag.decTest
new file mode 100644 (file)
index 0000000..53eb82c
--- /dev/null
@@ -0,0 +1,304 @@
+------------------------------------------------------------------------\r
+-- dqMaxMag.decTest -- decQuad maxnummag                              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqmxg001 maxmag  -2  -2  -> -2\r
+dqmxg002 maxmag  -2  -1  -> -2\r
+dqmxg003 maxmag  -2   0  -> -2\r
+dqmxg004 maxmag  -2   1  -> -2\r
+dqmxg005 maxmag  -2   2  ->  2\r
+dqmxg006 maxmag  -1  -2  -> -2\r
+dqmxg007 maxmag  -1  -1  -> -1\r
+dqmxg008 maxmag  -1   0  -> -1\r
+dqmxg009 maxmag  -1   1  ->  1\r
+dqmxg010 maxmag  -1   2  ->  2\r
+dqmxg011 maxmag   0  -2  -> -2\r
+dqmxg012 maxmag   0  -1  -> -1\r
+dqmxg013 maxmag   0   0  ->  0\r
+dqmxg014 maxmag   0   1  ->  1\r
+dqmxg015 maxmag   0   2  ->  2\r
+dqmxg016 maxmag   1  -2  -> -2\r
+dqmxg017 maxmag   1  -1  ->  1\r
+dqmxg018 maxmag   1   0  ->  1\r
+dqmxg019 maxmag   1   1  ->  1\r
+dqmxg020 maxmag   1   2  ->  2\r
+dqmxg021 maxmag   2  -2  ->  2\r
+dqmxg022 maxmag   2  -1  ->  2\r
+dqmxg023 maxmag   2   0  ->  2\r
+dqmxg025 maxmag   2   1  ->  2\r
+dqmxg026 maxmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+dqmxg030 maxmag   0     0   ->  0\r
+dqmxg031 maxmag   0    -0   ->  0\r
+dqmxg032 maxmag   0    -0.0 ->  0\r
+dqmxg033 maxmag   0     0.0 ->  0\r
+dqmxg034 maxmag  -0     0   ->  0    -- note: -0 = 0, but 0 chosen\r
+dqmxg035 maxmag  -0    -0   -> -0\r
+dqmxg036 maxmag  -0    -0.0 -> -0.0\r
+dqmxg037 maxmag  -0     0.0 ->  0.0\r
+dqmxg038 maxmag   0.0   0   ->  0\r
+dqmxg039 maxmag   0.0  -0   ->  0.0\r
+dqmxg040 maxmag   0.0  -0.0 ->  0.0\r
+dqmxg041 maxmag   0.0   0.0 ->  0.0\r
+dqmxg042 maxmag  -0.0   0   ->  0\r
+dqmxg043 maxmag  -0.0  -0   -> -0.0\r
+dqmxg044 maxmag  -0.0  -0.0 -> -0.0\r
+dqmxg045 maxmag  -0.0   0.0 ->  0.0\r
+\r
+dqmxg050 maxmag  -0E1   0E1 ->  0E+1\r
+dqmxg051 maxmag  -0E2   0E2 ->  0E+2\r
+dqmxg052 maxmag  -0E2   0E1 ->  0E+1\r
+dqmxg053 maxmag  -0E1   0E2 ->  0E+2\r
+dqmxg054 maxmag   0E1  -0E1 ->  0E+1\r
+dqmxg055 maxmag   0E2  -0E2 ->  0E+2\r
+dqmxg056 maxmag   0E2  -0E1 ->  0E+2\r
+dqmxg057 maxmag   0E1  -0E2 ->  0E+1\r
+\r
+dqmxg058 maxmag   0E1   0E1 ->  0E+1\r
+dqmxg059 maxmag   0E2   0E2 ->  0E+2\r
+dqmxg060 maxmag   0E2   0E1 ->  0E+2\r
+dqmxg061 maxmag   0E1   0E2 ->  0E+2\r
+dqmxg062 maxmag  -0E1  -0E1 -> -0E+1\r
+dqmxg063 maxmag  -0E2  -0E2 -> -0E+2\r
+dqmxg064 maxmag  -0E2  -0E1 -> -0E+1\r
+dqmxg065 maxmag  -0E1  -0E2 -> -0E+1\r
+\r
+-- Specials\r
+dqmxg090 maxmag  Inf  -Inf   ->  Infinity\r
+dqmxg091 maxmag  Inf  -1000  ->  Infinity\r
+dqmxg092 maxmag  Inf  -1     ->  Infinity\r
+dqmxg093 maxmag  Inf  -0     ->  Infinity\r
+dqmxg094 maxmag  Inf   0     ->  Infinity\r
+dqmxg095 maxmag  Inf   1     ->  Infinity\r
+dqmxg096 maxmag  Inf   1000  ->  Infinity\r
+dqmxg097 maxmag  Inf   Inf   ->  Infinity\r
+dqmxg098 maxmag -1000  Inf   ->  Infinity\r
+dqmxg099 maxmag -Inf   Inf   ->  Infinity\r
+dqmxg100 maxmag -1     Inf   ->  Infinity\r
+dqmxg101 maxmag -0     Inf   ->  Infinity\r
+dqmxg102 maxmag  0     Inf   ->  Infinity\r
+dqmxg103 maxmag  1     Inf   ->  Infinity\r
+dqmxg104 maxmag  1000  Inf   ->  Infinity\r
+dqmxg105 maxmag  Inf   Inf   ->  Infinity\r
+\r
+dqmxg120 maxmag -Inf  -Inf   -> -Infinity\r
+dqmxg121 maxmag -Inf  -1000  -> -Infinity\r
+dqmxg122 maxmag -Inf  -1     -> -Infinity\r
+dqmxg123 maxmag -Inf  -0     -> -Infinity\r
+dqmxg124 maxmag -Inf   0     -> -Infinity\r
+dqmxg125 maxmag -Inf   1     -> -Infinity\r
+dqmxg126 maxmag -Inf   1000  -> -Infinity\r
+dqmxg127 maxmag -Inf   Inf   ->  Infinity\r
+dqmxg128 maxmag -Inf  -Inf   ->  -Infinity\r
+dqmxg129 maxmag -1000 -Inf   -> -Infinity\r
+dqmxg130 maxmag -1    -Inf   -> -Infinity\r
+dqmxg131 maxmag -0    -Inf   -> -Infinity\r
+dqmxg132 maxmag  0    -Inf   -> -Infinity\r
+dqmxg133 maxmag  1    -Inf   -> -Infinity\r
+dqmxg134 maxmag  1000 -Inf   -> -Infinity\r
+dqmxg135 maxmag  Inf  -Inf   ->  Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+dqmxg141 maxmag  NaN -Inf    -> -Infinity\r
+dqmxg142 maxmag  NaN -1000   -> -1000\r
+dqmxg143 maxmag  NaN -1      -> -1\r
+dqmxg144 maxmag  NaN -0      -> -0\r
+dqmxg145 maxmag  NaN  0      ->  0\r
+dqmxg146 maxmag  NaN  1      ->  1\r
+dqmxg147 maxmag  NaN  1000   ->  1000\r
+dqmxg148 maxmag  NaN  Inf    ->  Infinity\r
+dqmxg149 maxmag  NaN  NaN    ->  NaN\r
+dqmxg150 maxmag -Inf  NaN    -> -Infinity\r
+dqmxg151 maxmag -1000 NaN    -> -1000\r
+dqmxg152 maxmag -1    NaN    -> -1\r
+dqmxg153 maxmag -0    NaN    -> -0\r
+dqmxg154 maxmag  0    NaN    ->  0\r
+dqmxg155 maxmag  1    NaN    ->  1\r
+dqmxg156 maxmag  1000 NaN    ->  1000\r
+dqmxg157 maxmag  Inf  NaN    ->  Infinity\r
+\r
+dqmxg161 maxmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqmxg162 maxmag  sNaN -1000  ->  NaN  Invalid_operation\r
+dqmxg163 maxmag  sNaN -1     ->  NaN  Invalid_operation\r
+dqmxg164 maxmag  sNaN -0     ->  NaN  Invalid_operation\r
+dqmxg165 maxmag  sNaN  0     ->  NaN  Invalid_operation\r
+dqmxg166 maxmag  sNaN  1     ->  NaN  Invalid_operation\r
+dqmxg167 maxmag  sNaN  1000  ->  NaN  Invalid_operation\r
+dqmxg168 maxmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqmxg169 maxmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqmxg170 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqmxg171 maxmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmxg172 maxmag -1000 sNaN   ->  NaN  Invalid_operation\r
+dqmxg173 maxmag -1    sNaN   ->  NaN  Invalid_operation\r
+dqmxg174 maxmag -0    sNaN   ->  NaN  Invalid_operation\r
+dqmxg175 maxmag  0    sNaN   ->  NaN  Invalid_operation\r
+dqmxg176 maxmag  1    sNaN   ->  NaN  Invalid_operation\r
+dqmxg177 maxmag  1000 sNaN   ->  NaN  Invalid_operation\r
+dqmxg178 maxmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmxg179 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqmxg181 maxmag  NaN9  -Inf   -> -Infinity\r
+dqmxg182 maxmag  NaN8     9   ->  9\r
+dqmxg183 maxmag -NaN7   Inf   ->  Infinity\r
+\r
+dqmxg184 maxmag -NaN1   NaN11 -> -NaN1\r
+dqmxg185 maxmag  NaN2   NaN12 ->  NaN2\r
+dqmxg186 maxmag -NaN13 -NaN7  -> -NaN13\r
+dqmxg187 maxmag  NaN14 -NaN5  ->  NaN14\r
+\r
+dqmxg188 maxmag -Inf    NaN4  -> -Infinity\r
+dqmxg189 maxmag -9     -NaN3  -> -9\r
+dqmxg190 maxmag  Inf    NaN2  ->  Infinity\r
+\r
+dqmxg191 maxmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqmxg192 maxmag  sNaN98 -1      ->  NaN98 Invalid_operation\r
+dqmxg193 maxmag -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dqmxg194 maxmag  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+dqmxg195 maxmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqmxg196 maxmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqmxg197 maxmag  0      sNaN91  ->  NaN91 Invalid_operation\r
+dqmxg198 maxmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqmxg199 maxmag  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- old rounding checks\r
+dqmxg221 maxmag 12345678000 1  -> 12345678000\r
+dqmxg222 maxmag 1 12345678000  -> 12345678000\r
+dqmxg223 maxmag 1234567800  1  -> 1234567800\r
+dqmxg224 maxmag 1 1234567800   -> 1234567800\r
+dqmxg225 maxmag 1234567890  1  -> 1234567890\r
+dqmxg226 maxmag 1 1234567890   -> 1234567890\r
+dqmxg227 maxmag 1234567891  1  -> 1234567891\r
+dqmxg228 maxmag 1 1234567891   -> 1234567891\r
+dqmxg229 maxmag 12345678901 1  -> 12345678901\r
+dqmxg230 maxmag 1 12345678901  -> 12345678901\r
+dqmxg231 maxmag 1234567896  1  -> 1234567896\r
+dqmxg232 maxmag 1 1234567896   -> 1234567896\r
+dqmxg233 maxmag -1234567891  1 -> -1234567891\r
+dqmxg234 maxmag 1 -1234567891  -> -1234567891\r
+dqmxg235 maxmag -12345678901 1 -> -12345678901\r
+dqmxg236 maxmag 1 -12345678901 -> -12345678901\r
+dqmxg237 maxmag -1234567896  1 -> -1234567896\r
+dqmxg238 maxmag 1 -1234567896  -> -1234567896\r
+\r
+-- from examples\r
+dqmxg280 maxmag '3'   '2'  ->  '3'\r
+dqmxg281 maxmag '-10' '3'  ->  '-10'\r
+dqmxg282 maxmag '1.0' '1'  ->  '1'\r
+dqmxg283 maxmag '1' '1.0'  ->  '1'\r
+dqmxg284 maxmag '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+dqmxg401 maxmag  Inf    1.1     ->  Infinity\r
+dqmxg402 maxmag  1.1    1       ->  1.1\r
+dqmxg403 maxmag  1      1.0     ->  1\r
+dqmxg404 maxmag  1.0    0.1     ->  1.0\r
+dqmxg405 maxmag  0.1    0.10    ->  0.1\r
+dqmxg406 maxmag  0.10   0.100   ->  0.10\r
+dqmxg407 maxmag  0.10   0       ->  0.10\r
+dqmxg408 maxmag  0      0.0     ->  0\r
+dqmxg409 maxmag  0.0   -0       ->  0.0\r
+dqmxg410 maxmag  0.0   -0.0     ->  0.0\r
+dqmxg411 maxmag  0.00  -0.0     ->  0.00\r
+dqmxg412 maxmag  0.0   -0.00    ->  0.0\r
+dqmxg413 maxmag  0     -0.0     ->  0\r
+dqmxg414 maxmag  0     -0       ->  0\r
+dqmxg415 maxmag -0.0   -0       -> -0.0\r
+dqmxg416 maxmag -0     -0.100   -> -0.100\r
+dqmxg417 maxmag -0.100 -0.10    -> -0.100\r
+dqmxg418 maxmag -0.10  -0.1     -> -0.10\r
+dqmxg419 maxmag -0.1   -1.0     -> -1.0\r
+dqmxg420 maxmag -1.0   -1       -> -1.0\r
+dqmxg421 maxmag -1     -1.1     -> -1.1\r
+dqmxg423 maxmag -1.1   -Inf     -> -Infinity\r
+-- same with operands reversed\r
+dqmxg431 maxmag  1.1    Inf     ->  Infinity\r
+dqmxg432 maxmag  1      1.1     ->  1.1\r
+dqmxg433 maxmag  1.0    1       ->  1\r
+dqmxg434 maxmag  0.1    1.0     ->  1.0\r
+dqmxg435 maxmag  0.10   0.1     ->  0.1\r
+dqmxg436 maxmag  0.100  0.10    ->  0.10\r
+dqmxg437 maxmag  0      0.10    ->  0.10\r
+dqmxg438 maxmag  0.0    0       ->  0\r
+dqmxg439 maxmag -0      0.0     ->  0.0\r
+dqmxg440 maxmag -0.0    0.0     ->  0.0\r
+dqmxg441 maxmag -0.0    0.00    ->  0.00\r
+dqmxg442 maxmag -0.00   0.0     ->  0.0\r
+dqmxg443 maxmag -0.0    0       ->  0\r
+dqmxg444 maxmag -0      0       ->  0\r
+dqmxg445 maxmag -0     -0.0     -> -0.0\r
+dqmxg446 maxmag -0.100 -0       -> -0.100\r
+dqmxg447 maxmag -0.10  -0.100   -> -0.100\r
+dqmxg448 maxmag -0.1   -0.10    -> -0.10\r
+dqmxg449 maxmag -1.0   -0.1     -> -1.0\r
+dqmxg450 maxmag -1     -1.0     -> -1.0\r
+dqmxg451 maxmag -1.1   -1       -> -1.1\r
+dqmxg453 maxmag -Inf   -1.1     -> -Infinity\r
+-- largies\r
+dqmxg460 maxmag  1000   1E+3    ->  1E+3\r
+dqmxg461 maxmag  1E+3   1000    ->  1E+3\r
+dqmxg462 maxmag  1000  -1E+3    ->  1000\r
+dqmxg463 maxmag  1E+3  -1000    ->  1E+3\r
+dqmxg464 maxmag -1000   1E+3    ->  1E+3\r
+dqmxg465 maxmag -1E+3   1000    ->  1000\r
+dqmxg466 maxmag -1000  -1E+3    -> -1000\r
+dqmxg467 maxmag -1E+3  -1000    -> -1000\r
+\r
+-- subnormals\r
+dqmxg510 maxmag  1.00E-6143       0  ->   1.00E-6143\r
+dqmxg511 maxmag  0.1E-6143        0  ->   1E-6144    Subnormal\r
+dqmxg512 maxmag  0.10E-6143       0  ->   1.0E-6144  Subnormal\r
+dqmxg513 maxmag  0.100E-6143      0  ->   1.00E-6144 Subnormal\r
+dqmxg514 maxmag  0.01E-6143       0  ->   1E-6145    Subnormal\r
+dqmxg515 maxmag  0.999E-6143      0  ->   9.99E-6144 Subnormal\r
+dqmxg516 maxmag  0.099E-6143      0  ->   9.9E-6145  Subnormal\r
+dqmxg517 maxmag  0.009E-6143      0  ->   9E-6146    Subnormal\r
+dqmxg518 maxmag  0.001E-6143      0  ->   1E-6146    Subnormal\r
+dqmxg519 maxmag  0.0009E-6143     0  ->   9E-6147    Subnormal\r
+dqmxg520 maxmag  0.0001E-6143     0  ->   1E-6147    Subnormal\r
+\r
+dqmxg530 maxmag -1.00E-6143       0  ->  -1.00E-6143\r
+dqmxg531 maxmag -0.1E-6143        0  ->  -1E-6144    Subnormal\r
+dqmxg532 maxmag -0.10E-6143       0  ->  -1.0E-6144  Subnormal\r
+dqmxg533 maxmag -0.100E-6143      0  ->  -1.00E-6144 Subnormal\r
+dqmxg534 maxmag -0.01E-6143       0  ->  -1E-6145    Subnormal\r
+dqmxg535 maxmag -0.999E-6143      0  ->  -9.99E-6144 Subnormal\r
+dqmxg536 maxmag -0.099E-6143      0  ->  -9.9E-6145  Subnormal\r
+dqmxg537 maxmag -0.009E-6143      0  ->  -9E-6146    Subnormal\r
+dqmxg538 maxmag -0.001E-6143      0  ->  -1E-6146    Subnormal\r
+dqmxg539 maxmag -0.0009E-6143     0  ->  -9E-6147    Subnormal\r
+dqmxg540 maxmag -0.0001E-6143     0  ->  -1E-6147    Subnormal\r
+\r
+-- Null tests\r
+dqmxg900 maxmag 10  #  -> NaN Invalid_operation\r
+dqmxg901 maxmag  # 10  -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqMin.decTest b/Lib/test/decimaltestdata/dqMin.decTest
new file mode 100644 (file)
index 0000000..9e34694
--- /dev/null
@@ -0,0 +1,309 @@
+------------------------------------------------------------------------\r
+-- dqMin.decTest -- decQuad minnum                                    --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqmin001 min  -2  -2  -> -2\r
+dqmin002 min  -2  -1  -> -2\r
+dqmin003 min  -2   0  -> -2\r
+dqmin004 min  -2   1  -> -2\r
+dqmin005 min  -2   2  -> -2\r
+dqmin006 min  -1  -2  -> -2\r
+dqmin007 min  -1  -1  -> -1\r
+dqmin008 min  -1   0  -> -1\r
+dqmin009 min  -1   1  -> -1\r
+dqmin010 min  -1   2  -> -1\r
+dqmin011 min   0  -2  -> -2\r
+dqmin012 min   0  -1  -> -1\r
+dqmin013 min   0   0  ->  0\r
+dqmin014 min   0   1  ->  0\r
+dqmin015 min   0   2  ->  0\r
+dqmin016 min   1  -2  -> -2\r
+dqmin017 min   1  -1  -> -1\r
+dqmin018 min   1   0  ->  0\r
+dqmin019 min   1   1  ->  1\r
+dqmin020 min   1   2  ->  1\r
+dqmin021 min   2  -2  -> -2\r
+dqmin022 min   2  -1  -> -1\r
+dqmin023 min   2   0  ->  0\r
+dqmin025 min   2   1  ->  1\r
+dqmin026 min   2   2  ->  2\r
+\r
+-- extended zeros\r
+dqmin030 min   0     0   ->  0\r
+dqmin031 min   0    -0   -> -0\r
+dqmin032 min   0    -0.0 -> -0.0\r
+dqmin033 min   0     0.0 ->  0.0\r
+dqmin034 min  -0     0   -> -0\r
+dqmin035 min  -0    -0   -> -0\r
+dqmin036 min  -0    -0.0 -> -0\r
+dqmin037 min  -0     0.0 -> -0\r
+dqmin038 min   0.0   0   ->  0.0\r
+dqmin039 min   0.0  -0   -> -0\r
+dqmin040 min   0.0  -0.0 -> -0.0\r
+dqmin041 min   0.0   0.0 ->  0.0\r
+dqmin042 min  -0.0   0   -> -0.0\r
+dqmin043 min  -0.0  -0   -> -0\r
+dqmin044 min  -0.0  -0.0 -> -0.0\r
+dqmin045 min  -0.0   0.0 -> -0.0\r
+\r
+dqmin046 min   0E1  -0E1 -> -0E+1\r
+dqmin047 min  -0E1   0E2 -> -0E+1\r
+dqmin048 min   0E2   0E1 ->  0E+1\r
+dqmin049 min   0E1   0E2 ->  0E+1\r
+dqmin050 min  -0E3  -0E2 -> -0E+3\r
+dqmin051 min  -0E2  -0E3 -> -0E+3\r
+\r
+-- Specials\r
+dqmin090 min  Inf  -Inf   -> -Infinity\r
+dqmin091 min  Inf  -1000  -> -1000\r
+dqmin092 min  Inf  -1     -> -1\r
+dqmin093 min  Inf  -0     -> -0\r
+dqmin094 min  Inf   0     ->  0\r
+dqmin095 min  Inf   1     ->  1\r
+dqmin096 min  Inf   1000  ->  1000\r
+dqmin097 min  Inf   Inf   ->  Infinity\r
+dqmin098 min -1000  Inf   -> -1000\r
+dqmin099 min -Inf   Inf   -> -Infinity\r
+dqmin100 min -1     Inf   -> -1\r
+dqmin101 min -0     Inf   -> -0\r
+dqmin102 min  0     Inf   ->  0\r
+dqmin103 min  1     Inf   ->  1\r
+dqmin104 min  1000  Inf   ->  1000\r
+dqmin105 min  Inf   Inf   ->  Infinity\r
+\r
+dqmin120 min -Inf  -Inf   -> -Infinity\r
+dqmin121 min -Inf  -1000  -> -Infinity\r
+dqmin122 min -Inf  -1     -> -Infinity\r
+dqmin123 min -Inf  -0     -> -Infinity\r
+dqmin124 min -Inf   0     -> -Infinity\r
+dqmin125 min -Inf   1     -> -Infinity\r
+dqmin126 min -Inf   1000  -> -Infinity\r
+dqmin127 min -Inf   Inf   -> -Infinity\r
+dqmin128 min -Inf  -Inf   -> -Infinity\r
+dqmin129 min -1000 -Inf   -> -Infinity\r
+dqmin130 min -1    -Inf   -> -Infinity\r
+dqmin131 min -0    -Inf   -> -Infinity\r
+dqmin132 min  0    -Inf   -> -Infinity\r
+dqmin133 min  1    -Inf   -> -Infinity\r
+dqmin134 min  1000 -Inf   -> -Infinity\r
+dqmin135 min  Inf  -Inf   -> -Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+dqmin141 min  NaN -Inf    ->  -Infinity\r
+dqmin142 min  NaN -1000   ->  -1000\r
+dqmin143 min  NaN -1      ->  -1\r
+dqmin144 min  NaN -0      ->  -0\r
+dqmin145 min  NaN  0      ->  0\r
+dqmin146 min  NaN  1      ->  1\r
+dqmin147 min  NaN  1000   ->  1000\r
+dqmin148 min  NaN  Inf    ->  Infinity\r
+dqmin149 min  NaN  NaN    ->  NaN\r
+dqmin150 min -Inf  NaN    -> -Infinity\r
+dqmin151 min -1000 NaN    -> -1000\r
+dqmin152 min -1   -NaN    -> -1\r
+dqmin153 min -0    NaN    -> -0\r
+dqmin154 min  0   -NaN    ->  0\r
+dqmin155 min  1    NaN    ->  1\r
+dqmin156 min  1000 NaN    ->  1000\r
+dqmin157 min  Inf  NaN    ->  Infinity\r
+\r
+dqmin161 min  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqmin162 min  sNaN -1000  ->  NaN  Invalid_operation\r
+dqmin163 min  sNaN -1     ->  NaN  Invalid_operation\r
+dqmin164 min  sNaN -0     ->  NaN  Invalid_operation\r
+dqmin165 min -sNaN  0     -> -NaN  Invalid_operation\r
+dqmin166 min -sNaN  1     -> -NaN  Invalid_operation\r
+dqmin167 min  sNaN  1000  ->  NaN  Invalid_operation\r
+dqmin168 min  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqmin169 min  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqmin170 min  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqmin171 min -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmin172 min -1000 sNaN   ->  NaN  Invalid_operation\r
+dqmin173 min -1    sNaN   ->  NaN  Invalid_operation\r
+dqmin174 min -0    sNaN   ->  NaN  Invalid_operation\r
+dqmin175 min  0    sNaN   ->  NaN  Invalid_operation\r
+dqmin176 min  1    sNaN   ->  NaN  Invalid_operation\r
+dqmin177 min  1000 sNaN   ->  NaN  Invalid_operation\r
+dqmin178 min  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmin179 min  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqmin181 min  NaN9   -Inf   -> -Infinity\r
+dqmin182 min -NaN8    9990  ->  9990\r
+dqmin183 min  NaN71   Inf   ->  Infinity\r
+\r
+dqmin184 min  NaN1    NaN54 ->  NaN1\r
+dqmin185 min  NaN22  -NaN53 ->  NaN22\r
+dqmin186 min -NaN3    NaN6  -> -NaN3\r
+dqmin187 min -NaN44   NaN7  -> -NaN44\r
+\r
+dqmin188 min -Inf     NaN41 -> -Infinity\r
+dqmin189 min -9999   -NaN33 -> -9999\r
+dqmin190 min  Inf     NaN2  ->  Infinity\r
+\r
+dqmin191 min  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqmin192 min  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqmin193 min -sNaN97  NaN8   -> -NaN97 Invalid_operation\r
+dqmin194 min  sNaN69 sNaN94  ->  NaN69 Invalid_operation\r
+dqmin195 min  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqmin196 min -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqmin197 min  088    sNaN91  ->  NaN91 Invalid_operation\r
+dqmin198 min  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqmin199 min  NaN    sNaN86  ->  NaN86 Invalid_operation\r
+\r
+-- old rounding checks\r
+dqmin221 min -12345678000 1  -> -12345678000\r
+dqmin222 min 1 -12345678000  -> -12345678000\r
+dqmin223 min -1234567800  1  -> -1234567800\r
+dqmin224 min 1 -1234567800   -> -1234567800\r
+dqmin225 min -1234567890  1  -> -1234567890\r
+dqmin226 min 1 -1234567890   -> -1234567890\r
+dqmin227 min -1234567891  1  -> -1234567891\r
+dqmin228 min 1 -1234567891   -> -1234567891\r
+dqmin229 min -12345678901 1  -> -12345678901\r
+dqmin230 min 1 -12345678901  -> -12345678901\r
+dqmin231 min -1234567896  1  -> -1234567896\r
+dqmin232 min 1 -1234567896   -> -1234567896\r
+dqmin233 min 1234567891  1   -> 1\r
+dqmin234 min 1 1234567891    -> 1\r
+dqmin235 min 12345678901 1   -> 1\r
+dqmin236 min 1 12345678901   -> 1\r
+dqmin237 min 1234567896  1   -> 1\r
+dqmin238 min 1 1234567896    -> 1\r
+\r
+-- from examples\r
+dqmin280 min '3'   '2'  ->  '2'\r
+dqmin281 min '-10' '3'  ->  '-10'\r
+dqmin282 min '1.0' '1'  ->  '1.0'\r
+dqmin283 min '1' '1.0'  ->  '1.0'\r
+dqmin284 min '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+dqmin401 min  Inf    1.1     ->  1.1\r
+dqmin402 min  1.1    1       ->  1\r
+dqmin403 min  1      1.0     ->  1.0\r
+dqmin404 min  1.0    0.1     ->  0.1\r
+dqmin405 min  0.1    0.10    ->  0.10\r
+dqmin406 min  0.10   0.100   ->  0.100\r
+dqmin407 min  0.10   0       ->  0\r
+dqmin408 min  0      0.0     ->  0.0\r
+dqmin409 min  0.0   -0       -> -0\r
+dqmin410 min  0.0   -0.0     -> -0.0\r
+dqmin411 min  0.00  -0.0     -> -0.0\r
+dqmin412 min  0.0   -0.00    -> -0.00\r
+dqmin413 min  0     -0.0     -> -0.0\r
+dqmin414 min  0     -0       -> -0\r
+dqmin415 min -0.0   -0       -> -0\r
+dqmin416 min -0     -0.100   -> -0.100\r
+dqmin417 min -0.100 -0.10    -> -0.10\r
+dqmin418 min -0.10  -0.1     -> -0.1\r
+dqmin419 min -0.1   -1.0     -> -1.0\r
+dqmin420 min -1.0   -1       -> -1\r
+dqmin421 min -1     -1.1     -> -1.1\r
+dqmin423 min -1.1   -Inf     -> -Infinity\r
+-- same with operands reversed\r
+dqmin431 min  1.1    Inf     ->  1.1\r
+dqmin432 min  1      1.1     ->  1\r
+dqmin433 min  1.0    1       ->  1.0\r
+dqmin434 min  0.1    1.0     ->  0.1\r
+dqmin435 min  0.10   0.1     ->  0.10\r
+dqmin436 min  0.100  0.10    ->  0.100\r
+dqmin437 min  0      0.10    ->  0\r
+dqmin438 min  0.0    0       ->  0.0\r
+dqmin439 min -0      0.0     -> -0\r
+dqmin440 min -0.0    0.0     -> -0.0\r
+dqmin441 min -0.0    0.00    -> -0.0\r
+dqmin442 min -0.00   0.0     -> -0.00\r
+dqmin443 min -0.0    0       -> -0.0\r
+dqmin444 min -0      0       -> -0\r
+dqmin445 min -0     -0.0     -> -0\r
+dqmin446 min -0.100 -0       -> -0.100\r
+dqmin447 min -0.10  -0.100   -> -0.10\r
+dqmin448 min -0.1   -0.10    -> -0.1\r
+dqmin449 min -1.0   -0.1     -> -1.0\r
+dqmin450 min -1     -1.0     -> -1\r
+dqmin451 min -1.1   -1       -> -1.1\r
+dqmin453 min -Inf   -1.1     -> -Infinity\r
+-- largies\r
+dqmin460 min  1000   1E+3    ->  1000\r
+dqmin461 min  1E+3   1000    ->  1000\r
+dqmin462 min  1000  -1E+3    -> -1E+3\r
+dqmin463 min  1E+3  -384    -> -384\r
+dqmin464 min -384   1E+3    -> -384\r
+dqmin465 min -1E+3   1000    -> -1E+3\r
+dqmin466 min -384  -1E+3    -> -1E+3\r
+dqmin467 min -1E+3  -384    -> -1E+3\r
+\r
+-- misalignment traps for little-endian\r
+dqmin471 min      1.0       0.1  -> 0.1\r
+dqmin472 min      0.1       1.0  -> 0.1\r
+dqmin473 min     10.0       0.1  -> 0.1\r
+dqmin474 min      0.1      10.0  -> 0.1\r
+dqmin475 min      100       1.0  -> 1.0\r
+dqmin476 min      1.0       100  -> 1.0\r
+dqmin477 min     1000      10.0  -> 10.0\r
+dqmin478 min     10.0      1000  -> 10.0\r
+dqmin479 min    10000     100.0  -> 100.0\r
+dqmin480 min    100.0     10000  -> 100.0\r
+dqmin481 min   100000    1000.0  -> 1000.0\r
+dqmin482 min   1000.0    100000  -> 1000.0\r
+dqmin483 min  1000000   10000.0  -> 10000.0\r
+dqmin484 min  10000.0   1000000  -> 10000.0\r
+\r
+-- subnormals\r
+dqmin510 min  1.00E-6143       0  ->   0\r
+dqmin511 min  0.1E-6143        0  ->   0\r
+dqmin512 min  0.10E-6143       0  ->   0\r
+dqmin513 min  0.100E-6143      0  ->   0\r
+dqmin514 min  0.01E-6143       0  ->   0\r
+dqmin515 min  0.999E-6143      0  ->   0\r
+dqmin516 min  0.099E-6143      0  ->   0\r
+dqmin517 min  0.009E-6143      0  ->   0\r
+dqmin518 min  0.001E-6143      0  ->   0\r
+dqmin519 min  0.0009E-6143     0  ->   0\r
+dqmin520 min  0.0001E-6143     0  ->   0\r
+\r
+dqmin530 min -1.00E-6143       0  ->  -1.00E-6143\r
+dqmin531 min -0.1E-6143        0  ->  -1E-6144    Subnormal\r
+dqmin532 min -0.10E-6143       0  ->  -1.0E-6144  Subnormal\r
+dqmin533 min -0.100E-6143      0  ->  -1.00E-6144 Subnormal\r
+dqmin534 min -0.01E-6143       0  ->  -1E-6145    Subnormal\r
+dqmin535 min -0.999E-6143      0  ->  -9.99E-6144 Subnormal\r
+dqmin536 min -0.099E-6143      0  ->  -9.9E-6145  Subnormal\r
+dqmin537 min -0.009E-6143      0  ->  -9E-6146    Subnormal\r
+dqmin538 min -0.001E-6143      0  ->  -1E-6146    Subnormal\r
+dqmin539 min -0.0009E-6143     0  ->  -9E-6147    Subnormal\r
+dqmin540 min -0.0001E-6143     0  ->  -1E-6147    Subnormal\r
+\r
+\r
+-- Null tests\r
+dqmin900 min 10  # -> NaN Invalid_operation\r
+dqmin901 min  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqMinMag.decTest b/Lib/test/decimaltestdata/dqMinMag.decTest
new file mode 100644 (file)
index 0000000..733acfd
--- /dev/null
@@ -0,0 +1,293 @@
+------------------------------------------------------------------------\r
+-- dqMinMag.decTest -- decQuad minnummag                              --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqmng001 minmag  -2  -2  -> -2\r
+dqmng002 minmag  -2  -1  -> -1\r
+dqmng003 minmag  -2   0  ->  0\r
+dqmng004 minmag  -2   1  ->  1\r
+dqmng005 minmag  -2   2  -> -2\r
+dqmng006 minmag  -1  -2  -> -1\r
+dqmng007 minmag  -1  -1  -> -1\r
+dqmng008 minmag  -1   0  ->  0\r
+dqmng009 minmag  -1   1  -> -1\r
+dqmng010 minmag  -1   2  -> -1\r
+dqmng011 minmag   0  -2  ->  0\r
+dqmng012 minmag   0  -1  ->  0\r
+dqmng013 minmag   0   0  ->  0\r
+dqmng014 minmag   0   1  ->  0\r
+dqmng015 minmag   0   2  ->  0\r
+dqmng016 minmag   1  -2  ->  1\r
+dqmng017 minmag   1  -1  -> -1\r
+dqmng018 minmag   1   0  ->  0\r
+dqmng019 minmag   1   1  ->  1\r
+dqmng020 minmag   1   2  ->  1\r
+dqmng021 minmag   2  -2  -> -2\r
+dqmng022 minmag   2  -1  -> -1\r
+dqmng023 minmag   2   0  ->  0\r
+dqmng025 minmag   2   1  ->  1\r
+dqmng026 minmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+dqmng030 minmag   0     0   ->  0\r
+dqmng031 minmag   0    -0   -> -0\r
+dqmng032 minmag   0    -0.0 -> -0.0\r
+dqmng033 minmag   0     0.0 ->  0.0\r
+dqmng034 minmag  -0     0   -> -0\r
+dqmng035 minmag  -0    -0   -> -0\r
+dqmng036 minmag  -0    -0.0 -> -0\r
+dqmng037 minmag  -0     0.0 -> -0\r
+dqmng038 minmag   0.0   0   ->  0.0\r
+dqmng039 minmag   0.0  -0   -> -0\r
+dqmng040 minmag   0.0  -0.0 -> -0.0\r
+dqmng041 minmag   0.0   0.0 ->  0.0\r
+dqmng042 minmag  -0.0   0   -> -0.0\r
+dqmng043 minmag  -0.0  -0   -> -0\r
+dqmng044 minmag  -0.0  -0.0 -> -0.0\r
+dqmng045 minmag  -0.0   0.0 -> -0.0\r
+\r
+dqmng046 minmag   0E1  -0E1 -> -0E+1\r
+dqmng047 minmag  -0E1   0E2 -> -0E+1\r
+dqmng048 minmag   0E2   0E1 ->  0E+1\r
+dqmng049 minmag   0E1   0E2 ->  0E+1\r
+dqmng050 minmag  -0E3  -0E2 -> -0E+3\r
+dqmng051 minmag  -0E2  -0E3 -> -0E+3\r
+\r
+-- Specials\r
+dqmng090 minmag  Inf  -Inf   -> -Infinity\r
+dqmng091 minmag  Inf  -1000  -> -1000\r
+dqmng092 minmag  Inf  -1     -> -1\r
+dqmng093 minmag  Inf  -0     -> -0\r
+dqmng094 minmag  Inf   0     ->  0\r
+dqmng095 minmag  Inf   1     ->  1\r
+dqmng096 minmag  Inf   1000  ->  1000\r
+dqmng097 minmag  Inf   Inf   ->  Infinity\r
+dqmng098 minmag -1000  Inf   -> -1000\r
+dqmng099 minmag -Inf   Inf   -> -Infinity\r
+dqmng100 minmag -1     Inf   -> -1\r
+dqmng101 minmag -0     Inf   -> -0\r
+dqmng102 minmag  0     Inf   ->  0\r
+dqmng103 minmag  1     Inf   ->  1\r
+dqmng104 minmag  1000  Inf   ->  1000\r
+dqmng105 minmag  Inf   Inf   ->  Infinity\r
+\r
+dqmng120 minmag -Inf  -Inf   -> -Infinity\r
+dqmng121 minmag -Inf  -1000  -> -1000\r
+dqmng122 minmag -Inf  -1     -> -1\r
+dqmng123 minmag -Inf  -0     -> -0\r
+dqmng124 minmag -Inf   0     ->  0\r
+dqmng125 minmag -Inf   1     ->  1\r
+dqmng126 minmag -Inf   1000  ->  1000\r
+dqmng127 minmag -Inf   Inf   -> -Infinity\r
+dqmng128 minmag -Inf  -Inf   -> -Infinity\r
+dqmng129 minmag -1000 -Inf   -> -1000\r
+dqmng130 minmag -1    -Inf   -> -1\r
+dqmng131 minmag -0    -Inf   -> -0\r
+dqmng132 minmag  0    -Inf   ->  0\r
+dqmng133 minmag  1    -Inf   ->  1\r
+dqmng134 minmag  1000 -Inf   ->  1000\r
+dqmng135 minmag  Inf  -Inf   -> -Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+dqmng141 minmag  NaN -Inf    ->  -Infinity\r
+dqmng142 minmag  NaN -1000   ->  -1000\r
+dqmng143 minmag  NaN -1      ->  -1\r
+dqmng144 minmag  NaN -0      ->  -0\r
+dqmng145 minmag  NaN  0      ->  0\r
+dqmng146 minmag  NaN  1      ->  1\r
+dqmng147 minmag  NaN  1000   ->  1000\r
+dqmng148 minmag  NaN  Inf    ->  Infinity\r
+dqmng149 minmag  NaN  NaN    ->  NaN\r
+dqmng150 minmag -Inf  NaN    -> -Infinity\r
+dqmng151 minmag -1000 NaN    -> -1000\r
+dqmng152 minmag -1   -NaN    -> -1\r
+dqmng153 minmag -0    NaN    -> -0\r
+dqmng154 minmag  0   -NaN    ->  0\r
+dqmng155 minmag  1    NaN    ->  1\r
+dqmng156 minmag  1000 NaN    ->  1000\r
+dqmng157 minmag  Inf  NaN    ->  Infinity\r
+\r
+dqmng161 minmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqmng162 minmag  sNaN -1000  ->  NaN  Invalid_operation\r
+dqmng163 minmag  sNaN -1     ->  NaN  Invalid_operation\r
+dqmng164 minmag  sNaN -0     ->  NaN  Invalid_operation\r
+dqmng165 minmag -sNaN  0     -> -NaN  Invalid_operation\r
+dqmng166 minmag -sNaN  1     -> -NaN  Invalid_operation\r
+dqmng167 minmag  sNaN  1000  ->  NaN  Invalid_operation\r
+dqmng168 minmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqmng169 minmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqmng170 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqmng171 minmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmng172 minmag -1000 sNaN   ->  NaN  Invalid_operation\r
+dqmng173 minmag -1    sNaN   ->  NaN  Invalid_operation\r
+dqmng174 minmag -0    sNaN   ->  NaN  Invalid_operation\r
+dqmng175 minmag  0    sNaN   ->  NaN  Invalid_operation\r
+dqmng176 minmag  1    sNaN   ->  NaN  Invalid_operation\r
+dqmng177 minmag  1000 sNaN   ->  NaN  Invalid_operation\r
+dqmng178 minmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmng179 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqmng181 minmag  NaN9   -Inf   -> -Infinity\r
+dqmng182 minmag -NaN8    9990  ->  9990\r
+dqmng183 minmag  NaN71   Inf   ->  Infinity\r
+\r
+dqmng184 minmag  NaN1    NaN54 ->  NaN1\r
+dqmng185 minmag  NaN22  -NaN53 ->  NaN22\r
+dqmng186 minmag -NaN3    NaN6  -> -NaN3\r
+dqmng187 minmag -NaN44   NaN7  -> -NaN44\r
+\r
+dqmng188 minmag -Inf     NaN41 -> -Infinity\r
+dqmng189 minmag -9999   -NaN33 -> -9999\r
+dqmng190 minmag  Inf     NaN2  ->  Infinity\r
+\r
+dqmng191 minmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqmng192 minmag  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqmng193 minmag -sNaN97  NaN8   -> -NaN97 Invalid_operation\r
+dqmng194 minmag  sNaN69 sNaN94  ->  NaN69 Invalid_operation\r
+dqmng195 minmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqmng196 minmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqmng197 minmag  088    sNaN91  ->  NaN91 Invalid_operation\r
+dqmng198 minmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqmng199 minmag  NaN    sNaN86  ->  NaN86 Invalid_operation\r
+\r
+-- old rounding checks\r
+dqmng221 minmag -12345678000 1  -> 1\r
+dqmng222 minmag 1 -12345678000  -> 1\r
+dqmng223 minmag -1234567800  1  -> 1\r
+dqmng224 minmag 1 -1234567800   -> 1\r
+dqmng225 minmag -1234567890  1  -> 1\r
+dqmng226 minmag 1 -1234567890   -> 1\r
+dqmng227 minmag -1234567891  1  -> 1\r
+dqmng228 minmag 1 -1234567891   -> 1\r
+dqmng229 minmag -12345678901 1  -> 1\r
+dqmng230 minmag 1 -12345678901  -> 1\r
+dqmng231 minmag -1234567896  1  -> 1\r
+dqmng232 minmag 1 -1234567896   -> 1\r
+dqmng233 minmag 1234567891  1   -> 1\r
+dqmng234 minmag 1 1234567891    -> 1\r
+dqmng235 minmag 12345678901 1   -> 1\r
+dqmng236 minmag 1 12345678901   -> 1\r
+dqmng237 minmag 1234567896  1   -> 1\r
+dqmng238 minmag 1 1234567896    -> 1\r
+\r
+-- from examples\r
+dqmng280 minmag '3'   '2'  ->  '2'\r
+dqmng281 minmag '-10' '3'  ->  '3'\r
+dqmng282 minmag '1.0' '1'  ->  '1.0'\r
+dqmng283 minmag '1' '1.0'  ->  '1.0'\r
+dqmng284 minmag '7' 'NaN'  ->  '7'\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+dqmng401 minmag  Inf    1.1     ->  1.1\r
+dqmng402 minmag  1.1    1       ->  1\r
+dqmng403 minmag  1      1.0     ->  1.0\r
+dqmng404 minmag  1.0    0.1     ->  0.1\r
+dqmng405 minmag  0.1    0.10    ->  0.10\r
+dqmng406 minmag  0.10   0.100   ->  0.100\r
+dqmng407 minmag  0.10   0       ->  0\r
+dqmng408 minmag  0      0.0     ->  0.0\r
+dqmng409 minmag  0.0   -0       -> -0\r
+dqmng410 minmag  0.0   -0.0     -> -0.0\r
+dqmng411 minmag  0.00  -0.0     -> -0.0\r
+dqmng412 minmag  0.0   -0.00    -> -0.00\r
+dqmng413 minmag  0     -0.0     -> -0.0\r
+dqmng414 minmag  0     -0       -> -0\r
+dqmng415 minmag -0.0   -0       -> -0\r
+dqmng416 minmag -0     -0.100   -> -0\r
+dqmng417 minmag -0.100 -0.10    -> -0.10\r
+dqmng418 minmag -0.10  -0.1     -> -0.1\r
+dqmng419 minmag -0.1   -1.0     -> -0.1\r
+dqmng420 minmag -1.0   -1       -> -1\r
+dqmng421 minmag -1     -1.1     -> -1\r
+dqmng423 minmag -1.1   -Inf     -> -1.1\r
+-- same with operands reversed\r
+dqmng431 minmag  1.1    Inf     ->  1.1\r
+dqmng432 minmag  1      1.1     ->  1\r
+dqmng433 minmag  1.0    1       ->  1.0\r
+dqmng434 minmag  0.1    1.0     ->  0.1\r
+dqmng435 minmag  0.10   0.1     ->  0.10\r
+dqmng436 minmag  0.100  0.10    ->  0.100\r
+dqmng437 minmag  0      0.10    ->  0\r
+dqmng438 minmag  0.0    0       ->  0.0\r
+dqmng439 minmag -0      0.0     -> -0\r
+dqmng440 minmag -0.0    0.0     -> -0.0\r
+dqmng441 minmag -0.0    0.00    -> -0.0\r
+dqmng442 minmag -0.00   0.0     -> -0.00\r
+dqmng443 minmag -0.0    0       -> -0.0\r
+dqmng444 minmag -0      0       -> -0\r
+dqmng445 minmag -0     -0.0     -> -0\r
+dqmng446 minmag -0.100 -0       -> -0\r
+dqmng447 minmag -0.10  -0.100   -> -0.10\r
+dqmng448 minmag -0.1   -0.10    -> -0.1\r
+dqmng449 minmag -1.0   -0.1     -> -0.1\r
+dqmng450 minmag -1     -1.0     -> -1\r
+dqmng451 minmag -1.1   -1       -> -1\r
+dqmng453 minmag -Inf   -1.1     -> -1.1\r
+-- largies\r
+dqmng460 minmag  1000   1E+3    ->  1000\r
+dqmng461 minmag  1E+3   1000    ->  1000\r
+dqmng462 minmag  1000  -1E+3    -> -1E+3\r
+dqmng463 minmag  1E+3   -384    -> -384\r
+dqmng464 minmag -384    1E+3    -> -384\r
+dqmng465 minmag -1E+3   1000    -> -1E+3\r
+dqmng466 minmag -384   -1E+3    -> -384\r
+dqmng467 minmag -1E+3   -384    -> -384\r
+\r
+-- subnormals\r
+dqmng510 minmag  1.00E-6143       0  ->   0\r
+dqmng511 minmag  0.1E-6143        0  ->   0\r
+dqmng512 minmag  0.10E-6143       0  ->   0\r
+dqmng513 minmag  0.100E-6143      0  ->   0\r
+dqmng514 minmag  0.01E-6143       0  ->   0\r
+dqmng515 minmag  0.999E-6143      0  ->   0\r
+dqmng516 minmag  0.099E-6143      0  ->   0\r
+dqmng517 minmag  0.009E-6143      0  ->   0\r
+dqmng518 minmag  0.001E-6143      0  ->   0\r
+dqmng519 minmag  0.0009E-6143     0  ->   0\r
+dqmng520 minmag  0.0001E-6143     0  ->   0\r
+\r
+dqmng530 minmag -1.00E-6143       0  ->   0\r
+dqmng531 minmag -0.1E-6143        0  ->   0\r
+dqmng532 minmag -0.10E-6143       0  ->   0\r
+dqmng533 minmag -0.100E-6143      0  ->   0\r
+dqmng534 minmag -0.01E-6143       0  ->   0\r
+dqmng535 minmag -0.999E-6143      0  ->   0\r
+dqmng536 minmag -0.099E-6143      0  ->   0\r
+dqmng537 minmag -0.009E-6143      0  ->   0\r
+dqmng538 minmag -0.001E-6143      0  ->   0\r
+dqmng539 minmag -0.0009E-6143     0  ->   0\r
+dqmng540 minmag -0.0001E-6143     0  ->   0\r
+\r
+\r
+-- Null tests\r
+dqmng900 minmag 10  # -> NaN Invalid_operation\r
+dqmng901 minmag  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqMinus.decTest b/Lib/test/decimaltestdata/dqMinus.decTest
new file mode 100644 (file)
index 0000000..50ac85a
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- dqMinus.decTest -- decQuad 0-x                                     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqmns001 minus       +7.50  -> -7.50\r
+\r
+-- Infinities\r
+dqmns011 minus  Infinity    -> -Infinity\r
+dqmns012 minus  -Infinity   -> Infinity\r
+\r
+-- NaNs, 0 payload\r
+dqmns021 minus         NaN  -> NaN\r
+dqmns022 minus        -NaN  -> -NaN\r
+dqmns023 minus        sNaN  -> NaN  Invalid_operation\r
+dqmns024 minus       -sNaN  -> -NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+dqmns031 minus       NaN13  -> NaN13\r
+dqmns032 minus      -NaN13  -> -NaN13\r
+dqmns033 minus      sNaN13  -> NaN13   Invalid_operation\r
+dqmns034 minus     -sNaN13  -> -NaN13  Invalid_operation\r
+dqmns035 minus       NaN70  -> NaN70\r
+dqmns036 minus      -NaN70  -> -NaN70\r
+dqmns037 minus      sNaN101 -> NaN101  Invalid_operation\r
+dqmns038 minus     -sNaN101 -> -NaN101 Invalid_operation\r
+\r
+-- finites\r
+dqmns101 minus          7   -> -7\r
+dqmns102 minus         -7   -> 7\r
+dqmns103 minus         75   -> -75\r
+dqmns104 minus        -75   -> 75\r
+dqmns105 minus       7.50   -> -7.50\r
+dqmns106 minus      -7.50   -> 7.50\r
+dqmns107 minus       7.500  -> -7.500\r
+dqmns108 minus      -7.500  -> 7.500\r
+\r
+-- zeros\r
+dqmns111 minus          0   -> 0\r
+dqmns112 minus         -0   -> 0\r
+dqmns113 minus       0E+4   -> 0E+4\r
+dqmns114 minus      -0E+4   -> 0E+4\r
+dqmns115 minus     0.0000   -> 0.0000\r
+dqmns116 minus    -0.0000   -> 0.0000\r
+dqmns117 minus      0E-141  -> 0E-141\r
+dqmns118 minus     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqmns121 minus   2682682682682682682682682682682682    -> -2682682682682682682682682682682682\r
+dqmns122 minus  -2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqmns123 minus   1341341341341341341341341341341341    -> -1341341341341341341341341341341341\r
+dqmns124 minus  -1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqmns131 minus  9.999999999999999999999999999999999E+6144   -> -9.999999999999999999999999999999999E+6144\r
+dqmns132 minus  1E-6143                                     -> -1E-6143\r
+dqmns133 minus  1.000000000000000000000000000000000E-6143   -> -1.000000000000000000000000000000000E-6143\r
+dqmns134 minus  1E-6176                                     -> -1E-6176 Subnormal\r
+\r
+dqmns135 minus  -1E-6176                                    ->  1E-6176 Subnormal\r
+dqmns136 minus  -1.000000000000000000000000000000000E-6143  ->  1.000000000000000000000000000000000E-6143\r
+dqmns137 minus  -1E-6143                                    ->  1E-6143\r
+dqmns138 minus  -9.999999999999999999999999999999999E+6144  ->  9.999999999999999999999999999999999E+6144\r
diff --git a/Lib/test/decimaltestdata/dqMultiply.decTest b/Lib/test/decimaltestdata/dqMultiply.decTest
new file mode 100644 (file)
index 0000000..a6f85e0
--- /dev/null
@@ -0,0 +1,473 @@
+------------------------------------------------------------------------\r
+-- dqMultiply.decTest -- decQuad multiplication                       --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decQuads only; all arguments are\r
+-- representable in a decQuad\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqmul000 multiply 2      2 -> 4\r
+dqmul001 multiply 2      3 -> 6\r
+dqmul002 multiply 5      1 -> 5\r
+dqmul003 multiply 5      2 -> 10\r
+dqmul004 multiply 1.20   2 -> 2.40\r
+dqmul005 multiply 1.20   0 -> 0.00\r
+dqmul006 multiply 1.20  -2 -> -2.40\r
+dqmul007 multiply -1.20  2 -> -2.40\r
+dqmul008 multiply -1.20  0 -> -0.00\r
+dqmul009 multiply -1.20 -2 -> 2.40\r
+dqmul010 multiply 5.09 7.1 -> 36.139\r
+dqmul011 multiply 2.5    4 -> 10.0\r
+dqmul012 multiply 2.50   4 -> 10.00\r
+dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded\r
+dqmul015 multiply 2.50   4 -> 10.00\r
+dqmul016 multiply  9.99999999999999999  9.99999999999999999 ->  99.99999999999999980000000000000000 Inexact Rounded\r
+dqmul017 multiply  9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded\r
+dqmul018 multiply -9.99999999999999999  9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded\r
+dqmul019 multiply -9.99999999999999999 -9.99999999999999999 ->  99.99999999999999980000000000000000 Inexact Rounded\r
+\r
+-- zeros, etc.\r
+dqmul021 multiply  0      0     ->  0\r
+dqmul022 multiply  0     -0     -> -0\r
+dqmul023 multiply -0      0     -> -0\r
+dqmul024 multiply -0     -0     ->  0\r
+dqmul025 multiply -0.0   -0.0   ->  0.00\r
+dqmul026 multiply -0.0   -0.0   ->  0.00\r
+dqmul027 multiply -0.0   -0.0   ->  0.00\r
+dqmul028 multiply -0.0   -0.0   ->  0.00\r
+dqmul030 multiply  5.00   1E-3  ->  0.00500\r
+dqmul031 multiply  00.00  0.000 ->  0.00000\r
+dqmul032 multiply  00.00  0E-3  ->  0.00000     -- rhs is 0\r
+dqmul033 multiply  0E-3   00.00 ->  0.00000     -- lhs is 0\r
+dqmul034 multiply -5.00   1E-3  -> -0.00500\r
+dqmul035 multiply -00.00  0.000 -> -0.00000\r
+dqmul036 multiply -00.00  0E-3  -> -0.00000     -- rhs is 0\r
+dqmul037 multiply -0E-3   00.00 -> -0.00000     -- lhs is 0\r
+dqmul038 multiply  5.00  -1E-3  -> -0.00500\r
+dqmul039 multiply  00.00 -0.000 -> -0.00000\r
+dqmul040 multiply  00.00 -0E-3  -> -0.00000     -- rhs is 0\r
+dqmul041 multiply  0E-3  -00.00 -> -0.00000     -- lhs is 0\r
+dqmul042 multiply -5.00  -1E-3  ->  0.00500\r
+dqmul043 multiply -00.00 -0.000 ->  0.00000\r
+dqmul044 multiply -00.00 -0E-3  ->  0.00000     -- rhs is 0\r
+dqmul045 multiply -0E-3  -00.00 ->  0.00000     -- lhs is 0\r
+\r
+-- examples from decarith\r
+dqmul050 multiply 1.20 3        -> 3.60\r
+dqmul051 multiply 7    3        -> 21\r
+dqmul052 multiply 0.9  0.8      -> 0.72\r
+dqmul053 multiply 0.9  -0       -> -0.0\r
+dqmul054 multiply 654321 654321 -> 428135971041\r
+\r
+dqmul060 multiply 123.45 1e7  ->  1.2345E+9\r
+dqmul061 multiply 123.45 1e8  ->  1.2345E+10\r
+dqmul062 multiply 123.45 1e+9 ->  1.2345E+11\r
+dqmul063 multiply 123.45 1e10 ->  1.2345E+12\r
+dqmul064 multiply 123.45 1e11 ->  1.2345E+13\r
+dqmul065 multiply 123.45 1e12 ->  1.2345E+14\r
+dqmul066 multiply 123.45 1e13 ->  1.2345E+15\r
+\r
+\r
+-- test some intermediate lengths\r
+--                    1234567890123456\r
+dqmul080 multiply 0.1 1230123456456789     -> 123012345645678.9\r
+dqmul084 multiply 0.1 1230123456456789     -> 123012345645678.9\r
+dqmul090 multiply 1230123456456789     0.1 -> 123012345645678.9\r
+dqmul094 multiply 1230123456456789     0.1 -> 123012345645678.9\r
+\r
+-- test some more edge cases and carries\r
+dqmul101 multiply 9 9   -> 81\r
+dqmul102 multiply 9 90   -> 810\r
+dqmul103 multiply 9 900   -> 8100\r
+dqmul104 multiply 9 9000   -> 81000\r
+dqmul105 multiply 9 90000   -> 810000\r
+dqmul106 multiply 9 900000   -> 8100000\r
+dqmul107 multiply 9 9000000   -> 81000000\r
+dqmul108 multiply 9 90000000   -> 810000000\r
+dqmul109 multiply 9 900000000   -> 8100000000\r
+dqmul110 multiply 9 9000000000   -> 81000000000\r
+dqmul111 multiply 9 90000000000   -> 810000000000\r
+dqmul112 multiply 9 900000000000   -> 8100000000000\r
+dqmul113 multiply 9 9000000000000   -> 81000000000000\r
+dqmul114 multiply 9 90000000000000   -> 810000000000000\r
+dqmul115 multiply 9 900000000000000   -> 8100000000000000\r
+--dqmul116 multiply 9 9000000000000000   -> 81000000000000000\r
+--dqmul117 multiply 9 90000000000000000   -> 810000000000000000\r
+--dqmul118 multiply 9 900000000000000000   -> 8100000000000000000\r
+--dqmul119 multiply 9 9000000000000000000   -> 81000000000000000000\r
+--dqmul120 multiply 9 90000000000000000000   -> 810000000000000000000\r
+--dqmul121 multiply 9 900000000000000000000   -> 8100000000000000000000\r
+--dqmul122 multiply 9 9000000000000000000000   -> 81000000000000000000000\r
+--dqmul123 multiply 9 90000000000000000000000   -> 810000000000000000000000\r
+-- test some more edge cases without carries\r
+dqmul131 multiply 3 3   -> 9\r
+dqmul132 multiply 3 30   -> 90\r
+dqmul133 multiply 3 300   -> 900\r
+dqmul134 multiply 3 3000   -> 9000\r
+dqmul135 multiply 3 30000   -> 90000\r
+dqmul136 multiply 3 300000   -> 900000\r
+dqmul137 multiply 3 3000000   -> 9000000\r
+dqmul138 multiply 3 30000000   -> 90000000\r
+dqmul139 multiply 3 300000000   -> 900000000\r
+dqmul140 multiply 3 3000000000   -> 9000000000\r
+dqmul141 multiply 3 30000000000   -> 90000000000\r
+dqmul142 multiply 3 300000000000   -> 900000000000\r
+dqmul143 multiply 3 3000000000000   -> 9000000000000\r
+dqmul144 multiply 3 30000000000000   -> 90000000000000\r
+dqmul145 multiply 3 300000000000000   -> 900000000000000\r
+dqmul146 multiply 3 3000000000000000   -> 9000000000000000\r
+dqmul147 multiply 3 30000000000000000   -> 90000000000000000\r
+dqmul148 multiply 3 300000000000000000   -> 900000000000000000\r
+dqmul149 multiply 3 3000000000000000000   -> 9000000000000000000\r
+dqmul150 multiply 3 30000000000000000000   -> 90000000000000000000\r
+dqmul151 multiply 3 300000000000000000000   -> 900000000000000000000\r
+dqmul152 multiply 3 3000000000000000000000   -> 9000000000000000000000\r
+dqmul153 multiply 3 30000000000000000000000   -> 90000000000000000000000\r
+\r
+dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded\r
+\r
+-- test some edge cases with exact rounding\r
+dqmul301 multiply 900000000000000000 9   -> 8100000000000000000\r
+dqmul302 multiply 900000000000000000 90   -> 81000000000000000000\r
+dqmul303 multiply 900000000000000000 900   -> 810000000000000000000\r
+dqmul304 multiply 900000000000000000 9000   -> 8100000000000000000000\r
+dqmul305 multiply 900000000000000000 90000   -> 81000000000000000000000\r
+dqmul306 multiply 900000000000000000 900000   -> 810000000000000000000000\r
+dqmul307 multiply 900000000000000000 9000000   -> 8100000000000000000000000\r
+dqmul308 multiply 900000000000000000 90000000   -> 81000000000000000000000000\r
+dqmul309 multiply 900000000000000000 900000000   -> 810000000000000000000000000\r
+dqmul310 multiply 900000000000000000 9000000000   -> 8100000000000000000000000000\r
+dqmul311 multiply 900000000000000000 90000000000   -> 81000000000000000000000000000\r
+dqmul312 multiply 900000000000000000 900000000000   -> 810000000000000000000000000000\r
+dqmul313 multiply 900000000000000000 9000000000000   -> 8100000000000000000000000000000\r
+dqmul314 multiply 900000000000000000 90000000000000   -> 81000000000000000000000000000000\r
+dqmul315 multiply 900000000000000000 900000000000000   -> 810000000000000000000000000000000\r
+dqmul316 multiply 900000000000000000 9000000000000000   -> 8100000000000000000000000000000000\r
+dqmul317 multiply 9000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+34  Rounded\r
+dqmul318 multiply 90000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+35  Rounded\r
+dqmul319 multiply 900000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+36  Rounded\r
+dqmul320 multiply 9000000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+37  Rounded\r
+dqmul321 multiply 90000000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+38  Rounded\r
+dqmul322 multiply 900000000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+39  Rounded\r
+dqmul323 multiply 9000000000000000000000000 9000000000000000   -> 8.100000000000000000000000000000000E+40  Rounded\r
+\r
+-- tryzeros cases\r
+dqmul504  multiply  0E-4260 1000E-4260  -> 0E-6176 Clamped\r
+dqmul505  multiply  100E+4260 0E+4260   -> 0E+6111 Clamped\r
+\r
+-- mixed with zeros\r
+dqmul541 multiply  0    -1     -> -0\r
+dqmul542 multiply -0    -1     ->  0\r
+dqmul543 multiply  0     1     ->  0\r
+dqmul544 multiply -0     1     -> -0\r
+dqmul545 multiply -1     0     -> -0\r
+dqmul546 multiply -1    -0     ->  0\r
+dqmul547 multiply  1     0     ->  0\r
+dqmul548 multiply  1    -0     -> -0\r
+\r
+dqmul551 multiply  0.0  -1     -> -0.0\r
+dqmul552 multiply -0.0  -1     ->  0.0\r
+dqmul553 multiply  0.0   1     ->  0.0\r
+dqmul554 multiply -0.0   1     -> -0.0\r
+dqmul555 multiply -1.0   0     -> -0.0\r
+dqmul556 multiply -1.0  -0     ->  0.0\r
+dqmul557 multiply  1.0   0     ->  0.0\r
+dqmul558 multiply  1.0  -0     -> -0.0\r
+\r
+dqmul561 multiply  0    -1.0   -> -0.0\r
+dqmul562 multiply -0    -1.0   ->  0.0\r
+dqmul563 multiply  0     1.0   ->  0.0\r
+dqmul564 multiply -0     1.0   -> -0.0\r
+dqmul565 multiply -1     0.0   -> -0.0\r
+dqmul566 multiply -1    -0.0   ->  0.0\r
+dqmul567 multiply  1     0.0   ->  0.0\r
+dqmul568 multiply  1    -0.0   -> -0.0\r
+\r
+dqmul571 multiply  0.0  -1.0   -> -0.00\r
+dqmul572 multiply -0.0  -1.0   ->  0.00\r
+dqmul573 multiply  0.0   1.0   ->  0.00\r
+dqmul574 multiply -0.0   1.0   -> -0.00\r
+dqmul575 multiply -1.0   0.0   -> -0.00\r
+dqmul576 multiply -1.0  -0.0   ->  0.00\r
+dqmul577 multiply  1.0   0.0   ->  0.00\r
+dqmul578 multiply  1.0  -0.0   -> -0.00\r
+\r
+\r
+-- Specials\r
+dqmul580 multiply  Inf  -Inf   -> -Infinity\r
+dqmul581 multiply  Inf  -1000  -> -Infinity\r
+dqmul582 multiply  Inf  -1     -> -Infinity\r
+dqmul583 multiply  Inf  -0     ->  NaN  Invalid_operation\r
+dqmul584 multiply  Inf   0     ->  NaN  Invalid_operation\r
+dqmul585 multiply  Inf   1     ->  Infinity\r
+dqmul586 multiply  Inf   1000  ->  Infinity\r
+dqmul587 multiply  Inf   Inf   ->  Infinity\r
+dqmul588 multiply -1000  Inf   -> -Infinity\r
+dqmul589 multiply -Inf   Inf   -> -Infinity\r
+dqmul590 multiply -1     Inf   -> -Infinity\r
+dqmul591 multiply -0     Inf   ->  NaN  Invalid_operation\r
+dqmul592 multiply  0     Inf   ->  NaN  Invalid_operation\r
+dqmul593 multiply  1     Inf   ->  Infinity\r
+dqmul594 multiply  1000  Inf   ->  Infinity\r
+dqmul595 multiply  Inf   Inf   ->  Infinity\r
+\r
+dqmul600 multiply -Inf  -Inf   ->  Infinity\r
+dqmul601 multiply -Inf  -1000  ->  Infinity\r
+dqmul602 multiply -Inf  -1     ->  Infinity\r
+dqmul603 multiply -Inf  -0     ->  NaN  Invalid_operation\r
+dqmul604 multiply -Inf   0     ->  NaN  Invalid_operation\r
+dqmul605 multiply -Inf   1     -> -Infinity\r
+dqmul606 multiply -Inf   1000  -> -Infinity\r
+dqmul607 multiply -Inf   Inf   -> -Infinity\r
+dqmul608 multiply -1000  Inf   -> -Infinity\r
+dqmul609 multiply -Inf  -Inf   ->  Infinity\r
+dqmul610 multiply -1    -Inf   ->  Infinity\r
+dqmul611 multiply -0    -Inf   ->  NaN  Invalid_operation\r
+dqmul612 multiply  0    -Inf   ->  NaN  Invalid_operation\r
+dqmul613 multiply  1    -Inf   -> -Infinity\r
+dqmul614 multiply  1000 -Inf   -> -Infinity\r
+dqmul615 multiply  Inf  -Inf   -> -Infinity\r
+\r
+dqmul621 multiply  NaN -Inf    ->  NaN\r
+dqmul622 multiply  NaN -1000   ->  NaN\r
+dqmul623 multiply  NaN -1      ->  NaN\r
+dqmul624 multiply  NaN -0      ->  NaN\r
+dqmul625 multiply  NaN  0      ->  NaN\r
+dqmul626 multiply  NaN  1      ->  NaN\r
+dqmul627 multiply  NaN  1000   ->  NaN\r
+dqmul628 multiply  NaN  Inf    ->  NaN\r
+dqmul629 multiply  NaN  NaN    ->  NaN\r
+dqmul630 multiply -Inf  NaN    ->  NaN\r
+dqmul631 multiply -1000 NaN    ->  NaN\r
+dqmul632 multiply -1    NaN    ->  NaN\r
+dqmul633 multiply -0    NaN    ->  NaN\r
+dqmul634 multiply  0    NaN    ->  NaN\r
+dqmul635 multiply  1    NaN    ->  NaN\r
+dqmul636 multiply  1000 NaN    ->  NaN\r
+dqmul637 multiply  Inf  NaN    ->  NaN\r
+\r
+dqmul641 multiply  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqmul642 multiply  sNaN -1000  ->  NaN  Invalid_operation\r
+dqmul643 multiply  sNaN -1     ->  NaN  Invalid_operation\r
+dqmul644 multiply  sNaN -0     ->  NaN  Invalid_operation\r
+dqmul645 multiply  sNaN  0     ->  NaN  Invalid_operation\r
+dqmul646 multiply  sNaN  1     ->  NaN  Invalid_operation\r
+dqmul647 multiply  sNaN  1000  ->  NaN  Invalid_operation\r
+dqmul648 multiply  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqmul649 multiply  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqmul650 multiply  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqmul651 multiply -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmul652 multiply -1000 sNaN   ->  NaN  Invalid_operation\r
+dqmul653 multiply -1    sNaN   ->  NaN  Invalid_operation\r
+dqmul654 multiply -0    sNaN   ->  NaN  Invalid_operation\r
+dqmul655 multiply  0    sNaN   ->  NaN  Invalid_operation\r
+dqmul656 multiply  1    sNaN   ->  NaN  Invalid_operation\r
+dqmul657 multiply  1000 sNaN   ->  NaN  Invalid_operation\r
+dqmul658 multiply  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqmul659 multiply  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqmul661 multiply  NaN9 -Inf   ->  NaN9\r
+dqmul662 multiply  NaN8  999   ->  NaN8\r
+dqmul663 multiply  NaN71 Inf   ->  NaN71\r
+dqmul664 multiply  NaN6  NaN5  ->  NaN6\r
+dqmul665 multiply -Inf   NaN4  ->  NaN4\r
+dqmul666 multiply -999   NaN33 ->  NaN33\r
+dqmul667 multiply  Inf   NaN2  ->  NaN2\r
+\r
+dqmul671 multiply  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqmul672 multiply  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqmul673 multiply  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqmul674 multiply  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+dqmul675 multiply  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqmul676 multiply -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqmul677 multiply  088    sNaN91  ->  NaN91 Invalid_operation\r
+dqmul678 multiply  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dqmul679 multiply  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+dqmul681 multiply -NaN9 -Inf   -> -NaN9\r
+dqmul682 multiply -NaN8  999   -> -NaN8\r
+dqmul683 multiply -NaN71 Inf   -> -NaN71\r
+dqmul684 multiply -NaN6 -NaN5  -> -NaN6\r
+dqmul685 multiply -Inf  -NaN4  -> -NaN4\r
+dqmul686 multiply -999  -NaN33 -> -NaN33\r
+dqmul687 multiply  Inf  -NaN2  -> -NaN2\r
+\r
+dqmul691 multiply -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqmul692 multiply -sNaN98 -11     -> -NaN98 Invalid_operation\r
+dqmul693 multiply -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation\r
+dqmul695 multiply -NaN95  -sNaN93 -> -NaN93 Invalid_operation\r
+dqmul696 multiply -Inf    -sNaN92 -> -NaN92 Invalid_operation\r
+dqmul697 multiply  088    -sNaN91 -> -NaN91 Invalid_operation\r
+dqmul698 multiply  Inf    -sNaN90 -> -NaN90 Invalid_operation\r
+dqmul699 multiply -NaN    -sNaN89 -> -NaN89 Invalid_operation\r
+\r
+dqmul701 multiply -NaN  -Inf   -> -NaN\r
+dqmul702 multiply -NaN   999   -> -NaN\r
+dqmul703 multiply -NaN   Inf   -> -NaN\r
+dqmul704 multiply -NaN  -NaN   -> -NaN\r
+dqmul705 multiply -Inf  -NaN0  -> -NaN\r
+dqmul706 multiply -999  -NaN   -> -NaN\r
+dqmul707 multiply  Inf  -NaN   -> -NaN\r
+\r
+dqmul711 multiply -sNaN   -Inf    -> -NaN Invalid_operation\r
+dqmul712 multiply -sNaN   -11     -> -NaN Invalid_operation\r
+dqmul713 multiply -sNaN00  NaN    -> -NaN Invalid_operation\r
+dqmul714 multiply -sNaN   -sNaN   -> -NaN Invalid_operation\r
+dqmul715 multiply -NaN    -sNaN   -> -NaN Invalid_operation\r
+dqmul716 multiply -Inf    -sNaN   -> -NaN Invalid_operation\r
+dqmul717 multiply  088    -sNaN   -> -NaN Invalid_operation\r
+dqmul718 multiply  Inf    -sNaN   -> -NaN Invalid_operation\r
+dqmul719 multiply -NaN    -sNaN   -> -NaN Invalid_operation\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+-- signs\r
+dqmul751 multiply  1e+4277  1e+3311 ->  Infinity Overflow Inexact Rounded\r
+dqmul752 multiply  1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded\r
+dqmul753 multiply -1e+4277  1e+3311 -> -Infinity Overflow Inexact Rounded\r
+dqmul754 multiply -1e+4277 -1e+3311 ->  Infinity Overflow Inexact Rounded\r
+dqmul755 multiply  1e-4277  1e-3311 ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul756 multiply  1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul757 multiply -1e-4277  1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul758 multiply -1e-4277 -1e-3311 ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal\r
+dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal\r
+dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal\r
+dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal\r
+dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal\r
+dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal\r
+dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal\r
+dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped\r
+dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142  Clamped\r
+dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143  Clamped\r
+dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144  Clamped\r
+dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded\r
+dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded\r
+dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded\r
+dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded\r
+dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded\r
+dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded\r
+\r
+dqmul801 multiply  1.0000E-6172  1     -> 1.0000E-6172 Subnormal\r
+dqmul802 multiply  1.000E-6172   1e-1  -> 1.000E-6173  Subnormal\r
+dqmul803 multiply  1.00E-6172    1e-2  -> 1.00E-6174   Subnormal\r
+dqmul804 multiply  1.0E-6172     1e-3  -> 1.0E-6175    Subnormal\r
+dqmul805 multiply  1.0E-6172     1e-4  -> 1E-6176     Subnormal Rounded\r
+dqmul806 multiply  1.3E-6172     1e-4  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul807 multiply  1.5E-6172     1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul808 multiply  1.7E-6172     1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul809 multiply  2.3E-6172     1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul810 multiply  2.5E-6172     1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul811 multiply  2.7E-6172     1e-4  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul812 multiply  1.49E-6172    1e-4  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul813 multiply  1.50E-6172    1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul814 multiply  1.51E-6172    1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul815 multiply  2.49E-6172    1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul816 multiply  2.50E-6172    1e-4  -> 2E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul817 multiply  2.51E-6172    1e-4  -> 3E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqmul818 multiply  1E-6172       1e-4  -> 1E-6176     Subnormal\r
+dqmul819 multiply  3E-6172       1e-5  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqmul820 multiply  5E-6172       1e-5  -> 0E-6176     Underflow Subnormal Inexact Rounded Clamped\r
+dqmul821 multiply  7E-6172       1e-5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul822 multiply  9E-6172       1e-5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+dqmul823 multiply  9.9E-6172     1e-5  -> 1E-6176     Underflow Subnormal Inexact Rounded\r
+\r
+dqmul824 multiply  1E-6172      -1e-4  -> -1E-6176    Subnormal\r
+dqmul825 multiply  3E-6172      -1e-5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqmul826 multiply -5E-6172       1e-5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+dqmul827 multiply  7E-6172      -1e-5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqmul828 multiply -9E-6172       1e-5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqmul829 multiply  9.9E-6172    -1e-5  -> -1E-6176    Underflow Subnormal Inexact Rounded\r
+dqmul830 multiply  3.0E-6172    -1e-5  -> -0E-6176    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dqmul831 multiply  1.0E-5977     1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqmul832 multiply  1.0E-5977     1e-199 -> 1E-6176    Subnormal Rounded\r
+dqmul833 multiply  1.0E-5977     1e-198 -> 1.0E-6175    Subnormal\r
+dqmul834 multiply  2.0E-5977     2e-198 -> 4.0E-6175    Subnormal\r
+dqmul835 multiply  4.0E-5977     4e-198 -> 1.60E-6174   Subnormal\r
+dqmul836 multiply 10.0E-5977    10e-198 -> 1.000E-6173  Subnormal\r
+dqmul837 multiply 30.0E-5977    30e-198 -> 9.000E-6173  Subnormal\r
+dqmul838 multiply 40.0E-5982    40e-166 -> 1.6000E-6145 Subnormal\r
+dqmul839 multiply 40.0E-5982    40e-165 -> 1.6000E-6144 Subnormal\r
+dqmul840 multiply 40.0E-5982    40e-164 -> 1.6000E-6143\r
+\r
+-- Long operand overflow may be a different path\r
+dqmul870 multiply 100  9.999E+6143     ->  Infinity Inexact Overflow Rounded\r
+dqmul871 multiply 100 -9.999E+6143     -> -Infinity Inexact Overflow Rounded\r
+dqmul872 multiply      9.999E+6143 100 ->  Infinity Inexact Overflow Rounded\r
+dqmul873 multiply     -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded\r
+\r
+-- check for double-rounded subnormals\r
+dqmul881 multiply  1.2347E-6133 1.2347E-40  ->  1.524E-6173 Inexact Rounded Subnormal Underflow\r
+dqmul882 multiply  1.234E-6133 1.234E-40    ->  1.523E-6173 Inexact Rounded Subnormal Underflow\r
+dqmul883 multiply  1.23E-6133  1.23E-40     ->  1.513E-6173 Inexact Rounded Subnormal Underflow\r
+dqmul884 multiply  1.2E-6133   1.2E-40      ->  1.44E-6173  Subnormal\r
+dqmul885 multiply  1.2E-6133   1.2E-41      ->  1.44E-6174  Subnormal\r
+dqmul886 multiply  1.2E-6133   1.2E-42      ->  1.4E-6175   Subnormal Inexact Rounded Underflow\r
+dqmul887 multiply  1.2E-6133   1.3E-42      ->  1.6E-6175   Subnormal Inexact Rounded Underflow\r
+dqmul888 multiply  1.3E-6133   1.3E-42      ->  1.7E-6175   Subnormal Inexact Rounded Underflow\r
+dqmul889 multiply  1.3E-6133   1.3E-43      ->    2E-6176   Subnormal Inexact Rounded Underflow\r
+dqmul890 multiply  1.3E-6134   1.3E-43      ->    0E-6176   Clamped Subnormal Inexact Rounded Underflow\r
+\r
+dqmul891 multiply  1.2345E-39    1.234E-6133 ->  1.5234E-6172 Inexact Rounded Subnormal Underflow\r
+dqmul892 multiply  1.23456E-39   1.234E-6133 ->  1.5234E-6172 Inexact Rounded Subnormal Underflow\r
+dqmul893 multiply  1.2345E-40   1.234E-6133 ->  1.523E-6173  Inexact Rounded Subnormal Underflow\r
+dqmul894 multiply  1.23456E-40  1.234E-6133 ->  1.523E-6173  Inexact Rounded Subnormal Underflow\r
+dqmul895 multiply  1.2345E-41   1.234E-6133 ->  1.52E-6174   Inexact Rounded Subnormal Underflow\r
+dqmul896 multiply  1.23456E-41  1.234E-6133 ->  1.52E-6174   Inexact Rounded Subnormal Underflow\r
+\r
+-- Now explore the case where we get a normal result with Underflow\r
+-- prove operands are exact\r
+dqmul906 multiply  9.999999999999999999999999999999999E-6143  1                       -> 9.999999999999999999999999999999999E-6143\r
+dqmul907 multiply                       1  0.09999999999999999999999999999999999     -> 0.09999999999999999999999999999999999\r
+-- the next rounds to Nmin\r
+dqmul908 multiply  9.999999999999999999999999999999999E-6143  0.09999999999999999999999999999999999     -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded\r
+\r
+-- hugest\r
+dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+precision:   34\r
+rounding:    half_up\r
+maxExponent: 6144\r
+minExponent: -6143\r
+dqmul1001  multiply 130E-2  120E-2 -> 1.5600\r
+dqmul1002  multiply 130E-2  12E-1  -> 1.560\r
+dqmul1003  multiply 130E-2  1E0    -> 1.30\r
+dqmul1004  multiply 1E2     1E4    -> 1E+6\r
+\r
+-- Null tests\r
+dqmul990 multiply 10  # -> NaN Invalid_operation\r
+dqmul991 multiply  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqNextMinus.decTest b/Lib/test/decimaltestdata/dqNextMinus.decTest
new file mode 100644 (file)
index 0000000..4880816
--- /dev/null
@@ -0,0 +1,126 @@
+------------------------------------------------------------------------\r
+-- dqNextMinus.decTest -- decQuad next that is less [754r nextdown]   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqnextm001 nextminus  0.9999999999999999999999999999999995 ->   0.9999999999999999999999999999999994\r
+dqnextm002 nextminus  0.9999999999999999999999999999999996 ->   0.9999999999999999999999999999999995\r
+dqnextm003 nextminus  0.9999999999999999999999999999999997 ->   0.9999999999999999999999999999999996\r
+dqnextm004 nextminus  0.9999999999999999999999999999999998 ->   0.9999999999999999999999999999999997\r
+dqnextm005 nextminus  0.9999999999999999999999999999999999 ->   0.9999999999999999999999999999999998\r
+dqnextm006 nextminus  1.000000000000000000000000000000000  ->   0.9999999999999999999999999999999999\r
+dqnextm007 nextminus  1.0         ->   0.9999999999999999999999999999999999\r
+dqnextm008 nextminus  1           ->   0.9999999999999999999999999999999999\r
+dqnextm009 nextminus  1.000000000000000000000000000000001  ->   1.000000000000000000000000000000000\r
+dqnextm010 nextminus  1.000000000000000000000000000000002  ->   1.000000000000000000000000000000001\r
+dqnextm011 nextminus  1.000000000000000000000000000000003  ->   1.000000000000000000000000000000002\r
+dqnextm012 nextminus  1.000000000000000000000000000000004  ->   1.000000000000000000000000000000003\r
+dqnextm013 nextminus  1.000000000000000000000000000000005  ->   1.000000000000000000000000000000004\r
+dqnextm014 nextminus  1.000000000000000000000000000000006  ->   1.000000000000000000000000000000005\r
+dqnextm015 nextminus  1.000000000000000000000000000000007  ->   1.000000000000000000000000000000006\r
+dqnextm016 nextminus  1.000000000000000000000000000000008  ->   1.000000000000000000000000000000007\r
+dqnextm017 nextminus  1.000000000000000000000000000000009  ->   1.000000000000000000000000000000008\r
+dqnextm018 nextminus  1.000000000000000000000000000000010  ->   1.000000000000000000000000000000009\r
+dqnextm019 nextminus  1.000000000000000000000000000000011  ->   1.000000000000000000000000000000010\r
+dqnextm020 nextminus  1.000000000000000000000000000000012  ->   1.000000000000000000000000000000011\r
+\r
+dqnextm021 nextminus -0.9999999999999999999999999999999995 ->  -0.9999999999999999999999999999999996\r
+dqnextm022 nextminus -0.9999999999999999999999999999999996 ->  -0.9999999999999999999999999999999997\r
+dqnextm023 nextminus -0.9999999999999999999999999999999997 ->  -0.9999999999999999999999999999999998\r
+dqnextm024 nextminus -0.9999999999999999999999999999999998 ->  -0.9999999999999999999999999999999999\r
+dqnextm025 nextminus -0.9999999999999999999999999999999999 ->  -1.000000000000000000000000000000000\r
+dqnextm026 nextminus -1.000000000000000000000000000000000  ->  -1.000000000000000000000000000000001\r
+dqnextm027 nextminus -1.0         ->  -1.000000000000000000000000000000001\r
+dqnextm028 nextminus -1           ->  -1.000000000000000000000000000000001\r
+dqnextm029 nextminus -1.000000000000000000000000000000001  ->  -1.000000000000000000000000000000002\r
+dqnextm030 nextminus -1.000000000000000000000000000000002  ->  -1.000000000000000000000000000000003\r
+dqnextm031 nextminus -1.000000000000000000000000000000003  ->  -1.000000000000000000000000000000004\r
+dqnextm032 nextminus -1.000000000000000000000000000000004  ->  -1.000000000000000000000000000000005\r
+dqnextm033 nextminus -1.000000000000000000000000000000005  ->  -1.000000000000000000000000000000006\r
+dqnextm034 nextminus -1.000000000000000000000000000000006  ->  -1.000000000000000000000000000000007\r
+dqnextm035 nextminus -1.000000000000000000000000000000007  ->  -1.000000000000000000000000000000008\r
+dqnextm036 nextminus -1.000000000000000000000000000000008  ->  -1.000000000000000000000000000000009\r
+dqnextm037 nextminus -1.000000000000000000000000000000009  ->  -1.000000000000000000000000000000010\r
+dqnextm038 nextminus -1.000000000000000000000000000000010  ->  -1.000000000000000000000000000000011\r
+dqnextm039 nextminus -1.000000000000000000000000000000011  ->  -1.000000000000000000000000000000012\r
+\r
+-- ultra-tiny inputs\r
+dqnextm062 nextminus  1E-6176         ->   0E-6176\r
+dqnextm065 nextminus -1E-6176         ->  -2E-6176\r
+\r
+-- Zeros\r
+dqnextm100 nextminus -0           -> -1E-6176\r
+dqnextm101 nextminus  0           -> -1E-6176\r
+dqnextm102 nextminus  0.00        -> -1E-6176\r
+dqnextm103 nextminus -0.00        -> -1E-6176\r
+dqnextm104 nextminus  0E-300      -> -1E-6176\r
+dqnextm105 nextminus  0E+300      -> -1E-6176\r
+dqnextm106 nextminus  0E+30000    -> -1E-6176\r
+dqnextm107 nextminus -0E+30000    -> -1E-6176\r
+\r
+-- specials\r
+dqnextm150 nextminus   Inf    ->  9.999999999999999999999999999999999E+6144\r
+dqnextm151 nextminus  -Inf    -> -Infinity\r
+dqnextm152 nextminus   NaN    ->  NaN\r
+dqnextm153 nextminus  sNaN    ->  NaN   Invalid_operation\r
+dqnextm154 nextminus   NaN77  ->  NaN77\r
+dqnextm155 nextminus  sNaN88  ->  NaN88 Invalid_operation\r
+dqnextm156 nextminus  -NaN    -> -NaN\r
+dqnextm157 nextminus -sNaN    -> -NaN   Invalid_operation\r
+dqnextm158 nextminus  -NaN77  -> -NaN77\r
+dqnextm159 nextminus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+dqnextm170 nextminus  9.999999999999999999999999999999999E+6144   -> 9.999999999999999999999999999999998E+6144\r
+dqnextm171 nextminus  9.999999999999999999999999999999998E+6144   -> 9.999999999999999999999999999999997E+6144\r
+dqnextm172 nextminus  1E-6143                   -> 9.99999999999999999999999999999999E-6144\r
+dqnextm173 nextminus  1.000000000000000000000000000000000E-6143   -> 9.99999999999999999999999999999999E-6144\r
+dqnextm174 nextminus  9E-6176                   -> 8E-6176\r
+dqnextm175 nextminus  9.9E-6175                 -> 9.8E-6175\r
+dqnextm176 nextminus  9.99999999999999999999999999999E-6147       -> 9.99999999999999999999999999998E-6147\r
+dqnextm177 nextminus  9.99999999999999999999999999999999E-6144    -> 9.99999999999999999999999999999998E-6144\r
+dqnextm178 nextminus  9.99999999999999999999999999999998E-6144    -> 9.99999999999999999999999999999997E-6144\r
+dqnextm179 nextminus  9.99999999999999999999999999999997E-6144    -> 9.99999999999999999999999999999996E-6144\r
+dqnextm180 nextminus  0E-6176                   -> -1E-6176\r
+dqnextm181 nextminus  1E-6176                   -> 0E-6176\r
+dqnextm182 nextminus  2E-6176                   -> 1E-6176\r
+\r
+dqnextm183 nextminus  -0E-6176                  -> -1E-6176\r
+dqnextm184 nextminus  -1E-6176                  -> -2E-6176\r
+dqnextm185 nextminus  -2E-6176                  -> -3E-6176\r
+dqnextm186 nextminus  -10E-6176                 -> -1.1E-6175\r
+dqnextm187 nextminus  -100E-6176                -> -1.01E-6174\r
+dqnextm188 nextminus  -100000E-6176             -> -1.00001E-6171\r
+dqnextm189 nextminus  -1.00000000000000000000000000000E-6143      -> -1.000000000000000000000000000000001E-6143\r
+dqnextm190 nextminus  -1.000000000000000000000000000000000E-6143  -> -1.000000000000000000000000000000001E-6143\r
+dqnextm191 nextminus  -1E-6143                  -> -1.000000000000000000000000000000001E-6143\r
+dqnextm192 nextminus  -9.999999999999999999999999999999998E+6144  -> -9.999999999999999999999999999999999E+6144\r
+dqnextm193 nextminus  -9.999999999999999999999999999999999E+6144  -> -Infinity\r
+\r
+-- Null tests\r
+dqnextm900 nextminus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqNextPlus.decTest b/Lib/test/decimaltestdata/dqNextPlus.decTest
new file mode 100644 (file)
index 0000000..8c0ac45
--- /dev/null
@@ -0,0 +1,124 @@
+------------------------------------------------------------------------\r
+-- dqNextPlus.decTest -- decQuad next that is greater [754r nextup]   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqnextp001 nextplus  0.9999999999999999999999999999999995 ->   0.9999999999999999999999999999999996\r
+dqnextp002 nextplus  0.9999999999999999999999999999999996 ->   0.9999999999999999999999999999999997\r
+dqnextp003 nextplus  0.9999999999999999999999999999999997 ->   0.9999999999999999999999999999999998\r
+dqnextp004 nextplus  0.9999999999999999999999999999999998 ->   0.9999999999999999999999999999999999\r
+dqnextp005 nextplus  0.9999999999999999999999999999999999 ->   1.000000000000000000000000000000000\r
+dqnextp006 nextplus  1.000000000000000000000000000000000  ->   1.000000000000000000000000000000001\r
+dqnextp007 nextplus  1.0         ->   1.000000000000000000000000000000001\r
+dqnextp008 nextplus  1           ->   1.000000000000000000000000000000001\r
+dqnextp009 nextplus  1.000000000000000000000000000000001  ->   1.000000000000000000000000000000002\r
+dqnextp010 nextplus  1.000000000000000000000000000000002  ->   1.000000000000000000000000000000003\r
+dqnextp011 nextplus  1.000000000000000000000000000000003  ->   1.000000000000000000000000000000004\r
+dqnextp012 nextplus  1.000000000000000000000000000000004  ->   1.000000000000000000000000000000005\r
+dqnextp013 nextplus  1.000000000000000000000000000000005  ->   1.000000000000000000000000000000006\r
+dqnextp014 nextplus  1.000000000000000000000000000000006  ->   1.000000000000000000000000000000007\r
+dqnextp015 nextplus  1.000000000000000000000000000000007  ->   1.000000000000000000000000000000008\r
+dqnextp016 nextplus  1.000000000000000000000000000000008  ->   1.000000000000000000000000000000009\r
+dqnextp017 nextplus  1.000000000000000000000000000000009  ->   1.000000000000000000000000000000010\r
+dqnextp018 nextplus  1.000000000000000000000000000000010  ->   1.000000000000000000000000000000011\r
+dqnextp019 nextplus  1.000000000000000000000000000000011  ->   1.000000000000000000000000000000012\r
+\r
+dqnextp021 nextplus -0.9999999999999999999999999999999995 ->  -0.9999999999999999999999999999999994\r
+dqnextp022 nextplus -0.9999999999999999999999999999999996 ->  -0.9999999999999999999999999999999995\r
+dqnextp023 nextplus -0.9999999999999999999999999999999997 ->  -0.9999999999999999999999999999999996\r
+dqnextp024 nextplus -0.9999999999999999999999999999999998 ->  -0.9999999999999999999999999999999997\r
+dqnextp025 nextplus -0.9999999999999999999999999999999999 ->  -0.9999999999999999999999999999999998\r
+dqnextp026 nextplus -1.000000000000000000000000000000000  ->  -0.9999999999999999999999999999999999\r
+dqnextp027 nextplus -1.0         ->  -0.9999999999999999999999999999999999\r
+dqnextp028 nextplus -1           ->  -0.9999999999999999999999999999999999\r
+dqnextp029 nextplus -1.000000000000000000000000000000001  ->  -1.000000000000000000000000000000000\r
+dqnextp030 nextplus -1.000000000000000000000000000000002  ->  -1.000000000000000000000000000000001\r
+dqnextp031 nextplus -1.000000000000000000000000000000003  ->  -1.000000000000000000000000000000002\r
+dqnextp032 nextplus -1.000000000000000000000000000000004  ->  -1.000000000000000000000000000000003\r
+dqnextp033 nextplus -1.000000000000000000000000000000005  ->  -1.000000000000000000000000000000004\r
+dqnextp034 nextplus -1.000000000000000000000000000000006  ->  -1.000000000000000000000000000000005\r
+dqnextp035 nextplus -1.000000000000000000000000000000007  ->  -1.000000000000000000000000000000006\r
+dqnextp036 nextplus -1.000000000000000000000000000000008  ->  -1.000000000000000000000000000000007\r
+dqnextp037 nextplus -1.000000000000000000000000000000009  ->  -1.000000000000000000000000000000008\r
+dqnextp038 nextplus -1.000000000000000000000000000000010  ->  -1.000000000000000000000000000000009\r
+dqnextp039 nextplus -1.000000000000000000000000000000011  ->  -1.000000000000000000000000000000010\r
+dqnextp040 nextplus -1.000000000000000000000000000000012  ->  -1.000000000000000000000000000000011\r
+\r
+-- Zeros\r
+dqnextp100 nextplus  0           ->  1E-6176\r
+dqnextp101 nextplus  0.00        ->  1E-6176\r
+dqnextp102 nextplus  0E-300      ->  1E-6176\r
+dqnextp103 nextplus  0E+300      ->  1E-6176\r
+dqnextp104 nextplus  0E+30000    ->  1E-6176\r
+dqnextp105 nextplus -0           ->  1E-6176\r
+dqnextp106 nextplus -0.00        ->  1E-6176\r
+dqnextp107 nextplus -0E-300      ->  1E-6176\r
+dqnextp108 nextplus -0E+300      ->  1E-6176\r
+dqnextp109 nextplus -0E+30000    ->  1E-6176\r
+\r
+-- specials\r
+dqnextp150 nextplus   Inf    ->  Infinity\r
+dqnextp151 nextplus  -Inf    -> -9.999999999999999999999999999999999E+6144\r
+dqnextp152 nextplus   NaN    ->  NaN\r
+dqnextp153 nextplus  sNaN    ->  NaN   Invalid_operation\r
+dqnextp154 nextplus   NaN77  ->  NaN77\r
+dqnextp155 nextplus  sNaN88  ->  NaN88 Invalid_operation\r
+dqnextp156 nextplus  -NaN    -> -NaN\r
+dqnextp157 nextplus -sNaN    -> -NaN   Invalid_operation\r
+dqnextp158 nextplus  -NaN77  -> -NaN77\r
+dqnextp159 nextplus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+dqnextp170 nextplus  -9.999999999999999999999999999999999E+6144  -> -9.999999999999999999999999999999998E+6144\r
+dqnextp171 nextplus  -9.999999999999999999999999999999998E+6144  -> -9.999999999999999999999999999999997E+6144\r
+dqnextp172 nextplus  -1E-6143                  -> -9.99999999999999999999999999999999E-6144\r
+dqnextp173 nextplus  -1.000000000000000E-6143  -> -9.99999999999999999999999999999999E-6144\r
+dqnextp174 nextplus  -9E-6176                  -> -8E-6176\r
+dqnextp175 nextplus  -9.9E-6175                -> -9.8E-6175\r
+dqnextp176 nextplus  -9.99999999999999999999999999999E-6147      -> -9.99999999999999999999999999998E-6147\r
+dqnextp177 nextplus  -9.99999999999999999999999999999999E-6144   -> -9.99999999999999999999999999999998E-6144\r
+dqnextp178 nextplus  -9.99999999999999999999999999999998E-6144   -> -9.99999999999999999999999999999997E-6144\r
+dqnextp179 nextplus  -9.99999999999999999999999999999997E-6144   -> -9.99999999999999999999999999999996E-6144\r
+dqnextp180 nextplus  -0E-6176                  ->  1E-6176\r
+dqnextp181 nextplus  -1E-6176                  -> -0E-6176\r
+dqnextp182 nextplus  -2E-6176                  -> -1E-6176\r
+\r
+dqnextp183 nextplus   0E-6176                  ->  1E-6176\r
+dqnextp184 nextplus   1E-6176                  ->  2E-6176\r
+dqnextp185 nextplus   2E-6176                  ->  3E-6176\r
+dqnextp186 nextplus   10E-6176                 ->  1.1E-6175\r
+dqnextp187 nextplus   100E-6176                ->  1.01E-6174\r
+dqnextp188 nextplus   100000E-6176             ->  1.00001E-6171\r
+dqnextp189 nextplus   1.00000000000000000000000000000E-6143      ->  1.000000000000000000000000000000001E-6143\r
+dqnextp190 nextplus   1.000000000000000000000000000000000E-6143  ->  1.000000000000000000000000000000001E-6143\r
+dqnextp191 nextplus   1E-6143                  ->  1.000000000000000000000000000000001E-6143\r
+dqnextp192 nextplus   9.999999999999999999999999999999998E+6144  ->  9.999999999999999999999999999999999E+6144\r
+dqnextp193 nextplus   9.999999999999999999999999999999999E+6144  ->  Infinity\r
+\r
+-- Null tests\r
+dqnextp900 nextplus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqNextToward.decTest b/Lib/test/decimaltestdata/dqNextToward.decTest
new file mode 100644 (file)
index 0000000..e534951
--- /dev/null
@@ -0,0 +1,375 @@
+------------------------------------------------------------------------\r
+-- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter]   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+\r
+-- Sanity check with a scattering of numerics\r
+dqnextt001 nexttoward   10    10   ->  10\r
+dqnextt002 nexttoward  -10   -10   -> -10\r
+dqnextt003 nexttoward   1     10   ->  1.000000000000000000000000000000001\r
+dqnextt004 nexttoward   1    -10   ->  0.9999999999999999999999999999999999\r
+dqnextt005 nexttoward  -1     10   -> -0.9999999999999999999999999999999999\r
+dqnextt006 nexttoward  -1    -10   -> -1.000000000000000000000000000000001\r
+dqnextt007 nexttoward   0     10   ->  1E-6176       Underflow Subnormal Inexact Rounded\r
+dqnextt008 nexttoward   0    -10   -> -1E-6176       Underflow Subnormal Inexact Rounded\r
+dqnextt009 nexttoward   9.999999999999999999999999999999999E+6144 +Infinity ->  Infinity Overflow Inexact Rounded\r
+dqnextt010 nexttoward  -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded\r
+dqnextt011 nexttoward       9.999999999999999999999999999999999  10  ->  10.00000000000000000000000000000000\r
+dqnextt012 nexttoward   10  9.999999999999999999999999999999999      ->  9.999999999999999999999999999999999\r
+dqnextt013 nexttoward      -9.999999999999999999999999999999999 -10  -> -10.00000000000000000000000000000000\r
+dqnextt014 nexttoward  -10 -9.999999999999999999999999999999999      -> -9.999999999999999999999999999999999\r
+dqnextt015 nexttoward       9.999999999999999999999999999999998  10  ->  9.999999999999999999999999999999999\r
+dqnextt016 nexttoward   10  9.999999999999999999999999999999998      ->  9.999999999999999999999999999999999\r
+dqnextt017 nexttoward      -9.999999999999999999999999999999998 -10  -> -9.999999999999999999999999999999999\r
+dqnextt018 nexttoward  -10 -9.999999999999999999999999999999998      -> -9.999999999999999999999999999999999\r
+\r
+------- lhs=rhs\r
+-- finites\r
+dqnextt101 nexttoward          7       7 ->  7\r
+dqnextt102 nexttoward         -7      -7 -> -7\r
+dqnextt103 nexttoward         75      75 ->  75\r
+dqnextt104 nexttoward        -75     -75 -> -75\r
+dqnextt105 nexttoward       7.50     7.5 ->  7.50\r
+dqnextt106 nexttoward      -7.50   -7.50 -> -7.50\r
+dqnextt107 nexttoward       7.500 7.5000 ->  7.500\r
+dqnextt108 nexttoward      -7.500   -7.5 -> -7.500\r
+\r
+-- zeros\r
+dqnextt111 nexttoward          0       0 ->  0\r
+dqnextt112 nexttoward         -0      -0 -> -0\r
+dqnextt113 nexttoward       0E+4       0 ->  0E+4\r
+dqnextt114 nexttoward      -0E+4      -0 -> -0E+4\r
+dqnextt115 nexttoward     0.00000000000   0.000000000000 ->  0E-11\r
+dqnextt116 nexttoward    -0.00000000000  -0.00           -> -0E-11\r
+dqnextt117 nexttoward      0E-141      0 ->  0E-141\r
+dqnextt118 nexttoward     -0E-141   -000 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqnextt121 nexttoward   268268268    268268268 ->   268268268\r
+dqnextt122 nexttoward  -268268268   -268268268 ->  -268268268\r
+dqnextt123 nexttoward   134134134    134134134 ->   134134134\r
+dqnextt124 nexttoward  -134134134   -134134134 ->  -134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqnextt131 nexttoward  9.999999999999999999999999999999999E+6144  9.999999999999999999999999999999999E+6144   ->   9.999999999999999999999999999999999E+6144\r
+dqnextt132 nexttoward  1E-6143           1E-6143            ->   1E-6143\r
+dqnextt133 nexttoward  1.000000000000000000000000000000000E-6143  1.000000000000000000000000000000000E-6143   ->   1.000000000000000000000000000000000E-6143\r
+dqnextt134 nexttoward  1E-6176           1E-6176            ->   1E-6176\r
+\r
+dqnextt135 nexttoward  -1E-6176          -1E-6176           ->  -1E-6176\r
+dqnextt136 nexttoward  -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143  ->  -1.000000000000000000000000000000000E-6143\r
+dqnextt137 nexttoward  -1E-6143          -1E-6143           ->  -1E-6143\r
+dqnextt138 nexttoward  -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144  ->  -9.999999999999999999999999999999999E+6144\r
+\r
+------- lhs<rhs\r
+dqnextt201 nexttoward  0.9999999999999999999999999999999995 Infinity ->   0.9999999999999999999999999999999996\r
+dqnextt202 nexttoward  0.9999999999999999999999999999999996 Infinity ->   0.9999999999999999999999999999999997\r
+dqnextt203 nexttoward  0.9999999999999999999999999999999997 Infinity ->   0.9999999999999999999999999999999998\r
+dqnextt204 nexttoward  0.9999999999999999999999999999999998 Infinity ->   0.9999999999999999999999999999999999\r
+dqnextt205 nexttoward  0.9999999999999999999999999999999999 Infinity ->   1.000000000000000000000000000000000\r
+dqnextt206 nexttoward  1.000000000000000000000000000000000  Infinity ->   1.000000000000000000000000000000001\r
+dqnextt207 nexttoward  1.0         Infinity ->   1.000000000000000000000000000000001\r
+dqnextt208 nexttoward  1           Infinity ->   1.000000000000000000000000000000001\r
+dqnextt209 nexttoward  1.000000000000000000000000000000001  Infinity ->   1.000000000000000000000000000000002\r
+dqnextt210 nexttoward  1.000000000000000000000000000000002  Infinity ->   1.000000000000000000000000000000003\r
+dqnextt211 nexttoward  1.000000000000000000000000000000003  Infinity ->   1.000000000000000000000000000000004\r
+dqnextt212 nexttoward  1.000000000000000000000000000000004  Infinity ->   1.000000000000000000000000000000005\r
+dqnextt213 nexttoward  1.000000000000000000000000000000005  Infinity ->   1.000000000000000000000000000000006\r
+dqnextt214 nexttoward  1.000000000000000000000000000000006  Infinity ->   1.000000000000000000000000000000007\r
+dqnextt215 nexttoward  1.000000000000000000000000000000007  Infinity ->   1.000000000000000000000000000000008\r
+dqnextt216 nexttoward  1.000000000000000000000000000000008  Infinity ->   1.000000000000000000000000000000009\r
+dqnextt217 nexttoward  1.000000000000000000000000000000009  Infinity ->   1.000000000000000000000000000000010\r
+dqnextt218 nexttoward  1.000000000000000000000000000000010  Infinity ->   1.000000000000000000000000000000011\r
+dqnextt219 nexttoward  1.000000000000000000000000000000011  Infinity ->   1.000000000000000000000000000000012\r
+\r
+dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity ->  -0.9999999999999999999999999999999994\r
+dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995\r
+dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity ->  -0.9999999999999999999999999999999996\r
+dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity ->  -0.9999999999999999999999999999999997\r
+dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity ->  -0.9999999999999999999999999999999998\r
+dqnextt226 nexttoward -1.000000000000000000000000000000000  Infinity ->  -0.9999999999999999999999999999999999\r
+dqnextt227 nexttoward -1.0         Infinity ->  -0.9999999999999999999999999999999999\r
+dqnextt228 nexttoward -1           Infinity ->  -0.9999999999999999999999999999999999\r
+dqnextt229 nexttoward -1.000000000000000000000000000000001  Infinity ->  -1.000000000000000000000000000000000\r
+dqnextt230 nexttoward -1.000000000000000000000000000000002  Infinity ->  -1.000000000000000000000000000000001\r
+dqnextt231 nexttoward -1.000000000000000000000000000000003  Infinity ->  -1.000000000000000000000000000000002\r
+dqnextt232 nexttoward -1.000000000000000000000000000000004  Infinity ->  -1.000000000000000000000000000000003\r
+dqnextt233 nexttoward -1.000000000000000000000000000000005  Infinity ->  -1.000000000000000000000000000000004\r
+dqnextt234 nexttoward -1.000000000000000000000000000000006  Infinity ->  -1.000000000000000000000000000000005\r
+dqnextt235 nexttoward -1.000000000000000000000000000000007  Infinity ->  -1.000000000000000000000000000000006\r
+dqnextt236 nexttoward -1.000000000000000000000000000000008  Infinity ->  -1.000000000000000000000000000000007\r
+dqnextt237 nexttoward -1.000000000000000000000000000000009  Infinity ->  -1.000000000000000000000000000000008\r
+dqnextt238 nexttoward -1.000000000000000000000000000000010  Infinity ->  -1.000000000000000000000000000000009\r
+dqnextt239 nexttoward -1.000000000000000000000000000000011  Infinity ->  -1.000000000000000000000000000000010\r
+dqnextt240 nexttoward -1.000000000000000000000000000000012  Infinity ->  -1.000000000000000000000000000000011\r
+\r
+-- Zeros\r
+dqnextt300 nexttoward  0           Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt301 nexttoward  0.00        Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt302 nexttoward  0E-300      Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt303 nexttoward  0E+300      Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt304 nexttoward  0E+30000    Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt305 nexttoward -0           Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt306 nexttoward -0.00        Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt307 nexttoward -0E-300      Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt308 nexttoward -0E+300      Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+dqnextt309 nexttoward -0E+30000    Infinity ->  1E-6176              Underflow Subnormal Inexact Rounded\r
+\r
+-- specials\r
+dqnextt350 nexttoward   Inf    Infinity ->  Infinity\r
+dqnextt351 nexttoward  -Inf    Infinity -> -9.999999999999999999999999999999999E+6144\r
+dqnextt352 nexttoward   NaN    Infinity ->  NaN\r
+dqnextt353 nexttoward  sNaN    Infinity ->  NaN   Invalid_operation\r
+dqnextt354 nexttoward   NaN77  Infinity ->  NaN77\r
+dqnextt355 nexttoward  sNaN88  Infinity ->  NaN88 Invalid_operation\r
+dqnextt356 nexttoward  -NaN    Infinity -> -NaN\r
+dqnextt357 nexttoward -sNaN    Infinity -> -NaN   Invalid_operation\r
+dqnextt358 nexttoward  -NaN77  Infinity -> -NaN77\r
+dqnextt359 nexttoward -sNaN88  Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+dqnextt370 nexttoward  -9.999999999999999999999999999999999E+6144  Infinity  -> -9.999999999999999999999999999999998E+6144\r
+dqnextt371 nexttoward  -9.999999999999999999999999999999998E+6144  Infinity  -> -9.999999999999999999999999999999997E+6144\r
+dqnextt372 nexttoward  -1E-6143                  Infinity  -> -9.99999999999999999999999999999999E-6144  Underflow Subnormal Inexact Rounded\r
+dqnextt373 nexttoward  -1.000000000000000E-6143  Infinity  -> -9.99999999999999999999999999999999E-6144  Underflow Subnormal Inexact Rounded\r
+dqnextt374 nexttoward  -9E-6176                  Infinity  -> -8E-6176                 Underflow Subnormal Inexact Rounded\r
+dqnextt375 nexttoward  -9.9E-6175                Infinity  -> -9.8E-6175               Underflow Subnormal Inexact Rounded\r
+dqnextt376 nexttoward  -9.99999999999999999999999999999E-6147      Infinity  -> -9.99999999999999999999999999998E-6147     Underflow Subnormal Inexact Rounded\r
+dqnextt377 nexttoward  -9.99999999999999999999999999999999E-6144   Infinity  -> -9.99999999999999999999999999999998E-6144  Underflow Subnormal Inexact Rounded\r
+dqnextt378 nexttoward  -9.99999999999999999999999999999998E-6144   Infinity  -> -9.99999999999999999999999999999997E-6144  Underflow Subnormal Inexact Rounded\r
+dqnextt379 nexttoward  -9.99999999999999999999999999999997E-6144   Infinity  -> -9.99999999999999999999999999999996E-6144  Underflow Subnormal Inexact Rounded\r
+dqnextt380 nexttoward  -0E-6176                  Infinity  ->  1E-6176                 Underflow Subnormal Inexact Rounded\r
+dqnextt381 nexttoward  -1E-6176                  Infinity  -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqnextt382 nexttoward  -2E-6176                  Infinity  -> -1E-6176                 Underflow Subnormal Inexact Rounded\r
+\r
+dqnextt383 nexttoward   0E-6176                  Infinity  ->  1E-6176                 Underflow Subnormal Inexact Rounded\r
+dqnextt384 nexttoward   1E-6176                  Infinity  ->  2E-6176                 Underflow Subnormal Inexact Rounded\r
+dqnextt385 nexttoward   2E-6176                  Infinity  ->  3E-6176                 Underflow Subnormal Inexact Rounded\r
+dqnextt386 nexttoward   10E-6176                 Infinity  ->  1.1E-6175               Underflow Subnormal Inexact Rounded\r
+dqnextt387 nexttoward   100E-6176                Infinity  ->  1.01E-6174              Underflow Subnormal Inexact Rounded\r
+dqnextt388 nexttoward   100000E-6176             Infinity  ->  1.00001E-6171           Underflow Subnormal Inexact Rounded\r
+dqnextt389 nexttoward   1.00000000000000000000000000000E-6143      Infinity  ->  1.000000000000000000000000000000001E-6143\r
+dqnextt390 nexttoward   1.000000000000000000000000000000000E-6143  Infinity  ->  1.000000000000000000000000000000001E-6143\r
+dqnextt391 nexttoward   1E-6143                  Infinity  ->  1.000000000000000000000000000000001E-6143\r
+dqnextt392 nexttoward   9.999999999999999999999999999999997E+6144  Infinity  ->  9.999999999999999999999999999999998E+6144\r
+dqnextt393 nexttoward   9.999999999999999999999999999999998E+6144  Infinity  ->  9.999999999999999999999999999999999E+6144\r
+dqnextt394 nexttoward   9.999999999999999999999999999999999E+6144  Infinity  ->  Infinity               Overflow Inexact Rounded\r
+\r
+------- lhs>rhs\r
+dqnextt401 nexttoward  0.9999999999999999999999999999999995  -Infinity ->   0.9999999999999999999999999999999994\r
+dqnextt402 nexttoward  0.9999999999999999999999999999999996  -Infinity ->   0.9999999999999999999999999999999995\r
+dqnextt403 nexttoward  0.9999999999999999999999999999999997  -Infinity ->   0.9999999999999999999999999999999996\r
+dqnextt404 nexttoward  0.9999999999999999999999999999999998  -Infinity ->   0.9999999999999999999999999999999997\r
+dqnextt405 nexttoward  0.9999999999999999999999999999999999  -Infinity ->   0.9999999999999999999999999999999998\r
+dqnextt406 nexttoward  1.000000000000000000000000000000000   -Infinity ->   0.9999999999999999999999999999999999\r
+dqnextt407 nexttoward  1.0          -Infinity ->   0.9999999999999999999999999999999999\r
+dqnextt408 nexttoward  1            -Infinity ->   0.9999999999999999999999999999999999\r
+dqnextt409 nexttoward  1.000000000000000000000000000000001   -Infinity ->   1.000000000000000000000000000000000\r
+dqnextt410 nexttoward  1.000000000000000000000000000000002   -Infinity ->   1.000000000000000000000000000000001\r
+dqnextt411 nexttoward  1.000000000000000000000000000000003   -Infinity ->   1.000000000000000000000000000000002\r
+dqnextt412 nexttoward  1.000000000000000000000000000000004   -Infinity ->   1.000000000000000000000000000000003\r
+dqnextt413 nexttoward  1.000000000000000000000000000000005   -Infinity ->   1.000000000000000000000000000000004\r
+dqnextt414 nexttoward  1.000000000000000000000000000000006   -Infinity ->   1.000000000000000000000000000000005\r
+dqnextt415 nexttoward  1.000000000000000000000000000000007   -Infinity ->   1.000000000000000000000000000000006\r
+dqnextt416 nexttoward  1.000000000000000000000000000000008   -Infinity ->   1.000000000000000000000000000000007\r
+dqnextt417 nexttoward  1.000000000000000000000000000000009   -Infinity ->   1.000000000000000000000000000000008\r
+dqnextt418 nexttoward  1.000000000000000000000000000000010   -Infinity ->   1.000000000000000000000000000000009\r
+dqnextt419 nexttoward  1.000000000000000000000000000000011   -Infinity ->   1.000000000000000000000000000000010\r
+dqnextt420 nexttoward  1.000000000000000000000000000000012   -Infinity ->   1.000000000000000000000000000000011\r
+\r
+dqnextt421 nexttoward -0.9999999999999999999999999999999995  -Infinity ->  -0.9999999999999999999999999999999996\r
+dqnextt422 nexttoward -0.9999999999999999999999999999999996  -Infinity ->  -0.9999999999999999999999999999999997\r
+dqnextt423 nexttoward -0.9999999999999999999999999999999997  -Infinity ->  -0.9999999999999999999999999999999998\r
+dqnextt424 nexttoward -0.9999999999999999999999999999999998  -Infinity ->  -0.9999999999999999999999999999999999\r
+dqnextt425 nexttoward -0.9999999999999999999999999999999999  -Infinity ->  -1.000000000000000000000000000000000\r
+dqnextt426 nexttoward -1.000000000000000000000000000000000   -Infinity ->  -1.000000000000000000000000000000001\r
+dqnextt427 nexttoward -1.0          -Infinity ->  -1.000000000000000000000000000000001\r
+dqnextt428 nexttoward -1            -Infinity ->  -1.000000000000000000000000000000001\r
+dqnextt429 nexttoward -1.000000000000000000000000000000001   -Infinity ->  -1.000000000000000000000000000000002\r
+dqnextt430 nexttoward -1.000000000000000000000000000000002   -Infinity ->  -1.000000000000000000000000000000003\r
+dqnextt431 nexttoward -1.000000000000000000000000000000003   -Infinity ->  -1.000000000000000000000000000000004\r
+dqnextt432 nexttoward -1.000000000000000000000000000000004   -Infinity ->  -1.000000000000000000000000000000005\r
+dqnextt433 nexttoward -1.000000000000000000000000000000005   -Infinity ->  -1.000000000000000000000000000000006\r
+dqnextt434 nexttoward -1.000000000000000000000000000000006   -Infinity ->  -1.000000000000000000000000000000007\r
+dqnextt435 nexttoward -1.000000000000000000000000000000007   -Infinity ->  -1.000000000000000000000000000000008\r
+dqnextt436 nexttoward -1.000000000000000000000000000000008   -Infinity ->  -1.000000000000000000000000000000009\r
+dqnextt437 nexttoward -1.000000000000000000000000000000009   -Infinity ->  -1.000000000000000000000000000000010\r
+dqnextt438 nexttoward -1.000000000000000000000000000000010   -Infinity ->  -1.000000000000000000000000000000011\r
+dqnextt439 nexttoward -1.000000000000000000000000000000011   -Infinity ->  -1.000000000000000000000000000000012\r
+\r
+-- Zeros\r
+dqnextt500 nexttoward -0            -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt501 nexttoward  0            -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt502 nexttoward  0.00         -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt503 nexttoward -0.00         -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt504 nexttoward  0E-300       -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt505 nexttoward  0E+300       -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt506 nexttoward  0E+30000     -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+dqnextt507 nexttoward -0E+30000     -Infinity -> -1E-6176         Underflow Subnormal Inexact Rounded\r
+\r
+-- specials\r
+dqnextt550 nexttoward   Inf     -Infinity ->  9.999999999999999999999999999999999E+6144\r
+dqnextt551 nexttoward  -Inf     -Infinity -> -Infinity\r
+dqnextt552 nexttoward   NaN     -Infinity ->  NaN\r
+dqnextt553 nexttoward  sNaN     -Infinity ->  NaN   Invalid_operation\r
+dqnextt554 nexttoward   NaN77   -Infinity ->  NaN77\r
+dqnextt555 nexttoward  sNaN88   -Infinity ->  NaN88 Invalid_operation\r
+dqnextt556 nexttoward  -NaN     -Infinity -> -NaN\r
+dqnextt557 nexttoward -sNaN     -Infinity -> -NaN   Invalid_operation\r
+dqnextt558 nexttoward  -NaN77   -Infinity -> -NaN77\r
+dqnextt559 nexttoward -sNaN88   -Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+dqnextt670 nexttoward  9.999999999999999999999999999999999E+6144   -Infinity  -> 9.999999999999999999999999999999998E+6144\r
+dqnextt671 nexttoward  9.999999999999999999999999999999998E+6144   -Infinity  -> 9.999999999999999999999999999999997E+6144\r
+dqnextt672 nexttoward  1E-6143                   -Infinity  -> 9.99999999999999999999999999999999E-6144   Underflow Subnormal  Inexact Rounded\r
+dqnextt673 nexttoward  1.000000000000000000000000000000000E-6143   -Infinity  -> 9.99999999999999999999999999999999E-6144   Underflow Subnormal  Inexact Rounded\r
+dqnextt674 nexttoward  9E-6176                   -Infinity  -> 8E-6176                  Underflow Subnormal  Inexact Rounded\r
+dqnextt675 nexttoward  9.9E-6175                 -Infinity  -> 9.8E-6175                Underflow Subnormal  Inexact Rounded\r
+dqnextt676 nexttoward  9.99999999999999999999999999999E-6147       -Infinity  -> 9.99999999999999999999999999998E-6147      Underflow Subnormal  Inexact Rounded\r
+dqnextt677 nexttoward  9.99999999999999999999999999999999E-6144    -Infinity  -> 9.99999999999999999999999999999998E-6144   Underflow Subnormal  Inexact Rounded\r
+dqnextt678 nexttoward  9.99999999999999999999999999999998E-6144    -Infinity  -> 9.99999999999999999999999999999997E-6144   Underflow Subnormal  Inexact Rounded\r
+dqnextt679 nexttoward  9.99999999999999999999999999999997E-6144    -Infinity  -> 9.99999999999999999999999999999996E-6144   Underflow Subnormal  Inexact Rounded\r
+dqnextt680 nexttoward  0E-6176                   -Infinity  -> -1E-6176                 Underflow Subnormal  Inexact Rounded\r
+dqnextt681 nexttoward  1E-6176                   -Infinity  -> 0E-6176                  Underflow Subnormal  Inexact Rounded Clamped\r
+dqnextt682 nexttoward  2E-6176                   -Infinity  -> 1E-6176                  Underflow Subnormal  Inexact Rounded\r
+\r
+dqnextt683 nexttoward  -0E-6176                  -Infinity  -> -1E-6176                 Underflow Subnormal  Inexact Rounded\r
+dqnextt684 nexttoward  -1E-6176                  -Infinity  -> -2E-6176                 Underflow Subnormal  Inexact Rounded\r
+dqnextt685 nexttoward  -2E-6176                  -Infinity  -> -3E-6176                 Underflow Subnormal  Inexact Rounded\r
+dqnextt686 nexttoward  -10E-6176                 -Infinity  -> -1.1E-6175               Underflow Subnormal  Inexact Rounded\r
+dqnextt687 nexttoward  -100E-6176                -Infinity  -> -1.01E-6174              Underflow Subnormal  Inexact Rounded\r
+dqnextt688 nexttoward  -100000E-6176             -Infinity  -> -1.00001E-6171           Underflow Subnormal  Inexact Rounded\r
+dqnextt689 nexttoward  -1.00000000000000000000000000000E-6143      -Infinity  -> -1.000000000000000000000000000000001E-6143\r
+dqnextt690 nexttoward  -1.000000000000000000000000000000000E-6143  -Infinity  -> -1.000000000000000000000000000000001E-6143\r
+dqnextt691 nexttoward  -1E-6143                  -Infinity  -> -1.000000000000000000000000000000001E-6143\r
+dqnextt692 nexttoward  -9.999999999999999999999999999999998E+6144  -Infinity  -> -9.999999999999999999999999999999999E+6144\r
+dqnextt693 nexttoward  -9.999999999999999999999999999999999E+6144  -Infinity  -> -Infinity               Overflow Inexact Rounded\r
+\r
+------- Specials\r
+dqnextt780 nexttoward -Inf  -Inf   -> -Infinity\r
+dqnextt781 nexttoward -Inf  -1000  -> -9.999999999999999999999999999999999E+6144\r
+dqnextt782 nexttoward -Inf  -1     -> -9.999999999999999999999999999999999E+6144\r
+dqnextt783 nexttoward -Inf  -0     -> -9.999999999999999999999999999999999E+6144\r
+dqnextt784 nexttoward -Inf   0     -> -9.999999999999999999999999999999999E+6144\r
+dqnextt785 nexttoward -Inf   1     -> -9.999999999999999999999999999999999E+6144\r
+dqnextt786 nexttoward -Inf   1000  -> -9.999999999999999999999999999999999E+6144\r
+dqnextt787 nexttoward -1000 -Inf   -> -1000.000000000000000000000000000001\r
+dqnextt788 nexttoward -Inf  -Inf   -> -Infinity\r
+dqnextt789 nexttoward -1    -Inf   -> -1.000000000000000000000000000000001\r
+dqnextt790 nexttoward -0    -Inf   -> -1E-6176           Underflow Subnormal Inexact Rounded\r
+dqnextt791 nexttoward  0    -Inf   -> -1E-6176           Underflow Subnormal Inexact Rounded\r
+dqnextt792 nexttoward  1    -Inf   ->  0.9999999999999999999999999999999999\r
+dqnextt793 nexttoward  1000 -Inf   ->  999.9999999999999999999999999999999\r
+dqnextt794 nexttoward  Inf  -Inf   ->  9.999999999999999999999999999999999E+6144\r
+\r
+dqnextt800 nexttoward  Inf  -Inf   ->  9.999999999999999999999999999999999E+6144\r
+dqnextt801 nexttoward  Inf  -1000  ->  9.999999999999999999999999999999999E+6144\r
+dqnextt802 nexttoward  Inf  -1     ->  9.999999999999999999999999999999999E+6144\r
+dqnextt803 nexttoward  Inf  -0     ->  9.999999999999999999999999999999999E+6144\r
+dqnextt804 nexttoward  Inf   0     ->  9.999999999999999999999999999999999E+6144\r
+dqnextt805 nexttoward  Inf   1     ->  9.999999999999999999999999999999999E+6144\r
+dqnextt806 nexttoward  Inf   1000  ->  9.999999999999999999999999999999999E+6144\r
+dqnextt807 nexttoward  Inf   Inf   ->  Infinity\r
+dqnextt808 nexttoward -1000  Inf   -> -999.9999999999999999999999999999999\r
+dqnextt809 nexttoward -Inf   Inf   -> -9.999999999999999999999999999999999E+6144\r
+dqnextt810 nexttoward -1     Inf   -> -0.9999999999999999999999999999999999\r
+dqnextt811 nexttoward -0     Inf   ->  1E-6176           Underflow Subnormal Inexact Rounded\r
+dqnextt812 nexttoward  0     Inf   ->  1E-6176           Underflow Subnormal Inexact Rounded\r
+dqnextt813 nexttoward  1     Inf   ->  1.000000000000000000000000000000001\r
+dqnextt814 nexttoward  1000  Inf   ->  1000.000000000000000000000000000001\r
+dqnextt815 nexttoward  Inf   Inf   ->  Infinity\r
+\r
+dqnextt821 nexttoward  NaN -Inf    ->  NaN\r
+dqnextt822 nexttoward  NaN -1000   ->  NaN\r
+dqnextt823 nexttoward  NaN -1      ->  NaN\r
+dqnextt824 nexttoward  NaN -0      ->  NaN\r
+dqnextt825 nexttoward  NaN  0      ->  NaN\r
+dqnextt826 nexttoward  NaN  1      ->  NaN\r
+dqnextt827 nexttoward  NaN  1000   ->  NaN\r
+dqnextt828 nexttoward  NaN  Inf    ->  NaN\r
+dqnextt829 nexttoward  NaN  NaN    ->  NaN\r
+dqnextt830 nexttoward -Inf  NaN    ->  NaN\r
+dqnextt831 nexttoward -1000 NaN    ->  NaN\r
+dqnextt832 nexttoward -1    NaN    ->  NaN\r
+dqnextt833 nexttoward -0    NaN    ->  NaN\r
+dqnextt834 nexttoward  0    NaN    ->  NaN\r
+dqnextt835 nexttoward  1    NaN    ->  NaN\r
+dqnextt836 nexttoward  1000 NaN    ->  NaN\r
+dqnextt837 nexttoward  Inf  NaN    ->  NaN\r
+\r
+dqnextt841 nexttoward  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqnextt842 nexttoward  sNaN -1000  ->  NaN  Invalid_operation\r
+dqnextt843 nexttoward  sNaN -1     ->  NaN  Invalid_operation\r
+dqnextt844 nexttoward  sNaN -0     ->  NaN  Invalid_operation\r
+dqnextt845 nexttoward  sNaN  0     ->  NaN  Invalid_operation\r
+dqnextt846 nexttoward  sNaN  1     ->  NaN  Invalid_operation\r
+dqnextt847 nexttoward  sNaN  1000  ->  NaN  Invalid_operation\r
+dqnextt848 nexttoward  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqnextt849 nexttoward  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqnextt850 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqnextt851 nexttoward -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqnextt852 nexttoward -1000 sNaN   ->  NaN  Invalid_operation\r
+dqnextt853 nexttoward -1    sNaN   ->  NaN  Invalid_operation\r
+dqnextt854 nexttoward -0    sNaN   ->  NaN  Invalid_operation\r
+dqnextt855 nexttoward  0    sNaN   ->  NaN  Invalid_operation\r
+dqnextt856 nexttoward  1    sNaN   ->  NaN  Invalid_operation\r
+dqnextt857 nexttoward  1000 sNaN   ->  NaN  Invalid_operation\r
+dqnextt858 nexttoward  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqnextt859 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqnextt861 nexttoward  NaN1   -Inf    ->  NaN1\r
+dqnextt862 nexttoward +NaN2   -1000   ->  NaN2\r
+dqnextt863 nexttoward  NaN3    1000   ->  NaN3\r
+dqnextt864 nexttoward  NaN4    Inf    ->  NaN4\r
+dqnextt865 nexttoward  NaN5   +NaN6   ->  NaN5\r
+dqnextt866 nexttoward -Inf     NaN7   ->  NaN7\r
+dqnextt867 nexttoward -1000    NaN8   ->  NaN8\r
+dqnextt868 nexttoward  1000    NaN9   ->  NaN9\r
+dqnextt869 nexttoward  Inf    +NaN10  ->  NaN10\r
+dqnextt871 nexttoward  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+dqnextt872 nexttoward  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+dqnextt873 nexttoward  sNaN13   1000  ->  NaN13  Invalid_operation\r
+dqnextt874 nexttoward  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+dqnextt875 nexttoward  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+dqnextt876 nexttoward  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+dqnextt877 nexttoward -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+dqnextt878 nexttoward -1000    sNaN21 ->  NaN21  Invalid_operation\r
+dqnextt879 nexttoward  1000    sNaN22 ->  NaN22  Invalid_operation\r
+dqnextt880 nexttoward  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+dqnextt881 nexttoward +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+dqnextt882 nexttoward -NaN26    NaN28 -> -NaN26\r
+dqnextt883 nexttoward -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+dqnextt884 nexttoward  1000    -NaN30 -> -NaN30\r
+dqnextt885 nexttoward  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Null tests\r
+dqnextt900 nexttoward 1  # -> NaN Invalid_operation\r
+dqnextt901 nexttoward #  1 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqOr.decTest b/Lib/test/decimaltestdata/dqOr.decTest
new file mode 100644 (file)
index 0000000..60470ea
--- /dev/null
@@ -0,0 +1,401 @@
+------------------------------------------------------------------------\r
+-- dqOr.decTest -- digitwise logical OR for decQuads                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+dqor001 or             0    0 ->    0\r
+dqor002 or             0    1 ->    1\r
+dqor003 or             1    0 ->    1\r
+dqor004 or             1    1 ->    1\r
+dqor005 or          1100 1010 -> 1110\r
+-- and at msd and msd-1\r
+dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 ->           0\r
+dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 ->           0\r
+dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 ->    100000000000000000000000000000000\r
+dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 ->    100000000000000000000000000000000\r
+dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 ->    100000000000000000000000000000000\r
+\r
+-- Various lengths\r
+dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110  -> 1111111111111111111111111111111111\r
+dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101  -> 1111111111111111111111111111111111\r
+dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011  -> 1111111111111111111111111111111111\r
+dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111  -> 1111111111111111111111111111111111\r
+dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111  -> 1111111111111111111111111111111111\r
+dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111  -> 1111111111111111111111111111111111\r
+dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111  -> 1111111111111111111111111111111111\r
+dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111  -> 1111111111111111111111111111111111\r
+dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111  -> 1111111111111111111111111111111111\r
+dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111  -> 1111111111111111111111111111111111\r
+dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111  -> 1111111111111111111111111111111111\r
+dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111  -> 1111111111111111111111111111111111\r
+dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111  -> 1111111111111111111111111111111111\r
+dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111  -> 1111111111111111111111111111111111\r
+dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111  -> 1111111111111111111111111111111111\r
+dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111  -> 1111111111111111111111111111111111\r
+dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111  -> 1111111111111111111111111111111111\r
+dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111  -> 1111111111111111111111111111111111\r
+dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111  -> 1111111111111111111111111111111111\r
+dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111  -> 1111111111111111111111111111111111\r
+dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111  -> 1111111111111111111111111111111111\r
+dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+\r
+dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111  -> 1111111111111111111111111111111111\r
+dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111  -> 1111111111111111111111111111111111\r
+dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111  -> 1111111111111111111111111111111111\r
+dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111  -> 1111111111111111111111111111111111\r
+dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010  -> 1010101010101010101010101010101010\r
+dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111  -> 1111111111111111111111111111111111\r
+dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111  -> 1111111111111111111111111111111111\r
+dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111  -> 1111111111111111111111111111111111\r
+dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111  -> 1111111111111111111111111111111111\r
+dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111  -> 1111111111111111111111111111111111\r
+dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111  -> 1111111111111111111111111111111111\r
+dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111  -> 1111111111111111111111111111111111\r
+dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111  -> 1111111111111111111111111111111111\r
+dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101  ->  101010101010101010101010101010101\r
+dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111  -> 1111111111111111111111111111111111\r
+dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111  -> 1111111111111111111111111111111111\r
+dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111  -> 1111111111111111111111111111111111\r
+dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111  -> 1111111111111111111111111111111111\r
+dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111  -> 1111111111111111111111111111111111\r
+dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011  -> 1111111111111111111111111111111111\r
+dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101  -> 1111111111111111111111111111111111\r
+dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110  -> 1111111111111111111111111111111111\r
+dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110  -> 1111111111111111111111111111111110\r
+dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110  -> 1111111111111111111111111111111110\r
+\r
+dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110  ->  111111111111111111111111111111111\r
+dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101  -> 1011111111111111111111111111111111\r
+dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011  -> 1101111111111111111111111111111111\r
+dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111  -> 1110111111111111111111111111111111\r
+dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111  -> 1111011111111111111111111111111111\r
+dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111  -> 1111101111111111111111111111111111\r
+dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111  -> 1111110111111111111111111111111111\r
+dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111  -> 1111111011111111111111111111111111\r
+dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111  -> 1111111101111111111111111111111111\r
+dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110  -> 1111111110111111111111111111111111\r
+dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101  -> 1111111111011111111111111111111111\r
+dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011  -> 1111111111101111111111111111111111\r
+dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111  -> 1111111111110111111111111111111111\r
+dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111  -> 1111111111111011111111111111111111\r
+dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111  -> 1111111111111101111111111111111111\r
+dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111  -> 1111111111111110111111111111111111\r
+dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111  -> 1111111111111111011111111111111111\r
+dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111  -> 1111111111111111101111111111111111\r
+dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111  -> 1111111111111111110111111111111111\r
+dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111  -> 1111111111111111111011111111111111\r
+dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111  -> 1111111111111111111101111111111111\r
+dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011  -> 1111111111111111111110111111111111\r
+dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101  -> 1111111111111111111111011111111111\r
+dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110  -> 1111111111111111111111101111111111\r
+dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111  -> 1111111111111111111111110111111111\r
+dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111  -> 1111111111111111111111111011111111\r
+dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111  -> 1111111111111111111111111101111111\r
+dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111  -> 1111111111111111111111111110111111\r
+dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111  -> 1111111111111111111111111111011111\r
+dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111  -> 1111111111111111111111111111101111\r
+dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111  -> 1111111111111111111111111111110111\r
+dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011  -> 1111111111111111111111111111111011\r
+dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101  -> 1111111111111111111111111111111101\r
+dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110  -> 1111111111111111111111111111111110\r
+\r
+\r
+\r
+--         1234567890123456     1234567890123456 1234567890123456\r
+dqor020 or 1111111111111111     1111111111111111  ->  1111111111111111\r
+dqor021 or  111111111111111      111111111111111  ->   111111111111111\r
+dqor022 or   11111111111111       11111111111111  ->    11111111111111\r
+dqor023 or    1111111111111        1111111111111  ->     1111111111111\r
+dqor024 or     111111111111         111111111111  ->      111111111111\r
+dqor025 or      11111111111          11111111111  ->       11111111111\r
+dqor026 or       1111111111           1111111111  ->        1111111111\r
+dqor027 or        111111111            111111111  ->         111111111\r
+dqor028 or         11111111             11111111  ->          11111111\r
+dqor029 or          1111111              1111111  ->           1111111\r
+dqor030 or           111111               111111  ->            111111\r
+dqor031 or            11111                11111  ->             11111\r
+dqor032 or             1111                 1111  ->              1111\r
+dqor033 or              111                  111  ->               111\r
+dqor034 or               11                   11  ->                11\r
+dqor035 or                1                    1  ->                 1\r
+dqor036 or                0                    0  ->                 0\r
+\r
+dqor042 or  111111110000000     1111111110000000  ->  1111111110000000\r
+dqor043 or   11111110000000     1000000100000000  ->  1011111110000000\r
+dqor044 or    1111110000000     1000001000000000  ->  1001111110000000\r
+dqor045 or     111110000000     1000010000000000  ->  1000111110000000\r
+dqor046 or      11110000000     1000100000000000  ->  1000111110000000\r
+dqor047 or       1110000000     1001000000000000  ->  1001001110000000\r
+dqor048 or        110000000     1010000000000000  ->  1010000110000000\r
+dqor049 or         10000000     1100000000000000  ->  1100000010000000\r
+\r
+dqor090 or 011111111  111101111  ->  111111111\r
+dqor091 or 101111111  111101111  ->  111111111\r
+dqor092 or 110111111  111101111  ->  111111111\r
+dqor093 or 111011111  111101111  ->  111111111\r
+dqor094 or 111101111  111101111  ->  111101111\r
+dqor095 or 111110111  111101111  ->  111111111\r
+dqor096 or 111111011  111101111  ->  111111111\r
+dqor097 or 111111101  111101111  ->  111111111\r
+dqor098 or 111111110  111101111  ->  111111111\r
+\r
+dqor100 or 111101111  011111111  ->  111111111\r
+dqor101 or 111101111  101111111  ->  111111111\r
+dqor102 or 111101111  110111111  ->  111111111\r
+dqor103 or 111101111  111011111  ->  111111111\r
+dqor104 or 111101111  111101111  ->  111101111\r
+dqor105 or 111101111  111110111  ->  111111111\r
+dqor106 or 111101111  111111011  ->  111111111\r
+dqor107 or 111101111  111111101  ->  111111111\r
+dqor108 or 111101111  111111110  ->  111111111\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+dqor220 or 111111112  111111111  ->  NaN Invalid_operation\r
+dqor221 or 333333333  333333333  ->  NaN Invalid_operation\r
+dqor222 or 555555555  555555555  ->  NaN Invalid_operation\r
+dqor223 or 777777777  777777777  ->  NaN Invalid_operation\r
+dqor224 or 999999999  999999999  ->  NaN Invalid_operation\r
+dqor225 or 222222222  999999999  ->  NaN Invalid_operation\r
+dqor226 or 444444444  999999999  ->  NaN Invalid_operation\r
+dqor227 or 666666666  999999999  ->  NaN Invalid_operation\r
+dqor228 or 888888888  999999999  ->  NaN Invalid_operation\r
+dqor229 or 999999999  222222222  ->  NaN Invalid_operation\r
+dqor230 or 999999999  444444444  ->  NaN Invalid_operation\r
+dqor231 or 999999999  666666666  ->  NaN Invalid_operation\r
+dqor232 or 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+dqor240 or  567468689 -934981942 ->  NaN Invalid_operation\r
+dqor241 or  567367689  934981942 ->  NaN Invalid_operation\r
+dqor242 or -631917772 -706014634 ->  NaN Invalid_operation\r
+dqor243 or -756253257  138579234 ->  NaN Invalid_operation\r
+dqor244 or  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+dqor250 or  2000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor251 or  7000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor252 or  8000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor253 or  9000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor254 or  2000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor255 or  7000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor256 or  8000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor257 or  9000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor258 or  1000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor259 or  1000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor260 or  1000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor261 or  1000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor262 or  0000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor263 or  0000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor264 or  0000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqor265 or  0000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+dqor270 or  0200000111000111000111001000000000 1000000111000111000111100000000010 ->  NaN Invalid_operation\r
+dqor271 or  0700000111000111000111000100000000 1000000111000111000111010000000100 ->  NaN Invalid_operation\r
+dqor272 or  0800000111000111000111000010000000 1000000111000111000111001000001000 ->  NaN Invalid_operation\r
+dqor273 or  0900000111000111000111000001000000 1000000111000111000111000100010000 ->  NaN Invalid_operation\r
+dqor274 or  1000000111000111000111000000100000 0200000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqor275 or  1000000111000111000111000000010000 0700000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqor276 or  1000000111000111000111000000001000 0800000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqor277 or  1000000111000111000111000000000100 0900000111000111000111000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+dqor280 or  0010000111000111000111000000000002 1000000111000111000111000100000001 ->  NaN Invalid_operation\r
+dqor281 or  0001000111000111000111000000000007 1000000111000111000111001000000011 ->  NaN Invalid_operation\r
+dqor282 or  0000000111000111000111100000000008 1000000111000111000111010000000001 ->  NaN Invalid_operation\r
+dqor283 or  0000000111000111000111010000000009 1000000111000111000111100000000001 ->  NaN Invalid_operation\r
+dqor284 or  1000000111000111000111001000000000 0001000111000111000111000000000002 ->  NaN Invalid_operation\r
+dqor285 or  1000000111000111000111000100000000 0010000111000111000111000000000007 ->  NaN Invalid_operation\r
+dqor286 or  1000000111000111000111000010000000 0100000111000111000111000000000008 ->  NaN Invalid_operation\r
+dqor287 or  1000000111000111000111000001000000 1000000111000111000111000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+dqor288 or  0010000111000111000111000020000000 1000000111000111000111001000000000 ->  NaN Invalid_operation\r
+dqor289 or  0001000111000111000111000070000001 1000000111000111000111000100000000 ->  NaN Invalid_operation\r
+dqor290 or  0000000111000111000111100080000010 1000000111000111000111000010000000 ->  NaN Invalid_operation\r
+dqor291 or  0000000111000111000111010090000100 1000000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqor292 or  1000000111000111000111001000001000 0000000111000111000111000020100000 ->  NaN Invalid_operation\r
+dqor293 or  1000000111000111000111000100010000 0000000111000111000111000070010000 ->  NaN Invalid_operation\r
+dqor294 or  1000000111000111000111000010100000 0000000111000111000111000080001000 ->  NaN Invalid_operation\r
+dqor295 or  1000000111000111000111000001000000 0000000111000111000111000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 ->  NaN Invalid_operation\r
+dqor297 or -1000000111000111000111000001000000  0000001110001110001110000010000100 ->  NaN Invalid_operation\r
+dqor298 or  1000000111000111000111000001000000 -0000001110001110001110001000000100 ->  NaN Invalid_operation\r
+dqor299 or  1000000111000111000111000001000000  0000001110001110001110000011000100 ->  1000001111001111001111000011000100\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+dqor331 or  2   9.99999999E+1999    -> NaN Invalid_operation\r
+dqor332 or  3   1E-1999             -> NaN Invalid_operation\r
+dqor333 or  4   1.00000000E-1999    -> NaN Invalid_operation\r
+dqor334 or  5   1E-1009             -> NaN Invalid_operation\r
+dqor335 or  6   -1E-1009            -> NaN Invalid_operation\r
+dqor336 or  7   -1.00000000E-1999   -> NaN Invalid_operation\r
+dqor337 or  8   -1E-1999            -> NaN Invalid_operation\r
+dqor338 or  9   -9.99999999E+1999   -> NaN Invalid_operation\r
+dqor341 or  9.99999999E+2999    -18 -> NaN Invalid_operation\r
+dqor342 or  1E-2999              01 -> NaN Invalid_operation\r
+dqor343 or  1.00000000E-2999    -18 -> NaN Invalid_operation\r
+dqor344 or  1E-1009              18 -> NaN Invalid_operation\r
+dqor345 or  -1E-1009            -10 -> NaN Invalid_operation\r
+dqor346 or  -1.00000000E-2999    18 -> NaN Invalid_operation\r
+dqor347 or  -1E-2999             10 -> NaN Invalid_operation\r
+dqor348 or  -9.99999999E+2999   -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+dqor361 or  1.0                  1  -> NaN Invalid_operation\r
+dqor362 or  1E+1                 1  -> NaN Invalid_operation\r
+dqor363 or  0.0                  1  -> NaN Invalid_operation\r
+dqor364 or  0E+1                 1  -> NaN Invalid_operation\r
+dqor365 or  9.9                  1  -> NaN Invalid_operation\r
+dqor366 or  9E+1                 1  -> NaN Invalid_operation\r
+dqor371 or  0 1.0                   -> NaN Invalid_operation\r
+dqor372 or  0 1E+1                  -> NaN Invalid_operation\r
+dqor373 or  0 0.0                   -> NaN Invalid_operation\r
+dqor374 or  0 0E+1                  -> NaN Invalid_operation\r
+dqor375 or  0 9.9                   -> NaN Invalid_operation\r
+dqor376 or  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+dqor780 or -Inf  -Inf   -> NaN Invalid_operation\r
+dqor781 or -Inf  -1000  -> NaN Invalid_operation\r
+dqor782 or -Inf  -1     -> NaN Invalid_operation\r
+dqor783 or -Inf  -0     -> NaN Invalid_operation\r
+dqor784 or -Inf   0     -> NaN Invalid_operation\r
+dqor785 or -Inf   1     -> NaN Invalid_operation\r
+dqor786 or -Inf   1000  -> NaN Invalid_operation\r
+dqor787 or -1000 -Inf   -> NaN Invalid_operation\r
+dqor788 or -Inf  -Inf   -> NaN Invalid_operation\r
+dqor789 or -1    -Inf   -> NaN Invalid_operation\r
+dqor790 or -0    -Inf   -> NaN Invalid_operation\r
+dqor791 or  0    -Inf   -> NaN Invalid_operation\r
+dqor792 or  1    -Inf   -> NaN Invalid_operation\r
+dqor793 or  1000 -Inf   -> NaN Invalid_operation\r
+dqor794 or  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+dqor800 or  Inf  -Inf   -> NaN Invalid_operation\r
+dqor801 or  Inf  -1000  -> NaN Invalid_operation\r
+dqor802 or  Inf  -1     -> NaN Invalid_operation\r
+dqor803 or  Inf  -0     -> NaN Invalid_operation\r
+dqor804 or  Inf   0     -> NaN Invalid_operation\r
+dqor805 or  Inf   1     -> NaN Invalid_operation\r
+dqor806 or  Inf   1000  -> NaN Invalid_operation\r
+dqor807 or  Inf   Inf   -> NaN Invalid_operation\r
+dqor808 or -1000  Inf   -> NaN Invalid_operation\r
+dqor809 or -Inf   Inf   -> NaN Invalid_operation\r
+dqor810 or -1     Inf   -> NaN Invalid_operation\r
+dqor811 or -0     Inf   -> NaN Invalid_operation\r
+dqor812 or  0     Inf   -> NaN Invalid_operation\r
+dqor813 or  1     Inf   -> NaN Invalid_operation\r
+dqor814 or  1000  Inf   -> NaN Invalid_operation\r
+dqor815 or  Inf   Inf   -> NaN Invalid_operation\r
+\r
+dqor821 or  NaN -Inf    -> NaN Invalid_operation\r
+dqor822 or  NaN -1000   -> NaN Invalid_operation\r
+dqor823 or  NaN -1      -> NaN Invalid_operation\r
+dqor824 or  NaN -0      -> NaN Invalid_operation\r
+dqor825 or  NaN  0      -> NaN Invalid_operation\r
+dqor826 or  NaN  1      -> NaN Invalid_operation\r
+dqor827 or  NaN  1000   -> NaN Invalid_operation\r
+dqor828 or  NaN  Inf    -> NaN Invalid_operation\r
+dqor829 or  NaN  NaN    -> NaN Invalid_operation\r
+dqor830 or -Inf  NaN    -> NaN Invalid_operation\r
+dqor831 or -1000 NaN    -> NaN Invalid_operation\r
+dqor832 or -1    NaN    -> NaN Invalid_operation\r
+dqor833 or -0    NaN    -> NaN Invalid_operation\r
+dqor834 or  0    NaN    -> NaN Invalid_operation\r
+dqor835 or  1    NaN    -> NaN Invalid_operation\r
+dqor836 or  1000 NaN    -> NaN Invalid_operation\r
+dqor837 or  Inf  NaN    -> NaN Invalid_operation\r
+\r
+dqor841 or  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqor842 or  sNaN -1000  ->  NaN  Invalid_operation\r
+dqor843 or  sNaN -1     ->  NaN  Invalid_operation\r
+dqor844 or  sNaN -0     ->  NaN  Invalid_operation\r
+dqor845 or  sNaN  0     ->  NaN  Invalid_operation\r
+dqor846 or  sNaN  1     ->  NaN  Invalid_operation\r
+dqor847 or  sNaN  1000  ->  NaN  Invalid_operation\r
+dqor848 or  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqor849 or  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqor850 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqor851 or -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqor852 or -1000 sNaN   ->  NaN  Invalid_operation\r
+dqor853 or -1    sNaN   ->  NaN  Invalid_operation\r
+dqor854 or -0    sNaN   ->  NaN  Invalid_operation\r
+dqor855 or  0    sNaN   ->  NaN  Invalid_operation\r
+dqor856 or  1    sNaN   ->  NaN  Invalid_operation\r
+dqor857 or  1000 sNaN   ->  NaN  Invalid_operation\r
+dqor858 or  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqor859 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqor861 or  NaN1   -Inf    -> NaN Invalid_operation\r
+dqor862 or +NaN2   -1000   -> NaN Invalid_operation\r
+dqor863 or  NaN3    1000   -> NaN Invalid_operation\r
+dqor864 or  NaN4    Inf    -> NaN Invalid_operation\r
+dqor865 or  NaN5   +NaN6   -> NaN Invalid_operation\r
+dqor866 or -Inf     NaN7   -> NaN Invalid_operation\r
+dqor867 or -1000    NaN8   -> NaN Invalid_operation\r
+dqor868 or  1000    NaN9   -> NaN Invalid_operation\r
+dqor869 or  Inf    +NaN10  -> NaN Invalid_operation\r
+dqor871 or  sNaN11  -Inf   -> NaN Invalid_operation\r
+dqor872 or  sNaN12  -1000  -> NaN Invalid_operation\r
+dqor873 or  sNaN13   1000  -> NaN Invalid_operation\r
+dqor874 or  sNaN14   NaN17 -> NaN Invalid_operation\r
+dqor875 or  sNaN15  sNaN18 -> NaN Invalid_operation\r
+dqor876 or  NaN16   sNaN19 -> NaN Invalid_operation\r
+dqor877 or -Inf    +sNaN20 -> NaN Invalid_operation\r
+dqor878 or -1000    sNaN21 -> NaN Invalid_operation\r
+dqor879 or  1000    sNaN22 -> NaN Invalid_operation\r
+dqor880 or  Inf     sNaN23 -> NaN Invalid_operation\r
+dqor881 or +NaN25  +sNaN24 -> NaN Invalid_operation\r
+dqor882 or -NaN26    NaN28 -> NaN Invalid_operation\r
+dqor883 or -sNaN27  sNaN29 -> NaN Invalid_operation\r
+dqor884 or  1000    -NaN30 -> NaN Invalid_operation\r
+dqor885 or  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqPlus.decTest b/Lib/test/decimaltestdata/dqPlus.decTest
new file mode 100644 (file)
index 0000000..5dc5a68
--- /dev/null
@@ -0,0 +1,88 @@
+------------------------------------------------------------------------\r
+-- dqPlus.decTest -- decQuad 0+x                                      --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqpls001 plus       +7.50  -> 7.50\r
+\r
+-- Infinities\r
+dqpls011 plus  Infinity    -> Infinity\r
+dqpls012 plus  -Infinity   -> -Infinity\r
+\r
+-- NaNs, 0 payload\r
+ddqls021 plus         NaN  -> NaN\r
+ddqls022 plus        -NaN  -> -NaN\r
+ddqls023 plus        sNaN  -> NaN  Invalid_operation\r
+ddqls024 plus       -sNaN  -> -NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+ddqls031 plus       NaN13  -> NaN13\r
+ddqls032 plus      -NaN13  -> -NaN13\r
+ddqls033 plus      sNaN13  -> NaN13   Invalid_operation\r
+ddqls034 plus     -sNaN13  -> -NaN13  Invalid_operation\r
+ddqls035 plus       NaN70  -> NaN70\r
+ddqls036 plus      -NaN70  -> -NaN70\r
+ddqls037 plus      sNaN101 -> NaN101  Invalid_operation\r
+ddqls038 plus     -sNaN101 -> -NaN101 Invalid_operation\r
+\r
+-- finites\r
+dqpls101 plus          7   -> 7\r
+dqpls102 plus         -7   -> -7\r
+dqpls103 plus         75   -> 75\r
+dqpls104 plus        -75   -> -75\r
+dqpls105 plus       7.50   -> 7.50\r
+dqpls106 plus      -7.50   -> -7.50\r
+dqpls107 plus       7.500  -> 7.500\r
+dqpls108 plus      -7.500  -> -7.500\r
+\r
+-- zeros\r
+dqpls111 plus          0   -> 0\r
+dqpls112 plus         -0   -> 0\r
+dqpls113 plus       0E+4   -> 0E+4\r
+dqpls114 plus      -0E+4   -> 0E+4\r
+dqpls115 plus     0.0000   -> 0.0000\r
+dqpls116 plus    -0.0000   -> 0.0000\r
+dqpls117 plus      0E-141  -> 0E-141\r
+dqpls118 plus     -0E-141  -> 0E-141\r
+\r
+-- full coefficients, alternating bits\r
+dqpls121 plus   2682682682682682682682682682682682    ->  2682682682682682682682682682682682\r
+dqpls122 plus  -2682682682682682682682682682682682    -> -2682682682682682682682682682682682\r
+dqpls123 plus   1341341341341341341341341341341341    ->  1341341341341341341341341341341341\r
+dqpls124 plus  -1341341341341341341341341341341341    -> -1341341341341341341341341341341341\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqpls131 plus  9.999999999999999999999999999999999E+6144   ->  9.999999999999999999999999999999999E+6144\r
+dqpls132 plus  1E-6143                                     ->  1E-6143\r
+dqpls133 plus  1.000000000000000000000000000000000E-6143   ->  1.000000000000000000000000000000000E-6143\r
+dqpls134 plus  1E-6176                                     ->  1E-6176 Subnormal\r
+\r
+dqpls135 plus  -1E-6176                                    -> -1E-6176 Subnormal\r
+dqpls136 plus  -1.000000000000000000000000000000000E-6143  -> -1.000000000000000000000000000000000E-6143\r
+dqpls137 plus  -1E-6143                                    -> -1E-6143\r
+dqpls138 plus  -9.999999999999999999999999999999999E+6144  -> -9.999999999999999999999999999999999E+6144\r
diff --git a/Lib/test/decimaltestdata/dqQuantize.decTest b/Lib/test/decimaltestdata/dqQuantize.decTest
new file mode 100644 (file)
index 0000000..aa8cf2e
--- /dev/null
@@ -0,0 +1,823 @@
+------------------------------------------------------------------------\r
+-- dqQuantize.decTest -- decQuad quantize operation                   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Most of the tests here assume a "regular pattern", where the\r
+-- sign and coefficient are +1.\r
+-- 2004.03.15 Underflow for quantize is suppressed\r
+-- 2005.06.08 More extensive tests for 'does not fit'\r
+-- [Forked from quantize.decTest 2006.11.25]\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks\r
+dqqua001 quantize 0       1e0   -> 0\r
+dqqua002 quantize 1       1e0   -> 1\r
+dqqua003 quantize 0.1    1e+2   -> 0E+2 Inexact Rounded\r
+dqqua005 quantize 0.1    1e+1   -> 0E+1 Inexact Rounded\r
+dqqua006 quantize 0.1     1e0   -> 0 Inexact Rounded\r
+dqqua007 quantize 0.1    1e-1   -> 0.1\r
+dqqua008 quantize 0.1    1e-2   -> 0.10\r
+dqqua009 quantize 0.1    1e-3   -> 0.100\r
+dqqua010 quantize 0.9    1e+2   -> 0E+2 Inexact Rounded\r
+dqqua011 quantize 0.9    1e+1   -> 0E+1 Inexact Rounded\r
+dqqua012 quantize 0.9    1e+0   -> 1 Inexact Rounded\r
+dqqua013 quantize 0.9    1e-1   -> 0.9\r
+dqqua014 quantize 0.9    1e-2   -> 0.90\r
+dqqua015 quantize 0.9    1e-3   -> 0.900\r
+-- negatives\r
+dqqua021 quantize -0      1e0   -> -0\r
+dqqua022 quantize -1      1e0   -> -1\r
+dqqua023 quantize -0.1   1e+2   -> -0E+2 Inexact Rounded\r
+dqqua025 quantize -0.1   1e+1   -> -0E+1 Inexact Rounded\r
+dqqua026 quantize -0.1    1e0   -> -0 Inexact Rounded\r
+dqqua027 quantize -0.1   1e-1   -> -0.1\r
+dqqua028 quantize -0.1   1e-2   -> -0.10\r
+dqqua029 quantize -0.1   1e-3   -> -0.100\r
+dqqua030 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded\r
+dqqua031 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded\r
+dqqua032 quantize -0.9   1e+0   -> -1 Inexact Rounded\r
+dqqua033 quantize -0.9   1e-1   -> -0.9\r
+dqqua034 quantize -0.9   1e-2   -> -0.90\r
+dqqua035 quantize -0.9   1e-3   -> -0.900\r
+dqqua036 quantize -0.5   1e+2   -> -0E+2 Inexact Rounded\r
+dqqua037 quantize -0.5   1e+1   -> -0E+1 Inexact Rounded\r
+dqqua038 quantize -0.5   1e+0   -> -0 Inexact Rounded\r
+dqqua039 quantize -0.5   1e-1   -> -0.5\r
+dqqua040 quantize -0.5   1e-2   -> -0.50\r
+dqqua041 quantize -0.5   1e-3   -> -0.500\r
+dqqua042 quantize -0.9   1e+2   -> -0E+2 Inexact Rounded\r
+dqqua043 quantize -0.9   1e+1   -> -0E+1 Inexact Rounded\r
+dqqua044 quantize -0.9   1e+0   -> -1 Inexact Rounded\r
+dqqua045 quantize -0.9   1e-1   -> -0.9\r
+dqqua046 quantize -0.9   1e-2   -> -0.90\r
+dqqua047 quantize -0.9   1e-3   -> -0.900\r
+\r
+-- examples from Specification\r
+dqqua060 quantize 2.17   0.001  -> 2.170\r
+dqqua061 quantize 2.17   0.01   -> 2.17\r
+dqqua062 quantize 2.17   0.1    -> 2.2 Inexact Rounded\r
+dqqua063 quantize 2.17   1e+0   -> 2 Inexact Rounded\r
+dqqua064 quantize 2.17   1e+1   -> 0E+1 Inexact Rounded\r
+dqqua065 quantize -Inf    Inf   -> -Infinity\r
+dqqua066 quantize 2       Inf   -> NaN Invalid_operation\r
+dqqua067 quantize -0.1    1     -> -0 Inexact Rounded\r
+dqqua068 quantize -0      1e+5     -> -0E+5\r
+dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation\r
+dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation\r
+dqqua071 quantize 217    1e-1   -> 217.0\r
+dqqua072 quantize 217    1e+0   -> 217\r
+dqqua073 quantize 217    1e+1   -> 2.2E+2 Inexact Rounded\r
+dqqua074 quantize 217    1e+2   -> 2E+2 Inexact Rounded\r
+\r
+-- general tests ..\r
+dqqua089 quantize 12     1e+4   -> 0E+4 Inexact Rounded\r
+dqqua090 quantize 12     1e+3   -> 0E+3 Inexact Rounded\r
+dqqua091 quantize 12     1e+2   -> 0E+2 Inexact Rounded\r
+dqqua092 quantize 12     1e+1   -> 1E+1 Inexact Rounded\r
+dqqua093 quantize 1.2345 1e-2   -> 1.23 Inexact Rounded\r
+dqqua094 quantize 1.2355 1e-2   -> 1.24 Inexact Rounded\r
+dqqua095 quantize 1.2345 1e-6   -> 1.234500\r
+dqqua096 quantize 9.9999 1e-2   -> 10.00 Inexact Rounded\r
+dqqua097 quantize 0.0001 1e-2   -> 0.00 Inexact Rounded\r
+dqqua098 quantize 0.001  1e-2   -> 0.00 Inexact Rounded\r
+dqqua099 quantize 0.009  1e-2   -> 0.01 Inexact Rounded\r
+dqqua100 quantize 92     1e+2   -> 1E+2 Inexact Rounded\r
+\r
+dqqua101 quantize -1      1e0   ->  -1\r
+dqqua102 quantize -1     1e-1   ->  -1.0\r
+dqqua103 quantize -1     1e-2   ->  -1.00\r
+dqqua104 quantize  0      1e0   ->  0\r
+dqqua105 quantize  0     1e-1   ->  0.0\r
+dqqua106 quantize  0     1e-2   ->  0.00\r
+dqqua107 quantize  0.00   1e0   ->  0\r
+dqqua108 quantize  0     1e+1   ->  0E+1\r
+dqqua109 quantize  0     1e+2   ->  0E+2\r
+dqqua110 quantize +1      1e0   ->  1\r
+dqqua111 quantize +1     1e-1   ->  1.0\r
+dqqua112 quantize +1     1e-2   ->  1.00\r
+\r
+dqqua120 quantize   1.04  1e-3 ->  1.040\r
+dqqua121 quantize   1.04  1e-2 ->  1.04\r
+dqqua122 quantize   1.04  1e-1 ->  1.0 Inexact Rounded\r
+dqqua123 quantize   1.04   1e0 ->  1 Inexact Rounded\r
+dqqua124 quantize   1.05  1e-3 ->  1.050\r
+dqqua125 quantize   1.05  1e-2 ->  1.05\r
+dqqua126 quantize   1.05  1e-1 ->  1.0 Inexact Rounded\r
+dqqua131 quantize   1.05   1e0 ->  1 Inexact Rounded\r
+dqqua132 quantize   1.06  1e-3 ->  1.060\r
+dqqua133 quantize   1.06  1e-2 ->  1.06\r
+dqqua134 quantize   1.06  1e-1 ->  1.1 Inexact Rounded\r
+dqqua135 quantize   1.06   1e0 ->  1 Inexact Rounded\r
+\r
+dqqua140 quantize   -10    1e-2  ->  -10.00\r
+dqqua141 quantize   +1     1e-2  ->  1.00\r
+dqqua142 quantize   +10    1e-2  ->  10.00\r
+dqqua143 quantize   1E+37  1e-2  ->  NaN Invalid_operation\r
+dqqua144 quantize   1E-37  1e-2  ->  0.00 Inexact Rounded\r
+dqqua145 quantize   1E-3   1e-2  ->  0.00 Inexact Rounded\r
+dqqua146 quantize   1E-2   1e-2  ->  0.01\r
+dqqua147 quantize   1E-1   1e-2  ->  0.10\r
+dqqua148 quantize   0E-37  1e-2  ->  0.00\r
+\r
+dqqua150 quantize   1.0600 1e-5 ->  1.06000\r
+dqqua151 quantize   1.0600 1e-4 ->  1.0600\r
+dqqua152 quantize   1.0600 1e-3 ->  1.060 Rounded\r
+dqqua153 quantize   1.0600 1e-2 ->  1.06 Rounded\r
+dqqua154 quantize   1.0600 1e-1 ->  1.1 Inexact Rounded\r
+dqqua155 quantize   1.0600  1e0 ->  1 Inexact Rounded\r
+\r
+-- a couple where rounding was different in base tests\r
+rounding:    half_up\r
+dqqua157 quantize -0.5   1e+0   -> -1 Inexact Rounded\r
+dqqua158 quantize   1.05  1e-1 ->  1.1 Inexact Rounded\r
+dqqua159 quantize   1.06   1e0 ->  1 Inexact Rounded\r
+rounding:    half_even\r
+\r
+-- base tests with non-1 coefficients\r
+dqqua161 quantize 0      -9e0   -> 0\r
+dqqua162 quantize 1      -7e0   -> 1\r
+dqqua163 quantize 0.1   -1e+2   -> 0E+2 Inexact Rounded\r
+dqqua165 quantize 0.1    0e+1   -> 0E+1 Inexact Rounded\r
+dqqua166 quantize 0.1     2e0   -> 0 Inexact Rounded\r
+dqqua167 quantize 0.1    3e-1   -> 0.1\r
+dqqua168 quantize 0.1   44e-2   -> 0.10\r
+dqqua169 quantize 0.1  555e-3   -> 0.100\r
+dqqua170 quantize 0.9 6666e+2   -> 0E+2 Inexact Rounded\r
+dqqua171 quantize 0.9 -777e+1   -> 0E+1 Inexact Rounded\r
+dqqua172 quantize 0.9  -88e+0   -> 1 Inexact Rounded\r
+dqqua173 quantize 0.9   -9e-1   -> 0.9\r
+dqqua174 quantize 0.9    0e-2   -> 0.90\r
+dqqua175 quantize 0.9  1.1e-3   -> 0.9000\r
+-- negatives\r
+dqqua181 quantize -0    1.1e0   -> -0.0\r
+dqqua182 quantize -1     -1e0   -> -1\r
+dqqua183 quantize -0.1  11e+2   -> -0E+2 Inexact Rounded\r
+dqqua185 quantize -0.1 111e+1   -> -0E+1 Inexact Rounded\r
+dqqua186 quantize -0.1   71e0   -> -0 Inexact Rounded\r
+dqqua187 quantize -0.1 -91e-1   -> -0.1\r
+dqqua188 quantize -0.1 -.1e-2   -> -0.100\r
+dqqua189 quantize -0.1  -1e-3   -> -0.100\r
+dqqua190 quantize -0.9   0e+2   -> -0E+2 Inexact Rounded\r
+dqqua191 quantize -0.9  -0e+1   -> -0E+1 Inexact Rounded\r
+dqqua192 quantize -0.9 -10e+0   -> -1 Inexact Rounded\r
+dqqua193 quantize -0.9 100e-1   -> -0.9\r
+dqqua194 quantize -0.9 999e-2   -> -0.90\r
+\r
+-- +ve exponents ..\r
+dqqua201 quantize   -1   1e+0 ->  -1\r
+dqqua202 quantize   -1   1e+1 ->  -0E+1 Inexact Rounded\r
+dqqua203 quantize   -1   1e+2 ->  -0E+2 Inexact Rounded\r
+dqqua204 quantize    0   1e+0 ->  0\r
+dqqua205 quantize    0   1e+1 ->  0E+1\r
+dqqua206 quantize    0   1e+2 ->  0E+2\r
+dqqua207 quantize   +1   1e+0 ->  1\r
+dqqua208 quantize   +1   1e+1 ->  0E+1 Inexact Rounded\r
+dqqua209 quantize   +1   1e+2 ->  0E+2 Inexact Rounded\r
+\r
+dqqua220 quantize   1.04 1e+3 ->  0E+3 Inexact Rounded\r
+dqqua221 quantize   1.04 1e+2 ->  0E+2 Inexact Rounded\r
+dqqua222 quantize   1.04 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua223 quantize   1.04 1e+0 ->  1 Inexact Rounded\r
+dqqua224 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded\r
+dqqua225 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded\r
+dqqua226 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua227 quantize   1.05 1e+0 ->  1 Inexact Rounded\r
+dqqua228 quantize   1.05 1e+3 ->  0E+3 Inexact Rounded\r
+dqqua229 quantize   1.05 1e+2 ->  0E+2 Inexact Rounded\r
+dqqua230 quantize   1.05 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua231 quantize   1.05 1e+0 ->  1 Inexact Rounded\r
+dqqua232 quantize   1.06 1e+3 ->  0E+3 Inexact Rounded\r
+dqqua233 quantize   1.06 1e+2 ->  0E+2 Inexact Rounded\r
+dqqua234 quantize   1.06 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua235 quantize   1.06 1e+0 ->  1 Inexact Rounded\r
+\r
+dqqua240 quantize   -10   1e+1  ->  -1E+1 Rounded\r
+dqqua241 quantize   +1    1e+1  ->  0E+1 Inexact Rounded\r
+dqqua242 quantize   +10   1e+1  ->  1E+1 Rounded\r
+dqqua243 quantize   1E+1  1e+1  ->  1E+1          -- underneath this is E+1\r
+dqqua244 quantize   1E+2  1e+1  ->  1.0E+2        -- underneath this is E+1\r
+dqqua245 quantize   1E+3  1e+1  ->  1.00E+3       -- underneath this is E+1\r
+dqqua246 quantize   1E+4  1e+1  ->  1.000E+4      -- underneath this is E+1\r
+dqqua247 quantize   1E+5  1e+1  ->  1.0000E+5     -- underneath this is E+1\r
+dqqua248 quantize   1E+6  1e+1  ->  1.00000E+6    -- underneath this is E+1\r
+dqqua249 quantize   1E+7  1e+1  ->  1.000000E+7   -- underneath this is E+1\r
+dqqua250 quantize   1E+8  1e+1  ->  1.0000000E+8  -- underneath this is E+1\r
+dqqua251 quantize   1E+9  1e+1  ->  1.00000000E+9 -- underneath this is E+1\r
+-- next one tries to add 9 zeros\r
+dqqua252 quantize   1E+37 1e+1  ->  NaN Invalid_operation\r
+dqqua253 quantize   1E-37 1e+1  ->  0E+1 Inexact Rounded\r
+dqqua254 quantize   1E-2  1e+1  ->  0E+1 Inexact Rounded\r
+dqqua255 quantize   0E-37 1e+1  ->  0E+1\r
+dqqua256 quantize  -0E-37 1e+1  -> -0E+1\r
+dqqua257 quantize  -0E-1  1e+1  -> -0E+1\r
+dqqua258 quantize  -0     1e+1  -> -0E+1\r
+dqqua259 quantize  -0E+1  1e+1  -> -0E+1\r
+\r
+dqqua260 quantize   -10   1e+2  ->  -0E+2 Inexact Rounded\r
+dqqua261 quantize   +1    1e+2  ->  0E+2 Inexact Rounded\r
+dqqua262 quantize   +10   1e+2  ->  0E+2 Inexact Rounded\r
+dqqua263 quantize   1E+1  1e+2  ->  0E+2 Inexact Rounded\r
+dqqua264 quantize   1E+2  1e+2  ->  1E+2\r
+dqqua265 quantize   1E+3  1e+2  ->  1.0E+3\r
+dqqua266 quantize   1E+4  1e+2  ->  1.00E+4\r
+dqqua267 quantize   1E+5  1e+2  ->  1.000E+5\r
+dqqua268 quantize   1E+6  1e+2  ->  1.0000E+6\r
+dqqua269 quantize   1E+7  1e+2  ->  1.00000E+7\r
+dqqua270 quantize   1E+8  1e+2  ->  1.000000E+8\r
+dqqua271 quantize   1E+9  1e+2  ->  1.0000000E+9\r
+dqqua272 quantize   1E+10 1e+2  ->  1.00000000E+10\r
+dqqua273 quantize   1E-10 1e+2  ->  0E+2 Inexact Rounded\r
+dqqua274 quantize   1E-2  1e+2  ->  0E+2 Inexact Rounded\r
+dqqua275 quantize   0E-10 1e+2  ->  0E+2\r
+\r
+dqqua280 quantize   -10   1e+3  ->  -0E+3 Inexact Rounded\r
+dqqua281 quantize   +1    1e+3  ->  0E+3 Inexact Rounded\r
+dqqua282 quantize   +10   1e+3  ->  0E+3 Inexact Rounded\r
+dqqua283 quantize   1E+1  1e+3  ->  0E+3 Inexact Rounded\r
+dqqua284 quantize   1E+2  1e+3  ->  0E+3 Inexact Rounded\r
+dqqua285 quantize   1E+3  1e+3  ->  1E+3\r
+dqqua286 quantize   1E+4  1e+3  ->  1.0E+4\r
+dqqua287 quantize   1E+5  1e+3  ->  1.00E+5\r
+dqqua288 quantize   1E+6  1e+3  ->  1.000E+6\r
+dqqua289 quantize   1E+7  1e+3  ->  1.0000E+7\r
+dqqua290 quantize   1E+8  1e+3  ->  1.00000E+8\r
+dqqua291 quantize   1E+9  1e+3  ->  1.000000E+9\r
+dqqua292 quantize   1E+10 1e+3  ->  1.0000000E+10\r
+dqqua293 quantize   1E-10 1e+3  ->  0E+3 Inexact Rounded\r
+dqqua294 quantize   1E-2  1e+3  ->  0E+3 Inexact Rounded\r
+dqqua295 quantize   0E-10 1e+3  ->  0E+3\r
+\r
+-- round up from below [sign wrong in JIT compiler once]\r
+dqqua300 quantize   0.0078 1e-5 ->  0.00780\r
+dqqua301 quantize   0.0078 1e-4 ->  0.0078\r
+dqqua302 quantize   0.0078 1e-3 ->  0.008 Inexact Rounded\r
+dqqua303 quantize   0.0078 1e-2 ->  0.01 Inexact Rounded\r
+dqqua304 quantize   0.0078 1e-1 ->  0.0 Inexact Rounded\r
+dqqua305 quantize   0.0078  1e0 ->  0 Inexact Rounded\r
+dqqua306 quantize   0.0078 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua307 quantize   0.0078 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+dqqua310 quantize  -0.0078 1e-5 -> -0.00780\r
+dqqua311 quantize  -0.0078 1e-4 -> -0.0078\r
+dqqua312 quantize  -0.0078 1e-3 -> -0.008 Inexact Rounded\r
+dqqua313 quantize  -0.0078 1e-2 -> -0.01 Inexact Rounded\r
+dqqua314 quantize  -0.0078 1e-1 -> -0.0 Inexact Rounded\r
+dqqua315 quantize  -0.0078  1e0 -> -0 Inexact Rounded\r
+dqqua316 quantize  -0.0078 1e+1 -> -0E+1 Inexact Rounded\r
+dqqua317 quantize  -0.0078 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+dqqua320 quantize   0.078 1e-5 ->  0.07800\r
+dqqua321 quantize   0.078 1e-4 ->  0.0780\r
+dqqua322 quantize   0.078 1e-3 ->  0.078\r
+dqqua323 quantize   0.078 1e-2 ->  0.08 Inexact Rounded\r
+dqqua324 quantize   0.078 1e-1 ->  0.1 Inexact Rounded\r
+dqqua325 quantize   0.078  1e0 ->  0 Inexact Rounded\r
+dqqua326 quantize   0.078 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua327 quantize   0.078 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+dqqua330 quantize  -0.078 1e-5 -> -0.07800\r
+dqqua331 quantize  -0.078 1e-4 -> -0.0780\r
+dqqua332 quantize  -0.078 1e-3 -> -0.078\r
+dqqua333 quantize  -0.078 1e-2 -> -0.08 Inexact Rounded\r
+dqqua334 quantize  -0.078 1e-1 -> -0.1 Inexact Rounded\r
+dqqua335 quantize  -0.078  1e0 -> -0 Inexact Rounded\r
+dqqua336 quantize  -0.078 1e+1 -> -0E+1 Inexact Rounded\r
+dqqua337 quantize  -0.078 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+dqqua340 quantize   0.78 1e-5 ->  0.78000\r
+dqqua341 quantize   0.78 1e-4 ->  0.7800\r
+dqqua342 quantize   0.78 1e-3 ->  0.780\r
+dqqua343 quantize   0.78 1e-2 ->  0.78\r
+dqqua344 quantize   0.78 1e-1 ->  0.8 Inexact Rounded\r
+dqqua345 quantize   0.78  1e0 ->  1 Inexact Rounded\r
+dqqua346 quantize   0.78 1e+1 ->  0E+1 Inexact Rounded\r
+dqqua347 quantize   0.78 1e+2 ->  0E+2 Inexact Rounded\r
+\r
+dqqua350 quantize  -0.78 1e-5 -> -0.78000\r
+dqqua351 quantize  -0.78 1e-4 -> -0.7800\r
+dqqua352 quantize  -0.78 1e-3 -> -0.780\r
+dqqua353 quantize  -0.78 1e-2 -> -0.78\r
+dqqua354 quantize  -0.78 1e-1 -> -0.8 Inexact Rounded\r
+dqqua355 quantize  -0.78  1e0 -> -1 Inexact Rounded\r
+dqqua356 quantize  -0.78 1e+1 -> -0E+1 Inexact Rounded\r
+dqqua357 quantize  -0.78 1e+2 -> -0E+2 Inexact Rounded\r
+\r
+dqqua360 quantize   7.8 1e-5 ->  7.80000\r
+dqqua361 quantize   7.8 1e-4 ->  7.8000\r
+dqqua362 quantize   7.8 1e-3 ->  7.800\r
+dqqua363 quantize   7.8 1e-2 ->  7.80\r
+dqqua364 quantize   7.8 1e-1 ->  7.8\r
+dqqua365 quantize   7.8  1e0 ->  8 Inexact Rounded\r
+dqqua366 quantize   7.8 1e+1 ->  1E+1 Inexact Rounded\r
+dqqua367 quantize   7.8 1e+2 ->  0E+2 Inexact Rounded\r
+dqqua368 quantize   7.8 1e+3 ->  0E+3 Inexact Rounded\r
+\r
+dqqua370 quantize  -7.8 1e-5 -> -7.80000\r
+dqqua371 quantize  -7.8 1e-4 -> -7.8000\r
+dqqua372 quantize  -7.8 1e-3 -> -7.800\r
+dqqua373 quantize  -7.8 1e-2 -> -7.80\r
+dqqua374 quantize  -7.8 1e-1 -> -7.8\r
+dqqua375 quantize  -7.8  1e0 -> -8 Inexact Rounded\r
+dqqua376 quantize  -7.8 1e+1 -> -1E+1 Inexact Rounded\r
+dqqua377 quantize  -7.8 1e+2 -> -0E+2 Inexact Rounded\r
+dqqua378 quantize  -7.8 1e+3 -> -0E+3 Inexact Rounded\r
+\r
+-- some individuals\r
+dqqua380 quantize   1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded\r
+dqqua381 quantize   11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06\r
+dqqua382 quantize   112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation\r
+dqqua383 quantize   1122334455667788991234567352364506  1e-2 -> NaN Invalid_operation\r
+dqqua384 quantize  -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded\r
+dqqua385 quantize  -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06\r
+dqqua386 quantize  -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation\r
+dqqua387 quantize  -1122334455667788991234567352364506  1e-2 -> NaN Invalid_operation\r
+\r
+rounding: down\r
+dqqua389 quantize   112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation\r
+-- ? should that one instead have been:\r
+-- dqqua389 quantize   112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation\r
+rounding: half_up\r
+\r
+-- and a few more from e-mail discussions\r
+dqqua391 quantize  11223344556677889912345678912.34567  1e-3 -> 11223344556677889912345678912.346   Inexact Rounded\r
+dqqua392 quantize  112233445566778899123456789123.4567  1e-3 -> 112233445566778899123456789123.457  Inexact Rounded\r
+dqqua393 quantize  1122334455667788991234567891234567.  1e-3 -> NaN Invalid_operation\r
+\r
+-- some 9999 round-up cases\r
+dqqua400 quantize   9.999        1e-5  ->  9.99900\r
+dqqua401 quantize   9.999        1e-4  ->  9.9990\r
+dqqua402 quantize   9.999        1e-3  ->  9.999\r
+dqqua403 quantize   9.999        1e-2  -> 10.00     Inexact Rounded\r
+dqqua404 quantize   9.999        1e-1  -> 10.0      Inexact Rounded\r
+dqqua405 quantize   9.999         1e0  -> 10        Inexact Rounded\r
+dqqua406 quantize   9.999         1e1  -> 1E+1      Inexact Rounded\r
+dqqua407 quantize   9.999         1e2  -> 0E+2      Inexact Rounded\r
+\r
+dqqua410 quantize   0.999        1e-5  ->  0.99900\r
+dqqua411 quantize   0.999        1e-4  ->  0.9990\r
+dqqua412 quantize   0.999        1e-3  ->  0.999\r
+dqqua413 quantize   0.999        1e-2  ->  1.00     Inexact Rounded\r
+dqqua414 quantize   0.999        1e-1  ->  1.0      Inexact Rounded\r
+dqqua415 quantize   0.999         1e0  ->  1        Inexact Rounded\r
+dqqua416 quantize   0.999         1e1  -> 0E+1      Inexact Rounded\r
+\r
+dqqua420 quantize   0.0999       1e-5  ->  0.09990\r
+dqqua421 quantize   0.0999       1e-4  ->  0.0999\r
+dqqua422 quantize   0.0999       1e-3  ->  0.100    Inexact Rounded\r
+dqqua423 quantize   0.0999       1e-2  ->  0.10     Inexact Rounded\r
+dqqua424 quantize   0.0999       1e-1  ->  0.1      Inexact Rounded\r
+dqqua425 quantize   0.0999        1e0  ->  0        Inexact Rounded\r
+dqqua426 quantize   0.0999        1e1  -> 0E+1      Inexact Rounded\r
+\r
+dqqua430 quantize   0.00999      1e-5  ->  0.00999\r
+dqqua431 quantize   0.00999      1e-4  ->  0.0100   Inexact Rounded\r
+dqqua432 quantize   0.00999      1e-3  ->  0.010    Inexact Rounded\r
+dqqua433 quantize   0.00999      1e-2  ->  0.01     Inexact Rounded\r
+dqqua434 quantize   0.00999      1e-1  ->  0.0      Inexact Rounded\r
+dqqua435 quantize   0.00999       1e0  ->  0        Inexact Rounded\r
+dqqua436 quantize   0.00999       1e1  -> 0E+1      Inexact Rounded\r
+\r
+dqqua440 quantize   0.000999     1e-5  ->  0.00100  Inexact Rounded\r
+dqqua441 quantize   0.000999     1e-4  ->  0.0010   Inexact Rounded\r
+dqqua442 quantize   0.000999     1e-3  ->  0.001    Inexact Rounded\r
+dqqua443 quantize   0.000999     1e-2  ->  0.00     Inexact Rounded\r
+dqqua444 quantize   0.000999     1e-1  ->  0.0      Inexact Rounded\r
+dqqua445 quantize   0.000999      1e0  ->  0        Inexact Rounded\r
+dqqua446 quantize   0.000999      1e1  -> 0E+1      Inexact Rounded\r
+\r
+dqqua1001 quantize  0.000        0.001 ->  0.000\r
+dqqua1002 quantize  0.001        0.001 ->  0.001\r
+dqqua1003 quantize  0.0012       0.001 ->  0.001     Inexact Rounded\r
+dqqua1004 quantize  0.0018       0.001 ->  0.002     Inexact Rounded\r
+dqqua1005 quantize  0.501        0.001 ->  0.501\r
+dqqua1006 quantize  0.5012       0.001 ->  0.501     Inexact Rounded\r
+dqqua1007 quantize  0.5018       0.001 ->  0.502     Inexact Rounded\r
+dqqua1008 quantize  0.999        0.001 ->  0.999\r
+\r
+dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded\r
+dqqua482 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded\r
+dqqua483 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded\r
+dqqua484 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded\r
+dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded\r
+dqqua486 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded\r
+-- a potential double-round\r
+dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded\r
+dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded\r
+\r
+dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded\r
+dqqua492 quantize 1234567800  1e+1 -> 1.23456780E+9 Rounded\r
+dqqua493 quantize 1234567890  1e+1 -> 1.23456789E+9 Rounded\r
+dqqua494 quantize 1234567891  1e+1 -> 1.23456789E+9 Inexact Rounded\r
+dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded\r
+dqqua496 quantize 1234567896  1e+1 -> 1.23456790E+9 Inexact Rounded\r
+dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded\r
+dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded\r
+\r
+-- Zeros\r
+dqqua500 quantize   0     1e1 ->  0E+1\r
+dqqua501 quantize   0     1e0 ->  0\r
+dqqua502 quantize   0    1e-1 ->  0.0\r
+dqqua503 quantize   0.0  1e-1 ->  0.0\r
+dqqua504 quantize   0.0   1e0 ->  0\r
+dqqua505 quantize   0.0  1e+1 ->  0E+1\r
+dqqua506 quantize   0E+1 1e-1 ->  0.0\r
+dqqua507 quantize   0E+1  1e0 ->  0\r
+dqqua508 quantize   0E+1 1e+1 ->  0E+1\r
+dqqua509 quantize  -0     1e1 -> -0E+1\r
+dqqua510 quantize  -0     1e0 -> -0\r
+dqqua511 quantize  -0    1e-1 -> -0.0\r
+dqqua512 quantize  -0.0  1e-1 -> -0.0\r
+dqqua513 quantize  -0.0   1e0 -> -0\r
+dqqua514 quantize  -0.0  1e+1 -> -0E+1\r
+dqqua515 quantize  -0E+1 1e-1 -> -0.0\r
+dqqua516 quantize  -0E+1  1e0 -> -0\r
+dqqua517 quantize  -0E+1 1e+1 -> -0E+1\r
+\r
+-- Suspicious RHS values\r
+dqqua520 quantize   1.234    1e359 -> 0E+359 Inexact Rounded\r
+dqqua521 quantize 123.456    1e359 -> 0E+359 Inexact Rounded\r
+dqqua522 quantize   1.234    1e359 -> 0E+359 Inexact Rounded\r
+dqqua523 quantize 123.456    1e359 -> 0E+359 Inexact Rounded\r
+-- next four are "won't fit" overfl\r
+dqqua526 quantize   1.234   1e-299 -> NaN Invalid_operation\r
+dqqua527 quantize 123.456   1e-299 -> NaN Invalid_operation\r
+dqqua528 quantize   1.234   1e-299 -> NaN Invalid_operation\r
+dqqua529 quantize 123.456   1e-299 -> NaN Invalid_operation\r
+\r
+dqqua532 quantize   1.234E+299    1e299 -> 1E+299    Inexact Rounded\r
+dqqua533 quantize   1.234E+298    1e299 -> 0E+299    Inexact Rounded\r
+dqqua534 quantize   1.234         1e299 -> 0E+299    Inexact Rounded\r
+dqqua537 quantize   0            1e-299 -> 0E-299\r
+-- next two are "won't fit" overflows\r
+dqqua538 quantize   1.234        1e-299 -> NaN Invalid_operation\r
+dqqua539 quantize   1.234        1e-300 -> NaN Invalid_operation\r
+-- [more below]\r
+\r
+-- Specials\r
+dqqua580 quantize  Inf    -Inf   ->  Infinity\r
+dqqua581 quantize  Inf  1e-299   ->  NaN  Invalid_operation\r
+dqqua582 quantize  Inf  1e-1     ->  NaN  Invalid_operation\r
+dqqua583 quantize  Inf   1e0     ->  NaN  Invalid_operation\r
+dqqua584 quantize  Inf   1e1     ->  NaN  Invalid_operation\r
+dqqua585 quantize  Inf   1e299   ->  NaN  Invalid_operation\r
+dqqua586 quantize  Inf     Inf   ->  Infinity\r
+dqqua587 quantize -1000    Inf   ->  NaN  Invalid_operation\r
+dqqua588 quantize -Inf     Inf   ->  -Infinity\r
+dqqua589 quantize -1       Inf   ->  NaN  Invalid_operation\r
+dqqua590 quantize  0       Inf   ->  NaN  Invalid_operation\r
+dqqua591 quantize  1       Inf   ->  NaN  Invalid_operation\r
+dqqua592 quantize  1000    Inf   ->  NaN  Invalid_operation\r
+dqqua593 quantize  Inf     Inf   ->  Infinity\r
+dqqua594 quantize  Inf  1e-0     ->  NaN  Invalid_operation\r
+dqqua595 quantize -0       Inf   ->  NaN  Invalid_operation\r
+\r
+dqqua600 quantize -Inf    -Inf   ->  -Infinity\r
+dqqua601 quantize -Inf  1e-299   ->  NaN  Invalid_operation\r
+dqqua602 quantize -Inf  1e-1     ->  NaN  Invalid_operation\r
+dqqua603 quantize -Inf   1e0     ->  NaN  Invalid_operation\r
+dqqua604 quantize -Inf   1e1     ->  NaN  Invalid_operation\r
+dqqua605 quantize -Inf   1e299   ->  NaN  Invalid_operation\r
+dqqua606 quantize -Inf     Inf   ->  -Infinity\r
+dqqua607 quantize -1000    Inf   ->  NaN  Invalid_operation\r
+dqqua608 quantize -Inf    -Inf   ->  -Infinity\r
+dqqua609 quantize -1      -Inf   ->  NaN  Invalid_operation\r
+dqqua610 quantize  0      -Inf   ->  NaN  Invalid_operation\r
+dqqua611 quantize  1      -Inf   ->  NaN  Invalid_operation\r
+dqqua612 quantize  1000   -Inf   ->  NaN  Invalid_operation\r
+dqqua613 quantize  Inf    -Inf   ->  Infinity\r
+dqqua614 quantize -Inf  1e-0     ->  NaN  Invalid_operation\r
+dqqua615 quantize -0      -Inf   ->  NaN  Invalid_operation\r
+\r
+dqqua621 quantize  NaN   -Inf    ->  NaN\r
+dqqua622 quantize  NaN 1e-299    ->  NaN\r
+dqqua623 quantize  NaN 1e-1      ->  NaN\r
+dqqua624 quantize  NaN  1e0      ->  NaN\r
+dqqua625 quantize  NaN  1e1      ->  NaN\r
+dqqua626 quantize  NaN  1e299    ->  NaN\r
+dqqua627 quantize  NaN    Inf    ->  NaN\r
+dqqua628 quantize  NaN    NaN    ->  NaN\r
+dqqua629 quantize -Inf    NaN    ->  NaN\r
+dqqua630 quantize -1000   NaN    ->  NaN\r
+dqqua631 quantize -1      NaN    ->  NaN\r
+dqqua632 quantize  0      NaN    ->  NaN\r
+dqqua633 quantize  1      NaN    ->  NaN\r
+dqqua634 quantize  1000   NaN    ->  NaN\r
+dqqua635 quantize  Inf    NaN    ->  NaN\r
+dqqua636 quantize  NaN 1e-0      ->  NaN\r
+dqqua637 quantize -0      NaN    ->  NaN\r
+\r
+dqqua641 quantize  sNaN   -Inf   ->  NaN  Invalid_operation\r
+dqqua642 quantize  sNaN 1e-299   ->  NaN  Invalid_operation\r
+dqqua643 quantize  sNaN 1e-1     ->  NaN  Invalid_operation\r
+dqqua644 quantize  sNaN  1e0     ->  NaN  Invalid_operation\r
+dqqua645 quantize  sNaN  1e1     ->  NaN  Invalid_operation\r
+dqqua646 quantize  sNaN  1e299   ->  NaN  Invalid_operation\r
+dqqua647 quantize  sNaN    NaN   ->  NaN  Invalid_operation\r
+dqqua648 quantize  sNaN   sNaN   ->  NaN  Invalid_operation\r
+dqqua649 quantize  NaN    sNaN   ->  NaN  Invalid_operation\r
+dqqua650 quantize -Inf    sNaN   ->  NaN  Invalid_operation\r
+dqqua651 quantize -1000   sNaN   ->  NaN  Invalid_operation\r
+dqqua652 quantize -1      sNaN   ->  NaN  Invalid_operation\r
+dqqua653 quantize  0      sNaN   ->  NaN  Invalid_operation\r
+dqqua654 quantize  1      sNaN   ->  NaN  Invalid_operation\r
+dqqua655 quantize  1000   sNaN   ->  NaN  Invalid_operation\r
+dqqua656 quantize  Inf    sNaN   ->  NaN  Invalid_operation\r
+dqqua657 quantize  NaN    sNaN   ->  NaN  Invalid_operation\r
+dqqua658 quantize  sNaN 1e-0     ->  NaN  Invalid_operation\r
+dqqua659 quantize -0      sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqqua661 quantize  NaN9 -Inf   ->  NaN9\r
+dqqua662 quantize  NaN8  919   ->  NaN8\r
+dqqua663 quantize  NaN71 Inf   ->  NaN71\r
+dqqua664 quantize  NaN6  NaN5  ->  NaN6\r
+dqqua665 quantize -Inf   NaN4  ->  NaN4\r
+dqqua666 quantize -919   NaN31 ->  NaN31\r
+dqqua667 quantize  Inf   NaN2  ->  NaN2\r
+\r
+dqqua671 quantize  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+dqqua672 quantize  sNaN98 -11     ->  NaN98 Invalid_operation\r
+dqqua673 quantize  sNaN97  NaN    ->  NaN97 Invalid_operation\r
+dqqua674 quantize  sNaN16 sNaN94  ->  NaN16 Invalid_operation\r
+dqqua675 quantize  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+dqqua676 quantize -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+dqqua677 quantize  088    sNaN91  ->  NaN91 Invalid_operation\r
+dqqua678 quantize  Inf    sNaN90  ->  NaN90 Invalid_operation\r
+dqqua679 quantize  NaN    sNaN88  ->  NaN88 Invalid_operation\r
+\r
+dqqua681 quantize -NaN9 -Inf   -> -NaN9\r
+dqqua682 quantize -NaN8  919   -> -NaN8\r
+dqqua683 quantize -NaN71 Inf   -> -NaN71\r
+dqqua684 quantize -NaN6 -NaN5  -> -NaN6\r
+dqqua685 quantize -Inf  -NaN4  -> -NaN4\r
+dqqua686 quantize -919  -NaN31 -> -NaN31\r
+dqqua687 quantize  Inf  -NaN2  -> -NaN2\r
+\r
+dqqua691 quantize -sNaN99 -Inf    -> -NaN99 Invalid_operation\r
+dqqua692 quantize -sNaN98 -11     -> -NaN98 Invalid_operation\r
+dqqua693 quantize -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+dqqua694 quantize -sNaN16 sNaN94  -> -NaN16 Invalid_operation\r
+dqqua695 quantize -NaN95 -sNaN93  -> -NaN93 Invalid_operation\r
+dqqua696 quantize -Inf   -sNaN92  -> -NaN92 Invalid_operation\r
+dqqua697 quantize  088   -sNaN91  -> -NaN91 Invalid_operation\r
+dqqua698 quantize  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+dqqua699 quantize  NaN   -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- subnormals and underflow\r
+dqqua710 quantize  1.00E-6143    1e-6143  ->   1E-6143    Rounded\r
+dqqua711 quantize  0.1E-6143    2e-6144  ->   1E-6144   Subnormal\r
+dqqua712 quantize  0.10E-6143   3e-6144  ->   1E-6144   Subnormal Rounded\r
+dqqua713 quantize  0.100E-6143  4e-6144  ->   1E-6144   Subnormal Rounded\r
+dqqua714 quantize  0.01E-6143   5e-6145  ->   1E-6145   Subnormal\r
+-- next is rounded to Emin\r
+dqqua715 quantize  0.999E-6143   1e-6143  ->   1E-6143    Inexact Rounded\r
+dqqua716 quantize  0.099E-6143 10e-6144  ->   1E-6144   Inexact Rounded Subnormal\r
+\r
+dqqua717 quantize  0.009E-6143  1e-6145  ->   1E-6145   Inexact Rounded Subnormal\r
+dqqua718 quantize  0.001E-6143  1e-6145  ->   0E-6145   Inexact Rounded\r
+dqqua719 quantize  0.0009E-6143 1e-6145  ->   0E-6145   Inexact Rounded\r
+dqqua720 quantize  0.0001E-6143 1e-6145  ->   0E-6145   Inexact Rounded\r
+\r
+dqqua730 quantize -1.00E-6143   1e-6143  ->  -1E-6143     Rounded\r
+dqqua731 quantize -0.1E-6143    1e-6143  ->  -0E-6143     Rounded Inexact\r
+dqqua732 quantize -0.10E-6143   1e-6143  ->  -0E-6143     Rounded Inexact\r
+dqqua733 quantize -0.100E-6143  1e-6143  ->  -0E-6143     Rounded Inexact\r
+dqqua734 quantize -0.01E-6143   1e-6143  ->  -0E-6143     Inexact Rounded\r
+-- next is rounded to Emin\r
+dqqua735 quantize -0.999E-6143 90e-6143  ->  -1E-6143     Inexact Rounded\r
+dqqua736 quantize -0.099E-6143 -1e-6143  ->  -0E-6143     Inexact Rounded\r
+dqqua737 quantize -0.009E-6143 -1e-6143  ->  -0E-6143     Inexact Rounded\r
+dqqua738 quantize -0.001E-6143 -0e-6143  ->  -0E-6143     Inexact Rounded\r
+dqqua739 quantize -0.0001E-6143 0e-6143  ->  -0E-6143     Inexact Rounded\r
+\r
+dqqua740 quantize -1.00E-6143   1e-6144 ->  -1.0E-6143   Rounded\r
+dqqua741 quantize -0.1E-6143    1e-6144 ->  -1E-6144    Subnormal\r
+dqqua742 quantize -0.10E-6143   1e-6144 ->  -1E-6144    Subnormal Rounded\r
+dqqua743 quantize -0.100E-6143  1e-6144 ->  -1E-6144    Subnormal Rounded\r
+dqqua744 quantize -0.01E-6143   1e-6144 ->  -0E-6144    Inexact Rounded\r
+-- next is rounded to Emin\r
+dqqua745 quantize -0.999E-6143  1e-6144 ->  -1.0E-6143   Inexact Rounded\r
+dqqua746 quantize -0.099E-6143  1e-6144 ->  -1E-6144    Inexact Rounded Subnormal\r
+dqqua747 quantize -0.009E-6143  1e-6144 ->  -0E-6144    Inexact Rounded\r
+dqqua748 quantize -0.001E-6143  1e-6144 ->  -0E-6144    Inexact Rounded\r
+dqqua749 quantize -0.0001E-6143 1e-6144 ->  -0E-6144    Inexact Rounded\r
+\r
+dqqua750 quantize -1.00E-6143   1e-6145 ->  -1.00E-6143\r
+dqqua751 quantize -0.1E-6143    1e-6145 ->  -1.0E-6144  Subnormal\r
+dqqua752 quantize -0.10E-6143   1e-6145 ->  -1.0E-6144  Subnormal\r
+dqqua753 quantize -0.100E-6143  1e-6145 ->  -1.0E-6144  Subnormal Rounded\r
+dqqua754 quantize -0.01E-6143   1e-6145 ->  -1E-6145    Subnormal\r
+-- next is rounded to Emin\r
+dqqua755 quantize -0.999E-6143  1e-6145 ->  -1.00E-6143  Inexact Rounded\r
+dqqua756 quantize -0.099E-6143  1e-6145 ->  -1.0E-6144  Inexact Rounded Subnormal\r
+dqqua757 quantize -0.009E-6143  1e-6145 ->  -1E-6145    Inexact Rounded Subnormal\r
+dqqua758 quantize -0.001E-6143  1e-6145 ->  -0E-6145    Inexact Rounded\r
+dqqua759 quantize -0.0001E-6143 1e-6145 ->  -0E-6145    Inexact Rounded\r
+\r
+dqqua760 quantize -1.00E-6143   1e-6146 ->  -1.000E-6143\r
+dqqua761 quantize -0.1E-6143    1e-6146 ->  -1.00E-6144  Subnormal\r
+dqqua762 quantize -0.10E-6143   1e-6146 ->  -1.00E-6144  Subnormal\r
+dqqua763 quantize -0.100E-6143  1e-6146 ->  -1.00E-6144  Subnormal\r
+dqqua764 quantize -0.01E-6143   1e-6146 ->  -1.0E-6145   Subnormal\r
+dqqua765 quantize -0.999E-6143  1e-6146 ->  -9.99E-6144  Subnormal\r
+dqqua766 quantize -0.099E-6143  1e-6146 ->  -9.9E-6145   Subnormal\r
+dqqua767 quantize -0.009E-6143  1e-6146 ->  -9E-6146     Subnormal\r
+dqqua768 quantize -0.001E-6143  1e-6146 ->  -1E-6146     Subnormal\r
+dqqua769 quantize -0.0001E-6143 1e-6146 ->  -0E-6146     Inexact Rounded\r
+\r
+-- More from Fung Lee\r
+dqqua1021 quantize  8.666666666666000E+6144  1.000000000000000E+6144 ->  8.666666666666000000000000000000000E+6144  Clamped\r
+dqqua1022 quantize -8.666666666666000E+6144  1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144  Clamped\r
+dqqua1027 quantize 8.666666666666000E+323  1E+31    -> NaN Invalid_operation\r
+dqqua1030 quantize 8.66666666E+3           1E+3     -> 9E+3 Inexact Rounded\r
+\r
+-- Int and uInt32 edge values for testing conversions\r
+dqqua1040 quantize -2147483646     0 -> -2147483646\r
+dqqua1041 quantize -2147483647     0 -> -2147483647\r
+dqqua1042 quantize -2147483648     0 -> -2147483648\r
+dqqua1043 quantize -2147483649     0 -> -2147483649\r
+dqqua1044 quantize  2147483646     0 ->  2147483646\r
+dqqua1045 quantize  2147483647     0 ->  2147483647\r
+dqqua1046 quantize  2147483648     0 ->  2147483648\r
+dqqua1047 quantize  2147483649     0 ->  2147483649\r
+dqqua1048 quantize  4294967294     0 ->  4294967294\r
+dqqua1049 quantize  4294967295     0 ->  4294967295\r
+dqqua1050 quantize  4294967296     0 ->  4294967296\r
+dqqua1051 quantize  4294967297     0 ->  4294967297\r
+\r
+-- Rounding swathe\r
+rounding: half_even\r
+dqqua1100 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1101 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+dqqua1102 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+dqqua1103 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+dqqua1104 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+dqqua1105 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+dqqua1106 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+dqqua1107 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+dqqua1108 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+dqqua1109 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: half_up\r
+dqqua1200 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1201 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+dqqua1202 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+dqqua1203 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+dqqua1204 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+dqqua1205 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+dqqua1206 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+dqqua1207 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+dqqua1208 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+dqqua1209 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: half_down\r
+dqqua1300 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1301 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+dqqua1302 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+dqqua1303 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+dqqua1304 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+dqqua1305 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+dqqua1306 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+dqqua1307 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+dqqua1308 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+dqqua1309 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+\r
+rounding: up\r
+dqqua1400 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1401 quantize  1.2301    1.00    ->  1.24  Inexact Rounded\r
+dqqua1402 quantize  1.2310    1.00    ->  1.24  Inexact Rounded\r
+dqqua1403 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+dqqua1404 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+dqqua1405 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+dqqua1406 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+dqqua1407 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+dqqua1408 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+dqqua1409 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+dqqua1411 quantize -1.2399    1.00    -> -1.24  Inexact Rounded\r
+\r
+rounding: down\r
+dqqua1500 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1501 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+dqqua1502 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+dqqua1503 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+dqqua1504 quantize  1.2351    1.00    ->  1.23  Inexact Rounded\r
+dqqua1505 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+dqqua1506 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+dqqua1507 quantize  1.2360    1.00    ->  1.23  Inexact Rounded\r
+dqqua1508 quantize  1.2370    1.00    ->  1.23  Inexact Rounded\r
+dqqua1509 quantize  1.2399    1.00    ->  1.23  Inexact Rounded\r
+dqqua1511 quantize -1.2399    1.00    -> -1.23  Inexact Rounded\r
+\r
+rounding: ceiling\r
+dqqua1600 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1601 quantize  1.2301    1.00    ->  1.24  Inexact Rounded\r
+dqqua1602 quantize  1.2310    1.00    ->  1.24  Inexact Rounded\r
+dqqua1603 quantize  1.2350    1.00    ->  1.24  Inexact Rounded\r
+dqqua1604 quantize  1.2351    1.00    ->  1.24  Inexact Rounded\r
+dqqua1605 quantize  1.2450    1.00    ->  1.25  Inexact Rounded\r
+dqqua1606 quantize  1.2451    1.00    ->  1.25  Inexact Rounded\r
+dqqua1607 quantize  1.2360    1.00    ->  1.24  Inexact Rounded\r
+dqqua1608 quantize  1.2370    1.00    ->  1.24  Inexact Rounded\r
+dqqua1609 quantize  1.2399    1.00    ->  1.24  Inexact Rounded\r
+dqqua1611 quantize -1.2399    1.00    -> -1.23  Inexact Rounded\r
+\r
+rounding: floor\r
+dqqua1700 quantize  1.2300    1.00    ->  1.23  Rounded\r
+dqqua1701 quantize  1.2301    1.00    ->  1.23  Inexact Rounded\r
+dqqua1702 quantize  1.2310    1.00    ->  1.23  Inexact Rounded\r
+dqqua1703 quantize  1.2350    1.00    ->  1.23  Inexact Rounded\r
+dqqua1704 quantize  1.2351    1.00    ->  1.23  Inexact Rounded\r
+dqqua1705 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+dqqua1706 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+dqqua1707 quantize  1.2360    1.00    ->  1.23  Inexact Rounded\r
+dqqua1708 quantize  1.2370    1.00    ->  1.23  Inexact Rounded\r
+dqqua1709 quantize  1.2399    1.00    ->  1.23  Inexact Rounded\r
+dqqua1711 quantize -1.2399    1.00    -> -1.24  Inexact Rounded\r
+\r
+rounding: 05up\r
+dqqua1800 quantize  1.2000    1.00    ->  1.20  Rounded\r
+dqqua1801 quantize  1.2001    1.00    ->  1.21  Inexact Rounded\r
+dqqua1802 quantize  1.2010    1.00    ->  1.21  Inexact Rounded\r
+dqqua1803 quantize  1.2050    1.00    ->  1.21  Inexact Rounded\r
+dqqua1804 quantize  1.2051    1.00    ->  1.21  Inexact Rounded\r
+dqqua1807 quantize  1.2060    1.00    ->  1.21  Inexact Rounded\r
+dqqua1808 quantize  1.2070    1.00    ->  1.21  Inexact Rounded\r
+dqqua1809 quantize  1.2099    1.00    ->  1.21  Inexact Rounded\r
+dqqua1811 quantize -1.2099    1.00    -> -1.21  Inexact Rounded\r
+\r
+dqqua1900 quantize  1.2100    1.00    ->  1.21  Rounded\r
+dqqua1901 quantize  1.2101    1.00    ->  1.21  Inexact Rounded\r
+dqqua1902 quantize  1.2110    1.00    ->  1.21  Inexact Rounded\r
+dqqua1903 quantize  1.2150    1.00    ->  1.21  Inexact Rounded\r
+dqqua1904 quantize  1.2151    1.00    ->  1.21  Inexact Rounded\r
+dqqua1907 quantize  1.2160    1.00    ->  1.21  Inexact Rounded\r
+dqqua1908 quantize  1.2170    1.00    ->  1.21  Inexact Rounded\r
+dqqua1909 quantize  1.2199    1.00    ->  1.21  Inexact Rounded\r
+dqqua1911 quantize -1.2199    1.00    -> -1.21  Inexact Rounded\r
+\r
+dqqua2000 quantize  1.2400    1.00    ->  1.24  Rounded\r
+dqqua2001 quantize  1.2401    1.00    ->  1.24  Inexact Rounded\r
+dqqua2002 quantize  1.2410    1.00    ->  1.24  Inexact Rounded\r
+dqqua2003 quantize  1.2450    1.00    ->  1.24  Inexact Rounded\r
+dqqua2004 quantize  1.2451    1.00    ->  1.24  Inexact Rounded\r
+dqqua2007 quantize  1.2460    1.00    ->  1.24  Inexact Rounded\r
+dqqua2008 quantize  1.2470    1.00    ->  1.24  Inexact Rounded\r
+dqqua2009 quantize  1.2499    1.00    ->  1.24  Inexact Rounded\r
+dqqua2011 quantize -1.2499    1.00    -> -1.24  Inexact Rounded\r
+\r
+dqqua2100 quantize  1.2500    1.00    ->  1.25  Rounded\r
+dqqua2101 quantize  1.2501    1.00    ->  1.26  Inexact Rounded\r
+dqqua2102 quantize  1.2510    1.00    ->  1.26  Inexact Rounded\r
+dqqua2103 quantize  1.2550    1.00    ->  1.26  Inexact Rounded\r
+dqqua2104 quantize  1.2551    1.00    ->  1.26  Inexact Rounded\r
+dqqua2107 quantize  1.2560    1.00    ->  1.26  Inexact Rounded\r
+dqqua2108 quantize  1.2570    1.00    ->  1.26  Inexact Rounded\r
+dqqua2109 quantize  1.2599    1.00    ->  1.26  Inexact Rounded\r
+dqqua2111 quantize -1.2599    1.00    -> -1.26  Inexact Rounded\r
+\r
+dqqua2200 quantize  1.2600    1.00    ->  1.26  Rounded\r
+dqqua2201 quantize  1.2601    1.00    ->  1.26  Inexact Rounded\r
+dqqua2202 quantize  1.2610    1.00    ->  1.26  Inexact Rounded\r
+dqqua2203 quantize  1.2650    1.00    ->  1.26  Inexact Rounded\r
+dqqua2204 quantize  1.2651    1.00    ->  1.26  Inexact Rounded\r
+dqqua2207 quantize  1.2660    1.00    ->  1.26  Inexact Rounded\r
+dqqua2208 quantize  1.2670    1.00    ->  1.26  Inexact Rounded\r
+dqqua2209 quantize  1.2699    1.00    ->  1.26  Inexact Rounded\r
+dqqua2211 quantize -1.2699    1.00    -> -1.26  Inexact Rounded\r
+\r
+dqqua2300 quantize  1.2900    1.00    ->  1.29  Rounded\r
+dqqua2301 quantize  1.2901    1.00    ->  1.29  Inexact Rounded\r
+dqqua2302 quantize  1.2910    1.00    ->  1.29  Inexact Rounded\r
+dqqua2303 quantize  1.2950    1.00    ->  1.29  Inexact Rounded\r
+dqqua2304 quantize  1.2951    1.00    ->  1.29  Inexact Rounded\r
+dqqua2307 quantize  1.2960    1.00    ->  1.29  Inexact Rounded\r
+dqqua2308 quantize  1.2970    1.00    ->  1.29  Inexact Rounded\r
+dqqua2309 quantize  1.2999    1.00    ->  1.29  Inexact Rounded\r
+dqqua2311 quantize -1.2999    1.00    -> -1.29  Inexact Rounded\r
+\r
+-- Null tests\r
+dqqua998 quantize 10    # -> NaN Invalid_operation\r
+dqqua999 quantize  # 1e10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqReduce.decTest b/Lib/test/decimaltestdata/dqReduce.decTest
new file mode 100644 (file)
index 0000000..183e9dc
--- /dev/null
@@ -0,0 +1,183 @@
+------------------------------------------------------------------------\r
+-- dqReduce.decTest -- remove trailing zeros from a decQuad           --\r
+-- Copyright (c) IBM Corporation, 2003, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqred001 reduce '1'      -> '1'\r
+dqred002 reduce '-1'     -> '-1'\r
+dqred003 reduce '1.00'   -> '1'\r
+dqred004 reduce '-1.00'  -> '-1'\r
+dqred005 reduce '0'      -> '0'\r
+dqred006 reduce '0.00'   -> '0'\r
+dqred007 reduce '00.0'   -> '0'\r
+dqred008 reduce '00.00'  -> '0'\r
+dqred009 reduce '00'     -> '0'\r
+dqred010 reduce '0E+1'   -> '0'\r
+dqred011 reduce '0E+5'   -> '0'\r
+\r
+dqred012 reduce '-2'     -> '-2'\r
+dqred013 reduce '2'      -> '2'\r
+dqred014 reduce '-2.00'  -> '-2'\r
+dqred015 reduce '2.00'   -> '2'\r
+dqred016 reduce '-0'     -> '-0'\r
+dqred017 reduce '-0.00'  -> '-0'\r
+dqred018 reduce '-00.0'  -> '-0'\r
+dqred019 reduce '-00.00' -> '-0'\r
+dqred020 reduce '-00'    -> '-0'\r
+dqred021 reduce '-0E+5'   -> '-0'\r
+dqred022 reduce '-0E+1'  -> '-0'\r
+\r
+dqred030 reduce '+0.1'            -> '0.1'\r
+dqred031 reduce '-0.1'            -> '-0.1'\r
+dqred032 reduce '+0.01'           -> '0.01'\r
+dqred033 reduce '-0.01'           -> '-0.01'\r
+dqred034 reduce '+0.001'          -> '0.001'\r
+dqred035 reduce '-0.001'          -> '-0.001'\r
+dqred036 reduce '+0.000001'       -> '0.000001'\r
+dqred037 reduce '-0.000001'       -> '-0.000001'\r
+dqred038 reduce '+0.000000000001' -> '1E-12'\r
+dqred039 reduce '-0.000000000001' -> '-1E-12'\r
+\r
+dqred041 reduce 1.1        -> 1.1\r
+dqred042 reduce 1.10       -> 1.1\r
+dqred043 reduce 1.100      -> 1.1\r
+dqred044 reduce 1.110      -> 1.11\r
+dqred045 reduce -1.1       -> -1.1\r
+dqred046 reduce -1.10      -> -1.1\r
+dqred047 reduce -1.100     -> -1.1\r
+dqred048 reduce -1.110     -> -1.11\r
+dqred049 reduce 9.9        -> 9.9\r
+dqred050 reduce 9.90       -> 9.9\r
+dqred051 reduce 9.900      -> 9.9\r
+dqred052 reduce 9.990      -> 9.99\r
+dqred053 reduce -9.9       -> -9.9\r
+dqred054 reduce -9.90      -> -9.9\r
+dqred055 reduce -9.900     -> -9.9\r
+dqred056 reduce -9.990     -> -9.99\r
+\r
+-- some trailing fractional zeros with zeros in units\r
+dqred060 reduce  10.0        -> 1E+1\r
+dqred061 reduce  10.00       -> 1E+1\r
+dqred062 reduce  100.0       -> 1E+2\r
+dqred063 reduce  100.00      -> 1E+2\r
+dqred064 reduce  1.1000E+3   -> 1.1E+3\r
+dqred065 reduce  1.10000E+3  -> 1.1E+3\r
+dqred066 reduce -10.0        -> -1E+1\r
+dqred067 reduce -10.00       -> -1E+1\r
+dqred068 reduce -100.0       -> -1E+2\r
+dqred069 reduce -100.00      -> -1E+2\r
+dqred070 reduce -1.1000E+3   -> -1.1E+3\r
+dqred071 reduce -1.10000E+3  -> -1.1E+3\r
+\r
+-- some insignificant trailing zeros with positive exponent\r
+dqred080 reduce  10E+1       -> 1E+2\r
+dqred081 reduce  100E+1      -> 1E+3\r
+dqred082 reduce  1.0E+2      -> 1E+2\r
+dqred083 reduce  1.0E+3      -> 1E+3\r
+dqred084 reduce  1.1E+3      -> 1.1E+3\r
+dqred085 reduce  1.00E+3     -> 1E+3\r
+dqred086 reduce  1.10E+3     -> 1.1E+3\r
+dqred087 reduce -10E+1       -> -1E+2\r
+dqred088 reduce -100E+1      -> -1E+3\r
+dqred089 reduce -1.0E+2      -> -1E+2\r
+dqred090 reduce -1.0E+3      -> -1E+3\r
+dqred091 reduce -1.1E+3      -> -1.1E+3\r
+dqred092 reduce -1.00E+3     -> -1E+3\r
+dqred093 reduce -1.10E+3     -> -1.1E+3\r
+\r
+-- some significant trailing zeros, were we to be trimming\r
+dqred100 reduce  11          -> 11\r
+dqred101 reduce  10          -> 1E+1\r
+dqred102 reduce  10.         -> 1E+1\r
+dqred103 reduce  1.1E+1      -> 11\r
+dqred104 reduce  1.0E+1      -> 1E+1\r
+dqred105 reduce  1.10E+2     -> 1.1E+2\r
+dqred106 reduce  1.00E+2     -> 1E+2\r
+dqred107 reduce  1.100E+3    -> 1.1E+3\r
+dqred108 reduce  1.000E+3    -> 1E+3\r
+dqred109 reduce  1.000000E+6 -> 1E+6\r
+dqred110 reduce -11          -> -11\r
+dqred111 reduce -10          -> -1E+1\r
+dqred112 reduce -10.         -> -1E+1\r
+dqred113 reduce -1.1E+1      -> -11\r
+dqred114 reduce -1.0E+1      -> -1E+1\r
+dqred115 reduce -1.10E+2     -> -1.1E+2\r
+dqred116 reduce -1.00E+2     -> -1E+2\r
+dqred117 reduce -1.100E+3    -> -1.1E+3\r
+dqred118 reduce -1.000E+3    -> -1E+3\r
+dqred119 reduce -1.00000E+5  -> -1E+5\r
+dqred120 reduce -1.000000E+6 -> -1E+6\r
+dqred121 reduce -10.00000E+6 -> -1E+7\r
+dqred122 reduce -100.0000E+6 -> -1E+8\r
+dqred123 reduce -1000.000E+6 -> -1E+9\r
+dqred124 reduce -10000.00E+6 -> -1E+10\r
+dqred125 reduce -100000.0E+6 -> -1E+11\r
+dqred126 reduce -1000000.E+6 -> -1E+12\r
+\r
+-- examples from decArith\r
+dqred140 reduce '2.1'     ->  '2.1'\r
+dqred141 reduce '-2.0'    ->  '-2'\r
+dqred142 reduce '1.200'   ->  '1.2'\r
+dqred143 reduce '-120'    ->  '-1.2E+2'\r
+dqred144 reduce '120.00'  ->  '1.2E+2'\r
+dqred145 reduce '0.00'    ->  '0'\r
+\r
+-- Nmax, Nmin, Ntiny\r
+-- note origami effect on some of these\r
+dqred151 reduce  9.999999999999999999999999999999999E+6144   -> 9.999999999999999999999999999999999E+6144\r
+dqred152 reduce  9.999999999999999999999999000000000E+6140   -> 9.99999999999999999999999900000E+6140\r
+dqred153 reduce  9.999999999999999999999999999990000E+6144   -> 9.999999999999999999999999999990000E+6144\r
+dqred154 reduce  1E-6143                   -> 1E-6143\r
+dqred155 reduce  1.000000000000000000000000000000000E-6143   -> 1E-6143\r
+dqred156 reduce  2.000E-6173               -> 2E-6173   Subnormal\r
+dqred157 reduce  1E-6176                   -> 1E-6176   Subnormal\r
+\r
+dqred161 reduce  -1E-6176                  -> -1E-6176  Subnormal\r
+dqred162 reduce  -2.000E-6173              -> -2E-6173  Subnormal\r
+dqred163 reduce  -1.000000000000000000000000000000000E-6143  -> -1E-6143\r
+dqred164 reduce  -1E-6143                  -> -1E-6143\r
+dqred165 reduce  -9.999999999999999999999999000000000E+6140  -> -9.99999999999999999999999900000E+6140\r
+dqred166 reduce  -9.999999999999999999999999999990000E+6144  -> -9.999999999999999999999999999990000E+6144\r
+dqred167 reduce  -9.999999999999999999999999999999990E+6144  -> -9.999999999999999999999999999999990E+6144\r
+dqred168 reduce  -9.999999999999999999999999999999999E+6144  -> -9.999999999999999999999999999999999E+6144\r
+dqred169 reduce  -9.999999999999999999999999999999990E+6144  -> -9.999999999999999999999999999999990E+6144\r
+\r
+\r
+-- specials (reduce does not affect payload)\r
+dqred820 reduce 'Inf'    -> 'Infinity'\r
+dqred821 reduce '-Inf'   -> '-Infinity'\r
+dqred822 reduce   NaN    ->  NaN\r
+dqred823 reduce  sNaN    ->  NaN    Invalid_operation\r
+dqred824 reduce   NaN101 ->  NaN101\r
+dqred825 reduce  sNaN010 ->  NaN10  Invalid_operation\r
+dqred827 reduce  -NaN    -> -NaN\r
+dqred828 reduce -sNaN    -> -NaN    Invalid_operation\r
+dqred829 reduce  -NaN101 -> -NaN101\r
+dqred830 reduce -sNaN010 -> -NaN10  Invalid_operation\r
+\r
+-- Null test\r
+dqred900 reduce  # -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqRemainder.decTest b/Lib/test/decimaltestdata/dqRemainder.decTest
new file mode 100644 (file)
index 0000000..e30fde7
--- /dev/null
@@ -0,0 +1,586 @@
+------------------------------------------------------------------------\r
+-- dqRemainder.decTest -- decQuad remainder                           --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks (as base, above)\r
+dqrem001 remainder  1     1    ->  0\r
+dqrem002 remainder  2     1    ->  0\r
+dqrem003 remainder  1     2    ->  1\r
+dqrem004 remainder  2     2    ->  0\r
+dqrem005 remainder  0     1    ->  0\r
+dqrem006 remainder  0     2    ->  0\r
+dqrem007 remainder  1     3    ->  1\r
+dqrem008 remainder  2     3    ->  2\r
+dqrem009 remainder  3     3    ->  0\r
+\r
+dqrem010 remainder  2.4   1    ->  0.4\r
+dqrem011 remainder  2.4   -1   ->  0.4\r
+dqrem012 remainder  -2.4  1    ->  -0.4\r
+dqrem013 remainder  -2.4  -1   ->  -0.4\r
+dqrem014 remainder  2.40  1    ->  0.40\r
+dqrem015 remainder  2.400 1    ->  0.400\r
+dqrem016 remainder  2.4   2    ->  0.4\r
+dqrem017 remainder  2.400 2    ->  0.400\r
+dqrem018 remainder  2.    2    ->  0\r
+dqrem019 remainder  20    20   ->  0\r
+\r
+dqrem020 remainder  187   187    ->  0\r
+dqrem021 remainder  5     2      ->  1\r
+dqrem022 remainder  5     2.0    ->  1.0\r
+dqrem023 remainder  5     2.000  ->  1.000\r
+dqrem024 remainder  5     0.200  ->  0.000\r
+dqrem025 remainder  5     0.200  ->  0.000\r
+\r
+dqrem030 remainder  1     2      ->  1\r
+dqrem031 remainder  1     4      ->  1\r
+dqrem032 remainder  1     8      ->  1\r
+\r
+dqrem033 remainder  1     16     ->  1\r
+dqrem034 remainder  1     32     ->  1\r
+dqrem035 remainder  1     64     ->  1\r
+dqrem040 remainder  1    -2      ->  1\r
+dqrem041 remainder  1    -4      ->  1\r
+dqrem042 remainder  1    -8      ->  1\r
+dqrem043 remainder  1    -16     ->  1\r
+dqrem044 remainder  1    -32     ->  1\r
+dqrem045 remainder  1    -64     ->  1\r
+dqrem050 remainder -1     2      ->  -1\r
+dqrem051 remainder -1     4      ->  -1\r
+dqrem052 remainder -1     8      ->  -1\r
+dqrem053 remainder -1     16     ->  -1\r
+dqrem054 remainder -1     32     ->  -1\r
+dqrem055 remainder -1     64     ->  -1\r
+dqrem060 remainder -1    -2      ->  -1\r
+dqrem061 remainder -1    -4      ->  -1\r
+dqrem062 remainder -1    -8      ->  -1\r
+dqrem063 remainder -1    -16     ->  -1\r
+dqrem064 remainder -1    -32     ->  -1\r
+dqrem065 remainder -1    -64     ->  -1\r
+\r
+dqrem066 remainder  999999999     1  -> 0\r
+dqrem067 remainder  999999999.4   1  -> 0.4\r
+dqrem068 remainder  999999999.5   1  -> 0.5\r
+dqrem069 remainder  999999999.9   1  -> 0.9\r
+dqrem070 remainder  999999999.999 1  -> 0.999\r
+dqrem071 remainder  999999.999999 1  -> 0.999999\r
+dqrem072 remainder  9             1  -> 0\r
+\r
+dqrem080 remainder  0.            1  -> 0\r
+dqrem081 remainder  .0            1  -> 0.0\r
+dqrem082 remainder  0.00          1  -> 0.00\r
+dqrem083 remainder  0.00E+9       1  -> 0\r
+dqrem084 remainder  0.00E+3       1  -> 0\r
+dqrem085 remainder  0.00E+2       1  -> 0\r
+dqrem086 remainder  0.00E+1       1  -> 0.0\r
+dqrem087 remainder  0.00E+0       1  -> 0.00\r
+dqrem088 remainder  0.00E-0       1  -> 0.00\r
+dqrem089 remainder  0.00E-1       1  -> 0.000\r
+dqrem090 remainder  0.00E-2       1  -> 0.0000\r
+dqrem091 remainder  0.00E-3       1  -> 0.00000\r
+dqrem092 remainder  0.00E-4       1  -> 0.000000\r
+dqrem093 remainder  0.00E-5       1  -> 0E-7\r
+dqrem094 remainder  0.00E-6       1  -> 0E-8\r
+dqrem095 remainder  0.0000E-50    1  -> 0E-54\r
+\r
+-- Various flavours of remainder by 0\r
+dqrem101 remainder  0       0   -> NaN Division_undefined\r
+dqrem102 remainder  0      -0   -> NaN Division_undefined\r
+dqrem103 remainder -0       0   -> NaN Division_undefined\r
+dqrem104 remainder -0      -0   -> NaN Division_undefined\r
+dqrem105 remainder  0.0E5   0   -> NaN Division_undefined\r
+dqrem106 remainder  0.000   0   -> NaN Division_undefined\r
+-- [Some think this next group should be Division_by_zero exception, but\r
+-- IEEE 854 is explicit that it is Invalid operation .. for\r
+-- remainder-near, anyway]\r
+dqrem107 remainder  0.0001  0   -> NaN Invalid_operation\r
+dqrem108 remainder  0.01    0   -> NaN Invalid_operation\r
+dqrem109 remainder  0.1     0   -> NaN Invalid_operation\r
+dqrem110 remainder  1       0   -> NaN Invalid_operation\r
+dqrem111 remainder  1       0.0 -> NaN Invalid_operation\r
+dqrem112 remainder 10       0.0 -> NaN Invalid_operation\r
+dqrem113 remainder 1E+100   0.0 -> NaN Invalid_operation\r
+dqrem114 remainder 1E+380   0   -> NaN Invalid_operation\r
+dqrem115 remainder  0.0001 -0   -> NaN Invalid_operation\r
+dqrem116 remainder  0.01   -0   -> NaN Invalid_operation\r
+dqrem119 remainder  0.1    -0   -> NaN Invalid_operation\r
+dqrem120 remainder  1      -0   -> NaN Invalid_operation\r
+dqrem121 remainder  1      -0.0 -> NaN Invalid_operation\r
+dqrem122 remainder 10      -0.0 -> NaN Invalid_operation\r
+dqrem123 remainder 1E+100  -0.0 -> NaN Invalid_operation\r
+dqrem124 remainder 1E+384  -0   -> NaN Invalid_operation\r
+-- and zeros on left\r
+dqrem130 remainder  0      1   ->  0\r
+dqrem131 remainder  0     -1   ->  0\r
+dqrem132 remainder  0.0    1   ->  0.0\r
+dqrem133 remainder  0.0   -1   ->  0.0\r
+dqrem134 remainder -0      1   -> -0\r
+dqrem135 remainder -0     -1   -> -0\r
+dqrem136 remainder -0.0    1   -> -0.0\r
+dqrem137 remainder -0.0   -1   -> -0.0\r
+\r
+-- 0.5ers\r
+dqrem143 remainder   0.5  2     ->  0.5\r
+dqrem144 remainder   0.5  2.1   ->  0.5\r
+dqrem145 remainder   0.5  2.01  ->  0.50\r
+dqrem146 remainder   0.5  2.001 ->  0.500\r
+dqrem147 remainder   0.50 2     ->  0.50\r
+dqrem148 remainder   0.50 2.01  ->  0.50\r
+dqrem149 remainder   0.50 2.001 ->  0.500\r
+\r
+-- steadies\r
+dqrem150 remainder  1  1   -> 0\r
+dqrem151 remainder  1  2   -> 1\r
+dqrem152 remainder  1  3   -> 1\r
+dqrem153 remainder  1  4   -> 1\r
+dqrem154 remainder  1  5   -> 1\r
+dqrem155 remainder  1  6   -> 1\r
+dqrem156 remainder  1  7   -> 1\r
+dqrem157 remainder  1  8   -> 1\r
+dqrem158 remainder  1  9   -> 1\r
+dqrem159 remainder  1  10  -> 1\r
+dqrem160 remainder  1  1   -> 0\r
+dqrem161 remainder  2  1   -> 0\r
+dqrem162 remainder  3  1   -> 0\r
+dqrem163 remainder  4  1   -> 0\r
+dqrem164 remainder  5  1   -> 0\r
+dqrem165 remainder  6  1   -> 0\r
+dqrem166 remainder  7  1   -> 0\r
+dqrem167 remainder  8  1   -> 0\r
+dqrem168 remainder  9  1   -> 0\r
+dqrem169 remainder  10 1   -> 0\r
+\r
+-- some differences from remainderNear\r
+dqrem171 remainder   0.4  1.020 ->  0.400\r
+dqrem172 remainder   0.50 1.020 ->  0.500\r
+dqrem173 remainder   0.51 1.020 ->  0.510\r
+dqrem174 remainder   0.52 1.020 ->  0.520\r
+dqrem175 remainder   0.6  1.020 ->  0.600\r
+\r
+-- More flavours of remainder by 0\r
+dqrem201 remainder  0      0   -> NaN Division_undefined\r
+dqrem202 remainder  0.0E5  0   -> NaN Division_undefined\r
+dqrem203 remainder  0.000  0   -> NaN Division_undefined\r
+dqrem204 remainder  0.0001 0   -> NaN Invalid_operation\r
+dqrem205 remainder  0.01   0   -> NaN Invalid_operation\r
+dqrem206 remainder  0.1    0   -> NaN Invalid_operation\r
+dqrem207 remainder  1      0   -> NaN Invalid_operation\r
+dqrem208 remainder  1      0.0 -> NaN Invalid_operation\r
+dqrem209 remainder 10      0.0 -> NaN Invalid_operation\r
+dqrem210 remainder 1E+100  0.0 -> NaN Invalid_operation\r
+dqrem211 remainder 1E+380  0   -> NaN Invalid_operation\r
+\r
+-- some differences from remainderNear\r
+dqrem231 remainder  -0.4  1.020 -> -0.400\r
+dqrem232 remainder  -0.50 1.020 -> -0.500\r
+dqrem233 remainder  -0.51 1.020 -> -0.510\r
+dqrem234 remainder  -0.52 1.020 -> -0.520\r
+dqrem235 remainder  -0.6  1.020 -> -0.600\r
+\r
+-- high Xs\r
+dqrem240 remainder  1E+2  1.00  ->  0.00\r
+\r
+-- dqrem3xx are from DiagBigDecimal\r
+dqrem301 remainder   1    3     ->  1\r
+dqrem302 remainder   5    5     ->  0\r
+dqrem303 remainder   13   10    ->  3\r
+dqrem304 remainder   13   50    ->  13\r
+dqrem305 remainder   13   100   ->  13\r
+dqrem306 remainder   13   1000  ->  13\r
+dqrem307 remainder   .13    1   ->  0.13\r
+dqrem308 remainder   0.133  1   ->  0.133\r
+dqrem309 remainder   0.1033 1   ->  0.1033\r
+dqrem310 remainder   1.033  1   ->  0.033\r
+dqrem311 remainder   10.33  1   ->  0.33\r
+dqrem312 remainder   10.33 10   ->  0.33\r
+dqrem313 remainder   103.3  1   ->  0.3\r
+dqrem314 remainder   133   10   ->  3\r
+dqrem315 remainder   1033  10   ->  3\r
+dqrem316 remainder   1033  50   ->  33\r
+dqrem317 remainder   101.0  3   ->  2.0\r
+dqrem318 remainder   102.0  3   ->  0.0\r
+dqrem319 remainder   103.0  3   ->  1.0\r
+dqrem320 remainder   2.40   1   ->  0.40\r
+dqrem321 remainder   2.400  1   ->  0.400\r
+dqrem322 remainder   2.4    1   ->  0.4\r
+dqrem323 remainder   2.4    2   ->  0.4\r
+dqrem324 remainder   2.400  2   ->  0.400\r
+dqrem325 remainder   1   0.3    ->  0.1\r
+dqrem326 remainder   1   0.30   ->  0.10\r
+dqrem327 remainder   1   0.300  ->  0.100\r
+dqrem328 remainder   1   0.3000 ->  0.1000\r
+dqrem329 remainder   1.0    0.3 ->  0.1\r
+dqrem330 remainder   1.00   0.3 ->  0.10\r
+dqrem331 remainder   1.000  0.3 ->  0.100\r
+dqrem332 remainder   1.0000 0.3 ->  0.1000\r
+dqrem333 remainder   0.5  2     ->  0.5\r
+dqrem334 remainder   0.5  2.1   ->  0.5\r
+dqrem335 remainder   0.5  2.01  ->  0.50\r
+dqrem336 remainder   0.5  2.001 ->  0.500\r
+dqrem337 remainder   0.50 2     ->  0.50\r
+dqrem338 remainder   0.50 2.01  ->  0.50\r
+dqrem339 remainder   0.50 2.001 ->  0.500\r
+\r
+dqrem340 remainder   0.5   0.5000001    ->  0.5000000\r
+dqrem341 remainder   0.5   0.50000001    ->  0.50000000\r
+dqrem342 remainder   0.5   0.500000001    ->  0.500000000\r
+dqrem343 remainder   0.5   0.5000000001    ->  0.5000000000\r
+dqrem344 remainder   0.5   0.50000000001    ->  0.50000000000\r
+dqrem345 remainder   0.5   0.4999999    ->  1E-7\r
+dqrem346 remainder   0.5   0.49999999    ->  1E-8\r
+dqrem347 remainder   0.5   0.499999999    ->  1E-9\r
+dqrem348 remainder   0.5   0.4999999999    ->  1E-10\r
+dqrem349 remainder   0.5   0.49999999999    ->  1E-11\r
+dqrem350 remainder   0.5   0.499999999999    ->  1E-12\r
+\r
+dqrem351 remainder   0.03  7  ->  0.03\r
+dqrem352 remainder   5   2    ->  1\r
+dqrem353 remainder   4.1   2    ->  0.1\r
+dqrem354 remainder   4.01   2    ->  0.01\r
+dqrem355 remainder   4.001   2    ->  0.001\r
+dqrem356 remainder   4.0001   2    ->  0.0001\r
+dqrem357 remainder   4.00001   2    ->  0.00001\r
+dqrem358 remainder   4.000001   2    ->  0.000001\r
+dqrem359 remainder   4.0000001   2    ->  1E-7\r
+\r
+dqrem360 remainder   1.2   0.7345 ->  0.4655\r
+dqrem361 remainder   0.8   12     ->  0.8\r
+dqrem362 remainder   0.8   0.2    ->  0.0\r
+dqrem363 remainder   0.8   0.3    ->  0.2\r
+dqrem364 remainder   0.800   12   ->  0.800\r
+dqrem365 remainder   0.800   1.7  ->  0.800\r
+dqrem366 remainder   2.400   2    ->  0.400\r
+\r
+dqrem371 remainder   2.400  2        ->  0.400\r
+\r
+dqrem381 remainder 12345  1         ->  0\r
+dqrem382 remainder 12345  1.0001    ->  0.7657\r
+dqrem383 remainder 12345  1.001     ->  0.668\r
+dqrem384 remainder 12345  1.01      ->  0.78\r
+dqrem385 remainder 12345  1.1       ->  0.8\r
+dqrem386 remainder 12355  4         ->  3\r
+dqrem387 remainder 12345  4         ->  1\r
+dqrem388 remainder 12355  4.0001    ->  2.6912\r
+dqrem389 remainder 12345  4.0001    ->  0.6914\r
+dqrem390 remainder 12345  4.9       ->  1.9\r
+dqrem391 remainder 12345  4.99      ->  4.73\r
+dqrem392 remainder 12345  4.999     ->  2.469\r
+dqrem393 remainder 12345  4.9999    ->  0.2469\r
+dqrem394 remainder 12345  5         ->  0\r
+dqrem395 remainder 12345  5.0001    ->  4.7532\r
+dqrem396 remainder 12345  5.001     ->  2.532\r
+dqrem397 remainder 12345  5.01      ->  0.36\r
+dqrem398 remainder 12345  5.1       ->  3.0\r
+\r
+-- the nasty division-by-1 cases\r
+dqrem401 remainder   0.5         1   ->  0.5\r
+dqrem402 remainder   0.55        1   ->  0.55\r
+dqrem403 remainder   0.555       1   ->  0.555\r
+dqrem404 remainder   0.5555      1   ->  0.5555\r
+dqrem405 remainder   0.55555     1   ->  0.55555\r
+dqrem406 remainder   0.555555    1   ->  0.555555\r
+dqrem407 remainder   0.5555555   1   ->  0.5555555\r
+dqrem408 remainder   0.55555555  1   ->  0.55555555\r
+dqrem409 remainder   0.555555555 1   ->  0.555555555\r
+\r
+-- folddowns\r
+dqrem421 remainder   1E+6144        1  ->   NaN Division_impossible\r
+dqrem422 remainder   1E+6144  1E+6143  ->   0E+6111 Clamped\r
+dqrem423 remainder   1E+6144  2E+6143  ->   0E+6111 Clamped\r
+dqrem424 remainder   1E+6144  3E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped\r
+dqrem425 remainder   1E+6144  4E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped\r
+dqrem426 remainder   1E+6144  5E+6143  ->   0E+6111 Clamped\r
+dqrem427 remainder   1E+6144  6E+6143  ->   4.00000000000000000000000000000000E+6143 Clamped\r
+dqrem428 remainder   1E+6144  7E+6143  ->   3.00000000000000000000000000000000E+6143 Clamped\r
+dqrem429 remainder   1E+6144  8E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped\r
+dqrem430 remainder   1E+6144  9E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped\r
+-- tinies\r
+dqrem431 remainder   1E-6175  1E-6176  ->   0E-6176\r
+dqrem432 remainder   1E-6175  2E-6176  ->   0E-6176\r
+dqrem433 remainder   1E-6175  3E-6176  ->   1E-6176 Subnormal\r
+dqrem434 remainder   1E-6175  4E-6176  ->   2E-6176 Subnormal\r
+dqrem435 remainder   1E-6175  5E-6176  ->   0E-6176\r
+dqrem436 remainder   1E-6175  6E-6176  ->   4E-6176 Subnormal\r
+dqrem437 remainder   1E-6175  7E-6176  ->   3E-6176 Subnormal\r
+dqrem438 remainder   1E-6175  8E-6176  ->   2E-6176 Subnormal\r
+dqrem439 remainder   1E-6175  9E-6176  ->   1E-6176 Subnormal\r
+dqrem440 remainder   1E-6175 10E-6176  ->   0E-6176\r
+dqrem441 remainder   1E-6175 11E-6176  -> 1.0E-6175 Subnormal\r
+dqrem442 remainder 100E-6175 11E-6176  -> 1.0E-6175 Subnormal\r
+dqrem443 remainder 100E-6175 20E-6176  ->   0E-6176\r
+dqrem444 remainder 100E-6175 21E-6176  -> 1.3E-6175 Subnormal\r
+dqrem445 remainder 100E-6175 30E-6176  -> 1.0E-6175 Subnormal\r
+\r
+-- zero signs\r
+dqrem650 remainder  1  1 ->  0\r
+dqrem651 remainder -1  1 -> -0\r
+dqrem652 remainder  1 -1 ->  0\r
+dqrem653 remainder -1 -1 -> -0\r
+dqrem654 remainder  0  1 ->  0\r
+dqrem655 remainder -0  1 -> -0\r
+dqrem656 remainder  0 -1 ->  0\r
+dqrem657 remainder -0 -1 -> -0\r
+dqrem658 remainder  0.00  1  ->  0.00\r
+dqrem659 remainder -0.00  1  -> -0.00\r
+\r
+-- Specials\r
+dqrem680 remainder  Inf  -Inf   ->  NaN Invalid_operation\r
+dqrem681 remainder  Inf  -1000  ->  NaN Invalid_operation\r
+dqrem682 remainder  Inf  -1     ->  NaN Invalid_operation\r
+dqrem683 remainder  Inf   0     ->  NaN Invalid_operation\r
+dqrem684 remainder  Inf  -0     ->  NaN Invalid_operation\r
+dqrem685 remainder  Inf   1     ->  NaN Invalid_operation\r
+dqrem686 remainder  Inf   1000  ->  NaN Invalid_operation\r
+dqrem687 remainder  Inf   Inf   ->  NaN Invalid_operation\r
+dqrem688 remainder -1000  Inf   -> -1000\r
+dqrem689 remainder -Inf   Inf   ->  NaN Invalid_operation\r
+dqrem691 remainder -1     Inf   -> -1\r
+dqrem692 remainder  0     Inf   ->  0\r
+dqrem693 remainder -0     Inf   -> -0\r
+dqrem694 remainder  1     Inf   ->  1\r
+dqrem695 remainder  1000  Inf   ->  1000\r
+dqrem696 remainder  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dqrem700 remainder -Inf  -Inf   ->  NaN Invalid_operation\r
+dqrem701 remainder -Inf  -1000  ->  NaN Invalid_operation\r
+dqrem702 remainder -Inf  -1     ->  NaN Invalid_operation\r
+dqrem703 remainder -Inf  -0     ->  NaN Invalid_operation\r
+dqrem704 remainder -Inf   0     ->  NaN Invalid_operation\r
+dqrem705 remainder -Inf   1     ->  NaN Invalid_operation\r
+dqrem706 remainder -Inf   1000  ->  NaN Invalid_operation\r
+dqrem707 remainder -Inf   Inf   ->  NaN Invalid_operation\r
+dqrem708 remainder -Inf  -Inf   ->  NaN Invalid_operation\r
+dqrem709 remainder -1000  Inf   -> -1000\r
+dqrem710 remainder -1    -Inf   -> -1\r
+dqrem711 remainder -0    -Inf   -> -0\r
+dqrem712 remainder  0    -Inf   ->  0\r
+dqrem713 remainder  1    -Inf   ->  1\r
+dqrem714 remainder  1000 -Inf   ->  1000\r
+dqrem715 remainder  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dqrem721 remainder  NaN -Inf    ->  NaN\r
+dqrem722 remainder  NaN -1000   ->  NaN\r
+dqrem723 remainder  NaN -1      ->  NaN\r
+dqrem724 remainder  NaN -0      ->  NaN\r
+dqrem725 remainder -NaN  0      -> -NaN\r
+dqrem726 remainder  NaN  1      ->  NaN\r
+dqrem727 remainder  NaN  1000   ->  NaN\r
+dqrem728 remainder  NaN  Inf    ->  NaN\r
+dqrem729 remainder  NaN -NaN    ->  NaN\r
+dqrem730 remainder -Inf  NaN    ->  NaN\r
+dqrem731 remainder -1000 NaN    ->  NaN\r
+dqrem732 remainder -1    NaN    ->  NaN\r
+dqrem733 remainder -0   -NaN    -> -NaN\r
+dqrem734 remainder  0    NaN    ->  NaN\r
+dqrem735 remainder  1   -NaN    -> -NaN\r
+dqrem736 remainder  1000 NaN    ->  NaN\r
+dqrem737 remainder  Inf  NaN    ->  NaN\r
+\r
+dqrem741 remainder  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqrem742 remainder  sNaN -1000  ->  NaN  Invalid_operation\r
+dqrem743 remainder -sNaN -1     -> -NaN  Invalid_operation\r
+dqrem744 remainder  sNaN -0     ->  NaN  Invalid_operation\r
+dqrem745 remainder  sNaN  0     ->  NaN  Invalid_operation\r
+dqrem746 remainder  sNaN  1     ->  NaN  Invalid_operation\r
+dqrem747 remainder  sNaN  1000  ->  NaN  Invalid_operation\r
+dqrem749 remainder  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqrem750 remainder  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqrem751 remainder  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqrem752 remainder -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqrem753 remainder -1000 sNaN   ->  NaN  Invalid_operation\r
+dqrem754 remainder -1    sNaN   ->  NaN  Invalid_operation\r
+dqrem755 remainder -0    sNaN   ->  NaN  Invalid_operation\r
+dqrem756 remainder  0    sNaN   ->  NaN  Invalid_operation\r
+dqrem757 remainder  1    sNaN   ->  NaN  Invalid_operation\r
+dqrem758 remainder  1000 sNaN   ->  NaN  Invalid_operation\r
+dqrem759 remainder  Inf -sNaN   -> -NaN  Invalid_operation\r
+\r
+-- propaging NaNs\r
+dqrem760 remainder  NaN1   NaN7   ->  NaN1\r
+dqrem761 remainder sNaN2   NaN8   ->  NaN2 Invalid_operation\r
+dqrem762 remainder  NaN3  sNaN9   ->  NaN9 Invalid_operation\r
+dqrem763 remainder sNaN4  sNaN10  ->  NaN4 Invalid_operation\r
+dqrem764 remainder    15   NaN11  ->  NaN11\r
+dqrem765 remainder  NaN6   NaN12  ->  NaN6\r
+dqrem766 remainder  Inf    NaN13  ->  NaN13\r
+dqrem767 remainder  NaN14  -Inf   ->  NaN14\r
+dqrem768 remainder    0    NaN15  ->  NaN15\r
+dqrem769 remainder  NaN16   -0    ->  NaN16\r
+\r
+-- edge cases of impossible\r
+dqrem770  remainder  1234568888888887777777777890123456  10    ->  6\r
+dqrem771  remainder  1234568888888887777777777890123456   1    ->  0\r
+dqrem772  remainder  1234568888888887777777777890123456   0.1  ->  NaN Division_impossible\r
+dqrem773  remainder  1234568888888887777777777890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- long operand checks\r
+dqrem801 remainder 12345678000 100 -> 0\r
+dqrem802 remainder 1 12345678000   -> 1\r
+dqrem803 remainder 1234567800  10  -> 0\r
+dqrem804 remainder 1 1234567800    -> 1\r
+dqrem805 remainder 1234567890  10  -> 0\r
+dqrem806 remainder 1 1234567890    -> 1\r
+dqrem807 remainder 1234567891  10  -> 1\r
+dqrem808 remainder 1 1234567891    -> 1\r
+dqrem809 remainder 12345678901 100 -> 1\r
+dqrem810 remainder 1 12345678901   -> 1\r
+dqrem811 remainder 1234567896  10  -> 6\r
+dqrem812 remainder 1 1234567896    -> 1\r
+\r
+dqrem821 remainder 12345678000 100 -> 0\r
+dqrem822 remainder 1 12345678000   -> 1\r
+dqrem823 remainder 1234567800  10  -> 0\r
+dqrem824 remainder 1 1234567800    -> 1\r
+dqrem825 remainder 1234567890  10  -> 0\r
+dqrem826 remainder 1 1234567890    -> 1\r
+dqrem827 remainder 1234567891  10  -> 1\r
+dqrem828 remainder 1 1234567891    -> 1\r
+dqrem829 remainder 12345678901 100 -> 1\r
+dqrem830 remainder 1 12345678901   -> 1\r
+dqrem831 remainder 1234567896  10  -> 6\r
+dqrem832 remainder 1 1234567896    -> 1\r
+\r
+-- from divideint\r
+dqrem840 remainder  100000000.0   1  ->  0.0\r
+dqrem841 remainder  100000000.4   1  ->  0.4\r
+dqrem842 remainder  100000000.5   1  ->  0.5\r
+dqrem843 remainder  100000000.9   1  ->  0.9\r
+dqrem844 remainder  100000000.999 1  ->  0.999\r
+dqrem850 remainder  100000003     5  ->  3\r
+dqrem851 remainder  10000003      5  ->  3\r
+dqrem852 remainder  1000003       5  ->  3\r
+dqrem853 remainder  100003        5  ->  3\r
+dqrem854 remainder  10003         5  ->  3\r
+dqrem855 remainder  1003          5  ->  3\r
+dqrem856 remainder  103           5  ->  3\r
+dqrem857 remainder  13            5  ->  3\r
+dqrem858 remainder  1             5  ->  1\r
+\r
+-- Vladimir's cases         1234567890123456\r
+dqrem860 remainder 123.0e1 1000000000000000  -> 1230\r
+dqrem861 remainder 1230    1000000000000000  -> 1230\r
+dqrem862 remainder 12.3e2  1000000000000000  -> 1230\r
+dqrem863 remainder 1.23e3  1000000000000000  -> 1230\r
+dqrem864 remainder 123e1   1000000000000000  -> 1230\r
+dqrem870 remainder 123e1    1000000000000000 -> 1230\r
+dqrem871 remainder 123e1     100000000000000 -> 1230\r
+dqrem872 remainder 123e1      10000000000000 -> 1230\r
+dqrem873 remainder 123e1       1000000000000 -> 1230\r
+dqrem874 remainder 123e1        100000000000 -> 1230\r
+dqrem875 remainder 123e1         10000000000 -> 1230\r
+dqrem876 remainder 123e1          1000000000 -> 1230\r
+dqrem877 remainder 123e1           100000000 -> 1230\r
+dqrem878 remainder 1230            100000000 -> 1230\r
+dqrem879 remainder 123e1            10000000 -> 1230\r
+dqrem880 remainder 123e1             1000000 -> 1230\r
+dqrem881 remainder 123e1              100000 -> 1230\r
+dqrem882 remainder 123e1               10000 -> 1230\r
+dqrem883 remainder 123e1                1000 ->  230\r
+dqrem884 remainder 123e1                 100 ->   30\r
+dqrem885 remainder 123e1                  10 ->    0\r
+dqrem886 remainder 123e1                   1 ->    0\r
+\r
+dqrem890 remainder 123e1    2000000000000000 -> 1230\r
+dqrem891 remainder 123e1     200000000000000 -> 1230\r
+dqrem892 remainder 123e1      20000000000000 -> 1230\r
+dqrem893 remainder 123e1       2000000000000 -> 1230\r
+dqrem894 remainder 123e1        200000000000 -> 1230\r
+dqrem895 remainder 123e1         20000000000 -> 1230\r
+dqrem896 remainder 123e1          2000000000 -> 1230\r
+dqrem897 remainder 123e1           200000000 -> 1230\r
+dqrem899 remainder 123e1            20000000 -> 1230\r
+dqrem900 remainder 123e1             2000000 -> 1230\r
+dqrem901 remainder 123e1              200000 -> 1230\r
+dqrem902 remainder 123e1               20000 -> 1230\r
+dqrem903 remainder 123e1                2000 -> 1230\r
+dqrem904 remainder 123e1                 200 ->   30\r
+dqrem905 remainder 123e1                  20 ->   10\r
+dqrem906 remainder 123e1                   2 ->    0\r
+\r
+dqrem910 remainder 123e1    5000000000000000 -> 1230\r
+dqrem911 remainder 123e1     500000000000000 -> 1230\r
+dqrem912 remainder 123e1      50000000000000 -> 1230\r
+dqrem913 remainder 123e1       5000000000000 -> 1230\r
+dqrem914 remainder 123e1        500000000000 -> 1230\r
+dqrem915 remainder 123e1         50000000000 -> 1230\r
+dqrem916 remainder 123e1          5000000000 -> 1230\r
+dqrem917 remainder 123e1           500000000 -> 1230\r
+dqrem919 remainder 123e1            50000000 -> 1230\r
+dqrem920 remainder 123e1             5000000 -> 1230\r
+dqrem921 remainder 123e1              500000 -> 1230\r
+dqrem922 remainder 123e1               50000 -> 1230\r
+dqrem923 remainder 123e1                5000 -> 1230\r
+dqrem924 remainder 123e1                 500 ->  230\r
+dqrem925 remainder 123e1                  50 ->   30\r
+dqrem926 remainder 123e1                   5 ->    0\r
+\r
+dqrem930 remainder 123e1    9000000000000000 -> 1230\r
+dqrem931 remainder 123e1     900000000000000 -> 1230\r
+dqrem932 remainder 123e1      90000000000000 -> 1230\r
+dqrem933 remainder 123e1       9000000000000 -> 1230\r
+dqrem934 remainder 123e1        900000000000 -> 1230\r
+dqrem935 remainder 123e1         90000000000 -> 1230\r
+dqrem936 remainder 123e1          9000000000 -> 1230\r
+dqrem937 remainder 123e1           900000000 -> 1230\r
+dqrem939 remainder 123e1            90000000 -> 1230\r
+dqrem940 remainder 123e1             9000000 -> 1230\r
+dqrem941 remainder 123e1              900000 -> 1230\r
+dqrem942 remainder 123e1               90000 -> 1230\r
+dqrem943 remainder 123e1                9000 -> 1230\r
+dqrem944 remainder 123e1                 900 ->  330\r
+dqrem945 remainder 123e1                  90 ->   60\r
+dqrem946 remainder 123e1                   9 ->    6\r
+\r
+dqrem950 remainder 123e1   1000000000000000 -> 1230\r
+dqrem961 remainder 123e1   2999999999999999 -> 1230\r
+dqrem962 remainder 123e1   3999999999999999 -> 1230\r
+dqrem963 remainder 123e1   4999999999999999 -> 1230\r
+dqrem964 remainder 123e1   5999999999999999 -> 1230\r
+dqrem965 remainder 123e1   6999999999999999 -> 1230\r
+dqrem966 remainder 123e1   7999999999999999 -> 1230\r
+dqrem967 remainder 123e1   8999999999999999 -> 1230\r
+dqrem968 remainder 123e1   9999999999999999 -> 1230\r
+dqrem969 remainder 123e1   9876543210987654 -> 1230\r
+\r
+dqrem980 remainder 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally\r
+\r
+-- overflow and underflow tests [from divide]\r
+dqrem1051 remainder  1e+277  1e-311 ->  NaN Division_impossible\r
+dqrem1052 remainder  1e+277 -1e-311 ->  NaN Division_impossible\r
+dqrem1053 remainder -1e+277  1e-311 ->  NaN Division_impossible\r
+dqrem1054 remainder -1e+277 -1e-311 ->  NaN Division_impossible\r
+dqrem1055 remainder  1e-277  1e+311 ->  1E-277\r
+dqrem1056 remainder  1e-277 -1e+311 ->  1E-277\r
+dqrem1057 remainder -1e-277  1e+311 -> -1E-277\r
+dqrem1058 remainder -1e-277 -1e+311 -> -1E-277\r
+\r
+-- Gyuris example\r
+dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143\r
+\r
+-- Null tests\r
+dqrem1000 remainder 10  # -> NaN Invalid_operation\r
+dqrem1001 remainder  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqRemainderNear.decTest b/Lib/test/decimaltestdata/dqRemainderNear.decTest
new file mode 100644 (file)
index 0000000..b62b79f
--- /dev/null
@@ -0,0 +1,618 @@
+------------------------------------------------------------------------\r
+-- dqRemainderNear.decTest -- decQuad remainder-near                  --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- sanity checks (as base, above)\r
+dqrmn001 remaindernear  1     1    ->  0\r
+dqrmn002 remaindernear  2     1    ->  0\r
+dqrmn003 remaindernear  1     2    ->  1\r
+dqrmn004 remaindernear  2     2    ->  0\r
+dqrmn005 remaindernear  0     1    ->  0\r
+dqrmn006 remaindernear  0     2    ->  0\r
+dqrmn007 remaindernear  1     3    ->  1\r
+dqrmn008 remaindernear  2     3    -> -1\r
+dqrmn009 remaindernear  3     3    ->  0\r
+\r
+dqrmn010 remaindernear  2.4   1    ->  0.4\r
+dqrmn011 remaindernear  2.4   -1   ->  0.4\r
+dqrmn012 remaindernear  -2.4  1    ->  -0.4\r
+dqrmn013 remaindernear  -2.4  -1   ->  -0.4\r
+dqrmn014 remaindernear  2.40  1    ->  0.40\r
+dqrmn015 remaindernear  2.400 1    ->  0.400\r
+dqrmn016 remaindernear  2.4   2    ->  0.4\r
+dqrmn017 remaindernear  2.400 2    ->  0.400\r
+dqrmn018 remaindernear  2.    2    ->  0\r
+dqrmn019 remaindernear  20    20   ->  0\r
+\r
+dqrmn020 remaindernear  187   187    ->  0\r
+dqrmn021 remaindernear  5     2      ->  1\r
+dqrmn022 remaindernear  5     2.0    ->  1.0\r
+dqrmn023 remaindernear  5     2.000  ->  1.000\r
+dqrmn024 remaindernear  5     0.200  ->  0.000\r
+dqrmn025 remaindernear  5     0.200  ->  0.000\r
+\r
+dqrmn030 remaindernear  1     2      ->  1\r
+dqrmn031 remaindernear  1     4      ->  1\r
+dqrmn032 remaindernear  1     8      ->  1\r
+\r
+dqrmn033 remaindernear  1     16     ->  1\r
+dqrmn034 remaindernear  1     32     ->  1\r
+dqrmn035 remaindernear  1     64     ->  1\r
+dqrmn040 remaindernear  1    -2      ->  1\r
+dqrmn041 remaindernear  1    -4      ->  1\r
+dqrmn042 remaindernear  1    -8      ->  1\r
+dqrmn043 remaindernear  1    -16     ->  1\r
+dqrmn044 remaindernear  1    -32     ->  1\r
+dqrmn045 remaindernear  1    -64     ->  1\r
+dqrmn050 remaindernear -1     2      ->  -1\r
+dqrmn051 remaindernear -1     4      ->  -1\r
+dqrmn052 remaindernear -1     8      ->  -1\r
+dqrmn053 remaindernear -1     16     ->  -1\r
+dqrmn054 remaindernear -1     32     ->  -1\r
+dqrmn055 remaindernear -1     64     ->  -1\r
+dqrmn060 remaindernear -1    -2      ->  -1\r
+dqrmn061 remaindernear -1    -4      ->  -1\r
+dqrmn062 remaindernear -1    -8      ->  -1\r
+dqrmn063 remaindernear -1    -16     ->  -1\r
+dqrmn064 remaindernear -1    -32     ->  -1\r
+dqrmn065 remaindernear -1    -64     ->  -1\r
+\r
+dqrmn066 remaindernear          9.9   1  -> -0.1\r
+dqrmn067 remaindernear         99.7   1  -> -0.3\r
+dqrmn068 remaindernear  999999999     1  -> 0\r
+dqrmn069 remaindernear  999999999.4   1  -> 0.4\r
+dqrmn070 remaindernear  999999999.5   1  -> -0.5\r
+dqrmn071 remaindernear  999999999.9   1  -> -0.1\r
+dqrmn072 remaindernear  999999999.999 1  -> -0.001\r
+dqrmn073 remaindernear  999999.999999 1  -> -0.000001\r
+dqrmn074 remaindernear  9             1  -> 0\r
+dqrmn075 remaindernear  9999999999999999 1  -> 0\r
+dqrmn076 remaindernear  9999999999999999 2  -> -1\r
+dqrmn077 remaindernear  9999999999999999 3  -> 0\r
+dqrmn078 remaindernear  9999999999999999 4  -> -1\r
+\r
+dqrmn080 remaindernear  0.            1  -> 0\r
+dqrmn081 remaindernear  .0            1  -> 0.0\r
+dqrmn082 remaindernear  0.00          1  -> 0.00\r
+dqrmn083 remaindernear  0.00E+9       1  -> 0\r
+dqrmn084 remaindernear  0.00E+3       1  -> 0\r
+dqrmn085 remaindernear  0.00E+2       1  -> 0\r
+dqrmn086 remaindernear  0.00E+1       1  -> 0.0\r
+dqrmn087 remaindernear  0.00E+0       1  -> 0.00\r
+dqrmn088 remaindernear  0.00E-0       1  -> 0.00\r
+dqrmn089 remaindernear  0.00E-1       1  -> 0.000\r
+dqrmn090 remaindernear  0.00E-2       1  -> 0.0000\r
+dqrmn091 remaindernear  0.00E-3       1  -> 0.00000\r
+dqrmn092 remaindernear  0.00E-4       1  -> 0.000000\r
+dqrmn093 remaindernear  0.00E-5       1  -> 0E-7\r
+dqrmn094 remaindernear  0.00E-6       1  -> 0E-8\r
+dqrmn095 remaindernear  0.0000E-50    1  -> 0E-54\r
+\r
+-- Various flavours of remaindernear by 0\r
+dqrmn101 remaindernear  0       0   -> NaN Division_undefined\r
+dqrmn102 remaindernear  0      -0   -> NaN Division_undefined\r
+dqrmn103 remaindernear -0       0   -> NaN Division_undefined\r
+dqrmn104 remaindernear -0      -0   -> NaN Division_undefined\r
+dqrmn105 remaindernear  0.0E5   0   -> NaN Division_undefined\r
+dqrmn106 remaindernear  0.000   0   -> NaN Division_undefined\r
+-- [Some think this next group should be Division_by_zero exception, but\r
+-- IEEE 854 is explicit that it is Invalid operation .. for\r
+-- remainder-near, anyway]\r
+dqrmn107 remaindernear  0.0001  0   -> NaN Invalid_operation\r
+dqrmn108 remaindernear  0.01    0   -> NaN Invalid_operation\r
+dqrmn109 remaindernear  0.1     0   -> NaN Invalid_operation\r
+dqrmn110 remaindernear  1       0   -> NaN Invalid_operation\r
+dqrmn111 remaindernear  1       0.0 -> NaN Invalid_operation\r
+dqrmn112 remaindernear 10       0.0 -> NaN Invalid_operation\r
+dqrmn113 remaindernear 1E+100   0.0 -> NaN Invalid_operation\r
+dqrmn114 remaindernear 1E+380   0   -> NaN Invalid_operation\r
+dqrmn115 remaindernear  0.0001 -0   -> NaN Invalid_operation\r
+dqrmn116 remaindernear  0.01   -0   -> NaN Invalid_operation\r
+dqrmn119 remaindernear  0.1    -0   -> NaN Invalid_operation\r
+dqrmn120 remaindernear  1      -0   -> NaN Invalid_operation\r
+dqrmn121 remaindernear  1      -0.0 -> NaN Invalid_operation\r
+dqrmn122 remaindernear 10      -0.0 -> NaN Invalid_operation\r
+dqrmn123 remaindernear 1E+100  -0.0 -> NaN Invalid_operation\r
+dqrmn124 remaindernear 1E+384  -0   -> NaN Invalid_operation\r
+-- and zeros on left\r
+dqrmn130 remaindernear  0      1   ->  0\r
+dqrmn131 remaindernear  0     -1   ->  0\r
+dqrmn132 remaindernear  0.0    1   ->  0.0\r
+dqrmn133 remaindernear  0.0   -1   ->  0.0\r
+dqrmn134 remaindernear -0      1   -> -0\r
+dqrmn135 remaindernear -0     -1   -> -0\r
+dqrmn136 remaindernear -0.0    1   -> -0.0\r
+dqrmn137 remaindernear -0.0   -1   -> -0.0\r
+\r
+-- 0.5ers\r
+dqrmn143 remaindernear   0.5  2     ->  0.5\r
+dqrmn144 remaindernear   0.5  2.1   ->  0.5\r
+dqrmn145 remaindernear   0.5  2.01  ->  0.50\r
+dqrmn146 remaindernear   0.5  2.001 ->  0.500\r
+dqrmn147 remaindernear   0.50 2     ->  0.50\r
+dqrmn148 remaindernear   0.50 2.01  ->  0.50\r
+dqrmn149 remaindernear   0.50 2.001 ->  0.500\r
+\r
+-- steadies\r
+dqrmn150 remaindernear  1  1   -> 0\r
+dqrmn151 remaindernear  1  2   -> 1\r
+dqrmn152 remaindernear  1  3   -> 1\r
+dqrmn153 remaindernear  1  4   -> 1\r
+dqrmn154 remaindernear  1  5   -> 1\r
+dqrmn155 remaindernear  1  6   -> 1\r
+dqrmn156 remaindernear  1  7   -> 1\r
+dqrmn157 remaindernear  1  8   -> 1\r
+dqrmn158 remaindernear  1  9   -> 1\r
+dqrmn159 remaindernear  1  10  -> 1\r
+dqrmn160 remaindernear  1  1   -> 0\r
+dqrmn161 remaindernear  2  1   -> 0\r
+dqrmn162 remaindernear  3  1   -> 0\r
+dqrmn163 remaindernear  4  1   -> 0\r
+dqrmn164 remaindernear  5  1   -> 0\r
+dqrmn165 remaindernear  6  1   -> 0\r
+dqrmn166 remaindernear  7  1   -> 0\r
+dqrmn167 remaindernear  8  1   -> 0\r
+dqrmn168 remaindernear  9  1   -> 0\r
+dqrmn169 remaindernear  10 1   -> 0\r
+\r
+-- some differences from remainder\r
+dqrmn171 remaindernear   0.4  1.020 ->  0.400\r
+dqrmn172 remaindernear   0.50 1.020 ->  0.500\r
+dqrmn173 remaindernear   0.51 1.020 ->  0.510\r
+dqrmn174 remaindernear   0.52 1.020 -> -0.500\r
+dqrmn175 remaindernear   0.6  1.020 -> -0.420\r
+\r
+-- More flavours of remaindernear by 0\r
+dqrmn201 remaindernear  0      0   -> NaN Division_undefined\r
+dqrmn202 remaindernear  0.0E5  0   -> NaN Division_undefined\r
+dqrmn203 remaindernear  0.000  0   -> NaN Division_undefined\r
+dqrmn204 remaindernear  0.0001 0   -> NaN Invalid_operation\r
+dqrmn205 remaindernear  0.01   0   -> NaN Invalid_operation\r
+dqrmn206 remaindernear  0.1    0   -> NaN Invalid_operation\r
+dqrmn207 remaindernear  1      0   -> NaN Invalid_operation\r
+dqrmn208 remaindernear  1      0.0 -> NaN Invalid_operation\r
+dqrmn209 remaindernear 10      0.0 -> NaN Invalid_operation\r
+dqrmn210 remaindernear 1E+100  0.0 -> NaN Invalid_operation\r
+dqrmn211 remaindernear 1E+380  0   -> NaN Invalid_operation\r
+\r
+-- tests from the extended specification\r
+dqrmn221 remaindernear 2.1     3   -> -0.9\r
+dqrmn222 remaindernear  10     6   -> -2\r
+dqrmn223 remaindernear  10     3   ->  1\r
+dqrmn224 remaindernear -10     3   -> -1\r
+dqrmn225 remaindernear  10.2   1   -> 0.2\r
+dqrmn226 remaindernear  10     0.3 -> 0.1\r
+dqrmn227 remaindernear   3.6   1.3 -> -0.3\r
+\r
+-- some differences from remainder\r
+dqrmn231 remaindernear  -0.4  1.020 -> -0.400\r
+dqrmn232 remaindernear  -0.50 1.020 -> -0.500\r
+dqrmn233 remaindernear  -0.51 1.020 -> -0.510\r
+dqrmn234 remaindernear  -0.52 1.020 ->  0.500\r
+dqrmn235 remaindernear  -0.6  1.020 ->  0.420\r
+\r
+-- high Xs\r
+dqrmn240 remaindernear  1E+2  1.00  ->  0.00\r
+\r
+-- dqrmn3xx are from DiagBigDecimal\r
+dqrmn301 remaindernear   1    3     ->  1\r
+dqrmn302 remaindernear   5    5     ->  0\r
+dqrmn303 remaindernear   13   10    ->  3\r
+dqrmn304 remaindernear   13   50    ->  13\r
+dqrmn305 remaindernear   13   100   ->  13\r
+dqrmn306 remaindernear   13   1000  ->  13\r
+dqrmn307 remaindernear   .13    1   ->  0.13\r
+dqrmn308 remaindernear   0.133  1   ->  0.133\r
+dqrmn309 remaindernear   0.1033 1   ->  0.1033\r
+dqrmn310 remaindernear   1.033  1   ->  0.033\r
+dqrmn311 remaindernear   10.33  1   ->  0.33\r
+dqrmn312 remaindernear   10.33 10   ->  0.33\r
+dqrmn313 remaindernear   103.3  1   ->  0.3\r
+dqrmn314 remaindernear   133   10   ->  3\r
+dqrmn315 remaindernear   1033  10   ->  3\r
+dqrmn316 remaindernear   1033  50   -> -17\r
+dqrmn317 remaindernear   101.0  3   -> -1.0\r
+dqrmn318 remaindernear   102.0  3   ->  0.0\r
+dqrmn319 remaindernear   103.0  3   ->  1.0\r
+dqrmn320 remaindernear   2.40   1   ->  0.40\r
+dqrmn321 remaindernear   2.400  1   ->  0.400\r
+dqrmn322 remaindernear   2.4    1   ->  0.4\r
+dqrmn323 remaindernear   2.4    2   ->  0.4\r
+dqrmn324 remaindernear   2.400  2   ->  0.400\r
+dqrmn325 remaindernear   1   0.3    ->  0.1\r
+dqrmn326 remaindernear   1   0.30   ->  0.10\r
+dqrmn327 remaindernear   1   0.300  ->  0.100\r
+dqrmn328 remaindernear   1   0.3000 ->  0.1000\r
+dqrmn329 remaindernear   1.0    0.3 ->  0.1\r
+dqrmn330 remaindernear   1.00   0.3 ->  0.10\r
+dqrmn331 remaindernear   1.000  0.3 ->  0.100\r
+dqrmn332 remaindernear   1.0000 0.3 ->  0.1000\r
+dqrmn333 remaindernear   0.5  2     ->  0.5\r
+dqrmn334 remaindernear   0.5  2.1   ->  0.5\r
+dqrmn335 remaindernear   0.5  2.01  ->  0.50\r
+dqrmn336 remaindernear   0.5  2.001 ->  0.500\r
+dqrmn337 remaindernear   0.50 2     ->  0.50\r
+dqrmn338 remaindernear   0.50 2.01  ->  0.50\r
+dqrmn339 remaindernear   0.50 2.001 ->  0.500\r
+\r
+dqrmn340 remaindernear   0.5   0.5000001    ->  -1E-7\r
+dqrmn341 remaindernear   0.5   0.50000001    ->  -1E-8\r
+dqrmn342 remaindernear   0.5   0.500000001    ->  -1E-9\r
+dqrmn343 remaindernear   0.5   0.5000000001    ->  -1E-10\r
+dqrmn344 remaindernear   0.5   0.50000000001    ->  -1E-11\r
+dqrmn345 remaindernear   0.5   0.4999999    ->  1E-7\r
+dqrmn346 remaindernear   0.5   0.49999999    ->  1E-8\r
+dqrmn347 remaindernear   0.5   0.499999999    ->  1E-9\r
+dqrmn348 remaindernear   0.5   0.4999999999    ->  1E-10\r
+dqrmn349 remaindernear   0.5   0.49999999999    ->  1E-11\r
+dqrmn350 remaindernear   0.5   0.499999999999    ->  1E-12\r
+\r
+dqrmn351 remaindernear   0.03  7  ->  0.03\r
+dqrmn352 remaindernear   5   2    ->  1\r
+dqrmn353 remaindernear   4.1   2    ->  0.1\r
+dqrmn354 remaindernear   4.01   2    ->  0.01\r
+dqrmn355 remaindernear   4.001   2    ->  0.001\r
+dqrmn356 remaindernear   4.0001   2    ->  0.0001\r
+dqrmn357 remaindernear   4.00001   2    ->  0.00001\r
+dqrmn358 remaindernear   4.000001   2    ->  0.000001\r
+dqrmn359 remaindernear   4.0000001   2    ->  1E-7\r
+\r
+dqrmn360 remaindernear   1.2   0.7345 -> -0.2690\r
+dqrmn361 remaindernear   0.8   12     ->  0.8\r
+dqrmn362 remaindernear   0.8   0.2    ->  0.0\r
+dqrmn363 remaindernear   0.8   0.3    -> -0.1\r
+dqrmn364 remaindernear   0.800   12   ->  0.800\r
+dqrmn365 remaindernear   0.800   1.7  ->  0.800\r
+dqrmn366 remaindernear   2.400   2    ->  0.400\r
+\r
+-- round to even\r
+dqrmn371 remaindernear   121     2    ->  1\r
+dqrmn372 remaindernear   122     2    ->  0\r
+dqrmn373 remaindernear   123     2    -> -1\r
+dqrmn374 remaindernear   124     2    ->  0\r
+dqrmn375 remaindernear   125     2    ->  1\r
+dqrmn376 remaindernear   126     2    ->  0\r
+dqrmn377 remaindernear   127     2    -> -1\r
+\r
+dqrmn381 remaindernear 12345  1         ->  0\r
+dqrmn382 remaindernear 12345  1.0001    -> -0.2344\r
+dqrmn383 remaindernear 12345  1.001     -> -0.333\r
+dqrmn384 remaindernear 12345  1.01      -> -0.23\r
+dqrmn385 remaindernear 12345  1.1       -> -0.3\r
+dqrmn386 remaindernear 12355  4         -> -1\r
+dqrmn387 remaindernear 12345  4         ->  1\r
+dqrmn388 remaindernear 12355  4.0001    -> -1.3089\r
+dqrmn389 remaindernear 12345  4.0001    ->  0.6914\r
+dqrmn390 remaindernear 12345  4.9       ->  1.9\r
+dqrmn391 remaindernear 12345  4.99      -> -0.26\r
+dqrmn392 remaindernear 12345  4.999     ->  2.469\r
+dqrmn393 remaindernear 12345  4.9999    ->  0.2469\r
+dqrmn394 remaindernear 12345  5         ->  0\r
+dqrmn395 remaindernear 12345  5.0001    -> -0.2469\r
+dqrmn396 remaindernear 12345  5.001     -> -2.469\r
+dqrmn397 remaindernear 12345  5.01      ->  0.36\r
+dqrmn398 remaindernear 12345  5.1       -> -2.1\r
+\r
+-- the nasty division-by-1 cases\r
+dqrmn401 remaindernear   0.4         1   ->  0.4\r
+dqrmn402 remaindernear   0.45        1   ->  0.45\r
+dqrmn403 remaindernear   0.455       1   ->  0.455\r
+dqrmn404 remaindernear   0.4555      1   ->  0.4555\r
+dqrmn405 remaindernear   0.45555     1   ->  0.45555\r
+dqrmn406 remaindernear   0.455555    1   ->  0.455555\r
+dqrmn407 remaindernear   0.4555555   1   ->  0.4555555\r
+dqrmn408 remaindernear   0.45555555  1   ->  0.45555555\r
+dqrmn409 remaindernear   0.455555555 1   ->  0.455555555\r
+-- with spill... [412 exercises sticktab loop]\r
+dqrmn411 remaindernear   0.5         1   ->  0.5\r
+dqrmn412 remaindernear   0.55        1   -> -0.45\r
+dqrmn413 remaindernear   0.555       1   -> -0.445\r
+dqrmn414 remaindernear   0.5555      1   -> -0.4445\r
+dqrmn415 remaindernear   0.55555     1   -> -0.44445\r
+dqrmn416 remaindernear   0.555555    1   -> -0.444445\r
+dqrmn417 remaindernear   0.5555555   1   -> -0.4444445\r
+dqrmn418 remaindernear   0.55555555  1   -> -0.44444445\r
+dqrmn419 remaindernear   0.555555555 1   -> -0.444444445\r
+\r
+-- folddowns\r
+dqrmn421 remaindernear   1E+6144        1  ->   NaN Division_impossible\r
+dqrmn422 remaindernear   1E+6144  1E+6143  ->   0E+6111 Clamped\r
+dqrmn423 remaindernear   1E+6144  2E+6143  ->   0E+6111 Clamped\r
+dqrmn424 remaindernear   1E+6144  3E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped\r
+dqrmn425 remaindernear   1E+6144  4E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped\r
+dqrmn426 remaindernear   1E+6144  5E+6143  ->   0E+6111 Clamped\r
+dqrmn427 remaindernear   1E+6144  6E+6143  ->  -2.00000000000000000000000000000000E+6143 Clamped\r
+dqrmn428 remaindernear   1E+6144  7E+6143  ->   3.00000000000000000000000000000000E+6143 Clamped\r
+dqrmn429 remaindernear   1E+6144  8E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped\r
+dqrmn430 remaindernear   1E+6144  9E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped\r
+-- tinies\r
+dqrmn431 remaindernear   1E-6175  1E-6176  ->   0E-6176\r
+dqrmn432 remaindernear   1E-6175  2E-6176  ->   0E-6176\r
+dqrmn433 remaindernear   1E-6175  3E-6176  ->   1E-6176 Subnormal\r
+dqrmn434 remaindernear   1E-6175  4E-6176  ->   2E-6176 Subnormal\r
+dqrmn435 remaindernear   1E-6175  5E-6176  ->   0E-6176\r
+dqrmn436 remaindernear   1E-6175  6E-6176  ->  -2E-6176 Subnormal\r
+dqrmn437 remaindernear   1E-6175  7E-6176  ->   3E-6176 Subnormal\r
+dqrmn438 remaindernear   1E-6175  8E-6176  ->   2E-6176 Subnormal\r
+dqrmn439 remaindernear   1E-6175  9E-6176  ->   1E-6176 Subnormal\r
+dqrmn440 remaindernear   1E-6175 10E-6176  ->   0E-6176\r
+dqrmn441 remaindernear   1E-6175 11E-6176  ->  -1E-6176 Subnormal\r
+dqrmn442 remaindernear 100E-6175 11E-6176  ->  -1E-6176 Subnormal\r
+dqrmn443 remaindernear 100E-6175 20E-6176  ->   0E-6176\r
+dqrmn444 remaindernear 100E-6175 21E-6176  ->  -8E-6176 Subnormal\r
+dqrmn445 remaindernear 100E-6175 30E-6176  -> 1.0E-6175 Subnormal\r
+\r
+-- zero signs\r
+dqrmn650 remaindernear  1  1 ->  0\r
+dqrmn651 remaindernear -1  1 -> -0\r
+dqrmn652 remaindernear  1 -1 ->  0\r
+dqrmn653 remaindernear -1 -1 -> -0\r
+dqrmn654 remaindernear  0  1 ->  0\r
+dqrmn655 remaindernear -0  1 -> -0\r
+dqrmn656 remaindernear  0 -1 ->  0\r
+dqrmn657 remaindernear -0 -1 -> -0\r
+dqrmn658 remaindernear  0.00  1  ->  0.00\r
+dqrmn659 remaindernear -0.00  1  -> -0.00\r
+\r
+-- Specials\r
+dqrmn680 remaindernear  Inf  -Inf   ->  NaN Invalid_operation\r
+dqrmn681 remaindernear  Inf  -1000  ->  NaN Invalid_operation\r
+dqrmn682 remaindernear  Inf  -1     ->  NaN Invalid_operation\r
+dqrmn683 remaindernear  Inf   0     ->  NaN Invalid_operation\r
+dqrmn684 remaindernear  Inf  -0     ->  NaN Invalid_operation\r
+dqrmn685 remaindernear  Inf   1     ->  NaN Invalid_operation\r
+dqrmn686 remaindernear  Inf   1000  ->  NaN Invalid_operation\r
+dqrmn687 remaindernear  Inf   Inf   ->  NaN Invalid_operation\r
+dqrmn688 remaindernear -1000  Inf   -> -1000\r
+dqrmn689 remaindernear -Inf   Inf   ->  NaN Invalid_operation\r
+dqrmn691 remaindernear -1     Inf   -> -1\r
+dqrmn692 remaindernear  0     Inf   ->  0\r
+dqrmn693 remaindernear -0     Inf   -> -0\r
+dqrmn694 remaindernear  1     Inf   ->  1\r
+dqrmn695 remaindernear  1000  Inf   ->  1000\r
+dqrmn696 remaindernear  Inf   Inf   ->  NaN Invalid_operation\r
+\r
+dqrmn700 remaindernear -Inf  -Inf   ->  NaN Invalid_operation\r
+dqrmn701 remaindernear -Inf  -1000  ->  NaN Invalid_operation\r
+dqrmn702 remaindernear -Inf  -1     ->  NaN Invalid_operation\r
+dqrmn703 remaindernear -Inf  -0     ->  NaN Invalid_operation\r
+dqrmn704 remaindernear -Inf   0     ->  NaN Invalid_operation\r
+dqrmn705 remaindernear -Inf   1     ->  NaN Invalid_operation\r
+dqrmn706 remaindernear -Inf   1000  ->  NaN Invalid_operation\r
+dqrmn707 remaindernear -Inf   Inf   ->  NaN Invalid_operation\r
+dqrmn708 remaindernear -Inf  -Inf   ->  NaN Invalid_operation\r
+dqrmn709 remaindernear -1000  Inf   -> -1000\r
+dqrmn710 remaindernear -1    -Inf   -> -1\r
+dqrmn711 remaindernear -0    -Inf   -> -0\r
+dqrmn712 remaindernear  0    -Inf   ->  0\r
+dqrmn713 remaindernear  1    -Inf   ->  1\r
+dqrmn714 remaindernear  1000 -Inf   ->  1000\r
+dqrmn715 remaindernear  Inf  -Inf   ->  NaN Invalid_operation\r
+\r
+dqrmn721 remaindernear  NaN -Inf    ->  NaN\r
+dqrmn722 remaindernear  NaN -1000   ->  NaN\r
+dqrmn723 remaindernear  NaN -1      ->  NaN\r
+dqrmn724 remaindernear  NaN -0      ->  NaN\r
+dqrmn725 remaindernear -NaN  0      -> -NaN\r
+dqrmn726 remaindernear  NaN  1      ->  NaN\r
+dqrmn727 remaindernear  NaN  1000   ->  NaN\r
+dqrmn728 remaindernear  NaN  Inf    ->  NaN\r
+dqrmn729 remaindernear  NaN -NaN    ->  NaN\r
+dqrmn730 remaindernear -Inf  NaN    ->  NaN\r
+dqrmn731 remaindernear -1000 NaN    ->  NaN\r
+dqrmn732 remaindernear -1    NaN    ->  NaN\r
+dqrmn733 remaindernear -0   -NaN    -> -NaN\r
+dqrmn734 remaindernear  0    NaN    ->  NaN\r
+dqrmn735 remaindernear  1   -NaN    -> -NaN\r
+dqrmn736 remaindernear  1000 NaN    ->  NaN\r
+dqrmn737 remaindernear  Inf  NaN    ->  NaN\r
+\r
+dqrmn741 remaindernear  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqrmn742 remaindernear  sNaN -1000  ->  NaN  Invalid_operation\r
+dqrmn743 remaindernear -sNaN -1     -> -NaN  Invalid_operation\r
+dqrmn744 remaindernear  sNaN -0     ->  NaN  Invalid_operation\r
+dqrmn745 remaindernear  sNaN  0     ->  NaN  Invalid_operation\r
+dqrmn746 remaindernear  sNaN  1     ->  NaN  Invalid_operation\r
+dqrmn747 remaindernear  sNaN  1000  ->  NaN  Invalid_operation\r
+dqrmn749 remaindernear  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqrmn750 remaindernear  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqrmn751 remaindernear  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqrmn752 remaindernear -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqrmn753 remaindernear -1000 sNaN   ->  NaN  Invalid_operation\r
+dqrmn754 remaindernear -1    sNaN   ->  NaN  Invalid_operation\r
+dqrmn755 remaindernear -0    sNaN   ->  NaN  Invalid_operation\r
+dqrmn756 remaindernear  0    sNaN   ->  NaN  Invalid_operation\r
+dqrmn757 remaindernear  1    sNaN   ->  NaN  Invalid_operation\r
+dqrmn758 remaindernear  1000 sNaN   ->  NaN  Invalid_operation\r
+dqrmn759 remaindernear  Inf -sNaN   -> -NaN  Invalid_operation\r
+\r
+-- propaging NaNs\r
+dqrmn760 remaindernear  NaN1   NaN7   ->  NaN1\r
+dqrmn761 remaindernear sNaN2   NaN8   ->  NaN2 Invalid_operation\r
+dqrmn762 remaindernear  NaN3  sNaN9   ->  NaN9 Invalid_operation\r
+dqrmn763 remaindernear sNaN4  sNaN10  ->  NaN4 Invalid_operation\r
+dqrmn764 remaindernear    15   NaN11  ->  NaN11\r
+dqrmn765 remaindernear  NaN6   NaN12  ->  NaN6\r
+dqrmn766 remaindernear  Inf    NaN13  ->  NaN13\r
+dqrmn767 remaindernear  NaN14  -Inf   ->  NaN14\r
+dqrmn768 remaindernear    0    NaN15  ->  NaN15\r
+dqrmn769 remaindernear  NaN16   -0    ->  NaN16\r
+\r
+-- edge cases of impossible\r
+dqrmn770  remaindernear  1234500000000000000000067890123456  10    -> -4\r
+dqrmn771  remaindernear  1234500000000000000000067890123456   1    ->  0\r
+dqrmn772  remaindernear  1234500000000000000000067890123456   0.1  ->  NaN Division_impossible\r
+dqrmn773  remaindernear  1234500000000000000000067890123456   0.01 ->  NaN Division_impossible\r
+\r
+-- long operand checks\r
+dqrmn801 remaindernear 12345678000 100 -> 0\r
+dqrmn802 remaindernear 1 12345678000   -> 1\r
+dqrmn803 remaindernear 1234567800  10  -> 0\r
+dqrmn804 remaindernear 1 1234567800    -> 1\r
+dqrmn805 remaindernear 1234567890  10  -> 0\r
+dqrmn806 remaindernear 1 1234567890    -> 1\r
+dqrmn807 remaindernear 1234567891  10  -> 1\r
+dqrmn808 remaindernear 1 1234567891    -> 1\r
+dqrmn809 remaindernear 12345678901 100 -> 1\r
+dqrmn810 remaindernear 1 12345678901   -> 1\r
+dqrmn811 remaindernear 1234567896  10  -> -4\r
+dqrmn812 remaindernear 1 1234567896    -> 1\r
+\r
+dqrmn821 remaindernear 12345678000 100 -> 0\r
+dqrmn822 remaindernear 1 12345678000   -> 1\r
+dqrmn823 remaindernear 1234567800  10  -> 0\r
+dqrmn824 remaindernear 1 1234567800    -> 1\r
+dqrmn825 remaindernear 1234567890  10  -> 0\r
+dqrmn826 remaindernear 1 1234567890    -> 1\r
+dqrmn827 remaindernear 1234567891  10  -> 1\r
+dqrmn828 remaindernear 1 1234567891    -> 1\r
+dqrmn829 remaindernear 12345678901 100 -> 1\r
+dqrmn830 remaindernear 1 12345678901   -> 1\r
+dqrmn831 remaindernear 1234567896  10  -> -4\r
+dqrmn832 remaindernear 1 1234567896    -> 1\r
+\r
+-- from divideint\r
+dqrmn840 remaindernear  100000000.0   1  ->  0.0\r
+dqrmn841 remaindernear  100000000.4   1  ->  0.4\r
+dqrmn842 remaindernear  100000000.5   1  ->  0.5\r
+dqrmn843 remaindernear  100000000.9   1  -> -0.1\r
+dqrmn844 remaindernear  100000000.999 1  -> -0.001\r
+dqrmn850 remaindernear  100000003     5  -> -2\r
+dqrmn851 remaindernear  10000003      5  -> -2\r
+dqrmn852 remaindernear  1000003       5  -> -2\r
+dqrmn853 remaindernear  100003        5  -> -2\r
+dqrmn854 remaindernear  10003         5  -> -2\r
+dqrmn855 remaindernear  1003          5  -> -2\r
+dqrmn856 remaindernear  103           5  -> -2\r
+dqrmn857 remaindernear  13            5  -> -2\r
+dqrmn858 remaindernear  1             5  ->  1\r
+\r
+-- Vladimir's cases         1234567890123456\r
+dqrmn860 remaindernear 123.0e1 1000000000000000  -> 1230\r
+dqrmn861 remaindernear 1230    1000000000000000  -> 1230\r
+dqrmn862 remaindernear 12.3e2  1000000000000000  -> 1230\r
+dqrmn863 remaindernear 1.23e3  1000000000000000  -> 1230\r
+dqrmn864 remaindernear 123e1   1000000000000000  -> 1230\r
+dqrmn870 remaindernear 123e1    1000000000000000 -> 1230\r
+dqrmn871 remaindernear 123e1     100000000000000 -> 1230\r
+dqrmn872 remaindernear 123e1      10000000000000 -> 1230\r
+dqrmn873 remaindernear 123e1       1000000000000 -> 1230\r
+dqrmn874 remaindernear 123e1        100000000000 -> 1230\r
+dqrmn875 remaindernear 123e1         10000000000 -> 1230\r
+dqrmn876 remaindernear 123e1          1000000000 -> 1230\r
+dqrmn877 remaindernear 123e1           100000000 -> 1230\r
+dqrmn878 remaindernear 1230            100000000 -> 1230\r
+dqrmn879 remaindernear 123e1            10000000 -> 1230\r
+dqrmn880 remaindernear 123e1             1000000 -> 1230\r
+dqrmn881 remaindernear 123e1              100000 -> 1230\r
+dqrmn882 remaindernear 123e1               10000 -> 1230\r
+dqrmn883 remaindernear 123e1                1000 ->  230\r
+dqrmn884 remaindernear 123e1                 100 ->   30\r
+dqrmn885 remaindernear 123e1                  10 ->    0\r
+dqrmn886 remaindernear 123e1                   1 ->    0\r
+\r
+dqrmn890 remaindernear 123e1    2000000000000000 -> 1230\r
+dqrmn891 remaindernear 123e1     200000000000000 -> 1230\r
+dqrmn892 remaindernear 123e1      20000000000000 -> 1230\r
+dqrmn893 remaindernear 123e1       2000000000000 -> 1230\r
+dqrmn894 remaindernear 123e1        200000000000 -> 1230\r
+dqrmn895 remaindernear 123e1         20000000000 -> 1230\r
+dqrmn896 remaindernear 123e1          2000000000 -> 1230\r
+dqrmn897 remaindernear 123e1           200000000 -> 1230\r
+dqrmn899 remaindernear 123e1            20000000 -> 1230\r
+dqrmn900 remaindernear 123e1             2000000 -> 1230\r
+dqrmn901 remaindernear 123e1              200000 -> 1230\r
+dqrmn902 remaindernear 123e1               20000 -> 1230\r
+dqrmn903 remaindernear 123e1                2000 -> -770\r
+dqrmn904 remaindernear 123e1                 200 ->   30\r
+dqrmn905 remaindernear 123e1                  20 ->  -10\r
+dqrmn906 remaindernear 123e1                   2 ->    0\r
+\r
+dqrmn910 remaindernear 123e1    5000000000000000 -> 1230\r
+dqrmn911 remaindernear 123e1     500000000000000 -> 1230\r
+dqrmn912 remaindernear 123e1      50000000000000 -> 1230\r
+dqrmn913 remaindernear 123e1       5000000000000 -> 1230\r
+dqrmn914 remaindernear 123e1        500000000000 -> 1230\r
+dqrmn915 remaindernear 123e1         50000000000 -> 1230\r
+dqrmn916 remaindernear 123e1          5000000000 -> 1230\r
+dqrmn917 remaindernear 123e1           500000000 -> 1230\r
+dqrmn919 remaindernear 123e1            50000000 -> 1230\r
+dqrmn920 remaindernear 123e1             5000000 -> 1230\r
+dqrmn921 remaindernear 123e1              500000 -> 1230\r
+dqrmn922 remaindernear 123e1               50000 -> 1230\r
+dqrmn923 remaindernear 123e1                5000 -> 1230\r
+dqrmn924 remaindernear 123e1                 500 ->  230\r
+dqrmn925 remaindernear 123e1                  50 ->  -20\r
+dqrmn926 remaindernear 123e1                   5 ->    0\r
+\r
+dqrmn930 remaindernear 123e1    9000000000000000 -> 1230\r
+dqrmn931 remaindernear 123e1     900000000000000 -> 1230\r
+dqrmn932 remaindernear 123e1      90000000000000 -> 1230\r
+dqrmn933 remaindernear 123e1       9000000000000 -> 1230\r
+dqrmn934 remaindernear 123e1        900000000000 -> 1230\r
+dqrmn935 remaindernear 123e1         90000000000 -> 1230\r
+dqrmn936 remaindernear 123e1          9000000000 -> 1230\r
+dqrmn937 remaindernear 123e1           900000000 -> 1230\r
+dqrmn939 remaindernear 123e1            90000000 -> 1230\r
+dqrmn940 remaindernear 123e1             9000000 -> 1230\r
+dqrmn941 remaindernear 123e1              900000 -> 1230\r
+dqrmn942 remaindernear 123e1               90000 -> 1230\r
+dqrmn943 remaindernear 123e1                9000 -> 1230\r
+dqrmn944 remaindernear 123e1                 900 ->  330\r
+dqrmn945 remaindernear 123e1                  90 ->  -30\r
+dqrmn946 remaindernear 123e1                   9 ->   -3\r
+\r
+dqrmn950 remaindernear 123e1   1000000000000000 -> 1230\r
+dqrmn961 remaindernear 123e1   2999999999999999 -> 1230\r
+dqrmn962 remaindernear 123e1   3999999999999999 -> 1230\r
+dqrmn963 remaindernear 123e1   4999999999999999 -> 1230\r
+dqrmn964 remaindernear 123e1   5999999999999999 -> 1230\r
+dqrmn965 remaindernear 123e1   6999999999999999 -> 1230\r
+dqrmn966 remaindernear 123e1   7999999999999999 -> 1230\r
+dqrmn967 remaindernear 123e1   8999999999999999 -> 1230\r
+dqrmn968 remaindernear 123e1   9999999999999999 -> 1230\r
+dqrmn969 remaindernear 123e1   9876543210987654 -> 1230\r
+\r
+dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally\r
+\r
+-- overflow and underflow tests [from divide]\r
+dqrmn1051 remaindernear  1e+277  1e-311 ->  NaN Division_impossible\r
+dqrmn1052 remaindernear  1e+277 -1e-311 ->  NaN Division_impossible\r
+dqrmn1053 remaindernear -1e+277  1e-311 ->  NaN Division_impossible\r
+dqrmn1054 remaindernear -1e+277 -1e-311 ->  NaN Division_impossible\r
+dqrmn1055 remaindernear  1e-277  1e+311 ->  1E-277\r
+dqrmn1056 remaindernear  1e-277 -1e+311 ->  1E-277\r
+dqrmn1057 remaindernear -1e-277  1e+311 -> -1E-277\r
+dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277\r
+\r
+-- Gyuris example\r
+dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143\r
+\r
+-- Null tests\r
+dqrmn1000 remaindernear 10  # -> NaN Invalid_operation\r
+dqrmn1001 remaindernear  # 10 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/dqRotate.decTest b/Lib/test/decimaltestdata/dqRotate.decTest
new file mode 100644 (file)
index 0000000..f21813c
--- /dev/null
@@ -0,0 +1,298 @@
+------------------------------------------------------------------------\r
+-- dqRotate.decTest -- rotate decQuad coefficient left or right       --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqrot001 rotate                                   0    0  ->  0\r
+dqrot002 rotate                                   0    2  ->  0\r
+dqrot003 rotate                                   1    2  ->  100\r
+dqrot004 rotate                                   1   33  ->  1000000000000000000000000000000000\r
+dqrot005 rotate                                   1   34  ->  1\r
+dqrot006 rotate                                   1   -1  ->  1000000000000000000000000000000000\r
+dqrot007 rotate                                   0   -2  ->  0\r
+dqrot008 rotate  1234567890123456789012345678901234   -1  ->  4123456789012345678901234567890123\r
+dqrot009 rotate  1234567890123456789012345678901234   -33 ->  2345678901234567890123456789012341\r
+dqrot010 rotate  1234567890123456789012345678901234   -34 ->  1234567890123456789012345678901234\r
+dqrot011 rotate  9934567890123456789012345678901234   -33 ->  9345678901234567890123456789012349\r
+dqrot012 rotate  9934567890123456789012345678901234   -34 ->  9934567890123456789012345678901234\r
+\r
+-- rhs must be an integer\r
+dqrot015 rotate        1    1.5    -> NaN Invalid_operation\r
+dqrot016 rotate        1    1.0    -> NaN Invalid_operation\r
+dqrot017 rotate        1    0.1    -> NaN Invalid_operation\r
+dqrot018 rotate        1    0.0    -> NaN Invalid_operation\r
+dqrot019 rotate        1    1E+1   -> NaN Invalid_operation\r
+dqrot020 rotate        1    1E+99  -> NaN Invalid_operation\r
+dqrot021 rotate        1    Inf    -> NaN Invalid_operation\r
+dqrot022 rotate        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+dqrot025 rotate        1    -1000  -> NaN Invalid_operation\r
+dqrot026 rotate        1    -35    -> NaN Invalid_operation\r
+dqrot027 rotate        1     35    -> NaN Invalid_operation\r
+dqrot028 rotate        1     1000  -> NaN Invalid_operation\r
+\r
+-- full pattern\r
+dqrot030 rotate  1234567890123456789012345678901234         -34  -> 1234567890123456789012345678901234\r
+dqrot031 rotate  1234567890123456789012345678901234         -33  -> 2345678901234567890123456789012341\r
+dqrot032 rotate  1234567890123456789012345678901234         -32  -> 3456789012345678901234567890123412\r
+dqrot033 rotate  1234567890123456789012345678901234         -31  -> 4567890123456789012345678901234123\r
+dqrot034 rotate  1234567890123456789012345678901234         -30  -> 5678901234567890123456789012341234\r
+dqrot035 rotate  1234567890123456789012345678901234         -29  -> 6789012345678901234567890123412345\r
+dqrot036 rotate  1234567890123456789012345678901234         -28  -> 7890123456789012345678901234123456\r
+dqrot037 rotate  1234567890123456789012345678901234         -27  -> 8901234567890123456789012341234567\r
+dqrot038 rotate  1234567890123456789012345678901234         -26  -> 9012345678901234567890123412345678\r
+dqrot039 rotate  1234567890123456789012345678901234         -25  ->  123456789012345678901234123456789\r
+dqrot040 rotate  1234567890123456789012345678901234         -24  -> 1234567890123456789012341234567890\r
+dqrot041 rotate  1234567890123456789012345678901234         -23  -> 2345678901234567890123412345678901\r
+dqrot042 rotate  1234567890123456789012345678901234         -22  -> 3456789012345678901234123456789012\r
+dqrot043 rotate  1234567890123456789012345678901234         -21  -> 4567890123456789012341234567890123\r
+dqrot044 rotate  1234567890123456789012345678901234         -20  -> 5678901234567890123412345678901234\r
+dqrot045 rotate  1234567890123456789012345678901234         -19  -> 6789012345678901234123456789012345\r
+dqrot047 rotate  1234567890123456789012345678901234         -18  -> 7890123456789012341234567890123456\r
+dqrot048 rotate  1234567890123456789012345678901234         -17  -> 8901234567890123412345678901234567\r
+dqrot049 rotate  1234567890123456789012345678901234         -16  -> 9012345678901234123456789012345678\r
+dqrot050 rotate  1234567890123456789012345678901234         -15  ->  123456789012341234567890123456789\r
+dqrot051 rotate  1234567890123456789012345678901234         -14  -> 1234567890123412345678901234567890\r
+dqrot052 rotate  1234567890123456789012345678901234         -13  -> 2345678901234123456789012345678901\r
+dqrot053 rotate  1234567890123456789012345678901234         -12  -> 3456789012341234567890123456789012\r
+dqrot054 rotate  1234567890123456789012345678901234         -11  -> 4567890123412345678901234567890123\r
+dqrot055 rotate  1234567890123456789012345678901234         -10  -> 5678901234123456789012345678901234\r
+dqrot056 rotate  1234567890123456789012345678901234         -9   -> 6789012341234567890123456789012345\r
+dqrot057 rotate  1234567890123456789012345678901234         -8   -> 7890123412345678901234567890123456\r
+dqrot058 rotate  1234567890123456789012345678901234         -7   -> 8901234123456789012345678901234567\r
+dqrot059 rotate  1234567890123456789012345678901234         -6   -> 9012341234567890123456789012345678\r
+dqrot060 rotate  1234567890123456789012345678901234         -5   ->  123412345678901234567890123456789\r
+dqrot061 rotate  1234567890123456789012345678901234         -4   -> 1234123456789012345678901234567890\r
+dqrot062 rotate  1234567890123456789012345678901234         -3   -> 2341234567890123456789012345678901\r
+dqrot063 rotate  1234567890123456789012345678901234         -2   -> 3412345678901234567890123456789012\r
+dqrot064 rotate  1234567890123456789012345678901234         -1   -> 4123456789012345678901234567890123\r
+dqrot065 rotate  1234567890123456789012345678901234         -0   -> 1234567890123456789012345678901234\r
+\r
+dqrot066 rotate  1234567890123456789012345678901234         +0   -> 1234567890123456789012345678901234\r
+dqrot067 rotate  1234567890123456789012345678901234         +1   -> 2345678901234567890123456789012341\r
+dqrot068 rotate  1234567890123456789012345678901234         +2   -> 3456789012345678901234567890123412\r
+dqrot069 rotate  1234567890123456789012345678901234         +3   -> 4567890123456789012345678901234123\r
+dqrot070 rotate  1234567890123456789012345678901234         +4   -> 5678901234567890123456789012341234\r
+dqrot071 rotate  1234567890123456789012345678901234         +5   -> 6789012345678901234567890123412345\r
+dqrot072 rotate  1234567890123456789012345678901234         +6   -> 7890123456789012345678901234123456\r
+dqrot073 rotate  1234567890123456789012345678901234         +7   -> 8901234567890123456789012341234567\r
+dqrot074 rotate  1234567890123456789012345678901234         +8   -> 9012345678901234567890123412345678\r
+dqrot075 rotate  1234567890123456789012345678901234         +9   ->  123456789012345678901234123456789\r
+dqrot076 rotate  1234567890123456789012345678901234         +10  -> 1234567890123456789012341234567890\r
+dqrot077 rotate  1234567890123456789012345678901234         +11  -> 2345678901234567890123412345678901\r
+dqrot078 rotate  1234567890123456789012345678901234         +12  -> 3456789012345678901234123456789012\r
+dqrot079 rotate  1234567890123456789012345678901234         +13  -> 4567890123456789012341234567890123\r
+dqrot080 rotate  1234567890123456789012345678901234         +14  -> 5678901234567890123412345678901234\r
+dqrot081 rotate  1234567890123456789012345678901234         +15  -> 6789012345678901234123456789012345\r
+dqrot082 rotate  1234567890123456789012345678901234         +16  -> 7890123456789012341234567890123456\r
+dqrot083 rotate  1234567890123456789012345678901234         +17  -> 8901234567890123412345678901234567\r
+dqrot084 rotate  1234567890123456789012345678901234         +18  -> 9012345678901234123456789012345678\r
+dqrot085 rotate  1234567890123456789012345678901234         +19  ->  123456789012341234567890123456789\r
+dqrot086 rotate  1234567890123456789012345678901234         +20  -> 1234567890123412345678901234567890\r
+dqrot087 rotate  1234567890123456789012345678901234         +21  -> 2345678901234123456789012345678901\r
+dqrot088 rotate  1234567890123456789012345678901234         +22  -> 3456789012341234567890123456789012\r
+dqrot089 rotate  1234567890123456789012345678901234         +23  -> 4567890123412345678901234567890123\r
+dqrot090 rotate  1234567890123456789012345678901234         +24  -> 5678901234123456789012345678901234\r
+dqrot091 rotate  1234567890123456789012345678901234         +25  -> 6789012341234567890123456789012345\r
+dqrot092 rotate  1234567890123456789012345678901234         +26  -> 7890123412345678901234567890123456\r
+dqrot093 rotate  1234567890123456789012345678901234         +27  -> 8901234123456789012345678901234567\r
+dqrot094 rotate  1234567890123456789012345678901234         +28  -> 9012341234567890123456789012345678\r
+dqrot095 rotate  1234567890123456789012345678901234         +29  ->  123412345678901234567890123456789\r
+dqrot096 rotate  1234567890123456789012345678901234         +30  -> 1234123456789012345678901234567890\r
+dqrot097 rotate  1234567890123456789012345678901234         +31  -> 2341234567890123456789012345678901\r
+dqrot098 rotate  1234567890123456789012345678901234         +32  -> 3412345678901234567890123456789012\r
+dqrot099 rotate  1234567890123456789012345678901234         +33  -> 4123456789012345678901234567890123\r
+dqrot100 rotate  1234567890123456789012345678901234         +34  -> 1234567890123456789012345678901234\r
+\r
+-- zeros\r
+dqrot270 rotate  0E-10              +29   ->   0E-10\r
+dqrot271 rotate  0E-10              -29   ->   0E-10\r
+dqrot272 rotate  0.000              +29   ->   0.000\r
+dqrot273 rotate  0.000              -29   ->   0.000\r
+dqrot274 rotate  0E+10              +29   ->   0E+10\r
+dqrot275 rotate  0E+10              -29   ->   0E+10\r
+dqrot276 rotate -0E-10              +29   ->  -0E-10\r
+dqrot277 rotate -0E-10              -29   ->  -0E-10\r
+dqrot278 rotate -0.000              +29   ->  -0.000\r
+dqrot279 rotate -0.000              -29   ->  -0.000\r
+dqrot280 rotate -0E+10              +29   ->  -0E+10\r
+dqrot281 rotate -0E+10              -29   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqrot141 rotate  9.999999999999999999999999999999999E+6144     -1  -> 9.999999999999999999999999999999999E+6144\r
+dqrot142 rotate  9.999999999999999999999999999999999E+6144     -33 -> 9.999999999999999999999999999999999E+6144\r
+dqrot143 rotate  9.999999999999999999999999999999999E+6144      1  -> 9.999999999999999999999999999999999E+6144\r
+dqrot144 rotate  9.999999999999999999999999999999999E+6144      33 -> 9.999999999999999999999999999999999E+6144\r
+dqrot145 rotate  1E-6143                                       -1  -> 1.000000000000000000000000000000000E-6110\r
+dqrot146 rotate  1E-6143                                       -33 -> 1.0E-6142\r
+dqrot147 rotate  1E-6143                                        1  -> 1.0E-6142\r
+dqrot148 rotate  1E-6143                                        33 -> 1.000000000000000000000000000000000E-6110\r
+dqrot151 rotate  1.000000000000000000000000000000000E-6143     -1  -> 1.00000000000000000000000000000000E-6144\r
+dqrot152 rotate  1.000000000000000000000000000000000E-6143     -33 -> 1E-6176\r
+dqrot153 rotate  1.000000000000000000000000000000000E-6143      1  -> 1E-6176\r
+dqrot154 rotate  1.000000000000000000000000000000000E-6143      33 -> 1.00000000000000000000000000000000E-6144\r
+dqrot155 rotate  9.000000000000000000000000000000000E-6143     -1  -> 9.00000000000000000000000000000000E-6144\r
+dqrot156 rotate  9.000000000000000000000000000000000E-6143     -33 -> 9E-6176\r
+dqrot157 rotate  9.000000000000000000000000000000000E-6143      1  -> 9E-6176\r
+dqrot158 rotate  9.000000000000000000000000000000000E-6143      33 -> 9.00000000000000000000000000000000E-6144\r
+dqrot160 rotate  1E-6176                                       -1  -> 1.000000000000000000000000000000000E-6143\r
+dqrot161 rotate  1E-6176                                       -33 -> 1.0E-6175\r
+dqrot162 rotate  1E-6176                                        1  -> 1.0E-6175\r
+dqrot163 rotate  1E-6176                                        33 -> 1.000000000000000000000000000000000E-6143\r
+--  negatives\r
+dqrot171 rotate -9.999999999999999999999999999999999E+6144     -1  -> -9.999999999999999999999999999999999E+6144\r
+dqrot172 rotate -9.999999999999999999999999999999999E+6144     -33 -> -9.999999999999999999999999999999999E+6144\r
+dqrot173 rotate -9.999999999999999999999999999999999E+6144      1  -> -9.999999999999999999999999999999999E+6144\r
+dqrot174 rotate -9.999999999999999999999999999999999E+6144      33 -> -9.999999999999999999999999999999999E+6144\r
+dqrot175 rotate -1E-6143                                       -1  -> -1.000000000000000000000000000000000E-6110\r
+dqrot176 rotate -1E-6143                                       -33 -> -1.0E-6142\r
+dqrot177 rotate -1E-6143                                        1  -> -1.0E-6142\r
+dqrot178 rotate -1E-6143                                        33 -> -1.000000000000000000000000000000000E-6110\r
+dqrot181 rotate -1.000000000000000000000000000000000E-6143     -1  -> -1.00000000000000000000000000000000E-6144\r
+dqrot182 rotate -1.000000000000000000000000000000000E-6143     -33 -> -1E-6176\r
+dqrot183 rotate -1.000000000000000000000000000000000E-6143      1  -> -1E-6176\r
+dqrot184 rotate -1.000000000000000000000000000000000E-6143      33 -> -1.00000000000000000000000000000000E-6144\r
+dqrot185 rotate -9.000000000000000000000000000000000E-6143     -1  -> -9.00000000000000000000000000000000E-6144\r
+dqrot186 rotate -9.000000000000000000000000000000000E-6143     -33 -> -9E-6176\r
+dqrot187 rotate -9.000000000000000000000000000000000E-6143      1  -> -9E-6176\r
+dqrot188 rotate -9.000000000000000000000000000000000E-6143      33 -> -9.00000000000000000000000000000000E-6144\r
+dqrot190 rotate -1E-6176                                       -1  -> -1.000000000000000000000000000000000E-6143\r
+dqrot191 rotate -1E-6176                                       -33 -> -1.0E-6175\r
+dqrot192 rotate -1E-6176                                        1  -> -1.0E-6175\r
+dqrot193 rotate -1E-6176                                        33 -> -1.000000000000000000000000000000000E-6143\r
+\r
+-- more negatives (of sanities)\r
+dqrot201 rotate                                  -0    0  -> -0\r
+dqrot202 rotate                                  -0    2  -> -0\r
+dqrot203 rotate                                  -1    2  -> -100\r
+dqrot204 rotate                                  -1   33  -> -1000000000000000000000000000000000\r
+dqrot205 rotate                                  -1   34  -> -1\r
+dqrot206 rotate                                  -1   -1  -> -1000000000000000000000000000000000\r
+dqrot207 rotate                                  -0   -2  -> -0\r
+dqrot208 rotate -1234567890123456789012345678901234   -1  -> -4123456789012345678901234567890123\r
+dqrot209 rotate -1234567890123456789012345678901234   -33 -> -2345678901234567890123456789012341\r
+dqrot210 rotate -1234567890123456789012345678901234   -34 -> -1234567890123456789012345678901234\r
+dqrot211 rotate -9934567890123456789012345678901234   -33 -> -9345678901234567890123456789012349\r
+dqrot212 rotate -9934567890123456789012345678901234   -34 -> -9934567890123456789012345678901234\r
+\r
+\r
+-- Specials; NaNs are handled as usual\r
+dqrot781 rotate -Inf  -8     -> -Infinity\r
+dqrot782 rotate -Inf  -1     -> -Infinity\r
+dqrot783 rotate -Inf  -0     -> -Infinity\r
+dqrot784 rotate -Inf   0     -> -Infinity\r
+dqrot785 rotate -Inf   1     -> -Infinity\r
+dqrot786 rotate -Inf   8     -> -Infinity\r
+dqrot787 rotate -1000 -Inf   -> NaN Invalid_operation\r
+dqrot788 rotate -Inf  -Inf   -> NaN Invalid_operation\r
+dqrot789 rotate -1    -Inf   -> NaN Invalid_operation\r
+dqrot790 rotate -0    -Inf   -> NaN Invalid_operation\r
+dqrot791 rotate  0    -Inf   -> NaN Invalid_operation\r
+dqrot792 rotate  1    -Inf   -> NaN Invalid_operation\r
+dqrot793 rotate  1000 -Inf   -> NaN Invalid_operation\r
+dqrot794 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+dqrot800 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+dqrot801 rotate  Inf  -8     -> Infinity\r
+dqrot802 rotate  Inf  -1     -> Infinity\r
+dqrot803 rotate  Inf  -0     -> Infinity\r
+dqrot804 rotate  Inf   0     -> Infinity\r
+dqrot805 rotate  Inf   1     -> Infinity\r
+dqrot806 rotate  Inf   8     -> Infinity\r
+dqrot807 rotate  Inf   Inf   -> NaN Invalid_operation\r
+dqrot808 rotate -1000  Inf   -> NaN Invalid_operation\r
+dqrot809 rotate -Inf   Inf   -> NaN Invalid_operation\r
+dqrot810 rotate -1     Inf   -> NaN Invalid_operation\r
+dqrot811 rotate -0     Inf   -> NaN Invalid_operation\r
+dqrot812 rotate  0     Inf   -> NaN Invalid_operation\r
+dqrot813 rotate  1     Inf   -> NaN Invalid_operation\r
+dqrot814 rotate  1000  Inf   -> NaN Invalid_operation\r
+dqrot815 rotate  Inf   Inf   -> NaN Invalid_operation\r
+\r
+dqrot821 rotate  NaN -Inf    ->  NaN\r
+dqrot822 rotate  NaN -1000   ->  NaN\r
+dqrot823 rotate  NaN -1      ->  NaN\r
+dqrot824 rotate  NaN -0      ->  NaN\r
+dqrot825 rotate  NaN  0      ->  NaN\r
+dqrot826 rotate  NaN  1      ->  NaN\r
+dqrot827 rotate  NaN  1000   ->  NaN\r
+dqrot828 rotate  NaN  Inf    ->  NaN\r
+dqrot829 rotate  NaN  NaN    ->  NaN\r
+dqrot830 rotate -Inf  NaN    ->  NaN\r
+dqrot831 rotate -1000 NaN    ->  NaN\r
+dqrot832 rotate -1    NaN    ->  NaN\r
+dqrot833 rotate -0    NaN    ->  NaN\r
+dqrot834 rotate  0    NaN    ->  NaN\r
+dqrot835 rotate  1    NaN    ->  NaN\r
+dqrot836 rotate  1000 NaN    ->  NaN\r
+dqrot837 rotate  Inf  NaN    ->  NaN\r
+\r
+dqrot841 rotate  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqrot842 rotate  sNaN -1000  ->  NaN  Invalid_operation\r
+dqrot843 rotate  sNaN -1     ->  NaN  Invalid_operation\r
+dqrot844 rotate  sNaN -0     ->  NaN  Invalid_operation\r
+dqrot845 rotate  sNaN  0     ->  NaN  Invalid_operation\r
+dqrot846 rotate  sNaN  1     ->  NaN  Invalid_operation\r
+dqrot847 rotate  sNaN  1000  ->  NaN  Invalid_operation\r
+dqrot848 rotate  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqrot849 rotate  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqrot850 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqrot851 rotate -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqrot852 rotate -1000 sNaN   ->  NaN  Invalid_operation\r
+dqrot853 rotate -1    sNaN   ->  NaN  Invalid_operation\r
+dqrot854 rotate -0    sNaN   ->  NaN  Invalid_operation\r
+dqrot855 rotate  0    sNaN   ->  NaN  Invalid_operation\r
+dqrot856 rotate  1    sNaN   ->  NaN  Invalid_operation\r
+dqrot857 rotate  1000 sNaN   ->  NaN  Invalid_operation\r
+dqrot858 rotate  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqrot859 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqrot861 rotate  NaN1   -Inf    ->  NaN1\r
+dqrot862 rotate +NaN2   -1000   ->  NaN2\r
+dqrot863 rotate  NaN3    1000   ->  NaN3\r
+dqrot864 rotate  NaN4    Inf    ->  NaN4\r
+dqrot865 rotate  NaN5   +NaN6   ->  NaN5\r
+dqrot866 rotate -Inf     NaN7   ->  NaN7\r
+dqrot867 rotate -1000    NaN8   ->  NaN8\r
+dqrot868 rotate  1000    NaN9   ->  NaN9\r
+dqrot869 rotate  Inf    +NaN10  ->  NaN10\r
+dqrot871 rotate  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+dqrot872 rotate  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+dqrot873 rotate  sNaN13   1000  ->  NaN13  Invalid_operation\r
+dqrot874 rotate  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+dqrot875 rotate  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+dqrot876 rotate  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+dqrot877 rotate -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+dqrot878 rotate -1000    sNaN21 ->  NaN21  Invalid_operation\r
+dqrot879 rotate  1000    sNaN22 ->  NaN22  Invalid_operation\r
+dqrot880 rotate  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+dqrot881 rotate +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+dqrot882 rotate -NaN26    NaN28 -> -NaN26\r
+dqrot883 rotate -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+dqrot884 rotate  1000    -NaN30 -> -NaN30\r
+dqrot885 rotate  1000   -sNaN31 -> -NaN31  Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqSameQuantum.decTest b/Lib/test/decimaltestdata/dqSameQuantum.decTest
new file mode 100644 (file)
index 0000000..e7264cb
--- /dev/null
@@ -0,0 +1,389 @@
+------------------------------------------------------------------------\r
+-- dqSameQuantum.decTest -- check decQuad quantums match              --\r
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- All operands and results are decQuads.\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqsamq001 samequantum  0      0      ->  1\r
+dqsamq002 samequantum  0      1      ->  1\r
+dqsamq003 samequantum  1      0      ->  1\r
+dqsamq004 samequantum  1      1      ->  1\r
+\r
+dqsamq011 samequantum  10     1E+1   -> 0\r
+dqsamq012 samequantum  10E+1  10E+1  -> 1\r
+dqsamq013 samequantum  100    10E+1  -> 0\r
+dqsamq014 samequantum  100    1E+2   -> 0\r
+dqsamq015 samequantum  0.1    1E-2   -> 0\r
+dqsamq016 samequantum  0.1    1E-1   -> 1\r
+dqsamq017 samequantum  0.1    1E-0   -> 0\r
+dqsamq018 samequantum  999    999    -> 1\r
+dqsamq019 samequantum  999E-1 99.9   -> 1\r
+dqsamq020 samequantum  111E-1 22.2   -> 1\r
+dqsamq021 samequantum  111E-1 1234.2 -> 1\r
+\r
+-- zeros\r
+dqsamq030 samequantum  0.0    1.1    -> 1\r
+dqsamq031 samequantum  0.0    1.11   -> 0\r
+dqsamq032 samequantum  0.0    0      -> 0\r
+dqsamq033 samequantum  0.0    0.0    -> 1\r
+dqsamq034 samequantum  0.0    0.00   -> 0\r
+dqsamq035 samequantum  0E+1   0E+0   -> 0\r
+dqsamq036 samequantum  0E+1   0E+1   -> 1\r
+dqsamq037 samequantum  0E+1   0E+2   -> 0\r
+dqsamq038 samequantum  0E-17  0E-16  -> 0\r
+dqsamq039 samequantum  0E-17  0E-17  -> 1\r
+dqsamq040 samequantum  0E-17  0E-18  -> 0\r
+dqsamq041 samequantum  0E-17  0.0E-15 -> 0\r
+dqsamq042 samequantum  0E-17  0.0E-16 -> 1\r
+dqsamq043 samequantum  0E-17  0.0E-17 -> 0\r
+dqsamq044 samequantum -0E-17  0.0E-16 -> 1\r
+dqsamq045 samequantum  0E-17 -0.0E-17 -> 0\r
+dqsamq046 samequantum  0E-17 -0.0E-16 -> 1\r
+dqsamq047 samequantum -0E-17  0.0E-17 -> 0\r
+dqsamq048 samequantum -0E-17 -0.0E-16 -> 1\r
+dqsamq049 samequantum -0E-17 -0.0E-17 -> 0\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqsamq051 samequantum  9.99999999999999999999999999999999E+6144    9.99999999999999999999999999999999E+6144  -> 1\r
+dqsamq052 samequantum  1E-6143             1E-6143           -> 1\r
+dqsamq053 samequantum  1.00000000000000000000000000000000E-6143    1.00000000000000000000000000000000E-6143  -> 1\r
+dqsamq054 samequantum  1E-6176             1E-6176           -> 1\r
+dqsamq055 samequantum  9.99999999999999999999999999999999E+6144    9.99999999999999999999999999999999E+6144  -> 1\r
+dqsamq056 samequantum  1E-6143             1E-6143           -> 1\r
+dqsamq057 samequantum  1.00000000000000000000000000000000E-6143    1.00000000000000000000000000000000E-6143  -> 1\r
+dqsamq058 samequantum  1E-6176             1E-6176           -> 1\r
+\r
+dqsamq061 samequantum  -1E-6176            -1E-6176          -> 1\r
+dqsamq062 samequantum  -1.00000000000000000000000000000000E-6143   -1.00000000000000000000000000000000E-6143 -> 1\r
+dqsamq063 samequantum  -1E-6143            -1E-6143          -> 1\r
+dqsamq064 samequantum  -9.99999999999999999999999999999999E+6144   -9.99999999999999999999999999999999E+6144 -> 1\r
+dqsamq065 samequantum  -1E-6176            -1E-6176          -> 1\r
+dqsamq066 samequantum  -1.00000000000000000000000000000000E-6143   -1.00000000000000000000000000000000E-6143 -> 1\r
+dqsamq067 samequantum  -1E-6143            -1E-6143          -> 1\r
+dqsamq068 samequantum  -9.99999999999999999999999999999999E+6144   -9.99999999999999999999999999999999E+6144 -> 1\r
+\r
+dqsamq071 samequantum  -4E-6176            -1E-6176          -> 1\r
+dqsamq072 samequantum  -4.00000000000000000000000000000000E-6143   -1.00000000000000000000000000004000E-6143 -> 1\r
+dqsamq073 samequantum  -4E-6143            -1E-6143          -> 1\r
+dqsamq074 samequantum  -4.99999999999999999999999999999999E+6144   -9.99949999999999999999999999999999E+6144 -> 1\r
+dqsamq075 samequantum  -4E-6176            -1E-6176          -> 1\r
+dqsamq076 samequantum  -4.00000000000000000000000000000000E-6143   -1.00400000000000000000000000000000E-6143 -> 1\r
+dqsamq077 samequantum  -4E-6143            -1E-6143          -> 1\r
+dqsamq078 samequantum  -4.99999999999999999999999999999999E+6144   -9.94999999999999999999999999999999E+6144 -> 1\r
+\r
+dqsamq081 samequantum  -4E-1006           -1E-6176          -> 0\r
+dqsamq082 samequantum  -4.00000000000000000000000000000000E-6143   -1.00004000000000000000000000000000E-6136 -> 0\r
+dqsamq083 samequantum  -4E-6140           -1E-6143          -> 0\r
+dqsamq084 samequantum  -4.99999999999999999999999999999999E+6144   -9.99949999999999999999999999999999E+6136 -> 0\r
+dqsamq085 samequantum  -4E-1006           -1E-6176          -> 0\r
+dqsamq086 samequantum  -4.00000000000000000000000000000000E-6143   -1.00400000000000000000000000000000E-6136 -> 0\r
+dqsamq087 samequantum  -4E-6133           -1E-6143          -> 0\r
+dqsamq088 samequantum  -4.99999999999999999999999999999999E+6144   -9.94999999999999999999999999999999E+6136 -> 0\r
+\r
+-- specials & combinations\r
+dqsamq0110 samequantum  -Inf    -Inf   -> 1\r
+dqsamq0111 samequantum  -Inf     Inf   -> 1\r
+dqsamq0112 samequantum  -Inf     NaN   -> 0\r
+dqsamq0113 samequantum  -Inf    -7E+3  -> 0\r
+dqsamq0114 samequantum  -Inf    -7     -> 0\r
+dqsamq0115 samequantum  -Inf    -7E-3  -> 0\r
+dqsamq0116 samequantum  -Inf    -0E-3  -> 0\r
+dqsamq0117 samequantum  -Inf    -0     -> 0\r
+dqsamq0118 samequantum  -Inf    -0E+3  -> 0\r
+dqsamq0119 samequantum  -Inf     0E-3  -> 0\r
+dqsamq0120 samequantum  -Inf     0     -> 0\r
+dqsamq0121 samequantum  -Inf     0E+3  -> 0\r
+dqsamq0122 samequantum  -Inf     7E-3  -> 0\r
+dqsamq0123 samequantum  -Inf     7     -> 0\r
+dqsamq0124 samequantum  -Inf     7E+3  -> 0\r
+dqsamq0125 samequantum  -Inf     sNaN  -> 0\r
+\r
+dqsamq0210 samequantum   Inf    -Inf   -> 1\r
+dqsamq0211 samequantum   Inf     Inf   -> 1\r
+dqsamq0212 samequantum   Inf     NaN   -> 0\r
+dqsamq0213 samequantum   Inf    -7E+3  -> 0\r
+dqsamq0214 samequantum   Inf    -7     -> 0\r
+dqsamq0215 samequantum   Inf    -7E-3  -> 0\r
+dqsamq0216 samequantum   Inf    -0E-3  -> 0\r
+dqsamq0217 samequantum   Inf    -0     -> 0\r
+dqsamq0218 samequantum   Inf    -0E+3  -> 0\r
+dqsamq0219 samequantum   Inf     0E-3  -> 0\r
+dqsamq0220 samequantum   Inf     0     -> 0\r
+dqsamq0221 samequantum   Inf     0E+3  -> 0\r
+dqsamq0222 samequantum   Inf     7E-3  -> 0\r
+dqsamq0223 samequantum   Inf     7     -> 0\r
+dqsamq0224 samequantum   Inf     7E+3  -> 0\r
+dqsamq0225 samequantum   Inf     sNaN  -> 0\r
+\r
+dqsamq0310 samequantum   NaN    -Inf   -> 0\r
+dqsamq0311 samequantum   NaN     Inf   -> 0\r
+dqsamq0312 samequantum   NaN     NaN   -> 1\r
+dqsamq0313 samequantum   NaN    -7E+3  -> 0\r
+dqsamq0314 samequantum   NaN    -7     -> 0\r
+dqsamq0315 samequantum   NaN    -7E-3  -> 0\r
+dqsamq0316 samequantum   NaN    -0E-3  -> 0\r
+dqsamq0317 samequantum   NaN    -0     -> 0\r
+dqsamq0318 samequantum   NaN    -0E+3  -> 0\r
+dqsamq0319 samequantum   NaN     0E-3  -> 0\r
+dqsamq0320 samequantum   NaN     0     -> 0\r
+dqsamq0321 samequantum   NaN     0E+3  -> 0\r
+dqsamq0322 samequantum   NaN     7E-3  -> 0\r
+dqsamq0323 samequantum   NaN     7     -> 0\r
+dqsamq0324 samequantum   NaN     7E+3  -> 0\r
+dqsamq0325 samequantum   NaN     sNaN  -> 1\r
+\r
+dqsamq0410 samequantum  -7E+3    -Inf   -> 0\r
+dqsamq0411 samequantum  -7E+3     Inf   -> 0\r
+dqsamq0412 samequantum  -7E+3     NaN   -> 0\r
+dqsamq0413 samequantum  -7E+3    -7E+3  -> 1\r
+dqsamq0414 samequantum  -7E+3    -7     -> 0\r
+dqsamq0415 samequantum  -7E+3    -7E-3  -> 0\r
+dqsamq0416 samequantum  -7E+3    -0E-3  -> 0\r
+dqsamq0417 samequantum  -7E+3    -0     -> 0\r
+dqsamq0418 samequantum  -7E+3    -0E+3  -> 1\r
+dqsamq0419 samequantum  -7E+3     0E-3  -> 0\r
+dqsamq0420 samequantum  -7E+3     0     -> 0\r
+dqsamq0421 samequantum  -7E+3     0E+3  -> 1\r
+dqsamq0422 samequantum  -7E+3     7E-3  -> 0\r
+dqsamq0423 samequantum  -7E+3     7     -> 0\r
+dqsamq0424 samequantum  -7E+3     7E+3  -> 1\r
+dqsamq0425 samequantum  -7E+3     sNaN  -> 0\r
+\r
+dqsamq0510 samequantum  -7      -Inf   -> 0\r
+dqsamq0511 samequantum  -7       Inf   -> 0\r
+dqsamq0512 samequantum  -7       NaN   -> 0\r
+dqsamq0513 samequantum  -7      -7E+3  -> 0\r
+dqsamq0514 samequantum  -7      -7     -> 1\r
+dqsamq0515 samequantum  -7      -7E-3  -> 0\r
+dqsamq0516 samequantum  -7      -0E-3  -> 0\r
+dqsamq0517 samequantum  -7      -0     -> 1\r
+dqsamq0518 samequantum  -7      -0E+3  -> 0\r
+dqsamq0519 samequantum  -7       0E-3  -> 0\r
+dqsamq0520 samequantum  -7       0     -> 1\r
+dqsamq0521 samequantum  -7       0E+3  -> 0\r
+dqsamq0522 samequantum  -7       7E-3  -> 0\r
+dqsamq0523 samequantum  -7       7     -> 1\r
+dqsamq0524 samequantum  -7       7E+3  -> 0\r
+dqsamq0525 samequantum  -7       sNaN  -> 0\r
+\r
+dqsamq0610 samequantum  -7E-3    -Inf   -> 0\r
+dqsamq0611 samequantum  -7E-3     Inf   -> 0\r
+dqsamq0612 samequantum  -7E-3     NaN   -> 0\r
+dqsamq0613 samequantum  -7E-3    -7E+3  -> 0\r
+dqsamq0614 samequantum  -7E-3    -7     -> 0\r
+dqsamq0615 samequantum  -7E-3    -7E-3  -> 1\r
+dqsamq0616 samequantum  -7E-3    -0E-3  -> 1\r
+dqsamq0617 samequantum  -7E-3    -0     -> 0\r
+dqsamq0618 samequantum  -7E-3    -0E+3  -> 0\r
+dqsamq0619 samequantum  -7E-3     0E-3  -> 1\r
+dqsamq0620 samequantum  -7E-3     0     -> 0\r
+dqsamq0621 samequantum  -7E-3     0E+3  -> 0\r
+dqsamq0622 samequantum  -7E-3     7E-3  -> 1\r
+dqsamq0623 samequantum  -7E-3     7     -> 0\r
+dqsamq0624 samequantum  -7E-3     7E+3  -> 0\r
+dqsamq0625 samequantum  -7E-3     sNaN  -> 0\r
+\r
+dqsamq0710 samequantum  -0E-3    -Inf   -> 0\r
+dqsamq0711 samequantum  -0E-3     Inf   -> 0\r
+dqsamq0712 samequantum  -0E-3     NaN   -> 0\r
+dqsamq0713 samequantum  -0E-3    -7E+3  -> 0\r
+dqsamq0714 samequantum  -0E-3    -7     -> 0\r
+dqsamq0715 samequantum  -0E-3    -7E-3  -> 1\r
+dqsamq0716 samequantum  -0E-3    -0E-3  -> 1\r
+dqsamq0717 samequantum  -0E-3    -0     -> 0\r
+dqsamq0718 samequantum  -0E-3    -0E+3  -> 0\r
+dqsamq0719 samequantum  -0E-3     0E-3  -> 1\r
+dqsamq0720 samequantum  -0E-3     0     -> 0\r
+dqsamq0721 samequantum  -0E-3     0E+3  -> 0\r
+dqsamq0722 samequantum  -0E-3     7E-3  -> 1\r
+dqsamq0723 samequantum  -0E-3     7     -> 0\r
+dqsamq0724 samequantum  -0E-3     7E+3  -> 0\r
+dqsamq0725 samequantum  -0E-3     sNaN  -> 0\r
+\r
+dqsamq0810 samequantum  -0      -Inf   -> 0\r
+dqsamq0811 samequantum  -0       Inf   -> 0\r
+dqsamq0812 samequantum  -0       NaN   -> 0\r
+dqsamq0813 samequantum  -0      -7E+3  -> 0\r
+dqsamq0814 samequantum  -0      -7     -> 1\r
+dqsamq0815 samequantum  -0      -7E-3  -> 0\r
+dqsamq0816 samequantum  -0      -0E-3  -> 0\r
+dqsamq0817 samequantum  -0      -0     -> 1\r
+dqsamq0818 samequantum  -0      -0E+3  -> 0\r
+dqsamq0819 samequantum  -0       0E-3  -> 0\r
+dqsamq0820 samequantum  -0       0     -> 1\r
+dqsamq0821 samequantum  -0       0E+3  -> 0\r
+dqsamq0822 samequantum  -0       7E-3  -> 0\r
+dqsamq0823 samequantum  -0       7     -> 1\r
+dqsamq0824 samequantum  -0       7E+3  -> 0\r
+dqsamq0825 samequantum  -0       sNaN  -> 0\r
+\r
+dqsamq0910 samequantum  -0E+3    -Inf   -> 0\r
+dqsamq0911 samequantum  -0E+3     Inf   -> 0\r
+dqsamq0912 samequantum  -0E+3     NaN   -> 0\r
+dqsamq0913 samequantum  -0E+3    -7E+3  -> 1\r
+dqsamq0914 samequantum  -0E+3    -7     -> 0\r
+dqsamq0915 samequantum  -0E+3    -7E-3  -> 0\r
+dqsamq0916 samequantum  -0E+3    -0E-3  -> 0\r
+dqsamq0917 samequantum  -0E+3    -0     -> 0\r
+dqsamq0918 samequantum  -0E+3    -0E+3  -> 1\r
+dqsamq0919 samequantum  -0E+3     0E-3  -> 0\r
+dqsamq0920 samequantum  -0E+3     0     -> 0\r
+dqsamq0921 samequantum  -0E+3     0E+3  -> 1\r
+dqsamq0922 samequantum  -0E+3     7E-3  -> 0\r
+dqsamq0923 samequantum  -0E+3     7     -> 0\r
+dqsamq0924 samequantum  -0E+3     7E+3  -> 1\r
+dqsamq0925 samequantum  -0E+3     sNaN  -> 0\r
+\r
+dqsamq1110 samequantum  0E-3    -Inf   -> 0\r
+dqsamq1111 samequantum  0E-3     Inf   -> 0\r
+dqsamq1112 samequantum  0E-3     NaN   -> 0\r
+dqsamq1113 samequantum  0E-3    -7E+3  -> 0\r
+dqsamq1114 samequantum  0E-3    -7     -> 0\r
+dqsamq1115 samequantum  0E-3    -7E-3  -> 1\r
+dqsamq1116 samequantum  0E-3    -0E-3  -> 1\r
+dqsamq1117 samequantum  0E-3    -0     -> 0\r
+dqsamq1118 samequantum  0E-3    -0E+3  -> 0\r
+dqsamq1119 samequantum  0E-3     0E-3  -> 1\r
+dqsamq1120 samequantum  0E-3     0     -> 0\r
+dqsamq1121 samequantum  0E-3     0E+3  -> 0\r
+dqsamq1122 samequantum  0E-3     7E-3  -> 1\r
+dqsamq1123 samequantum  0E-3     7     -> 0\r
+dqsamq1124 samequantum  0E-3     7E+3  -> 0\r
+dqsamq1125 samequantum  0E-3     sNaN  -> 0\r
+\r
+dqsamq1210 samequantum  0       -Inf   -> 0\r
+dqsamq1211 samequantum  0        Inf   -> 0\r
+dqsamq1212 samequantum  0        NaN   -> 0\r
+dqsamq1213 samequantum  0       -7E+3  -> 0\r
+dqsamq1214 samequantum  0       -7     -> 1\r
+dqsamq1215 samequantum  0       -7E-3  -> 0\r
+dqsamq1216 samequantum  0       -0E-3  -> 0\r
+dqsamq1217 samequantum  0       -0     -> 1\r
+dqsamq1218 samequantum  0       -0E+3  -> 0\r
+dqsamq1219 samequantum  0        0E-3  -> 0\r
+dqsamq1220 samequantum  0        0     -> 1\r
+dqsamq1221 samequantum  0        0E+3  -> 0\r
+dqsamq1222 samequantum  0        7E-3  -> 0\r
+dqsamq1223 samequantum  0        7     -> 1\r
+dqsamq1224 samequantum  0        7E+3  -> 0\r
+dqsamq1225 samequantum  0        sNaN  -> 0\r
+\r
+dqsamq1310 samequantum  0E+3    -Inf   -> 0\r
+dqsamq1311 samequantum  0E+3     Inf   -> 0\r
+dqsamq1312 samequantum  0E+3     NaN   -> 0\r
+dqsamq1313 samequantum  0E+3    -7E+3  -> 1\r
+dqsamq1314 samequantum  0E+3    -7     -> 0\r
+dqsamq1315 samequantum  0E+3    -7E-3  -> 0\r
+dqsamq1316 samequantum  0E+3    -0E-3  -> 0\r
+dqsamq1317 samequantum  0E+3    -0     -> 0\r
+dqsamq1318 samequantum  0E+3    -0E+3  -> 1\r
+dqsamq1319 samequantum  0E+3     0E-3  -> 0\r
+dqsamq1320 samequantum  0E+3     0     -> 0\r
+dqsamq1321 samequantum  0E+3     0E+3  -> 1\r
+dqsamq1322 samequantum  0E+3     7E-3  -> 0\r
+dqsamq1323 samequantum  0E+3     7     -> 0\r
+dqsamq1324 samequantum  0E+3     7E+3  -> 1\r
+dqsamq1325 samequantum  0E+3     sNaN  -> 0\r
+\r
+dqsamq1410 samequantum  7E-3    -Inf   -> 0\r
+dqsamq1411 samequantum  7E-3     Inf   -> 0\r
+dqsamq1412 samequantum  7E-3     NaN   -> 0\r
+dqsamq1413 samequantum  7E-3    -7E+3  -> 0\r
+dqsamq1414 samequantum  7E-3    -7     -> 0\r
+dqsamq1415 samequantum  7E-3    -7E-3  -> 1\r
+dqsamq1416 samequantum  7E-3    -0E-3  -> 1\r
+dqsamq1417 samequantum  7E-3    -0     -> 0\r
+dqsamq1418 samequantum  7E-3    -0E+3  -> 0\r
+dqsamq1419 samequantum  7E-3     0E-3  -> 1\r
+dqsamq1420 samequantum  7E-3     0     -> 0\r
+dqsamq1421 samequantum  7E-3     0E+3  -> 0\r
+dqsamq1422 samequantum  7E-3     7E-3  -> 1\r
+dqsamq1423 samequantum  7E-3     7     -> 0\r
+dqsamq1424 samequantum  7E-3     7E+3  -> 0\r
+dqsamq1425 samequantum  7E-3     sNaN  -> 0\r
+\r
+dqsamq1510 samequantum  7      -Inf   -> 0\r
+dqsamq1511 samequantum  7       Inf   -> 0\r
+dqsamq1512 samequantum  7       NaN   -> 0\r
+dqsamq1513 samequantum  7      -7E+3  -> 0\r
+dqsamq1514 samequantum  7      -7     -> 1\r
+dqsamq1515 samequantum  7      -7E-3  -> 0\r
+dqsamq1516 samequantum  7      -0E-3  -> 0\r
+dqsamq1517 samequantum  7      -0     -> 1\r
+dqsamq1518 samequantum  7      -0E+3  -> 0\r
+dqsamq1519 samequantum  7       0E-3  -> 0\r
+dqsamq1520 samequantum  7       0     -> 1\r
+dqsamq1521 samequantum  7       0E+3  -> 0\r
+dqsamq1522 samequantum  7       7E-3  -> 0\r
+dqsamq1523 samequantum  7       7     -> 1\r
+dqsamq1524 samequantum  7       7E+3  -> 0\r
+dqsamq1525 samequantum  7       sNaN  -> 0\r
+\r
+dqsamq1610 samequantum  7E+3    -Inf   -> 0\r
+dqsamq1611 samequantum  7E+3     Inf   -> 0\r
+dqsamq1612 samequantum  7E+3     NaN   -> 0\r
+dqsamq1613 samequantum  7E+3    -7E+3  -> 1\r
+dqsamq1614 samequantum  7E+3    -7     -> 0\r
+dqsamq1615 samequantum  7E+3    -7E-3  -> 0\r
+dqsamq1616 samequantum  7E+3    -0E-3  -> 0\r
+dqsamq1617 samequantum  7E+3    -0     -> 0\r
+dqsamq1618 samequantum  7E+3    -0E+3  -> 1\r
+dqsamq1619 samequantum  7E+3     0E-3  -> 0\r
+dqsamq1620 samequantum  7E+3     0     -> 0\r
+dqsamq1621 samequantum  7E+3     0E+3  -> 1\r
+dqsamq1622 samequantum  7E+3     7E-3  -> 0\r
+dqsamq1623 samequantum  7E+3     7     -> 0\r
+dqsamq1624 samequantum  7E+3     7E+3  -> 1\r
+dqsamq1625 samequantum  7E+3     sNaN  -> 0\r
+\r
+dqsamq1710 samequantum  sNaN    -Inf   -> 0\r
+dqsamq1711 samequantum  sNaN     Inf   -> 0\r
+dqsamq1712 samequantum  sNaN     NaN   -> 1\r
+dqsamq1713 samequantum  sNaN    -7E+3  -> 0\r
+dqsamq1714 samequantum  sNaN    -7     -> 0\r
+dqsamq1715 samequantum  sNaN    -7E-3  -> 0\r
+dqsamq1716 samequantum  sNaN    -0E-3  -> 0\r
+dqsamq1717 samequantum  sNaN    -0     -> 0\r
+dqsamq1718 samequantum  sNaN    -0E+3  -> 0\r
+dqsamq1719 samequantum  sNaN     0E-3  -> 0\r
+dqsamq1720 samequantum  sNaN     0     -> 0\r
+dqsamq1721 samequantum  sNaN     0E+3  -> 0\r
+dqsamq1722 samequantum  sNaN     7E-3  -> 0\r
+dqsamq1723 samequantum  sNaN     7     -> 0\r
+dqsamq1724 samequantum  sNaN     7E+3  -> 0\r
+dqsamq1725 samequantum  sNaN     sNaN  -> 1\r
+-- noisy NaNs\r
+dqsamq1730 samequantum  sNaN3    sNaN3 -> 1\r
+dqsamq1731 samequantum  sNaN3    sNaN4 -> 1\r
+dqsamq1732 samequantum   NaN3     NaN3 -> 1\r
+dqsamq1733 samequantum   NaN3     NaN4 -> 1\r
+dqsamq1734 samequantum  sNaN3     3    -> 0\r
+dqsamq1735 samequantum   NaN3     3    -> 0\r
+dqsamq1736 samequantum      4    sNaN4 -> 0\r
+dqsamq1737 samequantum      3     NaN3 -> 0\r
+dqsamq1738 samequantum    Inf    sNaN4 -> 0\r
+dqsamq1739 samequantum   -Inf     NaN3 -> 0\r
+\r
diff --git a/Lib/test/decimaltestdata/dqScaleB.decTest b/Lib/test/decimaltestdata/dqScaleB.decTest
new file mode 100644 (file)
index 0000000..88a3f9d
--- /dev/null
@@ -0,0 +1,260 @@
+------------------------------------------------------------------------\r
+-- dqScalebB.decTest -- scale a decQuad by powers of 10               --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Max |rhs| is 2*(6144+34) = 12356\r
+\r
+-- Sanity checks\r
+dqscb001 scaleb       7.50   10 -> 7.50E+10\r
+dqscb002 scaleb       7.50    3 -> 7.50E+3\r
+dqscb003 scaleb       7.50    2 -> 750\r
+dqscb004 scaleb       7.50    1 -> 75.0\r
+dqscb005 scaleb       7.50    0 -> 7.50\r
+dqscb006 scaleb       7.50   -1 -> 0.750\r
+dqscb007 scaleb       7.50   -2 -> 0.0750\r
+dqscb008 scaleb       7.50  -10 -> 7.50E-10\r
+dqscb009 scaleb      -7.50    3 -> -7.50E+3\r
+dqscb010 scaleb      -7.50    2 -> -750\r
+dqscb011 scaleb      -7.50    1 -> -75.0\r
+dqscb012 scaleb      -7.50    0 -> -7.50\r
+dqscb013 scaleb      -7.50   -1 -> -0.750\r
+\r
+-- Infinities\r
+dqscb014 scaleb  Infinity   1 -> Infinity\r
+dqscb015 scaleb  -Infinity  2 -> -Infinity\r
+dqscb016 scaleb  Infinity  -1 -> Infinity\r
+dqscb017 scaleb  -Infinity -2 -> -Infinity\r
+\r
+-- Next two are somewhat undefined in 754r; treat as non-integer\r
+dqscb018 scaleb  10  Infinity -> NaN Invalid_operation\r
+dqscb019 scaleb  10 -Infinity -> NaN Invalid_operation\r
+\r
+-- NaNs are undefined in 754r; assume usual processing\r
+-- NaNs, 0 payload\r
+dqscb021 scaleb         NaN  1 -> NaN\r
+dqscb022 scaleb        -NaN -1 -> -NaN\r
+dqscb023 scaleb        sNaN  1 -> NaN Invalid_operation\r
+dqscb024 scaleb       -sNaN  1 -> -NaN Invalid_operation\r
+dqscb025 scaleb    4    NaN    -> NaN\r
+dqscb026 scaleb -Inf   -NaN    -> -NaN\r
+dqscb027 scaleb    4   sNaN    -> NaN Invalid_operation\r
+dqscb028 scaleb  Inf  -sNaN    -> -NaN Invalid_operation\r
+\r
+-- non-integer RHS\r
+dqscb030 scaleb  1.23    1    ->  12.3\r
+dqscb031 scaleb  1.23    1.00 ->  NaN Invalid_operation\r
+dqscb032 scaleb  1.23    1.1  ->  NaN Invalid_operation\r
+dqscb033 scaleb  1.23    1.01 ->  NaN Invalid_operation\r
+dqscb034 scaleb  1.23    0.01 ->  NaN Invalid_operation\r
+dqscb035 scaleb  1.23    0.11 ->  NaN Invalid_operation\r
+dqscb036 scaleb  1.23    0.999999999 ->  NaN Invalid_operation\r
+dqscb037 scaleb  1.23   -1    ->  0.123\r
+dqscb0614 scaleb  1.23   -1.00 ->  NaN Invalid_operation\r
+dqscb039 scaleb  1.23   -1.1  ->  NaN Invalid_operation\r
+dqscb040 scaleb  1.23   -1.01 ->  NaN Invalid_operation\r
+dqscb041 scaleb  1.23   -0.01 ->  NaN Invalid_operation\r
+dqscb042 scaleb  1.23   -0.11 ->  NaN Invalid_operation\r
+dqscb043 scaleb  1.23   -0.999999999 ->  NaN Invalid_operation\r
+dqscb044 scaleb  1.23    0.1         ->  NaN Invalid_operation\r
+dqscb045 scaleb  1.23    1E+1        ->  NaN Invalid_operation\r
+dqscb046 scaleb  1.23    1.1234E+6   ->  NaN Invalid_operation\r
+dqscb047 scaleb  1.23    1.123E+4    ->  NaN Invalid_operation\r
+\r
+-- out-of range RHS\r
+dqscb120 scaleb  1.23    12355       ->  Infinity Overflow Inexact Rounded\r
+dqscb121 scaleb  1.23    12356       ->  Infinity Overflow Inexact Rounded\r
+dqscb122 scaleb  1.23    12357       ->  NaN Invalid_operation\r
+dqscb123 scaleb  1.23    12358       ->  NaN Invalid_operation\r
+dqscb124 scaleb  1.23   -12355       ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqscb125 scaleb  1.23   -12356       ->  0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqscb126 scaleb  1.23   -12357       ->  NaN Invalid_operation\r
+dqscb127 scaleb  1.23   -12358       ->  NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+-- propagating NaNs\r
+dqscb861 scaleb  NaN01   -Inf     ->  NaN1\r
+dqscb862 scaleb -NaN02   -1000    -> -NaN2\r
+dqscb863 scaleb  NaN03    1000    ->  NaN3\r
+dqscb864 scaleb  NaN04    Inf     ->  NaN4\r
+dqscb865 scaleb  NaN05    NaN61   ->  NaN5\r
+dqscb866 scaleb -Inf     -NaN71   -> -NaN71\r
+dqscb867 scaleb -1000     NaN81   ->  NaN81\r
+dqscb868 scaleb  1000     NaN91   ->  NaN91\r
+dqscb869 scaleb  Inf      NaN101  ->  NaN101\r
+dqscb871 scaleb  sNaN011  -Inf    ->  NaN11  Invalid_operation\r
+dqscb872 scaleb  sNaN012  -1000   ->  NaN12  Invalid_operation\r
+dqscb873 scaleb -sNaN013   1000   -> -NaN13  Invalid_operation\r
+dqscb874 scaleb  sNaN014   NaN171 ->  NaN14  Invalid_operation\r
+dqscb875 scaleb  sNaN015  sNaN181 ->  NaN15  Invalid_operation\r
+dqscb876 scaleb  NaN016   sNaN191 ->  NaN191 Invalid_operation\r
+dqscb877 scaleb -Inf      sNaN201 ->  NaN201 Invalid_operation\r
+dqscb878 scaleb -1000     sNaN211 ->  NaN211 Invalid_operation\r
+dqscb879 scaleb  1000    -sNaN221 -> -NaN221 Invalid_operation\r
+dqscb880 scaleb  Inf      sNaN231 ->  NaN231 Invalid_operation\r
+dqscb881 scaleb  NaN025   sNaN241 ->  NaN241 Invalid_operation\r
+\r
+-- finites\r
+dqscb051 scaleb          7   -2  -> 0.07\r
+dqscb052 scaleb         -7   -2  -> -0.07\r
+dqscb053 scaleb         75   -2  -> 0.75\r
+dqscb054 scaleb        -75   -2  -> -0.75\r
+dqscb055 scaleb       7.50   -2  -> 0.0750\r
+dqscb056 scaleb      -7.50   -2  -> -0.0750\r
+dqscb057 scaleb       7.500  -2  -> 0.07500\r
+dqscb058 scaleb      -7.500  -2  -> -0.07500\r
+dqscb061 scaleb          7   -1  -> 0.7\r
+dqscb062 scaleb         -7   -1  -> -0.7\r
+dqscb063 scaleb         75   -1  -> 7.5\r
+dqscb064 scaleb        -75   -1  -> -7.5\r
+dqscb065 scaleb       7.50   -1  -> 0.750\r
+dqscb066 scaleb      -7.50   -1  -> -0.750\r
+dqscb067 scaleb       7.500  -1  -> 0.7500\r
+dqscb068 scaleb      -7.500  -1  -> -0.7500\r
+dqscb071 scaleb          7    0  -> 7\r
+dqscb072 scaleb         -7    0  -> -7\r
+dqscb073 scaleb         75    0  -> 75\r
+dqscb074 scaleb        -75    0  -> -75\r
+dqscb075 scaleb       7.50    0  -> 7.50\r
+dqscb076 scaleb      -7.50    0  -> -7.50\r
+dqscb077 scaleb       7.500   0  -> 7.500\r
+dqscb078 scaleb      -7.500   0  -> -7.500\r
+dqscb081 scaleb          7    1  -> 7E+1\r
+dqscb082 scaleb         -7    1  -> -7E+1\r
+dqscb083 scaleb         75    1  -> 7.5E+2\r
+dqscb084 scaleb        -75    1  -> -7.5E+2\r
+dqscb085 scaleb       7.50    1  -> 75.0\r
+dqscb086 scaleb      -7.50    1  -> -75.0\r
+dqscb087 scaleb       7.500   1  -> 75.00\r
+dqscb088 scaleb      -7.500   1  -> -75.00\r
+dqscb091 scaleb          7    2  -> 7E+2\r
+dqscb092 scaleb         -7    2  -> -7E+2\r
+dqscb093 scaleb         75    2  -> 7.5E+3\r
+dqscb094 scaleb        -75    2  -> -7.5E+3\r
+dqscb095 scaleb       7.50    2  -> 750\r
+dqscb096 scaleb      -7.50    2  -> -750\r
+dqscb097 scaleb       7.500   2  -> 750.0\r
+dqscb098 scaleb      -7.500   2  -> -750.0\r
+\r
+-- zeros\r
+dqscb111 scaleb          0  1 -> 0E+1\r
+dqscb112 scaleb         -0  2 -> -0E+2\r
+dqscb113 scaleb       0E+4  3 -> 0E+7\r
+dqscb114 scaleb      -0E+4  4 -> -0E+8\r
+dqscb115 scaleb     0.0000  5 -> 0E+1\r
+dqscb116 scaleb    -0.0000  6 -> -0E+2\r
+dqscb117 scaleb      0E-141 7 -> 0E-134\r
+dqscb118 scaleb     -0E-141 8 -> -0E-133\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqscb132 scaleb  9.999999999999999999999999999999999E+6144  +6144 -> Infinity    Overflow Inexact Rounded\r
+dqscb133 scaleb  9.999999999999999999999999999999999E+6144  +10 -> Infinity     Overflow Inexact Rounded\r
+dqscb134 scaleb  9.999999999999999999999999999999999E+6144  +1  -> Infinity     Overflow Inexact Rounded\r
+dqscb135 scaleb  9.999999999999999999999999999999999E+6144   0  -> 9.999999999999999999999999999999999E+6144\r
+dqscb136 scaleb  9.999999999999999999999999999999999E+6144  -1  -> 9.999999999999999999999999999999999E+6143\r
+dqscb137 scaleb  1E-6143           +1  -> 1E-6142\r
+dqscb1614 scaleb  1E-6143           -0  -> 1E-6143\r
+dqscb139 scaleb  1E-6143           -1  -> 1E-6144          Subnormal\r
+dqscb140 scaleb  1.000000000000000000000000000000000E-6143  +1  -> 1.000000000000000000000000000000000E-6142\r
+dqscb141 scaleb  1.000000000000000000000000000000000E-6143   0  -> 1.000000000000000000000000000000000E-6143\r
+dqscb142 scaleb  1.000000000000000000000000000000000E-6143  -1  -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded\r
+dqscb143 scaleb  1E-6176          +1  -> 1E-6175         Subnormal\r
+dqscb144 scaleb  1E-6176          -0  -> 1E-6176         Subnormal\r
+dqscb145 scaleb  1E-6176          -1  -> 0E-6176         Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dqscb150 scaleb  -1E-6176         +1  -> -1E-6175        Subnormal\r
+dqscb151 scaleb  -1E-6176         -0  -> -1E-6176        Subnormal\r
+dqscb152 scaleb  -1E-6176         -1  -> -0E-6176        Underflow Subnormal Inexact Rounded Clamped\r
+dqscb153 scaleb  -1.000000000000000000000000000000000E-6143 +1  -> -1.000000000000000000000000000000000E-6142\r
+dqscb154 scaleb  -1.000000000000000000000000000000000E-6143 +0  -> -1.000000000000000000000000000000000E-6143\r
+dqscb155 scaleb  -1.000000000000000000000000000000000E-6143 -1  -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded\r
+dqscb156 scaleb  -1E-6143          +1  -> -1E-6142\r
+dqscb157 scaleb  -1E-6143          -0  -> -1E-6143\r
+dqscb158 scaleb  -1E-6143          -1  -> -1E-6144          Subnormal\r
+dqscb159 scaleb  -9.999999999999999999999999999999999E+6144 +1  -> -Infinity        Overflow Inexact Rounded\r
+dqscb160 scaleb  -9.999999999999999999999999999999999E+6144 +0  -> -9.999999999999999999999999999999999E+6144\r
+dqscb161 scaleb  -9.999999999999999999999999999999999E+6144 -1  -> -9.999999999999999999999999999999999E+6143\r
+dqscb162 scaleb  -9E+6144          +1  -> -Infinity        Overflow Inexact Rounded\r
+dqscb163 scaleb  -1E+6144          +1  -> -Infinity        Overflow Inexact Rounded\r
+\r
+-- some Origami\r
+-- (these check that overflow is being done correctly)\r
+dqscb171 scaleb   1000E+6109  +1 -> 1.000E+6113\r
+dqscb172 scaleb   1000E+6110  +1 -> 1.000E+6114\r
+dqscb173 scaleb   1000E+6111  +1 -> 1.0000E+6115                    Clamped\r
+dqscb174 scaleb   1000E+6112  +1 -> 1.00000E+6116                   Clamped\r
+dqscb175 scaleb   1000E+6113  +1 -> 1.000000E+6117                  Clamped\r
+dqscb176 scaleb   1000E+6114  +1 -> 1.0000000E+6118                 Clamped\r
+dqscb177 scaleb   1000E+6131  +1 -> 1.000000000000000000000000E+6135                Clamped\r
+dqscb178 scaleb   1000E+6132  +1 -> 1.0000000000000000000000000E+6136               Clamped\r
+dqscb179 scaleb   1000E+6133  +1 -> 1.00000000000000000000000000E+6137              Clamped\r
+dqscb180 scaleb   1000E+6134  +1 -> 1.000000000000000000000000000E+6138             Clamped\r
+dqscb181 scaleb   1000E+6135  +1 -> 1.0000000000000000000000000000E+6139            Clamped\r
+dqscb182 scaleb   1000E+6136  +1 -> 1.00000000000000000000000000000E+6140           Clamped\r
+dqscb183 scaleb   1000E+6137  +1 -> 1.000000000000000000000000000000E+6141          Clamped\r
+dqscb184 scaleb   1000E+6138  +1 -> 1.0000000000000000000000000000000E+6142         Clamped\r
+dqscb185 scaleb   1000E+6139  +1 -> 1.00000000000000000000000000000000E+6143        Clamped\r
+dqscb186 scaleb   1000E+6140  +1 -> 1.000000000000000000000000000000000E+6144       Clamped\r
+dqscb187 scaleb   1000E+6141  +1 -> Infinity    Overflow Inexact Rounded\r
+\r
+-- and a few more subnormal truncations\r
+-- (these check that underflow is being done correctly)\r
+dqscb221 scaleb  1.000000000000000000000000000000000E-6143   0  -> 1.000000000000000000000000000000000E-6143\r
+dqscb222 scaleb  1.000000000000000000000000000000000E-6143  -1  -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded\r
+dqscb223 scaleb  1.000000000000000000000000000000000E-6143  -2  -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded\r
+dqscb224 scaleb  1.000000000000000000000000000000000E-6143  -3  -> 1.000000000000000000000000000000E-6146 Subnormal Rounded\r
+dqscb225 scaleb  1.000000000000000000000000000000000E-6143  -4  -> 1.00000000000000000000000000000E-6147 Subnormal Rounded\r
+dqscb226 scaleb  1.000000000000000000000000000000000E-6143  -5  -> 1.0000000000000000000000000000E-6148 Subnormal Rounded\r
+dqscb227 scaleb  1.000000000000000000000000000000000E-6143  -6  -> 1.000000000000000000000000000E-6149 Subnormal Rounded\r
+dqscb228 scaleb  1.000000000000000000000000000000000E-6143  -7  -> 1.00000000000000000000000000E-6150 Subnormal Rounded\r
+dqscb229 scaleb  1.000000000000000000000000000000000E-6143  -8  -> 1.0000000000000000000000000E-6151 Subnormal Rounded\r
+dqscb230 scaleb  1.000000000000000000000000000000000E-6143  -9  -> 1.000000000000000000000000E-6152 Subnormal Rounded\r
+dqscb231 scaleb  1.000000000000000000000000000000000E-6143  -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded\r
+dqscb232 scaleb  1.000000000000000000000000000000000E-6143  -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded\r
+dqscb233 scaleb  1.000000000000000000000000000000000E-6143  -12 -> 1.000000000000000000000E-6155 Subnormal Rounded\r
+dqscb234 scaleb  1.000000000000000000000000000000000E-6143  -13 -> 1.00000000000000000000E-6156 Subnormal Rounded\r
+dqscb235 scaleb  1.000000000000000000000000000000000E-6143  -14 -> 1.0000000000000000000E-6157 Subnormal Rounded\r
+dqscb236 scaleb  1.000000000000000000000000000000000E-6143  -15 -> 1.000000000000000000E-6158 Subnormal Rounded\r
+dqscb237 scaleb  1.000000000000000000000000000000000E-6143  -16 -> 1.00000000000000000E-6159 Subnormal Rounded\r
+dqscb238 scaleb  1.000000000000000000000000000000000E-6143  -17 -> 1.0000000000000000E-6160 Subnormal Rounded\r
+dqscb239 scaleb  1.000000000000000000000000000000000E-6143  -18 -> 1.000000000000000E-6161 Subnormal Rounded\r
+dqscb202 scaleb  1.000000000000000000000000000000000E-6143  -19 -> 1.00000000000000E-6162 Subnormal Rounded\r
+dqscb203 scaleb  1.000000000000000000000000000000000E-6143  -20 -> 1.0000000000000E-6163 Subnormal Rounded\r
+dqscb204 scaleb  1.000000000000000000000000000000000E-6143  -21 -> 1.000000000000E-6164 Subnormal Rounded\r
+dqscb205 scaleb  1.000000000000000000000000000000000E-6143  -22 -> 1.00000000000E-6165 Subnormal Rounded\r
+dqscb206 scaleb  1.000000000000000000000000000000000E-6143  -23 -> 1.0000000000E-6166 Subnormal Rounded\r
+dqscb207 scaleb  1.000000000000000000000000000000000E-6143  -24 -> 1.000000000E-6167 Subnormal Rounded\r
+dqscb208 scaleb  1.000000000000000000000000000000000E-6143  -25 -> 1.00000000E-6168 Subnormal Rounded\r
+dqscb209 scaleb  1.000000000000000000000000000000000E-6143  -26 -> 1.0000000E-6169 Subnormal Rounded\r
+dqscb210 scaleb  1.000000000000000000000000000000000E-6143  -27 -> 1.000000E-6170 Subnormal Rounded\r
+dqscb211 scaleb  1.000000000000000000000000000000000E-6143  -28 -> 1.00000E-6171 Subnormal Rounded\r
+dqscb212 scaleb  1.000000000000000000000000000000000E-6143  -29 -> 1.0000E-6172 Subnormal Rounded\r
+dqscb213 scaleb  1.000000000000000000000000000000000E-6143  -30 -> 1.000E-6173 Subnormal Rounded\r
+dqscb214 scaleb  1.000000000000000000000000000000000E-6143  -31 -> 1.00E-6174 Subnormal Rounded\r
+dqscb215 scaleb  1.000000000000000000000000000000000E-6143  -32 -> 1.0E-6175 Subnormal Rounded\r
+dqscb216 scaleb  1.000000000000000000000000000000000E-6143  -33 -> 1E-6176 Subnormal Rounded\r
+dqscb217 scaleb  1.000000000000000000000000000000000E-6143  -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
+dqscb218 scaleb  1.000000000000000000000000000000000E-6143  -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped\r
diff --git a/Lib/test/decimaltestdata/dqShift.decTest b/Lib/test/decimaltestdata/dqShift.decTest
new file mode 100644 (file)
index 0000000..e728ec5
--- /dev/null
@@ -0,0 +1,298 @@
+------------------------------------------------------------------------\r
+-- dqShift.decTest -- shift decQuad coefficient left or right         --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check\r
+dqshi001 shift                                   0    0  ->  0\r
+dqshi002 shift                                   0    2  ->  0\r
+dqshi003 shift                                   1    2  ->  100\r
+dqshi004 shift                                   1   33  ->  1000000000000000000000000000000000\r
+dqshi005 shift                                   1   34  ->  0\r
+dqshi006 shift                                   1   -1  ->  0\r
+dqshi007 shift                                   0   -2  ->  0\r
+dqshi008 shift  1234567890123456789012345678901234   -1  ->  123456789012345678901234567890123\r
+dqshi009 shift  1234567890123456789012345678901234   -33 ->  1\r
+dqshi010 shift  1234567890123456789012345678901234   -34 ->  0\r
+dqshi011 shift  9934567890123456789012345678901234   -33 ->  9\r
+dqshi012 shift  9934567890123456789012345678901234   -34 ->  0\r
+\r
+-- rhs must be an integer\r
+dqshi015 shift        1    1.5    -> NaN Invalid_operation\r
+dqshi016 shift        1    1.0    -> NaN Invalid_operation\r
+dqshi017 shift        1    0.1    -> NaN Invalid_operation\r
+dqshi018 shift        1    0.0    -> NaN Invalid_operation\r
+dqshi019 shift        1    1E+1   -> NaN Invalid_operation\r
+dqshi020 shift        1    1E+99  -> NaN Invalid_operation\r
+dqshi021 shift        1    Inf    -> NaN Invalid_operation\r
+dqshi022 shift        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+dqshi025 shift        1    -1000  -> NaN Invalid_operation\r
+dqshi026 shift        1    -35    -> NaN Invalid_operation\r
+dqshi027 shift        1     35    -> NaN Invalid_operation\r
+dqshi028 shift        1     1000  -> NaN Invalid_operation\r
+\r
+-- full shifting pattern\r
+dqshi030 shift  1234567890123456789012345678901234         -34  -> 0\r
+dqshi031 shift  1234567890123456789012345678901234         -33  -> 1\r
+dqshi032 shift  1234567890123456789012345678901234         -32  -> 12\r
+dqshi033 shift  1234567890123456789012345678901234         -31  -> 123\r
+dqshi034 shift  1234567890123456789012345678901234         -30  -> 1234\r
+dqshi035 shift  1234567890123456789012345678901234         -29  -> 12345\r
+dqshi036 shift  1234567890123456789012345678901234         -28  -> 123456\r
+dqshi037 shift  1234567890123456789012345678901234         -27  -> 1234567\r
+dqshi038 shift  1234567890123456789012345678901234         -26  -> 12345678\r
+dqshi039 shift  1234567890123456789012345678901234         -25  -> 123456789\r
+dqshi040 shift  1234567890123456789012345678901234         -24  -> 1234567890\r
+dqshi041 shift  1234567890123456789012345678901234         -23  -> 12345678901\r
+dqshi042 shift  1234567890123456789012345678901234         -22  -> 123456789012\r
+dqshi043 shift  1234567890123456789012345678901234         -21  -> 1234567890123\r
+dqshi044 shift  1234567890123456789012345678901234         -20  -> 12345678901234\r
+dqshi045 shift  1234567890123456789012345678901234         -19  -> 123456789012345\r
+dqshi047 shift  1234567890123456789012345678901234         -18  -> 1234567890123456\r
+dqshi048 shift  1234567890123456789012345678901234         -17  -> 12345678901234567\r
+dqshi049 shift  1234567890123456789012345678901234         -16  -> 123456789012345678\r
+dqshi050 shift  1234567890123456789012345678901234         -15  -> 1234567890123456789\r
+dqshi051 shift  1234567890123456789012345678901234         -14  -> 12345678901234567890\r
+dqshi052 shift  1234567890123456789012345678901234         -13  -> 123456789012345678901\r
+dqshi053 shift  1234567890123456789012345678901234         -12  -> 1234567890123456789012\r
+dqshi054 shift  1234567890123456789012345678901234         -11  -> 12345678901234567890123\r
+dqshi055 shift  1234567890123456789012345678901234         -10  -> 123456789012345678901234\r
+dqshi056 shift  1234567890123456789012345678901234         -9   -> 1234567890123456789012345\r
+dqshi057 shift  1234567890123456789012345678901234         -8   -> 12345678901234567890123456\r
+dqshi058 shift  1234567890123456789012345678901234         -7   -> 123456789012345678901234567\r
+dqshi059 shift  1234567890123456789012345678901234         -6   -> 1234567890123456789012345678\r
+dqshi060 shift  1234567890123456789012345678901234         -5   -> 12345678901234567890123456789\r
+dqshi061 shift  1234567890123456789012345678901234         -4   -> 123456789012345678901234567890\r
+dqshi062 shift  1234567890123456789012345678901234         -3   -> 1234567890123456789012345678901\r
+dqshi063 shift  1234567890123456789012345678901234         -2   -> 12345678901234567890123456789012\r
+dqshi064 shift  1234567890123456789012345678901234         -1   -> 123456789012345678901234567890123\r
+dqshi065 shift  1234567890123456789012345678901234         -0   -> 1234567890123456789012345678901234\r
+\r
+dqshi066 shift  1234567890123456789012345678901234         +0   -> 1234567890123456789012345678901234\r
+dqshi067 shift  1234567890123456789012345678901234         +1   -> 2345678901234567890123456789012340\r
+dqshi068 shift  1234567890123456789012345678901234         +2   -> 3456789012345678901234567890123400\r
+dqshi069 shift  1234567890123456789012345678901234         +3   -> 4567890123456789012345678901234000\r
+dqshi070 shift  1234567890123456789012345678901234         +4   -> 5678901234567890123456789012340000\r
+dqshi071 shift  1234567890123456789012345678901234         +5   -> 6789012345678901234567890123400000\r
+dqshi072 shift  1234567890123456789012345678901234         +6   -> 7890123456789012345678901234000000\r
+dqshi073 shift  1234567890123456789012345678901234         +7   -> 8901234567890123456789012340000000\r
+dqshi074 shift  1234567890123456789012345678901234         +8   -> 9012345678901234567890123400000000\r
+dqshi075 shift  1234567890123456789012345678901234         +9   ->  123456789012345678901234000000000\r
+dqshi076 shift  1234567890123456789012345678901234         +10  -> 1234567890123456789012340000000000\r
+dqshi077 shift  1234567890123456789012345678901234         +11  -> 2345678901234567890123400000000000\r
+dqshi078 shift  1234567890123456789012345678901234         +12  -> 3456789012345678901234000000000000\r
+dqshi079 shift  1234567890123456789012345678901234         +13  -> 4567890123456789012340000000000000\r
+dqshi080 shift  1234567890123456789012345678901234         +14  -> 5678901234567890123400000000000000\r
+dqshi081 shift  1234567890123456789012345678901234         +15  -> 6789012345678901234000000000000000\r
+dqshi082 shift  1234567890123456789012345678901234         +16  -> 7890123456789012340000000000000000\r
+dqshi083 shift  1234567890123456789012345678901234         +17  -> 8901234567890123400000000000000000\r
+dqshi084 shift  1234567890123456789012345678901234         +18  -> 9012345678901234000000000000000000\r
+dqshi085 shift  1234567890123456789012345678901234         +19  ->  123456789012340000000000000000000\r
+dqshi086 shift  1234567890123456789012345678901234         +20  -> 1234567890123400000000000000000000\r
+dqshi087 shift  1234567890123456789012345678901234         +21  -> 2345678901234000000000000000000000\r
+dqshi088 shift  1234567890123456789012345678901234         +22  -> 3456789012340000000000000000000000\r
+dqshi089 shift  1234567890123456789012345678901234         +23  -> 4567890123400000000000000000000000\r
+dqshi090 shift  1234567890123456789012345678901234         +24  -> 5678901234000000000000000000000000\r
+dqshi091 shift  1234567890123456789012345678901234         +25  -> 6789012340000000000000000000000000\r
+dqshi092 shift  1234567890123456789012345678901234         +26  -> 7890123400000000000000000000000000\r
+dqshi093 shift  1234567890123456789012345678901234         +27  -> 8901234000000000000000000000000000\r
+dqshi094 shift  1234567890123456789012345678901234         +28  -> 9012340000000000000000000000000000\r
+dqshi095 shift  1234567890123456789012345678901234         +29  ->  123400000000000000000000000000000\r
+dqshi096 shift  1234567890123456789012345678901234         +30  -> 1234000000000000000000000000000000\r
+dqshi097 shift  1234567890123456789012345678901234         +31  -> 2340000000000000000000000000000000\r
+dqshi098 shift  1234567890123456789012345678901234         +32  -> 3400000000000000000000000000000000\r
+dqshi099 shift  1234567890123456789012345678901234         +33  -> 4000000000000000000000000000000000\r
+dqshi100 shift  1234567890123456789012345678901234         +34  -> 0\r
+\r
+-- zeros\r
+dqshi270 shift  0E-10              +29   ->   0E-10\r
+dqshi271 shift  0E-10              -29   ->   0E-10\r
+dqshi272 shift  0.000              +29   ->   0.000\r
+dqshi273 shift  0.000              -29   ->   0.000\r
+dqshi274 shift  0E+10              +29   ->   0E+10\r
+dqshi275 shift  0E+10              -29   ->   0E+10\r
+dqshi276 shift -0E-10              +29   ->  -0E-10\r
+dqshi277 shift -0E-10              -29   ->  -0E-10\r
+dqshi278 shift -0.000              +29   ->  -0.000\r
+dqshi279 shift -0.000              -29   ->  -0.000\r
+dqshi280 shift -0E+10              +29   ->  -0E+10\r
+dqshi281 shift -0E+10              -29   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+dqshi141 shift  9.999999999999999999999999999999999E+6144     -1  -> 9.99999999999999999999999999999999E+6143\r
+dqshi142 shift  9.999999999999999999999999999999999E+6144     -33 -> 9E+6111\r
+dqshi143 shift  9.999999999999999999999999999999999E+6144      1  -> 9.999999999999999999999999999999990E+6144\r
+dqshi144 shift  9.999999999999999999999999999999999E+6144      33 -> 9.000000000000000000000000000000000E+6144\r
+dqshi145 shift  1E-6143                                       -1  -> 0E-6143\r
+dqshi146 shift  1E-6143                                       -33 -> 0E-6143\r
+dqshi147 shift  1E-6143                                        1  -> 1.0E-6142\r
+dqshi148 shift  1E-6143                                        33 -> 1.000000000000000000000000000000000E-6110\r
+dqshi151 shift  1.000000000000000000000000000000000E-6143     -1  -> 1.00000000000000000000000000000000E-6144\r
+dqshi152 shift  1.000000000000000000000000000000000E-6143     -33 -> 1E-6176\r
+dqshi153 shift  1.000000000000000000000000000000000E-6143      1  -> 0E-6176\r
+dqshi154 shift  1.000000000000000000000000000000000E-6143      33 -> 0E-6176\r
+dqshi155 shift  9.000000000000000000000000000000000E-6143     -1  -> 9.00000000000000000000000000000000E-6144\r
+dqshi156 shift  9.000000000000000000000000000000000E-6143     -33 -> 9E-6176\r
+dqshi157 shift  9.000000000000000000000000000000000E-6143      1  -> 0E-6176\r
+dqshi158 shift  9.000000000000000000000000000000000E-6143      33 -> 0E-6176\r
+dqshi160 shift  1E-6176                                       -1  -> 0E-6176\r
+dqshi161 shift  1E-6176                                       -33 -> 0E-6176\r
+dqshi162 shift  1E-6176                                        1  -> 1.0E-6175\r
+dqshi163 shift  1E-6176                                        33 -> 1.000000000000000000000000000000000E-6143\r
+--  negatives\r
+dqshi171 shift -9.999999999999999999999999999999999E+6144     -1  -> -9.99999999999999999999999999999999E+6143\r
+dqshi172 shift -9.999999999999999999999999999999999E+6144     -33 -> -9E+6111\r
+dqshi173 shift -9.999999999999999999999999999999999E+6144      1  -> -9.999999999999999999999999999999990E+6144\r
+dqshi174 shift -9.999999999999999999999999999999999E+6144      33 -> -9.000000000000000000000000000000000E+6144\r
+dqshi175 shift -1E-6143                                       -1  -> -0E-6143\r
+dqshi176 shift -1E-6143                                       -33 -> -0E-6143\r
+dqshi177 shift -1E-6143                                        1  -> -1.0E-6142\r
+dqshi178 shift -1E-6143                                        33 -> -1.000000000000000000000000000000000E-6110\r
+dqshi181 shift -1.000000000000000000000000000000000E-6143     -1  -> -1.00000000000000000000000000000000E-6144\r
+dqshi182 shift -1.000000000000000000000000000000000E-6143     -33 -> -1E-6176\r
+dqshi183 shift -1.000000000000000000000000000000000E-6143      1  -> -0E-6176\r
+dqshi184 shift -1.000000000000000000000000000000000E-6143      33 -> -0E-6176\r
+dqshi185 shift -9.000000000000000000000000000000000E-6143     -1  -> -9.00000000000000000000000000000000E-6144\r
+dqshi186 shift -9.000000000000000000000000000000000E-6143     -33 -> -9E-6176\r
+dqshi187 shift -9.000000000000000000000000000000000E-6143      1  -> -0E-6176\r
+dqshi188 shift -9.000000000000000000000000000000000E-6143      33 -> -0E-6176\r
+dqshi190 shift -1E-6176                                       -1  -> -0E-6176\r
+dqshi191 shift -1E-6176                                       -33 -> -0E-6176\r
+dqshi192 shift -1E-6176                                        1  -> -1.0E-6175\r
+dqshi193 shift -1E-6176                                        33 -> -1.000000000000000000000000000000000E-6143\r
+\r
+-- more negatives (of sanities)\r
+dqshi201 shift                                  -0    0  -> -0\r
+dqshi202 shift                                  -0    2  -> -0\r
+dqshi203 shift                                  -1    2  -> -100\r
+dqshi204 shift                                  -1   33  -> -1000000000000000000000000000000000\r
+dqshi205 shift                                  -1   34  -> -0\r
+dqshi206 shift                                  -1   -1  -> -0\r
+dqshi207 shift                                  -0   -2  -> -0\r
+dqshi208 shift -1234567890123456789012345678901234   -1  -> -123456789012345678901234567890123\r
+dqshi209 shift -1234567890123456789012345678901234   -33 -> -1\r
+dqshi210 shift -1234567890123456789012345678901234   -34 -> -0\r
+dqshi211 shift -9934567890123456789012345678901234   -33 -> -9\r
+dqshi212 shift -9934567890123456789012345678901234   -34 -> -0\r
+\r
+\r
+-- Specials; NaNs are handled as usual\r
+dqshi781 shift -Inf  -8     -> -Infinity\r
+dqshi782 shift -Inf  -1     -> -Infinity\r
+dqshi783 shift -Inf  -0     -> -Infinity\r
+dqshi784 shift -Inf   0     -> -Infinity\r
+dqshi785 shift -Inf   1     -> -Infinity\r
+dqshi786 shift -Inf   8     -> -Infinity\r
+dqshi787 shift -1000 -Inf   -> NaN Invalid_operation\r
+dqshi788 shift -Inf  -Inf   -> NaN Invalid_operation\r
+dqshi789 shift -1    -Inf   -> NaN Invalid_operation\r
+dqshi790 shift -0    -Inf   -> NaN Invalid_operation\r
+dqshi791 shift  0    -Inf   -> NaN Invalid_operation\r
+dqshi792 shift  1    -Inf   -> NaN Invalid_operation\r
+dqshi793 shift  1000 -Inf   -> NaN Invalid_operation\r
+dqshi794 shift  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+dqshi800 shift  Inf  -Inf   -> NaN Invalid_operation\r
+dqshi801 shift  Inf  -8     -> Infinity\r
+dqshi802 shift  Inf  -1     -> Infinity\r
+dqshi803 shift  Inf  -0     -> Infinity\r
+dqshi804 shift  Inf   0     -> Infinity\r
+dqshi805 shift  Inf   1     -> Infinity\r
+dqshi806 shift  Inf   8     -> Infinity\r
+dqshi807 shift  Inf   Inf   -> NaN Invalid_operation\r
+dqshi808 shift -1000  Inf   -> NaN Invalid_operation\r
+dqshi809 shift -Inf   Inf   -> NaN Invalid_operation\r
+dqshi810 shift -1     Inf   -> NaN Invalid_operation\r
+dqshi811 shift -0     Inf   -> NaN Invalid_operation\r
+dqshi812 shift  0     Inf   -> NaN Invalid_operation\r
+dqshi813 shift  1     Inf   -> NaN Invalid_operation\r
+dqshi814 shift  1000  Inf   -> NaN Invalid_operation\r
+dqshi815 shift  Inf   Inf   -> NaN Invalid_operation\r
+\r
+dqshi821 shift  NaN -Inf    ->  NaN\r
+dqshi822 shift  NaN -1000   ->  NaN\r
+dqshi823 shift  NaN -1      ->  NaN\r
+dqshi824 shift  NaN -0      ->  NaN\r
+dqshi825 shift  NaN  0      ->  NaN\r
+dqshi826 shift  NaN  1      ->  NaN\r
+dqshi827 shift  NaN  1000   ->  NaN\r
+dqshi828 shift  NaN  Inf    ->  NaN\r
+dqshi829 shift  NaN  NaN    ->  NaN\r
+dqshi830 shift -Inf  NaN    ->  NaN\r
+dqshi831 shift -1000 NaN    ->  NaN\r
+dqshi832 shift -1    NaN    ->  NaN\r
+dqshi833 shift -0    NaN    ->  NaN\r
+dqshi834 shift  0    NaN    ->  NaN\r
+dqshi835 shift  1    NaN    ->  NaN\r
+dqshi836 shift  1000 NaN    ->  NaN\r
+dqshi837 shift  Inf  NaN    ->  NaN\r
+\r
+dqshi841 shift  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqshi842 shift  sNaN -1000  ->  NaN  Invalid_operation\r
+dqshi843 shift  sNaN -1     ->  NaN  Invalid_operation\r
+dqshi844 shift  sNaN -0     ->  NaN  Invalid_operation\r
+dqshi845 shift  sNaN  0     ->  NaN  Invalid_operation\r
+dqshi846 shift  sNaN  1     ->  NaN  Invalid_operation\r
+dqshi847 shift  sNaN  1000  ->  NaN  Invalid_operation\r
+dqshi848 shift  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqshi849 shift  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqshi850 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqshi851 shift -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqshi852 shift -1000 sNaN   ->  NaN  Invalid_operation\r
+dqshi853 shift -1    sNaN   ->  NaN  Invalid_operation\r
+dqshi854 shift -0    sNaN   ->  NaN  Invalid_operation\r
+dqshi855 shift  0    sNaN   ->  NaN  Invalid_operation\r
+dqshi856 shift  1    sNaN   ->  NaN  Invalid_operation\r
+dqshi857 shift  1000 sNaN   ->  NaN  Invalid_operation\r
+dqshi858 shift  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqshi859 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqshi861 shift  NaN1   -Inf    ->  NaN1\r
+dqshi862 shift +NaN2   -1000   ->  NaN2\r
+dqshi863 shift  NaN3    1000   ->  NaN3\r
+dqshi864 shift  NaN4    Inf    ->  NaN4\r
+dqshi865 shift  NaN5   +NaN6   ->  NaN5\r
+dqshi866 shift -Inf     NaN7   ->  NaN7\r
+dqshi867 shift -1000    NaN8   ->  NaN8\r
+dqshi868 shift  1000    NaN9   ->  NaN9\r
+dqshi869 shift  Inf    +NaN10  ->  NaN10\r
+dqshi871 shift  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+dqshi872 shift  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+dqshi873 shift  sNaN13   1000  ->  NaN13  Invalid_operation\r
+dqshi874 shift  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+dqshi875 shift  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+dqshi876 shift  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+dqshi877 shift -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+dqshi878 shift -1000    sNaN21 ->  NaN21  Invalid_operation\r
+dqshi879 shift  1000    sNaN22 ->  NaN22  Invalid_operation\r
+dqshi880 shift  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+dqshi881 shift +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+dqshi882 shift -NaN26    NaN28 -> -NaN26\r
+dqshi883 shift -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+dqshi884 shift  1000    -NaN30 -> -NaN30\r
+dqshi885 shift  1000   -sNaN31 -> -NaN31  Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqSubtract.decTest b/Lib/test/decimaltestdata/dqSubtract.decTest
new file mode 100644 (file)
index 0000000..923742c
--- /dev/null
@@ -0,0 +1,635 @@
+------------------------------------------------------------------------\r
+-- dqSubtract.decTest -- decQuad subtraction                          --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests are for decQuads only; all arguments are\r
+-- representable in a decQuad\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- [first group are 'quick confidence check']\r
+dqsub001 subtract  0   0  -> '0'\r
+dqsub002 subtract  1   1  -> '0'\r
+dqsub003 subtract  1   2  -> '-1'\r
+dqsub004 subtract  2   1  -> '1'\r
+dqsub005 subtract  2   2  -> '0'\r
+dqsub006 subtract  3   2  -> '1'\r
+dqsub007 subtract  2   3  -> '-1'\r
+\r
+dqsub011 subtract -0   0  -> '-0'\r
+dqsub012 subtract -1   1  -> '-2'\r
+dqsub013 subtract -1   2  -> '-3'\r
+dqsub014 subtract -2   1  -> '-3'\r
+dqsub015 subtract -2   2  -> '-4'\r
+dqsub016 subtract -3   2  -> '-5'\r
+dqsub017 subtract -2   3  -> '-5'\r
+\r
+dqsub021 subtract  0  -0  -> '0'\r
+dqsub022 subtract  1  -1  -> '2'\r
+dqsub023 subtract  1  -2  -> '3'\r
+dqsub024 subtract  2  -1  -> '3'\r
+dqsub025 subtract  2  -2  -> '4'\r
+dqsub026 subtract  3  -2  -> '5'\r
+dqsub027 subtract  2  -3  -> '5'\r
+\r
+dqsub030 subtract  11  1  -> 10\r
+dqsub031 subtract  10  1  ->  9\r
+dqsub032 subtract  9   1  ->  8\r
+dqsub033 subtract  1   1  ->  0\r
+dqsub034 subtract  0   1  -> -1\r
+dqsub035 subtract -1   1  -> -2\r
+dqsub036 subtract -9   1  -> -10\r
+dqsub037 subtract -10  1  -> -11\r
+dqsub038 subtract -11  1  -> -12\r
+\r
+dqsub040 subtract '5.75' '3.3'  -> '2.45'\r
+dqsub041 subtract '5'    '-3'   -> '8'\r
+dqsub042 subtract '-5'   '-3'   -> '-2'\r
+dqsub043 subtract '-7'   '2.5'  -> '-9.5'\r
+dqsub044 subtract '0.7'  '0.3'  -> '0.4'\r
+dqsub045 subtract '1.3'  '0.3'  -> '1.0'\r
+dqsub046 subtract '1.25' '1.25' -> '0.00'\r
+\r
+dqsub050 subtract '1.23456789'    '1.00000000' -> '0.23456789'\r
+dqsub051 subtract '1.23456789'    '1.00000089' -> '0.23456700'\r
+\r
+dqsub060 subtract '70'    '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqsub061 subtract '700'    '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqsub062 subtract '7000'    '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded\r
+dqsub063 subtract '70000'    '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded\r
+dqsub064 subtract '700000'    '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded\r
+  -- symmetry:\r
+dqsub065 subtract '10000e+34'    '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqsub066 subtract '10000e+34'    '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded\r
+dqsub067 subtract '10000e+34'    '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded\r
+dqsub068 subtract '10000e+34'    '70000' -> '9.999999999999999999999999999999993E+37' Rounded\r
+dqsub069 subtract '10000e+34'    '700000' -> '9.999999999999999999999999999999930E+37' Rounded\r
+\r
+  -- some of the next group are really constructor tests\r
+dqsub090 subtract '00.0'    '0.0'  -> '0.0'\r
+dqsub091 subtract '00.0'    '0.00' -> '0.00'\r
+dqsub092 subtract '0.00'    '00.0' -> '0.00'\r
+dqsub093 subtract '00.0'    '0.00' -> '0.00'\r
+dqsub094 subtract '0.00'    '00.0' -> '0.00'\r
+dqsub095 subtract '3'    '.3'   -> '2.7'\r
+dqsub096 subtract '3.'   '.3'   -> '2.7'\r
+dqsub097 subtract '3.0'  '.3'   -> '2.7'\r
+dqsub098 subtract '3.00' '.3'   -> '2.70'\r
+dqsub099 subtract '3'    '3'    -> '0'\r
+dqsub100 subtract '3'    '+3'   -> '0'\r
+dqsub101 subtract '3'    '-3'   -> '6'\r
+dqsub102 subtract '3'    '0.3'  -> '2.7'\r
+dqsub103 subtract '3.'   '0.3'  -> '2.7'\r
+dqsub104 subtract '3.0'  '0.3'  -> '2.7'\r
+dqsub105 subtract '3.00' '0.3'  -> '2.70'\r
+dqsub106 subtract '3'    '3.0'  -> '0.0'\r
+dqsub107 subtract '3'    '+3.0' -> '0.0'\r
+dqsub108 subtract '3'    '-3.0' -> '6.0'\r
+\r
+-- the above all from add; massaged and extended.  Now some new ones...\r
+-- [particularly important for comparisons]\r
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7\r
+-- with input rounding.\r
+dqsub120 subtract  '10.23456784'    '10.23456789'  -> '-5E-8'\r
+dqsub121 subtract  '10.23456785'    '10.23456789'  -> '-4E-8'\r
+dqsub122 subtract  '10.23456786'    '10.23456789'  -> '-3E-8'\r
+dqsub123 subtract  '10.23456787'    '10.23456789'  -> '-2E-8'\r
+dqsub124 subtract  '10.23456788'    '10.23456789'  -> '-1E-8'\r
+dqsub125 subtract  '10.23456789'    '10.23456789'  -> '0E-8'\r
+dqsub126 subtract  '10.23456790'    '10.23456789'  -> '1E-8'\r
+dqsub127 subtract  '10.23456791'    '10.23456789'  -> '2E-8'\r
+dqsub128 subtract  '10.23456792'    '10.23456789'  -> '3E-8'\r
+dqsub129 subtract  '10.23456793'    '10.23456789'  -> '4E-8'\r
+dqsub130 subtract  '10.23456794'    '10.23456789'  -> '5E-8'\r
+dqsub131 subtract  '10.23456781'    '10.23456786'  -> '-5E-8'\r
+dqsub132 subtract  '10.23456782'    '10.23456786'  -> '-4E-8'\r
+dqsub133 subtract  '10.23456783'    '10.23456786'  -> '-3E-8'\r
+dqsub134 subtract  '10.23456784'    '10.23456786'  -> '-2E-8'\r
+dqsub135 subtract  '10.23456785'    '10.23456786'  -> '-1E-8'\r
+dqsub136 subtract  '10.23456786'    '10.23456786'  -> '0E-8'\r
+dqsub137 subtract  '10.23456787'    '10.23456786'  -> '1E-8'\r
+dqsub138 subtract  '10.23456788'    '10.23456786'  -> '2E-8'\r
+dqsub139 subtract  '10.23456789'    '10.23456786'  -> '3E-8'\r
+dqsub140 subtract  '10.23456790'    '10.23456786'  -> '4E-8'\r
+dqsub141 subtract  '10.23456791'    '10.23456786'  -> '5E-8'\r
+dqsub142 subtract  '1'              '0.999999999'  -> '1E-9'\r
+dqsub143 subtract  '0.999999999'    '1'            -> '-1E-9'\r
+dqsub144 subtract  '-10.23456780'   '-10.23456786' -> '6E-8'\r
+dqsub145 subtract  '-10.23456790'   '-10.23456786' -> '-4E-8'\r
+dqsub146 subtract  '-10.23456791'   '-10.23456786' -> '-5E-8'\r
+\r
+-- additional scaled arithmetic tests [0.97 problem]\r
+dqsub160 subtract '0'     '.1'      -> '-0.1'\r
+dqsub161 subtract '00'    '.97983'  -> '-0.97983'\r
+dqsub162 subtract '0'     '.9'      -> '-0.9'\r
+dqsub163 subtract '0'     '0.102'   -> '-0.102'\r
+dqsub164 subtract '0'     '.4'      -> '-0.4'\r
+dqsub165 subtract '0'     '.307'    -> '-0.307'\r
+dqsub166 subtract '0'     '.43822'  -> '-0.43822'\r
+dqsub167 subtract '0'     '.911'    -> '-0.911'\r
+dqsub168 subtract '.0'    '.02'     -> '-0.02'\r
+dqsub169 subtract '00'    '.392'    -> '-0.392'\r
+dqsub170 subtract '0'     '.26'     -> '-0.26'\r
+dqsub171 subtract '0'     '0.51'    -> '-0.51'\r
+dqsub172 subtract '0'     '.2234'   -> '-0.2234'\r
+dqsub173 subtract '0'     '.2'      -> '-0.2'\r
+dqsub174 subtract '.0'    '.0008'   -> '-0.0008'\r
+-- 0. on left\r
+dqsub180 subtract '0.0'     '-.1'      -> '0.1'\r
+dqsub181 subtract '0.00'    '-.97983'  -> '0.97983'\r
+dqsub182 subtract '0.0'     '-.9'      -> '0.9'\r
+dqsub183 subtract '0.0'     '-0.102'   -> '0.102'\r
+dqsub184 subtract '0.0'     '-.4'      -> '0.4'\r
+dqsub185 subtract '0.0'     '-.307'    -> '0.307'\r
+dqsub186 subtract '0.0'     '-.43822'  -> '0.43822'\r
+dqsub187 subtract '0.0'     '-.911'    -> '0.911'\r
+dqsub188 subtract '0.0'     '-.02'     -> '0.02'\r
+dqsub189 subtract '0.00'    '-.392'    -> '0.392'\r
+dqsub190 subtract '0.0'     '-.26'     -> '0.26'\r
+dqsub191 subtract '0.0'     '-0.51'    -> '0.51'\r
+dqsub192 subtract '0.0'     '-.2234'   -> '0.2234'\r
+dqsub193 subtract '0.0'     '-.2'      -> '0.2'\r
+dqsub194 subtract '0.0'     '-.0008'   -> '0.0008'\r
+-- negatives of same\r
+dqsub200 subtract '0'     '-.1'      -> '0.1'\r
+dqsub201 subtract '00'    '-.97983'  -> '0.97983'\r
+dqsub202 subtract '0'     '-.9'      -> '0.9'\r
+dqsub203 subtract '0'     '-0.102'   -> '0.102'\r
+dqsub204 subtract '0'     '-.4'      -> '0.4'\r
+dqsub205 subtract '0'     '-.307'    -> '0.307'\r
+dqsub206 subtract '0'     '-.43822'  -> '0.43822'\r
+dqsub207 subtract '0'     '-.911'    -> '0.911'\r
+dqsub208 subtract '.0'    '-.02'     -> '0.02'\r
+dqsub209 subtract '00'    '-.392'    -> '0.392'\r
+dqsub210 subtract '0'     '-.26'     -> '0.26'\r
+dqsub211 subtract '0'     '-0.51'    -> '0.51'\r
+dqsub212 subtract '0'     '-.2234'   -> '0.2234'\r
+dqsub213 subtract '0'     '-.2'      -> '0.2'\r
+dqsub214 subtract '.0'    '-.0008'   -> '0.0008'\r
+\r
+-- more fixed, LHS swaps [really the same as testcases under add]\r
+dqsub220 subtract '-56267E-12' 0  -> '-5.6267E-8'\r
+dqsub221 subtract '-56267E-11' 0  -> '-5.6267E-7'\r
+dqsub222 subtract '-56267E-10' 0  -> '-0.0000056267'\r
+dqsub223 subtract '-56267E-9'  0  -> '-0.000056267'\r
+dqsub224 subtract '-56267E-8'  0  -> '-0.00056267'\r
+dqsub225 subtract '-56267E-7'  0  -> '-0.0056267'\r
+dqsub226 subtract '-56267E-6'  0  -> '-0.056267'\r
+dqsub227 subtract '-56267E-5'  0  -> '-0.56267'\r
+dqsub228 subtract '-56267E-2'  0  -> '-562.67'\r
+dqsub229 subtract '-56267E-1'  0  -> '-5626.7'\r
+dqsub230 subtract '-56267E-0'  0  -> '-56267'\r
+-- symmetry ...\r
+dqsub240 subtract 0 '-56267E-12'  -> '5.6267E-8'\r
+dqsub241 subtract 0 '-56267E-11'  -> '5.6267E-7'\r
+dqsub242 subtract 0 '-56267E-10'  -> '0.0000056267'\r
+dqsub243 subtract 0 '-56267E-9'   -> '0.000056267'\r
+dqsub244 subtract 0 '-56267E-8'   -> '0.00056267'\r
+dqsub245 subtract 0 '-56267E-7'   -> '0.0056267'\r
+dqsub246 subtract 0 '-56267E-6'   -> '0.056267'\r
+dqsub247 subtract 0 '-56267E-5'   -> '0.56267'\r
+dqsub248 subtract 0 '-56267E-2'   -> '562.67'\r
+dqsub249 subtract 0 '-56267E-1'   -> '5626.7'\r
+dqsub250 subtract 0 '-56267E-0'   -> '56267'\r
+\r
+-- now some more from the 'new' add\r
+dqsub301 subtract '1.23456789'  '1.00000000' -> '0.23456789'\r
+dqsub302 subtract '1.23456789'  '1.00000011' -> '0.23456778'\r
+\r
+-- some carrying effects\r
+dqsub321 subtract '0.9998'  '0.0000' -> '0.9998'\r
+dqsub322 subtract '0.9998'  '0.0001' -> '0.9997'\r
+dqsub323 subtract '0.9998'  '0.0002' -> '0.9996'\r
+dqsub324 subtract '0.9998'  '0.0003' -> '0.9995'\r
+dqsub325 subtract '0.9998'  '-0.0000' -> '0.9998'\r
+dqsub326 subtract '0.9998'  '-0.0001' -> '0.9999'\r
+dqsub327 subtract '0.9998'  '-0.0002' -> '1.0000'\r
+dqsub328 subtract '0.9998'  '-0.0003' -> '1.0001'\r
+\r
+-- internal boundaries\r
+dqsub346 subtract '10000e+9'  '7'   -> '9999999999993'\r
+dqsub347 subtract '10000e+9'  '70'   -> '9999999999930'\r
+dqsub348 subtract '10000e+9'  '700'   -> '9999999999300'\r
+dqsub349 subtract '10000e+9'  '7000'   -> '9999999993000'\r
+dqsub350 subtract '10000e+9'  '70000'   -> '9999999930000'\r
+dqsub351 subtract '10000e+9'  '700000'   -> '9999999300000'\r
+dqsub352 subtract '7' '10000e+9'   -> '-9999999999993'\r
+dqsub353 subtract '70' '10000e+9'   -> '-9999999999930'\r
+dqsub354 subtract '700' '10000e+9'   -> '-9999999999300'\r
+dqsub355 subtract '7000' '10000e+9'   -> '-9999999993000'\r
+dqsub356 subtract '70000' '10000e+9'   -> '-9999999930000'\r
+dqsub357 subtract '700000' '10000e+9'   -> '-9999999300000'\r
+\r
+-- zero preservation\r
+dqsub361 subtract 1 '0.0001' -> '0.9999'\r
+dqsub362 subtract 1 '0.00001' -> '0.99999'\r
+dqsub363 subtract 1 '0.000001' -> '0.999999'\r
+dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'\r
+dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+\r
+-- some funny zeros [in case of bad signum]\r
+dqsub370 subtract 1  0  -> 1\r
+dqsub371 subtract 1 0.  -> 1\r
+dqsub372 subtract 1  .0 -> 1.0\r
+dqsub373 subtract 1 0.0 -> 1.0\r
+dqsub374 subtract  0  1 -> -1\r
+dqsub375 subtract 0.  1 -> -1\r
+dqsub376 subtract  .0 1 -> -1.0\r
+dqsub377 subtract 0.0 1 -> -1.0\r
+\r
+-- leading 0 digit before round\r
+dqsub910 subtract -103519362 -51897955.3 -> -51621406.7\r
+dqsub911 subtract 159579.444 89827.5229 -> 69751.9211\r
+\r
+dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded\r
+dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded\r
+dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 ->  99.99999999999999999999999999999995\r
+dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 ->  99.99999999999999999999999999999996\r
+dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded\r
+dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 ->  90.00000000000000000000000000000000\r
+dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 ->  89.99999999999999999999999999999999\r
+dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 ->  89.99999999999999999999999999999994\r
+dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 ->   9.99999999999999999999999999999994\r
+dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 ->   1.99999999999999999999999999999994\r
+\r
+-- more LHS swaps [were fixed]\r
+dqsub390 subtract '-56267E-10'   0 ->  '-0.0000056267'\r
+dqsub391 subtract '-56267E-6'    0 ->  '-0.056267'\r
+dqsub392 subtract '-56267E-5'    0 ->  '-0.56267'\r
+dqsub393 subtract '-56267E-4'    0 ->  '-5.6267'\r
+dqsub394 subtract '-56267E-3'    0 ->  '-56.267'\r
+dqsub395 subtract '-56267E-2'    0 ->  '-562.67'\r
+dqsub396 subtract '-56267E-1'    0 ->  '-5626.7'\r
+dqsub397 subtract '-56267E-0'    0 ->  '-56267'\r
+dqsub398 subtract '-5E-10'       0 ->  '-5E-10'\r
+dqsub399 subtract '-5E-7'        0 ->  '-5E-7'\r
+dqsub400 subtract '-5E-6'        0 ->  '-0.000005'\r
+dqsub401 subtract '-5E-5'        0 ->  '-0.00005'\r
+dqsub402 subtract '-5E-4'        0 ->  '-0.0005'\r
+dqsub403 subtract '-5E-1'        0 ->  '-0.5'\r
+dqsub404 subtract '-5E0'         0 ->  '-5'\r
+dqsub405 subtract '-5E1'         0 ->  '-50'\r
+dqsub406 subtract '-5E5'         0 ->  '-500000'\r
+dqsub407 subtract '-5E33'        0 ->  '-5000000000000000000000000000000000'\r
+dqsub408 subtract '-5E34'        0 ->  '-5.000000000000000000000000000000000E+34'  Rounded\r
+dqsub409 subtract '-5E35'        0 ->  '-5.000000000000000000000000000000000E+35'  Rounded\r
+dqsub410 subtract '-5E36'        0 ->  '-5.000000000000000000000000000000000E+36'  Rounded\r
+dqsub411 subtract '-5E100'       0 ->  '-5.000000000000000000000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps [were fixed]\r
+dqsub420 subtract 0  '-56267E-10' ->  '0.0000056267'\r
+dqsub421 subtract 0  '-56267E-6'  ->  '0.056267'\r
+dqsub422 subtract 0  '-56267E-5'  ->  '0.56267'\r
+dqsub423 subtract 0  '-56267E-4'  ->  '5.6267'\r
+dqsub424 subtract 0  '-56267E-3'  ->  '56.267'\r
+dqsub425 subtract 0  '-56267E-2'  ->  '562.67'\r
+dqsub426 subtract 0  '-56267E-1'  ->  '5626.7'\r
+dqsub427 subtract 0  '-56267E-0'  ->  '56267'\r
+dqsub428 subtract 0  '-5E-10'     ->  '5E-10'\r
+dqsub429 subtract 0  '-5E-7'      ->  '5E-7'\r
+dqsub430 subtract 0  '-5E-6'      ->  '0.000005'\r
+dqsub431 subtract 0  '-5E-5'      ->  '0.00005'\r
+dqsub432 subtract 0  '-5E-4'      ->  '0.0005'\r
+dqsub433 subtract 0  '-5E-1'      ->  '0.5'\r
+dqsub434 subtract 0  '-5E0'       ->  '5'\r
+dqsub435 subtract 0  '-5E1'       ->  '50'\r
+dqsub436 subtract 0  '-5E5'       ->  '500000'\r
+dqsub437 subtract 0  '-5E33'      ->  '5000000000000000000000000000000000'\r
+dqsub438 subtract 0  '-5E34'      ->  '5.000000000000000000000000000000000E+34'   Rounded\r
+dqsub439 subtract 0  '-5E35'      ->  '5.000000000000000000000000000000000E+35'   Rounded\r
+dqsub440 subtract 0  '-5E36'      ->  '5.000000000000000000000000000000000E+36'   Rounded\r
+dqsub441 subtract 0  '-5E100'     ->  '5.000000000000000000000000000000000E+100'  Rounded\r
+\r
+\r
+-- try borderline precision, with carries, etc.\r
+dqsub461 subtract '1E+16' '1'        -> '9999999999999999'\r
+dqsub462 subtract '1E+12' '-1.111'   -> '1000000000001.111'\r
+dqsub463 subtract '1.111'  '-1E+12'  -> '1000000000001.111'\r
+dqsub464 subtract '-1'    '-1E+16'   -> '9999999999999999'\r
+dqsub465 subtract '7E+15' '1'        -> '6999999999999999'\r
+dqsub466 subtract '7E+12' '-1.111'   -> '7000000000001.111'\r
+dqsub467 subtract '1.111'  '-7E+12'  -> '7000000000001.111'\r
+dqsub468 subtract '-1'    '-7E+15'   -> '6999999999999999'\r
+\r
+--                   1234567890123456       1234567890123456      1 23456789012345\r
+dqsub470 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded\r
+dqsub471 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded\r
+dqsub472 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub473 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub474 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub475 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub476 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded\r
+dqsub477 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded\r
+dqsub478 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'\r
+dqsub479 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'\r
+dqsub480 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'\r
+dqsub481 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'\r
+dqsub482 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'\r
+dqsub483 subtract '0.4444444444444444444444444444444444'  '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+dqsub500 subtract '1231234555555555555555555567456789' 0             -> '1231234555555555555555555567456789'\r
+dqsub501 subtract '1231234555555555555555555567456789' 0.000000001   -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub502 subtract '1231234555555555555555555567456789' 0.000001      -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub503 subtract '1231234555555555555555555567456789' 0.1           -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub504 subtract '1231234555555555555555555567456789' 0.4           -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub505 subtract '1231234555555555555555555567456789' 0.49          -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub506 subtract '1231234555555555555555555567456789' 0.499999      -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub507 subtract '1231234555555555555555555567456789' 0.499999999   -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub508 subtract '1231234555555555555555555567456789' 0.5           -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub509 subtract '1231234555555555555555555567456789' 0.500000001   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub510 subtract '1231234555555555555555555567456789' 0.500001      -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub511 subtract '1231234555555555555555555567456789' 0.51          -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub512 subtract '1231234555555555555555555567456789' 0.6           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub513 subtract '1231234555555555555555555567456789' 0.9           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub514 subtract '1231234555555555555555555567456789' 0.99999       -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub515 subtract '1231234555555555555555555567456789' 0.999999999   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub516 subtract '1231234555555555555555555567456789' 1             -> '1231234555555555555555555567456788'\r
+dqsub517 subtract '1231234555555555555555555567456789' 1.000000001   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub518 subtract '1231234555555555555555555567456789' 1.00001       -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub519 subtract '1231234555555555555555555567456789' 1.1           -> '1231234555555555555555555567456788' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqsub520 subtract '1231234555555555555555555567456789' 0             -> '1231234555555555555555555567456789'\r
+dqsub521 subtract '1231234555555555555555555567456789' 0.000000001   -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub522 subtract '1231234555555555555555555567456789' 0.000001      -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub523 subtract '1231234555555555555555555567456789' 0.1           -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub524 subtract '1231234555555555555555555567456789' 0.4           -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub525 subtract '1231234555555555555555555567456789' 0.49          -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub526 subtract '1231234555555555555555555567456789' 0.499999      -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub527 subtract '1231234555555555555555555567456789' 0.499999999   -> '1231234555555555555555555567456789' Inexact Rounded\r
+dqsub528 subtract '1231234555555555555555555567456789' 0.5           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub529 subtract '1231234555555555555555555567456789' 0.500000001   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub530 subtract '1231234555555555555555555567456789' 0.500001      -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub531 subtract '1231234555555555555555555567456789' 0.51          -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub532 subtract '1231234555555555555555555567456789' 0.6           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub533 subtract '1231234555555555555555555567456789' 0.9           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub534 subtract '1231234555555555555555555567456789' 0.99999       -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub535 subtract '1231234555555555555555555567456789' 0.999999999   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub536 subtract '1231234555555555555555555567456789' 1             -> '1231234555555555555555555567456788'\r
+dqsub537 subtract '1231234555555555555555555567456789' 1.00000001    -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub538 subtract '1231234555555555555555555567456789' 1.00001       -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub539 subtract '1231234555555555555555555567456789' 1.1           -> '1231234555555555555555555567456788' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+dqsub540 subtract '1231234555555555555555555567456788' 0.499999999   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub541 subtract '1231234555555555555555555567456788' 0.5           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub542 subtract '1231234555555555555555555567456788' 0.500000001   -> '1231234555555555555555555567456787' Inexact Rounded\r
+\r
+rounding: down\r
+dqsub550 subtract '1231234555555555555555555567456789' 0             -> '1231234555555555555555555567456789'\r
+dqsub551 subtract '1231234555555555555555555567456789' 0.000000001   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub552 subtract '1231234555555555555555555567456789' 0.000001      -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub553 subtract '1231234555555555555555555567456789' 0.1           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub554 subtract '1231234555555555555555555567456789' 0.4           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub555 subtract '1231234555555555555555555567456789' 0.49          -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub556 subtract '1231234555555555555555555567456789' 0.499999      -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub557 subtract '1231234555555555555555555567456789' 0.499999999   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub558 subtract '1231234555555555555555555567456789' 0.5           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub559 subtract '1231234555555555555555555567456789' 0.500000001   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub560 subtract '1231234555555555555555555567456789' 0.500001      -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub561 subtract '1231234555555555555555555567456789' 0.51          -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub562 subtract '1231234555555555555555555567456789' 0.6           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub563 subtract '1231234555555555555555555567456789' 0.9           -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub564 subtract '1231234555555555555555555567456789' 0.99999       -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub565 subtract '1231234555555555555555555567456789' 0.999999999   -> '1231234555555555555555555567456788' Inexact Rounded\r
+dqsub566 subtract '1231234555555555555555555567456789' 1             -> '1231234555555555555555555567456788'\r
+dqsub567 subtract '1231234555555555555555555567456789' 1.00000001    -> '1231234555555555555555555567456787' Inexact Rounded\r
+dqsub568 subtract '1231234555555555555555555567456789' 1.00001       -> '1231234555555555555555555567456787' Inexact Rounded\r
+dqsub569 subtract '1231234555555555555555555567456789' 1.1           -> '1231234555555555555555555567456787' Inexact Rounded\r
+\r
+-- symmetry...\r
+rounding: half_up\r
+dqsub600 subtract 0             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'\r
+dqsub601 subtract 0.000000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub602 subtract 0.000001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub603 subtract 0.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub604 subtract 0.4           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub605 subtract 0.49          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub606 subtract 0.499999      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub607 subtract 0.499999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub608 subtract 0.5           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub609 subtract 0.500000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub610 subtract 0.500001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub611 subtract 0.51          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub612 subtract 0.6           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub613 subtract 0.9           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub614 subtract 0.99999       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub615 subtract 0.999999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub616 subtract 1             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'\r
+dqsub617 subtract 1.000000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub618 subtract 1.00001       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub619 subtract 1.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+\r
+rounding: half_even\r
+dqsub620 subtract 0             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'\r
+dqsub621 subtract 0.000000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub622 subtract 0.000001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub623 subtract 0.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub624 subtract 0.4           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub625 subtract 0.49          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub626 subtract 0.499999      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub627 subtract 0.499999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded\r
+dqsub628 subtract 0.5           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub629 subtract 0.500000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub630 subtract 0.500001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub631 subtract 0.51          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub632 subtract 0.6           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub633 subtract 0.9           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub634 subtract 0.99999       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub635 subtract 0.999999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub636 subtract 1             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'\r
+dqsub637 subtract 1.00000001    '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub638 subtract 1.00001       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub639 subtract 1.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+dqsub640 subtract 0.499999999   '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub641 subtract 0.5           '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub642 subtract 0.500000001   '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded\r
+\r
+rounding: down\r
+dqsub650 subtract 0             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'\r
+dqsub651 subtract 0.000000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub652 subtract 0.000001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub653 subtract 0.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub654 subtract 0.4           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub655 subtract 0.49          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub656 subtract 0.499999      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub657 subtract 0.499999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub658 subtract 0.5           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub659 subtract 0.500000001   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub660 subtract 0.500001      '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub661 subtract 0.51          '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub662 subtract 0.6           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub663 subtract 0.9           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub664 subtract 0.99999       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub665 subtract 0.999999999   '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded\r
+dqsub666 subtract 1             '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'\r
+dqsub667 subtract 1.00000001    '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded\r
+dqsub668 subtract 1.00001       '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded\r
+dqsub669 subtract 1.1           '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded\r
+\r
+\r
+-- lots of leading zeros in intermediate result, and showing effects of\r
+-- input rounding would have affected the following\r
+rounding: half_up\r
+dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+rounding: half_even\r
+dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9\r
+dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1\r
+dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1\r
+dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5\r
+dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9\r
+\r
+rounding: down\r
+dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9\r
+dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1\r
+dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1\r
+dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5\r
+dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9\r
+\r
+-- Specials\r
+dqsub780 subtract -Inf   Inf   -> -Infinity\r
+dqsub781 subtract -Inf   1000  -> -Infinity\r
+dqsub782 subtract -Inf   1     -> -Infinity\r
+dqsub783 subtract -Inf  -0     -> -Infinity\r
+dqsub784 subtract -Inf  -1     -> -Infinity\r
+dqsub785 subtract -Inf  -1000  -> -Infinity\r
+dqsub787 subtract -1000  Inf   -> -Infinity\r
+dqsub788 subtract -Inf   Inf   -> -Infinity\r
+dqsub789 subtract -1     Inf   -> -Infinity\r
+dqsub790 subtract  0     Inf   -> -Infinity\r
+dqsub791 subtract  1     Inf   -> -Infinity\r
+dqsub792 subtract  1000  Inf   -> -Infinity\r
+\r
+dqsub800 subtract  Inf   Inf   ->  NaN  Invalid_operation\r
+dqsub801 subtract  Inf   1000  ->  Infinity\r
+dqsub802 subtract  Inf   1     ->  Infinity\r
+dqsub803 subtract  Inf   0     ->  Infinity\r
+dqsub804 subtract  Inf  -0     ->  Infinity\r
+dqsub805 subtract  Inf  -1     ->  Infinity\r
+dqsub806 subtract  Inf  -1000  ->  Infinity\r
+dqsub807 subtract  Inf  -Inf   ->  Infinity\r
+dqsub808 subtract -1000 -Inf   ->  Infinity\r
+dqsub809 subtract -Inf  -Inf   ->  NaN  Invalid_operation\r
+dqsub810 subtract -1    -Inf   ->  Infinity\r
+dqsub811 subtract -0    -Inf   ->  Infinity\r
+dqsub812 subtract  0    -Inf   ->  Infinity\r
+dqsub813 subtract  1    -Inf   ->  Infinity\r
+dqsub814 subtract  1000 -Inf   ->  Infinity\r
+dqsub815 subtract  Inf  -Inf   ->  Infinity\r
+\r
+dqsub821 subtract  NaN   Inf   ->  NaN\r
+dqsub822 subtract -NaN   1000  -> -NaN\r
+dqsub823 subtract  NaN   1     ->  NaN\r
+dqsub824 subtract  NaN   0     ->  NaN\r
+dqsub825 subtract  NaN  -0     ->  NaN\r
+dqsub826 subtract  NaN  -1     ->  NaN\r
+dqsub827 subtract  NaN  -1000  ->  NaN\r
+dqsub828 subtract  NaN  -Inf   ->  NaN\r
+dqsub829 subtract -NaN   NaN   -> -NaN\r
+dqsub830 subtract -Inf   NaN   ->  NaN\r
+dqsub831 subtract -1000  NaN   ->  NaN\r
+dqsub832 subtract -1     NaN   ->  NaN\r
+dqsub833 subtract -0     NaN   ->  NaN\r
+dqsub834 subtract  0     NaN   ->  NaN\r
+dqsub835 subtract  1     NaN   ->  NaN\r
+dqsub836 subtract  1000 -NaN   -> -NaN\r
+dqsub837 subtract  Inf   NaN   ->  NaN\r
+\r
+dqsub841 subtract  sNaN  Inf   ->  NaN  Invalid_operation\r
+dqsub842 subtract -sNaN  1000  -> -NaN  Invalid_operation\r
+dqsub843 subtract  sNaN  1     ->  NaN  Invalid_operation\r
+dqsub844 subtract  sNaN  0     ->  NaN  Invalid_operation\r
+dqsub845 subtract  sNaN -0     ->  NaN  Invalid_operation\r
+dqsub846 subtract  sNaN -1     ->  NaN  Invalid_operation\r
+dqsub847 subtract  sNaN -1000  ->  NaN  Invalid_operation\r
+dqsub848 subtract  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqsub849 subtract  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqsub850 subtract  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqsub851 subtract -Inf -sNaN   -> -NaN  Invalid_operation\r
+dqsub852 subtract -1000 sNaN   ->  NaN  Invalid_operation\r
+dqsub853 subtract -1    sNaN   ->  NaN  Invalid_operation\r
+dqsub854 subtract -0    sNaN   ->  NaN  Invalid_operation\r
+dqsub855 subtract  0    sNaN   ->  NaN  Invalid_operation\r
+dqsub856 subtract  1    sNaN   ->  NaN  Invalid_operation\r
+dqsub857 subtract  1000 sNaN   ->  NaN  Invalid_operation\r
+dqsub858 subtract  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqsub859 subtract  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqsub861 subtract  NaN01   -Inf     ->  NaN1\r
+dqsub862 subtract -NaN02   -1000    -> -NaN2\r
+dqsub863 subtract  NaN03    1000    ->  NaN3\r
+dqsub864 subtract  NaN04    Inf     ->  NaN4\r
+dqsub865 subtract  NaN05    NaN61   ->  NaN5\r
+dqsub866 subtract -Inf     -NaN71   -> -NaN71\r
+dqsub867 subtract -1000     NaN81   ->  NaN81\r
+dqsub868 subtract  1000     NaN91   ->  NaN91\r
+dqsub869 subtract  Inf      NaN101  ->  NaN101\r
+dqsub871 subtract  sNaN011  -Inf    ->  NaN11  Invalid_operation\r
+dqsub872 subtract  sNaN012  -1000   ->  NaN12  Invalid_operation\r
+dqsub873 subtract -sNaN013   1000   -> -NaN13  Invalid_operation\r
+dqsub874 subtract  sNaN014   NaN171 ->  NaN14  Invalid_operation\r
+dqsub875 subtract  sNaN015  sNaN181 ->  NaN15  Invalid_operation\r
+dqsub876 subtract  NaN016   sNaN191 ->  NaN191 Invalid_operation\r
+dqsub877 subtract -Inf      sNaN201 ->  NaN201 Invalid_operation\r
+dqsub878 subtract -1000     sNaN211 ->  NaN211 Invalid_operation\r
+dqsub879 subtract  1000    -sNaN221 -> -NaN221 Invalid_operation\r
+dqsub880 subtract  Inf      sNaN231 ->  NaN231 Invalid_operation\r
+dqsub881 subtract  NaN025   sNaN241 ->  NaN241 Invalid_operation\r
+\r
+-- edge case spills\r
+dqsub901 subtract  2.E-3  1.002  -> -1.000\r
+dqsub902 subtract  2.0E-3  1.002  -> -1.0000\r
+dqsub903 subtract  2.00E-3  1.0020  -> -1.00000\r
+dqsub904 subtract  2.000E-3  1.00200  -> -1.000000\r
+dqsub905 subtract  2.0000E-3  1.002000  -> -1.0000000\r
+dqsub906 subtract  2.00000E-3  1.0020000  -> -1.00000000\r
+dqsub907 subtract  2.000000E-3  1.00200000  -> -1.000000000\r
+dqsub908 subtract  2.0000000E-3  1.002000000  -> -1.0000000000\r
+\r
+-- subnormals and overflows covered under Add\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+dqsub1125  subtract 130E-2  120E-2 -> 0.10\r
+dqsub1126  subtract 130E-2  12E-1  -> 0.10\r
+dqsub1127  subtract 130E-2  1E0    -> 0.30\r
+dqsub1128  subtract 1E2     1E4    -> -9.9E+3\r
+\r
+-- Null tests\r
+dqsub9990 subtract 10  # -> NaN Invalid_operation\r
+dqsub9991 subtract  # 10 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dqToIntegral.decTest b/Lib/test/decimaltestdata/dqToIntegral.decTest
new file mode 100644 (file)
index 0000000..ac50a4a
--- /dev/null
@@ -0,0 +1,257 @@
+------------------------------------------------------------------------\r
+-- dqToIntegral.decTest -- round Quad to integral value               --\r
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests tests the extended specification 'round-to-integral\r
+-- value-exact' operations (from IEEE 854, later modified in 754r).\r
+-- All non-zero results are defined as being those from either copy or\r
+-- quantize, so those are assumed to have been tested extensively\r
+-- elsewhere; the tests here are for integrity, rounding mode, etc.\r
+-- Also, it is assumed the test harness will use these tests for both\r
+-- ToIntegralExact (which does set Inexact) and the fixed-name\r
+-- functions (which do not set Inexact).\r
+\r
+-- Note that decNumber implements an earlier definition of toIntegral\r
+-- which never sets Inexact; the decTest operator for that is called\r
+-- 'tointegral' instead of 'tointegralx'.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+dqintx001 tointegralx      0     ->  0\r
+dqintx002 tointegralx      0.0   ->  0\r
+dqintx003 tointegralx      0.1   ->  0  Inexact Rounded\r
+dqintx004 tointegralx      0.2   ->  0  Inexact Rounded\r
+dqintx005 tointegralx      0.3   ->  0  Inexact Rounded\r
+dqintx006 tointegralx      0.4   ->  0  Inexact Rounded\r
+dqintx007 tointegralx      0.5   ->  0  Inexact Rounded\r
+dqintx008 tointegralx      0.6   ->  1  Inexact Rounded\r
+dqintx009 tointegralx      0.7   ->  1  Inexact Rounded\r
+dqintx010 tointegralx      0.8   ->  1  Inexact Rounded\r
+dqintx011 tointegralx      0.9   ->  1  Inexact Rounded\r
+dqintx012 tointegralx      1     ->  1\r
+dqintx013 tointegralx      1.0   ->  1  Rounded\r
+dqintx014 tointegralx      1.1   ->  1  Inexact Rounded\r
+dqintx015 tointegralx      1.2   ->  1  Inexact Rounded\r
+dqintx016 tointegralx      1.3   ->  1  Inexact Rounded\r
+dqintx017 tointegralx      1.4   ->  1  Inexact Rounded\r
+dqintx018 tointegralx      1.5   ->  2  Inexact Rounded\r
+dqintx019 tointegralx      1.6   ->  2  Inexact Rounded\r
+dqintx020 tointegralx      1.7   ->  2  Inexact Rounded\r
+dqintx021 tointegralx      1.8   ->  2  Inexact Rounded\r
+dqintx022 tointegralx      1.9   ->  2  Inexact Rounded\r
+-- negatives\r
+dqintx031 tointegralx     -0     -> -0\r
+dqintx032 tointegralx     -0.0   -> -0\r
+dqintx033 tointegralx     -0.1   -> -0  Inexact Rounded\r
+dqintx034 tointegralx     -0.2   -> -0  Inexact Rounded\r
+dqintx035 tointegralx     -0.3   -> -0  Inexact Rounded\r
+dqintx036 tointegralx     -0.4   -> -0  Inexact Rounded\r
+dqintx037 tointegralx     -0.5   -> -0  Inexact Rounded\r
+dqintx038 tointegralx     -0.6   -> -1  Inexact Rounded\r
+dqintx039 tointegralx     -0.7   -> -1  Inexact Rounded\r
+dqintx040 tointegralx     -0.8   -> -1  Inexact Rounded\r
+dqintx041 tointegralx     -0.9   -> -1  Inexact Rounded\r
+dqintx042 tointegralx     -1     -> -1\r
+dqintx043 tointegralx     -1.0   -> -1  Rounded\r
+dqintx044 tointegralx     -1.1   -> -1  Inexact Rounded\r
+dqintx045 tointegralx     -1.2   -> -1  Inexact Rounded\r
+dqintx046 tointegralx     -1.3   -> -1  Inexact Rounded\r
+dqintx047 tointegralx     -1.4   -> -1  Inexact Rounded\r
+dqintx048 tointegralx     -1.5   -> -2  Inexact Rounded\r
+dqintx049 tointegralx     -1.6   -> -2  Inexact Rounded\r
+dqintx050 tointegralx     -1.7   -> -2  Inexact Rounded\r
+dqintx051 tointegralx     -1.8   -> -2  Inexact Rounded\r
+dqintx052 tointegralx     -1.9   -> -2  Inexact Rounded\r
+-- next two would be NaN using quantize(x, 0)\r
+dqintx053 tointegralx    10E+60  -> 1.0E+61\r
+dqintx054 tointegralx   -10E+60  -> -1.0E+61\r
+\r
+-- numbers around precision\r
+dqintx060 tointegralx '56267E-17'   -> '0'      Inexact Rounded\r
+dqintx061 tointegralx '56267E-5'    -> '1'      Inexact Rounded\r
+dqintx062 tointegralx '56267E-2'    -> '563'    Inexact Rounded\r
+dqintx063 tointegralx '56267E-1'    -> '5627'   Inexact Rounded\r
+dqintx065 tointegralx '56267E-0'    -> '56267'\r
+dqintx066 tointegralx '56267E+0'    -> '56267'\r
+dqintx067 tointegralx '56267E+1'    -> '5.6267E+5'\r
+dqintx068 tointegralx '56267E+9'    -> '5.6267E+13'\r
+dqintx069 tointegralx '56267E+10'   -> '5.6267E+14'\r
+dqintx070 tointegralx '56267E+11'   -> '5.6267E+15'\r
+dqintx071 tointegralx '56267E+12'   -> '5.6267E+16'\r
+dqintx072 tointegralx '56267E+13'   -> '5.6267E+17'\r
+dqintx073 tointegralx '1.23E+96'    -> '1.23E+96'\r
+dqintx074 tointegralx '1.23E+6144'  -> #47ffd300000000000000000000000000 Clamped\r
+\r
+dqintx080 tointegralx '-56267E-10'  -> '-0'      Inexact Rounded\r
+dqintx081 tointegralx '-56267E-5'   -> '-1'      Inexact Rounded\r
+dqintx082 tointegralx '-56267E-2'   -> '-563'    Inexact Rounded\r
+dqintx083 tointegralx '-56267E-1'   -> '-5627'   Inexact Rounded\r
+dqintx085 tointegralx '-56267E-0'   -> '-56267'\r
+dqintx086 tointegralx '-56267E+0'   -> '-56267'\r
+dqintx087 tointegralx '-56267E+1'   -> '-5.6267E+5'\r
+dqintx088 tointegralx '-56267E+9'   -> '-5.6267E+13'\r
+dqintx089 tointegralx '-56267E+10'  -> '-5.6267E+14'\r
+dqintx090 tointegralx '-56267E+11'  -> '-5.6267E+15'\r
+dqintx091 tointegralx '-56267E+12'  -> '-5.6267E+16'\r
+dqintx092 tointegralx '-56267E+13'  -> '-5.6267E+17'\r
+dqintx093 tointegralx '-1.23E+96'   -> '-1.23E+96'\r
+dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped\r
+\r
+-- subnormal inputs\r
+dqintx100 tointegralx        1E-299 -> 0  Inexact Rounded\r
+dqintx101 tointegralx      0.1E-299 -> 0  Inexact Rounded\r
+dqintx102 tointegralx     0.01E-299 -> 0  Inexact Rounded\r
+dqintx103 tointegralx        0E-299 -> 0\r
+\r
+-- specials and zeros\r
+dqintx120 tointegralx 'Inf'       ->  Infinity\r
+dqintx121 tointegralx '-Inf'      -> -Infinity\r
+dqintx122 tointegralx   NaN       ->  NaN\r
+dqintx123 tointegralx  sNaN       ->  NaN  Invalid_operation\r
+dqintx124 tointegralx     0       ->  0\r
+dqintx125 tointegralx    -0       -> -0\r
+dqintx126 tointegralx     0.000   ->  0\r
+dqintx127 tointegralx     0.00    ->  0\r
+dqintx128 tointegralx     0.0     ->  0\r
+dqintx129 tointegralx     0       ->  0\r
+dqintx130 tointegralx     0E-3    ->  0\r
+dqintx131 tointegralx     0E-2    ->  0\r
+dqintx132 tointegralx     0E-1    ->  0\r
+dqintx133 tointegralx     0E-0    ->  0\r
+dqintx134 tointegralx     0E+1    ->  0E+1\r
+dqintx135 tointegralx     0E+2    ->  0E+2\r
+dqintx136 tointegralx     0E+3    ->  0E+3\r
+dqintx137 tointegralx     0E+4    ->  0E+4\r
+dqintx138 tointegralx     0E+5    ->  0E+5\r
+dqintx139 tointegralx    -0.000   -> -0\r
+dqintx140 tointegralx    -0.00    -> -0\r
+dqintx141 tointegralx    -0.0     -> -0\r
+dqintx142 tointegralx    -0       -> -0\r
+dqintx143 tointegralx    -0E-3    -> -0\r
+dqintx144 tointegralx    -0E-2    -> -0\r
+dqintx145 tointegralx    -0E-1    -> -0\r
+dqintx146 tointegralx    -0E-0    -> -0\r
+dqintx147 tointegralx    -0E+1    -> -0E+1\r
+dqintx148 tointegralx    -0E+2    -> -0E+2\r
+dqintx149 tointegralx    -0E+3    -> -0E+3\r
+dqintx150 tointegralx    -0E+4    -> -0E+4\r
+dqintx151 tointegralx    -0E+5    -> -0E+5\r
+-- propagating NaNs\r
+dqintx152 tointegralx   NaN808    ->  NaN808\r
+dqintx153 tointegralx  sNaN080    ->  NaN80  Invalid_operation\r
+dqintx154 tointegralx  -NaN808    -> -NaN808\r
+dqintx155 tointegralx -sNaN080    -> -NaN80  Invalid_operation\r
+dqintx156 tointegralx  -NaN       -> -NaN\r
+dqintx157 tointegralx -sNaN       -> -NaN    Invalid_operation\r
+\r
+-- examples\r
+rounding:    half_up\r
+dqintx200 tointegralx     2.1    -> 2            Inexact Rounded\r
+dqintx201 tointegralx   100      -> 100\r
+dqintx202 tointegralx   100.0    -> 100          Rounded\r
+dqintx203 tointegralx   101.5    -> 102          Inexact Rounded\r
+dqintx204 tointegralx  -101.5    -> -102         Inexact Rounded\r
+dqintx205 tointegralx   10E+5    -> 1.0E+6\r
+dqintx206 tointegralx  7.89E+77  -> 7.89E+77\r
+dqintx207 tointegralx   -Inf     -> -Infinity\r
+\r
+\r
+-- all rounding modes\r
+rounding:    half_even\r
+dqintx210 tointegralx     55.5   ->  56  Inexact Rounded\r
+dqintx211 tointegralx     56.5   ->  56  Inexact Rounded\r
+dqintx212 tointegralx     57.5   ->  58  Inexact Rounded\r
+dqintx213 tointegralx    -55.5   -> -56  Inexact Rounded\r
+dqintx214 tointegralx    -56.5   -> -56  Inexact Rounded\r
+dqintx215 tointegralx    -57.5   -> -58  Inexact Rounded\r
+\r
+rounding:    half_up\r
+\r
+dqintx220 tointegralx     55.5   ->  56  Inexact Rounded\r
+dqintx221 tointegralx     56.5   ->  57  Inexact Rounded\r
+dqintx222 tointegralx     57.5   ->  58  Inexact Rounded\r
+dqintx223 tointegralx    -55.5   -> -56  Inexact Rounded\r
+dqintx224 tointegralx    -56.5   -> -57  Inexact Rounded\r
+dqintx225 tointegralx    -57.5   -> -58  Inexact Rounded\r
+\r
+rounding:    half_down\r
+\r
+dqintx230 tointegralx     55.5   ->  55  Inexact Rounded\r
+dqintx231 tointegralx     56.5   ->  56  Inexact Rounded\r
+dqintx232 tointegralx     57.5   ->  57  Inexact Rounded\r
+dqintx233 tointegralx    -55.5   -> -55  Inexact Rounded\r
+dqintx234 tointegralx    -56.5   -> -56  Inexact Rounded\r
+dqintx235 tointegralx    -57.5   -> -57  Inexact Rounded\r
+\r
+rounding:    up\r
+\r
+dqintx240 tointegralx     55.3   ->  56  Inexact Rounded\r
+dqintx241 tointegralx     56.3   ->  57  Inexact Rounded\r
+dqintx242 tointegralx     57.3   ->  58  Inexact Rounded\r
+dqintx243 tointegralx    -55.3   -> -56  Inexact Rounded\r
+dqintx244 tointegralx    -56.3   -> -57  Inexact Rounded\r
+dqintx245 tointegralx    -57.3   -> -58  Inexact Rounded\r
+\r
+rounding:    down\r
+\r
+dqintx250 tointegralx     55.7   ->  55  Inexact Rounded\r
+dqintx251 tointegralx     56.7   ->  56  Inexact Rounded\r
+dqintx252 tointegralx     57.7   ->  57  Inexact Rounded\r
+dqintx253 tointegralx    -55.7   -> -55  Inexact Rounded\r
+dqintx254 tointegralx    -56.7   -> -56  Inexact Rounded\r
+dqintx255 tointegralx    -57.7   -> -57  Inexact Rounded\r
+\r
+rounding:    ceiling\r
+\r
+dqintx260 tointegralx     55.3   ->  56  Inexact Rounded\r
+dqintx261 tointegralx     56.3   ->  57  Inexact Rounded\r
+dqintx262 tointegralx     57.3   ->  58  Inexact Rounded\r
+dqintx263 tointegralx    -55.3   -> -55  Inexact Rounded\r
+dqintx264 tointegralx    -56.3   -> -56  Inexact Rounded\r
+dqintx265 tointegralx    -57.3   -> -57  Inexact Rounded\r
+\r
+rounding:    floor\r
+\r
+dqintx270 tointegralx     55.7   ->  55  Inexact Rounded\r
+dqintx271 tointegralx     56.7   ->  56  Inexact Rounded\r
+dqintx272 tointegralx     57.7   ->  57  Inexact Rounded\r
+dqintx273 tointegralx    -55.7   -> -56  Inexact Rounded\r
+dqintx274 tointegralx    -56.7   -> -57  Inexact Rounded\r
+dqintx275 tointegralx    -57.7   -> -58  Inexact Rounded\r
+\r
+-- Int and uInt32 edge values for testing conversions\r
+dqintx300 tointegralx -2147483646  -> -2147483646\r
+dqintx301 tointegralx -2147483647  -> -2147483647\r
+dqintx302 tointegralx -2147483648  -> -2147483648\r
+dqintx303 tointegralx -2147483649  -> -2147483649\r
+dqintx304 tointegralx  2147483646  ->  2147483646\r
+dqintx305 tointegralx  2147483647  ->  2147483647\r
+dqintx306 tointegralx  2147483648  ->  2147483648\r
+dqintx307 tointegralx  2147483649  ->  2147483649\r
+dqintx308 tointegralx  4294967294  ->  4294967294\r
+dqintx309 tointegralx  4294967295  ->  4294967295\r
+dqintx310 tointegralx  4294967296  ->  4294967296\r
+dqintx311 tointegralx  4294967297  ->  4294967297\r
+\r
diff --git a/Lib/test/decimaltestdata/dqXor.decTest b/Lib/test/decimaltestdata/dqXor.decTest
new file mode 100644 (file)
index 0000000..61bdbe2
--- /dev/null
@@ -0,0 +1,410 @@
+------------------------------------------------------------------------\r
+-- dqXor.decTest -- digitwise logical XOR for decQuads                --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+rounding:    half_even\r
+\r
+-- Sanity check (truth table)\r
+dqxor001 xor             0    0 ->    0\r
+dqxor002 xor             0    1 ->    1\r
+dqxor003 xor             1    0 ->    1\r
+dqxor004 xor             1    1 ->    0\r
+dqxor005 xor          1100 1010 ->  110\r
+-- and at msd and msd-1\r
+dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 ->           0\r
+dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 ->   1000000000000000000000000000000000\r
+dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 ->           0\r
+dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 ->           0\r
+dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 ->    100000000000000000000000000000000\r
+dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 ->    100000000000000000000000000000000\r
+dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 ->           0\r
+\r
+-- Various lengths\r
+--           1234567890123456789012345678901234\r
+dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111  -> 1000000000000000000000000000000000\r
+dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111  ->  100000000000000000000000000000000\r
+dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111  ->   10000000000000000000000000000000\r
+dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111  ->    1000000000000000000000000000000\r
+dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111  ->     100000000000000000000000000000\r
+dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111  ->      10000000000000000000000000000\r
+dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111  ->       1000000000000000000000000000\r
+dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111  ->        100000000000000000000000000\r
+dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111  ->         10000000000000000000000000\r
+dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111  ->          1000000000000000000000000\r
+dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111  ->           100000000000000000000000\r
+dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111  ->            10000000000000000000000\r
+dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111  ->             1000000000000000000000\r
+dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111  ->              100000000000000000000\r
+dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111  ->               10000000000000000000\r
+dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111  ->                1000000000000000000\r
+dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111  ->                 100000000000000000\r
+dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111  ->                  10000000000000000\r
+dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111  ->                   1000000000000000\r
+dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111  ->                    100000000000000\r
+dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111  ->                     10000000000000\r
+dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111  ->                      1000000000000\r
+dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111  ->                       100000000000\r
+dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111  ->                        10000000000\r
+dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111  ->                         1000000000\r
+dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111  ->                          100000000\r
+dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111  ->                           10000000\r
+dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111  ->                            1000000\r
+dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111  ->                             100000\r
+dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111  ->                              10000\r
+dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111  ->                               1000\r
+dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111  ->                                100\r
+dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111  ->                                 10\r
+dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111  ->                                  1\r
+\r
+dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111  -> 1000000000000000000000000000000000\r
+dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111  ->  100000000000000000000000000000000\r
+dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111  ->   10000000000000000000000000000000\r
+dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111  ->    1000000000000000000000000000000\r
+dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111  ->     100000000000000000000000000000\r
+dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111  ->      10000000000000000000000000000\r
+dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111  ->       1000000000000000000000000000\r
+dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111  ->        100000000000000000000000000\r
+dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111  ->         10000000000000000000000000\r
+dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111  ->          1000000000000000000000000\r
+dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111  ->           100000000000000000000000\r
+dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111  ->            10000000000000000000000\r
+dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111  ->             1000000000000000000000\r
+dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111  ->              100000000000000000000\r
+dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111  ->               10000000000000000000\r
+dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111  ->                1000000000000000000\r
+dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111  ->                 100000000000000000\r
+dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111  ->                  10000000000000000\r
+dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111  ->                   1000000000000000\r
+dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111  ->                    100000000000000\r
+dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111  ->                     10000000000000\r
+dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111  ->                      1000000000000\r
+dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111  ->                       100000000000\r
+dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111  ->                        10000000000\r
+dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111  ->                         1000000000\r
+dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111  ->                          100000000\r
+dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111  ->                           10000000\r
+dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111  ->                            1000000\r
+dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111  ->                             100000\r
+dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111  ->                              10000\r
+dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111  ->                               1000\r
+dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011  ->                                100\r
+dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101  ->                                 10\r
+dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110  ->                                  1\r
+dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110  -> 1000000000000000000000000000000001\r
+dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110  ->                                  1\r
+\r
+\r
+dqxor021 xor 1111111110000000     1111111110000000  ->  0\r
+dqxor022 xor  111111110000000      111111110000000  ->  0\r
+dqxor023 xor   11111110000000       11111110000000  ->  0\r
+dqxor024 xor    1111110000000        1111110000000  ->  0\r
+dqxor025 xor     111110000000         111110000000  ->  0\r
+dqxor026 xor      11110000000          11110000000  ->  0\r
+dqxor027 xor       1110000000           1110000000  ->  0\r
+dqxor028 xor        110000000            110000000  ->  0\r
+dqxor029 xor         10000000             10000000  ->  0\r
+dqxor030 xor          1000000              1000000  ->  0\r
+dqxor031 xor           100000               100000  ->  0\r
+dqxor032 xor            10000                10000  ->  0\r
+dqxor033 xor             1000                 1000  ->  0\r
+dqxor034 xor              100                  100  ->  0\r
+dqxor035 xor               10                   10  ->  0\r
+dqxor036 xor                1                    1  ->  0\r
+\r
+dqxor040 xor 111111111  111111111111  ->  111000000000\r
+dqxor041 xor  11111111  111111111111  ->  111100000000\r
+dqxor042 xor  11111111     111111111  ->  100000000\r
+dqxor043 xor   1111111     100000010  ->  101111101\r
+dqxor044 xor    111111     100000100  ->  100111011\r
+dqxor045 xor     11111     100001000  ->  100010111\r
+dqxor046 xor      1111     100010000  ->  100011111\r
+dqxor047 xor       111     100100000  ->  100100111\r
+dqxor048 xor        11     101000000  ->  101000011\r
+dqxor049 xor         1     110000000  ->  110000001\r
+\r
+dqxor050 xor 1111111111  1  ->  1111111110\r
+dqxor051 xor  111111111  1  ->  111111110\r
+dqxor052 xor   11111111  1  ->  11111110\r
+dqxor053 xor    1111111  1  ->  1111110\r
+dqxor054 xor     111111  1  ->  111110\r
+dqxor055 xor      11111  1  ->  11110\r
+dqxor056 xor       1111  1  ->  1110\r
+dqxor057 xor        111  1  ->  110\r
+dqxor058 xor         11  1  ->  10\r
+dqxor059 xor          1  1  ->  0\r
+\r
+dqxor060 xor 1111111111  0  ->  1111111111\r
+dqxor061 xor  111111111  0  ->  111111111\r
+dqxor062 xor   11111111  0  ->  11111111\r
+dqxor063 xor    1111111  0  ->  1111111\r
+dqxor064 xor     111111  0  ->  111111\r
+dqxor065 xor      11111  0  ->  11111\r
+dqxor066 xor       1111  0  ->  1111\r
+dqxor067 xor        111  0  ->  111\r
+dqxor068 xor         11  0  ->  11\r
+dqxor069 xor          1  0  ->  1\r
+\r
+dqxor070 xor 1  1111111111  ->  1111111110\r
+dqxor071 xor 1   111111111  ->  111111110\r
+dqxor072 xor 1    11111111  ->  11111110\r
+dqxor073 xor 1     1111111  ->  1111110\r
+dqxor074 xor 1      111111  ->  111110\r
+dqxor075 xor 1       11111  ->  11110\r
+dqxor076 xor 1        1111  ->  1110\r
+dqxor077 xor 1         111  ->  110\r
+dqxor078 xor 1          11  ->  10\r
+dqxor079 xor 1           1  ->  0\r
+\r
+dqxor080 xor 0  1111111111  ->  1111111111\r
+dqxor081 xor 0   111111111  ->  111111111\r
+dqxor082 xor 0    11111111  ->  11111111\r
+dqxor083 xor 0     1111111  ->  1111111\r
+dqxor084 xor 0      111111  ->  111111\r
+dqxor085 xor 0       11111  ->  11111\r
+dqxor086 xor 0        1111  ->  1111\r
+dqxor087 xor 0         111  ->  111\r
+dqxor088 xor 0          11  ->  11\r
+dqxor089 xor 0           1  ->  1\r
+\r
+dqxor090 xor 011111111  111101111  ->  100010000\r
+dqxor091 xor 101111111  111101111  ->   10010000\r
+dqxor092 xor 110111111  111101111  ->    1010000\r
+dqxor093 xor 111011111  111101111  ->     110000\r
+dqxor094 xor 111101111  111101111  ->          0\r
+dqxor095 xor 111110111  111101111  ->      11000\r
+dqxor096 xor 111111011  111101111  ->      10100\r
+dqxor097 xor 111111101  111101111  ->      10010\r
+dqxor098 xor 111111110  111101111  ->      10001\r
+\r
+dqxor100 xor 111101111  011111111  ->  100010000\r
+dqxor101 xor 111101111  101111111  ->   10010000\r
+dqxor102 xor 111101111  110111111  ->    1010000\r
+dqxor103 xor 111101111  111011111  ->     110000\r
+dqxor104 xor 111101111  111101111  ->          0\r
+dqxor105 xor 111101111  111110111  ->      11000\r
+dqxor106 xor 111101111  111111011  ->      10100\r
+dqxor107 xor 111101111  111111101  ->      10010\r
+dqxor108 xor 111101111  111111110  ->      10001\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+dqxor220 xor 111111112  111111111  ->  NaN Invalid_operation\r
+dqxor221 xor 333333333  333333333  ->  NaN Invalid_operation\r
+dqxor222 xor 555555555  555555555  ->  NaN Invalid_operation\r
+dqxor223 xor 777777777  777777777  ->  NaN Invalid_operation\r
+dqxor224 xor 999999999  999999999  ->  NaN Invalid_operation\r
+dqxor225 xor 222222222  999999999  ->  NaN Invalid_operation\r
+dqxor226 xor 444444444  999999999  ->  NaN Invalid_operation\r
+dqxor227 xor 666666666  999999999  ->  NaN Invalid_operation\r
+dqxor228 xor 888888888  999999999  ->  NaN Invalid_operation\r
+dqxor229 xor 999999999  222222222  ->  NaN Invalid_operation\r
+dqxor230 xor 999999999  444444444  ->  NaN Invalid_operation\r
+dqxor231 xor 999999999  666666666  ->  NaN Invalid_operation\r
+dqxor232 xor 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+dqxor240 xor  567468689 -934981942 ->  NaN Invalid_operation\r
+dqxor241 xor  567367689  934981942 ->  NaN Invalid_operation\r
+dqxor242 xor -631917772 -706014634 ->  NaN Invalid_operation\r
+dqxor243 xor -756253257  138579234 ->  NaN Invalid_operation\r
+dqxor244 xor  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+dqxor250 xor  2000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor251 xor  7000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor252 xor  8000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor253 xor  9000000111000111000111000000000000 1000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor254 xor  2000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor255 xor  7000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor256 xor  8000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor257 xor  9000000111000111000111000000000000 0000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor258 xor  1000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor259 xor  1000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor260 xor  1000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor261 xor  1000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor262 xor  0000000111000111000111000000000000 2000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor263 xor  0000000111000111000111000000000000 7000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor264 xor  0000000111000111000111000000000000 8000000111000111000111000000000000 ->  NaN Invalid_operation\r
+dqxor265 xor  0000000111000111000111000000000000 9000000111000111000111000000000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+dqxor270 xor  0200000111000111000111001000000000 1000000111000111000111100000000010 ->  NaN Invalid_operation\r
+dqxor271 xor  0700000111000111000111000100000000 1000000111000111000111010000000100 ->  NaN Invalid_operation\r
+dqxor272 xor  0800000111000111000111000010000000 1000000111000111000111001000001000 ->  NaN Invalid_operation\r
+dqxor273 xor  0900000111000111000111000001000000 1000000111000111000111000100010000 ->  NaN Invalid_operation\r
+dqxor274 xor  1000000111000111000111000000100000 0200000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqxor275 xor  1000000111000111000111000000010000 0700000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqxor276 xor  1000000111000111000111000000001000 0800000111000111000111000010100000 ->  NaN Invalid_operation\r
+dqxor277 xor  1000000111000111000111000000000100 0900000111000111000111000000010000 ->  NaN Invalid_operation\r
+-- test LSD\r
+dqxor280 xor  0010000111000111000111000000000002 1000000111000111000111000100000001 ->  NaN Invalid_operation\r
+dqxor281 xor  0001000111000111000111000000000007 1000000111000111000111001000000011 ->  NaN Invalid_operation\r
+dqxor282 xor  0000000111000111000111100000000008 1000000111000111000111010000000001 ->  NaN Invalid_operation\r
+dqxor283 xor  0000000111000111000111010000000009 1000000111000111000111100000000001 ->  NaN Invalid_operation\r
+dqxor284 xor  1000000111000111000111001000000000 0001000111000111000111000000000002 ->  NaN Invalid_operation\r
+dqxor285 xor  1000000111000111000111000100000000 0010000111000111000111000000000007 ->  NaN Invalid_operation\r
+dqxor286 xor  1000000111000111000111000010000000 0100000111000111000111000000000008 ->  NaN Invalid_operation\r
+dqxor287 xor  1000000111000111000111000001000000 1000000111000111000111000000000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+dqxor288 xor  0010000111000111000111000020000000 1000000111000111000111001000000000 ->  NaN Invalid_operation\r
+dqxor289 xor  0001000111000111000111000070000001 1000000111000111000111000100000000 ->  NaN Invalid_operation\r
+dqxor290 xor  0000000111000111000111100080000010 1000000111000111000111000010000000 ->  NaN Invalid_operation\r
+dqxor291 xor  0000000111000111000111010090000100 1000000111000111000111000001000000 ->  NaN Invalid_operation\r
+dqxor292 xor  1000000111000111000111001000001000 0000000111000111000111000020100000 ->  NaN Invalid_operation\r
+dqxor293 xor  1000000111000111000111000100010000 0000000111000111000111000070010000 ->  NaN Invalid_operation\r
+dqxor294 xor  1000000111000111000111000010100000 0000000111000111000111000080001000 ->  NaN Invalid_operation\r
+dqxor295 xor  1000000111000111000111000001000000 0000000111000111000111000090000100 ->  NaN Invalid_operation\r
+-- signs\r
+dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 ->  NaN Invalid_operation\r
+dqxor297 xor -1000000111000111000111000001000000  0000001110001110001110000010000100 ->  NaN Invalid_operation\r
+dqxor298 xor  1000000111000111000111000001000000 -0000001110001110001110001000000100 ->  NaN Invalid_operation\r
+dqxor299 xor  1000000111000111000111000001000000  0000001110001110001110000011000100 ->  1000001001001001001001000010000100\r
+\r
+-- Nmax, Nmin, Ntiny-like\r
+dqxor331 xor  2   9.99999999E+999     -> NaN Invalid_operation\r
+dqxor332 xor  3   1E-999              -> NaN Invalid_operation\r
+dqxor333 xor  4   1.00000000E-2821    -> NaN Invalid_operation\r
+dqxor334 xor  5   1E-900              -> NaN Invalid_operation\r
+dqxor335 xor  6   -1E-900             -> NaN Invalid_operation\r
+dqxor336 xor  7   -1.00000000E-999    -> NaN Invalid_operation\r
+dqxor337 xor  8   -1E-999             -> NaN Invalid_operation\r
+dqxor338 xor  9   -9.99999999E+999    -> NaN Invalid_operation\r
+dqxor341 xor  9.99999999E+999     -18 -> NaN Invalid_operation\r
+dqxor342 xor  1E-999               01 -> NaN Invalid_operation\r
+dqxor343 xor  1.00000000E-999     -18 -> NaN Invalid_operation\r
+dqxor344 xor  1E-908               18 -> NaN Invalid_operation\r
+dqxor345 xor  -1E-907             -10 -> NaN Invalid_operation\r
+dqxor346 xor  -1.00000000E-999     18 -> NaN Invalid_operation\r
+dqxor347 xor  -1E-999              10 -> NaN Invalid_operation\r
+dqxor348 xor  -9.99999999E+2991   -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+dqxor361 xor  1.0                  1  -> NaN Invalid_operation\r
+dqxor362 xor  1E+1                 1  -> NaN Invalid_operation\r
+dqxor363 xor  0.0                  1  -> NaN Invalid_operation\r
+dqxor364 xor  0E+1                 1  -> NaN Invalid_operation\r
+dqxor365 xor  9.9                  1  -> NaN Invalid_operation\r
+dqxor366 xor  9E+1                 1  -> NaN Invalid_operation\r
+dqxor371 xor  0 1.0                   -> NaN Invalid_operation\r
+dqxor372 xor  0 1E+1                  -> NaN Invalid_operation\r
+dqxor373 xor  0 0.0                   -> NaN Invalid_operation\r
+dqxor374 xor  0 0E+1                  -> NaN Invalid_operation\r
+dqxor375 xor  0 9.9                   -> NaN Invalid_operation\r
+dqxor376 xor  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+dqxor780 xor -Inf  -Inf   -> NaN Invalid_operation\r
+dqxor781 xor -Inf  -1000  -> NaN Invalid_operation\r
+dqxor782 xor -Inf  -1     -> NaN Invalid_operation\r
+dqxor783 xor -Inf  -0     -> NaN Invalid_operation\r
+dqxor784 xor -Inf   0     -> NaN Invalid_operation\r
+dqxor785 xor -Inf   1     -> NaN Invalid_operation\r
+dqxor786 xor -Inf   1000  -> NaN Invalid_operation\r
+dqxor787 xor -1000 -Inf   -> NaN Invalid_operation\r
+dqxor788 xor -Inf  -Inf   -> NaN Invalid_operation\r
+dqxor789 xor -1    -Inf   -> NaN Invalid_operation\r
+dqxor790 xor -0    -Inf   -> NaN Invalid_operation\r
+dqxor791 xor  0    -Inf   -> NaN Invalid_operation\r
+dqxor792 xor  1    -Inf   -> NaN Invalid_operation\r
+dqxor793 xor  1000 -Inf   -> NaN Invalid_operation\r
+dqxor794 xor  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+dqxor800 xor  Inf  -Inf   -> NaN Invalid_operation\r
+dqxor801 xor  Inf  -1000  -> NaN Invalid_operation\r
+dqxor802 xor  Inf  -1     -> NaN Invalid_operation\r
+dqxor803 xor  Inf  -0     -> NaN Invalid_operation\r
+dqxor804 xor  Inf   0     -> NaN Invalid_operation\r
+dqxor805 xor  Inf   1     -> NaN Invalid_operation\r
+dqxor806 xor  Inf   1000  -> NaN Invalid_operation\r
+dqxor807 xor  Inf   Inf   -> NaN Invalid_operation\r
+dqxor808 xor -1000  Inf   -> NaN Invalid_operation\r
+dqxor809 xor -Inf   Inf   -> NaN Invalid_operation\r
+dqxor810 xor -1     Inf   -> NaN Invalid_operation\r
+dqxor811 xor -0     Inf   -> NaN Invalid_operation\r
+dqxor812 xor  0     Inf   -> NaN Invalid_operation\r
+dqxor813 xor  1     Inf   -> NaN Invalid_operation\r
+dqxor814 xor  1000  Inf   -> NaN Invalid_operation\r
+dqxor815 xor  Inf   Inf   -> NaN Invalid_operation\r
+\r
+dqxor821 xor  NaN -Inf    -> NaN Invalid_operation\r
+dqxor822 xor  NaN -1000   -> NaN Invalid_operation\r
+dqxor823 xor  NaN -1      -> NaN Invalid_operation\r
+dqxor824 xor  NaN -0      -> NaN Invalid_operation\r
+dqxor825 xor  NaN  0      -> NaN Invalid_operation\r
+dqxor826 xor  NaN  1      -> NaN Invalid_operation\r
+dqxor827 xor  NaN  1000   -> NaN Invalid_operation\r
+dqxor828 xor  NaN  Inf    -> NaN Invalid_operation\r
+dqxor829 xor  NaN  NaN    -> NaN Invalid_operation\r
+dqxor830 xor -Inf  NaN    -> NaN Invalid_operation\r
+dqxor831 xor -1000 NaN    -> NaN Invalid_operation\r
+dqxor832 xor -1    NaN    -> NaN Invalid_operation\r
+dqxor833 xor -0    NaN    -> NaN Invalid_operation\r
+dqxor834 xor  0    NaN    -> NaN Invalid_operation\r
+dqxor835 xor  1    NaN    -> NaN Invalid_operation\r
+dqxor836 xor  1000 NaN    -> NaN Invalid_operation\r
+dqxor837 xor  Inf  NaN    -> NaN Invalid_operation\r
+\r
+dqxor841 xor  sNaN -Inf   ->  NaN  Invalid_operation\r
+dqxor842 xor  sNaN -1000  ->  NaN  Invalid_operation\r
+dqxor843 xor  sNaN -1     ->  NaN  Invalid_operation\r
+dqxor844 xor  sNaN -0     ->  NaN  Invalid_operation\r
+dqxor845 xor  sNaN  0     ->  NaN  Invalid_operation\r
+dqxor846 xor  sNaN  1     ->  NaN  Invalid_operation\r
+dqxor847 xor  sNaN  1000  ->  NaN  Invalid_operation\r
+dqxor848 xor  sNaN  NaN   ->  NaN  Invalid_operation\r
+dqxor849 xor  sNaN sNaN   ->  NaN  Invalid_operation\r
+dqxor850 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+dqxor851 xor -Inf  sNaN   ->  NaN  Invalid_operation\r
+dqxor852 xor -1000 sNaN   ->  NaN  Invalid_operation\r
+dqxor853 xor -1    sNaN   ->  NaN  Invalid_operation\r
+dqxor854 xor -0    sNaN   ->  NaN  Invalid_operation\r
+dqxor855 xor  0    sNaN   ->  NaN  Invalid_operation\r
+dqxor856 xor  1    sNaN   ->  NaN  Invalid_operation\r
+dqxor857 xor  1000 sNaN   ->  NaN  Invalid_operation\r
+dqxor858 xor  Inf  sNaN   ->  NaN  Invalid_operation\r
+dqxor859 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+dqxor861 xor  NaN1   -Inf    -> NaN Invalid_operation\r
+dqxor862 xor +NaN2   -1000   -> NaN Invalid_operation\r
+dqxor863 xor  NaN3    1000   -> NaN Invalid_operation\r
+dqxor864 xor  NaN4    Inf    -> NaN Invalid_operation\r
+dqxor865 xor  NaN5   +NaN6   -> NaN Invalid_operation\r
+dqxor866 xor -Inf     NaN7   -> NaN Invalid_operation\r
+dqxor867 xor -1000    NaN8   -> NaN Invalid_operation\r
+dqxor868 xor  1000    NaN9   -> NaN Invalid_operation\r
+dqxor869 xor  Inf    +NaN10  -> NaN Invalid_operation\r
+dqxor871 xor  sNaN11  -Inf   -> NaN Invalid_operation\r
+dqxor872 xor  sNaN12  -1000  -> NaN Invalid_operation\r
+dqxor873 xor  sNaN13   1000  -> NaN Invalid_operation\r
+dqxor874 xor  sNaN14   NaN17 -> NaN Invalid_operation\r
+dqxor875 xor  sNaN15  sNaN18 -> NaN Invalid_operation\r
+dqxor876 xor  NaN16   sNaN19 -> NaN Invalid_operation\r
+dqxor877 xor -Inf    +sNaN20 -> NaN Invalid_operation\r
+dqxor878 xor -1000    sNaN21 -> NaN Invalid_operation\r
+dqxor879 xor  1000    sNaN22 -> NaN Invalid_operation\r
+dqxor880 xor  Inf     sNaN23 -> NaN Invalid_operation\r
+dqxor881 xor +NaN25  +sNaN24 -> NaN Invalid_operation\r
+dqxor882 xor -NaN26    NaN28 -> NaN Invalid_operation\r
+dqxor883 xor -sNaN27  sNaN29 -> NaN Invalid_operation\r
+dqxor884 xor  1000    -NaN30 -> NaN Invalid_operation\r
+dqxor885 xor  1000   -sNaN31 -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/dsBase.decTest b/Lib/test/decimaltestdata/dsBase.decTest
new file mode 100644 (file)
index 0000000..d0632fd
--- /dev/null
@@ -0,0 +1,1061 @@
+------------------------------------------------------------------------\r
+-- dsBase.decTest -- base decSingle <--> string conversions           --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This file tests base conversions from string to a decimal number\r
+-- and back to a string (in Scientific form)\r
+\r
+-- Note that unlike other operations the operand is subject to rounding\r
+-- to conform to emax and precision settings (that is, numbers will\r
+-- conform to rules and exponent will be in permitted range).  The\r
+-- 'left hand side', therefore, may have numbers that cannot be\r
+-- represented in a decSingle.  Some testcases go to the limit of the\r
+-- next-wider format, and hence these testcases may also be used to\r
+-- test narrowing and widening operations.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   7\r
+maxExponent: 96\r
+minExponent: -95\r
+rounding:    half_even\r
+\r
+dsbas001 toSci       0 -> 0\r
+dsbas002 toSci       1 -> 1\r
+dsbas003 toSci     1.0 -> 1.0\r
+dsbas004 toSci    1.00 -> 1.00\r
+dsbas005 toSci      10 -> 10\r
+dsbas006 toSci    1000 -> 1000\r
+dsbas007 toSci    10.0 -> 10.0\r
+dsbas008 toSci    10.1 -> 10.1\r
+dsbas009 toSci    10.4 -> 10.4\r
+dsbas010 toSci    10.5 -> 10.5\r
+dsbas011 toSci    10.6 -> 10.6\r
+dsbas012 toSci    10.9 -> 10.9\r
+dsbas013 toSci    11.0 -> 11.0\r
+dsbas014 toSci  1.234 -> 1.234\r
+dsbas015 toSci  0.123 -> 0.123\r
+dsbas016 toSci  0.012 -> 0.012\r
+dsbas017 toSci  -0    -> -0\r
+dsbas018 toSci  -0.0  -> -0.0\r
+dsbas019 toSci -00.00 -> -0.00\r
+\r
+dsbas021 toSci     -1 -> -1\r
+dsbas022 toSci   -1.0 -> -1.0\r
+dsbas023 toSci   -0.1 -> -0.1\r
+dsbas024 toSci   -9.1 -> -9.1\r
+dsbas025 toSci   -9.11 -> -9.11\r
+dsbas026 toSci   -9.119 -> -9.119\r
+dsbas027 toSci   -9.999 -> -9.999\r
+\r
+dsbas030 toSci  '1234.567'   -> '1234.567'\r
+dsbas031 toSci  '1234.000'   -> '1234.000'\r
+dsbas032 toSci   '1234912'   -> '1234912'\r
+dsbas033 toSci   '0.00001234567'   -> '0.00001234567'\r
+dsbas034 toSci  '0.000001234567'   -> '0.000001234567'\r
+dsbas035 toSci '0.0000001234567'   -> '1.234567E-7'\r
+dsbas036 toSci '0.00000001234567'  -> '1.234567E-8'\r
+\r
+dsbas037 toSci '0.1234564'   -> '0.1234564'\r
+dsbas038 toSci '0.1234565'   -> '0.1234565'\r
+\r
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)\r
+dsbsn001 toSci -9.999999E+96 -> -9.999999E+96\r
+dsbsn002 toSci -1E-95 -> -1E-95\r
+dsbsn003 toSci -1E-101 -> -1E-101 Subnormal\r
+dsbsn004 toSci -0 -> -0\r
+dsbsn005 toSci +0 ->  0\r
+dsbsn006 toSci +1E-101 ->  1E-101 Subnormal\r
+dsbsn007 toSci +1E-95 ->  1E-95\r
+dsbsn008 toSci +9.999999E+96 ->  9.999999E+96\r
+\r
+-- String [many more examples are implicitly tested elsewhere]\r
+-- strings without E cannot generate E in result\r
+dsbas040 toSci "12"        -> '12'\r
+dsbas041 toSci "-76"       -> '-76'\r
+dsbas042 toSci "12.76"     -> '12.76'\r
+dsbas043 toSci "+12.76"    -> '12.76'\r
+dsbas044 toSci "012.76"    -> '12.76'\r
+dsbas045 toSci "+0.003"    -> '0.003'\r
+dsbas046 toSci "17."       -> '17'\r
+dsbas047 toSci ".5"        -> '0.5'\r
+dsbas048 toSci "044"       -> '44'\r
+dsbas049 toSci "0044"      -> '44'\r
+dsbas050 toSci "0.0005"      -> '0.0005'\r
+dsbas051 toSci "00.00005"    -> '0.00005'\r
+dsbas052 toSci "0.000005"    -> '0.000005'\r
+dsbas053 toSci "0.0000050"   -> '0.0000050'\r
+dsbas054 toSci "0.0000005"   -> '5E-7'\r
+dsbas055 toSci "0.00000005"  -> '5E-8'\r
+dsbas056 toSci "12678.54" -> '12678.54'\r
+dsbas057 toSci "2678.543" -> '2678.543'\r
+dsbas058 toSci "345678.5" -> '345678.5'\r
+dsbas059 toSci "0678.5432" -> '678.5432'\r
+dsbas060 toSci "678.5432" -> '678.5432'\r
+dsbas061 toSci "+678.5432" -> '678.5432'\r
+dsbas062 toSci "+0678.5432" -> '678.5432'\r
+dsbas063 toSci "+00678.5432" -> '678.5432'\r
+dsbas064 toSci "-678.5432"  -> '-678.5432'\r
+dsbas065 toSci "-0678.5432"  -> '-678.5432'\r
+dsbas066 toSci "-00678.5432"  -> '-678.5432'\r
+-- examples\r
+dsbas067 toSci "5E-6"        -> '0.000005'\r
+dsbas068 toSci "50E-7"       -> '0.0000050'\r
+dsbas069 toSci "5E-7"        -> '5E-7'\r
+\r
+-- [No exotics as no Unicode]\r
+\r
+-- rounded with dots in all (including edge) places\r
+dsbas071 toSci  .1234567890123456  -> 0.1234568 Inexact Rounded\r
+dsbas072 toSci  1.234567890123456  -> 1.234568 Inexact Rounded\r
+dsbas073 toSci  12.34567890123456  -> 12.34568 Inexact Rounded\r
+dsbas074 toSci  123.4567890123456  -> 123.4568 Inexact Rounded\r
+dsbas075 toSci  1234.567890123456  -> 1234.568 Inexact Rounded\r
+dsbas076 toSci  12345.67890123456  -> 12345.68 Inexact Rounded\r
+dsbas077 toSci  123456.7890123456  -> 123456.8 Inexact Rounded\r
+dsbas078 toSci  1234567.890123456  -> 1234568  Inexact Rounded\r
+dsbas079 toSci  12345678.90123456  -> 1.234568E+7 Inexact Rounded\r
+dsbas080 toSci  123456789.0123456  -> 1.234568E+8 Inexact Rounded\r
+dsbas081 toSci  1234567890.123456  -> 1.234568E+9 Inexact Rounded\r
+dsbas082 toSci  12345678901.23456  -> 1.234568E+10 Inexact Rounded\r
+dsbas083 toSci  123456789012.3456  -> 1.234568E+11 Inexact Rounded\r
+dsbas084 toSci  1234567890123.456  -> 1.234568E+12 Inexact Rounded\r
+dsbas085 toSci  12345678901234.56  -> 1.234568E+13 Inexact Rounded\r
+dsbas086 toSci  123456789012345.6  -> 1.234568E+14 Inexact Rounded\r
+dsbas087 toSci  1234567890123456.  -> 1.234568E+15 Inexact Rounded\r
+dsbas088 toSci  1234567890123456   -> 1.234568E+15 Inexact Rounded\r
+\r
+-- Numbers with E\r
+dsbas130 toSci "0.000E-1"  -> '0.0000'\r
+dsbas131 toSci "0.000E-2"  -> '0.00000'\r
+dsbas132 toSci "0.000E-3"  -> '0.000000'\r
+dsbas133 toSci "0.000E-4"  -> '0E-7'\r
+dsbas134 toSci "0.00E-2"   -> '0.0000'\r
+dsbas135 toSci "0.00E-3"   -> '0.00000'\r
+dsbas136 toSci "0.00E-4"   -> '0.000000'\r
+dsbas137 toSci "0.00E-5"   -> '0E-7'\r
+dsbas138 toSci "+0E+9"     -> '0E+9'\r
+dsbas139 toSci "-0E+9"     -> '-0E+9'\r
+dsbas140 toSci "1E+9"      -> '1E+9'\r
+dsbas141 toSci "1e+09"     -> '1E+9'\r
+dsbas142 toSci "1E+90"     -> '1E+90'\r
+dsbas143 toSci "+1E+009"   -> '1E+9'\r
+dsbas144 toSci "0E+9"      -> '0E+9'\r
+dsbas145 toSci "1E+9"      -> '1E+9'\r
+dsbas146 toSci "1E+09"     -> '1E+9'\r
+dsbas147 toSci "1e+90"     -> '1E+90'\r
+dsbas148 toSci "1E+009"    -> '1E+9'\r
+dsbas149 toSci "000E+9"    -> '0E+9'\r
+dsbas150 toSci "1E9"       -> '1E+9'\r
+dsbas151 toSci "1e09"      -> '1E+9'\r
+dsbas152 toSci "1E90"      -> '1E+90'\r
+dsbas153 toSci "1E009"     -> '1E+9'\r
+dsbas154 toSci "0E9"       -> '0E+9'\r
+dsbas155 toSci "0.000e+0"  -> '0.000'\r
+dsbas156 toSci "0.000E-1"  -> '0.0000'\r
+dsbas157 toSci "4E+9"      -> '4E+9'\r
+dsbas158 toSci "44E+9"     -> '4.4E+10'\r
+dsbas159 toSci "0.73e-7"   -> '7.3E-8'\r
+dsbas160 toSci "00E+9"     -> '0E+9'\r
+dsbas161 toSci "00E-9"     -> '0E-9'\r
+dsbas162 toSci "10E+9"     -> '1.0E+10'\r
+dsbas163 toSci "10E+09"    -> '1.0E+10'\r
+dsbas164 toSci "10e+90"    -> '1.0E+91'\r
+dsbas165 toSci "10E+009"   -> '1.0E+10'\r
+dsbas166 toSci "100e+9"    -> '1.00E+11'\r
+dsbas167 toSci "100e+09"   -> '1.00E+11'\r
+dsbas168 toSci "100E+90"   -> '1.00E+92'\r
+dsbas169 toSci "100e+009"  -> '1.00E+11'\r
+\r
+dsbas170 toSci "1.265"     -> '1.265'\r
+dsbas171 toSci "1.265E-20" -> '1.265E-20'\r
+dsbas172 toSci "1.265E-8"  -> '1.265E-8'\r
+dsbas173 toSci "1.265E-4"  -> '0.0001265'\r
+dsbas174 toSci "1.265E-3"  -> '0.001265'\r
+dsbas175 toSci "1.265E-2"  -> '0.01265'\r
+dsbas176 toSci "1.265E-1"  -> '0.1265'\r
+dsbas177 toSci "1.265E-0"  -> '1.265'\r
+dsbas178 toSci "1.265E+1"  -> '12.65'\r
+dsbas179 toSci "1.265E+2"  -> '126.5'\r
+dsbas180 toSci "1.265E+3"  -> '1265'\r
+dsbas181 toSci "1.265E+4"  -> '1.265E+4'\r
+dsbas182 toSci "1.265E+8"  -> '1.265E+8'\r
+dsbas183 toSci "1.265E+20" -> '1.265E+20'\r
+\r
+dsbas190 toSci "12.65"     -> '12.65'\r
+dsbas191 toSci "12.65E-20" -> '1.265E-19'\r
+dsbas192 toSci "12.65E-8"  -> '1.265E-7'\r
+dsbas193 toSci "12.65E-4"  -> '0.001265'\r
+dsbas194 toSci "12.65E-3"  -> '0.01265'\r
+dsbas195 toSci "12.65E-2"  -> '0.1265'\r
+dsbas196 toSci "12.65E-1"  -> '1.265'\r
+dsbas197 toSci "12.65E-0"  -> '12.65'\r
+dsbas198 toSci "12.65E+1"  -> '126.5'\r
+dsbas199 toSci "12.65E+2"  -> '1265'\r
+dsbas200 toSci "12.65E+3"  -> '1.265E+4'\r
+dsbas201 toSci "12.65E+4"  -> '1.265E+5'\r
+dsbas202 toSci "12.65E+8"  -> '1.265E+9'\r
+dsbas203 toSci "12.65E+20" -> '1.265E+21'\r
+\r
+dsbas210 toSci "126.5"     -> '126.5'\r
+dsbas211 toSci "126.5E-20" -> '1.265E-18'\r
+dsbas212 toSci "126.5E-8"  -> '0.000001265'\r
+dsbas213 toSci "126.5E-4"  -> '0.01265'\r
+dsbas214 toSci "126.5E-3"  -> '0.1265'\r
+dsbas215 toSci "126.5E-2"  -> '1.265'\r
+dsbas216 toSci "126.5E-1"  -> '12.65'\r
+dsbas217 toSci "126.5E-0"  -> '126.5'\r
+dsbas218 toSci "126.5E+1"  -> '1265'\r
+dsbas219 toSci "126.5E+2"  -> '1.265E+4'\r
+dsbas220 toSci "126.5E+3"  -> '1.265E+5'\r
+dsbas221 toSci "126.5E+4"  -> '1.265E+6'\r
+dsbas222 toSci "126.5E+8"  -> '1.265E+10'\r
+dsbas223 toSci "126.5E+20" -> '1.265E+22'\r
+\r
+dsbas230 toSci "1265"     -> '1265'\r
+dsbas231 toSci "1265E-20" -> '1.265E-17'\r
+dsbas232 toSci "1265E-8"  -> '0.00001265'\r
+dsbas233 toSci "1265E-4"  -> '0.1265'\r
+dsbas234 toSci "1265E-3"  -> '1.265'\r
+dsbas235 toSci "1265E-2"  -> '12.65'\r
+dsbas236 toSci "1265E-1"  -> '126.5'\r
+dsbas237 toSci "1265E-0"  -> '1265'\r
+dsbas238 toSci "1265E+1"  -> '1.265E+4'\r
+dsbas239 toSci "1265E+2"  -> '1.265E+5'\r
+dsbas240 toSci "1265E+3"  -> '1.265E+6'\r
+dsbas241 toSci "1265E+4"  -> '1.265E+7'\r
+dsbas242 toSci "1265E+8"  -> '1.265E+11'\r
+dsbas243 toSci "1265E+20" -> '1.265E+23'\r
+\r
+dsbas250 toSci "0.1265"     -> '0.1265'\r
+dsbas251 toSci "0.1265E-20" -> '1.265E-21'\r
+dsbas252 toSci "0.1265E-8"  -> '1.265E-9'\r
+dsbas253 toSci "0.1265E-4"  -> '0.00001265'\r
+dsbas254 toSci "0.1265E-3"  -> '0.0001265'\r
+dsbas255 toSci "0.1265E-2"  -> '0.001265'\r
+dsbas256 toSci "0.1265E-1"  -> '0.01265'\r
+dsbas257 toSci "0.1265E-0"  -> '0.1265'\r
+dsbas258 toSci "0.1265E+1"  -> '1.265'\r
+dsbas259 toSci "0.1265E+2"  -> '12.65'\r
+dsbas260 toSci "0.1265E+3"  -> '126.5'\r
+dsbas261 toSci "0.1265E+4"  -> '1265'\r
+dsbas262 toSci "0.1265E+8"  -> '1.265E+7'\r
+dsbas263 toSci "0.1265E+20" -> '1.265E+19'\r
+\r
+-- some more negative zeros [systematic tests below]\r
+dsbas290 toSci "-0.000E-1"  -> '-0.0000'\r
+dsbas291 toSci "-0.000E-2"  -> '-0.00000'\r
+dsbas292 toSci "-0.000E-3"  -> '-0.000000'\r
+dsbas293 toSci "-0.000E-4"  -> '-0E-7'\r
+dsbas294 toSci "-0.00E-2"   -> '-0.0000'\r
+dsbas295 toSci "-0.00E-3"   -> '-0.00000'\r
+dsbas296 toSci "-0.0E-2"    -> '-0.000'\r
+dsbas297 toSci "-0.0E-3"    -> '-0.0000'\r
+dsbas298 toSci "-0E-2"      -> '-0.00'\r
+dsbas299 toSci "-0E-3"      -> '-0.000'\r
+\r
+-- Engineering notation tests\r
+dsbas301  toSci 10e12  -> 1.0E+13\r
+dsbas302  toEng 10e12  -> 10E+12\r
+dsbas303  toSci 10e11  -> 1.0E+12\r
+dsbas304  toEng 10e11  -> 1.0E+12\r
+dsbas305  toSci 10e10  -> 1.0E+11\r
+dsbas306  toEng 10e10  -> 100E+9\r
+dsbas307  toSci 10e9   -> 1.0E+10\r
+dsbas308  toEng 10e9   -> 10E+9\r
+dsbas309  toSci 10e8   -> 1.0E+9\r
+dsbas310  toEng 10e8   -> 1.0E+9\r
+dsbas311  toSci 10e7   -> 1.0E+8\r
+dsbas312  toEng 10e7   -> 100E+6\r
+dsbas313  toSci 10e6   -> 1.0E+7\r
+dsbas314  toEng 10e6   -> 10E+6\r
+dsbas315  toSci 10e5   -> 1.0E+6\r
+dsbas316  toEng 10e5   -> 1.0E+6\r
+dsbas317  toSci 10e4   -> 1.0E+5\r
+dsbas318  toEng 10e4   -> 100E+3\r
+dsbas319  toSci 10e3   -> 1.0E+4\r
+dsbas320  toEng 10e3   -> 10E+3\r
+dsbas321  toSci 10e2   -> 1.0E+3\r
+dsbas322  toEng 10e2   -> 1.0E+3\r
+dsbas323  toSci 10e1   -> 1.0E+2\r
+dsbas324  toEng 10e1   -> 100\r
+dsbas325  toSci 10e0   -> 10\r
+dsbas326  toEng 10e0   -> 10\r
+dsbas327  toSci 10e-1  -> 1.0\r
+dsbas328  toEng 10e-1  -> 1.0\r
+dsbas329  toSci 10e-2  -> 0.10\r
+dsbas330  toEng 10e-2  -> 0.10\r
+dsbas331  toSci 10e-3  -> 0.010\r
+dsbas332  toEng 10e-3  -> 0.010\r
+dsbas333  toSci 10e-4  -> 0.0010\r
+dsbas334  toEng 10e-4  -> 0.0010\r
+dsbas335  toSci 10e-5  -> 0.00010\r
+dsbas336  toEng 10e-5  -> 0.00010\r
+dsbas337  toSci 10e-6  -> 0.000010\r
+dsbas338  toEng 10e-6  -> 0.000010\r
+dsbas339  toSci 10e-7  -> 0.0000010\r
+dsbas340  toEng 10e-7  -> 0.0000010\r
+dsbas341  toSci 10e-8  -> 1.0E-7\r
+dsbas342  toEng 10e-8  -> 100E-9\r
+dsbas343  toSci 10e-9  -> 1.0E-8\r
+dsbas344  toEng 10e-9  -> 10E-9\r
+dsbas345  toSci 10e-10 -> 1.0E-9\r
+dsbas346  toEng 10e-10 -> 1.0E-9\r
+dsbas347  toSci 10e-11 -> 1.0E-10\r
+dsbas348  toEng 10e-11 -> 100E-12\r
+dsbas349  toSci 10e-12 -> 1.0E-11\r
+dsbas350  toEng 10e-12 -> 10E-12\r
+dsbas351  toSci 10e-13 -> 1.0E-12\r
+dsbas352  toEng 10e-13 -> 1.0E-12\r
+\r
+dsbas361  toSci 7E12  -> 7E+12\r
+dsbas362  toEng 7E12  -> 7E+12\r
+dsbas363  toSci 7E11  -> 7E+11\r
+dsbas364  toEng 7E11  -> 700E+9\r
+dsbas365  toSci 7E10  -> 7E+10\r
+dsbas366  toEng 7E10  -> 70E+9\r
+dsbas367  toSci 7E9   -> 7E+9\r
+dsbas368  toEng 7E9   -> 7E+9\r
+dsbas369  toSci 7E8   -> 7E+8\r
+dsbas370  toEng 7E8   -> 700E+6\r
+dsbas371  toSci 7E7   -> 7E+7\r
+dsbas372  toEng 7E7   -> 70E+6\r
+dsbas373  toSci 7E6   -> 7E+6\r
+dsbas374  toEng 7E6   -> 7E+6\r
+dsbas375  toSci 7E5   -> 7E+5\r
+dsbas376  toEng 7E5   -> 700E+3\r
+dsbas377  toSci 7E4   -> 7E+4\r
+dsbas378  toEng 7E4   -> 70E+3\r
+dsbas379  toSci 7E3   -> 7E+3\r
+dsbas380  toEng 7E3   -> 7E+3\r
+dsbas381  toSci 7E2   -> 7E+2\r
+dsbas382  toEng 7E2   -> 700\r
+dsbas383  toSci 7E1   -> 7E+1\r
+dsbas384  toEng 7E1   -> 70\r
+dsbas385  toSci 7E0   -> 7\r
+dsbas386  toEng 7E0   -> 7\r
+dsbas387  toSci 7E-1  -> 0.7\r
+dsbas388  toEng 7E-1  -> 0.7\r
+dsbas389  toSci 7E-2  -> 0.07\r
+dsbas390  toEng 7E-2  -> 0.07\r
+dsbas391  toSci 7E-3  -> 0.007\r
+dsbas392  toEng 7E-3  -> 0.007\r
+dsbas393  toSci 7E-4  -> 0.0007\r
+dsbas394  toEng 7E-4  -> 0.0007\r
+dsbas395  toSci 7E-5  -> 0.00007\r
+dsbas396  toEng 7E-5  -> 0.00007\r
+dsbas397  toSci 7E-6  -> 0.000007\r
+dsbas398  toEng 7E-6  -> 0.000007\r
+dsbas399  toSci 7E-7  -> 7E-7\r
+dsbas400  toEng 7E-7  -> 700E-9\r
+dsbas401  toSci 7E-8  -> 7E-8\r
+dsbas402  toEng 7E-8  -> 70E-9\r
+dsbas403  toSci 7E-9  -> 7E-9\r
+dsbas404  toEng 7E-9  -> 7E-9\r
+dsbas405  toSci 7E-10 -> 7E-10\r
+dsbas406  toEng 7E-10 -> 700E-12\r
+dsbas407  toSci 7E-11 -> 7E-11\r
+dsbas408  toEng 7E-11 -> 70E-12\r
+dsbas409  toSci 7E-12 -> 7E-12\r
+dsbas410  toEng 7E-12 -> 7E-12\r
+dsbas411  toSci 7E-13 -> 7E-13\r
+dsbas412  toEng 7E-13 -> 700E-15\r
+\r
+-- Exacts remain exact up to precision ..\r
+dsbas420  toSci    100 -> 100\r
+dsbas422  toSci   1000 -> 1000\r
+dsbas424  toSci  999.9 ->  999.9\r
+dsbas426  toSci 1000.0 -> 1000.0\r
+dsbas428  toSci 1000.1 -> 1000.1\r
+dsbas430  toSci 10000 -> 10000\r
+dsbas432  toSci 1000        -> 1000\r
+dsbas434  toSci 10000       -> 10000\r
+dsbas436  toSci 100000      -> 100000\r
+dsbas438  toSci 1000000     -> 1000000\r
+dsbas440  toSci 10000000    -> 1.000000E+7   Rounded\r
+dsbas442  toSci 10000000    -> 1.000000E+7   Rounded\r
+dsbas444  toSci 10000003    -> 1.000000E+7   Rounded Inexact\r
+dsbas446  toSci 10000005    -> 1.000000E+7   Rounded Inexact\r
+dsbas448  toSci 100000050   -> 1.000000E+8   Rounded Inexact\r
+dsbas450  toSci 10000009    -> 1.000001E+7   Rounded Inexact\r
+dsbas452  toSci 100000000   -> 1.000000E+8   Rounded\r
+dsbas454  toSci 100000003   -> 1.000000E+8   Rounded Inexact\r
+dsbas456  toSci 100000005   -> 1.000000E+8   Rounded Inexact\r
+dsbas458  toSci 100000009   -> 1.000000E+8   Rounded Inexact\r
+dsbas460  toSci 1000000000  -> 1.000000E+9   Rounded\r
+dsbas462  toSci 1000000300  -> 1.000000E+9   Rounded Inexact\r
+dsbas464  toSci 1000000500  -> 1.000000E+9   Rounded Inexact\r
+dsbas466  toSci 1000000900  -> 1.000001E+9   Rounded Inexact\r
+dsbas468  toSci 10000000000 -> 1.000000E+10  Rounded\r
+dsbas470  toSci 10000003000 -> 1.000000E+10  Rounded Inexact\r
+dsbas472  toSci 10000005000 -> 1.000000E+10  Rounded Inexact\r
+dsbas474  toSci 10000009000 -> 1.000001E+10  Rounded Inexact\r
+\r
+-- check rounding modes heeded\r
+rounding:  ceiling\r
+dsbsr401  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr402  toSci  1.11234549   ->  1.112346  Rounded Inexact\r
+dsbsr403  toSci  1.11234550   ->  1.112346  Rounded Inexact\r
+dsbsr404  toSci  1.11234551   ->  1.112346  Rounded Inexact\r
+rounding:  up\r
+dsbsr405  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr406  toSci  1.11234549   ->  1.112346  Rounded Inexact\r
+dsbsr407  toSci  1.11234550   ->  1.112346  Rounded Inexact\r
+dsbsr408  toSci  1.11234551   ->  1.112346  Rounded Inexact\r
+rounding:  floor\r
+dsbsr410  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr411  toSci  1.11234549   ->  1.112345  Rounded Inexact\r
+dsbsr412  toSci  1.11234550   ->  1.112345  Rounded Inexact\r
+dsbsr413  toSci  1.11234551   ->  1.112345  Rounded Inexact\r
+rounding:  half_down\r
+dsbsr415  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr416  toSci  1.11234549   ->  1.112345  Rounded Inexact\r
+dsbsr417  toSci  1.11234550   ->  1.112345  Rounded Inexact\r
+dsbsr418  toSci  1.11234650   ->  1.112346  Rounded Inexact\r
+dsbsr419  toSci  1.11234551   ->  1.112346  Rounded Inexact\r
+rounding:  half_even\r
+dsbsr421  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr422  toSci  1.11234549   ->  1.112345  Rounded Inexact\r
+dsbsr423  toSci  1.11234550   ->  1.112346  Rounded Inexact\r
+dsbsr424  toSci  1.11234650   ->  1.112346  Rounded Inexact\r
+dsbsr425  toSci  1.11234551   ->  1.112346  Rounded Inexact\r
+rounding:  down\r
+dsbsr426  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr427  toSci  1.11234549   ->  1.112345  Rounded Inexact\r
+dsbsr428  toSci  1.11234550   ->  1.112345  Rounded Inexact\r
+dsbsr429  toSci  1.11234551   ->  1.112345  Rounded Inexact\r
+rounding:  half_up\r
+dsbsr431  toSci  1.1123450    ->  1.112345  Rounded\r
+dsbsr432  toSci  1.11234549   ->  1.112345  Rounded Inexact\r
+dsbsr433  toSci  1.11234550   ->  1.112346  Rounded Inexact\r
+dsbsr434  toSci  1.11234650   ->  1.112347  Rounded Inexact\r
+dsbsr435  toSci  1.11234551   ->  1.112346  Rounded Inexact\r
+-- negatives\r
+rounding:  ceiling\r
+dsbsr501  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr502  toSci -1.11234549   -> -1.112345  Rounded Inexact\r
+dsbsr503  toSci -1.11234550   -> -1.112345  Rounded Inexact\r
+dsbsr504  toSci -1.11234551   -> -1.112345  Rounded Inexact\r
+rounding:  up\r
+dsbsr505  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr506  toSci -1.11234549   -> -1.112346  Rounded Inexact\r
+dsbsr507  toSci -1.11234550   -> -1.112346  Rounded Inexact\r
+dsbsr508  toSci -1.11234551   -> -1.112346  Rounded Inexact\r
+rounding:  floor\r
+dsbsr510  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr511  toSci -1.11234549   -> -1.112346  Rounded Inexact\r
+dsbsr512  toSci -1.11234550   -> -1.112346  Rounded Inexact\r
+dsbsr513  toSci -1.11234551   -> -1.112346  Rounded Inexact\r
+rounding:  half_down\r
+dsbsr515  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr516  toSci -1.11234549   -> -1.112345  Rounded Inexact\r
+dsbsr517  toSci -1.11234550   -> -1.112345  Rounded Inexact\r
+dsbsr518  toSci -1.11234650   -> -1.112346  Rounded Inexact\r
+dsbsr519  toSci -1.11234551   -> -1.112346  Rounded Inexact\r
+rounding:  half_even\r
+dsbsr521  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr522  toSci -1.11234549   -> -1.112345  Rounded Inexact\r
+dsbsr523  toSci -1.11234550   -> -1.112346  Rounded Inexact\r
+dsbsr524  toSci -1.11234650   -> -1.112346  Rounded Inexact\r
+dsbsr525  toSci -1.11234551   -> -1.112346  Rounded Inexact\r
+rounding:  down\r
+dsbsr526  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr527  toSci -1.11234549   -> -1.112345  Rounded Inexact\r
+dsbsr528  toSci -1.11234550   -> -1.112345  Rounded Inexact\r
+dsbsr529  toSci -1.11234551   -> -1.112345  Rounded Inexact\r
+rounding:  half_up\r
+dsbsr531  toSci -1.1123450    -> -1.112345  Rounded\r
+dsbsr532  toSci -1.11234549   -> -1.112345  Rounded Inexact\r
+dsbsr533  toSci -1.11234550   -> -1.112346  Rounded Inexact\r
+dsbsr534  toSci -1.11234650   -> -1.112347  Rounded Inexact\r
+dsbsr535  toSci -1.11234551   -> -1.112346  Rounded Inexact\r
+\r
+rounding:    half_even\r
+\r
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones\r
+dsbas500 toSci '1..2'            -> NaN Conversion_syntax\r
+dsbas501 toSci '.'               -> NaN Conversion_syntax\r
+dsbas502 toSci '..'              -> NaN Conversion_syntax\r
+dsbas503 toSci '++1'             -> NaN Conversion_syntax\r
+dsbas504 toSci '--1'             -> NaN Conversion_syntax\r
+dsbas505 toSci '-+1'             -> NaN Conversion_syntax\r
+dsbas506 toSci '+-1'             -> NaN Conversion_syntax\r
+dsbas507 toSci '12e'             -> NaN Conversion_syntax\r
+dsbas508 toSci '12e++'           -> NaN Conversion_syntax\r
+dsbas509 toSci '12f4'            -> NaN Conversion_syntax\r
+dsbas510 toSci ' +1'             -> NaN Conversion_syntax\r
+dsbas511 toSci '+ 1'             -> NaN Conversion_syntax\r
+dsbas512 toSci '12 '             -> NaN Conversion_syntax\r
+dsbas513 toSci ' + 1'            -> NaN Conversion_syntax\r
+dsbas514 toSci ' - 1 '           -> NaN Conversion_syntax\r
+dsbas515 toSci 'x'               -> NaN Conversion_syntax\r
+dsbas516 toSci '-1-'             -> NaN Conversion_syntax\r
+dsbas517 toSci '12-'             -> NaN Conversion_syntax\r
+dsbas518 toSci '3+'              -> NaN Conversion_syntax\r
+dsbas519 toSci ''                -> NaN Conversion_syntax\r
+dsbas520 toSci '1e-'             -> NaN Conversion_syntax\r
+dsbas521 toSci '7e99999a'        -> NaN Conversion_syntax\r
+dsbas522 toSci '7e123567890x'    -> NaN Conversion_syntax\r
+dsbas523 toSci '7e12356789012x'  -> NaN Conversion_syntax\r
+dsbas524 toSci ''                -> NaN Conversion_syntax\r
+dsbas525 toSci 'e100'            -> NaN Conversion_syntax\r
+dsbas526 toSci '\u0e5a'          -> NaN Conversion_syntax\r
+dsbas527 toSci '\u0b65'          -> NaN Conversion_syntax\r
+dsbas528 toSci '123,65'          -> NaN Conversion_syntax\r
+dsbas529 toSci '1.34.5'          -> NaN Conversion_syntax\r
+dsbas530 toSci '.123.5'          -> NaN Conversion_syntax\r
+dsbas531 toSci '01.35.'          -> NaN Conversion_syntax\r
+dsbas532 toSci '01.35-'          -> NaN Conversion_syntax\r
+dsbas533 toSci '0000..'          -> NaN Conversion_syntax\r
+dsbas534 toSci '.0000.'          -> NaN Conversion_syntax\r
+dsbas535 toSci '00..00'          -> NaN Conversion_syntax\r
+dsbas536 toSci '111e*123'        -> NaN Conversion_syntax\r
+dsbas537 toSci '111e123-'        -> NaN Conversion_syntax\r
+dsbas538 toSci '111e+12+'        -> NaN Conversion_syntax\r
+dsbas539 toSci '111e1-3-'        -> NaN Conversion_syntax\r
+dsbas540 toSci '111e1*23'        -> NaN Conversion_syntax\r
+dsbas541 toSci '111e1e+3'        -> NaN Conversion_syntax\r
+dsbas542 toSci '1e1.0'           -> NaN Conversion_syntax\r
+dsbas543 toSci '1e123e'          -> NaN Conversion_syntax\r
+dsbas544 toSci 'ten'             -> NaN Conversion_syntax\r
+dsbas545 toSci 'ONE'             -> NaN Conversion_syntax\r
+dsbas546 toSci '1e.1'            -> NaN Conversion_syntax\r
+dsbas547 toSci '1e1.'            -> NaN Conversion_syntax\r
+dsbas548 toSci '1ee'             -> NaN Conversion_syntax\r
+dsbas549 toSci 'e+1'             -> NaN Conversion_syntax\r
+dsbas550 toSci '1.23.4'          -> NaN Conversion_syntax\r
+dsbas551 toSci '1.2.1'           -> NaN Conversion_syntax\r
+dsbas552 toSci '1E+1.2'          -> NaN Conversion_syntax\r
+dsbas553 toSci '1E+1.2.3'        -> NaN Conversion_syntax\r
+dsbas554 toSci '1E++1'           -> NaN Conversion_syntax\r
+dsbas555 toSci '1E--1'           -> NaN Conversion_syntax\r
+dsbas556 toSci '1E+-1'           -> NaN Conversion_syntax\r
+dsbas557 toSci '1E-+1'           -> NaN Conversion_syntax\r
+dsbas558 toSci '1E''1'           -> NaN Conversion_syntax\r
+dsbas559 toSci "1E""1"           -> NaN Conversion_syntax\r
+dsbas560 toSci "1E"""""          -> NaN Conversion_syntax\r
+-- Near-specials\r
+dsbas561 toSci "qNaN"            -> NaN Conversion_syntax\r
+dsbas562 toSci "NaNq"            -> NaN Conversion_syntax\r
+dsbas563 toSci "NaNs"            -> NaN Conversion_syntax\r
+dsbas564 toSci "Infi"            -> NaN Conversion_syntax\r
+dsbas565 toSci "Infin"           -> NaN Conversion_syntax\r
+dsbas566 toSci "Infini"          -> NaN Conversion_syntax\r
+dsbas567 toSci "Infinit"         -> NaN Conversion_syntax\r
+dsbas568 toSci "-Infinit"        -> NaN Conversion_syntax\r
+dsbas569 toSci "0Inf"            -> NaN Conversion_syntax\r
+dsbas570 toSci "9Inf"            -> NaN Conversion_syntax\r
+dsbas571 toSci "-0Inf"           -> NaN Conversion_syntax\r
+dsbas572 toSci "-9Inf"           -> NaN Conversion_syntax\r
+dsbas573 toSci "-sNa"            -> NaN Conversion_syntax\r
+dsbas574 toSci "xNaN"            -> NaN Conversion_syntax\r
+dsbas575 toSci "0sNaN"           -> NaN Conversion_syntax\r
+\r
+-- some baddies with dots and Es and dots and specials\r
+dsbas576 toSci  'e+1'            ->  NaN Conversion_syntax\r
+dsbas577 toSci  '.e+1'           ->  NaN Conversion_syntax\r
+dsbas578 toSci  '+.e+1'          ->  NaN Conversion_syntax\r
+dsbas579 toSci  '-.e+'           ->  NaN Conversion_syntax\r
+dsbas580 toSci  '-.e'            ->  NaN Conversion_syntax\r
+dsbas581 toSci  'E+1'            ->  NaN Conversion_syntax\r
+dsbas582 toSci  '.E+1'           ->  NaN Conversion_syntax\r
+dsbas583 toSci  '+.E+1'          ->  NaN Conversion_syntax\r
+dsbas584 toSci  '-.E+'           ->  NaN Conversion_syntax\r
+dsbas585 toSci  '-.E'            ->  NaN Conversion_syntax\r
+\r
+dsbas586 toSci  '.NaN'           ->  NaN Conversion_syntax\r
+dsbas587 toSci  '-.NaN'          ->  NaN Conversion_syntax\r
+dsbas588 toSci  '+.sNaN'         ->  NaN Conversion_syntax\r
+dsbas589 toSci  '+.Inf'          ->  NaN Conversion_syntax\r
+dsbas590 toSci  '.Infinity'      ->  NaN Conversion_syntax\r
+\r
+-- Zeros\r
+dsbas601 toSci 0.000000000       -> 0E-9\r
+dsbas602 toSci 0.00000000        -> 0E-8\r
+dsbas603 toSci 0.0000000         -> 0E-7\r
+dsbas604 toSci 0.000000          -> 0.000000\r
+dsbas605 toSci 0.00000           -> 0.00000\r
+dsbas606 toSci 0.0000            -> 0.0000\r
+dsbas607 toSci 0.000             -> 0.000\r
+dsbas608 toSci 0.00              -> 0.00\r
+dsbas609 toSci 0.0               -> 0.0\r
+dsbas610 toSci  .0               -> 0.0\r
+dsbas611 toSci 0.                -> 0\r
+dsbas612 toSci -.0               -> -0.0\r
+dsbas613 toSci -0.               -> -0\r
+dsbas614 toSci -0.0              -> -0.0\r
+dsbas615 toSci -0.00             -> -0.00\r
+dsbas616 toSci -0.000            -> -0.000\r
+dsbas617 toSci -0.0000           -> -0.0000\r
+dsbas618 toSci -0.00000          -> -0.00000\r
+dsbas619 toSci -0.000000         -> -0.000000\r
+dsbas620 toSci -0.0000000        -> -0E-7\r
+dsbas621 toSci -0.00000000       -> -0E-8\r
+dsbas622 toSci -0.000000000      -> -0E-9\r
+\r
+dsbas630 toSci  0.00E+0          -> 0.00\r
+dsbas631 toSci  0.00E+1          -> 0.0\r
+dsbas632 toSci  0.00E+2          -> 0\r
+dsbas633 toSci  0.00E+3          -> 0E+1\r
+dsbas634 toSci  0.00E+4          -> 0E+2\r
+dsbas635 toSci  0.00E+5          -> 0E+3\r
+dsbas636 toSci  0.00E+6          -> 0E+4\r
+dsbas637 toSci  0.00E+7          -> 0E+5\r
+dsbas638 toSci  0.00E+8          -> 0E+6\r
+dsbas639 toSci  0.00E+9          -> 0E+7\r
+\r
+dsbas640 toSci  0.0E+0           -> 0.0\r
+dsbas641 toSci  0.0E+1           -> 0\r
+dsbas642 toSci  0.0E+2           -> 0E+1\r
+dsbas643 toSci  0.0E+3           -> 0E+2\r
+dsbas644 toSci  0.0E+4           -> 0E+3\r
+dsbas645 toSci  0.0E+5           -> 0E+4\r
+dsbas646 toSci  0.0E+6           -> 0E+5\r
+dsbas647 toSci  0.0E+7           -> 0E+6\r
+dsbas648 toSci  0.0E+8           -> 0E+7\r
+dsbas649 toSci  0.0E+9           -> 0E+8\r
+\r
+dsbas650 toSci  0E+0             -> 0\r
+dsbas651 toSci  0E+1             -> 0E+1\r
+dsbas652 toSci  0E+2             -> 0E+2\r
+dsbas653 toSci  0E+3             -> 0E+3\r
+dsbas654 toSci  0E+4             -> 0E+4\r
+dsbas655 toSci  0E+5             -> 0E+5\r
+dsbas656 toSci  0E+6             -> 0E+6\r
+dsbas657 toSci  0E+7             -> 0E+7\r
+dsbas658 toSci  0E+8             -> 0E+8\r
+dsbas659 toSci  0E+9             -> 0E+9\r
+\r
+dsbas660 toSci  0.0E-0           -> 0.0\r
+dsbas661 toSci  0.0E-1           -> 0.00\r
+dsbas662 toSci  0.0E-2           -> 0.000\r
+dsbas663 toSci  0.0E-3           -> 0.0000\r
+dsbas664 toSci  0.0E-4           -> 0.00000\r
+dsbas665 toSci  0.0E-5           -> 0.000000\r
+dsbas666 toSci  0.0E-6           -> 0E-7\r
+dsbas667 toSci  0.0E-7           -> 0E-8\r
+dsbas668 toSci  0.0E-8           -> 0E-9\r
+dsbas669 toSci  0.0E-9           -> 0E-10\r
+\r
+dsbas670 toSci  0.00E-0          -> 0.00\r
+dsbas671 toSci  0.00E-1          -> 0.000\r
+dsbas672 toSci  0.00E-2          -> 0.0000\r
+dsbas673 toSci  0.00E-3          -> 0.00000\r
+dsbas674 toSci  0.00E-4          -> 0.000000\r
+dsbas675 toSci  0.00E-5          -> 0E-7\r
+dsbas676 toSci  0.00E-6          -> 0E-8\r
+dsbas677 toSci  0.00E-7          -> 0E-9\r
+dsbas678 toSci  0.00E-8          -> 0E-10\r
+dsbas679 toSci  0.00E-9          -> 0E-11\r
+\r
+dsbas680 toSci  000000.          ->  0\r
+dsbas681 toSci   00000.          ->  0\r
+dsbas682 toSci    0000.          ->  0\r
+dsbas683 toSci     000.          ->  0\r
+dsbas684 toSci      00.          ->  0\r
+dsbas685 toSci       0.          ->  0\r
+dsbas686 toSci  +00000.          ->  0\r
+dsbas687 toSci  -00000.          -> -0\r
+dsbas688 toSci  +0.              ->  0\r
+dsbas689 toSci  -0.              -> -0\r
+\r
+-- Specials\r
+dsbas700 toSci "NaN"             -> NaN\r
+dsbas701 toSci "nan"             -> NaN\r
+dsbas702 toSci "nAn"             -> NaN\r
+dsbas703 toSci "NAN"             -> NaN\r
+dsbas704 toSci "+NaN"            -> NaN\r
+dsbas705 toSci "+nan"            -> NaN\r
+dsbas706 toSci "+nAn"            -> NaN\r
+dsbas707 toSci "+NAN"            -> NaN\r
+dsbas708 toSci "-NaN"            -> -NaN\r
+dsbas709 toSci "-nan"            -> -NaN\r
+dsbas710 toSci "-nAn"            -> -NaN\r
+dsbas711 toSci "-NAN"            -> -NaN\r
+dsbas712 toSci 'NaN0'            -> NaN\r
+dsbas713 toSci 'NaN1'            -> NaN1\r
+dsbas714 toSci 'NaN12'           -> NaN12\r
+dsbas715 toSci 'NaN123'          -> NaN123\r
+dsbas716 toSci 'NaN1234'         -> NaN1234\r
+dsbas717 toSci 'NaN01'           -> NaN1\r
+dsbas718 toSci 'NaN012'          -> NaN12\r
+dsbas719 toSci 'NaN0123'         -> NaN123\r
+dsbas720 toSci 'NaN01234'        -> NaN1234\r
+dsbas721 toSci 'NaN001'          -> NaN1\r
+dsbas722 toSci 'NaN0012'         -> NaN12\r
+dsbas723 toSci 'NaN00123'        -> NaN123\r
+dsbas724 toSci 'NaN001234'       -> NaN1234\r
+dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax\r
+dsbas726 toSci 'NaN123e+1'       -> NaN Conversion_syntax\r
+dsbas727 toSci 'NaN12.45'        -> NaN Conversion_syntax\r
+dsbas728 toSci 'NaN-12'          -> NaN Conversion_syntax\r
+dsbas729 toSci 'NaN+12'          -> NaN Conversion_syntax\r
+\r
+dsbas730 toSci "sNaN"            -> sNaN\r
+dsbas731 toSci "snan"            -> sNaN\r
+dsbas732 toSci "SnAn"            -> sNaN\r
+dsbas733 toSci "SNAN"            -> sNaN\r
+dsbas734 toSci "+sNaN"           -> sNaN\r
+dsbas735 toSci "+snan"           -> sNaN\r
+dsbas736 toSci "+SnAn"           -> sNaN\r
+dsbas737 toSci "+SNAN"           -> sNaN\r
+dsbas738 toSci "-sNaN"           -> -sNaN\r
+dsbas739 toSci "-snan"           -> -sNaN\r
+dsbas740 toSci "-SnAn"           -> -sNaN\r
+dsbas741 toSci "-SNAN"           -> -sNaN\r
+dsbas742 toSci 'sNaN0000'        -> sNaN\r
+dsbas743 toSci 'sNaN7'           -> sNaN7\r
+dsbas744 toSci 'sNaN007234'      -> sNaN7234\r
+dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax\r
+dsbas746 toSci 'sNaN72.45'       -> NaN Conversion_syntax\r
+dsbas747 toSci 'sNaN-72'         -> NaN Conversion_syntax\r
+\r
+dsbas748 toSci "Inf"             -> Infinity\r
+dsbas749 toSci "inf"             -> Infinity\r
+dsbas750 toSci "iNf"             -> Infinity\r
+dsbas751 toSci "INF"             -> Infinity\r
+dsbas752 toSci "+Inf"            -> Infinity\r
+dsbas753 toSci "+inf"            -> Infinity\r
+dsbas754 toSci "+iNf"            -> Infinity\r
+dsbas755 toSci "+INF"            -> Infinity\r
+dsbas756 toSci "-Inf"            -> -Infinity\r
+dsbas757 toSci "-inf"            -> -Infinity\r
+dsbas758 toSci "-iNf"            -> -Infinity\r
+dsbas759 toSci "-INF"            -> -Infinity\r
+\r
+dsbas760 toSci "Infinity"        -> Infinity\r
+dsbas761 toSci "infinity"        -> Infinity\r
+dsbas762 toSci "iNfInItY"        -> Infinity\r
+dsbas763 toSci "INFINITY"        -> Infinity\r
+dsbas764 toSci "+Infinity"       -> Infinity\r
+dsbas765 toSci "+infinity"       -> Infinity\r
+dsbas766 toSci "+iNfInItY"       -> Infinity\r
+dsbas767 toSci "+INFINITY"       -> Infinity\r
+dsbas768 toSci "-Infinity"       -> -Infinity\r
+dsbas769 toSci "-infinity"       -> -Infinity\r
+dsbas770 toSci "-iNfInItY"       -> -Infinity\r
+dsbas771 toSci "-INFINITY"       -> -Infinity\r
+\r
+-- Specials and zeros for toEng\r
+dsbast772 toEng "NaN"              -> NaN\r
+dsbast773 toEng "-Infinity"        -> -Infinity\r
+dsbast774 toEng "-sNaN"            -> -sNaN\r
+dsbast775 toEng "-NaN"             -> -NaN\r
+dsbast776 toEng "+Infinity"        -> Infinity\r
+dsbast778 toEng "+sNaN"            -> sNaN\r
+dsbast779 toEng "+NaN"             -> NaN\r
+dsbast780 toEng "INFINITY"         -> Infinity\r
+dsbast781 toEng "SNAN"             -> sNaN\r
+dsbast782 toEng "NAN"              -> NaN\r
+dsbast783 toEng "infinity"         -> Infinity\r
+dsbast784 toEng "snan"             -> sNaN\r
+dsbast785 toEng "nan"              -> NaN\r
+dsbast786 toEng "InFINITY"         -> Infinity\r
+dsbast787 toEng "SnAN"             -> sNaN\r
+dsbast788 toEng "nAN"              -> NaN\r
+dsbast789 toEng "iNfinity"         -> Infinity\r
+dsbast790 toEng "sNan"             -> sNaN\r
+dsbast791 toEng "Nan"              -> NaN\r
+dsbast792 toEng "Infinity"         -> Infinity\r
+dsbast793 toEng "sNaN"             -> sNaN\r
+\r
+-- Zero toEng, etc.\r
+dsbast800 toEng 0e+1              -> "0.00E+3"  -- doc example\r
+\r
+dsbast801 toEng 0.000000000       -> 0E-9\r
+dsbast802 toEng 0.00000000        -> 0.00E-6\r
+dsbast803 toEng 0.0000000         -> 0.0E-6\r
+dsbast804 toEng 0.000000          -> 0.000000\r
+dsbast805 toEng 0.00000           -> 0.00000\r
+dsbast806 toEng 0.0000            -> 0.0000\r
+dsbast807 toEng 0.000             -> 0.000\r
+dsbast808 toEng 0.00              -> 0.00\r
+dsbast809 toEng 0.0               -> 0.0\r
+dsbast810 toEng  .0               -> 0.0\r
+dsbast811 toEng 0.                -> 0\r
+dsbast812 toEng -.0               -> -0.0\r
+dsbast813 toEng -0.               -> -0\r
+dsbast814 toEng -0.0              -> -0.0\r
+dsbast815 toEng -0.00             -> -0.00\r
+dsbast816 toEng -0.000            -> -0.000\r
+dsbast817 toEng -0.0000           -> -0.0000\r
+dsbast818 toEng -0.00000          -> -0.00000\r
+dsbast819 toEng -0.000000         -> -0.000000\r
+dsbast820 toEng -0.0000000        -> -0.0E-6\r
+dsbast821 toEng -0.00000000       -> -0.00E-6\r
+dsbast822 toEng -0.000000000      -> -0E-9\r
+\r
+dsbast830 toEng  0.00E+0          -> 0.00\r
+dsbast831 toEng  0.00E+1          -> 0.0\r
+dsbast832 toEng  0.00E+2          -> 0\r
+dsbast833 toEng  0.00E+3          -> 0.00E+3\r
+dsbast834 toEng  0.00E+4          -> 0.0E+3\r
+dsbast835 toEng  0.00E+5          -> 0E+3\r
+dsbast836 toEng  0.00E+6          -> 0.00E+6\r
+dsbast837 toEng  0.00E+7          -> 0.0E+6\r
+dsbast838 toEng  0.00E+8          -> 0E+6\r
+dsbast839 toEng  0.00E+9          -> 0.00E+9\r
+\r
+dsbast840 toEng  0.0E+0           -> 0.0\r
+dsbast841 toEng  0.0E+1           -> 0\r
+dsbast842 toEng  0.0E+2           -> 0.00E+3\r
+dsbast843 toEng  0.0E+3           -> 0.0E+3\r
+dsbast844 toEng  0.0E+4           -> 0E+3\r
+dsbast845 toEng  0.0E+5           -> 0.00E+6\r
+dsbast846 toEng  0.0E+6           -> 0.0E+6\r
+dsbast847 toEng  0.0E+7           -> 0E+6\r
+dsbast848 toEng  0.0E+8           -> 0.00E+9\r
+dsbast849 toEng  0.0E+9           -> 0.0E+9\r
+\r
+dsbast850 toEng  0E+0             -> 0\r
+dsbast851 toEng  0E+1             -> 0.00E+3\r
+dsbast852 toEng  0E+2             -> 0.0E+3\r
+dsbast853 toEng  0E+3             -> 0E+3\r
+dsbast854 toEng  0E+4             -> 0.00E+6\r
+dsbast855 toEng  0E+5             -> 0.0E+6\r
+dsbast856 toEng  0E+6             -> 0E+6\r
+dsbast857 toEng  0E+7             -> 0.00E+9\r
+dsbast858 toEng  0E+8             -> 0.0E+9\r
+dsbast859 toEng  0E+9             -> 0E+9\r
+\r
+dsbast860 toEng  0.0E-0           -> 0.0\r
+dsbast861 toEng  0.0E-1           -> 0.00\r
+dsbast862 toEng  0.0E-2           -> 0.000\r
+dsbast863 toEng  0.0E-3           -> 0.0000\r
+dsbast864 toEng  0.0E-4           -> 0.00000\r
+dsbast865 toEng  0.0E-5           -> 0.000000\r
+dsbast866 toEng  0.0E-6           -> 0.0E-6\r
+dsbast867 toEng  0.0E-7           -> 0.00E-6\r
+dsbast868 toEng  0.0E-8           -> 0E-9\r
+dsbast869 toEng  0.0E-9           -> 0.0E-9\r
+\r
+dsbast870 toEng  0.00E-0          -> 0.00\r
+dsbast871 toEng  0.00E-1          -> 0.000\r
+dsbast872 toEng  0.00E-2          -> 0.0000\r
+dsbast873 toEng  0.00E-3          -> 0.00000\r
+dsbast874 toEng  0.00E-4          -> 0.000000\r
+dsbast875 toEng  0.00E-5          -> 0.0E-6\r
+dsbast876 toEng  0.00E-6          -> 0.00E-6\r
+dsbast877 toEng  0.00E-7          -> 0E-9\r
+dsbast878 toEng  0.00E-8          -> 0.0E-9\r
+dsbast879 toEng  0.00E-9          -> 0.00E-9\r
+\r
+-- long input strings\r
+dsbas801 tosci          '01234567' -> 1234567\r
+dsbas802 tosci         '001234567' -> 1234567\r
+dsbas803 tosci        '0001234567' -> 1234567\r
+dsbas804 tosci       '00001234567' -> 1234567\r
+dsbas805 tosci      '000001234567' -> 1234567\r
+dsbas806 tosci     '0000001234567' -> 1234567\r
+dsbas807 tosci    '00000001234567' -> 1234567\r
+dsbas808 tosci   '000000001234567' -> 1234567\r
+dsbas809 tosci  '0000000001234567' -> 1234567\r
+dsbas810 tosci '00000000001234567' -> 1234567\r
+\r
+dsbas811 tosci          '0.1234567' ->      0.1234567\r
+dsbas812 tosci         '0.01234567' ->     0.01234567\r
+dsbas813 tosci        '0.001234567' ->    0.001234567\r
+dsbas814 tosci       '0.0001234567' ->   0.0001234567\r
+dsbas815 tosci      '0.00001234567' ->  0.00001234567\r
+dsbas816 tosci     '0.000001234567' -> 0.000001234567\r
+dsbas817 tosci    '0.0000001234567' ->       1.234567E-7\r
+dsbas818 tosci   '0.00000001234567' ->       1.234567E-8\r
+dsbas819 tosci  '0.000000001234567' ->       1.234567E-9\r
+dsbas820 tosci '0.0000000001234567' ->       1.234567E-10\r
+\r
+dsbas821 tosci '123456790'         -> 1.234568E+8 Inexact Rounded\r
+dsbas822 tosci '1234567901'        -> 1.234568E+9  Inexact Rounded\r
+dsbas823 tosci '12345679012'       -> 1.234568E+10 Inexact Rounded\r
+dsbas824 tosci '123456790123'      -> 1.234568E+11 Inexact Rounded\r
+dsbas825 tosci '1234567901234'     -> 1.234568E+12 Inexact Rounded\r
+dsbas826 tosci '12345679012345'    -> 1.234568E+13 Inexact Rounded\r
+dsbas827 tosci '123456790123456'   -> 1.234568E+14 Inexact Rounded\r
+dsbas828 tosci '1234567901234567'  -> 1.234568E+15 Inexact Rounded\r
+dsbas829 tosci '1234567890123456'  -> 1.234568E+15 Inexact Rounded\r
+\r
+-- subnormals and overflows\r
+dsbas906 toSci '99e999999999'       -> Infinity Overflow  Inexact Rounded\r
+dsbas907 toSci '999e999999999'      -> Infinity Overflow  Inexact Rounded\r
+dsbas908 toSci '0.9e-999999999'     -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas909 toSci '0.09e-999999999'    -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas910 toSci '0.1e1000000000'     -> Infinity Overflow  Inexact Rounded\r
+dsbas911 toSci '10e-1000000000'     -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas912 toSci '0.9e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+dsbas913 toSci '99e-9999999999'     -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas914 toSci '111e9999999999'     -> Infinity Overflow  Inexact Rounded\r
+dsbas915 toSci '1111e-9999999999'   -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas916 toSci '1111e-99999999999'  -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas917 toSci '7e1000000000'       -> Infinity Overflow  Inexact Rounded\r
+-- negatives the same\r
+dsbas918 toSci '-99e999999999'      -> -Infinity Overflow  Inexact Rounded\r
+dsbas919 toSci '-999e999999999'     -> -Infinity Overflow  Inexact Rounded\r
+dsbas920 toSci '-0.9e-999999999'    -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas921 toSci '-0.09e-999999999'   -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas922 toSci '-0.1e1000000000'    -> -Infinity Overflow  Inexact Rounded\r
+dsbas923 toSci '-10e-1000000000'    -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas924 toSci '-0.9e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+dsbas925 toSci '-99e-9999999999'    -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas926 toSci '-111e9999999999'    -> -Infinity Overflow  Inexact Rounded\r
+dsbas927 toSci '-1111e-9999999999'  -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas929 toSci '-7e1000000000'      -> -Infinity Overflow  Inexact Rounded\r
+\r
+-- overflow results at different rounding modes\r
+rounding:  ceiling\r
+dsbas930 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dsbas931 toSci '-7e10000'  -> -9.999999E+96 Overflow  Inexact Rounded\r
+rounding:  up\r
+dsbas932 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dsbas933 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  down\r
+dsbas934 toSci  '7e10000'  ->  9.999999E+96 Overflow  Inexact Rounded\r
+dsbas935 toSci '-7e10000'  -> -9.999999E+96 Overflow  Inexact Rounded\r
+rounding:  floor\r
+dsbas936 toSci  '7e10000'  ->  9.999999E+96 Overflow  Inexact Rounded\r
+dsbas937 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_up\r
+dsbas938 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dsbas939 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_even\r
+dsbas940 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dsbas941 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+rounding:  half_down\r
+dsbas942 toSci  '7e10000'  ->  Infinity Overflow  Inexact Rounded\r
+dsbas943 toSci '-7e10000'  -> -Infinity Overflow  Inexact Rounded\r
+\r
+rounding:  half_even\r
+\r
+-- Now check 854/754r some subnormals and underflow to 0\r
+dsbem400 toSci  1.0000E-86     -> 1.0000E-86\r
+dsbem401 toSci  0.1E-97        -> 1E-98       Subnormal\r
+dsbem402 toSci  0.1000E-97     -> 1.000E-98   Subnormal\r
+dsbem403 toSci  0.0100E-97     -> 1.00E-99    Subnormal\r
+dsbem404 toSci  0.0010E-97     -> 1.0E-100     Subnormal\r
+dsbem405 toSci  0.0001E-97     -> 1E-101       Subnormal\r
+dsbem406 toSci  0.00010E-97    -> 1E-101     Subnormal Rounded\r
+dsbem407 toSci  0.00013E-97    -> 1E-101     Underflow Subnormal Inexact Rounded\r
+dsbem408 toSci  0.00015E-97    -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem409 toSci  0.00017E-97    -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem410 toSci  0.00023E-97    -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem411 toSci  0.00025E-97    -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem412 toSci  0.00027E-97    -> 3E-101     Underflow Subnormal Inexact Rounded\r
+dsbem413 toSci  0.000149E-97   -> 1E-101     Underflow Subnormal Inexact Rounded\r
+dsbem414 toSci  0.000150E-97   -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem415 toSci  0.000151E-97   -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem416 toSci  0.000249E-97   -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem417 toSci  0.000250E-97   -> 2E-101     Underflow Subnormal Inexact Rounded\r
+dsbem418 toSci  0.000251E-97   -> 3E-101     Underflow Subnormal Inexact Rounded\r
+dsbem419 toSci  0.00009E-97    -> 1E-101     Underflow Subnormal Inexact Rounded\r
+dsbem420 toSci  0.00005E-97    -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem421 toSci  0.00003E-97    -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem422 toSci  0.000009E-97   -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem423 toSci  0.000005E-97   -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem424 toSci  0.000003E-97   -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+dsbem425 toSci  0.001049E-97   -> 1.0E-100   Underflow Subnormal Inexact Rounded\r
+dsbem426 toSci  0.001050E-97   -> 1.0E-100   Underflow Subnormal Inexact Rounded\r
+dsbem427 toSci  0.001051E-97   -> 1.1E-100   Underflow Subnormal Inexact Rounded\r
+dsbem428 toSci  0.001149E-97   -> 1.1E-100   Underflow Subnormal Inexact Rounded\r
+dsbem429 toSci  0.001150E-97   -> 1.2E-100   Underflow Subnormal Inexact Rounded\r
+dsbem430 toSci  0.001151E-97   -> 1.2E-100   Underflow Subnormal Inexact Rounded\r
+\r
+dsbem432 toSci  0.010049E-97   -> 1.00E-99  Underflow Subnormal Inexact Rounded\r
+dsbem433 toSci  0.010050E-97   -> 1.00E-99  Underflow Subnormal Inexact Rounded\r
+dsbem434 toSci  0.010051E-97   -> 1.01E-99  Underflow Subnormal Inexact Rounded\r
+dsbem435 toSci  0.010149E-97   -> 1.01E-99  Underflow Subnormal Inexact Rounded\r
+dsbem436 toSci  0.010150E-97   -> 1.02E-99  Underflow Subnormal Inexact Rounded\r
+dsbem437 toSci  0.010151E-97   -> 1.02E-99  Underflow Subnormal Inexact Rounded\r
+\r
+dsbem440 toSci  0.10103E-97    -> 1.010E-98 Underflow Subnormal Inexact Rounded\r
+dsbem441 toSci  0.10105E-97    -> 1.010E-98 Underflow Subnormal Inexact Rounded\r
+dsbem442 toSci  0.10107E-97    -> 1.011E-98 Underflow Subnormal Inexact Rounded\r
+dsbem443 toSci  0.10113E-97    -> 1.011E-98 Underflow Subnormal Inexact Rounded\r
+dsbem444 toSci  0.10115E-97    -> 1.012E-98 Underflow Subnormal Inexact Rounded\r
+dsbem445 toSci  0.10117E-97    -> 1.012E-98 Underflow Subnormal Inexact Rounded\r
+\r
+dsbem450 toSci  1.10730E-98    -> 1.107E-98 Underflow Subnormal Inexact Rounded\r
+dsbem451 toSci  1.10750E-98    -> 1.108E-98 Underflow Subnormal Inexact Rounded\r
+dsbem452 toSci  1.10770E-98    -> 1.108E-98 Underflow Subnormal Inexact Rounded\r
+dsbem453 toSci  1.10830E-98    -> 1.108E-98 Underflow Subnormal Inexact Rounded\r
+dsbem454 toSci  1.10850E-98    -> 1.108E-98 Underflow Subnormal Inexact Rounded\r
+dsbem455 toSci  1.10870E-98    -> 1.109E-98 Underflow Subnormal Inexact Rounded\r
+\r
+-- make sure sign OK\r
+dsbem456 toSci  -0.10103E-97   -> -1.010E-98 Underflow Subnormal Inexact Rounded\r
+dsbem457 toSci  -0.10105E-97   -> -1.010E-98 Underflow Subnormal Inexact Rounded\r
+dsbem458 toSci  -0.10107E-97   -> -1.011E-98 Underflow Subnormal Inexact Rounded\r
+dsbem459 toSci  -0.10113E-97   -> -1.011E-98 Underflow Subnormal Inexact Rounded\r
+dsbem460 toSci  -0.10115E-97   -> -1.012E-98 Underflow Subnormal Inexact Rounded\r
+dsbem461 toSci  -0.10117E-97   -> -1.012E-98 Underflow Subnormal Inexact Rounded\r
+\r
+-- '999s' cases\r
+dsbem464 toSci  999999E-98         -> 9.99999E-93\r
+dsbem465 toSci  99999.0E-97        -> 9.99990E-93\r
+dsbem466 toSci  99999.E-97         -> 9.9999E-93\r
+dsbem467 toSci  9999.9E-97         -> 9.9999E-94\r
+dsbem468 toSci  999.99E-97         -> 9.9999E-95\r
+dsbem469 toSci  99.999E-97         -> 9.9999E-96 Subnormal\r
+dsbem470 toSci  9.9999E-97         -> 9.9999E-97 Subnormal\r
+dsbem471 toSci  0.99999E-97        -> 1.0000E-97 Underflow Subnormal Inexact Rounded\r
+dsbem472 toSci  0.099999E-97       -> 1.000E-98  Underflow Subnormal Inexact Rounded\r
+dsbem473 toSci  0.0099999E-97      -> 1.00E-99   Underflow Subnormal Inexact Rounded\r
+dsbem474 toSci  0.00099999E-97     -> 1.0E-100   Underflow Subnormal Inexact Rounded\r
+dsbem475 toSci  0.000099999E-97    -> 1E-101     Underflow Subnormal Inexact Rounded\r
+dsbem476 toSci  0.0000099999E-97   -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem477 toSci  0.00000099999E-97  -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+dsbem478 toSci  0.000000099999E-97 -> 0E-101     Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- Exponents with insignificant leading zeros\r
+dsbas1001 toSci  1e999999999 -> Infinity Overflow Inexact Rounded\r
+dsbas1002 toSci  1e0999999999 -> Infinity Overflow Inexact Rounded\r
+dsbas1003 toSci  1e00999999999 -> Infinity Overflow Inexact Rounded\r
+dsbas1004 toSci  1e000999999999 -> Infinity Overflow Inexact Rounded\r
+dsbas1005 toSci  1e000000000000999999999 -> Infinity Overflow Inexact Rounded\r
+dsbas1006 toSci  1e000000000001000000007 -> Infinity Overflow Inexact Rounded\r
+dsbas1007 toSci  1e-999999999 -> 0E-101             Underflow Subnormal Inexact Rounded Clamped\r
+dsbas1008 toSci  1e-0999999999 -> 0E-101            Underflow Subnormal Inexact Rounded Clamped\r
+dsbas1009 toSci  1e-00999999999 -> 0E-101           Underflow Subnormal Inexact Rounded Clamped\r
+dsbas1010 toSci  1e-000999999999 -> 0E-101          Underflow Subnormal Inexact Rounded Clamped\r
+dsbas1011 toSci  1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+dsbas1012 toSci  1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- check for double-rounded subnormals\r
+dsbas1041 toSci     1.1152444E-96 ->  1.11524E-96 Inexact Rounded Subnormal Underflow\r
+dsbas1042 toSci     1.1152445E-96 ->  1.11524E-96 Inexact Rounded Subnormal Underflow\r
+dsbas1043 toSci     1.1152446E-96 ->  1.11524E-96 Inexact Rounded Subnormal Underflow\r
+\r
+-- clamped zeros [see also clamp.decTest]\r
+dsbas1075 toSci   0e+10000  ->  0E+90   Clamped\r
+dsbas1076 toSci   0e-10000  ->  0E-101  Clamped\r
+dsbas1077 toSci  -0e+10000  -> -0E+90   Clamped\r
+dsbas1078 toSci  -0e-10000  -> -0E-101  Clamped\r
+\r
+-- extreme values from next-wider\r
+dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded\r
+dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped\r
+dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped\r
+dsbas1104 toSci -0 -> -0\r
+dsbas1105 toSci +0 ->  0\r
+dsbas1106 toSci +1E-398 ->  0E-101 Inexact Rounded Subnormal Underflow Clamped\r
+dsbas1107 toSci +1E-383 ->  0E-101 Inexact Rounded Subnormal Underflow Clamped\r
+dsbas1108 toSci +9.999999999999999E+384 ->  Infinity Overflow Inexact Rounded\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/dsEncode.decTest b/Lib/test/decimaltestdata/dsEncode.decTest
new file mode 100644 (file)
index 0000000..185ddc7
--- /dev/null
@@ -0,0 +1,369 @@
+------------------------------------------------------------------------\r
+-- dsEncode.decTest -- decimal four-byte format testcases             --\r
+-- Copyright (c) IBM Corporation, 2000, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+-- [Previously called decimal32.decTest]\r
+version: 2.56\r
+\r
+-- This set of tests is for the four-byte concrete representation.\r
+-- Its characteristics are:\r
+--\r
+--  1 bit  sign\r
+--  5 bits combination field\r
+--  6 bits exponent continuation\r
+-- 20 bits coefficient continuation\r
+--\r
+-- Total exponent length 8 bits\r
+-- Total coefficient length 24 bits (7 digits)\r
+--\r
+-- Elimit =  191 (maximum encoded exponent)\r
+-- Emax   =   96 (largest exponent value)\r
+-- Emin   =  -95 (smallest exponent value)\r
+-- bias   =  101 (subtracted from encoded exponent) = -Etiny\r
+\r
+-- The testcases here have only exactly representable data on the\r
+-- 'left-hand-side'; rounding from strings is tested in 'base'\r
+-- testcase groups.\r
+\r
+extended:    1\r
+clamp:       1\r
+precision:   7\r
+rounding:    half_up\r
+maxExponent: 96\r
+minExponent: -95\r
+\r
+-- General testcases\r
+-- (mostly derived from the Strawman 4 document and examples)\r
+decs001 apply   #A23003D0          -> -7.50\r
+decs002 apply   -7.50              -> #A23003D0\r
+-- derivative canonical plain strings\r
+decs003 apply   #A26003D0         -> -7.50E+3\r
+decs004 apply   -7.50E+3          -> #A26003D0\r
+decs005 apply   #A25003D0         -> -750\r
+decs006 apply   -750              -> #A25003D0\r
+decs007 apply   #A24003D0         -> -75.0\r
+decs008 apply   -75.0             -> #A24003D0\r
+decs009 apply   #A22003D0         -> -0.750\r
+decs010 apply   -0.750            -> #A22003D0\r
+decs011 apply   #A21003D0         -> -0.0750\r
+decs012 apply   -0.0750           -> #A21003D0\r
+decs013 apply   #A1f003D0         -> -0.000750\r
+decs014 apply   -0.000750         -> #A1f003D0\r
+decs015 apply   #A1d003D0         -> -0.00000750\r
+decs016 apply   -0.00000750       -> #A1d003D0\r
+decs017 apply   #A1c003D0         -> -7.50E-7\r
+decs018 apply   -7.50E-7          -> #A1c003D0\r
+\r
+-- Normality\r
+decs020 apply   1234567            -> #2654d2e7\r
+decs021 apply  -1234567            -> #a654d2e7\r
+decs022 apply   1111111            -> #26524491\r
+\r
+-- Nmax and similar\r
+decs031 apply   9.999999E+96            -> #77f3fcff\r
+decs032 apply   #77f3fcff               -> 9.999999E+96\r
+decs033 apply   1.234567E+96            -> #47f4d2e7\r
+decs034 apply   #47f4d2e7               -> 1.234567E+96\r
+-- fold-downs (more below)\r
+decs035 apply   1.23E+96                -> #47f4c000 Clamped\r
+decs036 apply   #47f4c000               -> 1.230000E+96\r
+decs037 apply   1E+96                   -> #47f00000 Clamped\r
+decs038 apply   #47f00000               -> 1.000000E+96\r
+\r
+decs051 apply   12345                   -> #225049c5\r
+decs052 apply   #225049c5               -> 12345\r
+decs053 apply   1234                    -> #22500534\r
+decs054 apply   #22500534               -> 1234\r
+decs055 apply   123                     -> #225000a3\r
+decs056 apply   #225000a3               -> 123\r
+decs057 apply   12                      -> #22500012\r
+decs058 apply   #22500012               -> 12\r
+decs059 apply   1                       -> #22500001\r
+decs060 apply   #22500001               -> 1\r
+decs061 apply   1.23                    -> #223000a3\r
+decs062 apply   #223000a3               -> 1.23\r
+decs063 apply   123.45                  -> #223049c5\r
+decs064 apply   #223049c5               -> 123.45\r
+\r
+-- Nmin and below\r
+decs071 apply   1E-95                   -> #00600001\r
+decs072 apply   #00600001               -> 1E-95\r
+decs073 apply   1.000000E-95            -> #04000000\r
+decs074 apply   #04000000               -> 1.000000E-95\r
+decs075 apply   1.000001E-95            -> #04000001\r
+decs076 apply   #04000001               -> 1.000001E-95\r
+\r
+decs077 apply   0.100000E-95            -> #00020000     Subnormal\r
+decs07x apply   1.00000E-96             -> 1.00000E-96   Subnormal\r
+decs078 apply   #00020000               -> 1.00000E-96   Subnormal\r
+decs079 apply   0.000010E-95            -> #00000010     Subnormal\r
+decs080 apply   #00000010               -> 1.0E-100      Subnormal\r
+decs081 apply   0.000001E-95            -> #00000001     Subnormal\r
+decs082 apply   #00000001               -> 1E-101        Subnormal\r
+decs083 apply   1e-101                  -> #00000001     Subnormal\r
+decs084 apply   #00000001               -> 1E-101        Subnormal\r
+decs08x apply   1e-101                  -> 1E-101        Subnormal\r
+\r
+-- underflows cannot be tested; just check edge case\r
+decs090 apply   1e-101                  -> #00000001  Subnormal\r
+\r
+-- same again, negatives --\r
+\r
+-- Nmax and similar\r
+decs122 apply  -9.999999E+96            -> #f7f3fcff\r
+decs123 apply   #f7f3fcff               -> -9.999999E+96\r
+decs124 apply  -1.234567E+96            -> #c7f4d2e7\r
+decs125 apply   #c7f4d2e7               -> -1.234567E+96\r
+-- fold-downs (more below)\r
+decs130 apply  -1.23E+96                -> #c7f4c000 Clamped\r
+decs131 apply   #c7f4c000               -> -1.230000E+96\r
+decs132 apply  -1E+96                   -> #c7f00000 Clamped\r
+decs133 apply   #c7f00000               -> -1.000000E+96\r
+\r
+decs151 apply  -12345                   -> #a25049c5\r
+decs152 apply   #a25049c5               -> -12345\r
+decs153 apply  -1234                    -> #a2500534\r
+decs154 apply   #a2500534               -> -1234\r
+decs155 apply  -123                     -> #a25000a3\r
+decs156 apply   #a25000a3               -> -123\r
+decs157 apply  -12                      -> #a2500012\r
+decs158 apply   #a2500012               -> -12\r
+decs159 apply  -1                       -> #a2500001\r
+decs160 apply   #a2500001               -> -1\r
+decs161 apply  -1.23                    -> #a23000a3\r
+decs162 apply   #a23000a3               -> -1.23\r
+decs163 apply  -123.45                  -> #a23049c5\r
+decs164 apply   #a23049c5               -> -123.45\r
+\r
+-- Nmin and below\r
+decs171 apply  -1E-95                   -> #80600001\r
+decs172 apply   #80600001               -> -1E-95\r
+decs173 apply  -1.000000E-95            -> #84000000\r
+decs174 apply   #84000000               -> -1.000000E-95\r
+decs175 apply  -1.000001E-95            -> #84000001\r
+decs176 apply   #84000001               -> -1.000001E-95\r
+\r
+decs177 apply  -0.100000E-95            -> #80020000     Subnormal\r
+decs178 apply   #80020000               -> -1.00000E-96  Subnormal\r
+decs179 apply  -0.000010E-95            -> #80000010     Subnormal\r
+decs180 apply   #80000010               -> -1.0E-100     Subnormal\r
+decs181 apply  -0.000001E-95            -> #80000001     Subnormal\r
+decs182 apply   #80000001               -> -1E-101       Subnormal\r
+decs183 apply  -1e-101                  -> #80000001     Subnormal\r
+decs184 apply   #80000001               -> -1E-101       Subnormal\r
+\r
+-- underflow edge case\r
+decs190 apply  -1e-101                  -> #80000001  Subnormal\r
+\r
+-- zeros\r
+decs400 apply   0E-400                  -> #00000000  Clamped\r
+decs401 apply   0E-101                  -> #00000000\r
+decs402 apply   #00000000               -> 0E-101\r
+decs403 apply   0.000000E-95            -> #00000000\r
+decs404 apply   #00000000               -> 0E-101\r
+decs405 apply   0E-2                    -> #22300000\r
+decs406 apply   #22300000               -> 0.00\r
+decs407 apply   0                       -> #22500000\r
+decs408 apply   #22500000               -> 0\r
+decs409 apply   0E+3                    -> #22800000\r
+decs410 apply   #22800000               -> 0E+3\r
+decs411 apply   0E+90                   -> #43f00000\r
+decs412 apply   #43f00000               -> 0E+90\r
+-- clamped zeros...\r
+decs413 apply   0E+91                   -> #43f00000  Clamped\r
+decs414 apply   #43f00000               -> 0E+90\r
+decs415 apply   0E+96                   -> #43f00000  Clamped\r
+decs416 apply   #43f00000               -> 0E+90\r
+decs417 apply   0E+400                  -> #43f00000  Clamped\r
+decs418 apply   #43f00000               -> 0E+90\r
+\r
+-- negative zeros\r
+decs420 apply   -0E-400                 -> #80000000  Clamped\r
+decs421 apply   -0E-101                 -> #80000000\r
+decs422 apply   #80000000               -> -0E-101\r
+decs423 apply   -0.000000E-95           -> #80000000\r
+decs424 apply   #80000000               -> -0E-101\r
+decs425 apply   -0E-2                   -> #a2300000\r
+decs426 apply   #a2300000               -> -0.00\r
+decs427 apply   -0                      -> #a2500000\r
+decs428 apply   #a2500000               -> -0\r
+decs429 apply   -0E+3                   -> #a2800000\r
+decs430 apply   #a2800000               -> -0E+3\r
+decs431 apply   -0E+90                  -> #c3f00000\r
+decs432 apply   #c3f00000               -> -0E+90\r
+-- clamped zeros...\r
+decs433 apply   -0E+91                  -> #c3f00000  Clamped\r
+decs434 apply   #c3f00000               -> -0E+90\r
+decs435 apply   -0E+96                  -> #c3f00000  Clamped\r
+decs436 apply   #c3f00000               -> -0E+90\r
+decs437 apply   -0E+400                 -> #c3f00000  Clamped\r
+decs438 apply   #c3f00000               -> -0E+90\r
+\r
+-- Specials\r
+decs500 apply   Infinity  -> #78000000\r
+decs501 apply   #78787878 -> #78000000\r
+decs502 apply   #78000000 -> Infinity\r
+decs503 apply   #79797979 -> #78000000\r
+decs504 apply   #79000000 -> Infinity\r
+decs505 apply   #7a7a7a7a -> #78000000\r
+decs506 apply   #7a000000 -> Infinity\r
+decs507 apply   #7b7b7b7b -> #78000000\r
+decs508 apply   #7b000000 -> Infinity\r
+decs509 apply   #7c7c7c7c -> #7c0c7c7c\r
+\r
+decs510 apply   NaN       -> #7c000000\r
+decs511 apply   #7c000000 -> NaN\r
+decs512 apply   #7d7d7d7d -> #7c0d7d7d\r
+decs513 apply   #7d000000 -> NaN\r
+decs514 apply   #7e7e7e7e -> #7e0e7c7e\r
+decs515 apply   #7e000000 -> sNaN\r
+decs516 apply   #7f7f7f7f -> #7e0f7c7f\r
+decs517 apply   #7f000000 -> sNaN\r
+decs518 apply   #7fffffff -> sNaN999999\r
+decs519 apply   #7fffffff -> #7e03fcff\r
+\r
+decs520 apply   -Infinity -> #f8000000\r
+decs521 apply   #f8787878 -> #f8000000\r
+decs522 apply   #f8000000 -> -Infinity\r
+decs523 apply   #f9797979 -> #f8000000\r
+decs524 apply   #f9000000 -> -Infinity\r
+decs525 apply   #fa7a7a7a -> #f8000000\r
+decs526 apply   #fa000000 -> -Infinity\r
+decs527 apply   #fb7b7b7b -> #f8000000\r
+decs528 apply   #fb000000 -> -Infinity\r
+\r
+decs529 apply   -NaN      -> #fc000000\r
+decs530 apply   #fc7c7c7c -> #fc0c7c7c\r
+decs531 apply   #fc000000 -> -NaN\r
+decs532 apply   #fd7d7d7d -> #fc0d7d7d\r
+decs533 apply   #fd000000 -> -NaN\r
+decs534 apply   #fe7e7e7e -> #fe0e7c7e\r
+decs535 apply   #fe000000 -> -sNaN\r
+decs536 apply   #ff7f7f7f -> #fe0f7c7f\r
+decs537 apply   #ff000000 -> -sNaN\r
+decs538 apply   #ffffffff -> -sNaN999999\r
+decs539 apply   #ffffffff -> #fe03fcff\r
+\r
+-- diagnostic NaNs\r
+decs540 apply   NaN       -> #7c000000\r
+decs541 apply   NaN0      -> #7c000000\r
+decs542 apply   NaN1      -> #7c000001\r
+decs543 apply   NaN12     -> #7c000012\r
+decs544 apply   NaN79     -> #7c000079\r
+decs545 apply   NaN12345   -> #7c0049c5\r
+decs546 apply   NaN123456  -> #7c028e56\r
+decs547 apply   NaN799799  -> #7c0f7fdf\r
+decs548 apply   NaN999999  -> #7c03fcff\r
+\r
+\r
+-- fold-down full sequence\r
+decs601 apply   1E+96                   -> #47f00000 Clamped\r
+decs602 apply   #47f00000               -> 1.000000E+96\r
+decs603 apply   1E+95                   -> #43f20000 Clamped\r
+decs604 apply   #43f20000               -> 1.00000E+95\r
+decs605 apply   1E+94                   -> #43f04000 Clamped\r
+decs606 apply   #43f04000               -> 1.0000E+94\r
+decs607 apply   1E+93                   -> #43f00400 Clamped\r
+decs608 apply   #43f00400               -> 1.000E+93\r
+decs609 apply   1E+92                   -> #43f00080 Clamped\r
+decs610 apply   #43f00080               -> 1.00E+92\r
+decs611 apply   1E+91                   -> #43f00010 Clamped\r
+decs612 apply   #43f00010               -> 1.0E+91\r
+decs613 apply   1E+90                   -> #43f00001\r
+decs614 apply   #43f00001               -> 1E+90\r
+\r
+\r
+-- Selected DPD codes\r
+decs700 apply   #22500000       -> 0\r
+decs701 apply   #22500009       -> 9\r
+decs702 apply   #22500010       -> 10\r
+decs703 apply   #22500019       -> 19\r
+decs704 apply   #22500020       -> 20\r
+decs705 apply   #22500029       -> 29\r
+decs706 apply   #22500030       -> 30\r
+decs707 apply   #22500039       -> 39\r
+decs708 apply   #22500040       -> 40\r
+decs709 apply   #22500049       -> 49\r
+decs710 apply   #22500050       -> 50\r
+decs711 apply   #22500059       -> 59\r
+decs712 apply   #22500060       -> 60\r
+decs713 apply   #22500069       -> 69\r
+decs714 apply   #22500070       -> 70\r
+decs715 apply   #22500071       -> 71\r
+decs716 apply   #22500072       -> 72\r
+decs717 apply   #22500073       -> 73\r
+decs718 apply   #22500074       -> 74\r
+decs719 apply   #22500075       -> 75\r
+decs720 apply   #22500076       -> 76\r
+decs721 apply   #22500077       -> 77\r
+decs722 apply   #22500078       -> 78\r
+decs723 apply   #22500079       -> 79\r
+\r
+decs730 apply   #2250029e       -> 994\r
+decs731 apply   #2250029f       -> 995\r
+decs732 apply   #225002a0       -> 520\r
+decs733 apply   #225002a1       -> 521\r
+\r
+-- DPD: one of each of the huffman groups\r
+decs740 apply   #225003f7       -> 777\r
+decs741 apply   #225003f8       -> 778\r
+decs742 apply   #225003eb       -> 787\r
+decs743 apply   #2250037d       -> 877\r
+decs744 apply   #2250039f       -> 997\r
+decs745 apply   #225003bf       -> 979\r
+decs746 apply   #225003df       -> 799\r
+decs747 apply   #2250006e       -> 888\r
+\r
+\r
+-- DPD all-highs cases (includes the 24 redundant codes)\r
+decs750 apply   #2250006e       -> 888\r
+decs751 apply   #2250016e       -> 888\r
+decs752 apply   #2250026e       -> 888\r
+decs753 apply   #2250036e       -> 888\r
+decs754 apply   #2250006f       -> 889\r
+decs755 apply   #2250016f       -> 889\r
+decs756 apply   #2250026f       -> 889\r
+decs757 apply   #2250036f       -> 889\r
+\r
+decs760 apply   #2250007e       -> 898\r
+decs761 apply   #2250017e       -> 898\r
+decs762 apply   #2250027e       -> 898\r
+decs763 apply   #2250037e       -> 898\r
+decs764 apply   #2250007f       -> 899\r
+decs765 apply   #2250017f       -> 899\r
+decs766 apply   #2250027f       -> 899\r
+decs767 apply   #2250037f       -> 899\r
+\r
+decs770 apply   #225000ee       -> 988\r
+decs771 apply   #225001ee       -> 988\r
+decs772 apply   #225002ee       -> 988\r
+decs773 apply   #225003ee       -> 988\r
+decs774 apply   #225000ef       -> 989\r
+decs775 apply   #225001ef       -> 989\r
+decs776 apply   #225002ef       -> 989\r
+decs777 apply   #225003ef       -> 989\r
+\r
+decs780 apply   #225000fe       -> 998\r
+decs781 apply   #225001fe       -> 998\r
+decs782 apply   #225002fe       -> 998\r
+decs783 apply   #225003fe       -> 998\r
+decs784 apply   #225000ff       -> 999\r
+decs785 apply   #225001ff       -> 999\r
+decs786 apply   #225002ff       -> 999\r
+decs787 apply   #225003ff       -> 999\r
+\r
diff --git a/Lib/test/decimaltestdata/exp.decTest b/Lib/test/decimaltestdata/exp.decTest
new file mode 100644 (file)
index 0000000..c07ed5a
--- /dev/null
@@ -0,0 +1,674 @@
+------------------------------------------------------------------------\r
+-- exp.decTest -- decimal natural exponentiation                      --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- Tests of the exponential funtion.  Currently all testcases here\r
+-- show results which are correctly rounded (within <= 0.5 ulp).\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- basics (examples in specificiation, etc.)\r
+expx001 exp  -Infinity     -> 0\r
+expx002 exp  -10           -> 0.0000453999298 Inexact Rounded\r
+expx003 exp  -1            -> 0.367879441 Inexact Rounded\r
+expx004 exp   0            -> 1\r
+expx005 exp  -0            -> 1\r
+expx006 exp   1            -> 2.71828183  Inexact Rounded\r
+expx007 exp   0.693147181  -> 2.00000000  Inexact Rounded\r
+expx008 exp   10           -> 22026.4658  Inexact Rounded\r
+expx009 exp  +Infinity     -> Infinity\r
+\r
+-- tiny edge cases\r
+precision:   7\r
+expx011 exp  0.1          ->  1.105171  Inexact Rounded\r
+expx012 exp  0.01         ->  1.010050  Inexact Rounded\r
+expx013 exp  0.001        ->  1.001001  Inexact Rounded\r
+expx014 exp  0.0001       ->  1.000100  Inexact Rounded\r
+expx015 exp  0.00001      ->  1.000010  Inexact Rounded\r
+expx016 exp  0.000001     ->  1.000001  Inexact Rounded\r
+expx017 exp  0.0000001    ->  1.000000  Inexact Rounded\r
+expx018 exp  0.0000003    ->  1.000000  Inexact Rounded\r
+expx019 exp  0.0000004    ->  1.000000  Inexact Rounded\r
+expx020 exp  0.0000005    ->  1.000001  Inexact Rounded\r
+expx021 exp  0.0000008    ->  1.000001  Inexact Rounded\r
+expx022 exp  0.0000009    ->  1.000001  Inexact Rounded\r
+expx023 exp  0.0000010    ->  1.000001  Inexact Rounded\r
+expx024 exp  0.0000011    ->  1.000001  Inexact Rounded\r
+expx025 exp  0.00000009   ->  1.000000  Inexact Rounded\r
+expx026 exp  0.00000005   ->  1.000000  Inexact Rounded\r
+expx027 exp  0.00000004   ->  1.000000  Inexact Rounded\r
+expx028 exp  0.00000001   ->  1.000000  Inexact Rounded\r
+\r
+-- and some more zeros\r
+expx030 exp  0.00000000   ->  1\r
+expx031 exp  0E+100       ->  1\r
+expx032 exp  0E-100       ->  1\r
+expx033 exp -0.00000000   ->  1\r
+expx034 exp -0E+100       ->  1\r
+expx035 exp -0E-100       ->  1\r
+\r
+-- basic e=0, e=1, e=2, e=4, e>=8 cases\r
+precision:   7\r
+expx041 exp  1          ->  2.718282  Inexact Rounded\r
+expx042 exp -1          ->  0.3678794 Inexact Rounded\r
+expx043 exp  10         ->  22026.47  Inexact Rounded\r
+expx044 exp -10         ->  0.00004539993 Inexact Rounded\r
+expx045 exp  100        ->  2.688117E+43  Inexact Rounded\r
+expx046 exp -100        ->  3.720076E-44  Inexact Rounded\r
+expx047 exp  1000       ->  Infinity Overflow Inexact Rounded\r
+expx048 exp -1000       ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx049 exp  100000000  ->  Infinity Overflow Inexact Rounded\r
+expx050 exp -100000000  ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+\r
+-- miscellanea\r
+-- similar to 'VF bug' test, at 17, but with last digit corrected for decimal\r
+precision: 16\r
+expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded\r
+--  result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236\r
+--   result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236\r
+precision: 17\r
+expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded\r
+precision: 18\r
+expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded\r
+precision: 19\r
+expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded\r
+precision: 20\r
+expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded\r
+\r
+-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences\r
+precision:   50\r
+expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded\r
+precision:   31\r
+expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded\r
+precision:   30\r
+expx103 exp -9E-8 -> 0.999999910000004049999878500003  Inexact Rounded\r
+precision:   29\r
+expx104 exp -9E-8 -> 0.99999991000000404999987850000   Inexact Rounded\r
+precision:   28\r
+expx105 exp -9E-8 -> 0.9999999100000040499998785000    Inexact Rounded\r
+precision:   27\r
+expx106 exp -9E-8 -> 0.999999910000004049999878500     Inexact Rounded\r
+precision:   26\r
+expx107 exp -9E-8 -> 0.99999991000000404999987850      Inexact Rounded\r
+precision:   25\r
+expx108 exp -9E-8 -> 0.9999999100000040499998785       Inexact Rounded\r
+precision:   24\r
+expx109 exp -9E-8 -> 0.999999910000004049999879        Inexact Rounded\r
+precision:   23\r
+expx110 exp -9E-8 -> 0.99999991000000404999988         Inexact Rounded\r
+precision:   22\r
+expx111 exp -9E-8 -> 0.9999999100000040499999          Inexact Rounded\r
+precision:   21\r
+expx112 exp -9E-8 -> 0.999999910000004050000           Inexact Rounded\r
+precision:   20\r
+expx113 exp -9E-8 -> 0.99999991000000405000            Inexact Rounded\r
+precision:   19\r
+expx114 exp -9E-8 -> 0.9999999100000040500             Inexact Rounded\r
+precision:   18\r
+expx115 exp -9E-8 -> 0.999999910000004050              Inexact Rounded\r
+precision:   17\r
+expx116 exp -9E-8 -> 0.99999991000000405               Inexact Rounded\r
+precision:   16\r
+expx117 exp -9E-8 -> 0.9999999100000040                Inexact Rounded\r
+precision:   15\r
+expx118 exp -9E-8 -> 0.999999910000004                 Inexact Rounded\r
+precision:   14\r
+expx119 exp -9E-8 -> 0.99999991000000                  Inexact Rounded\r
+precision:   13\r
+expx120 exp -9E-8 -> 0.9999999100000                   Inexact Rounded\r
+precision:   12\r
+expx121 exp -9E-8 -> 0.999999910000                    Inexact Rounded\r
+precision:   11\r
+expx122 exp -9E-8 -> 0.99999991000                     Inexact Rounded\r
+precision:   10\r
+expx123 exp -9E-8 -> 0.9999999100                      Inexact Rounded\r
+precision:    9\r
+expx124 exp -9E-8 -> 0.999999910                       Inexact Rounded\r
+precision:    8\r
+expx125 exp -9E-8 -> 0.99999991                        Inexact Rounded\r
+precision:    7\r
+expx126 exp -9E-8 -> 0.9999999                         Inexact Rounded\r
+precision:    6\r
+expx127 exp -9E-8 -> 1.00000                           Inexact Rounded\r
+precision:    5\r
+expx128 exp -9E-8 -> 1.0000                            Inexact Rounded\r
+precision:    4\r
+expx129 exp -9E-8 -> 1.000                             Inexact Rounded\r
+precision:    3\r
+expx130 exp -9E-8 -> 1.00                              Inexact Rounded\r
+precision:    2\r
+expx131 exp -9E-8 -> 1.0                               Inexact Rounded\r
+precision:    1\r
+expx132 exp -9E-8 -> 1                                 Inexact Rounded\r
+\r
+\r
+-- sanity checks, with iteration counts [normalized so 0<=|x|<1]\r
+precision:   50\r
+\r
+expx210 exp 0 -> 1\r
+-- iterations: 2\r
+expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded\r
+-- iterations: 8\r
+expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded\r
+-- iterations: 6\r
+expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded\r
+-- iterations: 15\r
+expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded\r
+-- iterations: 14\r
+expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded\r
+-- iterations: 26\r
+expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded\r
+-- iterations: 39\r
+expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded\r
+-- iterations: 41\r
+expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded\r
+-- iterations: 43\r
+expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded\r
+-- iterations: 26\r
+expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded\r
+-- iterations: 26\r
+expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded\r
+-- iterations: 27\r
+expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded\r
+-- iterations: 28\r
+expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded\r
+-- iterations: 30\r
+expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded\r
+-- iterations: 36\r
+expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded\r
+-- iterations: 26\r
+expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded\r
+-- iterations: 28\r
+expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded\r
+-- iterations: 29\r
+expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded\r
+-- iterations: 30\r
+expx233 exp 0 -> 1\r
+-- iterations: 2\r
+expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded\r
+-- iterations: 7\r
+expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded\r
+-- iterations: 6\r
+expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded\r
+-- iterations: 15\r
+expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded\r
+-- iterations: 13\r
+expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded\r
+-- iterations: 25\r
+expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded\r
+-- iterations: 38\r
+expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded\r
+-- iterations: 41\r
+expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded\r
+-- iterations: 42\r
+expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded\r
+-- iterations: 26\r
+expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded\r
+-- iterations: 26\r
+expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded\r
+-- iterations: 26\r
+expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded\r
+-- iterations: 28\r
+expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded\r
+-- iterations: 29\r
+expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded\r
+-- iterations: 36\r
+expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded\r
+-- iterations: 26\r
+expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded\r
+-- iterations: 28\r
+expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded\r
+-- iterations: 28\r
+expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded\r
+-- iterations: 29\r
+\r
+-- a biggie [result verified 3 ways]\r
+precision: 250\r
+expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded\r
+\r
+-- extreme range boundaries\r
+precision:   16\r
+maxExponent: 999999\r
+minExponent: -999999\r
+-- Ntiny boundary\r
+expx290 exp  -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped\r
+expx291 exp  -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded\r
+-- Nmax/10 and Nmax boundary\r
+expx292 exp  2302582.790408952 -> 9.999999993100277E+999998  Inexact Rounded\r
+expx293 exp  2302582.790408953 -> 1.000000000310028E+999999  Inexact Rounded\r
+expx294 exp  2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded\r
+expx295 exp  2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded\r
+expx296 exp  2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded\r
+expx297 exp  2302585.092994046 -> Infinity Overflow         Inexact Rounded\r
+\r
+-- 0<-x<<1 effects\r
+precision:    30\r
+expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded\r
+expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded\r
+expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded\r
+precision:    20\r
+expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded\r
+expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded\r
+expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded\r
+precision:    14\r
+expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded\r
+expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded\r
+expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded\r
+-- overprecise and 0<-x<<1\r
+precision:    8\r
+expx330 exp -4.9999999999999E-8 -> 0.99999995       Inexact Rounded\r
+expx331 exp -5.0000000000000E-8 -> 0.99999995       Inexact Rounded\r
+expx332 exp -5.0000000000001E-8 -> 0.99999995       Inexact Rounded\r
+precision:    7\r
+expx333 exp -4.9999999999999E-8 -> 1.000000         Inexact Rounded\r
+expx334 exp -5.0000000000000E-8 -> 1.000000         Inexact Rounded\r
+expx335 exp -5.0000000000001E-8 -> 1.000000         Inexact Rounded\r
+precision:    3\r
+expx336 exp -4.9999999999999E-8 -> 1.00             Inexact Rounded\r
+expx337 exp -5.0000000000000E-8 -> 1.00             Inexact Rounded\r
+expx338 exp -5.0000000000001E-8 -> 1.00             Inexact Rounded\r
+\r
+-- 0<x<<1 effects\r
+precision:    30\r
+expx340 exp  4.9999999999999E-8 -> 1.00000005000000124999902083328  Inexact Rounded\r
+expx341 exp  5.0000000000000E-8 -> 1.00000005000000125000002083333  Inexact Rounded\r
+expx342 exp  5.0000000000001E-8 -> 1.00000005000000125000102083338  Inexact Rounded\r
+precision:    20\r
+expx343 exp  4.9999999999999E-8 -> 1.0000000500000012500  Inexact Rounded\r
+expx344 exp  5.0000000000000E-8 -> 1.0000000500000012500  Inexact Rounded\r
+expx345 exp  5.0000000000001E-8 -> 1.0000000500000012500  Inexact Rounded\r
+precision:    14\r
+expx346 exp  4.9999999999999E-8 -> 1.0000000500000  Inexact Rounded\r
+expx347 exp  5.0000000000000E-8 -> 1.0000000500000  Inexact Rounded\r
+expx348 exp  5.0000000000001E-8 -> 1.0000000500000  Inexact Rounded\r
+-- overprecise and 0<x<<1\r
+precision:    8\r
+expx350 exp  4.9999999999999E-8 -> 1.0000001        Inexact Rounded\r
+expx351 exp  5.0000000000000E-8 -> 1.0000001        Inexact Rounded\r
+expx352 exp  5.0000000000001E-8 -> 1.0000001        Inexact Rounded\r
+precision:    7\r
+expx353 exp  4.9999999999999E-8 -> 1.000000         Inexact Rounded\r
+expx354 exp  5.0000000000000E-8 -> 1.000000         Inexact Rounded\r
+expx355 exp  5.0000000000001E-8 -> 1.000000         Inexact Rounded\r
+precision:    3\r
+expx356 exp  4.9999999999999E-8 -> 1.00             Inexact Rounded\r
+expx357 exp  5.0000000000000E-8 -> 1.00             Inexact Rounded\r
+expx358 exp  5.0000000000001E-8 -> 1.00             Inexact Rounded\r
+\r
+-- cases near 1              --  1 2345678901234567890\r
+precision:    20\r
+expx401 exp 0.99999999999996  -> 2.7182818284589365041  Inexact Rounded\r
+expx402 exp 0.99999999999997  -> 2.7182818284589636869  Inexact Rounded\r
+expx403 exp 0.99999999999998  -> 2.7182818284589908697  Inexact Rounded\r
+expx404 exp 0.99999999999999  -> 2.7182818284590180525  Inexact Rounded\r
+expx405 exp 1.0000000000000   -> 2.7182818284590452354  Inexact Rounded\r
+expx406 exp 1.0000000000001   -> 2.7182818284593170635  Inexact Rounded\r
+expx407 exp 1.0000000000002   -> 2.7182818284595888917  Inexact Rounded\r
+precision:    14\r
+expx411 exp 0.99999999999996  -> 2.7182818284589  Inexact Rounded\r
+expx412 exp 0.99999999999997  -> 2.7182818284590  Inexact Rounded\r
+expx413 exp 0.99999999999998  -> 2.7182818284590  Inexact Rounded\r
+expx414 exp 0.99999999999999  -> 2.7182818284590  Inexact Rounded\r
+expx415 exp 1.0000000000000   -> 2.7182818284590  Inexact Rounded\r
+expx416 exp 1.0000000000001   -> 2.7182818284593  Inexact Rounded\r
+expx417 exp 1.0000000000002   -> 2.7182818284596  Inexact Rounded\r
+-- overprecise...\r
+precision:    7\r
+expx421 exp 0.99999999999996  -> 2.718282         Inexact Rounded\r
+expx422 exp 0.99999999999997  -> 2.718282         Inexact Rounded\r
+expx423 exp 0.99999999999998  -> 2.718282         Inexact Rounded\r
+expx424 exp 0.99999999999999  -> 2.718282         Inexact Rounded\r
+expx425 exp 1.0000000000001   -> 2.718282         Inexact Rounded\r
+expx426 exp 1.0000000000002   -> 2.718282         Inexact Rounded\r
+expx427 exp 1.0000000000003   -> 2.718282         Inexact Rounded\r
+precision:    2\r
+expx431 exp 0.99999999999996  -> 2.7              Inexact Rounded\r
+expx432 exp 0.99999999999997  -> 2.7              Inexact Rounded\r
+expx433 exp 0.99999999999998  -> 2.7              Inexact Rounded\r
+expx434 exp 0.99999999999999  -> 2.7              Inexact Rounded\r
+expx435 exp 1.0000000000001   -> 2.7              Inexact Rounded\r
+expx436 exp 1.0000000000002   -> 2.7              Inexact Rounded\r
+expx437 exp 1.0000000000003   -> 2.7              Inexact Rounded\r
+\r
+-- basics at low precisions\r
+precision: 3\r
+expx501 exp  -Infinity     -> 0\r
+expx502 exp  -10           -> 0.0000454   Inexact Rounded\r
+expx503 exp  -1            -> 0.368       Inexact Rounded\r
+expx504 exp   0            -> 1\r
+expx505 exp  -0            -> 1\r
+expx506 exp   1            -> 2.72        Inexact Rounded\r
+expx507 exp   0.693147181  -> 2.00        Inexact Rounded\r
+expx508 exp   10           -> 2.20E+4     Inexact Rounded\r
+expx509 exp  +Infinity     -> Infinity\r
+precision: 2\r
+expx511 exp  -Infinity     -> 0\r
+expx512 exp  -10           -> 0.000045    Inexact Rounded\r
+expx513 exp  -1            -> 0.37        Inexact Rounded\r
+expx514 exp   0            -> 1\r
+expx515 exp  -0            -> 1\r
+expx516 exp   1            -> 2.7         Inexact Rounded\r
+expx517 exp   0.693147181  -> 2.0         Inexact Rounded\r
+expx518 exp   10           -> 2.2E+4      Inexact Rounded\r
+expx519 exp  +Infinity     -> Infinity\r
+precision: 1\r
+expx521 exp  -Infinity     -> 0\r
+expx522 exp  -10           -> 0.00005     Inexact Rounded\r
+expx523 exp  -1            -> 0.4         Inexact Rounded\r
+expx524 exp   0            -> 1\r
+expx525 exp  -0            -> 1\r
+expx526 exp   1            -> 3           Inexact Rounded\r
+expx527 exp   0.693147181  -> 2           Inexact Rounded\r
+expx528 exp   10           -> 2E+4        Inexact Rounded\r
+expx529 exp  +Infinity     -> Infinity\r
+\r
+-- overflows, including some overprecise borderlines\r
+precision:   7\r
+maxExponent: 384\r
+minExponent: -383\r
+expx701 exp  1000000000  -> Infinity Overflow Inexact Rounded\r
+expx702 exp  100000000   -> Infinity Overflow Inexact Rounded\r
+expx703 exp  10000000    -> Infinity Overflow Inexact Rounded\r
+expx704 exp  1000000     -> Infinity Overflow Inexact Rounded\r
+expx705 exp  100000      -> Infinity Overflow Inexact Rounded\r
+expx706 exp  10000       -> Infinity Overflow Inexact Rounded\r
+expx707 exp  1000        -> Infinity Overflow Inexact Rounded\r
+expx708 exp  886.4952608 -> Infinity Overflow Inexact Rounded\r
+expx709 exp  886.4952607 -> 9.999999E+384 Inexact Rounded\r
+expx710 exp  886.49527   -> Infinity Overflow Inexact Rounded\r
+expx711 exp  886.49526   -> 9.999992E+384 Inexact Rounded\r
+precision:   16\r
+expx721 exp  886.4952608027075883 -> Infinity Overflow Inexact Rounded\r
+expx722 exp  886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded\r
+expx723 exp  886.49526080270759   -> Infinity Overflow Inexact Rounded\r
+expx724 exp  886.49526080270758   -> 9.999999999999917E+384 Inexact Rounded\r
+expx725 exp  886.4952608027076    -> Infinity Overflow Inexact Rounded\r
+expx726 exp  886.4952608027075    -> 9.999999999999117E+384 Inexact Rounded\r
+-- and by special request ...\r
+precision:   15\r
+expx731 exp  886.495260802708     -> Infinity Overflow Inexact Rounded\r
+expx732 exp  886.495260802707     -> 9.99999999999412E+384 Inexact Rounded\r
+expx733 exp  886.495260802706     -> 9.99999999998412E+384 Inexact Rounded\r
+maxExponent: 999\r
+minExponent: -999\r
+expx735 exp  2302.58509299405    -> Infinity Overflow Inexact Rounded\r
+expx736 exp  2302.58509299404    -> 9.99999999994316E+999 Inexact Rounded\r
+expx737 exp  2302.58509299403    -> 9.99999999984316E+999 Inexact Rounded\r
+\r
+-- subnormals and underflows, including underflow-to-zero edge point\r
+precision:   7\r
+maxExponent: 384\r
+minExponent: -383\r
+expx751 exp -1000000000   ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx752 exp -100000000    ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx753 exp -10000000     ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx754 exp -1000000      ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx755 exp -100000       ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx756 exp -10000        ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx757 exp -1000         ->  0E-389 Underflow Inexact Rounded Clamped Subnormal\r
+expx758 exp -881.89009    ->  1.000001E-383 Inexact Rounded\r
+expx759 exp -881.8901     ->  9.99991E-384  Inexact Rounded Underflow Subnormal\r
+expx760 exp -885          ->  4.4605E-385   Inexact Rounded Underflow Subnormal\r
+expx761 exp -888          ->  2.221E-386    Inexact Rounded Underflow Subnormal\r
+expx762 exp -890          ->  3.01E-387     Inexact Rounded Underflow Subnormal\r
+expx763 exp -892.9        ->  1.7E-388      Inexact Rounded Underflow Subnormal\r
+expx764 exp -893          ->  1.5E-388      Inexact Rounded Underflow Subnormal\r
+expx765 exp -893.5        ->  9E-389        Inexact Rounded Underflow Subnormal\r
+expx766 exp -895.7056     ->  1E-389        Inexact Rounded Underflow Subnormal\r
+expx769 exp -895.8        ->  1E-389        Inexact Rounded Underflow Subnormal\r
+expx770 exp -895.73       ->  1E-389        Inexact Rounded Underflow Subnormal\r
+expx771 exp -896.3987     ->  1E-389        Inexact Rounded Underflow Subnormal\r
+expx772 exp -896.3988     ->  0E-389        Inexact Rounded Underflow Subnormal Clamped\r
+expx773 exp -898.0081     ->  0E-389        Inexact Rounded Underflow Subnormal Clamped\r
+expx774 exp -898.0082     ->  0E-389        Inexact Rounded Underflow Subnormal Clamped\r
+\r
+-- special values\r
+maxexponent: 999\r
+minexponent: -999\r
+expx820 exp   Inf    -> Infinity\r
+expx821 exp  -Inf    -> 0\r
+expx822 exp   NaN    -> NaN\r
+expx823 exp  sNaN    -> NaN Invalid_operation\r
+-- propagating NaNs\r
+expx824 exp  sNaN123 ->  NaN123 Invalid_operation\r
+expx825 exp -sNaN321 -> -NaN321 Invalid_operation\r
+expx826 exp   NaN456 ->  NaN456\r
+expx827 exp  -NaN654 -> -NaN654\r
+expx828 exp   NaN1   ->  NaN1\r
+\r
+-- Invalid operations due to restrictions\r
+-- [next two probably skipped by most test harnesses]\r
+precision: 100000000\r
+expx901 exp  -Infinity     -> NaN Invalid_context\r
+precision:  99999999\r
+expx902 exp  -Infinity     -> NaN Invalid_context\r
+\r
+precision: 9\r
+maxExponent:   1000000\r
+minExponent:   -999999\r
+expx903 exp  -Infinity     -> NaN Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999999\r
+expx904 exp  -Infinity     -> 0\r
+maxExponent:    999999\r
+minExponent:  -1000000\r
+expx905 exp  -Infinity     -> NaN Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999998\r
+expx906 exp  -Infinity     -> 0\r
+\r
+--\r
+maxExponent: 384\r
+minExponent: -383\r
+precision:   16\r
+rounding:    half_even\r
+\r
+-- Null test\r
+expx900 exp  # -> NaN Invalid_operation\r
+\r
+\r
+-- Randoms P=50, within 0-999\r
+Precision: 50\r
+maxExponent: 384\r
+minExponent: -383\r
+expx1501 exp 656.35397950590285612266095596539934213943872885728  -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded\r
+expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded\r
+expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded\r
+expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded\r
+expx1505 exp 33.909116897973797735657751591014926629051117541243  -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded\r
+expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded\r
+expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded\r
+expx1508 exp 4.1793280674155659794286951159430651258356014391382  -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded\r
+expx1509 exp 485.43595745460655893746179890255529919221550201686  -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded\r
+expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded\r
+expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded\r
+expx1512 exp 9.7959168821760339304571595474480640286072720233796  -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded\r
+expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded\r
+expx1514 exp 741.29888791134298194088827572374718940925820027354  -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded\r
+expx1515 exp 032.75573003552517668808529099897153710887014947935  -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded\r
+expx1516 exp 42.333700726429333308594265553422902463737399437644  -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded\r
+expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded\r
+expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded\r
+expx1519 exp 640.72396012796509482382712891709072570653606838251  -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded\r
+expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded\r
+expx1521 exp 6.7670394314315206378625221583973414660727960241395  -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded\r
+expx1522 exp 04.823217407412963506638267226891024138054783122548  -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded\r
+expx1523 exp 193.51307878701196403991208482520115359690106143615  -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded\r
+expx1524 exp 5.7307749038303650539200345901210497015617393970463  -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded\r
+expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded\r
+expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded\r
+expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded\r
+expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded\r
+expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded\r
+expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded\r
+expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded\r
+expx1532 exp 85.522796894744576211573232055494551429297878413017  -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded\r
+expx1533 exp 9.1496720811363678696938036379756663548353399954363  -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded\r
+expx1534 exp 8.2215705240788294472944382056330516738577785177942  -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded\r
+expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded\r
+expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded\r
+expx1537 exp 33.555726197149525061455517784870570470833498096559  -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded\r
+expx1538 exp 9.7898079803906215094140010009583375537259810398659  -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded\r
+expx1539 exp 89.157697327174521542502447953032536541038636966347  -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded\r
+expx1540 exp 25.022947600123328912029051897171319573322888514885  -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded\r
+\r
+-- exp(1) at 34\r
+Precision: 34\r
+expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded\r
+\r
+-- Randoms P=34, within 0-999\r
+Precision: 34\r
+maxExponent: 6144\r
+minExponent: -6143\r
+expx1201 exp 309.5948855821510212996700645087188  -> 2.853319692901387521201738015050724E+134 Inexact Rounded\r
+expx1202 exp 9.936543068706211420422803962680164  -> 20672.15839203171877476511093276022 Inexact Rounded\r
+expx1203 exp 6.307870323881505684429839491707908  -> 548.8747777054637296137277391754665 Inexact Rounded\r
+expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded\r
+expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded\r
+expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded\r
+expx1207 exp 6.856313340032177672550343216129586  -> 949.8587981604144147983589660524396 Inexact Rounded\r
+expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded\r
+expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded\r
+expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded\r
+expx1211 exp 08.59979170376061890684723211112566  -> 5430.528314920905714615339273738097 Inexact Rounded\r
+expx1212 exp 9.473117039341003854872778112752590  -> 13005.36234331224953460055897913917 Inexact Rounded\r
+expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded\r
+expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded\r
+expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded\r
+expx1216 exp 261.6896411697539524911536116712307  -> 4.470613562127465095241600174941460E+113 Inexact Rounded\r
+expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded\r
+expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded\r
+expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded\r
+expx1220 exp 547.5174462574156885473558485475052  -> 6.078629247383807942612114579728672E+237 Inexact Rounded\r
+expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded\r
+expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded\r
+expx1223 exp 84.46160530377645101833996706384473  -> 4.799644995897968383503269871697856E+36 Inexact Rounded\r
+expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded\r
+expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded\r
+expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded\r
+expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded\r
+expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded\r
+expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded\r
+expx1230 exp 174.9431952176750671150886423048447  -> 9.481222305374955011464619468044051E+75 Inexact Rounded\r
+expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded\r
+expx1232 exp 51.06888989702669288180946272499035  -> 15098613888619165073959.89896018749 Inexact Rounded\r
+expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded\r
+expx1234 exp 714.8549046761054856311108828903972  -> 2.867744544891081117381595080480784E+310 Inexact Rounded\r
+expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded\r
+expx1236 exp 831.5818151589890366323551672043709  -> 1.417077409182624969435938062261655E+361 Inexact Rounded\r
+expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded\r
+expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded\r
+expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded\r
+expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded\r
+\r
+-- Randoms P=16, within 0-99\r
+Precision: 16\r
+maxExponent: 384\r
+minExponent: -383\r
+expx1101 exp 8.473011527013724  -> 4783.900643969246 Inexact Rounded\r
+expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded\r
+expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded\r
+expx1104 exp 64.54374138544166  -> 1.073966476173531E+28 Inexact Rounded\r
+expx1105 exp 90.47203246416569  -> 1.956610887250643E+39 Inexact Rounded\r
+expx1106 exp 9.299931532342757  -> 10937.27033325227 Inexact Rounded\r
+expx1107 exp 8.759678437852203  -> 6372.062234495381 Inexact Rounded\r
+expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded\r
+expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded\r
+expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded\r
+expx1111 exp 8.339771722299049  -> 4187.133803081878 Inexact Rounded\r
+expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded\r
+expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded\r
+expx1114 exp 51.77663761827966  -> 3.064135801120365E+22 Inexact Rounded\r
+expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded\r
+expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded\r
+expx1117 exp 9.955141865534960  -> 21060.23334287038 Inexact Rounded\r
+expx1118 exp 92.34503059198483  -> 1.273318993481226E+40 Inexact Rounded\r
+expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded\r
+expx1120 exp 79.12883036433204  -> 2.318538899389243E+34 Inexact Rounded\r
+expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded\r
+expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded\r
+expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded\r
+expx1124 exp 8.825786167283102  -> 6807.540455289995 Inexact Rounded\r
+expx1125 exp 1.535457249746275  -> 4.643448260146849 Inexact Rounded\r
+expx1126 exp 69.02254254355800  -> 9.464754500670653E+29 Inexact Rounded\r
+expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded\r
+expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded\r
+expx1129 exp 0.621774854641137  -> 1.862230298554903 Inexact Rounded\r
+expx1130 exp 3.847629031404354  -> 46.88177613568203 Inexact Rounded\r
+expx1131 exp 24.81250184697732  -> 59694268456.19966 Inexact Rounded\r
+expx1132 exp 5.107546500516044  -> 165.2643809755670 Inexact Rounded\r
+expx1133 exp 79.17810943951986  -> 2.435656372541360E+34 Inexact Rounded\r
+expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded\r
+expx1135 exp 57.44504488501725  -> 8.872908566929688E+24 Inexact Rounded\r
+expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded\r
+expx1137 exp 69.71309932148997  -> 1.888053740693541E+30 Inexact Rounded\r
+expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded\r
+expx1139 exp 9.346991220814677  -> 11464.27802035082 Inexact Rounded\r
+expx1140 exp 33.09087139999152  -> 235062229168763.5 Inexact Rounded\r
+\r
+-- Randoms P=7, within 0-9\r
+Precision: 7\r
+maxExponent: 96\r
+minExponent: -95\r
+expx1001 exp 2.395441  -> 10.97304 Inexact Rounded\r
+expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded\r
+expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded\r
+expx1004 exp 3.055120  -> 21.22373 Inexact Rounded\r
+expx1005 exp 1.536792  -> 4.649650 Inexact Rounded\r
+expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded\r
+expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded\r
+expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded\r
+expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded\r
+expx1010 exp 2.956859  -> 19.23745 Inexact Rounded\r
+expx1011 exp 7.504679  -> 1816.522 Inexact Rounded\r
+expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded\r
+expx1013 exp 3.810071  -> 45.15364 Inexact Rounded\r
+expx1014 exp 1.502390  -> 4.492413 Inexact Rounded\r
+expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded\r
+expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded\r
+expx1017 exp 9.811445  -> 18241.33 Inexact Rounded\r
+expx1018 exp 3.245249  -> 25.66810 Inexact Rounded\r
+expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded\r
+expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded\r
+expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded\r
+expx1022 exp 2.202088  -> 9.043877 Inexact Rounded\r
+expx1023 exp 8.778203  -> 6491.202 Inexact Rounded\r
+expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded\r
+expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded\r
+expx1026 exp 0.276413  -> 1.318392 Inexact Rounded\r
+expx1027 exp 4.490067  -> 89.12742 Inexact Rounded\r
+expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded\r
+expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded\r
+expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded\r
+expx1031 exp 9.261816  -> 10528.24 Inexact Rounded\r
+expx1032 exp 9.611186  -> 14930.87 Inexact Rounded\r
+expx1033 exp 9.118125  -> 9119.087 Inexact Rounded\r
+expx1034 exp 9.469083  -> 12953.00 Inexact Rounded\r
+expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded\r
+expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded\r
+expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded\r
+expx1038 exp 9.138494  -> 9306.739 Inexact Rounded\r
+expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded\r
+expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded\r
+\r
diff --git a/Lib/test/decimaltestdata/extra.decTest b/Lib/test/decimaltestdata/extra.decTest
new file mode 100644 (file)
index 0000000..36f2a97
--- /dev/null
@@ -0,0 +1,567 @@
+version: ?.??
+
+extended: 1
+rounding: half_even
+
+-- testing folddown and clamping
+maxexponent: 9
+minexponent: -9
+precision: 6
+clamp: 1
+extr0000 apply 1E+11 -> Infinity Overflow Inexact Rounded
+extr0001 apply 1E+10 -> Infinity Overflow Inexact Rounded
+extr0002 apply 1E+9 -> 1.00000E+9 Clamped
+extr0003 apply 1E+8 -> 1.0000E+8 Clamped
+extr0004 apply 1E+7 -> 1.000E+7 Clamped
+extr0005 apply 1E+6 -> 1.00E+6 Clamped
+extr0006 apply 1E+5 -> 1.0E+5 Clamped
+extr0007 apply 1E+4 -> 1E+4
+extr0008 apply 1E+3 -> 1E+3
+extr0009 apply 1E+2 -> 1E+2
+extr0010 apply 1E+1 -> 1E+1
+extr0011 apply 1 -> 1
+extr0012 apply 1E-1 -> 0.1
+extr0013 apply 1E-2 -> 0.01
+extr0014 apply 1E-3 -> 0.001
+extr0015 apply 1E-4 -> 0.0001
+extr0016 apply 1E-5 -> 0.00001
+extr0017 apply 1E-6 -> 0.000001
+extr0018 apply 1E-7 -> 1E-7
+extr0019 apply 1E-8 -> 1E-8
+extr0020 apply 1E-9 -> 1E-9
+extr0021 apply 1E-10 -> 1E-10 Subnormal
+extr0022 apply 1E-11 -> 1E-11 Subnormal
+extr0023 apply 1E-12 -> 1E-12 Subnormal
+extr0024 apply 1E-13 -> 1E-13 Subnormal
+extr0025 apply 1E-14 -> 1E-14 Subnormal
+extr0026 apply 1E-15 -> 0E-14 Inexact Rounded Subnormal Underflow Clamped
+extr0027 apply 1E-16 -> 0E-14 Inexact Rounded Subnormal Underflow Clamped
+clamp: 0
+
+-- large precision, small minimum and maximum exponent; in this case
+-- it's possible that folddown is required on a subnormal result
+maxexponent: 9
+minexponent: -9
+precision: 24
+clamp: 1
+extr0100 apply 1E+11 -> Infinity Overflow Inexact Rounded
+extr0101 apply 1E+10 -> Infinity Overflow Inexact Rounded
+extr0102 apply 1E+9 -> 1000000000.00000000000000 Clamped
+extr0103 apply 1E+8 -> 100000000.00000000000000 Clamped
+extr0104 apply 1E+7 -> 10000000.00000000000000 Clamped
+extr0105 apply 1E+6 -> 1000000.00000000000000 Clamped
+extr0106 apply 1E+5 -> 100000.00000000000000 Clamped
+extr0107 apply 1E+4 -> 10000.00000000000000 Clamped
+extr0108 apply 1E+3 -> 1000.00000000000000 Clamped
+extr0109 apply 1E+2 -> 100.00000000000000 Clamped
+extr0110 apply 1E+1 -> 10.00000000000000 Clamped
+extr0111 apply 1 ->    1.00000000000000 Clamped
+extr0112 apply 1E-1 -> 0.10000000000000 Clamped
+extr0113 apply 1E-2 -> 0.01000000000000 Clamped
+extr0114 apply 1E-3 -> 0.00100000000000 Clamped
+extr0115 apply 1E-4 -> 0.00010000000000 Clamped
+extr0116 apply 1E-5 -> 0.00001000000000 Clamped
+extr0117 apply 1E-6 -> 0.00000100000000 Clamped
+extr0118 apply 1E-7 -> 1.0000000E-7 Clamped
+extr0119 apply 1E-8 -> 1.000000E-8 Clamped
+extr0120 apply 1E-9 -> 1.00000E-9 Clamped
+extr0121 apply 1E-10 -> 1.0000E-10 Subnormal Clamped
+extr0122 apply 1E-11 -> 1.000E-11 Subnormal Clamped
+extr0123 apply 1E-12 -> 1.00E-12 Subnormal Clamped
+extr0124 apply 1E-13 -> 1.0E-13 Subnormal Clamped
+extr0125 apply 1E-14 -> 1E-14 Subnormal
+extr0126 apply 1E-15 -> 1E-15 Subnormal
+extr0127 apply 1E-16 -> 1E-16 Subnormal
+extr0128 apply 1E-17 -> 1E-17 Subnormal
+extr0129 apply 1E-18 -> 1E-18 Subnormal
+extr0130 apply 1E-19 -> 1E-19 Subnormal
+extr0131 apply 1E-20 -> 1E-20 Subnormal
+extr0132 apply 1E-21 -> 1E-21 Subnormal
+extr0133 apply 1E-22 -> 1E-22 Subnormal
+extr0134 apply 1E-23 -> 1E-23 Subnormal
+extr0135 apply 1E-24 -> 1E-24 Subnormal
+extr0136 apply 1E-25 -> 1E-25 Subnormal
+extr0137 apply 1E-26 -> 1E-26 Subnormal
+extr0138 apply 1E-27 -> 1E-27 Subnormal
+extr0139 apply 1E-28 -> 1E-28 Subnormal
+extr0140 apply 1E-29 -> 1E-29 Subnormal
+extr0141 apply 1E-30 -> 1E-30 Subnormal
+extr0142 apply 1E-31 -> 1E-31 Subnormal
+extr0143 apply 1E-32 -> 1E-32 Subnormal
+extr0144 apply 1E-33 -> 0E-32 Inexact Rounded Subnormal Underflow Clamped
+extr0145 apply 1E-34 -> 0E-32 Inexact Rounded Subnormal Underflow Clamped
+clamp: 0
+
+-- some buggy addition cases from Python 2.5.x
+maxexponent: 999
+minexponent: -999
+precision: 6
+extr1000 add 0E+1000 0E+2000 -> 0E+999 Clamped
+extr1001 add 0E+1004 0E+1001 -> 0E+999 Clamped
+clamp: 1
+extr1002 add 0E+1000 0E+1000 -> 0E+994 Clamped
+clamp: 0
+extr1003 add 0E+1000 0E-1005 -> 0E-1004 Clamped
+extr1004 add 0E-1006 0 -> 0E-1004 Clamped
+extr1005 add 1E+1000 -1E+1000 -> 0E+999 Clamped
+extr1006 add -3.1E+1004 3.1E+1004 -> 0E+999 Clamped
+clamp: 1
+extr1007 add 1E+998 -1E+998 -> 0E+994 Clamped
+clamp: 0
+extr1008 add 2E-1005 -2E-1005 -> 0E-1004 Clamped
+extr1009 add -3.1E-1005 3.1E-1005 -> 0E-1004 Clamped
+
+precision: 3
+extr1010 add 99949.9 0.200000 -> 1.00E+5 Inexact Rounded
+extr1011 add 99949.9 0.100000 -> 1.00E+5 Inexact Rounded
+extr1012 add 99849.9 0.200000 -> 9.99E+4 Inexact Rounded
+extr1013 add 99849.9 0.100000 -> 9.98E+4 Inexact Rounded
+extr1014 add 1.0149 0.00011 -> 1.02 Inexact Rounded
+extr1015 add 1.0149 0.00010 -> 1.02 Inexact Rounded
+extr1016 add 1.0149 0.00009 -> 1.01 Inexact Rounded
+extr1017 add 1.0049 0.00011 -> 1.01 Inexact Rounded
+extr1018 add 1.0049 0.00010 -> 1.00 Inexact Rounded
+extr1019 add 1.0049 0.00009 -> 1.00 Inexact Rounded
+rounding: down
+extr1020 add 99999.9 0.200000 -> 1.00E+5 Inexact Rounded
+extr1021 add 99999.8 0.200000 -> 1.00E+5 Rounded
+extr1022 add 99999.7 0.200000 -> 9.99E+4 Inexact Rounded
+rounding: half_even
+
+-- a bug in _rescale caused the following to fail in Python 2.5.1
+maxexponent: 999
+minexponent: -999
+precision: 6
+extr1100 add 0E+1000 1E+1000 -> Infinity Overflow Inexact Rounded
+extr1101 remainder 1E+1000 2E+1000 -> Infinity Overflow Inexact Rounded
+
+-- tests for scaleb in case where input precision > context precision.
+-- Result should be rounded.  (This isn't totally clear from the
+-- specification, but the treatment of underflow in the testcases
+-- suggests that rounding should occur in general.  Furthermore, it's
+-- the way that the reference implementation behaves.)
+maxexponent: 999
+minexponent: -999
+precision: 3
+extr1200 scaleb 1234 1 -> 1.23E+4 Inexact Rounded
+extr1201 scaleb 5678 0 -> 5.68E+3 Inexact Rounded
+extr1202 scaleb -9105 -1 -> -910 Inexact Rounded
+
+-- Invalid operation from 0 * infinity in fma
+-- takes precedence over a third-argument sNaN
+extr1300 fma 0 Inf sNaN123 -> NaN Invalid_operation
+extr1301 fma Inf 0 sNaN456 -> NaN Invalid_operation
+extr1302 fma 0E123 -Inf sNaN789 -> NaN Invalid_operation
+extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation
+
+------------------------------------------------------------------------
+-- The following tests (pwmx0 through pwmx440) are for the            --
+-- three-argument version of power:                                   --
+--                                                                    --
+--   pow(x, y, z) := x**y % z                                         --
+--                                                                    --
+-- Note that the three-argument version of power is *not* part of     --
+-- the IBM General Decimal Arithmetic specification.  Questions       --
+-- about it, or about these testcases, should go to one of the        --
+-- Python decimal authors.                                            --
+------------------------------------------------------------------------
+
+extended: 1
+precision: 9
+rounding: down
+maxExponent: 999
+minExponent: -999
+
+-- Small numbers
+-- Note that power(0, 0, m) is an error for any m
+pwmx0 power 0 -0 1 -> NaN Invalid_operation
+pwmx1 power 0 -0 2 -> NaN Invalid_operation
+pwmx2 power 0 -0 3 -> NaN Invalid_operation
+pwmx3 power 0 -0 4 -> NaN Invalid_operation
+pwmx4 power 0 -0 -1 -> NaN Invalid_operation
+pwmx5 power 0 -0 -2 -> NaN Invalid_operation
+pwmx6 power 0 0 1 -> NaN Invalid_operation
+pwmx7 power 0 0 2 -> NaN Invalid_operation
+pwmx8 power 0 0 3 -> NaN Invalid_operation
+pwmx9 power 0 0 4 -> NaN Invalid_operation
+pwmx10 power 0 0 -1 -> NaN Invalid_operation
+pwmx11 power 0 0 -2 -> NaN Invalid_operation
+pwmx12 power 0 1 1 -> 0
+pwmx13 power 0 1 2 -> 0
+pwmx14 power 0 1 3 -> 0
+pwmx15 power 0 1 4 -> 0
+pwmx16 power 0 1 -1 -> 0
+pwmx17 power 0 1 -2 -> 0
+pwmx18 power 0 2 1 -> 0
+pwmx19 power 0 2 2 -> 0
+pwmx20 power 0 2 3 -> 0
+pwmx21 power 0 2 4 -> 0
+pwmx22 power 0 2 -1 -> 0
+pwmx23 power 0 2 -2 -> 0
+pwmx24 power 0 3 1 -> 0
+pwmx25 power 0 3 2 -> 0
+pwmx26 power 0 3 3 -> 0
+pwmx27 power 0 3 4 -> 0
+pwmx28 power 0 3 -1 -> 0
+pwmx29 power 0 3 -2 -> 0
+pwmx30 power 0 4 1 -> 0
+pwmx31 power 0 4 2 -> 0
+pwmx32 power 0 4 3 -> 0
+pwmx33 power 0 4 4 -> 0
+pwmx34 power 0 4 -1 -> 0
+pwmx35 power 0 4 -2 -> 0
+pwmx36 power 0 5 1 -> 0
+pwmx37 power 0 5 2 -> 0
+pwmx38 power 0 5 3 -> 0
+pwmx39 power 0 5 4 -> 0
+pwmx40 power 0 5 -1 -> 0
+pwmx41 power 0 5 -2 -> 0
+pwmx42 power 1 -0 1 -> 0
+pwmx43 power 1 -0 2 -> 1
+pwmx44 power 1 -0 3 -> 1
+pwmx45 power 1 -0 4 -> 1
+pwmx46 power 1 -0 -1 -> 0
+pwmx47 power 1 -0 -2 -> 1
+pwmx48 power 1 0 1 -> 0
+pwmx49 power 1 0 2 -> 1
+pwmx50 power 1 0 3 -> 1
+pwmx51 power 1 0 4 -> 1
+pwmx52 power 1 0 -1 -> 0
+pwmx53 power 1 0 -2 -> 1
+pwmx54 power 1 1 1 -> 0
+pwmx55 power 1 1 2 -> 1
+pwmx56 power 1 1 3 -> 1
+pwmx57 power 1 1 4 -> 1
+pwmx58 power 1 1 -1 -> 0
+pwmx59 power 1 1 -2 -> 1
+pwmx60 power 1 2 1 -> 0
+pwmx61 power 1 2 2 -> 1
+pwmx62 power 1 2 3 -> 1
+pwmx63 power 1 2 4 -> 1
+pwmx64 power 1 2 -1 -> 0
+pwmx65 power 1 2 -2 -> 1
+pwmx66 power 1 3 1 -> 0
+pwmx67 power 1 3 2 -> 1
+pwmx68 power 1 3 3 -> 1
+pwmx69 power 1 3 4 -> 1
+pwmx70 power 1 3 -1 -> 0
+pwmx71 power 1 3 -2 -> 1
+pwmx72 power 1 4 1 -> 0
+pwmx73 power 1 4 2 -> 1
+pwmx74 power 1 4 3 -> 1
+pwmx75 power 1 4 4 -> 1
+pwmx76 power 1 4 -1 -> 0
+pwmx77 power 1 4 -2 -> 1
+pwmx78 power 1 5 1 -> 0
+pwmx79 power 1 5 2 -> 1
+pwmx80 power 1 5 3 -> 1
+pwmx81 power 1 5 4 -> 1
+pwmx82 power 1 5 -1 -> 0
+pwmx83 power 1 5 -2 -> 1
+pwmx84 power 2 -0 1 -> 0
+pwmx85 power 2 -0 2 -> 1
+pwmx86 power 2 -0 3 -> 1
+pwmx87 power 2 -0 4 -> 1
+pwmx88 power 2 -0 -1 -> 0
+pwmx89 power 2 -0 -2 -> 1
+pwmx90 power 2 0 1 -> 0
+pwmx91 power 2 0 2 -> 1
+pwmx92 power 2 0 3 -> 1
+pwmx93 power 2 0 4 -> 1
+pwmx94 power 2 0 -1 -> 0
+pwmx95 power 2 0 -2 -> 1
+pwmx96 power 2 1 1 -> 0
+pwmx97 power 2 1 2 -> 0
+pwmx98 power 2 1 3 -> 2
+pwmx99 power 2 1 4 -> 2
+pwmx100 power 2 1 -1 -> 0
+pwmx101 power 2 1 -2 -> 0
+pwmx102 power 2 2 1 -> 0
+pwmx103 power 2 2 2 -> 0
+pwmx104 power 2 2 3 -> 1
+pwmx105 power 2 2 4 -> 0
+pwmx106 power 2 2 -1 -> 0
+pwmx107 power 2 2 -2 -> 0
+pwmx108 power 2 3 1 -> 0
+pwmx109 power 2 3 2 -> 0
+pwmx110 power 2 3 3 -> 2
+pwmx111 power 2 3 4 -> 0
+pwmx112 power 2 3 -1 -> 0
+pwmx113 power 2 3 -2 -> 0
+pwmx114 power 2 4 1 -> 0
+pwmx115 power 2 4 2 -> 0
+pwmx116 power 2 4 3 -> 1
+pwmx117 power 2 4 4 -> 0
+pwmx118 power 2 4 -1 -> 0
+pwmx119 power 2 4 -2 -> 0
+pwmx120 power 2 5 1 -> 0
+pwmx121 power 2 5 2 -> 0
+pwmx122 power 2 5 3 -> 2
+pwmx123 power 2 5 4 -> 0
+pwmx124 power 2 5 -1 -> 0
+pwmx125 power 2 5 -2 -> 0
+pwmx126 power 3 -0 1 -> 0
+pwmx127 power 3 -0 2 -> 1
+pwmx128 power 3 -0 3 -> 1
+pwmx129 power 3 -0 4 -> 1
+pwmx130 power 3 -0 -1 -> 0
+pwmx131 power 3 -0 -2 -> 1
+pwmx132 power 3 0 1 -> 0
+pwmx133 power 3 0 2 -> 1
+pwmx134 power 3 0 3 -> 1
+pwmx135 power 3 0 4 -> 1
+pwmx136 power 3 0 -1 -> 0
+pwmx137 power 3 0 -2 -> 1
+pwmx138 power 3 1 1 -> 0
+pwmx139 power 3 1 2 -> 1
+pwmx140 power 3 1 3 -> 0
+pwmx141 power 3 1 4 -> 3
+pwmx142 power 3 1 -1 -> 0
+pwmx143 power 3 1 -2 -> 1
+pwmx144 power 3 2 1 -> 0
+pwmx145 power 3 2 2 -> 1
+pwmx146 power 3 2 3 -> 0
+pwmx147 power 3 2 4 -> 1
+pwmx148 power 3 2 -1 -> 0
+pwmx149 power 3 2 -2 -> 1
+pwmx150 power 3 3 1 -> 0
+pwmx151 power 3 3 2 -> 1
+pwmx152 power 3 3 3 -> 0
+pwmx153 power 3 3 4 -> 3
+pwmx154 power 3 3 -1 -> 0
+pwmx155 power 3 3 -2 -> 1
+pwmx156 power 3 4 1 -> 0
+pwmx157 power 3 4 2 -> 1
+pwmx158 power 3 4 3 -> 0
+pwmx159 power 3 4 4 -> 1
+pwmx160 power 3 4 -1 -> 0
+pwmx161 power 3 4 -2 -> 1
+pwmx162 power 3 5 1 -> 0
+pwmx163 power 3 5 2 -> 1
+pwmx164 power 3 5 3 -> 0
+pwmx165 power 3 5 4 -> 3
+pwmx166 power 3 5 -1 -> 0
+pwmx167 power 3 5 -2 -> 1
+pwmx168 power -0 -0 1 -> NaN Invalid_operation
+pwmx169 power -0 -0 2 -> NaN Invalid_operation
+pwmx170 power -0 -0 3 -> NaN Invalid_operation
+pwmx171 power -0 -0 4 -> NaN Invalid_operation
+pwmx172 power -0 -0 -1 -> NaN Invalid_operation
+pwmx173 power -0 -0 -2 -> NaN Invalid_operation
+pwmx174 power -0 0 1 -> NaN Invalid_operation
+pwmx175 power -0 0 2 -> NaN Invalid_operation
+pwmx176 power -0 0 3 -> NaN Invalid_operation
+pwmx177 power -0 0 4 -> NaN Invalid_operation
+pwmx178 power -0 0 -1 -> NaN Invalid_operation
+pwmx179 power -0 0 -2 -> NaN Invalid_operation
+pwmx180 power -0 1 1 -> -0
+pwmx181 power -0 1 2 -> -0
+pwmx182 power -0 1 3 -> -0
+pwmx183 power -0 1 4 -> -0
+pwmx184 power -0 1 -1 -> -0
+pwmx185 power -0 1 -2 -> -0
+pwmx186 power -0 2 1 -> 0
+pwmx187 power -0 2 2 -> 0
+pwmx188 power -0 2 3 -> 0
+pwmx189 power -0 2 4 -> 0
+pwmx190 power -0 2 -1 -> 0
+pwmx191 power -0 2 -2 -> 0
+pwmx192 power -0 3 1 -> -0
+pwmx193 power -0 3 2 -> -0
+pwmx194 power -0 3 3 -> -0
+pwmx195 power -0 3 4 -> -0
+pwmx196 power -0 3 -1 -> -0
+pwmx197 power -0 3 -2 -> -0
+pwmx198 power -0 4 1 -> 0
+pwmx199 power -0 4 2 -> 0
+pwmx200 power -0 4 3 -> 0
+pwmx201 power -0 4 4 -> 0
+pwmx202 power -0 4 -1 -> 0
+pwmx203 power -0 4 -2 -> 0
+pwmx204 power -0 5 1 -> -0
+pwmx205 power -0 5 2 -> -0
+pwmx206 power -0 5 3 -> -0
+pwmx207 power -0 5 4 -> -0
+pwmx208 power -0 5 -1 -> -0
+pwmx209 power -0 5 -2 -> -0
+pwmx210 power -1 -0 1 -> 0
+pwmx211 power -1 -0 2 -> 1
+pwmx212 power -1 -0 3 -> 1
+pwmx213 power -1 -0 4 -> 1
+pwmx214 power -1 -0 -1 -> 0
+pwmx215 power -1 -0 -2 -> 1
+pwmx216 power -1 0 1 -> 0
+pwmx217 power -1 0 2 -> 1
+pwmx218 power -1 0 3 -> 1
+pwmx219 power -1 0 4 -> 1
+pwmx220 power -1 0 -1 -> 0
+pwmx221 power -1 0 -2 -> 1
+pwmx222 power -1 1 1 -> -0
+pwmx223 power -1 1 2 -> -1
+pwmx224 power -1 1 3 -> -1
+pwmx225 power -1 1 4 -> -1
+pwmx226 power -1 1 -1 -> -0
+pwmx227 power -1 1 -2 -> -1
+pwmx228 power -1 2 1 -> 0
+pwmx229 power -1 2 2 -> 1
+pwmx230 power -1 2 3 -> 1
+pwmx231 power -1 2 4 -> 1
+pwmx232 power -1 2 -1 -> 0
+pwmx233 power -1 2 -2 -> 1
+pwmx234 power -1 3 1 -> -0
+pwmx235 power -1 3 2 -> -1
+pwmx236 power -1 3 3 -> -1
+pwmx237 power -1 3 4 -> -1
+pwmx238 power -1 3 -1 -> -0
+pwmx239 power -1 3 -2 -> -1
+pwmx240 power -1 4 1 -> 0
+pwmx241 power -1 4 2 -> 1
+pwmx242 power -1 4 3 -> 1
+pwmx243 power -1 4 4 -> 1
+pwmx244 power -1 4 -1 -> 0
+pwmx245 power -1 4 -2 -> 1
+pwmx246 power -1 5 1 -> -0
+pwmx247 power -1 5 2 -> -1
+pwmx248 power -1 5 3 -> -1
+pwmx249 power -1 5 4 -> -1
+pwmx250 power -1 5 -1 -> -0
+pwmx251 power -1 5 -2 -> -1
+
+-- Randomly chosen larger values
+pwmx252 power 0 4 7 -> 0
+pwmx253 power -4 5 -9 -> -7
+pwmx254 power -5 4 -9 -> 4
+pwmx255 power -50 29 2 -> -0
+pwmx256 power -1 83 3 -> -1
+pwmx257 power -55 65 -75 -> -25
+pwmx258 power -613 151 -302 -> -9
+pwmx259 power 551 23 -35 -> 31
+pwmx260 power 51 142 942 -> 9
+pwmx261 power 6886 9204 -6091 -> 5034
+pwmx262 power 3057 5890 -3 -> 0
+pwmx263 power 56 4438 5365 -> 521
+pwmx264 power 96237 35669 -46669 -> 30717
+pwmx265 power 40011 34375 -57611 -> 625
+pwmx266 power 44317 38493 -12196 -> 11081
+pwmx267 power -282368 895633 -235870 -> -220928
+pwmx268 power 77328 852553 -405529 -> 129173
+pwmx269 power -929659 855713 650348 -> -90803
+pwmx270 power 907057 6574309 4924768 -> 3018257
+pwmx271 power -2887757 3198492 -5864352 -> 3440113
+pwmx272 power -247310 657371 -7415739 -> -1301840
+pwmx273 power -8399046 45334087 -22395020 -> -18515896
+pwmx274 power 79621397 4850236 1486555 -> 928706
+pwmx275 power 96012251 27971901 69609031 -> 50028729
+pwmx276 power -907335481 74127986 582330017 -> 51527187
+pwmx277 power -141192960 821063826 -260877928 -> 112318560
+pwmx278 power -501711702 934355994 82135143 -> 66586995
+pwmx279 power -9256358075 8900900138 -467222031 -> 95800246
+pwmx280 power -7031964291 1751257483 -935334498 -> -607626609
+pwmx281 power 8494314971 8740197252 107522491 -> 17373655
+pwmx282 power 88306216890 87477374166 -23498076 -> 15129528
+pwmx283 power -33939432478 7170196239 22133583 -> -11017036
+pwmx284 power 19466222767 30410710614 305752056 -> 191509537
+pwmx285 power -864942494008 370558899638 346688856 -> 56956768
+pwmx286 power -525406225603 345700226898 237163621 -> 56789534
+pwmx287 power 464612215955 312474621651 -329485700 -> 1853975
+pwmx288 power -1664283031244 3774474669855 919022867 -> -516034520
+pwmx289 power -3472438506913 7407327549995 -451206854 -> -74594761
+pwmx290 power -4223662152949 6891069279069 499843503 -> -80135290
+pwmx291 power -44022119276816 8168266170326 569679509 -> 375734475
+pwmx292 power -66195891207902 12532690555875 -243262129 -> -113186833
+pwmx293 power -69039911263164 52726605857673 360625196 -> -268662748
+pwmx294 power -299010116699208 885092589359231 -731310123 -> -104103765
+pwmx295 power -202495776299758 501159122943145 -686234870 -> -135511878
+pwmx296 power -595411478087676 836269270472481 -214614901 -> -183440819
+pwmx297 power -139555381056229 1324808520020507 -228944738 -> -218991473
+pwmx298 power 7846356250770543 1798045051036814 -101028985 -> 7805179
+pwmx299 power -4298015862709415 604966944844209 880212893 -> -87408671
+pwmx300 power -37384897538910893 76022206995659295 -930512842 -> -697757157
+pwmx301 power 82166659028005443 23375408251767704 817270700 -> 770697001
+pwmx302 power 97420301198165641 72213282983416924 947519716 -> 610711721
+pwmx303 power 913382043453243607 449681707248500262 211135545 -> 79544899
+pwmx304 power -313823613418052171 534579409610142937 -943062968 -> -446001379
+pwmx305 power -928106516894494093 760020177330116509 -50043994 -> -46010575
+pwmx306 power 4692146601679439796 4565354511806767804 -667339075 -> 480272081
+pwmx307 power 9722256633509177930 7276568791860505790 792675321 -> 182879752
+pwmx308 power 8689899484830064228 429082967129615261 -844555637 -> 270374557
+
+-- All inputs must be integers
+pwmx309 power 2.1 3 1 -> NaN Invalid_operation
+pwmx310 power 0.4 1 5 -> NaN Invalid_operation
+pwmx311 power 2 3.1 5 -> NaN Invalid_operation
+pwmx312 power 13 -1.2 10 -> NaN Invalid_operation
+pwmx313 power 2 3 5.1 -> NaN Invalid_operation
+
+-- Second argument must be nonnegative (-0 is okay)
+pwmx314 power 2 -3 5 -> NaN Invalid_operation
+pwmx315 power 7 -1 1 -> NaN Invalid_operation
+pwmx316 power 0 -2 6 -> NaN Invalid_operation
+
+-- Third argument must be nonzero
+pwmx317 power 13 1003 0 -> NaN Invalid_operation
+pwmx318 power 1 0 0E+987 -> NaN Invalid_operation
+pwmx319 power 0 2 -0 -> NaN Invalid_operation
+
+-- Integers are fine, no matter how they're expressed
+pwmx320 power 13.0 117.00 1E+2 -> 33
+pwmx321 power -2E+3 1.1E+10 -12323 -> 4811
+pwmx322 power 20 0E-300 143 -> 1
+pwmx323 power -20 -0E+1005 1179 -> 1
+pwmx324 power 0E-1001 17 5.6E+4 -> 0
+
+-- Modulus must not exceed precision
+pwmx325 power 0 1 1234567890 -> NaN Invalid_operation
+pwmx326 power 1 0 1000000000 -> NaN Invalid_operation
+pwmx327 power -23 5 -1000000000 -> NaN Invalid_operation
+pwmx328 power 41557 213 -999999999 -> 47650456
+pwmx329 power -2134 199 999999997 -> -946957912
+
+-- Huge base shouldn't present any problems
+pwmx330 power 1.23E+123456791 10123898 17291065 -> 5674045
+
+-- Large exponent, may be slow
+-- (if second argument is 1En then expect O(n) running time)
+pwmx331 power 1000288896 9.87E+12347 93379908 -> 43224924
+
+-- Triple NaN propagation (adapted from examples in fma.decTest)
+pwmx400 power  NaN2  NaN3  NaN5   ->  NaN2
+pwmx401 power  1     NaN3  NaN5   ->  NaN3
+pwmx402 power  1     1     NaN5   ->  NaN5
+pwmx403 power  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
+pwmx404 power  1     sNaN2 sNaN3  ->  NaN2 Invalid_operation
+pwmx405 power  1     1     sNaN3  ->  NaN3 Invalid_operation
+pwmx406 power  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
+pwmx407 power  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation
+pwmx408 power  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation
+
+-- Infinities not allowed
+pwmx410 power Inf 1 1 -> NaN Invalid_operation
+pwmx411 power 1 Inf 1 -> NaN Invalid_operation
+pwmx412 power 1 1 Inf -> NaN Invalid_operation
+pwmx413 power -Inf 1 1 -> NaN Invalid_operation
+pwmx414 power 1 -Inf 1 -> NaN Invalid_operation
+pwmx415 power 1 1 -Inf -> NaN Invalid_operation
+
+-- Just for fun: 1729 is a Carmichael number
+pwmx420 power 0 1728 1729 -> 0
+pwmx421 power 1 1728 1729 -> 1
+pwmx422 power 2 1728 1729 -> 1
+pwmx423 power 3 1728 1729 -> 1
+pwmx424 power 4 1728 1729 -> 1
+pwmx425 power 5 1728 1729 -> 1
+pwmx426 power 6 1728 1729 -> 1
+pwmx427 power 7 1728 1729 -> 742
+pwmx428 power 8 1728 1729 -> 1
+pwmx429 power 9 1728 1729 -> 1
+pwmx430 power 10 1728 1729 -> 1
+pwmx431 power 11 1728 1729 -> 1
+pwmx432 power 12 1728 1729 -> 1
+pwmx433 power 13 1728 1729 -> 533
+pwmx434 power 14 1728 1729 -> 742
+pwmx435 power 15 1728 1729 -> 1
+pwmx436 power 16 1728 1729 -> 1
+pwmx437 power 17 1728 1729 -> 1
+pwmx438 power 18 1728 1729 -> 1
+pwmx439 power 19 1728 1729 -> 456
+pwmx440 power 20 1728 1729 -> 1
diff --git a/Lib/test/decimaltestdata/fma.decTest b/Lib/test/decimaltestdata/fma.decTest
new file mode 100644 (file)
index 0000000..aa4c0ba
--- /dev/null
@@ -0,0 +1,3426 @@
+------------------------------------------------------------------------\r
+-- fma.decTest -- decimal fused multiply add                          --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- These tests comprese three parts:\r
+--   1. Sanity checks and other three-operand tests (especially those\r
+--      where the fused operation makes a difference)\r
+--   2. Multiply tests (third operand is neutral zero [0E+emax])\r
+--   3. Addition tests (first operand is 1)\r
+-- The multiply and addition tests are extensive because FMA may have\r
+-- its own dedicated multiplication or addition routine(s), and they\r
+-- also inherently check the left-to-right properties.\r
+\r
+-- Sanity checks\r
+fmax0001 fma  1   1   1 ->   2\r
+fmax0002 fma  1   1   2 ->   3\r
+fmax0003 fma  2   2   3 ->   7\r
+fmax0004 fma  9   9   9 ->  90\r
+fmax0005 fma -1   1   1 ->   0\r
+fmax0006 fma -1   1   2 ->   1\r
+fmax0007 fma -2   2   3 ->  -1\r
+fmax0008 fma -9   9   9 -> -72\r
+fmax0011 fma  1  -1   1 ->   0\r
+fmax0012 fma  1  -1   2 ->   1\r
+fmax0013 fma  2  -2   3 ->  -1\r
+fmax0014 fma  9  -9   9 -> -72\r
+fmax0015 fma  1   1  -1 ->   0\r
+fmax0016 fma  1   1  -2 ->  -1\r
+fmax0017 fma  2   2  -3 ->   1\r
+fmax0018 fma  9   9  -9 ->  72\r
+fmax0019 fma  3   5   7 ->  22\r
+fmax0029 fma  3  -5   7 ->  -8\r
+\r
+-- non-integer exacts\r
+fma0100  fma    25.2   63.6   -438  ->  1164.72\r
+fma0101  fma   0.301  0.380    334  ->  334.114380\r
+fma0102  fma    49.2   -4.8   23.3  ->  -212.86\r
+fma0103  fma    4.22  0.079  -94.6  ->  -94.26662\r
+fma0104  fma     903  0.797  0.887  ->  720.578\r
+fma0105  fma    6.13   -161   65.9  ->  -921.03\r
+fma0106  fma    28.2    727   5.45  ->  20506.85\r
+fma0107  fma       4    605    688  ->  3108\r
+fma0108  fma    93.3   0.19  0.226  ->  17.953\r
+fma0109  fma   0.169   -341   5.61  ->  -52.019\r
+fma0110  fma   -72.2     30  -51.2  ->  -2217.2\r
+fma0111  fma  -0.409     13   20.4  ->  15.083\r
+fma0112  fma     317   77.0   19.0  ->  24428.0\r
+fma0113  fma      47   6.58   1.62  ->  310.88\r
+fma0114  fma    1.36  0.984  0.493  ->  1.83124\r
+fma0115  fma    72.7    274   1.56  ->  19921.36\r
+fma0116  fma     335    847     83  ->  283828\r
+fma0117  fma     666  0.247   25.4  ->  189.902\r
+fma0118  fma   -3.87   3.06   78.0  ->  66.1578\r
+fma0119  fma   0.742    192   35.6  ->  178.064\r
+fma0120  fma   -91.6   5.29  0.153  ->  -484.411\r
+\r
+-- cases where result is different from separate multiply + add; each\r
+-- is preceded by the result of unfused multiply and add\r
+-- [this is about 20% of all similar  cases in general]\r
+--               888565290   1557.96930  -86087.7578  -> 1.38435735E+12\r
+fma0201  fma     888565290   1557.96930  -86087.7578  -> 1.38435736E+12  Inexact Rounded\r
+--             -85519342.9    735155419     42010431  -> -6.28700084E+16\r
+fma0205  fma   -85519342.9    735155419     42010431  -> -6.28700083E+16 Inexact Rounded\r
+--                -98025.5  -294603.472   10414348.2  -> 2.88890669E+10\r
+fma0208  fma      -98025.5  -294603.472   10414348.2  -> 2.88890670E+10  Inexact Rounded\r
+--              5967627.39   83526540.6   498494.810  -> 4.98455271E+14\r
+fma0211  fma    5967627.39   83526540.6   498494.810  -> 4.98455272E+14  Inexact Rounded\r
+--               3456.9433    874.39518   197866.615  ->  3220601.18\r
+fma0216  fma     3456.9433    874.39518   197866.615  ->  3220601.17     Inexact Rounded\r
+--              62769.8287   2096.98927    48.420317  ->  131627705\r
+fma0218  fma    62769.8287   2096.98927    48.420317  ->  131627706      Inexact Rounded\r
+--               -68.81500   59961113.9     -8988862  -> -4.13521291E+9\r
+fma0219  fma     -68.81500   59961113.9     -8988862  -> -4.13521292E+9  Inexact Rounded\r
+--              2126341.02   63491.5152    302427455  -> 1.35307040E+11\r
+fma0226  fma    2126341.02   63491.5152    302427455  -> 1.35307041E+11  Inexact Rounded\r
+\r
+\r
+-- Infinite combinations\r
+fmax0800 fma  Inf   Inf   Inf    ->  Infinity\r
+fmax0801 fma  Inf   Inf  -Inf    ->  NaN Invalid_operation\r
+fmax0802 fma  Inf  -Inf   Inf    ->  NaN Invalid_operation\r
+fmax0803 fma  Inf  -Inf  -Inf    -> -Infinity\r
+fmax0804 fma -Inf   Inf   Inf    ->  NaN Invalid_operation\r
+fmax0805 fma -Inf   Inf  -Inf    -> -Infinity\r
+fmax0806 fma -Inf  -Inf   Inf    ->  Infinity\r
+fmax0807 fma -Inf  -Inf  -Inf    ->  NaN Invalid_operation\r
+fmax0808 fma -Inf   0       1    ->  NaN Invalid_operation\r
+fmax0809 fma -Inf   0     NaN    ->  NaN Invalid_operation\r
+\r
+-- Triple NaN propagation\r
+fmax0900 fma  NaN2  NaN3  NaN5   ->  NaN2\r
+fmax0901 fma  0     NaN3  NaN5   ->  NaN3\r
+fmax0902 fma  0     0     NaN5   ->  NaN5\r
+-- first sNaN wins (consider qNaN from earlier sNaN being\r
+-- overridden by an sNaN in third operand)\r
+fmax0903 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+fmax0904 fma  0     sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+fmax0905 fma  0     0     sNaN3  ->  NaN3 Invalid_operation\r
+fmax0906 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation\r
+fmax0907 fma  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation\r
+fmax0908 fma  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation\r
+\r
+-- MULTIPLICATION TESTS ------------------------------------------------\r
+-- sanity checks (as base, above)\r
+fmax2000 fma 2      2  0E+999999  -> 4\r
+fmax2001 fma 2      3  0E+999999  -> 6\r
+fmax2002 fma 5      1  0E+999999  -> 5\r
+fmax2003 fma 5      2  0E+999999  -> 10\r
+fmax2004 fma 1.20   2  0E+999999  -> 2.40\r
+fmax2005 fma 1.20   0  0E+999999  -> 0.00\r
+fmax2006 fma 1.20  -2  0E+999999  -> -2.40\r
+fmax2007 fma -1.20  2  0E+999999  -> -2.40\r
+fmax2008 fma -1.20  0  0E+999999  -> 0.00\r
+fmax2009 fma -1.20 -2  0E+999999  -> 2.40\r
+fmax2010 fma 5.09 7.1  0E+999999  -> 36.139\r
+fmax2011 fma 2.5    4  0E+999999  -> 10.0\r
+fmax2012 fma 2.50   4  0E+999999  -> 10.00\r
+fmax2013 fma 1.23456789 1.00000000  0E+999999  -> 1.23456789 Rounded\r
+fmax2014 fma 9.999999999 9.999999999  0E+999999  -> 100.000000 Inexact Rounded\r
+fmax2015 fma 2.50   4  0E+999999  -> 10.00\r
+precision: 6\r
+fmax2016 fma 2.50   4  0E+999999  -> 10.00\r
+fmax2017 fma  9.999999  9.999999  0E+999999  ->  100.000 Inexact Rounded\r
+fmax2018 fma  9.999999 -9.999999  0E+999999  -> -100.000 Inexact Rounded\r
+fmax2019 fma -9.999999  9.999999  0E+999999  -> -100.000 Inexact Rounded\r
+fmax2020 fma -9.999999 -9.999999  0E+999999  ->  100.000 Inexact Rounded\r
+\r
+-- 1999.12.21: next one is a edge case if intermediate longs are used\r
+precision: 15\r
+fmax2059 fma 999999999999 9765625  0E+999999  -> 9.76562499999023E+18 Inexact Rounded\r
+precision: 30\r
+fmax2160 fma 999999999999 9765625  0E+999999  -> 9765624999990234375\r
+precision: 9\r
+-----\r
+\r
+-- zeros, etc.\r
+fmax2021 fma  0      0      0E+999999  ->  0\r
+fmax2022 fma  0     -0      0E+999999  ->  0\r
+fmax2023 fma -0      0      0E+999999  ->  0\r
+fmax2024 fma -0     -0      0E+999999  ->  0\r
+fmax2025 fma -0.0   -0.0    0E+999999  ->  0.00\r
+fmax2026 fma -0.0   -0.0    0E+999999  ->  0.00\r
+fmax2027 fma -0.0   -0.0    0E+999999  ->  0.00\r
+fmax2028 fma -0.0   -0.0    0E+999999  ->  0.00\r
+fmax2030 fma  5.00   1E-3   0E+999999  ->  0.00500\r
+fmax2031 fma  00.00  0.000  0E+999999  ->  0.00000\r
+fmax2032 fma  00.00  0E-3   0E+999999  ->  0.00000     -- rhs is 0\r
+fmax2033 fma  0E-3   00.00  0E+999999  ->  0.00000     -- lhs is 0\r
+fmax2034 fma -5.00   1E-3   0E+999999  -> -0.00500\r
+fmax2035 fma -00.00  0.000  0E+999999  ->  0.00000\r
+fmax2036 fma -00.00  0E-3   0E+999999  ->  0.00000     -- rhs is 0\r
+fmax2037 fma -0E-3   00.00  0E+999999  ->  0.00000     -- lhs is 0\r
+fmax2038 fma  5.00  -1E-3   0E+999999  -> -0.00500\r
+fmax2039 fma  00.00 -0.000  0E+999999  ->  0.00000\r
+fmax2040 fma  00.00 -0E-3   0E+999999  ->  0.00000     -- rhs is 0\r
+fmax2041 fma  0E-3  -00.00  0E+999999  ->  0.00000     -- lhs is 0\r
+fmax2042 fma -5.00  -1E-3   0E+999999  ->  0.00500\r
+fmax2043 fma -00.00 -0.000  0E+999999  ->  0.00000\r
+fmax2044 fma -00.00 -0E-3   0E+999999  ->  0.00000     -- rhs is 0\r
+fmax2045 fma -0E-3  -00.00  0E+999999  ->  0.00000     -- lhs is 0\r
+\r
+-- examples from decarith multiply\r
+fmax2050 fma 1.20 3         0E+999999  -> 3.60\r
+fmax2051 fma 7    3         0E+999999  -> 21\r
+fmax2052 fma 0.9  0.8       0E+999999  -> 0.72\r
+fmax2053 fma 0.9  -0        0E+999999  -> 0.0\r
+fmax2054 fma 654321 654321  0E+999999  -> 4.28135971E+11  Inexact Rounded\r
+\r
+fmax2060 fma 123.45 1e7   0E+999999  ->  1.2345E+9\r
+fmax2061 fma 123.45 1e8   0E+999999  ->  1.2345E+10\r
+fmax2062 fma 123.45 1e+9  0E+999999  ->  1.2345E+11\r
+fmax2063 fma 123.45 1e10  0E+999999  ->  1.2345E+12\r
+fmax2064 fma 123.45 1e11  0E+999999  ->  1.2345E+13\r
+fmax2065 fma 123.45 1e12  0E+999999  ->  1.2345E+14\r
+fmax2066 fma 123.45 1e13  0E+999999  ->  1.2345E+15\r
+\r
+\r
+-- test some intermediate lengths\r
+precision: 9\r
+fmax2080 fma 0.1 123456789           0E+999999  -> 12345678.9\r
+fmax2081 fma 0.1 1234567891          0E+999999  -> 123456789 Inexact Rounded\r
+fmax2082 fma 0.1 12345678912         0E+999999  -> 1.23456789E+9 Inexact Rounded\r
+fmax2083 fma 0.1 12345678912345      0E+999999  -> 1.23456789E+12 Inexact Rounded\r
+fmax2084 fma 0.1 123456789           0E+999999  -> 12345678.9\r
+precision: 8\r
+fmax2085 fma 0.1 12345678912         0E+999999  -> 1.2345679E+9 Inexact Rounded\r
+fmax2086 fma 0.1 12345678912345      0E+999999  -> 1.2345679E+12 Inexact Rounded\r
+precision: 7\r
+fmax2087 fma 0.1 12345678912         0E+999999  -> 1.234568E+9 Inexact Rounded\r
+fmax2088 fma 0.1 12345678912345      0E+999999  -> 1.234568E+12 Inexact Rounded\r
+\r
+precision: 9\r
+fmax2090 fma 123456789          0.1  0E+999999  -> 12345678.9\r
+fmax2091 fma 1234567891         0.1  0E+999999  -> 123456789 Inexact Rounded\r
+fmax2092 fma 12345678912        0.1  0E+999999  -> 1.23456789E+9 Inexact Rounded\r
+fmax2093 fma 12345678912345     0.1  0E+999999  -> 1.23456789E+12 Inexact Rounded\r
+fmax2094 fma 123456789          0.1  0E+999999  -> 12345678.9\r
+precision: 8\r
+fmax2095 fma 12345678912        0.1  0E+999999  -> 1.2345679E+9 Inexact Rounded\r
+fmax2096 fma 12345678912345     0.1  0E+999999  -> 1.2345679E+12 Inexact Rounded\r
+precision: 7\r
+fmax2097 fma 12345678912        0.1  0E+999999  -> 1.234568E+9 Inexact Rounded\r
+fmax2098 fma 12345678912345     0.1  0E+999999  -> 1.234568E+12 Inexact Rounded\r
+\r
+-- test some more edge cases and carries\r
+maxexponent: 9999\r
+minexponent: -9999\r
+precision: 33\r
+fmax2101 fma 9 9    0E+999999  -> 81\r
+fmax2102 fma 9 90    0E+999999  -> 810\r
+fmax2103 fma 9 900    0E+999999  -> 8100\r
+fmax2104 fma 9 9000    0E+999999  -> 81000\r
+fmax2105 fma 9 90000    0E+999999  -> 810000\r
+fmax2106 fma 9 900000    0E+999999  -> 8100000\r
+fmax2107 fma 9 9000000    0E+999999  -> 81000000\r
+fmax2108 fma 9 90000000    0E+999999  -> 810000000\r
+fmax2109 fma 9 900000000    0E+999999  -> 8100000000\r
+fmax2110 fma 9 9000000000    0E+999999  -> 81000000000\r
+fmax2111 fma 9 90000000000    0E+999999  -> 810000000000\r
+fmax2112 fma 9 900000000000    0E+999999  -> 8100000000000\r
+fmax2113 fma 9 9000000000000    0E+999999  -> 81000000000000\r
+fmax2114 fma 9 90000000000000    0E+999999  -> 810000000000000\r
+fmax2115 fma 9 900000000000000    0E+999999  -> 8100000000000000\r
+fmax2116 fma 9 9000000000000000    0E+999999  -> 81000000000000000\r
+fmax2117 fma 9 90000000000000000    0E+999999  -> 810000000000000000\r
+fmax2118 fma 9 900000000000000000    0E+999999  -> 8100000000000000000\r
+fmax2119 fma 9 9000000000000000000    0E+999999  -> 81000000000000000000\r
+fmax2120 fma 9 90000000000000000000    0E+999999  -> 810000000000000000000\r
+fmax2121 fma 9 900000000000000000000    0E+999999  -> 8100000000000000000000\r
+fmax2122 fma 9 9000000000000000000000    0E+999999  -> 81000000000000000000000\r
+fmax2123 fma 9 90000000000000000000000    0E+999999  -> 810000000000000000000000\r
+-- test some more edge cases without carries\r
+fmax2131 fma 3 3    0E+999999  -> 9\r
+fmax2132 fma 3 30    0E+999999  -> 90\r
+fmax2133 fma 3 300    0E+999999  -> 900\r
+fmax2134 fma 3 3000    0E+999999  -> 9000\r
+fmax2135 fma 3 30000    0E+999999  -> 90000\r
+fmax2136 fma 3 300000    0E+999999  -> 900000\r
+fmax2137 fma 3 3000000    0E+999999  -> 9000000\r
+fmax2138 fma 3 30000000    0E+999999  -> 90000000\r
+fmax2139 fma 3 300000000    0E+999999  -> 900000000\r
+fmax2140 fma 3 3000000000    0E+999999  -> 9000000000\r
+fmax2141 fma 3 30000000000    0E+999999  -> 90000000000\r
+fmax2142 fma 3 300000000000    0E+999999  -> 900000000000\r
+fmax2143 fma 3 3000000000000    0E+999999  -> 9000000000000\r
+fmax2144 fma 3 30000000000000    0E+999999  -> 90000000000000\r
+fmax2145 fma 3 300000000000000    0E+999999  -> 900000000000000\r
+fmax2146 fma 3 3000000000000000    0E+999999  -> 9000000000000000\r
+fmax2147 fma 3 30000000000000000    0E+999999  -> 90000000000000000\r
+fmax2148 fma 3 300000000000000000    0E+999999  -> 900000000000000000\r
+fmax2149 fma 3 3000000000000000000    0E+999999  -> 9000000000000000000\r
+fmax2150 fma 3 30000000000000000000    0E+999999  -> 90000000000000000000\r
+fmax2151 fma 3 300000000000000000000    0E+999999  -> 900000000000000000000\r
+fmax2152 fma 3 3000000000000000000000    0E+999999  -> 9000000000000000000000\r
+fmax2153 fma 3 30000000000000000000000    0E+999999  -> 90000000000000000000000\r
+\r
+maxexponent: 999999\r
+minexponent: -999999\r
+precision: 9\r
+-- test some cases that are close to exponent overflow/underflow\r
+fmax2170 fma 1 9e999999     0E+999999  -> 9E+999999\r
+fmax2171 fma 1 9.9e999999   0E+999999  -> 9.9E+999999\r
+fmax2172 fma 1 9.99e999999  0E+999999  -> 9.99E+999999\r
+fmax2173 fma 9e999999    1  0E+999999  -> 9E+999999\r
+fmax2174 fma 9.9e999999  1  0E+999999  -> 9.9E+999999\r
+fmax2176 fma 9.99e999999 1  0E+999999  -> 9.99E+999999\r
+fmax2177 fma 1 9.99999e999999  0E+999999  -> 9.99999E+999999\r
+fmax2178 fma 9.99999e999999 1  0E+999999  -> 9.99999E+999999\r
+\r
+fmax2180 fma 0.1 9e-999998    0E+999999  -> 9E-999999\r
+fmax2181 fma 0.1 99e-999998   0E+999999  -> 9.9E-999998\r
+fmax2182 fma 0.1 999e-999998  0E+999999  -> 9.99E-999997\r
+\r
+fmax2183 fma 0.1 9e-999998      0E+999999  -> 9E-999999\r
+fmax2184 fma 0.1 99e-999998     0E+999999  -> 9.9E-999998\r
+fmax2185 fma 0.1 999e-999998    0E+999999  -> 9.99E-999997\r
+fmax2186 fma 0.1 999e-999997    0E+999999  -> 9.99E-999996\r
+fmax2187 fma 0.1 9999e-999997   0E+999999  -> 9.999E-999995\r
+fmax2188 fma 0.1 99999e-999997  0E+999999  -> 9.9999E-999994\r
+\r
+fmax2190 fma 1 9e-999998    0E+999999  -> 9E-999998\r
+fmax2191 fma 1 99e-999998   0E+999999  -> 9.9E-999997\r
+fmax2192 fma 1 999e-999998  0E+999999  -> 9.99E-999996\r
+fmax2193 fma 9e-999998   1  0E+999999  -> 9E-999998\r
+fmax2194 fma 99e-999998  1  0E+999999  -> 9.9E-999997\r
+fmax2195 fma 999e-999998 1  0E+999999  -> 9.99E-999996\r
+\r
+-- long operand triangle\r
+precision: 33\r
+fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916511992830 Inexact Rounded\r
+precision: 32\r
+fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651199283  Inexact Rounded\r
+precision: 31\r
+fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165119928   Inexact Rounded\r
+precision: 30\r
+fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916511993    Inexact Rounded\r
+precision: 29\r
+fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651199     Inexact Rounded\r
+precision: 28\r
+fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165120      Inexact Rounded\r
+precision: 27\r
+fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916512       Inexact Rounded\r
+precision: 26\r
+fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651        Inexact Rounded\r
+precision: 25\r
+fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165         Inexact Rounded\r
+precision: 24\r
+fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671917          Inexact Rounded\r
+precision: 23\r
+fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967192           Inexact Rounded\r
+precision: 22\r
+fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719            Inexact Rounded\r
+precision: 21\r
+fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369672             Inexact Rounded\r
+precision: 20\r
+fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967              Inexact Rounded\r
+precision: 19\r
+fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933697               Inexact Rounded\r
+precision: 18\r
+fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193370                Inexact Rounded\r
+precision: 17\r
+fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119337                 Inexact Rounded\r
+precision: 16\r
+fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011934                  Inexact Rounded\r
+precision: 15\r
+fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193                   Inexact Rounded\r
+precision: 14\r
+fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119                    Inexact Rounded\r
+precision: 13\r
+fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908012                     Inexact Rounded\r
+precision: 12\r
+fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801                      Inexact Rounded\r
+precision: 11\r
+fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080                       Inexact Rounded\r
+precision: 10\r
+fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908                        Inexact Rounded\r
+precision:  9\r
+fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.291                         Inexact Rounded\r
+precision:  8\r
+fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29                          Inexact Rounded\r
+precision:  7\r
+fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.3                           Inexact Rounded\r
+precision:  6\r
+fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433                            Inexact Rounded\r
+precision:  5\r
+fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.4543E+5                         Inexact Rounded\r
+precision:  4\r
+fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.454E+5                         Inexact Rounded\r
+precision:  3\r
+fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.45E+5                         Inexact Rounded\r
+precision:  2\r
+fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.5E+5                         Inexact Rounded\r
+precision:  1\r
+fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1E+5                          Inexact Rounded\r
+\r
+-- test some edge cases with exact rounding\r
+maxexponent: 9999\r
+minexponent: -9999\r
+precision: 9\r
+fmax2301 fma 9 9    0E+999999  -> 81\r
+fmax2302 fma 9 90    0E+999999  -> 810\r
+fmax2303 fma 9 900    0E+999999  -> 8100\r
+fmax2304 fma 9 9000    0E+999999  -> 81000\r
+fmax2305 fma 9 90000    0E+999999  -> 810000\r
+fmax2306 fma 9 900000    0E+999999  -> 8100000\r
+fmax2307 fma 9 9000000    0E+999999  -> 81000000\r
+fmax2308 fma 9 90000000    0E+999999  -> 810000000\r
+fmax2309 fma 9 900000000    0E+999999  -> 8.10000000E+9   Rounded\r
+fmax2310 fma 9 9000000000    0E+999999  -> 8.10000000E+10  Rounded\r
+fmax2311 fma 9 90000000000    0E+999999  -> 8.10000000E+11  Rounded\r
+fmax2312 fma 9 900000000000    0E+999999  -> 8.10000000E+12  Rounded\r
+fmax2313 fma 9 9000000000000    0E+999999  -> 8.10000000E+13  Rounded\r
+fmax2314 fma 9 90000000000000    0E+999999  -> 8.10000000E+14  Rounded\r
+fmax2315 fma 9 900000000000000    0E+999999  -> 8.10000000E+15  Rounded\r
+fmax2316 fma 9 9000000000000000    0E+999999  -> 8.10000000E+16  Rounded\r
+fmax2317 fma 9 90000000000000000    0E+999999  -> 8.10000000E+17  Rounded\r
+fmax2318 fma 9 900000000000000000    0E+999999  -> 8.10000000E+18  Rounded\r
+fmax2319 fma 9 9000000000000000000    0E+999999  -> 8.10000000E+19  Rounded\r
+fmax2320 fma 9 90000000000000000000    0E+999999  -> 8.10000000E+20  Rounded\r
+fmax2321 fma 9 900000000000000000000    0E+999999  -> 8.10000000E+21  Rounded\r
+fmax2322 fma 9 9000000000000000000000    0E+999999  -> 8.10000000E+22  Rounded\r
+fmax2323 fma 9 90000000000000000000000    0E+999999  -> 8.10000000E+23  Rounded\r
+\r
+-- fastpath breakers\r
+precision:   29\r
+fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603  0E+999999  -> 1.6487212707001281468486507878 Inexact Rounded\r
+precision:   55\r
+fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428  0E+999999  -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded\r
+\r
+\r
+-- tryzeros cases\r
+precision:   7\r
+rounding:    half_up\r
+maxExponent: 92\r
+minexponent: -92\r
+fmax2504  fma  0E-60 1000E-60   0E+999999  -> 0E-98 Clamped\r
+fmax2505  fma  100E+60 0E+60    0E+999999  -> 0E+92 Clamped\r
+\r
+-- mixed with zeros\r
+maxexponent: 999999\r
+minexponent: -999999\r
+precision: 9\r
+fmax2541 fma  0    -1      0E+999999  ->  0\r
+fmax2542 fma -0    -1      0E+999999  ->  0\r
+fmax2543 fma  0     1      0E+999999  ->  0\r
+fmax2544 fma -0     1      0E+999999  ->  0\r
+fmax2545 fma -1     0      0E+999999  ->  0\r
+fmax2546 fma -1    -0      0E+999999  ->  0\r
+fmax2547 fma  1     0      0E+999999  ->  0\r
+fmax2548 fma  1    -0      0E+999999  ->  0\r
+\r
+fmax2551 fma  0.0  -1      0E+999999  ->  0.0\r
+fmax2552 fma -0.0  -1      0E+999999  ->  0.0\r
+fmax2553 fma  0.0   1      0E+999999  ->  0.0\r
+fmax2554 fma -0.0   1      0E+999999  ->  0.0\r
+fmax2555 fma -1.0   0      0E+999999  ->  0.0\r
+fmax2556 fma -1.0  -0      0E+999999  ->  0.0\r
+fmax2557 fma  1.0   0      0E+999999  ->  0.0\r
+fmax2558 fma  1.0  -0      0E+999999  ->  0.0\r
+\r
+fmax2561 fma  0    -1.0    0E+999999  ->  0.0\r
+fmax2562 fma -0    -1.0    0E+999999  ->  0.0\r
+fmax2563 fma  0     1.0    0E+999999  ->  0.0\r
+fmax2564 fma -0     1.0    0E+999999  ->  0.0\r
+fmax2565 fma -1     0.0    0E+999999  ->  0.0\r
+fmax2566 fma -1    -0.0    0E+999999  ->  0.0\r
+fmax2567 fma  1     0.0    0E+999999  ->  0.0\r
+fmax2568 fma  1    -0.0    0E+999999  ->  0.0\r
+\r
+fmax2571 fma  0.0  -1.0    0E+999999  ->  0.00\r
+fmax2572 fma -0.0  -1.0    0E+999999  ->  0.00\r
+fmax2573 fma  0.0   1.0    0E+999999  ->  0.00\r
+fmax2574 fma -0.0   1.0    0E+999999  ->  0.00\r
+fmax2575 fma -1.0   0.0    0E+999999  ->  0.00\r
+fmax2576 fma -1.0  -0.0    0E+999999  ->  0.00\r
+fmax2577 fma  1.0   0.0    0E+999999  ->  0.00\r
+fmax2578 fma  1.0  -0.0    0E+999999  ->  0.00\r
+\r
+\r
+-- Specials\r
+fmax2580 fma  Inf  -Inf    0E+999999  -> -Infinity\r
+fmax2581 fma  Inf  -1000   0E+999999  -> -Infinity\r
+fmax2582 fma  Inf  -1      0E+999999  -> -Infinity\r
+fmax2583 fma  Inf  -0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2584 fma  Inf   0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2585 fma  Inf   1      0E+999999  ->  Infinity\r
+fmax2586 fma  Inf   1000   0E+999999  ->  Infinity\r
+fmax2587 fma  Inf   Inf    0E+999999  ->  Infinity\r
+fmax2588 fma -1000  Inf    0E+999999  -> -Infinity\r
+fmax2589 fma -Inf   Inf    0E+999999  -> -Infinity\r
+fmax2590 fma -1     Inf    0E+999999  -> -Infinity\r
+fmax2591 fma -0     Inf    0E+999999  ->  NaN  Invalid_operation\r
+fmax2592 fma  0     Inf    0E+999999  ->  NaN  Invalid_operation\r
+fmax2593 fma  1     Inf    0E+999999  ->  Infinity\r
+fmax2594 fma  1000  Inf    0E+999999  ->  Infinity\r
+fmax2595 fma  Inf   Inf    0E+999999  ->  Infinity\r
+\r
+fmax2600 fma -Inf  -Inf    0E+999999  ->  Infinity\r
+fmax2601 fma -Inf  -1000   0E+999999  ->  Infinity\r
+fmax2602 fma -Inf  -1      0E+999999  ->  Infinity\r
+fmax2603 fma -Inf  -0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2604 fma -Inf   0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2605 fma -Inf   1      0E+999999  -> -Infinity\r
+fmax2606 fma -Inf   1000   0E+999999  -> -Infinity\r
+fmax2607 fma -Inf   Inf    0E+999999  -> -Infinity\r
+fmax2608 fma -1000  Inf    0E+999999  -> -Infinity\r
+fmax2609 fma -Inf  -Inf    0E+999999  ->  Infinity\r
+fmax2610 fma -1    -Inf    0E+999999  ->  Infinity\r
+fmax2611 fma -0    -Inf    0E+999999  ->  NaN  Invalid_operation\r
+fmax2612 fma  0    -Inf    0E+999999  ->  NaN  Invalid_operation\r
+fmax2613 fma  1    -Inf    0E+999999  -> -Infinity\r
+fmax2614 fma  1000 -Inf    0E+999999  -> -Infinity\r
+fmax2615 fma  Inf  -Inf    0E+999999  -> -Infinity\r
+\r
+fmax2621 fma  NaN -Inf     0E+999999  ->  NaN\r
+fmax2622 fma  NaN -1000    0E+999999  ->  NaN\r
+fmax2623 fma  NaN -1       0E+999999  ->  NaN\r
+fmax2624 fma  NaN -0       0E+999999  ->  NaN\r
+fmax2625 fma  NaN  0       0E+999999  ->  NaN\r
+fmax2626 fma  NaN  1       0E+999999  ->  NaN\r
+fmax2627 fma  NaN  1000    0E+999999  ->  NaN\r
+fmax2628 fma  NaN  Inf     0E+999999  ->  NaN\r
+fmax2629 fma  NaN  NaN     0E+999999  ->  NaN\r
+fmax2630 fma -Inf  NaN     0E+999999  ->  NaN\r
+fmax2631 fma -1000 NaN     0E+999999  ->  NaN\r
+fmax2632 fma -1    NaN     0E+999999  ->  NaN\r
+fmax2633 fma -0    NaN     0E+999999  ->  NaN\r
+fmax2634 fma  0    NaN     0E+999999  ->  NaN\r
+fmax2635 fma  1    NaN     0E+999999  ->  NaN\r
+fmax2636 fma  1000 NaN     0E+999999  ->  NaN\r
+fmax2637 fma  Inf  NaN     0E+999999  ->  NaN\r
+\r
+fmax2641 fma  sNaN -Inf    0E+999999  ->  NaN  Invalid_operation\r
+fmax2642 fma  sNaN -1000   0E+999999  ->  NaN  Invalid_operation\r
+fmax2643 fma  sNaN -1      0E+999999  ->  NaN  Invalid_operation\r
+fmax2644 fma  sNaN -0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2645 fma  sNaN  0      0E+999999  ->  NaN  Invalid_operation\r
+fmax2646 fma  sNaN  1      0E+999999  ->  NaN  Invalid_operation\r
+fmax2647 fma  sNaN  1000   0E+999999  ->  NaN  Invalid_operation\r
+fmax2648 fma  sNaN  NaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2649 fma  sNaN sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2650 fma  NaN  sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2651 fma -Inf  sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2652 fma -1000 sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2653 fma -1    sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2654 fma -0    sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2655 fma  0    sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2656 fma  1    sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2657 fma  1000 sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2658 fma  Inf  sNaN    0E+999999  ->  NaN  Invalid_operation\r
+fmax2659 fma  NaN  sNaN    0E+999999  ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+fmax2661 fma  NaN9 -Inf    0E+999999  ->  NaN9\r
+fmax2662 fma  NaN8  999    0E+999999  ->  NaN8\r
+fmax2663 fma  NaN71 Inf    0E+999999  ->  NaN71\r
+fmax2664 fma  NaN6  NaN5   0E+999999  ->  NaN6\r
+fmax2665 fma -Inf   NaN4   0E+999999  ->  NaN4\r
+fmax2666 fma -999   NaN33  0E+999999  ->  NaN33\r
+fmax2667 fma  Inf   NaN2   0E+999999  ->  NaN2\r
+\r
+fmax2671 fma  sNaN99 -Inf     0E+999999  ->  NaN99 Invalid_operation\r
+fmax2672 fma  sNaN98 -11      0E+999999  ->  NaN98 Invalid_operation\r
+fmax2673 fma  sNaN97  NaN     0E+999999  ->  NaN97 Invalid_operation\r
+fmax2674 fma  sNaN16 sNaN94   0E+999999  ->  NaN16 Invalid_operation\r
+fmax2675 fma  NaN95  sNaN93   0E+999999  ->  NaN93 Invalid_operation\r
+fmax2676 fma -Inf    sNaN92   0E+999999  ->  NaN92 Invalid_operation\r
+fmax2677 fma  088    sNaN91   0E+999999  ->  NaN91 Invalid_operation\r
+fmax2678 fma  Inf    sNaN90   0E+999999  ->  NaN90 Invalid_operation\r
+fmax2679 fma  NaN    sNaN89   0E+999999  ->  NaN89 Invalid_operation\r
+\r
+fmax2681 fma -NaN9 -Inf    0E+999999  -> -NaN9\r
+fmax2682 fma -NaN8  999    0E+999999  -> -NaN8\r
+fmax2683 fma -NaN71 Inf    0E+999999  -> -NaN71\r
+fmax2684 fma -NaN6 -NaN5   0E+999999  -> -NaN6\r
+fmax2685 fma -Inf  -NaN4   0E+999999  -> -NaN4\r
+fmax2686 fma -999  -NaN33  0E+999999  -> -NaN33\r
+fmax2687 fma  Inf  -NaN2   0E+999999  -> -NaN2\r
+\r
+fmax2691 fma -sNaN99 -Inf     0E+999999  -> -NaN99 Invalid_operation\r
+fmax2692 fma -sNaN98 -11      0E+999999  -> -NaN98 Invalid_operation\r
+fmax2693 fma -sNaN97  NaN     0E+999999  -> -NaN97 Invalid_operation\r
+fmax2694 fma -sNaN16 -sNaN94  0E+999999  -> -NaN16 Invalid_operation\r
+fmax2695 fma -NaN95  -sNaN93  0E+999999  -> -NaN93 Invalid_operation\r
+fmax2696 fma -Inf    -sNaN92  0E+999999  -> -NaN92 Invalid_operation\r
+fmax2697 fma  088    -sNaN91  0E+999999  -> -NaN91 Invalid_operation\r
+fmax2698 fma  Inf    -sNaN90  0E+999999  -> -NaN90 Invalid_operation\r
+fmax2699 fma -NaN    -sNaN89  0E+999999  -> -NaN89 Invalid_operation\r
+\r
+fmax2701 fma -NaN  -Inf    0E+999999  -> -NaN\r
+fmax2702 fma -NaN   999    0E+999999  -> -NaN\r
+fmax2703 fma -NaN   Inf    0E+999999  -> -NaN\r
+fmax2704 fma -NaN  -NaN    0E+999999  -> -NaN\r
+fmax2705 fma -Inf  -NaN0   0E+999999  -> -NaN\r
+fmax2706 fma -999  -NaN    0E+999999  -> -NaN\r
+fmax2707 fma  Inf  -NaN    0E+999999  -> -NaN\r
+\r
+fmax2711 fma -sNaN   -Inf     0E+999999  -> -NaN Invalid_operation\r
+fmax2712 fma -sNaN   -11      0E+999999  -> -NaN Invalid_operation\r
+fmax2713 fma -sNaN00  NaN     0E+999999  -> -NaN Invalid_operation\r
+fmax2714 fma -sNaN   -sNaN    0E+999999  -> -NaN Invalid_operation\r
+fmax2715 fma -NaN    -sNaN    0E+999999  -> -NaN Invalid_operation\r
+fmax2716 fma -Inf    -sNaN    0E+999999  -> -NaN Invalid_operation\r
+fmax2717 fma  088    -sNaN    0E+999999  -> -NaN Invalid_operation\r
+fmax2718 fma  Inf    -sNaN    0E+999999  -> -NaN Invalid_operation\r
+fmax2719 fma -NaN    -sNaN    0E+999999  -> -NaN Invalid_operation\r
+\r
+-- overflow and underflow tests .. note subnormal results\r
+maxexponent: 999999\r
+minexponent: -999999\r
+fmax2730 fma +1.23456789012345E-0 9E+999999  0E+999999  -> Infinity Inexact Overflow Rounded\r
+fmax2731 fma 9E+999999 +1.23456789012345E-0  0E+999999  -> Infinity Inexact Overflow Rounded\r
+fmax2732 fma +0.100 9E-999999  0E+999999  -> 9.00E-1000000 Subnormal\r
+fmax2733 fma 9E-999999 +0.100  0E+999999  -> 9.00E-1000000 Subnormal\r
+fmax2735 fma -1.23456789012345E-0 9E+999999  0E+999999  -> -Infinity Inexact Overflow Rounded\r
+fmax2736 fma 9E+999999 -1.23456789012345E-0  0E+999999  -> -Infinity Inexact Overflow Rounded\r
+fmax2737 fma -0.100 9E-999999  0E+999999  -> -9.00E-1000000 Subnormal\r
+fmax2738 fma 9E-999999 -0.100  0E+999999  -> -9.00E-1000000 Subnormal\r
+\r
+-- signs\r
+fmax2751 fma  1e+777777  1e+411111  0E+999999  ->  Infinity Overflow Inexact Rounded\r
+fmax2752 fma  1e+777777 -1e+411111  0E+999999  -> -Infinity Overflow Inexact Rounded\r
+fmax2753 fma -1e+777777  1e+411111  0E+999999  -> -Infinity Overflow Inexact Rounded\r
+fmax2754 fma -1e+777777 -1e+411111  0E+999999  ->  Infinity Overflow Inexact Rounded\r
+fmax2755 fma  1e-777777  1e-411111  0E+999999  ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+fmax2756 fma  1e-777777 -1e-411111  0E+999999  -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+fmax2757 fma -1e-777777  1e-411111  0E+999999  -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+fmax2758 fma -1e-777777 -1e-411111  0E+999999  ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)\r
+precision: 9\r
+fmax2760 fma 1e-600000 1e-400001  0E+999999  -> 1E-1000001 Subnormal\r
+fmax2761 fma 1e-600000 1e-400002  0E+999999  -> 1E-1000002 Subnormal\r
+fmax2762 fma 1e-600000 1e-400003  0E+999999  -> 1E-1000003 Subnormal\r
+fmax2763 fma 1e-600000 1e-400004  0E+999999  -> 1E-1000004 Subnormal\r
+fmax2764 fma 1e-600000 1e-400005  0E+999999  -> 1E-1000005 Subnormal\r
+fmax2765 fma 1e-600000 1e-400006  0E+999999  -> 1E-1000006 Subnormal\r
+fmax2766 fma 1e-600000 1e-400007  0E+999999  -> 1E-1000007 Subnormal\r
+fmax2767 fma 1e-600000 1e-400008  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+fmax2768 fma 1e-600000 1e-400009  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+fmax2769 fma 1e-600000 1e-400010  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped\r
+-- [no equivalent of 'subnormal' for overflow]\r
+fmax2770 fma 1e+600000 1e+400001  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2771 fma 1e+600000 1e+400002  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2772 fma 1e+600000 1e+400003  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2773 fma 1e+600000 1e+400004  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2774 fma 1e+600000 1e+400005  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2775 fma 1e+600000 1e+400006  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2776 fma 1e+600000 1e+400007  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2777 fma 1e+600000 1e+400008  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2778 fma 1e+600000 1e+400009  0E+999999  -> Infinity Overflow Inexact Rounded\r
+fmax2779 fma 1e+600000 1e+400010  0E+999999  -> Infinity Overflow Inexact Rounded\r
+\r
+-- 'subnormal' test edge condition at higher precisions\r
+precision: 99\r
+fmax2780 fma 1e-600000 1e-400007  0E+999999  -> 1E-1000007 Subnormal\r
+fmax2781 fma 1e-600000 1e-400008  0E+999999  -> 1E-1000008 Subnormal\r
+fmax2782 fma 1e-600000 1e-400097  0E+999999  -> 1E-1000097 Subnormal\r
+fmax2783 fma 1e-600000 1e-400098  0E+999999  -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped\r
+precision: 999\r
+fmax2784 fma 1e-600000 1e-400997  0E+999999  -> 1E-1000997 Subnormal\r
+fmax2785 fma 1e-600000 1e-400998  0E+999999  -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- test subnormals rounding\r
+precision:   5\r
+maxExponent: 999\r
+minexponent: -999\r
+rounding:    half_even\r
+\r
+fmax2801 fma  1.0000E-999  1      0E+999999  -> 1.0000E-999\r
+fmax2802 fma  1.000E-999   1e-1   0E+999999  -> 1.000E-1000 Subnormal\r
+fmax2803 fma  1.00E-999    1e-2   0E+999999  -> 1.00E-1001  Subnormal\r
+fmax2804 fma  1.0E-999     1e-3   0E+999999  -> 1.0E-1002   Subnormal\r
+fmax2805 fma  1.0E-999     1e-4   0E+999999  -> 1E-1003     Subnormal Rounded\r
+fmax2806 fma  1.3E-999     1e-4   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2807 fma  1.5E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2808 fma  1.7E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2809 fma  2.3E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2810 fma  2.5E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2811 fma  2.7E-999     1e-4   0E+999999  -> 3E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2812 fma  1.49E-999    1e-4   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2813 fma  1.50E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2814 fma  1.51E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2815 fma  2.49E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2816 fma  2.50E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2817 fma  2.51E-999    1e-4   0E+999999  -> 3E-1003     Underflow Subnormal Inexact Rounded\r
+\r
+fmax2818 fma  1E-999       1e-4   0E+999999  -> 1E-1003     Subnormal\r
+fmax2819 fma  3E-999       1e-5   0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped\r
+fmax2820 fma  5E-999       1e-5   0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped\r
+fmax2821 fma  7E-999       1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2822 fma  9E-999       1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded\r
+fmax2823 fma  9.9E-999     1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded\r
+\r
+fmax2824 fma  1E-999      -1e-4   0E+999999  -> -1E-1003    Subnormal\r
+fmax2825 fma  3E-999      -1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped\r
+fmax2826 fma -5E-999       1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped\r
+fmax2827 fma  7E-999      -1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded\r
+fmax2828 fma -9E-999       1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded\r
+fmax2829 fma  9.9E-999    -1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded\r
+fmax2830 fma  3.0E-999    -1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped\r
+\r
+fmax2831 fma  1.0E-501     1e-501  0E+999999  -> 1.0E-1002   Subnormal\r
+fmax2832 fma  2.0E-501     2e-501  0E+999999  -> 4.0E-1002   Subnormal\r
+fmax2833 fma  4.0E-501     4e-501  0E+999999  -> 1.60E-1001  Subnormal\r
+fmax2834 fma 10.0E-501    10e-501  0E+999999  -> 1.000E-1000 Subnormal\r
+fmax2835 fma 30.0E-501    30e-501  0E+999999  -> 9.000E-1000 Subnormal\r
+fmax2836 fma 40.0E-501    40e-501  0E+999999  -> 1.6000E-999\r
+\r
+-- squares\r
+fmax2840 fma  1E-502       1e-502  0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped\r
+fmax2841 fma  1E-501       1e-501  0E+999999  -> 1E-1002     Subnormal\r
+fmax2842 fma  2E-501       2e-501  0E+999999  -> 4E-1002     Subnormal\r
+fmax2843 fma  4E-501       4e-501  0E+999999  -> 1.6E-1001   Subnormal\r
+fmax2844 fma 10E-501      10e-501  0E+999999  -> 1.00E-1000  Subnormal\r
+fmax2845 fma 30E-501      30e-501  0E+999999  -> 9.00E-1000  Subnormal\r
+fmax2846 fma 40E-501      40e-501  0E+999999  -> 1.600E-999\r
+\r
+-- cubes\r
+fmax2850 fma  1E-670     1e-335  0E+999999  -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped\r
+fmax2851 fma  1E-668     1e-334  0E+999999  -> 1E-1002    Subnormal\r
+fmax2852 fma  4E-668     2e-334  0E+999999  -> 8E-1002    Subnormal\r
+fmax2853 fma  9E-668     3e-334  0E+999999  -> 2.7E-1001  Subnormal\r
+fmax2854 fma 16E-668     4e-334  0E+999999  -> 6.4E-1001  Subnormal\r
+fmax2855 fma 25E-668     5e-334  0E+999999  -> 1.25E-1000 Subnormal\r
+fmax2856 fma 10E-668   100e-334  0E+999999  -> 1.000E-999\r
+\r
+-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent\r
+precision: 19\r
+fmax2860 fma  6636851557994578716E-520 6636851557994578716E-520  0E+999999  -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded\r
+\r
+-- Long operand overflow may be a different path\r
+precision: 3\r
+maxExponent: 999999\r
+minexponent: -999999\r
+fmax2870 fma 1  9.999E+999999    0E+999999  ->  Infinity Inexact Overflow Rounded\r
+fmax2871 fma 1 -9.999E+999999    0E+999999  -> -Infinity Inexact Overflow Rounded\r
+fmax2872 fma    9.999E+999999 1  0E+999999  ->  Infinity Inexact Overflow Rounded\r
+fmax2873 fma   -9.999E+999999 1  0E+999999  -> -Infinity Inexact Overflow Rounded\r
+\r
+-- check for double-rounded subnormals\r
+precision:   5\r
+maxexponent: 79\r
+minexponent: -79\r
+fmax2881 fma  1.2347E-40  1.2347E-40   0E+999999  ->  1.524E-80  Inexact Rounded Subnormal Underflow\r
+fmax2882 fma  1.234E-40  1.234E-40     0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow\r
+fmax2883 fma  1.23E-40   1.23E-40      0E+999999  ->  1.513E-80  Inexact Rounded Subnormal Underflow\r
+fmax2884 fma  1.2E-40    1.2E-40       0E+999999  ->  1.44E-80   Subnormal\r
+fmax2885 fma  1.2E-40    1.2E-41       0E+999999  ->  1.44E-81   Subnormal\r
+fmax2886 fma  1.2E-40    1.2E-42       0E+999999  ->  1.4E-82    Subnormal Inexact Rounded Underflow\r
+fmax2887 fma  1.2E-40    1.3E-42       0E+999999  ->  1.6E-82    Subnormal Inexact Rounded Underflow\r
+fmax2888 fma  1.3E-40    1.3E-42       0E+999999  ->  1.7E-82    Subnormal Inexact Rounded Underflow\r
+fmax2889 fma  1.3E-40    1.3E-43       0E+999999  ->    2E-83    Subnormal Inexact Rounded Underflow\r
+fmax2890 fma  1.3E-41    1.3E-43       0E+999999  ->    0E-83    Clamped Subnormal Inexact Rounded Underflow\r
+\r
+fmax2891 fma  1.2345E-39   1.234E-40   0E+999999  ->  1.5234E-79 Inexact Rounded\r
+fmax2892 fma  1.23456E-39  1.234E-40   0E+999999  ->  1.5234E-79 Inexact Rounded\r
+fmax2893 fma  1.2345E-40   1.234E-40   0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow\r
+fmax2894 fma  1.23456E-40  1.234E-40   0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow\r
+fmax2895 fma  1.2345E-41   1.234E-40   0E+999999  ->  1.52E-81   Inexact Rounded Subnormal Underflow\r
+fmax2896 fma  1.23456E-41  1.234E-40   0E+999999  ->  1.52E-81   Inexact Rounded Subnormal Underflow\r
+\r
+-- Now explore the case where we get a normal result with Underflow\r
+precision:   16\r
+rounding:    half_up\r
+maxExponent: 384\r
+minExponent: -383\r
+\r
+fmax2900 fma  0.3000000000E-191 0.3000000000E-191  0E+999999  -> 9.00000000000000E-384 Subnormal Rounded\r
+fmax2901 fma  0.3000000001E-191 0.3000000001E-191  0E+999999  -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded\r
+fmax2902 fma  9.999999999999999E-383  0.0999999999999          0E+999999  -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded\r
+fmax2903 fma  9.999999999999999E-383  0.09999999999999         0E+999999  -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded\r
+fmax2904 fma  9.999999999999999E-383  0.099999999999999        0E+999999  -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded\r
+fmax2905 fma  9.999999999999999E-383  0.0999999999999999       0E+999999  -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded\r
+-- prove operands are exact\r
+fmax2906 fma  9.999999999999999E-383  1                        0E+999999  -> 9.999999999999999E-383\r
+fmax2907 fma                       1  0.09999999999999999      0E+999999  -> 0.09999999999999999\r
+-- the next rounds to Nmin\r
+fmax2908 fma  9.999999999999999E-383  0.09999999999999999      0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax2909 fma  9.999999999999999E-383  0.099999999999999999     0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax2910 fma  9.999999999999999E-383  0.0999999999999999999    0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax2911 fma  9.999999999999999E-383  0.09999999999999999999   0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+precision:   34\r
+rounding:    half_up\r
+maxExponent: 6144\r
+minExponent: -6143\r
+fmax2921  fma 130E-2  120E-2  0E+999999  -> 1.5600\r
+fmax2922  fma 130E-2  12E-1   0E+999999  -> 1.560\r
+fmax2923  fma 130E-2  1E0     0E+999999  -> 1.30\r
+\r
+-- Null tests\r
+fmax2990 fma  # 10  0E+999999  -> NaN Invalid_operation\r
+fmax2991 fma 10  #  0E+999999  -> NaN Invalid_operation\r
+\r
+-- ADDITION TESTS ------------------------------------------------------\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- [first group are 'quick confidence check']\r
+fmax3001 fma  1   1       1       ->  2\r
+fmax3002 fma  1   2       3       ->  5\r
+fmax3003 fma  1   '5.75'  '3.3'   ->  9.05\r
+fmax3004 fma  1   '5'     '-3'    ->  2\r
+fmax3005 fma  1   '-5'    '-3'    ->  -8\r
+fmax3006 fma  1   '-7'    '2.5'   ->  -4.5\r
+fmax3007 fma  1   '0.7'   '0.3'   ->  1.0\r
+fmax3008 fma  1   '1.25'  '1.25'  ->  2.50\r
+fmax3009 fma  1   '1.23456789'  '1.00000000' -> '2.23456789'\r
+fmax3010 fma  1   '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+fmax3011 fma  1   '0.4444444444'  '0.5555555555' -> '1.00000000' Inexact Rounded\r
+fmax3012 fma  1   '0.4444444440'  '0.5555555555' -> '1.00000000' Inexact Rounded\r
+fmax3013 fma  1   '0.4444444444'  '0.5555555550' -> '0.999999999' Inexact Rounded\r
+fmax3014 fma  1   '0.44444444449'    '0' -> '0.444444444' Inexact Rounded\r
+fmax3015 fma  1   '0.444444444499'   '0' -> '0.444444444' Inexact Rounded\r
+fmax3016 fma  1   '0.4444444444999'  '0' -> '0.444444444' Inexact Rounded\r
+fmax3017 fma  1   '0.4444444445000'  '0' -> '0.444444445' Inexact Rounded\r
+fmax3018 fma  1   '0.4444444445001'  '0' -> '0.444444445' Inexact Rounded\r
+fmax3019 fma  1   '0.444444444501'   '0' -> '0.444444445' Inexact Rounded\r
+fmax3020 fma  1   '0.44444444451'    '0' -> '0.444444445' Inexact Rounded\r
+\r
+fmax3021 fma  1   0 1 -> 1\r
+fmax3022 fma  1   1 1 -> 2\r
+fmax3023 fma  1   2 1 -> 3\r
+fmax3024 fma  1   3 1 -> 4\r
+fmax3025 fma  1   4 1 -> 5\r
+fmax3026 fma  1   5 1 -> 6\r
+fmax3027 fma  1   6 1 -> 7\r
+fmax3028 fma  1   7 1 -> 8\r
+fmax3029 fma  1   8 1 -> 9\r
+fmax3030 fma  1   9 1 -> 10\r
+\r
+-- some carrying effects\r
+fmax3031 fma  1   '0.9998'  '0.0000' -> '0.9998'\r
+fmax3032 fma  1   '0.9998'  '0.0001' -> '0.9999'\r
+fmax3033 fma  1   '0.9998'  '0.0002' -> '1.0000'\r
+fmax3034 fma  1   '0.9998'  '0.0003' -> '1.0001'\r
+\r
+fmax3035 fma  1   '70'  '10000e+9' -> '1.00000000E+13' Inexact Rounded\r
+fmax3036 fma  1   '700'  '10000e+9' -> '1.00000000E+13' Inexact Rounded\r
+fmax3037 fma  1   '7000'  '10000e+9' -> '1.00000000E+13' Inexact Rounded\r
+fmax3038 fma  1   '70000'  '10000e+9' -> '1.00000001E+13' Inexact Rounded\r
+fmax3039 fma  1   '700000'  '10000e+9' -> '1.00000007E+13' Rounded\r
+\r
+-- symmetry:\r
+fmax3040 fma  1   '10000e+9'  '70' -> '1.00000000E+13' Inexact Rounded\r
+fmax3041 fma  1   '10000e+9'  '700' -> '1.00000000E+13' Inexact Rounded\r
+fmax3042 fma  1   '10000e+9'  '7000' -> '1.00000000E+13' Inexact Rounded\r
+fmax3044 fma  1   '10000e+9'  '70000' -> '1.00000001E+13' Inexact Rounded\r
+fmax3045 fma  1   '10000e+9'  '700000' -> '1.00000007E+13' Rounded\r
+\r
+-- same, higher precision\r
+precision: 15\r
+fmax3046 fma  1   '10000e+9'  '7' -> '10000000000007'\r
+fmax3047 fma  1   '10000e+9'  '70' -> '10000000000070'\r
+fmax3048 fma  1   '10000e+9'  '700' -> '10000000000700'\r
+fmax3049 fma  1   '10000e+9'  '7000' -> '10000000007000'\r
+fmax3050 fma  1   '10000e+9'  '70000' -> '10000000070000'\r
+fmax3051 fma  1   '10000e+9'  '700000' -> '10000000700000'\r
+fmax3052 fma  1   '10000e+9'  '7000000' -> '10000007000000'\r
+\r
+-- examples from decarith\r
+fmax3053 fma  1   '12' '7.00' -> '19.00'\r
+fmax3054 fma  1   '1.3' '-1.07' -> '0.23'\r
+fmax3055 fma  1   '1.3' '-1.30' -> '0.00'\r
+fmax3056 fma  1   '1.3' '-2.07' -> '-0.77'\r
+fmax3057 fma  1   '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- zero preservation\r
+precision: 6\r
+fmax3060 fma  1   '10000e+9'  '70000' -> '1.00000E+13' Inexact Rounded\r
+fmax3061 fma  1   1 '0.0001' -> '1.0001'\r
+fmax3062 fma  1   1 '0.00001' -> '1.00001'\r
+fmax3063 fma  1   1 '0.000001' -> '1.00000' Inexact Rounded\r
+fmax3064 fma  1   1 '0.0000001' -> '1.00000' Inexact Rounded\r
+fmax3065 fma  1   1 '0.00000001' -> '1.00000' Inexact Rounded\r
+\r
+-- some funny zeros [in case of bad signum]\r
+fmax3070 fma  1   1  0    -> 1\r
+fmax3071 fma  1   1 0.    -> 1\r
+fmax3072 fma  1   1  .0   -> 1.0\r
+fmax3073 fma  1   1 0.0   -> 1.0\r
+fmax3074 fma  1   1 0.00  -> 1.00\r
+fmax3075 fma  1    0  1   -> 1\r
+fmax3076 fma  1   0.  1   -> 1\r
+fmax3077 fma  1    .0 1   -> 1.0\r
+fmax3078 fma  1   0.0 1   -> 1.0\r
+fmax3079 fma  1   0.00 1  -> 1.00\r
+\r
+precision: 9\r
+\r
+-- some carries\r
+fmax3080 fma  1   999999998 1  -> 999999999\r
+fmax3081 fma  1   999999999 1  -> 1.00000000E+9 Rounded\r
+fmax3082 fma  1    99999999 1  -> 100000000\r
+fmax3083 fma  1     9999999 1  -> 10000000\r
+fmax3084 fma  1      999999 1  -> 1000000\r
+fmax3085 fma  1       99999 1  -> 100000\r
+fmax3086 fma  1        9999 1  -> 10000\r
+fmax3087 fma  1         999 1  -> 1000\r
+fmax3088 fma  1          99 1  -> 100\r
+fmax3089 fma  1           9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+fmax3090 fma  1   '-56267E-10'   0 ->  '-0.0000056267'\r
+fmax3091 fma  1   '-56267E-6'    0 ->  '-0.056267'\r
+fmax3092 fma  1   '-56267E-5'    0 ->  '-0.56267'\r
+fmax3093 fma  1   '-56267E-4'    0 ->  '-5.6267'\r
+fmax3094 fma  1   '-56267E-3'    0 ->  '-56.267'\r
+fmax3095 fma  1   '-56267E-2'    0 ->  '-562.67'\r
+fmax3096 fma  1   '-56267E-1'    0 ->  '-5626.7'\r
+fmax3097 fma  1   '-56267E-0'    0 ->  '-56267'\r
+fmax3098 fma  1   '-5E-10'       0 ->  '-5E-10'\r
+fmax3099 fma  1   '-5E-7'        0 ->  '-5E-7'\r
+fmax3100 fma  1   '-5E-6'        0 ->  '-0.000005'\r
+fmax3101 fma  1   '-5E-5'        0 ->  '-0.00005'\r
+fmax3102 fma  1   '-5E-4'        0 ->  '-0.0005'\r
+fmax3103 fma  1   '-5E-1'        0 ->  '-0.5'\r
+fmax3104 fma  1   '-5E0'         0 ->  '-5'\r
+fmax3105 fma  1   '-5E1'         0 ->  '-50'\r
+fmax3106 fma  1   '-5E5'         0 ->  '-500000'\r
+fmax3107 fma  1   '-5E8'         0 ->  '-500000000'\r
+fmax3108 fma  1   '-5E9'         0 ->  '-5.00000000E+9'   Rounded\r
+fmax3109 fma  1   '-5E10'        0 ->  '-5.00000000E+10'  Rounded\r
+fmax3110 fma  1   '-5E11'        0 ->  '-5.00000000E+11'  Rounded\r
+fmax3111 fma  1   '-5E100'       0 ->  '-5.00000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+fmax3113 fma  1   0  '-56267E-10' ->  '-0.0000056267'\r
+fmax3114 fma  1   0  '-56267E-6'  ->  '-0.056267'\r
+fmax3116 fma  1   0  '-56267E-5'  ->  '-0.56267'\r
+fmax3117 fma  1   0  '-56267E-4'  ->  '-5.6267'\r
+fmax3119 fma  1   0  '-56267E-3'  ->  '-56.267'\r
+fmax3120 fma  1   0  '-56267E-2'  ->  '-562.67'\r
+fmax3121 fma  1   0  '-56267E-1'  ->  '-5626.7'\r
+fmax3122 fma  1   0  '-56267E-0'  ->  '-56267'\r
+fmax3123 fma  1   0  '-5E-10'     ->  '-5E-10'\r
+fmax3124 fma  1   0  '-5E-7'      ->  '-5E-7'\r
+fmax3125 fma  1   0  '-5E-6'      ->  '-0.000005'\r
+fmax3126 fma  1   0  '-5E-5'      ->  '-0.00005'\r
+fmax3127 fma  1   0  '-5E-4'      ->  '-0.0005'\r
+fmax3128 fma  1   0  '-5E-1'      ->  '-0.5'\r
+fmax3129 fma  1   0  '-5E0'       ->  '-5'\r
+fmax3130 fma  1   0  '-5E1'       ->  '-50'\r
+fmax3131 fma  1   0  '-5E5'       ->  '-500000'\r
+fmax3132 fma  1   0  '-5E8'       ->  '-500000000'\r
+fmax3133 fma  1   0  '-5E9'       ->  '-5.00000000E+9'    Rounded\r
+fmax3134 fma  1   0  '-5E10'      ->  '-5.00000000E+10'   Rounded\r
+fmax3135 fma  1   0  '-5E11'      ->  '-5.00000000E+11'   Rounded\r
+fmax3136 fma  1   0  '-5E100'     ->  '-5.00000000E+100'  Rounded\r
+\r
+-- related\r
+fmax3137 fma  1    1  '0E-12'      ->  '1.00000000'  Rounded\r
+fmax3138 fma  1   -1  '0E-12'      ->  '-1.00000000' Rounded\r
+fmax3139 fma  1   '0E-12' 1        ->  '1.00000000'  Rounded\r
+fmax3140 fma  1   '0E-12' -1       ->  '-1.00000000' Rounded\r
+fmax3141 fma  1   1E+4    0.0000   ->  '10000.0000'\r
+fmax3142 fma  1   1E+4    0.00000  ->  '10000.0000'  Rounded\r
+fmax3143 fma  1   0.000   1E+5     ->  '100000.000'\r
+fmax3144 fma  1   0.0000  1E+5     ->  '100000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+fmax3146 fma  1   '00.0'  0       ->  '0.0'\r
+fmax3147 fma  1   '0.00'  0       ->  '0.00'\r
+fmax3148 fma  1    0      '0.00'  ->  '0.00'\r
+fmax3149 fma  1    0      '00.0'  ->  '0.0'\r
+fmax3150 fma  1   '00.0'  '0.00'  ->  '0.00'\r
+fmax3151 fma  1   '0.00'  '00.0'  ->  '0.00'\r
+fmax3152 fma  1   '3'     '.3'    ->  '3.3'\r
+fmax3153 fma  1   '3.'    '.3'    ->  '3.3'\r
+fmax3154 fma  1   '3.0'   '.3'    ->  '3.3'\r
+fmax3155 fma  1   '3.00'  '.3'    ->  '3.30'\r
+fmax3156 fma  1   '3'     '3'     ->  '6'\r
+fmax3157 fma  1   '3'     '+3'    ->  '6'\r
+fmax3158 fma  1   '3'     '-3'    ->  '0'\r
+fmax3159 fma  1   '0.3'   '-0.3'  ->  '0.0'\r
+fmax3160 fma  1   '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+precision: 15\r
+fmax3161 fma  1   '1E+12' '-1'    -> '999999999999'\r
+fmax3162 fma  1   '1E+12'  '1.11' -> '1000000000001.11'\r
+fmax3163 fma  1   '1.11'  '1E+12' -> '1000000000001.11'\r
+fmax3164 fma  1   '-1'    '1E+12' -> '999999999999'\r
+fmax3165 fma  1   '7E+12' '-1'    -> '6999999999999'\r
+fmax3166 fma  1   '7E+12'  '1.11' -> '7000000000001.11'\r
+fmax3167 fma  1   '1.11'  '7E+12' -> '7000000000001.11'\r
+fmax3168 fma  1   '-1'    '7E+12' -> '6999999999999'\r
+\r
+--             123456789012345      123456789012345      1 23456789012345\r
+fmax3170 fma  1   '0.444444444444444'  '0.555555555555563' -> '1.00000000000001' Inexact Rounded\r
+fmax3171 fma  1   '0.444444444444444'  '0.555555555555562' -> '1.00000000000001' Inexact Rounded\r
+fmax3172 fma  1   '0.444444444444444'  '0.555555555555561' -> '1.00000000000001' Inexact Rounded\r
+fmax3173 fma  1   '0.444444444444444'  '0.555555555555560' -> '1.00000000000000' Inexact Rounded\r
+fmax3174 fma  1   '0.444444444444444'  '0.555555555555559' -> '1.00000000000000' Inexact Rounded\r
+fmax3175 fma  1   '0.444444444444444'  '0.555555555555558' -> '1.00000000000000' Inexact Rounded\r
+fmax3176 fma  1   '0.444444444444444'  '0.555555555555557' -> '1.00000000000000' Inexact Rounded\r
+fmax3177 fma  1   '0.444444444444444'  '0.555555555555556' -> '1.00000000000000' Rounded\r
+fmax3178 fma  1   '0.444444444444444'  '0.555555555555555' -> '0.999999999999999'\r
+fmax3179 fma  1   '0.444444444444444'  '0.555555555555554' -> '0.999999999999998'\r
+fmax3180 fma  1   '0.444444444444444'  '0.555555555555553' -> '0.999999999999997'\r
+fmax3181 fma  1   '0.444444444444444'  '0.555555555555552' -> '0.999999999999996'\r
+fmax3182 fma  1   '0.444444444444444'  '0.555555555555551' -> '0.999999999999995'\r
+fmax3183 fma  1   '0.444444444444444'  '0.555555555555550' -> '0.999999999999994'\r
+\r
+-- and some more, including residue effects and different roundings\r
+precision: 9\r
+rounding: half_up\r
+fmax3200 fma  1   '123456789' 0             -> '123456789'\r
+fmax3201 fma  1   '123456789' 0.000000001   -> '123456789' Inexact Rounded\r
+fmax3202 fma  1   '123456789' 0.000001      -> '123456789' Inexact Rounded\r
+fmax3203 fma  1   '123456789' 0.1           -> '123456789' Inexact Rounded\r
+fmax3204 fma  1   '123456789' 0.4           -> '123456789' Inexact Rounded\r
+fmax3205 fma  1   '123456789' 0.49          -> '123456789' Inexact Rounded\r
+fmax3206 fma  1   '123456789' 0.499999      -> '123456789' Inexact Rounded\r
+fmax3207 fma  1   '123456789' 0.499999999   -> '123456789' Inexact Rounded\r
+fmax3208 fma  1   '123456789' 0.5           -> '123456790' Inexact Rounded\r
+fmax3209 fma  1   '123456789' 0.500000001   -> '123456790' Inexact Rounded\r
+fmax3210 fma  1   '123456789' 0.500001      -> '123456790' Inexact Rounded\r
+fmax3211 fma  1   '123456789' 0.51          -> '123456790' Inexact Rounded\r
+fmax3212 fma  1   '123456789' 0.6           -> '123456790' Inexact Rounded\r
+fmax3213 fma  1   '123456789' 0.9           -> '123456790' Inexact Rounded\r
+fmax3214 fma  1   '123456789' 0.99999       -> '123456790' Inexact Rounded\r
+fmax3215 fma  1   '123456789' 0.999999999   -> '123456790' Inexact Rounded\r
+fmax3216 fma  1   '123456789' 1             -> '123456790'\r
+fmax3217 fma  1   '123456789' 1.000000001   -> '123456790' Inexact Rounded\r
+fmax3218 fma  1   '123456789' 1.00001       -> '123456790' Inexact Rounded\r
+fmax3219 fma  1   '123456789' 1.1           -> '123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+fmax3220 fma  1   '123456789' 0             -> '123456789'\r
+fmax3221 fma  1   '123456789' 0.000000001   -> '123456789' Inexact Rounded\r
+fmax3222 fma  1   '123456789' 0.000001      -> '123456789' Inexact Rounded\r
+fmax3223 fma  1   '123456789' 0.1           -> '123456789' Inexact Rounded\r
+fmax3224 fma  1   '123456789' 0.4           -> '123456789' Inexact Rounded\r
+fmax3225 fma  1   '123456789' 0.49          -> '123456789' Inexact Rounded\r
+fmax3226 fma  1   '123456789' 0.499999      -> '123456789' Inexact Rounded\r
+fmax3227 fma  1   '123456789' 0.499999999   -> '123456789' Inexact Rounded\r
+fmax3228 fma  1   '123456789' 0.5           -> '123456790' Inexact Rounded\r
+fmax3229 fma  1   '123456789' 0.500000001   -> '123456790' Inexact Rounded\r
+fmax3230 fma  1   '123456789' 0.500001      -> '123456790' Inexact Rounded\r
+fmax3231 fma  1   '123456789' 0.51          -> '123456790' Inexact Rounded\r
+fmax3232 fma  1   '123456789' 0.6           -> '123456790' Inexact Rounded\r
+fmax3233 fma  1   '123456789' 0.9           -> '123456790' Inexact Rounded\r
+fmax3234 fma  1   '123456789' 0.99999       -> '123456790' Inexact Rounded\r
+fmax3235 fma  1   '123456789' 0.999999999   -> '123456790' Inexact Rounded\r
+fmax3236 fma  1   '123456789' 1             -> '123456790'\r
+fmax3237 fma  1   '123456789' 1.00000001    -> '123456790' Inexact Rounded\r
+fmax3238 fma  1   '123456789' 1.00001       -> '123456790' Inexact Rounded\r
+fmax3239 fma  1   '123456789' 1.1           -> '123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+fmax3240 fma  1   '123456788' 0.499999999   -> '123456788' Inexact Rounded\r
+fmax3241 fma  1   '123456788' 0.5           -> '123456788' Inexact Rounded\r
+fmax3242 fma  1   '123456788' 0.500000001   -> '123456789' Inexact Rounded\r
+\r
+rounding: down\r
+fmax3250 fma  1   '123456789' 0             -> '123456789'\r
+fmax3251 fma  1   '123456789' 0.000000001   -> '123456789' Inexact Rounded\r
+fmax3252 fma  1   '123456789' 0.000001      -> '123456789' Inexact Rounded\r
+fmax3253 fma  1   '123456789' 0.1           -> '123456789' Inexact Rounded\r
+fmax3254 fma  1   '123456789' 0.4           -> '123456789' Inexact Rounded\r
+fmax3255 fma  1   '123456789' 0.49          -> '123456789' Inexact Rounded\r
+fmax3256 fma  1   '123456789' 0.499999      -> '123456789' Inexact Rounded\r
+fmax3257 fma  1   '123456789' 0.499999999   -> '123456789' Inexact Rounded\r
+fmax3258 fma  1   '123456789' 0.5           -> '123456789' Inexact Rounded\r
+fmax3259 fma  1   '123456789' 0.500000001   -> '123456789' Inexact Rounded\r
+fmax3260 fma  1   '123456789' 0.500001      -> '123456789' Inexact Rounded\r
+fmax3261 fma  1   '123456789' 0.51          -> '123456789' Inexact Rounded\r
+fmax3262 fma  1   '123456789' 0.6           -> '123456789' Inexact Rounded\r
+fmax3263 fma  1   '123456789' 0.9           -> '123456789' Inexact Rounded\r
+fmax3264 fma  1   '123456789' 0.99999       -> '123456789' Inexact Rounded\r
+fmax3265 fma  1   '123456789' 0.999999999   -> '123456789' Inexact Rounded\r
+fmax3266 fma  1   '123456789' 1             -> '123456790'\r
+fmax3267 fma  1   '123456789' 1.00000001    -> '123456790' Inexact Rounded\r
+fmax3268 fma  1   '123456789' 1.00001       -> '123456790' Inexact Rounded\r
+fmax3269 fma  1   '123456789' 1.1           -> '123456790' Inexact Rounded\r
+\r
+-- input preparation tests (operands should not be rounded)\r
+precision: 3\r
+rounding: half_up\r
+\r
+fmax3270 fma  1   '12345678900000'  9999999999999 ->  '2.23E+13' Inexact Rounded\r
+fmax3271 fma  1    '9999999999999' 12345678900000 ->  '2.23E+13' Inexact Rounded\r
+\r
+fmax3272 fma  1   '12E+3'  '3444'   ->  '1.54E+4' Inexact Rounded\r
+fmax3273 fma  1   '12E+3'  '3446'   ->  '1.54E+4' Inexact Rounded\r
+fmax3274 fma  1   '12E+3'  '3449.9' ->  '1.54E+4' Inexact Rounded\r
+fmax3275 fma  1   '12E+3'  '3450.0' ->  '1.55E+4' Inexact Rounded\r
+fmax3276 fma  1   '12E+3'  '3450.1' ->  '1.55E+4' Inexact Rounded\r
+fmax3277 fma  1   '12E+3'  '3454'   ->  '1.55E+4' Inexact Rounded\r
+fmax3278 fma  1   '12E+3'  '3456'   ->  '1.55E+4' Inexact Rounded\r
+\r
+fmax3281 fma  1   '3444'   '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3282 fma  1   '3446'   '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3283 fma  1   '3449.9' '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3284 fma  1   '3450.0' '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+fmax3285 fma  1   '3450.1' '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+fmax3286 fma  1   '3454'   '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+fmax3287 fma  1   '3456'   '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+\r
+rounding: half_down\r
+fmax3291 fma  1   '3444'   '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3292 fma  1   '3446'   '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3293 fma  1   '3449.9' '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3294 fma  1   '3450.0' '12E+3'  ->  '1.54E+4' Inexact Rounded\r
+fmax3295 fma  1   '3450.1' '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+fmax3296 fma  1   '3454'   '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+fmax3297 fma  1   '3456'   '12E+3'  ->  '1.55E+4' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_up\r
+fmax3301 fma  1    -1   1      ->   0\r
+fmax3302 fma  1     0   1      ->   1\r
+fmax3303 fma  1     1   1      ->   2\r
+fmax3304 fma  1    12   1      ->  13\r
+fmax3305 fma  1    98   1      ->  99\r
+fmax3306 fma  1    99   1      -> 100\r
+fmax3307 fma  1   100   1      -> 101\r
+fmax3308 fma  1   101   1      -> 102\r
+fmax3309 fma  1    -1  -1      ->  -2\r
+fmax3310 fma  1     0  -1      ->  -1\r
+fmax3311 fma  1     1  -1      ->   0\r
+fmax3312 fma  1    12  -1      ->  11\r
+fmax3313 fma  1    98  -1      ->  97\r
+fmax3314 fma  1    99  -1      ->  98\r
+fmax3315 fma  1   100  -1      ->  99\r
+fmax3316 fma  1   101  -1      -> 100\r
+\r
+fmax3321 fma  1   -0.01  0.01    ->  0.00\r
+fmax3322 fma  1    0.00  0.01    ->  0.01\r
+fmax3323 fma  1    0.01  0.01    ->  0.02\r
+fmax3324 fma  1    0.12  0.01    ->  0.13\r
+fmax3325 fma  1    0.98  0.01    ->  0.99\r
+fmax3326 fma  1    0.99  0.01    ->  1.00\r
+fmax3327 fma  1    1.00  0.01    ->  1.01\r
+fmax3328 fma  1    1.01  0.01    ->  1.02\r
+fmax3329 fma  1   -0.01 -0.01    -> -0.02\r
+fmax3330 fma  1    0.00 -0.01    -> -0.01\r
+fmax3331 fma  1    0.01 -0.01    ->  0.00\r
+fmax3332 fma  1    0.12 -0.01    ->  0.11\r
+fmax3333 fma  1    0.98 -0.01    ->  0.97\r
+fmax3334 fma  1    0.99 -0.01    ->  0.98\r
+fmax3335 fma  1    1.00 -0.01    ->  0.99\r
+fmax3336 fma  1    1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where fma  1  ing 0 affects the coefficient\r
+precision: 9\r
+fmax3340 fma  1   1E+3    0    ->         1000\r
+fmax3341 fma  1   1E+8    0    ->    100000000\r
+fmax3342 fma  1   1E+9    0    ->   1.00000000E+9   Rounded\r
+fmax3343 fma  1   1E+10   0    ->   1.00000000E+10  Rounded\r
+-- which simply follow from these cases ...\r
+fmax3344 fma  1   1E+3    1    ->         1001\r
+fmax3345 fma  1   1E+8    1    ->    100000001\r
+fmax3346 fma  1   1E+9    1    ->   1.00000000E+9   Inexact Rounded\r
+fmax3347 fma  1   1E+10   1    ->   1.00000000E+10  Inexact Rounded\r
+fmax3348 fma  1   1E+3    7    ->         1007\r
+fmax3349 fma  1   1E+8    7    ->    100000007\r
+fmax3350 fma  1   1E+9    7    ->   1.00000001E+9   Inexact Rounded\r
+fmax3351 fma  1   1E+10   7    ->   1.00000000E+10  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+precision:   7\r
+rounding:    half_up\r
+maxExponent: 92\r
+minexponent: -92\r
+fmax3361  fma  1   0E+50 10000E+1  -> 1.0000E+5\r
+fmax3362  fma  1   10000E+1 0E-50  -> 100000.0  Rounded\r
+fmax3363  fma  1   10000E+1 10000E-50  -> 100000.0  Rounded Inexact\r
+fmax3364  fma  1   9.999999E+92 -9.999999E+92 -> 0E+86\r
+\r
+-- a curiosity from JSR 13 testing\r
+rounding:    half_down\r
+precision:   10\r
+fmax3370 fma  1   99999999 81512 -> 100081511\r
+precision:      6\r
+fmax3371 fma  1   99999999 81512 -> 1.00082E+8 Rounded Inexact\r
+rounding:    half_up\r
+precision:   10\r
+fmax3372 fma  1   99999999 81512 -> 100081511\r
+precision:      6\r
+fmax3373 fma  1   99999999 81512 -> 1.00082E+8 Rounded Inexact\r
+rounding:    half_even\r
+precision:   10\r
+fmax3374 fma  1   99999999 81512 -> 100081511\r
+precision:      6\r
+fmax3375 fma  1   99999999 81512 -> 1.00082E+8 Rounded Inexact\r
+\r
+-- ulp replacement tests\r
+precision: 9\r
+maxexponent: 999999\r
+minexponent: -999999\r
+fmax3400 fma  1     1   77e-7       ->  1.0000077\r
+fmax3401 fma  1     1   77e-8       ->  1.00000077\r
+fmax3402 fma  1     1   77e-9       ->  1.00000008 Inexact Rounded\r
+fmax3403 fma  1     1   77e-10      ->  1.00000001 Inexact Rounded\r
+fmax3404 fma  1     1   77e-11      ->  1.00000000 Inexact Rounded\r
+fmax3405 fma  1     1   77e-12      ->  1.00000000 Inexact Rounded\r
+fmax3406 fma  1     1   77e-999     ->  1.00000000 Inexact Rounded\r
+fmax3407 fma  1     1   77e-999999  ->  1.00000000 Inexact Rounded\r
+\r
+fmax3410 fma  1    10   77e-7       ->  10.0000077\r
+fmax3411 fma  1    10   77e-8       ->  10.0000008 Inexact Rounded\r
+fmax3412 fma  1    10   77e-9       ->  10.0000001 Inexact Rounded\r
+fmax3413 fma  1    10   77e-10      ->  10.0000000 Inexact Rounded\r
+fmax3414 fma  1    10   77e-11      ->  10.0000000 Inexact Rounded\r
+fmax3415 fma  1    10   77e-12      ->  10.0000000 Inexact Rounded\r
+fmax3416 fma  1    10   77e-999     ->  10.0000000 Inexact Rounded\r
+fmax3417 fma  1    10   77e-999999  ->  10.0000000 Inexact Rounded\r
+\r
+fmax3420 fma  1    77e-7        1   ->  1.0000077\r
+fmax3421 fma  1    77e-8        1   ->  1.00000077\r
+fmax3422 fma  1    77e-9        1   ->  1.00000008 Inexact Rounded\r
+fmax3423 fma  1    77e-10       1   ->  1.00000001 Inexact Rounded\r
+fmax3424 fma  1    77e-11       1   ->  1.00000000 Inexact Rounded\r
+fmax3425 fma  1    77e-12       1   ->  1.00000000 Inexact Rounded\r
+fmax3426 fma  1    77e-999      1   ->  1.00000000 Inexact Rounded\r
+fmax3427 fma  1    77e-999999   1   ->  1.00000000 Inexact Rounded\r
+\r
+fmax3430 fma  1    77e-7       10   ->  10.0000077\r
+fmax3431 fma  1    77e-8       10   ->  10.0000008 Inexact Rounded\r
+fmax3432 fma  1    77e-9       10   ->  10.0000001 Inexact Rounded\r
+fmax3433 fma  1    77e-10      10   ->  10.0000000 Inexact Rounded\r
+fmax3434 fma  1    77e-11      10   ->  10.0000000 Inexact Rounded\r
+fmax3435 fma  1    77e-12      10   ->  10.0000000 Inexact Rounded\r
+fmax3436 fma  1    77e-999     10   ->  10.0000000 Inexact Rounded\r
+fmax3437 fma  1    77e-999999  10   ->  10.0000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+fmax3440 fma  1     1   -77e-7       ->  0.9999923\r
+fmax3441 fma  1     1   -77e-8       ->  0.99999923\r
+fmax3442 fma  1     1   -77e-9       ->  0.999999923\r
+fmax3443 fma  1     1   -77e-10      ->  0.999999992 Inexact Rounded\r
+fmax3444 fma  1     1   -77e-11      ->  0.999999999 Inexact Rounded\r
+fmax3445 fma  1     1   -77e-12      ->  1.00000000 Inexact Rounded\r
+fmax3446 fma  1     1   -77e-999     ->  1.00000000 Inexact Rounded\r
+fmax3447 fma  1     1   -77e-999999  ->  1.00000000 Inexact Rounded\r
+\r
+fmax3450 fma  1    10   -77e-7       ->   9.9999923\r
+fmax3451 fma  1    10   -77e-8       ->   9.99999923\r
+fmax3452 fma  1    10   -77e-9       ->   9.99999992 Inexact Rounded\r
+fmax3453 fma  1    10   -77e-10      ->   9.99999999 Inexact Rounded\r
+fmax3454 fma  1    10   -77e-11      ->  10.0000000 Inexact Rounded\r
+fmax3455 fma  1    10   -77e-12      ->  10.0000000 Inexact Rounded\r
+fmax3456 fma  1    10   -77e-999     ->  10.0000000 Inexact Rounded\r
+fmax3457 fma  1    10   -77e-999999  ->  10.0000000 Inexact Rounded\r
+\r
+fmax3460 fma  1    -77e-7        1   ->  0.9999923\r
+fmax3461 fma  1    -77e-8        1   ->  0.99999923\r
+fmax3462 fma  1    -77e-9        1   ->  0.999999923\r
+fmax3463 fma  1    -77e-10       1   ->  0.999999992 Inexact Rounded\r
+fmax3464 fma  1    -77e-11       1   ->  0.999999999 Inexact Rounded\r
+fmax3465 fma  1    -77e-12       1   ->  1.00000000 Inexact Rounded\r
+fmax3466 fma  1    -77e-999      1   ->  1.00000000 Inexact Rounded\r
+fmax3467 fma  1    -77e-999999   1   ->  1.00000000 Inexact Rounded\r
+\r
+fmax3470 fma  1    -77e-7       10   ->   9.9999923\r
+fmax3471 fma  1    -77e-8       10   ->   9.99999923\r
+fmax3472 fma  1    -77e-9       10   ->   9.99999992 Inexact Rounded\r
+fmax3473 fma  1    -77e-10      10   ->   9.99999999 Inexact Rounded\r
+fmax3474 fma  1    -77e-11      10   ->  10.0000000 Inexact Rounded\r
+fmax3475 fma  1    -77e-12      10   ->  10.0000000 Inexact Rounded\r
+fmax3476 fma  1    -77e-999     10   ->  10.0000000 Inexact Rounded\r
+fmax3477 fma  1    -77e-999999  10   ->  10.0000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+fmax3480 fma  1    -1    77e-7       ->  -0.9999923\r
+fmax3481 fma  1    -1    77e-8       ->  -0.99999923\r
+fmax3482 fma  1    -1    77e-9       ->  -0.999999923\r
+fmax3483 fma  1    -1    77e-10      ->  -0.999999992 Inexact Rounded\r
+fmax3484 fma  1    -1    77e-11      ->  -0.999999999 Inexact Rounded\r
+fmax3485 fma  1    -1    77e-12      ->  -1.00000000 Inexact Rounded\r
+fmax3486 fma  1    -1    77e-999     ->  -1.00000000 Inexact Rounded\r
+fmax3487 fma  1    -1    77e-999999  ->  -1.00000000 Inexact Rounded\r
+\r
+fmax3490 fma  1   -10    77e-7       ->   -9.9999923\r
+fmax3491 fma  1   -10    77e-8       ->   -9.99999923\r
+fmax3492 fma  1   -10    77e-9       ->   -9.99999992 Inexact Rounded\r
+fmax3493 fma  1   -10    77e-10      ->   -9.99999999 Inexact Rounded\r
+fmax3494 fma  1   -10    77e-11      ->  -10.0000000 Inexact Rounded\r
+fmax3495 fma  1   -10    77e-12      ->  -10.0000000 Inexact Rounded\r
+fmax3496 fma  1   -10    77e-999     ->  -10.0000000 Inexact Rounded\r
+fmax3497 fma  1   -10    77e-999999  ->  -10.0000000 Inexact Rounded\r
+\r
+fmax3500 fma  1     77e-7       -1   ->  -0.9999923\r
+fmax3501 fma  1     77e-8       -1   ->  -0.99999923\r
+fmax3502 fma  1     77e-9       -1   ->  -0.999999923\r
+fmax3503 fma  1     77e-10      -1   ->  -0.999999992 Inexact Rounded\r
+fmax3504 fma  1     77e-11      -1   ->  -0.999999999 Inexact Rounded\r
+fmax3505 fma  1     77e-12      -1   ->  -1.00000000 Inexact Rounded\r
+fmax3506 fma  1     77e-999     -1   ->  -1.00000000 Inexact Rounded\r
+fmax3507 fma  1     77e-999999  -1   ->  -1.00000000 Inexact Rounded\r
+\r
+fmax3510 fma  1     77e-7       -10  ->   -9.9999923\r
+fmax3511 fma  1     77e-8       -10  ->   -9.99999923\r
+fmax3512 fma  1     77e-9       -10  ->   -9.99999992 Inexact Rounded\r
+fmax3513 fma  1     77e-10      -10  ->   -9.99999999 Inexact Rounded\r
+fmax3514 fma  1     77e-11      -10  ->  -10.0000000 Inexact Rounded\r
+fmax3515 fma  1     77e-12      -10  ->  -10.0000000 Inexact Rounded\r
+fmax3516 fma  1     77e-999     -10  ->  -10.0000000 Inexact Rounded\r
+fmax3517 fma  1     77e-999999  -10  ->  -10.0000000 Inexact Rounded\r
+\r
+\r
+-- long operands\r
+maxexponent: 999\r
+minexponent: -999\r
+precision: 9\r
+fmax3521 fma  1   12345678000 0 -> 1.23456780E+10 Rounded\r
+fmax3522 fma  1   0 12345678000 -> 1.23456780E+10 Rounded\r
+fmax3523 fma  1   1234567800  0 -> 1.23456780E+9 Rounded\r
+fmax3524 fma  1   0 1234567800  -> 1.23456780E+9 Rounded\r
+fmax3525 fma  1   1234567890  0 -> 1.23456789E+9 Rounded\r
+fmax3526 fma  1   0 1234567890  -> 1.23456789E+9 Rounded\r
+fmax3527 fma  1   1234567891  0 -> 1.23456789E+9 Inexact Rounded\r
+fmax3528 fma  1   0 1234567891  -> 1.23456789E+9 Inexact Rounded\r
+fmax3529 fma  1   12345678901 0 -> 1.23456789E+10 Inexact Rounded\r
+fmax3530 fma  1   0 12345678901 -> 1.23456789E+10 Inexact Rounded\r
+fmax3531 fma  1   1234567896  0 -> 1.23456790E+9 Inexact Rounded\r
+fmax3532 fma  1   0 1234567896  -> 1.23456790E+9 Inexact Rounded\r
+\r
+precision: 15\r
+-- still checking\r
+fmax3541 fma  1   12345678000 0 -> 12345678000\r
+fmax3542 fma  1   0 12345678000 -> 12345678000\r
+fmax3543 fma  1   1234567800  0 -> 1234567800\r
+fmax3544 fma  1   0 1234567800  -> 1234567800\r
+fmax3545 fma  1   1234567890  0 -> 1234567890\r
+fmax3546 fma  1   0 1234567890  -> 1234567890\r
+fmax3547 fma  1   1234567891  0 -> 1234567891\r
+fmax3548 fma  1   0 1234567891  -> 1234567891\r
+fmax3549 fma  1   12345678901 0 -> 12345678901\r
+fmax3550 fma  1   0 12345678901 -> 12345678901\r
+fmax3551 fma  1   1234567896  0 -> 1234567896\r
+fmax3552 fma  1   0 1234567896  -> 1234567896\r
+\r
+-- verify a query\r
+precision:    16\r
+maxExponent: +394\r
+minExponent: -393\r
+rounding:     down\r
+fmax3561 fma  1   1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded\r
+fmax3562 fma  1        0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded\r
+-- and using decimal64 bounds...\r
+precision:    16\r
+maxExponent: +384\r
+minExponent: -383\r
+rounding:     down\r
+fmax3563 fma  1   1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded\r
+fmax3564 fma  1        0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded\r
+\r
+\r
+-- some more residue effects with extreme rounding\r
+precision:   9\r
+rounding: half_up\r
+fmax3601 fma  1   123456789  0.000001 -> 123456789 Inexact Rounded\r
+rounding: half_even\r
+fmax3602 fma  1   123456789  0.000001 -> 123456789 Inexact Rounded\r
+rounding: half_down\r
+fmax3603 fma  1   123456789  0.000001 -> 123456789 Inexact Rounded\r
+rounding: floor\r
+fmax3604 fma  1   123456789  0.000001 -> 123456789 Inexact Rounded\r
+rounding: ceiling\r
+fmax3605 fma  1   123456789  0.000001 -> 123456790 Inexact Rounded\r
+rounding: up\r
+fmax3606 fma  1   123456789  0.000001 -> 123456790 Inexact Rounded\r
+rounding: down\r
+fmax3607 fma  1   123456789  0.000001 -> 123456789 Inexact Rounded\r
+\r
+rounding: half_up\r
+fmax3611 fma  1   123456789 -0.000001 -> 123456789 Inexact Rounded\r
+rounding: half_even\r
+fmax3612 fma  1   123456789 -0.000001 -> 123456789 Inexact Rounded\r
+rounding: half_down\r
+fmax3613 fma  1   123456789 -0.000001 -> 123456789 Inexact Rounded\r
+rounding: floor\r
+fmax3614 fma  1   123456789 -0.000001 -> 123456788 Inexact Rounded\r
+rounding: ceiling\r
+fmax3615 fma  1   123456789 -0.000001 -> 123456789 Inexact Rounded\r
+rounding: up\r
+fmax3616 fma  1   123456789 -0.000001 -> 123456789 Inexact Rounded\r
+rounding: down\r
+fmax3617 fma  1   123456789 -0.000001 -> 123456788 Inexact Rounded\r
+\r
+rounding: half_up\r
+fmax3621 fma  1   123456789  0.499999 -> 123456789 Inexact Rounded\r
+rounding: half_even\r
+fmax3622 fma  1   123456789  0.499999 -> 123456789 Inexact Rounded\r
+rounding: half_down\r
+fmax3623 fma  1   123456789  0.499999 -> 123456789 Inexact Rounded\r
+rounding: floor\r
+fmax3624 fma  1   123456789  0.499999 -> 123456789 Inexact Rounded\r
+rounding: ceiling\r
+fmax3625 fma  1   123456789  0.499999 -> 123456790 Inexact Rounded\r
+rounding: up\r
+fmax3626 fma  1   123456789  0.499999 -> 123456790 Inexact Rounded\r
+rounding: down\r
+fmax3627 fma  1   123456789  0.499999 -> 123456789 Inexact Rounded\r
+\r
+rounding: half_up\r
+fmax3631 fma  1   123456789 -0.499999 -> 123456789 Inexact Rounded\r
+rounding: half_even\r
+fmax3632 fma  1   123456789 -0.499999 -> 123456789 Inexact Rounded\r
+rounding: half_down\r
+fmax3633 fma  1   123456789 -0.499999 -> 123456789 Inexact Rounded\r
+rounding: floor\r
+fmax3634 fma  1   123456789 -0.499999 -> 123456788 Inexact Rounded\r
+rounding: ceiling\r
+fmax3635 fma  1   123456789 -0.499999 -> 123456789 Inexact Rounded\r
+rounding: up\r
+fmax3636 fma  1   123456789 -0.499999 -> 123456789 Inexact Rounded\r
+rounding: down\r
+fmax3637 fma  1   123456789 -0.499999 -> 123456788 Inexact Rounded\r
+\r
+rounding: half_up\r
+fmax3641 fma  1   123456789  0.500001 -> 123456790 Inexact Rounded\r
+rounding: half_even\r
+fmax3642 fma  1   123456789  0.500001 -> 123456790 Inexact Rounded\r
+rounding: half_down\r
+fmax3643 fma  1   123456789  0.500001 -> 123456790 Inexact Rounded\r
+rounding: floor\r
+fmax3644 fma  1   123456789  0.500001 -> 123456789 Inexact Rounded\r
+rounding: ceiling\r
+fmax3645 fma  1   123456789  0.500001 -> 123456790 Inexact Rounded\r
+rounding: up\r
+fmax3646 fma  1   123456789  0.500001 -> 123456790 Inexact Rounded\r
+rounding: down\r
+fmax3647 fma  1   123456789  0.500001 -> 123456789 Inexact Rounded\r
+\r
+rounding: half_up\r
+fmax3651 fma  1   123456789 -0.500001 -> 123456788 Inexact Rounded\r
+rounding: half_even\r
+fmax3652 fma  1   123456789 -0.500001 -> 123456788 Inexact Rounded\r
+rounding: half_down\r
+fmax3653 fma  1   123456789 -0.500001 -> 123456788 Inexact Rounded\r
+rounding: floor\r
+fmax3654 fma  1   123456789 -0.500001 -> 123456788 Inexact Rounded\r
+rounding: ceiling\r
+fmax3655 fma  1   123456789 -0.500001 -> 123456789 Inexact Rounded\r
+rounding: up\r
+fmax3656 fma  1   123456789 -0.500001 -> 123456789 Inexact Rounded\r
+rounding: down\r
+fmax3657 fma  1   123456789 -0.500001 -> 123456788 Inexact Rounded\r
+\r
+-- long operand triangle\r
+rounding: half_up\r
+precision:  37\r
+fmax3660 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538\r
+precision:  36\r
+fmax3661 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454  Inexact Rounded\r
+precision:  35\r
+fmax3662 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345   Inexact Rounded\r
+precision:  34\r
+fmax3663 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835    Inexact Rounded\r
+precision:  33\r
+fmax3664 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483     Inexact Rounded\r
+precision:  32\r
+fmax3665 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148      Inexact Rounded\r
+precision:  31\r
+fmax3666 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115       Inexact Rounded\r
+precision:  30\r
+fmax3667 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711        Inexact Rounded\r
+precision:  29\r
+fmax3668 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371         Inexact Rounded\r
+precision:  28\r
+fmax3669 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337          Inexact Rounded\r
+precision:  27\r
+fmax3670 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234           Inexact Rounded\r
+precision:  26\r
+fmax3671 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223            Inexact Rounded\r
+precision:  25\r
+fmax3672 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922             Inexact Rounded\r
+precision:  24\r
+fmax3673 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892              Inexact Rounded\r
+precision:  23\r
+fmax3674 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389               Inexact Rounded\r
+precision:  22\r
+fmax3675 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639                Inexact Rounded\r
+precision:  21\r
+fmax3676 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364                 Inexact Rounded\r
+precision:  20\r
+fmax3677 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236                  Inexact Rounded\r
+precision:  19\r
+fmax3678 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024                   Inexact Rounded\r
+precision:  18\r
+fmax3679 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102                    Inexact Rounded\r
+precision:  17\r
+fmax3680 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110                     Inexact Rounded\r
+precision:  16\r
+fmax3681 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211                      Inexact Rounded\r
+precision:  15\r
+fmax3682 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221                       Inexact Rounded\r
+precision:  14\r
+fmax3683 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422                        Inexact Rounded\r
+precision:  13\r
+fmax3684 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42                         Inexact Rounded\r
+precision:  12\r
+fmax3685 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4                          Inexact Rounded\r
+precision:  11\r
+fmax3686 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166                            Inexact Rounded\r
+precision:  10\r
+fmax3687 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10                        Inexact Rounded\r
+precision:   9\r
+fmax3688 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10                         Inexact Rounded\r
+precision:   8\r
+fmax3689 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10                          Inexact Rounded\r
+precision:   7\r
+fmax3690 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10                          Inexact Rounded\r
+precision:   6\r
+fmax3691 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10                          Inexact Rounded\r
+precision:   5\r
+fmax3692 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10                          Inexact Rounded\r
+precision:   4\r
+fmax3693 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10                          Inexact Rounded\r
+precision:   3\r
+fmax3694 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10                          Inexact Rounded\r
+precision:   2\r
+fmax3695 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10                          Inexact Rounded\r
+precision:   1\r
+fmax3696 fma  1   98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11                          Inexact Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_up\r
+precision:   9\r
+\r
+fmax3701 fma  1   5.00 1.00E-3 -> 5.00100\r
+fmax3702 fma  1   00.00 0.000  -> 0.000\r
+fmax3703 fma  1   00.00 0E-3   -> 0.000\r
+fmax3704 fma  1   0E-3  00.00  -> 0.000\r
+\r
+fmax3710 fma  1   0E+3  00.00  -> 0.00\r
+fmax3711 fma  1   0E+3  00.0   -> 0.0\r
+fmax3712 fma  1   0E+3  00.    -> 0\r
+fmax3713 fma  1   0E+3  00.E+1 -> 0E+1\r
+fmax3714 fma  1   0E+3  00.E+2 -> 0E+2\r
+fmax3715 fma  1   0E+3  00.E+3 -> 0E+3\r
+fmax3716 fma  1   0E+3  00.E+4 -> 0E+3\r
+fmax3717 fma  1   0E+3  00.E+5 -> 0E+3\r
+fmax3718 fma  1   0E+3  -00.0   -> 0.0\r
+fmax3719 fma  1   0E+3  -00.    -> 0\r
+fmax3731 fma  1   0E+3  -00.E+1 -> 0E+1\r
+\r
+fmax3720 fma  1   00.00  0E+3  -> 0.00\r
+fmax3721 fma  1   00.0   0E+3  -> 0.0\r
+fmax3722 fma  1   00.    0E+3  -> 0\r
+fmax3723 fma  1   00.E+1 0E+3  -> 0E+1\r
+fmax3724 fma  1   00.E+2 0E+3  -> 0E+2\r
+fmax3725 fma  1   00.E+3 0E+3  -> 0E+3\r
+fmax3726 fma  1   00.E+4 0E+3  -> 0E+3\r
+fmax3727 fma  1   00.E+5 0E+3  -> 0E+3\r
+fmax3728 fma  1   -00.00 0E+3  -> 0.00\r
+fmax3729 fma  1   -00.0  0E+3  -> 0.0\r
+fmax3730 fma  1   -00.   0E+3  -> 0\r
+\r
+fmax3732 fma  1    0     0     ->  0\r
+fmax3733 fma  1    0    -0     ->  0\r
+fmax3734 fma  1   -0     0     ->  0\r
+fmax3735 fma  1   -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+fmax3736 fma  1    1    -1     ->  0\r
+fmax3737 fma  1   -1    -1     -> -2\r
+fmax3738 fma  1    1     1     ->  2\r
+fmax3739 fma  1   -1     1     ->  0\r
+\r
+fmax3741 fma  1    0    -1     -> -1\r
+fmax3742 fma  1   -0    -1     -> -1\r
+fmax3743 fma  1    0     1     ->  1\r
+fmax3744 fma  1   -0     1     ->  1\r
+fmax3745 fma  1   -1     0     -> -1\r
+fmax3746 fma  1   -1    -0     -> -1\r
+fmax3747 fma  1    1     0     ->  1\r
+fmax3748 fma  1    1    -0     ->  1\r
+\r
+fmax3751 fma  1    0.0  -1     -> -1.0\r
+fmax3752 fma  1   -0.0  -1     -> -1.0\r
+fmax3753 fma  1    0.0   1     ->  1.0\r
+fmax3754 fma  1   -0.0   1     ->  1.0\r
+fmax3755 fma  1   -1.0   0     -> -1.0\r
+fmax3756 fma  1   -1.0  -0     -> -1.0\r
+fmax3757 fma  1    1.0   0     ->  1.0\r
+fmax3758 fma  1    1.0  -0     ->  1.0\r
+\r
+fmax3761 fma  1    0    -1.0   -> -1.0\r
+fmax3762 fma  1   -0    -1.0   -> -1.0\r
+fmax3763 fma  1    0     1.0   ->  1.0\r
+fmax3764 fma  1   -0     1.0   ->  1.0\r
+fmax3765 fma  1   -1     0.0   -> -1.0\r
+fmax3766 fma  1   -1    -0.0   -> -1.0\r
+fmax3767 fma  1    1     0.0   ->  1.0\r
+fmax3768 fma  1    1    -0.0   ->  1.0\r
+\r
+fmax3771 fma  1    0.0  -1.0   -> -1.0\r
+fmax3772 fma  1   -0.0  -1.0   -> -1.0\r
+fmax3773 fma  1    0.0   1.0   ->  1.0\r
+fmax3774 fma  1   -0.0   1.0   ->  1.0\r
+fmax3775 fma  1   -1.0   0.0   -> -1.0\r
+fmax3776 fma  1   -1.0  -0.0   -> -1.0\r
+fmax3777 fma  1    1.0   0.0   ->  1.0\r
+fmax3778 fma  1    1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+fmax3780 fma  1   -Inf  -Inf   -> -Infinity\r
+fmax3781 fma  1   -Inf  -1000  -> -Infinity\r
+fmax3782 fma  1   -Inf  -1     -> -Infinity\r
+fmax3783 fma  1   -Inf  -0     -> -Infinity\r
+fmax3784 fma  1   -Inf   0     -> -Infinity\r
+fmax3785 fma  1   -Inf   1     -> -Infinity\r
+fmax3786 fma  1   -Inf   1000  -> -Infinity\r
+fmax3787 fma  1   -1000 -Inf   -> -Infinity\r
+fmax3788 fma  1   -Inf  -Inf   -> -Infinity\r
+fmax3789 fma  1   -1    -Inf   -> -Infinity\r
+fmax3790 fma  1   -0    -Inf   -> -Infinity\r
+fmax3791 fma  1    0    -Inf   -> -Infinity\r
+fmax3792 fma  1    1    -Inf   -> -Infinity\r
+fmax3793 fma  1    1000 -Inf   -> -Infinity\r
+fmax3794 fma  1    Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+fmax3800 fma  1    Inf  -Inf   ->  NaN  Invalid_operation\r
+fmax3801 fma  1    Inf  -1000  ->  Infinity\r
+fmax3802 fma  1    Inf  -1     ->  Infinity\r
+fmax3803 fma  1    Inf  -0     ->  Infinity\r
+fmax3804 fma  1    Inf   0     ->  Infinity\r
+fmax3805 fma  1    Inf   1     ->  Infinity\r
+fmax3806 fma  1    Inf   1000  ->  Infinity\r
+fmax3807 fma  1    Inf   Inf   ->  Infinity\r
+fmax3808 fma  1   -1000  Inf   ->  Infinity\r
+fmax3809 fma  1   -Inf   Inf   ->  NaN  Invalid_operation\r
+fmax3810 fma  1   -1     Inf   ->  Infinity\r
+fmax3811 fma  1   -0     Inf   ->  Infinity\r
+fmax3812 fma  1    0     Inf   ->  Infinity\r
+fmax3813 fma  1    1     Inf   ->  Infinity\r
+fmax3814 fma  1    1000  Inf   ->  Infinity\r
+fmax3815 fma  1    Inf   Inf   ->  Infinity\r
+\r
+fmax3821 fma  1    NaN -Inf    ->  NaN\r
+fmax3822 fma  1    NaN -1000   ->  NaN\r
+fmax3823 fma  1    NaN -1      ->  NaN\r
+fmax3824 fma  1    NaN -0      ->  NaN\r
+fmax3825 fma  1    NaN  0      ->  NaN\r
+fmax3826 fma  1    NaN  1      ->  NaN\r
+fmax3827 fma  1    NaN  1000   ->  NaN\r
+fmax3828 fma  1    NaN  Inf    ->  NaN\r
+fmax3829 fma  1    NaN  NaN    ->  NaN\r
+fmax3830 fma  1   -Inf  NaN    ->  NaN\r
+fmax3831 fma  1   -1000 NaN    ->  NaN\r
+fmax3832 fma  1   -1    NaN    ->  NaN\r
+fmax3833 fma  1   -0    NaN    ->  NaN\r
+fmax3834 fma  1    0    NaN    ->  NaN\r
+fmax3835 fma  1    1    NaN    ->  NaN\r
+fmax3836 fma  1    1000 NaN    ->  NaN\r
+fmax3837 fma  1    Inf  NaN    ->  NaN\r
+\r
+fmax3841 fma  1    sNaN -Inf   ->  NaN  Invalid_operation\r
+fmax3842 fma  1    sNaN -1000  ->  NaN  Invalid_operation\r
+fmax3843 fma  1    sNaN -1     ->  NaN  Invalid_operation\r
+fmax3844 fma  1    sNaN -0     ->  NaN  Invalid_operation\r
+fmax3845 fma  1    sNaN  0     ->  NaN  Invalid_operation\r
+fmax3846 fma  1    sNaN  1     ->  NaN  Invalid_operation\r
+fmax3847 fma  1    sNaN  1000  ->  NaN  Invalid_operation\r
+fmax3848 fma  1    sNaN  NaN   ->  NaN  Invalid_operation\r
+fmax3849 fma  1    sNaN sNaN   ->  NaN  Invalid_operation\r
+fmax3850 fma  1    NaN  sNaN   ->  NaN  Invalid_operation\r
+fmax3851 fma  1   -Inf  sNaN   ->  NaN  Invalid_operation\r
+fmax3852 fma  1   -1000 sNaN   ->  NaN  Invalid_operation\r
+fmax3853 fma  1   -1    sNaN   ->  NaN  Invalid_operation\r
+fmax3854 fma  1   -0    sNaN   ->  NaN  Invalid_operation\r
+fmax3855 fma  1    0    sNaN   ->  NaN  Invalid_operation\r
+fmax3856 fma  1    1    sNaN   ->  NaN  Invalid_operation\r
+fmax3857 fma  1    1000 sNaN   ->  NaN  Invalid_operation\r
+fmax3858 fma  1    Inf  sNaN   ->  NaN  Invalid_operation\r
+fmax3859 fma  1    NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+fmax3861 fma  1    NaN1   -Inf    ->  NaN1\r
+fmax3862 fma  1   +NaN2   -1000   ->  NaN2\r
+fmax3863 fma  1    NaN3    1000   ->  NaN3\r
+fmax3864 fma  1    NaN4    Inf    ->  NaN4\r
+fmax3865 fma  1    NaN5   +NaN6   ->  NaN5\r
+fmax3866 fma  1   -Inf     NaN7   ->  NaN7\r
+fmax3867 fma  1   -1000    NaN8   ->  NaN8\r
+fmax3868 fma  1    1000    NaN9   ->  NaN9\r
+fmax3869 fma  1    Inf    +NaN10  ->  NaN10\r
+fmax3871 fma  1    sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+fmax3872 fma  1    sNaN12  -1000  ->  NaN12  Invalid_operation\r
+fmax3873 fma  1    sNaN13   1000  ->  NaN13  Invalid_operation\r
+fmax3874 fma  1    sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+fmax3875 fma  1    sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+fmax3876 fma  1    NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+fmax3877 fma  1   -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+fmax3878 fma  1   -1000    sNaN21 ->  NaN21  Invalid_operation\r
+fmax3879 fma  1    1000    sNaN22 ->  NaN22  Invalid_operation\r
+fmax3880 fma  1    Inf     sNaN23 ->  NaN23  Invalid_operation\r
+fmax3881 fma  1   +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+fmax3882 fma  1   -NaN26    NaN28 -> -NaN26\r
+fmax3883 fma  1   -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+fmax3884 fma  1    1000    -NaN30 -> -NaN30\r
+fmax3885 fma  1    1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- overflow, underflow and subnormal tests\r
+maxexponent: 999999\r
+minexponent: -999999\r
+precision: 9\r
+fmax3890 fma  1   1E+999999     9E+999999   -> Infinity Overflow Inexact Rounded\r
+fmax3891 fma  1   9E+999999     1E+999999   -> Infinity Overflow Inexact Rounded\r
+fmax3892 fma  1   -1.1E-999999  1E-999999   -> -1E-1000000    Subnormal\r
+fmax3893 fma  1   1E-999999    -1.1e-999999 -> -1E-1000000    Subnormal\r
+fmax3894 fma  1   -1.0001E-999999  1E-999999   -> -1E-1000003 Subnormal\r
+fmax3895 fma  1   1E-999999    -1.0001e-999999 -> -1E-1000003 Subnormal\r
+fmax3896 fma  1   -1E+999999   -9E+999999   -> -Infinity Overflow Inexact Rounded\r
+fmax3897 fma  1   -9E+999999   -1E+999999   -> -Infinity Overflow Inexact Rounded\r
+fmax3898 fma  1   +1.1E-999999 -1E-999999   -> 1E-1000000   Subnormal\r
+fmax3899 fma  1   -1E-999999   +1.1e-999999 -> 1E-1000000    Subnormal\r
+fmax3900 fma  1   +1.0001E-999999 -1E-999999   -> 1E-1000003 Subnormal\r
+fmax3901 fma  1   -1E-999999   +1.0001e-999999 -> 1E-1000003 Subnormal\r
+fmax3902 fma  1   -1E+999999   +9E+999999   ->  8E+999999\r
+fmax3903 fma  1   -9E+999999   +1E+999999   -> -8E+999999\r
+\r
+precision: 3\r
+fmax3904 fma  1        0 -9.999E+999999   -> -Infinity Inexact Overflow Rounded\r
+fmax3905 fma  1          -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded\r
+fmax3906 fma  1        0  9.999E+999999   ->  Infinity Inexact Overflow Rounded\r
+fmax3907 fma  1           9.999E+999999 0 ->  Infinity Inexact Overflow Rounded\r
+\r
+precision: 3\r
+maxexponent: 999\r
+minexponent: -999\r
+fmax3910 fma  1    1.00E-999   0    ->   1.00E-999\r
+fmax3911 fma  1    0.1E-999    0    ->   1E-1000   Subnormal\r
+fmax3912 fma  1    0.10E-999   0    ->   1.0E-1000 Subnormal\r
+fmax3913 fma  1    0.100E-999  0    ->   1.0E-1000 Subnormal Rounded\r
+fmax3914 fma  1    0.01E-999   0    ->   1E-1001   Subnormal\r
+-- next is rounded to Nmin\r
+fmax3915 fma  1    0.999E-999  0    ->   1.00E-999 Inexact Rounded Subnormal Underflow\r
+fmax3916 fma  1    0.099E-999  0    ->   1.0E-1000 Inexact Rounded Subnormal Underflow\r
+fmax3917 fma  1    0.009E-999  0    ->   1E-1001   Inexact Rounded Subnormal Underflow\r
+fmax3918 fma  1    0.001E-999  0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+fmax3919 fma  1    0.0009E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+fmax3920 fma  1    0.0001E-999 0    ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+\r
+fmax3930 fma  1   -1.00E-999   0    ->  -1.00E-999\r
+fmax3931 fma  1   -0.1E-999    0    ->  -1E-1000   Subnormal\r
+fmax3932 fma  1   -0.10E-999   0    ->  -1.0E-1000 Subnormal\r
+fmax3933 fma  1   -0.100E-999  0    ->  -1.0E-1000 Subnormal Rounded\r
+fmax3934 fma  1   -0.01E-999   0    ->  -1E-1001   Subnormal\r
+-- next is rounded to Nmin\r
+fmax3935 fma  1   -0.999E-999  0    ->  -1.00E-999 Inexact Rounded Subnormal Underflow\r
+fmax3936 fma  1   -0.099E-999  0    ->  -1.0E-1000 Inexact Rounded Subnormal Underflow\r
+fmax3937 fma  1   -0.009E-999  0    ->  -1E-1001   Inexact Rounded Subnormal Underflow\r
+fmax3938 fma  1   -0.001E-999  0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+fmax3939 fma  1   -0.0009E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+fmax3940 fma  1   -0.0001E-999 0    ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+\r
+-- some non-zero subnormal fma  1  s\r
+fmax3950 fma  1    1.00E-999    0.1E-999  ->   1.10E-999\r
+fmax3951 fma  1    0.1E-999     0.1E-999  ->   2E-1000    Subnormal\r
+fmax3952 fma  1    0.10E-999    0.1E-999  ->   2.0E-1000  Subnormal\r
+fmax3953 fma  1    0.100E-999   0.1E-999  ->   2.0E-1000  Subnormal Rounded\r
+fmax3954 fma  1    0.01E-999    0.1E-999  ->   1.1E-1000  Subnormal\r
+fmax3955 fma  1    0.999E-999   0.1E-999  ->   1.10E-999  Inexact Rounded\r
+fmax3956 fma  1    0.099E-999   0.1E-999  ->   2.0E-1000  Inexact Rounded Subnormal Underflow\r
+fmax3957 fma  1    0.009E-999   0.1E-999  ->   1.1E-1000  Inexact Rounded Subnormal Underflow\r
+fmax3958 fma  1    0.001E-999   0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow\r
+fmax3959 fma  1    0.0009E-999  0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow\r
+fmax3960 fma  1    0.0001E-999  0.1E-999  ->   1.0E-1000  Inexact Rounded Subnormal Underflow\r
+-- negatives...\r
+fmax3961 fma  1    1.00E-999   -0.1E-999  ->   9.0E-1000  Subnormal\r
+fmax3962 fma  1    0.1E-999    -0.1E-999  ->   0E-1000\r
+fmax3963 fma  1    0.10E-999   -0.1E-999  ->   0E-1001\r
+fmax3964 fma  1    0.100E-999  -0.1E-999  ->   0E-1001    Clamped\r
+fmax3965 fma  1    0.01E-999   -0.1E-999  ->   -9E-1001   Subnormal\r
+fmax3966 fma  1    0.999E-999  -0.1E-999  ->   9.0E-1000  Inexact Rounded Subnormal Underflow\r
+fmax3967 fma  1    0.099E-999  -0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+fmax3968 fma  1    0.009E-999  -0.1E-999  ->   -9E-1001   Inexact Rounded Subnormal Underflow\r
+fmax3969 fma  1    0.001E-999  -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow\r
+fmax3970 fma  1    0.0009E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow\r
+fmax3971 fma  1    0.0001E-999 -0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow\r
+\r
+-- some 'real' numbers\r
+maxExponent: 384\r
+minExponent: -383\r
+precision: 8\r
+fmax3566 fma  1   99999061735E-394  0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal\r
+precision: 7\r
+fmax3567 fma  1   99999061735E-394  0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal\r
+precision: 6\r
+fmax3568 fma  1   99999061735E-394  0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal\r
+\r
+-- now the case where we can get underflow but the result is normal\r
+-- [note this can't happen if the operands are also bounded, as we\r
+-- cannot represent 1E-399, for example]\r
+precision:   16\r
+rounding:    half_up\r
+maxExponent: 384\r
+minExponent: -383\r
+\r
+fmax3571 fma  1         1E-383       0  -> 1E-383\r
+fmax3572 fma  1         1E-384       0  -> 1E-384   Subnormal\r
+fmax3573 fma  1         1E-383  1E-384  -> 1.1E-383\r
+fmax3574 subtract  1E-383  1E-384  ->   9E-384 Subnormal\r
+\r
+-- Here we explore the boundary of rounding a subnormal to Nmin\r
+fmax3575 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal\r
+fmax3576 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal\r
+fmax3577 subtract  1E-383  1E-399  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax3578 subtract  1E-383  1E-400  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax3579 subtract  1E-383  1E-401  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax3580 subtract  1E-383  1E-402  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+\r
+-- check for double-rounded subnormals\r
+precision:   5\r
+maxexponent: 79\r
+minexponent: -79\r
+-- Add: lhs and rhs 0\r
+fmax31001 fma  1         1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31002 fma  1         1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31003 fma  1         1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31004 fma  1         0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31005 fma  1         0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31006 fma  1         0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+\r
+-- Add: lhs >> rhs and vice versa\r
+fmax31011 fma  1         1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31012 fma  1         1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31013 fma  1         1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31014 fma  1         1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31015 fma  1         1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31016 fma  1         1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow\r
+\r
+-- Add: lhs + rhs fma  1  ition carried out\r
+fmax31021 fma  1         1.52443E-80 1.00001E-80  -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31022 fma  1         1.52444E-80 1.00001E-80  -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31023 fma  1         1.52445E-80 1.00001E-80  -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31024 fma  1         1.00001E-80  1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31025 fma  1         1.00001E-80  1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+fmax31026 fma  1         1.00001E-80  1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow\r
+\r
+-- And for round down full and subnormal results\r
+precision:    16\r
+maxExponent: +384\r
+minExponent: -383\r
+rounding:     down\r
+\r
+fmax31100 fma  1   1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact\r
+fmax31101 fma  1   1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact\r
+fmax31103 fma  1     +1 -1e-383    -> 0.9999999999999999  Rounded Inexact\r
+fmax31104 fma  1   1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact\r
+fmax31105 fma  1   1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact\r
+fmax31106 fma  1   1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact\r
+fmax31107 fma  1   1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact\r
+fmax31108 fma  1   1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact\r
+fmax31109 fma  1   1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+fmax31110 fma  1   -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact\r
+fmax31111 fma  1   -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact\r
+fmax31113 fma  1      -1 +1e-383   -> -0.9999999999999999  Rounded Inexact\r
+fmax31114 fma  1   -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact\r
+fmax31115 fma  1   -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact\r
+fmax31116 fma  1   -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact\r
+fmax31117 fma  1   -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact\r
+fmax31118 fma  1   -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact\r
+fmax31119 fma  1   -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     down\r
+precision:    7\r
+maxExponent: +96\r
+minExponent: -95\r
+fmax31130 fma  1     1            -1e-200  -> 0.9999999  Rounded Inexact\r
+-- subnormal boundary\r
+fmax31131 fma  1     1.000000E-94  -1e-200  ->  9.999999E-95  Rounded Inexact\r
+fmax31132 fma  1     1.000001E-95  -1e-200  ->  1.000000E-95  Rounded Inexact\r
+fmax31133 fma  1     1.000000E-95  -1e-200  ->  9.99999E-96  Rounded Inexact Subnormal Underflow\r
+fmax31134 fma  1     0.999999E-95  -1e-200  ->  9.99998E-96  Rounded Inexact Subnormal Underflow\r
+fmax31135 fma  1     0.001000E-95  -1e-200  ->  9.99E-99  Rounded Inexact Subnormal Underflow\r
+fmax31136 fma  1     0.000999E-95  -1e-200  ->  9.98E-99  Rounded Inexact Subnormal Underflow\r
+fmax31137 fma  1     1.000000E-95  -1e-101  ->  9.99999E-96  Subnormal\r
+fmax31138 fma  1        10000E-101 -1e-200  ->  9.999E-98  Subnormal Inexact Rounded Underflow\r
+fmax31139 fma  1         1000E-101 -1e-200  ->  9.99E-99   Subnormal Inexact Rounded Underflow\r
+fmax31140 fma  1          100E-101 -1e-200  ->  9.9E-100   Subnormal Inexact Rounded Underflow\r
+fmax31141 fma  1           10E-101 -1e-200  ->  9E-101     Subnormal Inexact Rounded Underflow\r
+fmax31142 fma  1            1E-101 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+fmax31143 fma  1            0E-101 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+fmax31144 fma  1            1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+\r
+fmax31151 fma  1        10000E-102 -1e-200  ->  9.99E-99  Subnormal Inexact Rounded Underflow\r
+fmax31152 fma  1         1000E-102 -1e-200  ->  9.9E-100  Subnormal Inexact Rounded Underflow\r
+fmax31153 fma  1          100E-102 -1e-200  ->  9E-101   Subnormal Inexact Rounded Underflow\r
+fmax31154 fma  1           10E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+fmax31155 fma  1            1E-102 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+fmax31156 fma  1            0E-102 -1e-200  -> -0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+fmax31157 fma  1            1E-103 -1e-200  ->  0E-101     Subnormal Inexact Rounded Underflow Clamped\r
+\r
+fmax31160 fma  1          100E-105 -1e-101  -> -0E-101 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31161 fma  1          100E-105 -1e-201  ->  0E-101 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+precision:   15\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+fmax31200 fma  1   1E15  -0.5                 ->  1.00000000000000E+15 Inexact Rounded\r
+fmax31201 fma  1   1E15  -0.50                ->  1.00000000000000E+15 Inexact Rounded\r
+fmax31210 fma  1   1E15  -0.51                ->  999999999999999      Inexact Rounded\r
+fmax31211 fma  1   1E15  -0.501               ->  999999999999999      Inexact Rounded\r
+fmax31212 fma  1   1E15  -0.5001              ->  999999999999999      Inexact Rounded\r
+fmax31213 fma  1   1E15  -0.50001             ->  999999999999999      Inexact Rounded\r
+fmax31214 fma  1   1E15  -0.500001            ->  999999999999999      Inexact Rounded\r
+fmax31215 fma  1   1E15  -0.5000001           ->  999999999999999      Inexact Rounded\r
+fmax31216 fma  1   1E15  -0.50000001          ->  999999999999999      Inexact Rounded\r
+fmax31217 fma  1   1E15  -0.500000001         ->  999999999999999      Inexact Rounded\r
+fmax31218 fma  1   1E15  -0.5000000001        ->  999999999999999      Inexact Rounded\r
+fmax31219 fma  1   1E15  -0.50000000001       ->  999999999999999      Inexact Rounded\r
+fmax31220 fma  1   1E15  -0.500000000001      ->  999999999999999      Inexact Rounded\r
+fmax31221 fma  1   1E15  -0.5000000000001     ->  999999999999999      Inexact Rounded\r
+fmax31222 fma  1   1E15  -0.50000000000001    ->  999999999999999      Inexact Rounded\r
+fmax31223 fma  1   1E15  -0.500000000000001   ->  999999999999999      Inexact Rounded\r
+fmax31224 fma  1   1E15  -0.5000000000000001  ->  999999999999999      Inexact Rounded\r
+fmax31225 fma  1   1E15  -0.5000000000000000  ->  1.00000000000000E+15 Inexact Rounded\r
+fmax31230 fma  1   1E15  -5000000.000000001   ->  999999995000000      Inexact Rounded\r
+\r
+precision:   16\r
+\r
+fmax31300 fma  1   1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31310 fma  1   1E16  -0.51                ->  9999999999999999      Inexact Rounded\r
+fmax31311 fma  1   1E16  -0.501               ->  9999999999999999      Inexact Rounded\r
+fmax31312 fma  1   1E16  -0.5001              ->  9999999999999999      Inexact Rounded\r
+fmax31313 fma  1   1E16  -0.50001             ->  9999999999999999      Inexact Rounded\r
+fmax31314 fma  1   1E16  -0.500001            ->  9999999999999999      Inexact Rounded\r
+fmax31315 fma  1   1E16  -0.5000001           ->  9999999999999999      Inexact Rounded\r
+fmax31316 fma  1   1E16  -0.50000001          ->  9999999999999999      Inexact Rounded\r
+fmax31317 fma  1   1E16  -0.500000001         ->  9999999999999999      Inexact Rounded\r
+fmax31318 fma  1   1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded\r
+fmax31319 fma  1   1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded\r
+fmax31320 fma  1   1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded\r
+fmax31321 fma  1   1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded\r
+fmax31322 fma  1   1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded\r
+fmax31323 fma  1   1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded\r
+fmax31324 fma  1   1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded\r
+fmax31325 fma  1   1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31326 fma  1   1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31327 fma  1   1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31328 fma  1   1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31329 fma  1   1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31330 fma  1   1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31331 fma  1   1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31332 fma  1   1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31333 fma  1   1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31334 fma  1   1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31335 fma  1   1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31336 fma  1   1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31337 fma  1   1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31338 fma  1   1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31339 fma  1   1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+fmax31340 fma  1   1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded\r
+fmax31341 fma  1   1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded\r
+\r
+fmax31349 fma  1   9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded\r
+fmax31350 fma  1   9999999999999999 0.49                ->  9999999999999999      Inexact Rounded\r
+fmax31351 fma  1   9999999999999999 0.499               ->  9999999999999999      Inexact Rounded\r
+fmax31352 fma  1   9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded\r
+fmax31353 fma  1   9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded\r
+fmax31354 fma  1   9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded\r
+fmax31355 fma  1   9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded\r
+fmax31356 fma  1   9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded\r
+fmax31357 fma  1   9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded\r
+fmax31358 fma  1   9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded\r
+fmax31359 fma  1   9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded\r
+fmax31360 fma  1   9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded\r
+fmax31361 fma  1   9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded\r
+fmax31362 fma  1   9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded\r
+fmax31363 fma  1   9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded\r
+fmax31364 fma  1   9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded\r
+fmax31365 fma  1   9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31367 fma  1   9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31368 fma  1   9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31369 fma  1   9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31370 fma  1   9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31371 fma  1   9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31372 fma  1   9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31373 fma  1   9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31374 fma  1   9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31375 fma  1   9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31376 fma  1   9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31377 fma  1   9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31378 fma  1   9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31379 fma  1   9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31380 fma  1   9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31381 fma  1   9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31382 fma  1   9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31383 fma  1   9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31384 fma  1   9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31385 fma  1   9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31386 fma  1   9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31387 fma  1   9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31388 fma  1   9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31389 fma  1   9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31390 fma  1   9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31391 fma  1   9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31392 fma  1   9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31393 fma  1   9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31394 fma  1   9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31395 fma  1   9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax31396 fma  1   9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+precision:   15\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+fmax31400 fma  1    0 1.23456789012345     -> 1.23456789012345\r
+fmax31401 fma  1    0 1.23456789012345E-1  -> 0.123456789012345\r
+fmax31402 fma  1    0 1.23456789012345E-2  -> 0.0123456789012345\r
+fmax31403 fma  1    0 1.23456789012345E-3  -> 0.00123456789012345\r
+fmax31404 fma  1    0 1.23456789012345E-4  -> 0.000123456789012345\r
+fmax31405 fma  1    0 1.23456789012345E-5  -> 0.0000123456789012345\r
+fmax31406 fma  1    0 1.23456789012345E-6  -> 0.00000123456789012345\r
+fmax31407 fma  1    0 1.23456789012345E-7  -> 1.23456789012345E-7\r
+fmax31408 fma  1    0 1.23456789012345E-8  -> 1.23456789012345E-8\r
+fmax31409 fma  1    0 1.23456789012345E-9  -> 1.23456789012345E-9\r
+fmax31410 fma  1    0 1.23456789012345E-10 -> 1.23456789012345E-10\r
+fmax31411 fma  1    0 1.23456789012345E-11 -> 1.23456789012345E-11\r
+fmax31412 fma  1    0 1.23456789012345E-12 -> 1.23456789012345E-12\r
+fmax31413 fma  1    0 1.23456789012345E-13 -> 1.23456789012345E-13\r
+fmax31414 fma  1    0 1.23456789012345E-14 -> 1.23456789012345E-14\r
+fmax31415 fma  1    0 1.23456789012345E-15 -> 1.23456789012345E-15\r
+fmax31416 fma  1    0 1.23456789012345E-16 -> 1.23456789012345E-16\r
+fmax31417 fma  1    0 1.23456789012345E-17 -> 1.23456789012345E-17\r
+fmax31418 fma  1    0 1.23456789012345E-18 -> 1.23456789012345E-18\r
+fmax31419 fma  1    0 1.23456789012345E-19 -> 1.23456789012345E-19\r
+\r
+-- same, precision 16..\r
+precision:   16\r
+fmax31420 fma  1    0 1.123456789012345     -> 1.123456789012345\r
+fmax31421 fma  1    0 1.123456789012345E-1  -> 0.1123456789012345\r
+fmax31422 fma  1    0 1.123456789012345E-2  -> 0.01123456789012345\r
+fmax31423 fma  1    0 1.123456789012345E-3  -> 0.001123456789012345\r
+fmax31424 fma  1    0 1.123456789012345E-4  -> 0.0001123456789012345\r
+fmax31425 fma  1    0 1.123456789012345E-5  -> 0.00001123456789012345\r
+fmax31426 fma  1    0 1.123456789012345E-6  -> 0.000001123456789012345\r
+fmax31427 fma  1    0 1.123456789012345E-7  -> 1.123456789012345E-7\r
+fmax31428 fma  1    0 1.123456789012345E-8  -> 1.123456789012345E-8\r
+fmax31429 fma  1    0 1.123456789012345E-9  -> 1.123456789012345E-9\r
+fmax31430 fma  1    0 1.123456789012345E-10 -> 1.123456789012345E-10\r
+fmax31431 fma  1    0 1.123456789012345E-11 -> 1.123456789012345E-11\r
+fmax31432 fma  1    0 1.123456789012345E-12 -> 1.123456789012345E-12\r
+fmax31433 fma  1    0 1.123456789012345E-13 -> 1.123456789012345E-13\r
+fmax31434 fma  1    0 1.123456789012345E-14 -> 1.123456789012345E-14\r
+fmax31435 fma  1    0 1.123456789012345E-15 -> 1.123456789012345E-15\r
+fmax31436 fma  1    0 1.123456789012345E-16 -> 1.123456789012345E-16\r
+fmax31437 fma  1    0 1.123456789012345E-17 -> 1.123456789012345E-17\r
+fmax31438 fma  1    0 1.123456789012345E-18 -> 1.123456789012345E-18\r
+fmax31439 fma  1    0 1.123456789012345E-19 -> 1.123456789012345E-19\r
+\r
+-- same, reversed 0\r
+fmax31440 fma  1   1.123456789012345     0 -> 1.123456789012345\r
+fmax31441 fma  1   1.123456789012345E-1  0 -> 0.1123456789012345\r
+fmax31442 fma  1   1.123456789012345E-2  0 -> 0.01123456789012345\r
+fmax31443 fma  1   1.123456789012345E-3  0 -> 0.001123456789012345\r
+fmax31444 fma  1   1.123456789012345E-4  0 -> 0.0001123456789012345\r
+fmax31445 fma  1   1.123456789012345E-5  0 -> 0.00001123456789012345\r
+fmax31446 fma  1   1.123456789012345E-6  0 -> 0.000001123456789012345\r
+fmax31447 fma  1   1.123456789012345E-7  0 -> 1.123456789012345E-7\r
+fmax31448 fma  1   1.123456789012345E-8  0 -> 1.123456789012345E-8\r
+fmax31449 fma  1   1.123456789012345E-9  0 -> 1.123456789012345E-9\r
+fmax31450 fma  1   1.123456789012345E-10 0 -> 1.123456789012345E-10\r
+fmax31451 fma  1   1.123456789012345E-11 0 -> 1.123456789012345E-11\r
+fmax31452 fma  1   1.123456789012345E-12 0 -> 1.123456789012345E-12\r
+fmax31453 fma  1   1.123456789012345E-13 0 -> 1.123456789012345E-13\r
+fmax31454 fma  1   1.123456789012345E-14 0 -> 1.123456789012345E-14\r
+fmax31455 fma  1   1.123456789012345E-15 0 -> 1.123456789012345E-15\r
+fmax31456 fma  1   1.123456789012345E-16 0 -> 1.123456789012345E-16\r
+fmax31457 fma  1   1.123456789012345E-17 0 -> 1.123456789012345E-17\r
+fmax31458 fma  1   1.123456789012345E-18 0 -> 1.123456789012345E-18\r
+fmax31459 fma  1   1.123456789012345E-19 0 -> 1.123456789012345E-19\r
+\r
+-- same, Es on the 0\r
+fmax31460 fma  1   1.123456789012345  0E-0   -> 1.123456789012345\r
+fmax31461 fma  1   1.123456789012345  0E-1   -> 1.123456789012345\r
+fmax31462 fma  1   1.123456789012345  0E-2   -> 1.123456789012345\r
+fmax31463 fma  1   1.123456789012345  0E-3   -> 1.123456789012345\r
+fmax31464 fma  1   1.123456789012345  0E-4   -> 1.123456789012345\r
+fmax31465 fma  1   1.123456789012345  0E-5   -> 1.123456789012345\r
+fmax31466 fma  1   1.123456789012345  0E-6   -> 1.123456789012345\r
+fmax31467 fma  1   1.123456789012345  0E-7   -> 1.123456789012345\r
+fmax31468 fma  1   1.123456789012345  0E-8   -> 1.123456789012345\r
+fmax31469 fma  1   1.123456789012345  0E-9   -> 1.123456789012345\r
+fmax31470 fma  1   1.123456789012345  0E-10  -> 1.123456789012345\r
+fmax31471 fma  1   1.123456789012345  0E-11  -> 1.123456789012345\r
+fmax31472 fma  1   1.123456789012345  0E-12  -> 1.123456789012345\r
+fmax31473 fma  1   1.123456789012345  0E-13  -> 1.123456789012345\r
+fmax31474 fma  1   1.123456789012345  0E-14  -> 1.123456789012345\r
+fmax31475 fma  1   1.123456789012345  0E-15  -> 1.123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+fmax31476 fma  1   1.123456789012345  0E-16  -> 1.123456789012345 Rounded\r
+fmax31477 fma  1   1.123456789012345  0E-17  -> 1.123456789012345 Rounded\r
+fmax31478 fma  1   1.123456789012345  0E-18  -> 1.123456789012345 Rounded\r
+fmax31479 fma  1   1.123456789012345  0E-19  -> 1.123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+precision:   16\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+fmax31500 fma  1    0        0E-19  ->  0E-19\r
+fmax31501 fma  1   -0        0E-19  ->  0E-19\r
+fmax31502 fma  1    0       -0E-19  ->  0E-19\r
+fmax31503 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31504 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31505 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31506 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31507 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31511 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31512 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31513 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31514 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax31515 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31516 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31517 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31518 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+fmax31520 fma  1    0        0E-19  ->  0E-19\r
+fmax31521 fma  1   -0        0E-19  ->  0E-19\r
+fmax31522 fma  1    0       -0E-19  ->  0E-19\r
+fmax31523 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31524 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31525 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31526 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31527 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31531 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31532 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31533 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31534 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax31535 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31536 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31537 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31538 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+fmax31540 fma  1    0        0E-19  ->  0E-19\r
+fmax31541 fma  1   -0        0E-19  ->  0E-19\r
+fmax31542 fma  1    0       -0E-19  ->  0E-19\r
+fmax31543 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31544 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31545 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31546 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31547 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31551 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31552 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31553 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31554 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax31555 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31556 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31557 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31558 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+fmax31560 fma  1    0        0E-19  ->  0E-19\r
+fmax31561 fma  1   -0        0E-19  ->  0E-19\r
+fmax31562 fma  1    0       -0E-19  ->  0E-19\r
+fmax31563 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31564 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31565 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31566 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31567 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31571 fma  1    1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31572 fma  1   -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31573 fma  1    1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31574 fma  1   -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+-- some exact zeros from non-zeros\r
+fmax31575 fma  1    1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31576 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31577 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31578 fma  1   -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+fmax31580 fma  1    0        0E-19  ->  0E-19\r
+fmax31581 fma  1   -0        0E-19  ->  0E-19\r
+fmax31582 fma  1    0       -0E-19  ->  0E-19\r
+fmax31583 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31584 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31585 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31586 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31587 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31591 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31592 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31593 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31594 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax31595 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31596 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31597 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31598 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+fmax31600 fma  1    0        0E-19  ->  0E-19\r
+fmax31601 fma  1   -0        0E-19  ->  0E-19\r
+fmax31602 fma  1    0       -0E-19  ->  0E-19\r
+fmax31603 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31604 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31605 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31606 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax31607 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31611 fma  1    1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31612 fma  1   -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31613 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31614 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax31615 fma  1    1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31616 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax31617 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax31618 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+fmax31620 fma  1    0        0E-19  ->  0E-19\r
+fmax31621 fma  1   -0        0E-19  -> -0E-19           -- *\r
+fmax31622 fma  1    0       -0E-19  -> -0E-19           -- *\r
+fmax31623 fma  1   -0       -0E-19  -> -0E-19\r
+fmax31624 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax31625 fma  1   -0E-400   0E-19  -> -0E-398 Clamped  -- *\r
+fmax31626 fma  1    0E-400  -0E-19  -> -0E-398 Clamped  -- *\r
+fmax31627 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax31631 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31632 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31633 fma  1    1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+fmax31634 fma  1   -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+-- some exact zeros from non-zeros\r
+fmax31635 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax31636 fma  1   -1E-401   1E-401 -> -0E-398 Clamped  -- *\r
+fmax31637 fma  1    1E-401  -1E-401 -> -0E-398 Clamped  -- *\r
+fmax31638 fma  1   -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+\r
+-- BigDecimal problem testcases 2006.01.23\r
+precision:   16\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+rounding:  down\r
+precision: 7\r
+fmax31651 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 6\r
+fmax31652 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 5\r
+fmax31653 fma  1    10001E+2  -2E+1 -> 1.0000E+6   Inexact Rounded\r
+precision: 4\r
+fmax31654 fma  1    10001E+2  -2E+1 -> 1.000E+6    Inexact Rounded\r
+precision: 3\r
+fmax31655 fma  1    10001E+2  -2E+1 -> 1.00E+6     Inexact Rounded\r
+precision: 2\r
+fmax31656 fma  1    10001E+2  -2E+1 -> 1.0E+6      Inexact Rounded\r
+precision: 1\r
+fmax31657 fma  1    10001E+2  -2E+1 -> 1E+6        Inexact Rounded\r
+\r
+rounding:  half_even\r
+precision: 7\r
+fmax31661 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 6\r
+fmax31662 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 5\r
+fmax31663 fma  1    10001E+2  -2E+1 -> 1.0001E+6   Inexact Rounded\r
+precision: 4\r
+fmax31664 fma  1    10001E+2  -2E+1 -> 1.000E+6    Inexact Rounded\r
+precision: 3\r
+fmax31665 fma  1    10001E+2  -2E+1 -> 1.00E+6     Inexact Rounded\r
+precision: 2\r
+fmax31666 fma  1    10001E+2  -2E+1 -> 1.0E+6      Inexact Rounded\r
+precision: 1\r
+fmax31667 fma  1    10001E+2  -2E+1 -> 1E+6        Inexact Rounded\r
+\r
+rounding:  up\r
+precision: 7\r
+fmax31671 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 6\r
+fmax31672 fma  1    10001E+2  -2E+1 -> 1.00008E+6\r
+precision: 5\r
+fmax31673 fma  1    10001E+2  -2E+1 -> 1.0001E+6   Inexact Rounded\r
+precision: 4\r
+fmax31674 fma  1    10001E+2  -2E+1 -> 1.001E+6    Inexact Rounded\r
+precision: 3\r
+fmax31675 fma  1    10001E+2  -2E+1 -> 1.01E+6     Inexact Rounded\r
+precision: 2\r
+fmax31676 fma  1    10001E+2  -2E+1 -> 1.1E+6      Inexact Rounded\r
+precision: 1\r
+fmax31677 fma  1    10001E+2  -2E+1 -> 2E+6        Inexact Rounded\r
+\r
+precision:   34\r
+rounding:    half_up\r
+maxExponent: 6144\r
+minExponent: -6143\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+fmax31701  fma  1   130E-2    120E-2    -> 2.50\r
+fmax31702  fma  1   130E-2    12E-1     -> 2.50\r
+fmax31703  fma  1   130E-2    1E0       -> 2.30\r
+fmax31704  fma  1   1E2       1E4       -> 1.01E+4\r
+fmax31705  subtract 130E-2  120E-2 -> 0.10\r
+fmax31706  subtract 130E-2  12E-1  -> 0.10\r
+fmax31707  subtract 130E-2  1E0    -> 0.30\r
+fmax31708  subtract 1E2     1E4    -> -9.9E+3\r
+\r
+------------------------------------------------------------------------\r
+-- Same as above, using decimal64 default parameters                  --\r
+------------------------------------------------------------------------\r
+precision:   16\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- [first group are 'quick confidence check']\r
+fmax36001 fma  1   1       1       ->  2\r
+fmax36002 fma  1   2       3       ->  5\r
+fmax36003 fma  1   '5.75'  '3.3'   ->  9.05\r
+fmax36004 fma  1   '5'     '-3'    ->  2\r
+fmax36005 fma  1   '-5'    '-3'    ->  -8\r
+fmax36006 fma  1   '-7'    '2.5'   ->  -4.5\r
+fmax36007 fma  1   '0.7'   '0.3'   ->  1.0\r
+fmax36008 fma  1   '1.25'  '1.25'  ->  2.50\r
+fmax36009 fma  1   '1.23456789'  '1.00000000' -> '2.23456789'\r
+fmax36010 fma  1   '1.23456789'  '1.00000011' -> '2.23456800'\r
+\r
+fmax36011 fma  1   '0.44444444444444444'  '0.55555555555555555' -> '1.000000000000000' Inexact Rounded\r
+fmax36012 fma  1   '0.44444444444444440'  '0.55555555555555555' -> '1.000000000000000' Inexact Rounded\r
+fmax36013 fma  1   '0.44444444444444444'  '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded\r
+fmax36014 fma  1   '0.444444444444444449'    '0' -> '0.4444444444444444' Inexact Rounded\r
+fmax36015 fma  1   '0.4444444444444444499'   '0' -> '0.4444444444444444' Inexact Rounded\r
+fmax36016 fma  1   '0.44444444444444444999'  '0' -> '0.4444444444444444' Inexact Rounded\r
+fmax36017 fma  1   '0.44444444444444445000'  '0' -> '0.4444444444444444' Inexact Rounded\r
+fmax36018 fma  1   '0.44444444444444445001'  '0' -> '0.4444444444444445' Inexact Rounded\r
+fmax36019 fma  1   '0.4444444444444444501'   '0' -> '0.4444444444444445' Inexact Rounded\r
+fmax36020 fma  1   '0.444444444444444451'    '0' -> '0.4444444444444445' Inexact Rounded\r
+\r
+fmax36021 fma  1   0 1 -> 1\r
+fmax36022 fma  1   1 1 -> 2\r
+fmax36023 fma  1   2 1 -> 3\r
+fmax36024 fma  1   3 1 -> 4\r
+fmax36025 fma  1   4 1 -> 5\r
+fmax36026 fma  1   5 1 -> 6\r
+fmax36027 fma  1   6 1 -> 7\r
+fmax36028 fma  1   7 1 -> 8\r
+fmax36029 fma  1   8 1 -> 9\r
+fmax36030 fma  1   9 1 -> 10\r
+\r
+-- some carrying effects\r
+fmax36031 fma  1   '0.9998'  '0.0000' -> '0.9998'\r
+fmax36032 fma  1   '0.9998'  '0.0001' -> '0.9999'\r
+fmax36033 fma  1   '0.9998'  '0.0002' -> '1.0000'\r
+fmax36034 fma  1   '0.9998'  '0.0003' -> '1.0001'\r
+\r
+fmax36035 fma  1   '70'      '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36036 fma  1   '700'     '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36037 fma  1   '7000'    '10000e+16' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36038 fma  1   '70000'   '10000e+16' -> '1.000000000000001E+20' Inexact Rounded\r
+fmax36039 fma  1   '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded\r
+\r
+-- symmetry:\r
+fmax36040 fma  1   '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36041 fma  1   '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36042 fma  1   '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded\r
+fmax36044 fma  1   '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded\r
+fmax36045 fma  1   '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded\r
+\r
+fmax36046 fma  1   '10000e+9'  '7' -> '10000000000007'\r
+fmax36047 fma  1   '10000e+9'  '70' -> '10000000000070'\r
+fmax36048 fma  1   '10000e+9'  '700' -> '10000000000700'\r
+fmax36049 fma  1   '10000e+9'  '7000' -> '10000000007000'\r
+fmax36050 fma  1   '10000e+9'  '70000' -> '10000000070000'\r
+fmax36051 fma  1   '10000e+9'  '700000' -> '10000000700000'\r
+\r
+-- examples from decarith\r
+fmax36053 fma  1   '12' '7.00' -> '19.00'\r
+fmax36054 fma  1   '1.3' '-1.07' -> '0.23'\r
+fmax36055 fma  1   '1.3' '-1.30' -> '0.00'\r
+fmax36056 fma  1   '1.3' '-2.07' -> '-0.77'\r
+fmax36057 fma  1   '1E+2' '1E+4' -> '1.01E+4'\r
+\r
+-- from above\r
+fmax36061 fma  1   1 '0.1' -> '1.1'\r
+fmax36062 fma  1   1 '0.01' -> '1.01'\r
+fmax36063 fma  1   1 '0.001' -> '1.001'\r
+fmax36064 fma  1   1 '0.0001' -> '1.0001'\r
+fmax36065 fma  1   1 '0.00001' -> '1.00001'\r
+fmax36066 fma  1   1 '0.000001' -> '1.000001'\r
+fmax36067 fma  1   1 '0.0000001' -> '1.0000001'\r
+fmax36068 fma  1   1 '0.00000001' -> '1.00000001'\r
+\r
+-- some funny zeros [in case of bad signum]\r
+fmax36070 fma  1   1  0    -> 1\r
+fmax36071 fma  1   1 0.    -> 1\r
+fmax36072 fma  1   1  .0   -> 1.0\r
+fmax36073 fma  1   1 0.0   -> 1.0\r
+fmax36074 fma  1   1 0.00  -> 1.00\r
+fmax36075 fma  1    0  1   -> 1\r
+fmax36076 fma  1   0.  1   -> 1\r
+fmax36077 fma  1    .0 1   -> 1.0\r
+fmax36078 fma  1   0.0 1   -> 1.0\r
+fmax36079 fma  1   0.00 1  -> 1.00\r
+\r
+-- some carries\r
+fmax36080 fma  1   9999999999999998 1  -> 9999999999999999\r
+fmax36081 fma  1   9999999999999999 1  -> 1.000000000000000E+16 Rounded\r
+fmax36082 fma  1    999999999999999 1  -> 1000000000000000\r
+fmax36083 fma  1      9999999999999 1  -> 10000000000000\r
+fmax36084 fma  1        99999999999 1  -> 100000000000\r
+fmax36085 fma  1          999999999 1  -> 1000000000\r
+fmax36086 fma  1            9999999 1  -> 10000000\r
+fmax36087 fma  1              99999 1  -> 100000\r
+fmax36088 fma  1                999 1  -> 1000\r
+fmax36089 fma  1                  9 1  -> 10\r
+\r
+\r
+-- more LHS swaps\r
+fmax36090 fma  1   '-56267E-10'   0 ->  '-0.0000056267'\r
+fmax36091 fma  1   '-56267E-6'    0 ->  '-0.056267'\r
+fmax36092 fma  1   '-56267E-5'    0 ->  '-0.56267'\r
+fmax36093 fma  1   '-56267E-4'    0 ->  '-5.6267'\r
+fmax36094 fma  1   '-56267E-3'    0 ->  '-56.267'\r
+fmax36095 fma  1   '-56267E-2'    0 ->  '-562.67'\r
+fmax36096 fma  1   '-56267E-1'    0 ->  '-5626.7'\r
+fmax36097 fma  1   '-56267E-0'    0 ->  '-56267'\r
+fmax36098 fma  1   '-5E-10'       0 ->  '-5E-10'\r
+fmax36099 fma  1   '-5E-7'        0 ->  '-5E-7'\r
+fmax36100 fma  1   '-5E-6'        0 ->  '-0.000005'\r
+fmax36101 fma  1   '-5E-5'        0 ->  '-0.00005'\r
+fmax36102 fma  1   '-5E-4'        0 ->  '-0.0005'\r
+fmax36103 fma  1   '-5E-1'        0 ->  '-0.5'\r
+fmax36104 fma  1   '-5E0'         0 ->  '-5'\r
+fmax36105 fma  1   '-5E1'         0 ->  '-50'\r
+fmax36106 fma  1   '-5E5'         0 ->  '-500000'\r
+fmax36107 fma  1   '-5E15'        0 ->  '-5000000000000000'\r
+fmax36108 fma  1   '-5E16'        0 ->  '-5.000000000000000E+16'   Rounded\r
+fmax36109 fma  1   '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded\r
+fmax36110 fma  1   '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded\r
+fmax36111 fma  1   '-5E100'       0 ->  '-5.000000000000000E+100' Rounded\r
+\r
+-- more RHS swaps\r
+fmax36113 fma  1   0  '-56267E-10' ->  '-0.0000056267'\r
+fmax36114 fma  1   0  '-56267E-6'  ->  '-0.056267'\r
+fmax36116 fma  1   0  '-56267E-5'  ->  '-0.56267'\r
+fmax36117 fma  1   0  '-56267E-4'  ->  '-5.6267'\r
+fmax36119 fma  1   0  '-56267E-3'  ->  '-56.267'\r
+fmax36120 fma  1   0  '-56267E-2'  ->  '-562.67'\r
+fmax36121 fma  1   0  '-56267E-1'  ->  '-5626.7'\r
+fmax36122 fma  1   0  '-56267E-0'  ->  '-56267'\r
+fmax36123 fma  1   0  '-5E-10'     ->  '-5E-10'\r
+fmax36124 fma  1   0  '-5E-7'      ->  '-5E-7'\r
+fmax36125 fma  1   0  '-5E-6'      ->  '-0.000005'\r
+fmax36126 fma  1   0  '-5E-5'      ->  '-0.00005'\r
+fmax36127 fma  1   0  '-5E-4'      ->  '-0.0005'\r
+fmax36128 fma  1   0  '-5E-1'      ->  '-0.5'\r
+fmax36129 fma  1   0  '-5E0'       ->  '-5'\r
+fmax36130 fma  1   0  '-5E1'       ->  '-50'\r
+fmax36131 fma  1   0  '-5E5'       ->  '-500000'\r
+fmax36132 fma  1   0  '-5E15'      ->  '-5000000000000000'\r
+fmax36133 fma  1   0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded\r
+fmax36134 fma  1   0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded\r
+fmax36135 fma  1   0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded\r
+fmax36136 fma  1   0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded\r
+\r
+-- related\r
+fmax36137 fma  1    1  '0E-19'      ->  '1.000000000000000'  Rounded\r
+fmax36138 fma  1   -1  '0E-19'      ->  '-1.000000000000000' Rounded\r
+fmax36139 fma  1   '0E-19' 1        ->  '1.000000000000000'  Rounded\r
+fmax36140 fma  1   '0E-19' -1       ->  '-1.000000000000000' Rounded\r
+fmax36141 fma  1   1E+11   0.0000   ->  '100000000000.0000'\r
+fmax36142 fma  1   1E+11   0.00000  ->  '100000000000.0000'  Rounded\r
+fmax36143 fma  1   0.000   1E+12    ->  '1000000000000.000'\r
+fmax36144 fma  1   0.0000  1E+12    ->  '1000000000000.000'  Rounded\r
+\r
+-- [some of the next group are really constructor tests]\r
+fmax36146 fma  1   '00.0'  0       ->  '0.0'\r
+fmax36147 fma  1   '0.00'  0       ->  '0.00'\r
+fmax36148 fma  1    0      '0.00'  ->  '0.00'\r
+fmax36149 fma  1    0      '00.0'  ->  '0.0'\r
+fmax36150 fma  1   '00.0'  '0.00'  ->  '0.00'\r
+fmax36151 fma  1   '0.00'  '00.0'  ->  '0.00'\r
+fmax36152 fma  1   '3'     '.3'    ->  '3.3'\r
+fmax36153 fma  1   '3.'    '.3'    ->  '3.3'\r
+fmax36154 fma  1   '3.0'   '.3'    ->  '3.3'\r
+fmax36155 fma  1   '3.00'  '.3'    ->  '3.30'\r
+fmax36156 fma  1   '3'     '3'     ->  '6'\r
+fmax36157 fma  1   '3'     '+3'    ->  '6'\r
+fmax36158 fma  1   '3'     '-3'    ->  '0'\r
+fmax36159 fma  1   '0.3'   '-0.3'  ->  '0.0'\r
+fmax36160 fma  1   '0.03'  '-0.03' ->  '0.00'\r
+\r
+-- try borderline precision, with carries, etc.\r
+fmax36161 fma  1   '1E+13' '-1'    -> '9999999999999'\r
+fmax36162 fma  1   '1E+13'  '1.11' -> '10000000000001.11'\r
+fmax36163 fma  1   '1.11'  '1E+13' -> '10000000000001.11'\r
+fmax36164 fma  1   '-1'    '1E+13' -> '9999999999999'\r
+fmax36165 fma  1   '7E+13' '-1'    -> '69999999999999'\r
+fmax36166 fma  1   '7E+13'  '1.11' -> '70000000000001.11'\r
+fmax36167 fma  1   '1.11'  '7E+13' -> '70000000000001.11'\r
+fmax36168 fma  1   '-1'    '7E+13' -> '69999999999999'\r
+\r
+--                    1234567890123456      1234567890123456      1 234567890123456\r
+fmax36170 fma  1   '0.4444444444444444'  '0.5555555555555563' -> '1.000000000000001' Inexact Rounded\r
+fmax36171 fma  1   '0.4444444444444444'  '0.5555555555555562' -> '1.000000000000001' Inexact Rounded\r
+fmax36172 fma  1   '0.4444444444444444'  '0.5555555555555561' -> '1.000000000000000' Inexact Rounded\r
+fmax36173 fma  1   '0.4444444444444444'  '0.5555555555555560' -> '1.000000000000000' Inexact Rounded\r
+fmax36174 fma  1   '0.4444444444444444'  '0.5555555555555559' -> '1.000000000000000' Inexact Rounded\r
+fmax36175 fma  1   '0.4444444444444444'  '0.5555555555555558' -> '1.000000000000000' Inexact Rounded\r
+fmax36176 fma  1   '0.4444444444444444'  '0.5555555555555557' -> '1.000000000000000' Inexact Rounded\r
+fmax36177 fma  1   '0.4444444444444444'  '0.5555555555555556' -> '1.000000000000000' Rounded\r
+fmax36178 fma  1   '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'\r
+fmax36179 fma  1   '0.4444444444444444'  '0.5555555555555554' -> '0.9999999999999998'\r
+fmax36180 fma  1   '0.4444444444444444'  '0.5555555555555553' -> '0.9999999999999997'\r
+fmax36181 fma  1   '0.4444444444444444'  '0.5555555555555552' -> '0.9999999999999996'\r
+fmax36182 fma  1   '0.4444444444444444'  '0.5555555555555551' -> '0.9999999999999995'\r
+fmax36183 fma  1   '0.4444444444444444'  '0.5555555555555550' -> '0.9999999999999994'\r
+\r
+-- and some more, including residue effects and different roundings\r
+rounding: half_up\r
+fmax36200 fma  1   '6543210123456789' 0             -> '6543210123456789'\r
+fmax36201 fma  1   '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+fmax36202 fma  1   '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+fmax36203 fma  1   '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+fmax36204 fma  1   '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+fmax36205 fma  1   '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+fmax36206 fma  1   '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+fmax36207 fma  1   '6543210123456789' 0.499999   -> '6543210123456789' Inexact Rounded\r
+fmax36208 fma  1   '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+fmax36209 fma  1   '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+fmax36210 fma  1   '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+fmax36211 fma  1   '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+fmax36212 fma  1   '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+fmax36213 fma  1   '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+fmax36214 fma  1   '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+fmax36215 fma  1   '6543210123456789' 0.999999   -> '6543210123456790' Inexact Rounded\r
+fmax36216 fma  1   '6543210123456789' 1             -> '6543210123456790'\r
+fmax36217 fma  1   '6543210123456789' 1.000000001   -> '6543210123456790' Inexact Rounded\r
+fmax36218 fma  1   '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+fmax36219 fma  1   '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+rounding: half_even\r
+fmax36220 fma  1   '6543210123456789' 0             -> '6543210123456789'\r
+fmax36221 fma  1   '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+fmax36222 fma  1   '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+fmax36223 fma  1   '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+fmax36224 fma  1   '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+fmax36225 fma  1   '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+fmax36226 fma  1   '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+fmax36227 fma  1   '6543210123456789' 0.499999   -> '6543210123456789' Inexact Rounded\r
+fmax36228 fma  1   '6543210123456789' 0.5           -> '6543210123456790' Inexact Rounded\r
+fmax36229 fma  1   '6543210123456789' 0.500000001   -> '6543210123456790' Inexact Rounded\r
+fmax36230 fma  1   '6543210123456789' 0.500001      -> '6543210123456790' Inexact Rounded\r
+fmax36231 fma  1   '6543210123456789' 0.51          -> '6543210123456790' Inexact Rounded\r
+fmax36232 fma  1   '6543210123456789' 0.6           -> '6543210123456790' Inexact Rounded\r
+fmax36233 fma  1   '6543210123456789' 0.9           -> '6543210123456790' Inexact Rounded\r
+fmax36234 fma  1   '6543210123456789' 0.99999       -> '6543210123456790' Inexact Rounded\r
+fmax36235 fma  1   '6543210123456789' 0.999999   -> '6543210123456790' Inexact Rounded\r
+fmax36236 fma  1   '6543210123456789' 1             -> '6543210123456790'\r
+fmax36237 fma  1   '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+fmax36238 fma  1   '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+fmax36239 fma  1   '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+-- critical few with even bottom digit...\r
+fmax36240 fma  1   '6543210123456788' 0.499999   -> '6543210123456788' Inexact Rounded\r
+fmax36241 fma  1   '6543210123456788' 0.5           -> '6543210123456788' Inexact Rounded\r
+fmax36242 fma  1   '6543210123456788' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+\r
+rounding: down\r
+fmax36250 fma  1   '6543210123456789' 0             -> '6543210123456789'\r
+fmax36251 fma  1   '6543210123456789' 0.000000001   -> '6543210123456789' Inexact Rounded\r
+fmax36252 fma  1   '6543210123456789' 0.000001      -> '6543210123456789' Inexact Rounded\r
+fmax36253 fma  1   '6543210123456789' 0.1           -> '6543210123456789' Inexact Rounded\r
+fmax36254 fma  1   '6543210123456789' 0.4           -> '6543210123456789' Inexact Rounded\r
+fmax36255 fma  1   '6543210123456789' 0.49          -> '6543210123456789' Inexact Rounded\r
+fmax36256 fma  1   '6543210123456789' 0.499999      -> '6543210123456789' Inexact Rounded\r
+fmax36257 fma  1   '6543210123456789' 0.499999   -> '6543210123456789' Inexact Rounded\r
+fmax36258 fma  1   '6543210123456789' 0.5           -> '6543210123456789' Inexact Rounded\r
+fmax36259 fma  1   '6543210123456789' 0.500000001   -> '6543210123456789' Inexact Rounded\r
+fmax36260 fma  1   '6543210123456789' 0.500001      -> '6543210123456789' Inexact Rounded\r
+fmax36261 fma  1   '6543210123456789' 0.51          -> '6543210123456789' Inexact Rounded\r
+fmax36262 fma  1   '6543210123456789' 0.6           -> '6543210123456789' Inexact Rounded\r
+fmax36263 fma  1   '6543210123456789' 0.9           -> '6543210123456789' Inexact Rounded\r
+fmax36264 fma  1   '6543210123456789' 0.99999       -> '6543210123456789' Inexact Rounded\r
+fmax36265 fma  1   '6543210123456789' 0.999999   -> '6543210123456789' Inexact Rounded\r
+fmax36266 fma  1   '6543210123456789' 1             -> '6543210123456790'\r
+fmax36267 fma  1   '6543210123456789' 1.00000001    -> '6543210123456790' Inexact Rounded\r
+fmax36268 fma  1   '6543210123456789' 1.00001       -> '6543210123456790' Inexact Rounded\r
+fmax36269 fma  1   '6543210123456789' 1.1           -> '6543210123456790' Inexact Rounded\r
+\r
+-- 1 in last place tests\r
+rounding: half_even\r
+fmax36301 fma  1    -1   1      ->   0\r
+fmax36302 fma  1     0   1      ->   1\r
+fmax36303 fma  1     1   1      ->   2\r
+fmax36304 fma  1    12   1      ->  13\r
+fmax36305 fma  1    98   1      ->  99\r
+fmax36306 fma  1    99   1      -> 100\r
+fmax36307 fma  1   100   1      -> 101\r
+fmax36308 fma  1   101   1      -> 102\r
+fmax36309 fma  1    -1  -1      ->  -2\r
+fmax36310 fma  1     0  -1      ->  -1\r
+fmax36311 fma  1     1  -1      ->   0\r
+fmax36312 fma  1    12  -1      ->  11\r
+fmax36313 fma  1    98  -1      ->  97\r
+fmax36314 fma  1    99  -1      ->  98\r
+fmax36315 fma  1   100  -1      ->  99\r
+fmax36316 fma  1   101  -1      -> 100\r
+\r
+fmax36321 fma  1   -0.01  0.01    ->  0.00\r
+fmax36322 fma  1    0.00  0.01    ->  0.01\r
+fmax36323 fma  1    0.01  0.01    ->  0.02\r
+fmax36324 fma  1    0.12  0.01    ->  0.13\r
+fmax36325 fma  1    0.98  0.01    ->  0.99\r
+fmax36326 fma  1    0.99  0.01    ->  1.00\r
+fmax36327 fma  1    1.00  0.01    ->  1.01\r
+fmax36328 fma  1    1.01  0.01    ->  1.02\r
+fmax36329 fma  1   -0.01 -0.01    -> -0.02\r
+fmax36330 fma  1    0.00 -0.01    -> -0.01\r
+fmax36331 fma  1    0.01 -0.01    ->  0.00\r
+fmax36332 fma  1    0.12 -0.01    ->  0.11\r
+fmax36333 fma  1    0.98 -0.01    ->  0.97\r
+fmax36334 fma  1    0.99 -0.01    ->  0.98\r
+fmax36335 fma  1    1.00 -0.01    ->  0.99\r
+fmax36336 fma  1    1.01 -0.01    ->  1.00\r
+\r
+-- some more cases where fma  1  ing 0 affects the coefficient\r
+fmax36340 fma  1   1E+3    0    ->         1000\r
+fmax36341 fma  1   1E+15   0    ->    1000000000000000\r
+fmax36342 fma  1   1E+16   0    ->   1.000000000000000E+16  Rounded\r
+fmax36343 fma  1   1E+17   0    ->   1.000000000000000E+17  Rounded\r
+-- which simply follow from these cases ...\r
+fmax36344 fma  1   1E+3    1    ->         1001\r
+fmax36345 fma  1   1E+15   1    ->    1000000000000001\r
+fmax36346 fma  1   1E+16   1    ->   1.000000000000000E+16  Inexact Rounded\r
+fmax36347 fma  1   1E+17   1    ->   1.000000000000000E+17  Inexact Rounded\r
+fmax36348 fma  1   1E+3    7    ->         1007\r
+fmax36349 fma  1   1E+15   7    ->    1000000000000007\r
+fmax36350 fma  1   1E+16   7    ->   1.000000000000001E+16  Inexact Rounded\r
+fmax36351 fma  1   1E+17   7    ->   1.000000000000000E+17  Inexact Rounded\r
+\r
+-- tryzeros cases\r
+fmax36361  fma  1   0E+50 10000E+1  -> 1.0000E+5\r
+fmax36362  fma  1   10000E+1 0E-50  -> 100000.0000000000  Rounded\r
+fmax36363  fma  1   10000E+1 10000E-50  -> 100000.0000000000  Rounded Inexact\r
+fmax36364  fma  1   12.34    0e-398  -> 12.34000000000000  Rounded\r
+\r
+-- ulp replacement tests\r
+fmax36400 fma  1     1   77e-14      ->  1.00000000000077\r
+fmax36401 fma  1     1   77e-15      ->  1.000000000000077\r
+fmax36402 fma  1     1   77e-16      ->  1.000000000000008 Inexact Rounded\r
+fmax36403 fma  1     1   77e-17      ->  1.000000000000001 Inexact Rounded\r
+fmax36404 fma  1     1   77e-18      ->  1.000000000000000 Inexact Rounded\r
+fmax36405 fma  1     1   77e-19      ->  1.000000000000000 Inexact Rounded\r
+fmax36406 fma  1     1   77e-99      ->  1.000000000000000 Inexact Rounded\r
+\r
+fmax36410 fma  1    10   77e-14      ->  10.00000000000077\r
+fmax36411 fma  1    10   77e-15      ->  10.00000000000008 Inexact Rounded\r
+fmax36412 fma  1    10   77e-16      ->  10.00000000000001 Inexact Rounded\r
+fmax36413 fma  1    10   77e-17      ->  10.00000000000000 Inexact Rounded\r
+fmax36414 fma  1    10   77e-18      ->  10.00000000000000 Inexact Rounded\r
+fmax36415 fma  1    10   77e-19      ->  10.00000000000000 Inexact Rounded\r
+fmax36416 fma  1    10   77e-99      ->  10.00000000000000 Inexact Rounded\r
+\r
+fmax36420 fma  1    77e-14       1   ->  1.00000000000077\r
+fmax36421 fma  1    77e-15       1   ->  1.000000000000077\r
+fmax36422 fma  1    77e-16       1   ->  1.000000000000008 Inexact Rounded\r
+fmax36423 fma  1    77e-17       1   ->  1.000000000000001 Inexact Rounded\r
+fmax36424 fma  1    77e-18       1   ->  1.000000000000000 Inexact Rounded\r
+fmax36425 fma  1    77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+fmax36426 fma  1    77e-99       1   ->  1.000000000000000 Inexact Rounded\r
+\r
+fmax36430 fma  1    77e-14      10   ->  10.00000000000077\r
+fmax36431 fma  1    77e-15      10   ->  10.00000000000008 Inexact Rounded\r
+fmax36432 fma  1    77e-16      10   ->  10.00000000000001 Inexact Rounded\r
+fmax36433 fma  1    77e-17      10   ->  10.00000000000000 Inexact Rounded\r
+fmax36434 fma  1    77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+fmax36435 fma  1    77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+fmax36436 fma  1    77e-99      10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+fmax36440 fma  1     1   -77e-14      ->  0.99999999999923\r
+fmax36441 fma  1     1   -77e-15      ->  0.999999999999923\r
+fmax36442 fma  1     1   -77e-16      ->  0.9999999999999923\r
+fmax36443 fma  1     1   -77e-17      ->  0.9999999999999992 Inexact Rounded\r
+fmax36444 fma  1     1   -77e-18      ->  0.9999999999999999 Inexact Rounded\r
+fmax36445 fma  1     1   -77e-19      ->  1.000000000000000 Inexact Rounded\r
+fmax36446 fma  1     1   -77e-99      ->  1.000000000000000 Inexact Rounded\r
+\r
+fmax36450 fma  1    10   -77e-14      ->   9.99999999999923\r
+fmax36451 fma  1    10   -77e-15      ->   9.999999999999923\r
+fmax36452 fma  1    10   -77e-16      ->   9.999999999999992 Inexact Rounded\r
+fmax36453 fma  1    10   -77e-17      ->   9.999999999999999 Inexact Rounded\r
+fmax36454 fma  1    10   -77e-18      ->  10.00000000000000 Inexact Rounded\r
+fmax36455 fma  1    10   -77e-19      ->  10.00000000000000 Inexact Rounded\r
+fmax36456 fma  1    10   -77e-99      ->  10.00000000000000 Inexact Rounded\r
+\r
+fmax36460 fma  1    -77e-14       1   ->  0.99999999999923\r
+fmax36461 fma  1    -77e-15       1   ->  0.999999999999923\r
+fmax36462 fma  1    -77e-16       1   ->  0.9999999999999923\r
+fmax36463 fma  1    -77e-17       1   ->  0.9999999999999992 Inexact Rounded\r
+fmax36464 fma  1    -77e-18       1   ->  0.9999999999999999 Inexact Rounded\r
+fmax36465 fma  1    -77e-19       1   ->  1.000000000000000 Inexact Rounded\r
+fmax36466 fma  1    -77e-99       1   ->  1.000000000000000 Inexact Rounded\r
+\r
+fmax36470 fma  1    -77e-14      10   ->   9.99999999999923\r
+fmax36471 fma  1    -77e-15      10   ->   9.999999999999923\r
+fmax36472 fma  1    -77e-16      10   ->   9.999999999999992 Inexact Rounded\r
+fmax36473 fma  1    -77e-17      10   ->   9.999999999999999 Inexact Rounded\r
+fmax36474 fma  1    -77e-18      10   ->  10.00000000000000 Inexact Rounded\r
+fmax36475 fma  1    -77e-19      10   ->  10.00000000000000 Inexact Rounded\r
+fmax36476 fma  1    -77e-99      10   ->  10.00000000000000 Inexact Rounded\r
+\r
+-- negative ulps\r
+fmax36480 fma  1    -1    77e-14      ->  -0.99999999999923\r
+fmax36481 fma  1    -1    77e-15      ->  -0.999999999999923\r
+fmax36482 fma  1    -1    77e-16      ->  -0.9999999999999923\r
+fmax36483 fma  1    -1    77e-17      ->  -0.9999999999999992 Inexact Rounded\r
+fmax36484 fma  1    -1    77e-18      ->  -0.9999999999999999 Inexact Rounded\r
+fmax36485 fma  1    -1    77e-19      ->  -1.000000000000000 Inexact Rounded\r
+fmax36486 fma  1    -1    77e-99      ->  -1.000000000000000 Inexact Rounded\r
+\r
+fmax36490 fma  1   -10    77e-14      ->   -9.99999999999923\r
+fmax36491 fma  1   -10    77e-15      ->   -9.999999999999923\r
+fmax36492 fma  1   -10    77e-16      ->   -9.999999999999992 Inexact Rounded\r
+fmax36493 fma  1   -10    77e-17      ->   -9.999999999999999 Inexact Rounded\r
+fmax36494 fma  1   -10    77e-18      ->  -10.00000000000000 Inexact Rounded\r
+fmax36495 fma  1   -10    77e-19      ->  -10.00000000000000 Inexact Rounded\r
+fmax36496 fma  1   -10    77e-99      ->  -10.00000000000000 Inexact Rounded\r
+\r
+fmax36500 fma  1     77e-14      -1   ->  -0.99999999999923\r
+fmax36501 fma  1     77e-15      -1   ->  -0.999999999999923\r
+fmax36502 fma  1     77e-16      -1   ->  -0.9999999999999923\r
+fmax36503 fma  1     77e-17      -1   ->  -0.9999999999999992 Inexact Rounded\r
+fmax36504 fma  1     77e-18      -1   ->  -0.9999999999999999 Inexact Rounded\r
+fmax36505 fma  1     77e-19      -1   ->  -1.000000000000000 Inexact Rounded\r
+fmax36506 fma  1     77e-99      -1   ->  -1.000000000000000 Inexact Rounded\r
+\r
+fmax36510 fma  1     77e-14      -10  ->   -9.99999999999923\r
+fmax36511 fma  1     77e-15      -10  ->   -9.999999999999923\r
+fmax36512 fma  1     77e-16      -10  ->   -9.999999999999992 Inexact Rounded\r
+fmax36513 fma  1     77e-17      -10  ->   -9.999999999999999 Inexact Rounded\r
+fmax36514 fma  1     77e-18      -10  ->  -10.00000000000000 Inexact Rounded\r
+fmax36515 fma  1     77e-19      -10  ->  -10.00000000000000 Inexact Rounded\r
+fmax36516 fma  1     77e-99      -10  ->  -10.00000000000000 Inexact Rounded\r
+\r
+\r
+-- long operands\r
+fmax36521 fma  1   101234562345678000 0 -> 1.012345623456780E+17 Rounded\r
+fmax36522 fma  1   0 101234562345678000 -> 1.012345623456780E+17 Rounded\r
+fmax36523 fma  1   10123456234567800  0 -> 1.012345623456780E+16 Rounded\r
+fmax36524 fma  1   0 10123456234567800  -> 1.012345623456780E+16 Rounded\r
+fmax36525 fma  1   10123456234567890  0 -> 1.012345623456789E+16 Rounded\r
+fmax36526 fma  1   0 10123456234567890  -> 1.012345623456789E+16 Rounded\r
+fmax36527 fma  1   10123456234567891  0 -> 1.012345623456789E+16 Inexact Rounded\r
+fmax36528 fma  1   0 10123456234567891  -> 1.012345623456789E+16 Inexact Rounded\r
+fmax36529 fma  1   101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded\r
+fmax36530 fma  1   0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded\r
+fmax36531 fma  1   10123456234567896  0 -> 1.012345623456790E+16 Inexact Rounded\r
+fmax36532 fma  1   0 10123456234567896  -> 1.012345623456790E+16 Inexact Rounded\r
+\r
+-- verify a query\r
+rounding:     down\r
+fmax36561 fma  1   1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded\r
+fmax36562 fma  1        0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded\r
+-- and using decimal64 bounds...\r
+rounding:     down\r
+fmax36563 fma  1   1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded\r
+fmax36564 fma  1        0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded\r
+\r
+-- more zeros, etc.\r
+rounding: half_even\r
+\r
+fmax36701 fma  1   5.00 1.00E-3 -> 5.00100\r
+fmax36702 fma  1   00.00 0.000  -> 0.000\r
+fmax36703 fma  1   00.00 0E-3   -> 0.000\r
+fmax36704 fma  1   0E-3  00.00  -> 0.000\r
+\r
+fmax36710 fma  1   0E+3  00.00  -> 0.00\r
+fmax36711 fma  1   0E+3  00.0   -> 0.0\r
+fmax36712 fma  1   0E+3  00.    -> 0\r
+fmax36713 fma  1   0E+3  00.E+1 -> 0E+1\r
+fmax36714 fma  1   0E+3  00.E+2 -> 0E+2\r
+fmax36715 fma  1   0E+3  00.E+3 -> 0E+3\r
+fmax36716 fma  1   0E+3  00.E+4 -> 0E+3\r
+fmax36717 fma  1   0E+3  00.E+5 -> 0E+3\r
+fmax36718 fma  1   0E+3  -00.0   -> 0.0\r
+fmax36719 fma  1   0E+3  -00.    -> 0\r
+fmax36731 fma  1   0E+3  -00.E+1 -> 0E+1\r
+\r
+fmax36720 fma  1   00.00  0E+3  -> 0.00\r
+fmax36721 fma  1   00.0   0E+3  -> 0.0\r
+fmax36722 fma  1   00.    0E+3  -> 0\r
+fmax36723 fma  1   00.E+1 0E+3  -> 0E+1\r
+fmax36724 fma  1   00.E+2 0E+3  -> 0E+2\r
+fmax36725 fma  1   00.E+3 0E+3  -> 0E+3\r
+fmax36726 fma  1   00.E+4 0E+3  -> 0E+3\r
+fmax36727 fma  1   00.E+5 0E+3  -> 0E+3\r
+fmax36728 fma  1   -00.00 0E+3  -> 0.00\r
+fmax36729 fma  1   -00.0  0E+3  -> 0.0\r
+fmax36730 fma  1   -00.   0E+3  -> 0\r
+\r
+fmax36732 fma  1    0     0     ->  0\r
+fmax36733 fma  1    0    -0     ->  0\r
+fmax36734 fma  1   -0     0     ->  0\r
+fmax36735 fma  1   -0    -0     -> -0     -- IEEE 854 special case\r
+\r
+fmax36736 fma  1    1    -1     ->  0\r
+fmax36737 fma  1   -1    -1     -> -2\r
+fmax36738 fma  1    1     1     ->  2\r
+fmax36739 fma  1   -1     1     ->  0\r
+\r
+fmax36741 fma  1    0    -1     -> -1\r
+fmax36742 fma  1   -0    -1     -> -1\r
+fmax36743 fma  1    0     1     ->  1\r
+fmax36744 fma  1   -0     1     ->  1\r
+fmax36745 fma  1   -1     0     -> -1\r
+fmax36746 fma  1   -1    -0     -> -1\r
+fmax36747 fma  1    1     0     ->  1\r
+fmax36748 fma  1    1    -0     ->  1\r
+\r
+fmax36751 fma  1    0.0  -1     -> -1.0\r
+fmax36752 fma  1   -0.0  -1     -> -1.0\r
+fmax36753 fma  1    0.0   1     ->  1.0\r
+fmax36754 fma  1   -0.0   1     ->  1.0\r
+fmax36755 fma  1   -1.0   0     -> -1.0\r
+fmax36756 fma  1   -1.0  -0     -> -1.0\r
+fmax36757 fma  1    1.0   0     ->  1.0\r
+fmax36758 fma  1    1.0  -0     ->  1.0\r
+\r
+fmax36761 fma  1    0    -1.0   -> -1.0\r
+fmax36762 fma  1   -0    -1.0   -> -1.0\r
+fmax36763 fma  1    0     1.0   ->  1.0\r
+fmax36764 fma  1   -0     1.0   ->  1.0\r
+fmax36765 fma  1   -1     0.0   -> -1.0\r
+fmax36766 fma  1   -1    -0.0   -> -1.0\r
+fmax36767 fma  1    1     0.0   ->  1.0\r
+fmax36768 fma  1    1    -0.0   ->  1.0\r
+\r
+fmax36771 fma  1    0.0  -1.0   -> -1.0\r
+fmax36772 fma  1   -0.0  -1.0   -> -1.0\r
+fmax36773 fma  1    0.0   1.0   ->  1.0\r
+fmax36774 fma  1   -0.0   1.0   ->  1.0\r
+fmax36775 fma  1   -1.0   0.0   -> -1.0\r
+fmax36776 fma  1   -1.0  -0.0   -> -1.0\r
+fmax36777 fma  1    1.0   0.0   ->  1.0\r
+fmax36778 fma  1    1.0  -0.0   ->  1.0\r
+\r
+-- Specials\r
+fmax36780 fma  1   -Inf  -Inf   -> -Infinity\r
+fmax36781 fma  1   -Inf  -1000  -> -Infinity\r
+fmax36782 fma  1   -Inf  -1     -> -Infinity\r
+fmax36783 fma  1   -Inf  -0     -> -Infinity\r
+fmax36784 fma  1   -Inf   0     -> -Infinity\r
+fmax36785 fma  1   -Inf   1     -> -Infinity\r
+fmax36786 fma  1   -Inf   1000  -> -Infinity\r
+fmax36787 fma  1   -1000 -Inf   -> -Infinity\r
+fmax36788 fma  1   -Inf  -Inf   -> -Infinity\r
+fmax36789 fma  1   -1    -Inf   -> -Infinity\r
+fmax36790 fma  1   -0    -Inf   -> -Infinity\r
+fmax36791 fma  1    0    -Inf   -> -Infinity\r
+fmax36792 fma  1    1    -Inf   -> -Infinity\r
+fmax36793 fma  1    1000 -Inf   -> -Infinity\r
+fmax36794 fma  1    Inf  -Inf   ->  NaN  Invalid_operation\r
+\r
+fmax36800 fma  1    Inf  -Inf   ->  NaN  Invalid_operation\r
+fmax36801 fma  1    Inf  -1000  ->  Infinity\r
+fmax36802 fma  1    Inf  -1     ->  Infinity\r
+fmax36803 fma  1    Inf  -0     ->  Infinity\r
+fmax36804 fma  1    Inf   0     ->  Infinity\r
+fmax36805 fma  1    Inf   1     ->  Infinity\r
+fmax36806 fma  1    Inf   1000  ->  Infinity\r
+fmax36807 fma  1    Inf   Inf   ->  Infinity\r
+fmax36808 fma  1   -1000  Inf   ->  Infinity\r
+fmax36809 fma  1   -Inf   Inf   ->  NaN  Invalid_operation\r
+fmax36810 fma  1   -1     Inf   ->  Infinity\r
+fmax36811 fma  1   -0     Inf   ->  Infinity\r
+fmax36812 fma  1    0     Inf   ->  Infinity\r
+fmax36813 fma  1    1     Inf   ->  Infinity\r
+fmax36814 fma  1    1000  Inf   ->  Infinity\r
+fmax36815 fma  1    Inf   Inf   ->  Infinity\r
+\r
+fmax36821 fma  1    NaN -Inf    ->  NaN\r
+fmax36822 fma  1    NaN -1000   ->  NaN\r
+fmax36823 fma  1    NaN -1      ->  NaN\r
+fmax36824 fma  1    NaN -0      ->  NaN\r
+fmax36825 fma  1    NaN  0      ->  NaN\r
+fmax36826 fma  1    NaN  1      ->  NaN\r
+fmax36827 fma  1    NaN  1000   ->  NaN\r
+fmax36828 fma  1    NaN  Inf    ->  NaN\r
+fmax36829 fma  1    NaN  NaN    ->  NaN\r
+fmax36830 fma  1   -Inf  NaN    ->  NaN\r
+fmax36831 fma  1   -1000 NaN    ->  NaN\r
+fmax36832 fma  1   -1    NaN    ->  NaN\r
+fmax36833 fma  1   -0    NaN    ->  NaN\r
+fmax36834 fma  1    0    NaN    ->  NaN\r
+fmax36835 fma  1    1    NaN    ->  NaN\r
+fmax36836 fma  1    1000 NaN    ->  NaN\r
+fmax36837 fma  1    Inf  NaN    ->  NaN\r
+\r
+fmax36841 fma  1    sNaN -Inf   ->  NaN  Invalid_operation\r
+fmax36842 fma  1    sNaN -1000  ->  NaN  Invalid_operation\r
+fmax36843 fma  1    sNaN -1     ->  NaN  Invalid_operation\r
+fmax36844 fma  1    sNaN -0     ->  NaN  Invalid_operation\r
+fmax36845 fma  1    sNaN  0     ->  NaN  Invalid_operation\r
+fmax36846 fma  1    sNaN  1     ->  NaN  Invalid_operation\r
+fmax36847 fma  1    sNaN  1000  ->  NaN  Invalid_operation\r
+fmax36848 fma  1    sNaN  NaN   ->  NaN  Invalid_operation\r
+fmax36849 fma  1    sNaN sNaN   ->  NaN  Invalid_operation\r
+fmax36850 fma  1    NaN  sNaN   ->  NaN  Invalid_operation\r
+fmax36851 fma  1   -Inf  sNaN   ->  NaN  Invalid_operation\r
+fmax36852 fma  1   -1000 sNaN   ->  NaN  Invalid_operation\r
+fmax36853 fma  1   -1    sNaN   ->  NaN  Invalid_operation\r
+fmax36854 fma  1   -0    sNaN   ->  NaN  Invalid_operation\r
+fmax36855 fma  1    0    sNaN   ->  NaN  Invalid_operation\r
+fmax36856 fma  1    1    sNaN   ->  NaN  Invalid_operation\r
+fmax36857 fma  1    1000 sNaN   ->  NaN  Invalid_operation\r
+fmax36858 fma  1    Inf  sNaN   ->  NaN  Invalid_operation\r
+fmax36859 fma  1    NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+fmax36861 fma  1    NaN1   -Inf    ->  NaN1\r
+fmax36862 fma  1   +NaN2   -1000   ->  NaN2\r
+fmax36863 fma  1    NaN3    1000   ->  NaN3\r
+fmax36864 fma  1    NaN4    Inf    ->  NaN4\r
+fmax36865 fma  1    NaN5   +NaN6   ->  NaN5\r
+fmax36866 fma  1   -Inf     NaN7   ->  NaN7\r
+fmax36867 fma  1   -1000    NaN8   ->  NaN8\r
+fmax36868 fma  1    1000    NaN9   ->  NaN9\r
+fmax36869 fma  1    Inf    +NaN10  ->  NaN10\r
+fmax36871 fma  1    sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+fmax36872 fma  1    sNaN12  -1000  ->  NaN12  Invalid_operation\r
+fmax36873 fma  1    sNaN13   1000  ->  NaN13  Invalid_operation\r
+fmax36874 fma  1    sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+fmax36875 fma  1    sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+fmax36876 fma  1    NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+fmax36877 fma  1   -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+fmax36878 fma  1   -1000    sNaN21 ->  NaN21  Invalid_operation\r
+fmax36879 fma  1    1000    sNaN22 ->  NaN22  Invalid_operation\r
+fmax36880 fma  1    Inf     sNaN23 ->  NaN23  Invalid_operation\r
+fmax36881 fma  1   +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+fmax36882 fma  1   -NaN26    NaN28 -> -NaN26\r
+fmax36883 fma  1   -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+fmax36884 fma  1    1000    -NaN30 -> -NaN30\r
+fmax36885 fma  1    1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- now the case where we can get underflow but the result is normal\r
+-- [note this can't happen if the operands are also bounded, as we\r
+-- cannot represent 1E-399, for example]\r
+\r
+fmax36571 fma  1         1E-383       0  -> 1E-383\r
+fmax36572 fma  1         1E-384       0  -> 1E-384   Subnormal\r
+fmax36573 fma  1         1E-383  1E-384  -> 1.1E-383\r
+fmax36574 subtract  1E-383  1E-384  ->   9E-384 Subnormal\r
+\r
+-- Here we explore the boundary of rounding a subnormal to Nmin\r
+fmax36575 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal\r
+fmax36576 subtract  1E-383  1E-398  ->   9.99999999999999E-384  Subnormal\r
+fmax36577 subtract  1E-383  1E-399  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax36578 subtract  1E-383  1E-400  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax36579 subtract  1E-383  1E-401  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+fmax36580 subtract  1E-383  1E-402  ->   1.000000000000000E-383 Underflow Inexact Subnormal Rounded\r
+\r
+-- check overflow edge case\r
+--               1234567890123456\r
+fmax36972 apply        9.999999999999999E+384         -> 9.999999999999999E+384\r
+fmax36973 fma  1       9.999999999999999E+384  1      -> 9.999999999999999E+384 Inexact Rounded\r
+fmax36974 fma  1        9999999999999999E+369  1      -> 9.999999999999999E+384 Inexact Rounded\r
+fmax36975 fma  1        9999999999999999E+369  1E+369  -> Infinity Overflow Inexact Rounded\r
+fmax36976 fma  1        9999999999999999E+369  9E+368  -> Infinity Overflow Inexact Rounded\r
+fmax36977 fma  1        9999999999999999E+369  8E+368  -> Infinity Overflow Inexact Rounded\r
+fmax36978 fma  1        9999999999999999E+369  7E+368  -> Infinity Overflow Inexact Rounded\r
+fmax36979 fma  1        9999999999999999E+369  6E+368  -> Infinity Overflow Inexact Rounded\r
+fmax36980 fma  1        9999999999999999E+369  5E+368  -> Infinity Overflow Inexact Rounded\r
+fmax36981 fma  1        9999999999999999E+369  4E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+fmax36982 fma  1        9999999999999999E+369  3E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+fmax36983 fma  1        9999999999999999E+369  2E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+fmax36984 fma  1        9999999999999999E+369  1E+368  -> 9.999999999999999E+384 Inexact Rounded\r
+\r
+fmax36985 apply       -9.999999999999999E+384         -> -9.999999999999999E+384\r
+fmax36986 fma  1      -9.999999999999999E+384 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+fmax36987 fma  1       -9999999999999999E+369 -1      -> -9.999999999999999E+384 Inexact Rounded\r
+fmax36988 fma  1       -9999999999999999E+369 -1E+369  -> -Infinity Overflow Inexact Rounded\r
+fmax36989 fma  1       -9999999999999999E+369 -9E+368  -> -Infinity Overflow Inexact Rounded\r
+fmax36990 fma  1       -9999999999999999E+369 -8E+368  -> -Infinity Overflow Inexact Rounded\r
+fmax36991 fma  1       -9999999999999999E+369 -7E+368  -> -Infinity Overflow Inexact Rounded\r
+fmax36992 fma  1       -9999999999999999E+369 -6E+368  -> -Infinity Overflow Inexact Rounded\r
+fmax36993 fma  1       -9999999999999999E+369 -5E+368  -> -Infinity Overflow Inexact Rounded\r
+fmax36994 fma  1       -9999999999999999E+369 -4E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+fmax36995 fma  1       -9999999999999999E+369 -3E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+fmax36996 fma  1       -9999999999999999E+369 -2E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+fmax36997 fma  1       -9999999999999999E+369 -1E+368  -> -9.999999999999999E+384 Inexact Rounded\r
+\r
+-- And for round down full and subnormal results\r
+rounding:     down\r
+fmax361100 fma  1   1e+2 -1e-383    -> 99.99999999999999 Rounded Inexact\r
+fmax361101 fma  1   1e+1 -1e-383    -> 9.999999999999999  Rounded Inexact\r
+fmax361103 fma  1     +1 -1e-383    -> 0.9999999999999999  Rounded Inexact\r
+fmax361104 fma  1   1e-1 -1e-383    -> 0.09999999999999999  Rounded Inexact\r
+fmax361105 fma  1   1e-2 -1e-383    -> 0.009999999999999999  Rounded Inexact\r
+fmax361106 fma  1   1e-3 -1e-383    -> 0.0009999999999999999  Rounded Inexact\r
+fmax361107 fma  1   1e-4 -1e-383    -> 0.00009999999999999999  Rounded Inexact\r
+fmax361108 fma  1   1e-5 -1e-383    -> 0.000009999999999999999  Rounded Inexact\r
+fmax361109 fma  1   1e-6 -1e-383    -> 9.999999999999999E-7  Rounded Inexact\r
+\r
+rounding:     ceiling\r
+fmax361110 fma  1   -1e+2 +1e-383   -> -99.99999999999999 Rounded Inexact\r
+fmax361111 fma  1   -1e+1 +1e-383   -> -9.999999999999999  Rounded Inexact\r
+fmax361113 fma  1      -1 +1e-383   -> -0.9999999999999999  Rounded Inexact\r
+fmax361114 fma  1   -1e-1 +1e-383   -> -0.09999999999999999  Rounded Inexact\r
+fmax361115 fma  1   -1e-2 +1e-383   -> -0.009999999999999999  Rounded Inexact\r
+fmax361116 fma  1   -1e-3 +1e-383   -> -0.0009999999999999999  Rounded Inexact\r
+fmax361117 fma  1   -1e-4 +1e-383   -> -0.00009999999999999999  Rounded Inexact\r
+fmax361118 fma  1   -1e-5 +1e-383   -> -0.000009999999999999999  Rounded Inexact\r
+fmax361119 fma  1   -1e-6 +1e-383   -> -9.999999999999999E-7  Rounded Inexact\r
+\r
+-- tests based on Gunnar Degnbol's edge case\r
+rounding:     half_even\r
+\r
+fmax361300 fma  1   1E16  -0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361310 fma  1   1E16  -0.51                ->  9999999999999999      Inexact Rounded\r
+fmax361311 fma  1   1E16  -0.501               ->  9999999999999999      Inexact Rounded\r
+fmax361312 fma  1   1E16  -0.5001              ->  9999999999999999      Inexact Rounded\r
+fmax361313 fma  1   1E16  -0.50001             ->  9999999999999999      Inexact Rounded\r
+fmax361314 fma  1   1E16  -0.500001            ->  9999999999999999      Inexact Rounded\r
+fmax361315 fma  1   1E16  -0.5000001           ->  9999999999999999      Inexact Rounded\r
+fmax361316 fma  1   1E16  -0.50000001          ->  9999999999999999      Inexact Rounded\r
+fmax361317 fma  1   1E16  -0.500000001         ->  9999999999999999      Inexact Rounded\r
+fmax361318 fma  1   1E16  -0.5000000001        ->  9999999999999999      Inexact Rounded\r
+fmax361319 fma  1   1E16  -0.50000000001       ->  9999999999999999      Inexact Rounded\r
+fmax361320 fma  1   1E16  -0.500000000001      ->  9999999999999999      Inexact Rounded\r
+fmax361321 fma  1   1E16  -0.5000000000001     ->  9999999999999999      Inexact Rounded\r
+fmax361322 fma  1   1E16  -0.50000000000001    ->  9999999999999999      Inexact Rounded\r
+fmax361323 fma  1   1E16  -0.500000000000001   ->  9999999999999999      Inexact Rounded\r
+fmax361324 fma  1   1E16  -0.5000000000000001  ->  9999999999999999      Inexact Rounded\r
+fmax361325 fma  1   1E16  -0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361326 fma  1   1E16  -0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361327 fma  1   1E16  -0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361328 fma  1   1E16  -0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361329 fma  1   1E16  -0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361330 fma  1   1E16  -0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361331 fma  1   1E16  -0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361332 fma  1   1E16  -0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361333 fma  1   1E16  -0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361334 fma  1   1E16  -0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361335 fma  1   1E16  -0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361336 fma  1   1E16  -0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361337 fma  1   1E16  -0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361338 fma  1   1E16  -0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361339 fma  1   1E16  -0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+fmax361340 fma  1   1E16  -5000000.000010001   ->  9999999995000000      Inexact Rounded\r
+fmax361341 fma  1   1E16  -5000000.000000001   ->  9999999995000000      Inexact Rounded\r
+\r
+fmax361349 fma  1   9999999999999999 0.4                 ->  9999999999999999      Inexact Rounded\r
+fmax361350 fma  1   9999999999999999 0.49                ->  9999999999999999      Inexact Rounded\r
+fmax361351 fma  1   9999999999999999 0.499               ->  9999999999999999      Inexact Rounded\r
+fmax361352 fma  1   9999999999999999 0.4999              ->  9999999999999999      Inexact Rounded\r
+fmax361353 fma  1   9999999999999999 0.49999             ->  9999999999999999      Inexact Rounded\r
+fmax361354 fma  1   9999999999999999 0.499999            ->  9999999999999999      Inexact Rounded\r
+fmax361355 fma  1   9999999999999999 0.4999999           ->  9999999999999999      Inexact Rounded\r
+fmax361356 fma  1   9999999999999999 0.49999999          ->  9999999999999999      Inexact Rounded\r
+fmax361357 fma  1   9999999999999999 0.499999999         ->  9999999999999999      Inexact Rounded\r
+fmax361358 fma  1   9999999999999999 0.4999999999        ->  9999999999999999      Inexact Rounded\r
+fmax361359 fma  1   9999999999999999 0.49999999999       ->  9999999999999999      Inexact Rounded\r
+fmax361360 fma  1   9999999999999999 0.499999999999      ->  9999999999999999      Inexact Rounded\r
+fmax361361 fma  1   9999999999999999 0.4999999999999     ->  9999999999999999      Inexact Rounded\r
+fmax361362 fma  1   9999999999999999 0.49999999999999    ->  9999999999999999      Inexact Rounded\r
+fmax361363 fma  1   9999999999999999 0.499999999999999   ->  9999999999999999      Inexact Rounded\r
+fmax361364 fma  1   9999999999999999 0.4999999999999999  ->  9999999999999999      Inexact Rounded\r
+fmax361365 fma  1   9999999999999999 0.5000000000000000  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361367 fma  1   9999999999999999 0.500000000000000   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361368 fma  1   9999999999999999 0.50000000000000    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361369 fma  1   9999999999999999 0.5000000000000     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361370 fma  1   9999999999999999 0.500000000000      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361371 fma  1   9999999999999999 0.50000000000       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361372 fma  1   9999999999999999 0.5000000000        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361373 fma  1   9999999999999999 0.500000000         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361374 fma  1   9999999999999999 0.50000000          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361375 fma  1   9999999999999999 0.5000000           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361376 fma  1   9999999999999999 0.500000            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361377 fma  1   9999999999999999 0.50000             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361378 fma  1   9999999999999999 0.5000              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361379 fma  1   9999999999999999 0.500               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361380 fma  1   9999999999999999 0.50                ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361381 fma  1   9999999999999999 0.5                 ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361382 fma  1   9999999999999999 0.5000000000000001  ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361383 fma  1   9999999999999999 0.500000000000001   ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361384 fma  1   9999999999999999 0.50000000000001    ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361385 fma  1   9999999999999999 0.5000000000001     ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361386 fma  1   9999999999999999 0.500000000001      ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361387 fma  1   9999999999999999 0.50000000001       ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361388 fma  1   9999999999999999 0.5000000001        ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361389 fma  1   9999999999999999 0.500000001         ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361390 fma  1   9999999999999999 0.50000001          ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361391 fma  1   9999999999999999 0.5000001           ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361392 fma  1   9999999999999999 0.500001            ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361393 fma  1   9999999999999999 0.50001             ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361394 fma  1   9999999999999999 0.5001              ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361395 fma  1   9999999999999999 0.501               ->  1.000000000000000E+16 Inexact Rounded\r
+fmax361396 fma  1   9999999999999999 0.51                ->  1.000000000000000E+16 Inexact Rounded\r
+\r
+-- More GD edge cases, where difference between the unadjusted\r
+-- exponents is larger than the maximum precision and one side is 0\r
+fmax361420 fma  1    0 1.123456789012345     -> 1.123456789012345\r
+fmax361421 fma  1    0 1.123456789012345E-1  -> 0.1123456789012345\r
+fmax361422 fma  1    0 1.123456789012345E-2  -> 0.01123456789012345\r
+fmax361423 fma  1    0 1.123456789012345E-3  -> 0.001123456789012345\r
+fmax361424 fma  1    0 1.123456789012345E-4  -> 0.0001123456789012345\r
+fmax361425 fma  1    0 1.123456789012345E-5  -> 0.00001123456789012345\r
+fmax361426 fma  1    0 1.123456789012345E-6  -> 0.000001123456789012345\r
+fmax361427 fma  1    0 1.123456789012345E-7  -> 1.123456789012345E-7\r
+fmax361428 fma  1    0 1.123456789012345E-8  -> 1.123456789012345E-8\r
+fmax361429 fma  1    0 1.123456789012345E-9  -> 1.123456789012345E-9\r
+fmax361430 fma  1    0 1.123456789012345E-10 -> 1.123456789012345E-10\r
+fmax361431 fma  1    0 1.123456789012345E-11 -> 1.123456789012345E-11\r
+fmax361432 fma  1    0 1.123456789012345E-12 -> 1.123456789012345E-12\r
+fmax361433 fma  1    0 1.123456789012345E-13 -> 1.123456789012345E-13\r
+fmax361434 fma  1    0 1.123456789012345E-14 -> 1.123456789012345E-14\r
+fmax361435 fma  1    0 1.123456789012345E-15 -> 1.123456789012345E-15\r
+fmax361436 fma  1    0 1.123456789012345E-16 -> 1.123456789012345E-16\r
+fmax361437 fma  1    0 1.123456789012345E-17 -> 1.123456789012345E-17\r
+fmax361438 fma  1    0 1.123456789012345E-18 -> 1.123456789012345E-18\r
+fmax361439 fma  1    0 1.123456789012345E-19 -> 1.123456789012345E-19\r
+\r
+-- same, reversed 0\r
+fmax361440 fma  1   1.123456789012345     0 -> 1.123456789012345\r
+fmax361441 fma  1   1.123456789012345E-1  0 -> 0.1123456789012345\r
+fmax361442 fma  1   1.123456789012345E-2  0 -> 0.01123456789012345\r
+fmax361443 fma  1   1.123456789012345E-3  0 -> 0.001123456789012345\r
+fmax361444 fma  1   1.123456789012345E-4  0 -> 0.0001123456789012345\r
+fmax361445 fma  1   1.123456789012345E-5  0 -> 0.00001123456789012345\r
+fmax361446 fma  1   1.123456789012345E-6  0 -> 0.000001123456789012345\r
+fmax361447 fma  1   1.123456789012345E-7  0 -> 1.123456789012345E-7\r
+fmax361448 fma  1   1.123456789012345E-8  0 -> 1.123456789012345E-8\r
+fmax361449 fma  1   1.123456789012345E-9  0 -> 1.123456789012345E-9\r
+fmax361450 fma  1   1.123456789012345E-10 0 -> 1.123456789012345E-10\r
+fmax361451 fma  1   1.123456789012345E-11 0 -> 1.123456789012345E-11\r
+fmax361452 fma  1   1.123456789012345E-12 0 -> 1.123456789012345E-12\r
+fmax361453 fma  1   1.123456789012345E-13 0 -> 1.123456789012345E-13\r
+fmax361454 fma  1   1.123456789012345E-14 0 -> 1.123456789012345E-14\r
+fmax361455 fma  1   1.123456789012345E-15 0 -> 1.123456789012345E-15\r
+fmax361456 fma  1   1.123456789012345E-16 0 -> 1.123456789012345E-16\r
+fmax361457 fma  1   1.123456789012345E-17 0 -> 1.123456789012345E-17\r
+fmax361458 fma  1   1.123456789012345E-18 0 -> 1.123456789012345E-18\r
+fmax361459 fma  1   1.123456789012345E-19 0 -> 1.123456789012345E-19\r
+\r
+-- same, Es on the 0\r
+fmax361460 fma  1   1.123456789012345  0E-0   -> 1.123456789012345\r
+fmax361461 fma  1   1.123456789012345  0E-1   -> 1.123456789012345\r
+fmax361462 fma  1   1.123456789012345  0E-2   -> 1.123456789012345\r
+fmax361463 fma  1   1.123456789012345  0E-3   -> 1.123456789012345\r
+fmax361464 fma  1   1.123456789012345  0E-4   -> 1.123456789012345\r
+fmax361465 fma  1   1.123456789012345  0E-5   -> 1.123456789012345\r
+fmax361466 fma  1   1.123456789012345  0E-6   -> 1.123456789012345\r
+fmax361467 fma  1   1.123456789012345  0E-7   -> 1.123456789012345\r
+fmax361468 fma  1   1.123456789012345  0E-8   -> 1.123456789012345\r
+fmax361469 fma  1   1.123456789012345  0E-9   -> 1.123456789012345\r
+fmax361470 fma  1   1.123456789012345  0E-10  -> 1.123456789012345\r
+fmax361471 fma  1   1.123456789012345  0E-11  -> 1.123456789012345\r
+fmax361472 fma  1   1.123456789012345  0E-12  -> 1.123456789012345\r
+fmax361473 fma  1   1.123456789012345  0E-13  -> 1.123456789012345\r
+fmax361474 fma  1   1.123456789012345  0E-14  -> 1.123456789012345\r
+fmax361475 fma  1   1.123456789012345  0E-15  -> 1.123456789012345\r
+-- next four flag Rounded because the 0 extends the result\r
+fmax361476 fma  1   1.123456789012345  0E-16  -> 1.123456789012345 Rounded\r
+fmax361477 fma  1   1.123456789012345  0E-17  -> 1.123456789012345 Rounded\r
+fmax361478 fma  1   1.123456789012345  0E-18  -> 1.123456789012345 Rounded\r
+fmax361479 fma  1   1.123456789012345  0E-19  -> 1.123456789012345 Rounded\r
+\r
+-- sum of two opposite-sign operands is exactly 0 and floor => -0\r
+rounding:    half_up\r
+-- exact zeros from zeros\r
+fmax361500 fma  1    0        0E-19  ->  0E-19\r
+fmax361501 fma  1   -0        0E-19  ->  0E-19\r
+fmax361502 fma  1    0       -0E-19  ->  0E-19\r
+fmax361503 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361504 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361505 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361506 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361507 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361511 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361512 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361513 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361514 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax361515 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361516 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361517 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361518 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    half_down\r
+-- exact zeros from zeros\r
+fmax361520 fma  1    0        0E-19  ->  0E-19\r
+fmax361521 fma  1   -0        0E-19  ->  0E-19\r
+fmax361522 fma  1    0       -0E-19  ->  0E-19\r
+fmax361523 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361524 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361525 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361526 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361527 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361531 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361532 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361533 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361534 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax361535 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361536 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361537 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361538 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    half_even\r
+-- exact zeros from zeros\r
+fmax361540 fma  1    0        0E-19  ->  0E-19\r
+fmax361541 fma  1   -0        0E-19  ->  0E-19\r
+fmax361542 fma  1    0       -0E-19  ->  0E-19\r
+fmax361543 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361544 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361545 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361546 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361547 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361551 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361552 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361553 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361554 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax361555 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361556 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361557 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361558 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    up\r
+-- exact zeros from zeros\r
+fmax361560 fma  1    0        0E-19  ->  0E-19\r
+fmax361561 fma  1   -0        0E-19  ->  0E-19\r
+fmax361562 fma  1    0       -0E-19  ->  0E-19\r
+fmax361563 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361564 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361565 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361566 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361567 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361571 fma  1    1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361572 fma  1   -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361573 fma  1    1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361574 fma  1   -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+-- some exact zeros from non-zeros\r
+fmax361575 fma  1    1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361576 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361577 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361578 fma  1   -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+\r
+rounding:    down\r
+-- exact zeros from zeros\r
+fmax361580 fma  1    0        0E-19  ->  0E-19\r
+fmax361581 fma  1   -0        0E-19  ->  0E-19\r
+fmax361582 fma  1    0       -0E-19  ->  0E-19\r
+fmax361583 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361584 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361585 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361586 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361587 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361591 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361592 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361593 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361594 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax361595 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361596 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361597 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361598 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+rounding:    ceiling\r
+-- exact zeros from zeros\r
+fmax361600 fma  1    0        0E-19  ->  0E-19\r
+fmax361601 fma  1   -0        0E-19  ->  0E-19\r
+fmax361602 fma  1    0       -0E-19  ->  0E-19\r
+fmax361603 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361604 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361605 fma  1   -0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361606 fma  1    0E-400  -0E-19  ->  0E-398 Clamped\r
+fmax361607 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361611 fma  1    1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361612 fma  1   -1E-401   1E-400 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361613 fma  1    1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361614 fma  1   -1E-401  -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+-- some exact zeros from non-zeros\r
+fmax361615 fma  1    1E-401   1E-401 ->  1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361616 fma  1   -1E-401   1E-401 ->  0E-398 Clamped\r
+fmax361617 fma  1    1E-401  -1E-401 ->  0E-398 Clamped\r
+fmax361618 fma  1   -1E-401  -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+\r
+-- and the extra-special ugly case; unusual minuses marked by -- *\r
+rounding:    floor\r
+-- exact zeros from zeros\r
+fmax361620 fma  1    0        0E-19  ->  0E-19\r
+fmax361621 fma  1   -0        0E-19  -> -0E-19           -- *\r
+fmax361622 fma  1    0       -0E-19  -> -0E-19           -- *\r
+fmax361623 fma  1   -0       -0E-19  -> -0E-19\r
+fmax361624 fma  1    0E-400   0E-19  ->  0E-398 Clamped\r
+fmax361625 fma  1   -0E-400   0E-19  -> -0E-398 Clamped  -- *\r
+fmax361626 fma  1    0E-400  -0E-19  -> -0E-398 Clamped  -- *\r
+fmax361627 fma  1   -0E-400  -0E-19  -> -0E-398 Clamped\r
+-- inexact zeros\r
+fmax361631 fma  1    1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361632 fma  1   -1E-401   1E-400 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361633 fma  1    1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+fmax361634 fma  1   -1E-401  -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+-- some exact zeros from non-zeros\r
+fmax361635 fma  1    1E-401   1E-401 ->  0E-398 Subnormal Inexact Rounded Underflow Clamped\r
+fmax361636 fma  1   -1E-401   1E-401 -> -0E-398 Clamped  -- *\r
+fmax361637 fma  1    1E-401  -1E-401 -> -0E-398 Clamped  -- *\r
+fmax361638 fma  1   -1E-401  -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow\r
+\r
+-- Examples from SQL proposal (Krishna Kulkarni)\r
+fmax361701 fma  1   130E-2    120E-2    -> 2.50\r
+fmax361702 fma  1   130E-2    12E-1     -> 2.50\r
+fmax361703 fma  1   130E-2    1E0       -> 2.30\r
+fmax361704 fma  1   1E2       1E4       -> 1.01E+4\r
+fmax361705 subtract 130E-2  120E-2 -> 0.10\r
+fmax361706 subtract 130E-2  12E-1  -> 0.10\r
+fmax361707 subtract 130E-2  1E0    -> 0.30\r
+fmax361708 subtract 1E2     1E4    -> -9.9E+3\r
+\r
+-- Gappy coefficients; check residue handling even with full coefficient gap\r
+rounding: half_even\r
+\r
+fmax362001 fma  1   1234567890123456 1      -> 1234567890123457\r
+fmax362002 fma  1   1234567890123456 0.6    -> 1234567890123457  Inexact Rounded\r
+fmax362003 fma  1   1234567890123456 0.06   -> 1234567890123456  Inexact Rounded\r
+fmax362004 fma  1   1234567890123456 6E-3   -> 1234567890123456  Inexact Rounded\r
+fmax362005 fma  1   1234567890123456 6E-4   -> 1234567890123456  Inexact Rounded\r
+fmax362006 fma  1   1234567890123456 6E-5   -> 1234567890123456  Inexact Rounded\r
+fmax362007 fma  1   1234567890123456 6E-6   -> 1234567890123456  Inexact Rounded\r
+fmax362008 fma  1   1234567890123456 6E-7   -> 1234567890123456  Inexact Rounded\r
+fmax362009 fma  1   1234567890123456 6E-8   -> 1234567890123456  Inexact Rounded\r
+fmax362010 fma  1   1234567890123456 6E-9   -> 1234567890123456  Inexact Rounded\r
+fmax362011 fma  1   1234567890123456 6E-10  -> 1234567890123456  Inexact Rounded\r
+fmax362012 fma  1   1234567890123456 6E-11  -> 1234567890123456  Inexact Rounded\r
+fmax362013 fma  1   1234567890123456 6E-12  -> 1234567890123456  Inexact Rounded\r
+fmax362014 fma  1   1234567890123456 6E-13  -> 1234567890123456  Inexact Rounded\r
+fmax362015 fma  1   1234567890123456 6E-14  -> 1234567890123456  Inexact Rounded\r
+fmax362016 fma  1   1234567890123456 6E-15  -> 1234567890123456  Inexact Rounded\r
+fmax362017 fma  1   1234567890123456 6E-16  -> 1234567890123456  Inexact Rounded\r
+fmax362018 fma  1   1234567890123456 6E-17  -> 1234567890123456  Inexact Rounded\r
+fmax362019 fma  1   1234567890123456 6E-18  -> 1234567890123456  Inexact Rounded\r
+fmax362020 fma  1   1234567890123456 6E-19  -> 1234567890123456  Inexact Rounded\r
+fmax362021 fma  1   1234567890123456 6E-20  -> 1234567890123456  Inexact Rounded\r
+\r
+-- widening second argument at gap\r
+fmax362030 fma  1   12345678 1                       -> 12345679\r
+fmax362031 fma  1   12345678 0.1                     -> 12345678.1\r
+fmax362032 fma  1   12345678 0.12                    -> 12345678.12\r
+fmax362033 fma  1   12345678 0.123                   -> 12345678.123\r
+fmax362034 fma  1   12345678 0.1234                  -> 12345678.1234\r
+fmax362035 fma  1   12345678 0.12345                 -> 12345678.12345\r
+fmax362036 fma  1   12345678 0.123456                -> 12345678.123456\r
+fmax362037 fma  1   12345678 0.1234567               -> 12345678.1234567\r
+fmax362038 fma  1   12345678 0.12345678              -> 12345678.12345678\r
+fmax362039 fma  1   12345678 0.123456789             -> 12345678.12345679 Inexact Rounded\r
+fmax362040 fma  1   12345678 0.123456785             -> 12345678.12345678 Inexact Rounded\r
+fmax362041 fma  1   12345678 0.1234567850            -> 12345678.12345678 Inexact Rounded\r
+fmax362042 fma  1   12345678 0.1234567851            -> 12345678.12345679 Inexact Rounded\r
+fmax362043 fma  1   12345678 0.12345678501           -> 12345678.12345679 Inexact Rounded\r
+fmax362044 fma  1   12345678 0.123456785001          -> 12345678.12345679 Inexact Rounded\r
+fmax362045 fma  1   12345678 0.1234567850001         -> 12345678.12345679 Inexact Rounded\r
+fmax362046 fma  1   12345678 0.12345678500001        -> 12345678.12345679 Inexact Rounded\r
+fmax362047 fma  1   12345678 0.123456785000001       -> 12345678.12345679 Inexact Rounded\r
+fmax362048 fma  1   12345678 0.1234567850000001      -> 12345678.12345679 Inexact Rounded\r
+fmax362049 fma  1   12345678 0.1234567850000000      -> 12345678.12345678 Inexact Rounded\r
+--                               90123456\r
+rounding: half_even\r
+fmax362050 fma  1   12345678 0.0234567750000000      -> 12345678.02345678 Inexact Rounded\r
+fmax362051 fma  1   12345678 0.0034567750000000      -> 12345678.00345678 Inexact Rounded\r
+fmax362052 fma  1   12345678 0.0004567750000000      -> 12345678.00045678 Inexact Rounded\r
+fmax362053 fma  1   12345678 0.0000567750000000      -> 12345678.00005678 Inexact Rounded\r
+fmax362054 fma  1   12345678 0.0000067750000000      -> 12345678.00000678 Inexact Rounded\r
+fmax362055 fma  1   12345678 0.0000007750000000      -> 12345678.00000078 Inexact Rounded\r
+fmax362056 fma  1   12345678 0.0000000750000000      -> 12345678.00000008 Inexact Rounded\r
+fmax362057 fma  1   12345678 0.0000000050000000      -> 12345678.00000000 Inexact Rounded\r
+fmax362060 fma  1   12345678 0.0234567750000001      -> 12345678.02345678 Inexact Rounded\r
+fmax362061 fma  1   12345678 0.0034567750000001      -> 12345678.00345678 Inexact Rounded\r
+fmax362062 fma  1   12345678 0.0004567750000001      -> 12345678.00045678 Inexact Rounded\r
+fmax362063 fma  1   12345678 0.0000567750000001      -> 12345678.00005678 Inexact Rounded\r
+fmax362064 fma  1   12345678 0.0000067750000001      -> 12345678.00000678 Inexact Rounded\r
+fmax362065 fma  1   12345678 0.0000007750000001      -> 12345678.00000078 Inexact Rounded\r
+fmax362066 fma  1   12345678 0.0000000750000001      -> 12345678.00000008 Inexact Rounded\r
+fmax362067 fma  1   12345678 0.0000000050000001      -> 12345678.00000001 Inexact Rounded\r
+-- far-out residues (full coefficient gap is 16+15 digits)\r
+rounding: up\r
+fmax362070 fma  1   12345678 1E-8                    -> 12345678.00000001\r
+fmax362071 fma  1   12345678 1E-9                    -> 12345678.00000001 Inexact Rounded\r
+fmax362072 fma  1   12345678 1E-10                   -> 12345678.00000001 Inexact Rounded\r
+fmax362073 fma  1   12345678 1E-11                   -> 12345678.00000001 Inexact Rounded\r
+fmax362074 fma  1   12345678 1E-12                   -> 12345678.00000001 Inexact Rounded\r
+fmax362075 fma  1   12345678 1E-13                   -> 12345678.00000001 Inexact Rounded\r
+fmax362076 fma  1   12345678 1E-14                   -> 12345678.00000001 Inexact Rounded\r
+fmax362077 fma  1   12345678 1E-15                   -> 12345678.00000001 Inexact Rounded\r
+fmax362078 fma  1   12345678 1E-16                   -> 12345678.00000001 Inexact Rounded\r
+fmax362079 fma  1   12345678 1E-17                   -> 12345678.00000001 Inexact Rounded\r
+fmax362080 fma  1   12345678 1E-18                   -> 12345678.00000001 Inexact Rounded\r
+fmax362081 fma  1   12345678 1E-19                   -> 12345678.00000001 Inexact Rounded\r
+fmax362082 fma  1   12345678 1E-20                   -> 12345678.00000001 Inexact Rounded\r
+fmax362083 fma  1   12345678 1E-25                   -> 12345678.00000001 Inexact Rounded\r
+fmax362084 fma  1   12345678 1E-30                   -> 12345678.00000001 Inexact Rounded\r
+fmax362085 fma  1   12345678 1E-31                   -> 12345678.00000001 Inexact Rounded\r
+fmax362086 fma  1   12345678 1E-32                   -> 12345678.00000001 Inexact Rounded\r
+fmax362087 fma  1   12345678 1E-33                   -> 12345678.00000001 Inexact Rounded\r
+fmax362088 fma  1   12345678 1E-34                   -> 12345678.00000001 Inexact Rounded\r
+fmax362089 fma  1   12345678 1E-35                   -> 12345678.00000001 Inexact Rounded\r
+\r
+-- payload decapitate x3\r
+precision: 5\r
+fmax363000 fma  1 1  sNaN1234567890     ->  NaN67890  Invalid_operation\r
+fmax363001 fma    1 -sNaN1234512345 1   -> -NaN12345  Invalid_operation\r
+fmax363002 fma       sNaN1234554321 1 1 ->  NaN54321  Invalid_operation\r
+\r
+-- Null tests\r
+fmax39990 fma  1   10  # -> NaN Invalid_operation\r
+fmax39991 fma  1    # 10 -> NaN Invalid_operation\r
index 3c435bd6b438ebeb7dff2c5bf7e1cd14e483a651..b61c85a67bf8e2c15b19fc2f860201aa1944a82c 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- inexact.decTest -- decimal inexact and rounded edge cases          --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
diff --git a/Lib/test/decimaltestdata/invert.decTest b/Lib/test/decimaltestdata/invert.decTest
new file mode 100644 (file)
index 0000000..19fdeeb
--- /dev/null
@@ -0,0 +1,176 @@
+------------------------------------------------------------------------\r
+-- invert.decTest -- digitwise logical INVERT                         --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check (truth table), and examples from decArith\r
+invx001 invert             0 -> 111111111\r
+invx002 invert             1 -> 111111110\r
+invx003 invert            10 -> 111111101\r
+invx004 invert     111111111 ->         0\r
+invx005 invert     000000000 -> 111111111\r
+invx006 invert     101010101 -> '10101010'\r
+-- and at msd and msd-1\r
+invx007 invert 000000000 ->   111111111\r
+invx009 invert 100000000 ->    11111111\r
+invx011 invert 000000000 ->   111111111\r
+invx013 invert 010000000 ->   101111111\r
+\r
+-- Various lengths\r
+--             123456789         123456789\r
+invx021 invert 111111111     ->  0\r
+invx022 invert 111111111111  ->  0\r
+invx023 invert  11111111     ->  100000000\r
+invx025 invert   1111111     ->  110000000\r
+invx026 invert    111111     ->  111000000\r
+invx027 invert     11111     ->  111100000\r
+invx028 invert      1111     ->  111110000\r
+invx029 invert       111     ->  111111000\r
+invx031 invert        11     ->  111111100\r
+invx032 invert         1     ->  111111110\r
+invx033 invert 111111111111  ->  0\r
+invx034 invert 11111111111   ->  0\r
+invx035 invert 1111111111    ->  0\r
+invx036 invert 111111111     ->  0\r
+\r
+invx080 invert 011111111   ->  100000000\r
+invx081 invert 101111111   ->   10000000\r
+invx082 invert 110111111   ->    1000000\r
+invx083 invert 111011111   ->     100000\r
+invx084 invert 111101111   ->      10000\r
+invx085 invert 111110111   ->       1000\r
+invx086 invert 111111011   ->        100\r
+invx087 invert 111111101   ->         10\r
+invx088 invert 111111110   ->          1\r
+invx089 invert 011111011   ->  100000100\r
+invx090 invert 101111101   ->   10000010\r
+invx091 invert 110111110   ->    1000001\r
+invx092 invert 111011101   ->     100010\r
+invx093 invert 111101011   ->      10100\r
+invx094 invert 111110111   ->       1000\r
+invx095 invert 111101011   ->      10100\r
+invx096 invert 111011101   ->     100010\r
+invx097 invert 110111110   ->    1000001\r
+invx098 invert 101111101   ->   10000010\r
+invx099 invert 011111011   ->  100000100\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+invx220 invert 111111112   ->  NaN Invalid_operation\r
+invx221 invert 333333333   ->  NaN Invalid_operation\r
+invx222 invert 555555555   ->  NaN Invalid_operation\r
+invx223 invert 777777777   ->  NaN Invalid_operation\r
+invx224 invert 999999999   ->  NaN Invalid_operation\r
+invx225 invert 222222222   ->  NaN Invalid_operation\r
+invx226 invert 444444444   ->  NaN Invalid_operation\r
+invx227 invert 666666666   ->  NaN Invalid_operation\r
+invx228 invert 888888888   ->  NaN Invalid_operation\r
+invx229 invert 999999999   ->  NaN Invalid_operation\r
+invx230 invert 999999999   ->  NaN Invalid_operation\r
+invx231 invert 999999999   ->  NaN Invalid_operation\r
+invx232 invert 999999999   ->  NaN Invalid_operation\r
+-- a few randoms\r
+invx240 invert  567468689  ->  NaN Invalid_operation\r
+invx241 invert  567367689  ->  NaN Invalid_operation\r
+invx242 invert -631917772  ->  NaN Invalid_operation\r
+invx243 invert -756253257  ->  NaN Invalid_operation\r
+invx244 invert  835590149  ->  NaN Invalid_operation\r
+-- test MSD\r
+invx250 invert  200000000  ->  NaN Invalid_operation\r
+invx251 invert  300000000  ->  NaN Invalid_operation\r
+invx252 invert  400000000  ->  NaN Invalid_operation\r
+invx253 invert  500000000  ->  NaN Invalid_operation\r
+invx254 invert  600000000  ->  NaN Invalid_operation\r
+invx255 invert  700000000  ->  NaN Invalid_operation\r
+invx256 invert  800000000  ->  NaN Invalid_operation\r
+invx257 invert  900000000  ->  NaN Invalid_operation\r
+-- test MSD-1\r
+invx270 invert  021000000  ->  NaN Invalid_operation\r
+invx271 invert  030100000  ->  NaN Invalid_operation\r
+invx272 invert  040010000  ->  NaN Invalid_operation\r
+invx273 invert  050001000  ->  NaN Invalid_operation\r
+invx274 invert  160000100  ->  NaN Invalid_operation\r
+invx275 invert  170000010  ->  NaN Invalid_operation\r
+invx276 invert  180000000  ->  NaN Invalid_operation\r
+invx277 invert  190000000  ->  NaN Invalid_operation\r
+-- test LSD\r
+invx280 invert  000000002  ->  NaN Invalid_operation\r
+invx281 invert  000000003  ->  NaN Invalid_operation\r
+invx282 invert  000000004  ->  NaN Invalid_operation\r
+invx283 invert  000000005  ->  NaN Invalid_operation\r
+invx284 invert  101000006  ->  NaN Invalid_operation\r
+invx285 invert  100100007  ->  NaN Invalid_operation\r
+invx286 invert  100010008  ->  NaN Invalid_operation\r
+invx287 invert  100001009  ->  NaN Invalid_operation\r
+-- test Middie\r
+invx288 invert  000020000  ->  NaN Invalid_operation\r
+invx289 invert  000030001  ->  NaN Invalid_operation\r
+invx290 invert  000040000  ->  NaN Invalid_operation\r
+invx291 invert  000050000  ->  NaN Invalid_operation\r
+invx292 invert  101060000  ->  NaN Invalid_operation\r
+invx293 invert  100170010  ->  NaN Invalid_operation\r
+invx294 invert  100080100  ->  NaN Invalid_operation\r
+invx295 invert  100091000  ->  NaN Invalid_operation\r
+-- signs\r
+invx296 invert -100001000  ->  NaN Invalid_operation\r
+invx299 invert  100001000  ->  11110111\r
+\r
+-- Nmax, Nmin, Ntiny\r
+invx341 invert  9.99999999E+999   -> NaN Invalid_operation\r
+invx342 invert  1E-999            -> NaN Invalid_operation\r
+invx343 invert  1.00000000E-999   -> NaN Invalid_operation\r
+invx344 invert  1E-1007           -> NaN Invalid_operation\r
+invx345 invert  -1E-1007          -> NaN Invalid_operation\r
+invx346 invert  -1.00000000E-999  -> NaN Invalid_operation\r
+invx347 invert  -1E-999           -> NaN Invalid_operation\r
+invx348 invert  -9.99999999E+999  -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+invx361 invert  1.0               -> NaN Invalid_operation\r
+invx362 invert  1E+1              -> NaN Invalid_operation\r
+invx363 invert  0.0               -> NaN Invalid_operation\r
+invx364 invert  0E+1              -> NaN Invalid_operation\r
+invx365 invert  9.9               -> NaN Invalid_operation\r
+invx366 invert  9E+1              -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+invx788 invert -Inf     -> NaN  Invalid_operation\r
+invx794 invert  Inf     -> NaN  Invalid_operation\r
+invx821 invert  NaN     -> NaN  Invalid_operation\r
+invx841 invert  sNaN    -> NaN  Invalid_operation\r
+-- propagating NaNs\r
+invx861 invert  NaN1    -> NaN Invalid_operation\r
+invx862 invert +NaN2    -> NaN Invalid_operation\r
+invx863 invert  NaN3    -> NaN Invalid_operation\r
+invx864 invert  NaN4    -> NaN Invalid_operation\r
+invx865 invert  NaN5    -> NaN Invalid_operation\r
+invx871 invert  sNaN11  -> NaN Invalid_operation\r
+invx872 invert  sNaN12  -> NaN Invalid_operation\r
+invx873 invert  sNaN13  -> NaN Invalid_operation\r
+invx874 invert  sNaN14  -> NaN Invalid_operation\r
+invx875 invert  sNaN15  -> NaN Invalid_operation\r
+invx876 invert  NaN16   -> NaN Invalid_operation\r
+invx881 invert +NaN25   -> NaN Invalid_operation\r
+invx882 invert -NaN26   -> NaN Invalid_operation\r
+invx883 invert -sNaN27  -> NaN Invalid_operation\r
diff --git a/Lib/test/decimaltestdata/ln.decTest b/Lib/test/decimaltestdata/ln.decTest
new file mode 100644 (file)
index 0000000..44ae4d2
--- /dev/null
@@ -0,0 +1,611 @@
+------------------------------------------------------------------------\r
+-- ln.decTest -- decimal natural logarithm                            --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   16\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- basics (examples in specification)\r
+precision: 9\r
+lnxs001 ln  0                 -> -Infinity\r
+lnxs002 ln  1.000             ->   0\r
+lnxs003 ln  2.71828183        ->   1.00000000         Inexact Rounded\r
+lnxs004 ln  10                ->   2.30258509         Inexact Rounded\r
+lnxs005 ln +Infinity          ->  Infinity\r
+\r
+\r
+-- basics\r
+precision:   16\r
+lnx0001 ln  0                 -> -Infinity\r
+lnx0002 ln  1E-9              -> -20.72326583694641   Inexact Rounded\r
+lnx0003 ln  0.0007            ->  -7.264430222920869  Inexact Rounded\r
+lnx0004 ln  0.1               ->  -2.302585092994046  Inexact Rounded\r
+lnx0005 ln  0.7               ->  -0.3566749439387324 Inexact Rounded\r
+lnx0006 ln  1                 ->   0\r
+lnx0007 ln  1.000             ->   0\r
+lnx0008 ln  1.5               ->   0.4054651081081644 Inexact Rounded\r
+lnx0009 ln  2                 ->   0.6931471805599453 Inexact Rounded\r
+lnx0010 ln  2.718281828459045 ->   0.9999999999999999 Inexact Rounded\r
+lnx0011 ln  2.718281828459046 ->   1.000000000000000  Inexact Rounded\r
+lnx0012 ln  2.718281828459047 ->   1.000000000000001  Inexact Rounded\r
+lnx0013 ln  10                ->   2.302585092994046  Inexact Rounded\r
+lnx0014 ln  10.5              ->   2.351375257163478  Inexact Rounded\r
+lnx0015 ln  9999              ->   9.210240366975849  Inexact Rounded\r
+lnx0016 ln  1E6               ->  13.81551055796427   Inexact Rounded\r
+lnx0017 ln  1E+9              ->  20.72326583694641   Inexact Rounded\r
+lnx0018 ln +Infinity          ->  Infinity\r
+\r
+-- notable cases\r
+-- negatives\r
+lnx0021 ln -1E-9              -> NaN Invalid_operation\r
+lnx0022 ln -0.0007            -> NaN Invalid_operation\r
+lnx0023 ln -0.1               -> NaN Invalid_operation\r
+lnx0024 ln -0.7               -> NaN Invalid_operation\r
+lnx0025 ln -1                 -> NaN Invalid_operation\r
+lnx0026 ln -1.5               -> NaN Invalid_operation\r
+lnx0027 ln -2                 -> NaN Invalid_operation\r
+lnx0029 ln -10.5              -> NaN Invalid_operation\r
+lnx0028 ln -9999              -> NaN Invalid_operation\r
+lnx0030 ln -2.718281828459045 -> NaN Invalid_operation\r
+lnx0031 ln -2.718281828459046 -> NaN Invalid_operation\r
+lnx0032 ln -0                 -> -Infinity\r
+lnx0033 ln -0E+17             -> -Infinity\r
+lnx0034 ln -0E-17             -> -Infinity\r
+-- other zeros\r
+lnx0041 ln  0                 -> -Infinity\r
+lnx0042 ln  0E+17             -> -Infinity\r
+lnx0043 ln  0E-17             -> -Infinity\r
+-- infinities\r
+lnx0045 ln -Infinity          -> NaN Invalid_operation\r
+lnx0046 ln +Infinity          -> Infinity\r
+-- ones\r
+lnx0050 ln  1                 ->   0\r
+lnx0051 ln  1.0               ->   0\r
+lnx0052 ln  1.000000000000000 ->   0\r
+lnx0053 ln  1.000000000000000000 ->   0\r
+\r
+-- lower precision basics\r
+Precision: 7\r
+lnx0101 ln  0                 -> -Infinity\r
+lnx0102 ln  1E-9              -> -20.72327            Inexact Rounded\r
+lnx0103 ln  0.0007            ->  -7.264430           Inexact Rounded\r
+lnx0104 ln  0.1               ->  -2.302585           Inexact Rounded\r
+lnx0105 ln  0.7               ->  -0.3566749          Inexact Rounded\r
+lnx0106 ln  1                 ->   0\r
+lnx0107 ln  1.5               ->   0.4054651          Inexact Rounded\r
+lnx0108 ln  2                 ->   0.6931472          Inexact Rounded\r
+lnx0109 ln  2.718281828459045 ->   1.000000           Inexact Rounded\r
+lnx0110 ln  2.718281828459046 ->   1.000000           Inexact Rounded\r
+lnx0111 ln  2.718281828459047 ->   1.000000           Inexact Rounded\r
+lnx0112 ln  10                ->   2.302585           Inexact Rounded\r
+lnx0113 ln  10.5              ->   2.351375           Inexact Rounded\r
+lnx0114 ln  9999              ->   9.210240           Inexact Rounded\r
+lnx0115 ln  1E6               ->  13.81551            Inexact Rounded\r
+lnx0116 ln  1E+9              ->  20.72327            Inexact Rounded\r
+lnx0117 ln +Infinity          ->  Infinity\r
+Precision: 2\r
+lnx0121 ln  0                 -> -Infinity\r
+lnx0122 ln  1E-9              -> -21                  Inexact Rounded\r
+lnx0123 ln  0.0007            ->  -7.3                Inexact Rounded\r
+lnx0124 ln  0.1               ->  -2.3                Inexact Rounded\r
+lnx0125 ln  0.7               ->  -0.36               Inexact Rounded\r
+lnx0126 ln  1                 ->   0\r
+lnx0127 ln  1.5               ->   0.41               Inexact Rounded\r
+lnx0128 ln  2                 ->   0.69               Inexact Rounded\r
+lnx0129 ln  2.718281828459045 ->   1.0                Inexact Rounded\r
+lnx0130 ln  2.718281828459046 ->   1.0                Inexact Rounded\r
+lnx0131 ln  2.718281828459047 ->   1.0                Inexact Rounded\r
+lnx0132 ln  10                ->   2.3                Inexact Rounded\r
+lnx0133 ln  10.5              ->   2.4                Inexact Rounded\r
+lnx0134 ln  9999              ->   9.2                Inexact Rounded\r
+lnx0135 ln  1E6               ->  14                  Inexact Rounded\r
+lnx0136 ln  1E+9              ->  21                  Inexact Rounded\r
+lnx0137 ln +Infinity          ->  Infinity\r
+Precision: 1\r
+lnx0141 ln  0                 -> -Infinity\r
+lnx0142 ln  1E-9              -> -2E+1                Inexact Rounded\r
+lnx0143 ln  0.0007            ->  -7                  Inexact Rounded\r
+lnx0144 ln  0.1               ->  -2                  Inexact Rounded\r
+lnx0145 ln  0.7               ->  -0.4                Inexact Rounded\r
+lnx0146 ln  1                 ->   0\r
+lnx0147 ln  1.5               ->   0.4                Inexact Rounded\r
+lnx0148 ln  2                 ->   0.7                Inexact Rounded\r
+lnx0149 ln  2.718281828459045 ->   1                  Inexact Rounded\r
+lnx0150 ln  2.718281828459046 ->   1                  Inexact Rounded\r
+lnx0151 ln  2.718281828459047 ->   1                  Inexact Rounded\r
+lnx0152 ln  10                ->   2                  Inexact Rounded\r
+lnx0153 ln  10.5              ->   2                  Inexact Rounded\r
+lnx0154 ln  9999              ->   9                  Inexact Rounded\r
+lnx0155 ln  1E6               ->  1E+1                Inexact Rounded\r
+lnx0156 ln  1E+9              ->  2E+1                Inexact Rounded\r
+lnx0157 ln +Infinity          ->  Infinity\r
+\r
+-- group low-precision ln(1)s:\r
+precision: 1\r
+lnx0161 ln  1 -> 0\r
+precision: 2\r
+lnx0162 ln  1 -> 0\r
+precision: 3\r
+lnx0163 ln  1 -> 0\r
+precision: 4\r
+lnx0164 ln  1 -> 0\r
+precision: 5\r
+lnx0165 ln  1 -> 0\r
+precision: 6\r
+lnx0166 ln  1 -> 0\r
+precision: 7\r
+lnx0167 ln  1 -> 0\r
+precision: 8\r
+lnx0168 ln  1 -> 0\r
+\r
+-- edge-test ln(2) and ln(10) in case of lookasides\r
+precision: 45\r
+lnx201  ln  2 -> 0.693147180559945309417232121458176568075500134  Inexact Rounded\r
+lnx202  ln 10 -> 2.30258509299404568401799145468436420760110149   Inexact Rounded\r
+precision: 44\r
+lnx203  ln  2 -> 0.69314718055994530941723212145817656807550013   Inexact Rounded\r
+lnx204  ln 10 -> 2.3025850929940456840179914546843642076011015    Inexact Rounded\r
+precision: 43\r
+lnx205  ln  2 -> 0.6931471805599453094172321214581765680755001    Inexact Rounded\r
+lnx206  ln 10 -> 2.302585092994045684017991454684364207601101     Inexact Rounded\r
+precision: 42\r
+lnx207  ln  2 -> 0.693147180559945309417232121458176568075500     Inexact Rounded\r
+lnx208  ln 10 -> 2.30258509299404568401799145468436420760110      Inexact Rounded\r
+precision: 41\r
+lnx209  ln  2 -> 0.69314718055994530941723212145817656807550      Inexact Rounded\r
+lnx210  ln 10 -> 2.3025850929940456840179914546843642076011       Inexact Rounded\r
+precision: 40\r
+lnx211  ln  2 -> 0.6931471805599453094172321214581765680755       Inexact Rounded\r
+lnx212  ln 10 -> 2.302585092994045684017991454684364207601        Inexact Rounded\r
+precision: 39\r
+lnx213  ln  2 -> 0.693147180559945309417232121458176568076        Inexact Rounded\r
+lnx214  ln 10 -> 2.30258509299404568401799145468436420760         Inexact Rounded\r
+precision: 38\r
+lnx215  ln  2 -> 0.69314718055994530941723212145817656808         Inexact Rounded\r
+lnx216  ln 10 -> 2.3025850929940456840179914546843642076          Inexact Rounded\r
+precision: 37\r
+lnx217  ln  2 -> 0.6931471805599453094172321214581765681          Inexact Rounded\r
+lnx218  ln 10 -> 2.302585092994045684017991454684364208           Inexact Rounded\r
+precision: 36\r
+lnx219  ln  2 -> 0.693147180559945309417232121458176568           Inexact Rounded\r
+lnx220  ln 10 -> 2.30258509299404568401799145468436421            Inexact Rounded\r
+precision: 35\r
+lnx221  ln  2 -> 0.69314718055994530941723212145817657            Inexact Rounded\r
+lnx222  ln 10 -> 2.3025850929940456840179914546843642             Inexact Rounded\r
+precision: 34\r
+lnx223  ln  2 -> 0.6931471805599453094172321214581766             Inexact Rounded\r
+lnx224  ln 10 -> 2.302585092994045684017991454684364              Inexact Rounded\r
+precision: 33\r
+lnx225  ln  2 -> 0.693147180559945309417232121458177              Inexact Rounded\r
+lnx226  ln 10 -> 2.30258509299404568401799145468436               Inexact Rounded\r
+precision: 32\r
+lnx227  ln  2 -> 0.69314718055994530941723212145818               Inexact Rounded\r
+lnx228  ln 10 -> 2.3025850929940456840179914546844                Inexact Rounded\r
+precision: 31\r
+lnx229  ln  2 -> 0.6931471805599453094172321214582                Inexact Rounded\r
+lnx230  ln 10 -> 2.302585092994045684017991454684                 Inexact Rounded\r
+precision: 30\r
+lnx231  ln  2 -> 0.693147180559945309417232121458                 Inexact Rounded\r
+lnx232  ln 10 -> 2.30258509299404568401799145468                  Inexact Rounded\r
+\r
+-- extreme input range values\r
+maxExponent: 384\r
+minExponent: -383\r
+Precision: 16\r
+\r
+lnx0901 ln 1e-400    -> -921.0340371976183  Inexact Rounded\r
+lnx0902 ln 1e+400    ->  921.0340371976183  Inexact Rounded\r
+lnx0903 ln 1e-999999 -> -2302582.790408953  Inexact Rounded\r
+lnx0904 ln 1e+999999 ->  2302582.790408953  Inexact Rounded\r
+lnx0905 ln 1e-1000013                -> -2302615.026600255  Inexact Rounded\r
+lnx0906 ln 2e-1000013                -> -2302614.333453074  Inexact Rounded\r
+\r
+lnx0910 ln 9.999999e+999999          ->  2302585.092993946  Inexact Rounded\r
+lnx0911 ln 9.9999999e+999999         ->  2302585.092994036  Inexact Rounded\r
+lnx0912 ln 9.99999999e+999999        ->  2302585.092994045  Inexact Rounded\r
+lnx0913 ln 9.999999999e+999999       ->  2302585.092994046  Inexact Rounded\r
+lnx0914 ln 9.999999999999e+999999    ->  2302585.092994046  Inexact Rounded\r
+lnx0915 ln 9.999999999999999e+999999 ->  2302585.092994046  Inexact Rounded\r
+lnx0916 ln 9.999999999999999999999999e+999999 ->  2302585.092994046  Inexact Rounded\r
+\r
+-- randoms\r
+-- P=50, within 0-999\r
+Precision: 50\r
+maxExponent: 384\r
+minExponent: -383\r
+lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded\r
+lnx1502 ln 158.15866624664623070184595045304145949900714987827  -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded\r
+lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded\r
+lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded\r
+lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded\r
+lnx1506 ln 83.033654063877426261108592599182418953442677554806  -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded\r
+lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded\r
+lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded\r
+lnx1509 ln 66.176106555181527101630351127583944689752069132522  -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded\r
+lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded\r
+lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded\r
+lnx1512 ln 72.646968818463546449499147579023555008392860423385  -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded\r
+lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded\r
+lnx1514 ln 61.002910447202398204114909451851111424657671911002  -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded\r
+lnx1515 ln 917.06917611331980999227893584010544542312239174774  -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded\r
+lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded\r
+lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded\r
+lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded\r
+lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded\r
+lnx1520 ln 4.0312542977070300070506064666536478373801988540614  -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded\r
+lnx1521 ln 271.84991311551875601432518819562391699324632396423  -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded\r
+lnx1522 ln 7.4118671629373864667229445746862314443895404818689  -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded\r
+lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded\r
+lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded\r
+lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded\r
+lnx1526 ln 6.8441648298027301292342057248737326152250794026761  -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded\r
+lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded\r
+lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded\r
+lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded\r
+lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded\r
+lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded\r
+lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded\r
+lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded\r
+lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded\r
+lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded\r
+lnx1536 ln 79.335036798971515026519630103325369729637514127617  -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded\r
+lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded\r
+lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded\r
+lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded\r
+lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded\r
+\r
+-- P=34, within 0-999\r
+Precision: 34\r
+lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded\r
+lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded\r
+lnx1203 ln 786.8398945385105190697541493392742  -> 6.668024790031836340471824147010546 Inexact Rounded\r
+lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded\r
+lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded\r
+lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded\r
+lnx1207 ln 09.13888261229039989110753389096760  -> 2.212538125507975574509563027696021 Inexact Rounded\r
+lnx1208 ln 802.0105417063143696497292158147174  -> 6.687121752052341737234832203350214 Inexact Rounded\r
+lnx1209 ln 778.7749710387773713523028497333058  -> 6.657722135126935472086625031413031 Inexact Rounded\r
+lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded\r
+lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded\r
+lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded\r
+lnx1213 ln 9.027898199253511668242977766616082  -> 2.200319582778899029786017830557293 Inexact Rounded\r
+lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded\r
+lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded\r
+lnx1216 ln 2.630101665342826494730394729313167  -> 0.9670225014664367465128243039749559 Inexact Rounded\r
+lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded\r
+lnx1218 ln 567.3436047121057843908106573095590  -> 6.340965124964258486463444360787970 Inexact Rounded\r
+lnx1219 ln 1.199291248124655996614605745649725  -> 0.1817307557425911805765087755675657 Inexact Rounded\r
+lnx1220 ln 25.02050448582031098696267479135557  -> 3.219695668137659139544178905459317 Inexact Rounded\r
+lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded\r
+lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded\r
+lnx1223 ln 4.681515800176129184873770605589795  -> 1.543621946415383338972124445445748 Inexact Rounded\r
+lnx1224 ln 15.95126669161103011206658749345781  -> 2.769538242479483539275986395443539 Inexact Rounded\r
+lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded\r
+lnx1226 ln 000.0040544064881821770528475185674  -> -5.507950967557021671647165889608324 Inexact Rounded\r
+lnx1227 ln 29.01617095935593792095913785100360  -> 3.367853293862745651888450004473297 Inexact Rounded\r
+lnx1228 ln 78.01836167344736733024804243195323  -> 4.356944205055768575987781375003992 Inexact Rounded\r
+lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded\r
+lnx1230 ln 97.95475237720579752770587185074428  -> 4.584505661612812742208619358214729 Inexact Rounded\r
+lnx1231 ln 528.0609262050423246402564228432371  -> 6.269211667589138113396583894315956 Inexact Rounded\r
+lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded\r
+lnx1233 ln 47.97063637767998658567199049725754  -> 3.870589081585660692195989854842372 Inexact Rounded\r
+lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded\r
+lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded\r
+lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded\r
+lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded\r
+lnx1238 ln 499.1277448846130709827154556125942  -> 6.212862064761427967461188083514774 Inexact Rounded\r
+lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded\r
+lnx1240 ln 41.08268350829477451667228892495136  -> 3.715586706887278039173584859218960 Inexact Rounded\r
+\r
+-- P=16, within 0-99\r
+Precision: 16\r
+lnx1101 ln 7.964875261033948  -> 2.075041282352241 Inexact Rounded\r
+lnx1102 ln 13.54527396845394  -> 2.606037701870263 Inexact Rounded\r
+lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded\r
+lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded\r
+lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded\r
+lnx1106 ln 7.616268622474371  -> 2.030286567675148 Inexact Rounded\r
+lnx1107 ln 51.58329925806381  -> 3.943197962309569 Inexact Rounded\r
+lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded\r
+lnx1109 ln 2.956282457072984  -> 1.083932552334575 Inexact Rounded\r
+lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded\r
+lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded\r
+lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded\r
+lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded\r
+lnx1114 ln 5.926756998151102  -> 1.779477182834305 Inexact Rounded\r
+lnx1115 ln 9.025699152180897  -> 2.200075969604119 Inexact Rounded\r
+lnx1116 ln 1.910124643533526  -> 0.6471684983238183 Inexact Rounded\r
+lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded\r
+lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded\r
+lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded\r
+lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded\r
+lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded\r
+lnx1122 ln 6.927937541637261  -> 1.935562155866906 Inexact Rounded\r
+lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded\r
+lnx1124 ln 1.602465492956538  -> 0.4715433763243936 Inexact Rounded\r
+lnx1125 ln 38.98415625087535  -> 3.663155313610213 Inexact Rounded\r
+lnx1126 ln 5.343182042276734  -> 1.675821363568112 Inexact Rounded\r
+lnx1127 ln 55.89763703245816  -> 4.023522107934110 Inexact Rounded\r
+lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded\r
+lnx1129 ln 1.631407314946094  -> 0.4894430257201248 Inexact Rounded\r
+lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded\r
+lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded\r
+lnx1132 ln 5.227161719132849  -> 1.653868438439637 Inexact Rounded\r
+lnx1133 ln 60.57078466941998  -> 4.103812675662452 Inexact Rounded\r
+lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded\r
+lnx1135 ln 09.48564268447325  -> 2.249779359074983 Inexact Rounded\r
+lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded\r
+lnx1137 ln 1.805176865587172  -> 0.5906585734593707 Inexact Rounded\r
+lnx1138 ln 62.59363259642255  -> 4.136663557220559 Inexact Rounded\r
+lnx1139 ln 4.373828261137201  -> 1.475638657912000 Inexact Rounded\r
+lnx1140 ln 0.994483524148738  -> -0.005531747794938690 Inexact Rounded\r
+\r
+-- P=7, within 0-9\r
+Precision: 7\r
+lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded\r
+lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded\r
+lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded\r
+lnx1004 ln 8.798639  -> 2.174597 Inexact Rounded\r
+lnx1005 ln 2.459121  -> 0.8998040 Inexact Rounded\r
+lnx1006 ln 2.013193  -> 0.6997220 Inexact Rounded\r
+lnx1007 ln 9.064857  -> 2.204405 Inexact Rounded\r
+lnx1008 ln 5.796417  -> 1.757240 Inexact Rounded\r
+lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded\r
+lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded\r
+lnx1011 ln 6.693781  -> 1.901179 Inexact Rounded\r
+lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded\r
+lnx1013 ln 8.313616  -> 2.117895 Inexact Rounded\r
+lnx1014 ln 3.486925  -> 1.249020 Inexact Rounded\r
+lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded\r
+lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded\r
+lnx1017 ln 7.818111  -> 2.056443 Inexact Rounded\r
+lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded\r
+lnx1019 ln 8.153966  -> 2.098504 Inexact Rounded\r
+lnx1020 ln 2.040975  -> 0.7134276 Inexact Rounded\r
+lnx1021 ln 1.481642  -> 0.3931509 Inexact Rounded\r
+lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded\r
+lnx1023 ln 0.466723  -> -0.7620193 Inexact Rounded\r
+lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded\r
+lnx1025 ln 2.056410  -> 0.7209617 Inexact Rounded\r
+lnx1026 ln 0.181522  -> -1.706378 Inexact Rounded\r
+lnx1027 ln 0.515551  -> -0.6625190 Inexact Rounded\r
+lnx1028 ln 8.425089  -> 2.131214 Inexact Rounded\r
+lnx1029 ln 2.077091  -> 0.7309684 Inexact Rounded\r
+lnx1030 ln 6.212705  -> 1.826596 Inexact Rounded\r
+lnx1031 ln 5.729343  -> 1.745601 Inexact Rounded\r
+lnx1032 ln 4.831251  -> 1.575105 Inexact Rounded\r
+lnx1033 ln 2.029760  -> 0.7079176 Inexact Rounded\r
+lnx1034 ln 8.615060  -> 2.153512 Inexact Rounded\r
+lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded\r
+lnx1036 ln 5.195269  -> 1.647748 Inexact Rounded\r
+lnx1037 ln 9.617686  -> 2.263604 Inexact Rounded\r
+lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded\r
+lnx1039 ln 2.786840  -> 1.024908 Inexact Rounded\r
+lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded\r
+\r
+-- from here 3-digit tests are based on reverse exp tests\r
+precision:   9\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+lnx001  ln 0           ->  -Infinity\r
+lnx002  ln 0.367879441 ->  -1.00000000    Inexact Rounded\r
+lnx003  ln 1           ->   0\r
+lnx005  ln 2.71828183  ->   1.00000000    Inexact Rounded\r
+lnx006  ln 2.00000000  ->   0.693147181   Inexact Rounded\r
+lnx007  ln +Infinity   ->   Infinity\r
+\r
+-- tiny edge cases\r
+precision:   7\r
+lnx011  ln 1.105171 ->  0.1000001       Inexact Rounded\r
+lnx012  ln 1.010050 ->  0.009999835     Inexact Rounded\r
+lnx013  ln 1.000010 ->  0.000009999950  Inexact Rounded\r
+lnx014  ln 1.000001 ->  9.999995E-7     Inexact Rounded\r
+lnx015  ln 1.000000 ->  0\r
+\r
+-- basic e=0, e=1, e=2, e=4, e>=8 cases\r
+precision:   7\r
+lnx041  ln 2.718282      ->  1.000000    Inexact Rounded\r
+lnx042  ln 0.3678794     -> -1.000000    Inexact Rounded\r
+lnx043  ln 22026.47      ->  10.00000    Inexact Rounded\r
+lnx044  ln 0.00004539993 -> -10.00000    Inexact Rounded\r
+lnx045  ln 2.688117E+43  ->  100.0000    Inexact Rounded\r
+lnx046  ln 3.720076E-44  -> -100.0000    Inexact Rounded\r
+lnx047  ln Infinity      ->  Infinity\r
+lnx048  ln 0E-389        -> -Infinity\r
+\r
+-- miscellanea\r
+precision: 16\r
+lnx055  ln 2.717658486884572E-236     -> -542.4103112874415       Inexact Rounded\r
+precision: 17\r
+lnx056  ln 2.7176584868845721E-236    -> -542.41031128744146      Inexact Rounded\r
+precision: 18\r
+lnx057  ln 2.71765848688457211E-236   -> -542.410311287441459     Inexact Rounded\r
+precision: 19\r
+lnx058  ln 2.717658486884572112E-236  -> -542.4103112874414592    Inexact Rounded\r
+precision: 20\r
+lnx059  ln 2.7176584868845721118E-236 -> -542.41031128744145917   Inexact Rounded\r
+\r
+-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences\r
+precision:   50\r
+lnx102  ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8  Inexact Rounded\r
+precision:   30\r
+lnx103  ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8   Inexact Rounded\r
+precision:   29\r
+lnx104  ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8    Inexact Rounded\r
+precision:   28\r
+lnx105  ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8     Inexact Rounded\r
+precision:   27\r
+lnx106  ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8      Inexact Rounded\r
+precision:   26\r
+lnx107  ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8       Inexact Rounded\r
+precision:   25\r
+lnx108  ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8        Inexact Rounded\r
+precision:   24\r
+lnx109  ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8         Inexact Rounded\r
+precision:   23\r
+lnx110  ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8          Inexact Rounded\r
+precision:   22\r
+lnx111  ln 0.9999999100000040499999 -> -8.999999999999997850000E-8           Inexact Rounded\r
+precision:   21\r
+lnx112  ln 0.999999910000004050000 -> -8.99999999999998785000E-8            Inexact Rounded\r
+precision:   20\r
+lnx113  ln 0.99999991000000405000 -> -8.9999999999999878500E-8             Inexact Rounded\r
+precision:   19\r
+lnx114  ln 0.9999999100000040500 -> -8.999999999999987850E-8              Inexact Rounded\r
+precision:   18\r
+lnx115  ln 0.999999910000004050 -> -8.99999999999998785E-8               Inexact Rounded\r
+-- next may be a > 0.5ulp case; a more precise answer is:\r
+--                                -8.99999999999998784999918E-8\r
+precision:   17\r
+lnx116  ln 0.99999991000000405 -> -8.9999999999999878E-8               Inexact Rounded\r
+precision:   16\r
+lnx117  ln 0.9999999100000040 -> -9.000000004999988E-8               Inexact Rounded\r
+precision:   15\r
+lnx118  ln 0.999999910000004 -> -9.00000000499999E-8            Inexact Rounded\r
+precision:   14\r
+lnx119  ln 0.99999991000000 -> -9.0000004050000E-8                  Inexact Rounded\r
+precision:   13\r
+lnx120  ln 0.9999999100000 -> -9.000000405000E-8       Inexact Rounded\r
+precision:   12\r
+lnx121  ln 0.999999910000 -> -9.00000040500E-8        Inexact Rounded\r
+precision:   11\r
+lnx122  ln 0.99999991000 -> -9.0000004050E-8         Inexact Rounded\r
+precision:   10\r
+lnx123  ln 0.9999999100 -> -9.000000405E-8          Inexact Rounded\r
+precision:    9\r
+lnx124  ln 0.999999910 -> -9.00000041E-8           Inexact Rounded\r
+precision:    8\r
+lnx125  ln 0.99999991 -> -9.0000004E-8            Inexact Rounded\r
+precision:    7\r
+lnx126  ln 0.9999999 -> -1.000000E-7                   Inexact Rounded\r
+precision:   16\r
+lnx126b ln 0.9999999 -> -1.000000050000003E-7          Inexact Rounded\r
+precision:    6\r
+lnx127  ln 0.999999 -> -0.00000100000                  Inexact Rounded\r
+precision:    5\r
+lnx128  ln 0.99999 -> -0.000010000                     Inexact Rounded\r
+precision:    4\r
+lnx129  ln 0.9999 -> -0.0001000                        Inexact Rounded\r
+precision:    3\r
+lnx130  ln 0.999 -> -0.00100                           Inexact Rounded\r
+precision:    2\r
+lnx131  ln 0.99 -> -0.010                              Inexact Rounded\r
+precision:    1\r
+lnx132  ln 0.9 -> -0.1                                 Inexact Rounded\r
+\r
+\r
+-- cases near 1              --  1 2345678901234567890\r
+precision:    20\r
+lnx401  ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded\r
+lnx402  ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded\r
+lnx403  ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded\r
+lnx404  ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded\r
+lnx405  ln 2.7182818284590452354 -> 1.0000000000000000000  Inexact Rounded\r
+lnx406  ln 2.7182818284593170635 -> 1.0000000000001000000  Inexact Rounded\r
+lnx407  ln 2.7182818284595888917 -> 1.0000000000002000000  Inexact Rounded\r
+precision:    14\r
+lnx411  ln 2.7182818284589 -> 0.99999999999995    Inexact Rounded\r
+lnx413  ln 2.7182818284590 -> 0.99999999999998    Inexact Rounded\r
+lnx416  ln 2.7182818284591 -> 1.0000000000000     Inexact Rounded\r
+lnx417  ln 2.7182818284592 -> 1.0000000000001     Inexact Rounded\r
+\r
+-- overflows, including some exp overprecise borderlines\r
+precision:   7\r
+maxExponent: 384\r
+minExponent: -383\r
+lnx709  ln 9.999999E+384 ->  886.4953     Inexact Rounded\r
+lnx711  ln 9.999992E+384 ->  886.4953     Inexact Rounded\r
+precision:   16\r
+lnx722  ln 9.999999999999999E+384 ->  886.4952608027076     Inexact Rounded\r
+lnx724  ln 9.999999999999917E+384 ->  886.4952608027076     Inexact Rounded\r
+lnx726  ln 9.999999999999117E+384 ->  886.4952608027075     Inexact Rounded\r
+-- and more...\r
+precision:   15\r
+maxExponent: 999\r
+minExponent: -999\r
+lnx731  ln 9.99999999999999E+999 -> 2302.58509299405       Inexact Rounded\r
+-- next may be a > 0.5ulp case; a more precise answer is:\r
+--                                  2302.58509299404495001799145442\r
+lnx732  ln 9.99999999999266E+999 -> 2302.58509299404       Inexact Rounded\r
+lnx733  ln 9.99999999999265E+999 -> 2302.58509299404       Inexact Rounded\r
+lnx734  ln 9.99999999999264E+999 -> 2302.58509299404       Inexact Rounded\r
+\r
+-- subnormals and underflows for exp, including underflow-to-zero edge point\r
+precision:   7\r
+maxExponent: 384\r
+minExponent: -383\r
+lnx751  ln 0E-389 -> -Infinity\r
+lnx758  ln 1.000001E-383 -> -881.8901      Inexact Rounded\r
+lnx759  ln 9.99991E-384 -> -881.8901       Inexact Rounded\r
+lnx760  ln 4.4605E-385 -> -885.0000        Inexact Rounded\r
+lnx761  ln 2.221E-386 -> -887.9999         Inexact Rounded\r
+lnx762  ln 3.01E-387 -> -889.9985          Inexact Rounded\r
+lnx763  ln 1.7E-388 -> -892.8724           Inexact Rounded\r
+lnx764  ln 1.5E-388 -> -892.9976           Inexact Rounded\r
+lnx765  ln 9E-389 -> -893.5084             Inexact Rounded\r
+lnx766  ln 1E-389 -> -895.7056             Inexact Rounded\r
+lnx774  ln 0E-389 -> -Infinity\r
+\r
+-- special values\r
+lnx820  ln Infinity ->   Infinity\r
+lnx821  ln 0        ->  -Infinity\r
+lnx822  ln NaN      ->   NaN\r
+lnx823  ln sNaN     ->   NaN     Invalid_operation\r
+-- propagating NaNs\r
+lnx824  ln sNaN123  ->   NaN123  Invalid_operation\r
+lnx825  ln -sNaN321 ->  -NaN321  Invalid_operation\r
+lnx826  ln NaN456   ->   NaN456\r
+lnx827  ln -NaN654  ->  -NaN654\r
+lnx828  ln NaN1     ->   NaN1\r
+\r
+-- Invalid operations due to restrictions\r
+-- [next two probably skipped by most test harnesses]\r
+precision: 100000000\r
+lnx901  ln 1 ->  NaN            Invalid_context\r
+precision:  99999999\r
+lnx902  ln 0 ->  NaN            Invalid_context\r
+\r
+precision: 9\r
+maxExponent:   1000000\r
+minExponent:   -999999\r
+lnx903  ln 1   ->  NaN          Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999999\r
+lnx904  ln 0 ->  -Infinity\r
+maxExponent:    999999\r
+minExponent:  -1000000\r
+lnx905  ln 1   ->  NaN          Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999998\r
+lnx906  ln 0 ->  -Infinity\r
+\r
+-- payload decapitate\r
+precision: 5\r
+lnx910  ln -sNaN1234567890 -> -NaN67890  Invalid_operation\r
+\r
+-- Null test\r
+lnx900  ln #   -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/log10.decTest b/Lib/test/decimaltestdata/log10.decTest
new file mode 100644 (file)
index 0000000..9841acb
--- /dev/null
@@ -0,0 +1,551 @@
+------------------------------------------------------------------------\r
+-- log10.decTest -- decimal logarithm in base 10                      --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This emphasises the testing of notable cases, as they will often\r
+-- have unusual paths (especially the 10**n results).\r
+\r
+extended:    1\r
+precision:   16\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- examples in specification\r
+precision:   9\r
+logxs000 log10  0                 -> -Infinity\r
+logxs001 log10  0.001             -> -3\r
+logxs002 log10  1                 ->  0\r
+logxs003 log10  2                 ->  0.301029996         Inexact Rounded\r
+logxs004 log10  10                ->  1\r
+logxs005 log10  70                ->  1.84509804          Inexact Rounded\r
+logxs006 log10 +Infinity          ->  Infinity\r
+\r
+\r
+-- basics (examples in specification, etc.)\r
+precision:   16\r
+logx0000 log10  0                 -> -Infinity\r
+logx0001 log10  7E-1000           -> -999.1549019599857   Inexact Rounded\r
+logx0002 log10  1.1E-9            -> -8.958607314841775   Inexact Rounded\r
+logx0003 log10  0.0007            -> -3.154901959985743   Inexact Rounded\r
+logx0004 log10  0.11              -> -0.9586073148417750  Inexact Rounded\r
+logx0005 log10  0.7               -> -0.1549019599857432  Inexact Rounded\r
+logx0006 log10  1                 ->  0\r
+logx0007 log10  1.5               ->  0.1760912590556812  Inexact Rounded\r
+logx0008 log10  2                 ->  0.3010299956639812  Inexact Rounded\r
+logx0009 log10  2.718281828459045 ->  0.4342944819032518  Inexact Rounded\r
+logx0010 log10  2.718281828459046 ->  0.4342944819032519  Inexact Rounded\r
+logx0011 log10  2.718281828459047 ->  0.4342944819032521  Inexact Rounded\r
+logx0012 log10  7                 ->  0.8450980400142568  Inexact Rounded\r
+logx0013 log10  10                ->  1\r
+logx0014 log10  10.5              ->  1.021189299069938   Inexact Rounded\r
+logx0015 log10  11                ->  1.041392685158225   Inexact Rounded\r
+logx0016 log10  70                ->  1.845098040014257   Inexact Rounded\r
+logx0017 log10  9999              ->  3.999956568380192   Inexact Rounded\r
+logx0018 log10  1.21E6            ->  6.082785370316450   Inexact Rounded\r
+logx0019 log10  1.1E+9            ->  9.041392685158225   Inexact Rounded\r
+logx0020 log10  7E+1000           ->  1000.845098040014   Inexact Rounded\r
+logx0021 log10 +Infinity          ->  Infinity\r
+\r
+-- notable cases\r
+-- negatives\r
+logx0031 log10 -1E-9              -> NaN Invalid_operation\r
+logx0032 log10 -0.0007            -> NaN Invalid_operation\r
+logx0033 log10 -0.1               -> NaN Invalid_operation\r
+logx0034 log10 -0.7               -> NaN Invalid_operation\r
+logx0035 log10 -1                 -> NaN Invalid_operation\r
+logx0036 log10 -1.5               -> NaN Invalid_operation\r
+logx0037 log10 -2                 -> NaN Invalid_operation\r
+logx0038 log10 -10.5              -> NaN Invalid_operation\r
+logx0039 log10 -10.5              -> NaN Invalid_operation\r
+logx0040 log10 -9999              -> NaN Invalid_operation\r
+logx0041 log10 -10                -> NaN Invalid_operation\r
+logx0042 log10 -0                 -> -Infinity\r
+logx0043 log10 -0E+17             -> -Infinity\r
+logx0044 log10 -0E-17             -> -Infinity\r
+-- other zeros\r
+logx0051 log10  0                 -> -Infinity\r
+logx0052 log10  0E+17             -> -Infinity\r
+logx0053 log10  0E-17             -> -Infinity\r
+-- infinities\r
+logx0055 log10 -Infinity          -> NaN Invalid_operation\r
+logx0056 log10 +Infinity          -> Infinity\r
+-- ones\r
+logx0061 log10  1                 ->   0\r
+logx0062 log10  1.0               ->   0\r
+logx0063 log10  1.000000000000000 ->   0\r
+logx0064 log10  1.000000000000000000 ->   0\r
+\r
+-- notable cases -- exact powers of 10\r
+logx1100 log10 1             -> 0\r
+logx1101 log10 10            -> 1\r
+logx1102 log10 100           -> 2\r
+logx1103 log10 1000          -> 3\r
+logx1104 log10 10000         -> 4\r
+logx1105 log10 100000        -> 5\r
+logx1106 log10 1000000       -> 6\r
+logx1107 log10 10000000      -> 7\r
+logx1108 log10 100000000     -> 8\r
+logx1109 log10 1000000000    -> 9\r
+logx1110 log10 10000000000   -> 10\r
+logx1111 log10 100000000000  -> 11\r
+logx1112 log10 1000000000000 -> 12\r
+logx1113 log10 0.00000000001 -> -11\r
+logx1114 log10 0.0000000001 -> -10\r
+logx1115 log10 0.000000001 -> -9\r
+logx1116 log10 0.00000001 -> -8\r
+logx1117 log10 0.0000001 -> -7\r
+logx1118 log10 0.000001 -> -6\r
+logx1119 log10 0.00001 -> -5\r
+logx1120 log10 0.0001 -> -4\r
+logx1121 log10 0.001 -> -3\r
+logx1122 log10 0.01 -> -2\r
+logx1123 log10 0.1 -> -1\r
+logx1124 log10 1E-99  -> -99\r
+logx1125 log10 1E-100 -> -100\r
+logx1126 log10 1E-383 -> -383\r
+\r
+-- check normally exact cases round properly\r
+precision: 1\r
+logx1141 log10 10000000000   -> 1E+1         Rounded\r
+logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded\r
+logx1143 log10 1E+100        -> 1E+2         Rounded\r
+logx1144 log10 1E+123        -> 1E+2 Inexact Rounded\r
+logx1145 log10 1E+126        -> 1E+2 Inexact Rounded\r
+logx1146 log10 1E+916        -> 9E+2 Inexact Rounded\r
+logx1147 log10 1E+999        -> 1E+3 Inexact Rounded\r
+\r
+precision: 2\r
+logx1151 log10 10000000000   -> 10\r
+logx1152 log10 1000000000000 -> 12\r
+logx1153 log10 1E+100        -> 1.0E+2         Rounded\r
+logx1154 log10 1E+123        -> 1.2E+2 Inexact Rounded\r
+logx1155 log10 1E+126        -> 1.3E+2 Inexact Rounded\r
+logx1156 log10 1E+916        -> 9.2E+2 Inexact Rounded\r
+logx1157 log10 1E+999        -> 1.0E+3 Inexact Rounded\r
+-- some half-way point rounds, other cases, and negatives\r
+logx1158 log10 1E+125        -> 1.2E+2 Inexact Rounded\r
+logx1159 log10 1E+135        -> 1.4E+2 Inexact Rounded\r
+logx1160 log10 1E+129        -> 1.3E+2 Inexact Rounded\r
+logx1161 log10 1E+131        -> 1.3E+2 Inexact Rounded\r
+logx1162 log10 1E-123        -> -1.2E+2 Inexact Rounded\r
+logx1163 log10 1E-126        -> -1.3E+2 Inexact Rounded\r
+logx1164 log10 1E-916        -> -9.2E+2 Inexact Rounded\r
+logx1165 log10 1E-999        -> -1.0E+3 Inexact Rounded\r
+logx1166 log10 1E-125        -> -1.2E+2 Inexact Rounded\r
+logx1167 log10 1E-135        -> -1.4E+2 Inexact Rounded\r
+logx1168 log10 1E-129        -> -1.3E+2 Inexact Rounded\r
+logx1169 log10 1E-131        -> -1.3E+2 Inexact Rounded\r
+\r
+precision: 3\r
+logx1171 log10 10000000000   -> 10\r
+logx1172 log10 1000000000000 -> 12\r
+logx1173 log10 1E+100        -> 100\r
+logx1174 log10 1E+123        -> 123\r
+logx1175 log10 1E+126        -> 126\r
+logx1176 log10 1E+916        -> 916\r
+logx1177 log10 1E+999        -> 999\r
+\r
+-- log10(2) .. tests both ln(2) and ln(10) constants, too\r
+precision: 50\r
+logx1201 log10 2     -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded\r
+logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded\r
+logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded\r
+precision: 49\r
+logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded\r
+precision: 48\r
+logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462  Inexact Rounded\r
+precision: 47\r
+logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146   Inexact Rounded\r
+precision: 46\r
+logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815    Inexact Rounded\r
+precision: 45\r
+logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881     Inexact Rounded\r
+precision: 44\r
+logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988      Inexact Rounded\r
+precision: 43\r
+logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899       Inexact Rounded\r
+precision: 42\r
+logx1211 log10 2 -> 0.301029995663981195213738894724493026768190        Inexact Rounded\r
+precision: 41\r
+logx1212 log10 2 -> 0.30102999566398119521373889472449302676819         Inexact Rounded\r
+precision: 40\r
+logx1213 log10 2 -> 0.3010299956639811952137388947244930267682          Inexact Rounded\r
+precision: 39\r
+logx1214 log10 2 -> 0.301029995663981195213738894724493026768           Inexact Rounded\r
+precision: 38\r
+logx1215 log10 2 -> 0.30102999566398119521373889472449302677            Inexact Rounded\r
+precision: 37\r
+logx1216 log10 2 -> 0.3010299956639811952137388947244930268             Inexact Rounded\r
+precision: 36\r
+logx1217 log10 2 -> 0.301029995663981195213738894724493027              Inexact Rounded\r
+precision: 35\r
+logx1218 log10 2 -> 0.30102999566398119521373889472449303               Inexact Rounded\r
+precision: 34\r
+logx1219 log10 2 -> 0.3010299956639811952137388947244930                Inexact Rounded\r
+precision: 33\r
+logx1220 log10 2 -> 0.301029995663981195213738894724493                 Inexact Rounded\r
+precision: 32\r
+logx1221 log10 2 -> 0.30102999566398119521373889472449                  Inexact Rounded\r
+precision: 31\r
+logx1222 log10 2 -> 0.3010299956639811952137388947245                   Inexact Rounded\r
+precision: 30\r
+logx1223 log10 2 -> 0.301029995663981195213738894724                    Inexact Rounded\r
+precision: 29\r
+logx1224 log10 2 -> 0.30102999566398119521373889472                     Inexact Rounded\r
+precision: 28\r
+logx1225 log10 2 -> 0.3010299956639811952137388947                      Inexact Rounded\r
+precision: 27\r
+logx1226 log10 2 -> 0.301029995663981195213738895                       Inexact Rounded\r
+precision: 26\r
+logx1227 log10 2 -> 0.30102999566398119521373889                        Inexact Rounded\r
+precision: 25\r
+logx1228 log10 2 -> 0.3010299956639811952137389                         Inexact Rounded\r
+precision: 24\r
+logx1229 log10 2 -> 0.301029995663981195213739                          Inexact Rounded\r
+precision: 23\r
+logx1230 log10 2 -> 0.30102999566398119521374                           Inexact Rounded\r
+precision: 22\r
+logx1231 log10 2 -> 0.3010299956639811952137                            Inexact Rounded\r
+precision: 21\r
+logx1232 log10 2 -> 0.301029995663981195214                             Inexact Rounded\r
+precision: 20\r
+logx1233 log10 2 -> 0.30102999566398119521                              Inexact Rounded\r
+precision: 19\r
+logx1234 log10 2 -> 0.3010299956639811952                               Inexact Rounded\r
+precision: 18\r
+logx1235 log10 2 -> 0.301029995663981195                                Inexact Rounded\r
+precision: 17\r
+logx1236 log10 2 -> 0.30102999566398120                                 Inexact Rounded\r
+precision: 16\r
+logx1237 log10 2 -> 0.3010299956639812                                  Inexact Rounded\r
+precision: 15\r
+logx1238 log10 2 -> 0.301029995663981                                   Inexact Rounded\r
+precision: 14\r
+logx1239 log10 2 -> 0.30102999566398                                    Inexact Rounded\r
+precision: 13\r
+logx1240 log10 2 -> 0.3010299956640                                     Inexact Rounded\r
+precision: 12\r
+logx1241 log10 2 -> 0.301029995664                                      Inexact Rounded\r
+precision: 11\r
+logx1242 log10 2 -> 0.30102999566                                       Inexact Rounded\r
+precision: 10\r
+logx1243 log10 2 -> 0.3010299957                                        Inexact Rounded\r
+precision:  9\r
+logx1244 log10 2 -> 0.301029996                                         Inexact Rounded\r
+precision:  8\r
+logx1245 log10 2 -> 0.30103000                                          Inexact Rounded\r
+precision:  7\r
+logx1246 log10 2 -> 0.3010300                                           Inexact Rounded\r
+precision:  6\r
+logx1247 log10 2 -> 0.301030                                            Inexact Rounded\r
+precision:  5\r
+logx1248 log10 2 -> 0.30103                                             Inexact Rounded\r
+precision:  4\r
+logx1249 log10 2 -> 0.3010                                              Inexact Rounded\r
+precision:  3\r
+logx1250 log10 2 -> 0.301                                               Inexact Rounded\r
+precision:  2\r
+logx1251 log10 2 -> 0.30                                                Inexact Rounded\r
+precision:  1\r
+logx1252 log10 2 -> 0.3                                                 Inexact Rounded\r
+\r
+maxExponent: 384\r
+minExponent: -383\r
+precision:   16\r
+rounding:    half_even\r
+\r
+-- More close-to-e, etc., tests\r
+precision:   34\r
+logx1301 log10 2.718281828459045235360287471352661  -> 0.4342944819032518276511289189166048 Inexact Rounded\r
+logx1302 log10 2.718281828459045235360287471352662  -> 0.4342944819032518276511289189166050 Inexact Rounded\r
+logx1303 log10 2.718281828459045235360287471352663  -> 0.4342944819032518276511289189166052 Inexact Rounded\r
+logx1304 log10 0.99999999999999999999999999999999   -> -4.342944819032518276511289189166073E-33 Inexact Rounded\r
+logx1305 log10 0.999999999999999999999999999999999  -> -4.342944819032518276511289189166053E-34 Inexact Rounded\r
+logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded\r
+logx1307 log10 1.000000000000000000000000000000000  -> 0\r
+logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded\r
+logx1309 log10 1.000000000000000000000000000000001  -> 4.342944819032518276511289189166049E-34 Inexact Rounded\r
+logx1310 log10 1.00000000000000000000000000000001   -> 4.342944819032518276511289189166029E-33 Inexact Rounded\r
+-- lower p\r
+precision:    7\r
+logx1320 log10 0.999999    -> -4.342947E-7  Inexact Rounded\r
+logx1321 log10 0.9999999   -> -4.342945E-8  Inexact Rounded\r
+logx1322 log10 0.99999999  -> -4.342945E-9  Inexact Rounded\r
+logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded\r
+logx1324 log10 1.00000000  ->  0\r
+logx1325 log10 1.00000001  ->  4.342945E-9  Inexact Rounded\r
+logx1326 log10 1.0000001   ->  4.342945E-8  Inexact Rounded\r
+logx1327 log10 1.000001    ->  4.342943E-7  Inexact Rounded\r
+\r
+-- near 10^3\r
+precision:   9\r
+logx1331 log10  999.9999998  -> 3.00000000 Inexact Rounded\r
+logx1332 log10  999.9999999  -> 3.00000000 Inexact Rounded\r
+logx1333 log10 1000.000000   -> 3\r
+logx1334 log10 1000.000001   -> 3.00000000 Inexact Rounded\r
+logx1335 log10 1000.000002   -> 3.00000000 Inexact Rounded\r
+precision: 16\r
+logx1341 log10  999.9999998  -> 2.999999999913141 Inexact Rounded\r
+logx1342 log10  999.9999999  -> 2.999999999956571 Inexact Rounded\r
+logx1343 log10 1000.000000   -> 3\r
+logx1344 log10 1000.000001   -> 3.000000000434294 Inexact Rounded\r
+logx1345 log10 1000.000002   -> 3.000000000868589 Inexact Rounded\r
+\r
+-- suggestions from Ilan Nehama\r
+logx1400 log10 10E-3    -> -2\r
+logx1401 log10 10E-2    -> -1\r
+logx1402 log10 100E-2   ->  0\r
+logx1403 log10 1000E-2  ->  1\r
+logx1404 log10 10000E-2 ->  2\r
+logx1405 log10 10E-1    ->  0\r
+logx1406 log10 100E-1   ->  1\r
+logx1407 log10 1000E-1  ->  2\r
+logx1408 log10 10000E-1 ->  3\r
+logx1409 log10 10E0     ->  1\r
+logx1410 log10 100E0    ->  2\r
+logx1411 log10 1000E0   ->  3\r
+logx1412 log10 10000E0  ->  4\r
+logx1413 log10 10E1     ->  2\r
+logx1414 log10 100E1    ->  3\r
+logx1415 log10 1000E1   ->  4\r
+logx1416 log10 10000E1  ->  5\r
+logx1417 log10 10E2     ->  3\r
+logx1418 log10 100E2    ->  4\r
+logx1419 log10 1000E2   ->  5\r
+logx1420 log10 10000E2  ->  6\r
+\r
+-- Randoms\r
+-- P=50, within 0-9999\r
+Precision: 50\r
+logx2501 log10 0.00035448001667968141775891246991912655961163345904 ->  -3.4504082425411775290864053318247274944685586188505 Inexact Rounded\r
+logx2502 log10 70.636455726424311228255338637935330826995136597644  ->   1.8490288998408492045793070255302335558140975719247 Inexact Rounded\r
+logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded\r
+logx2504 log10 97.783628621523244679901260358286898958832135433764  ->   1.9902661493224219517897657964362571690592734407330 Inexact Rounded\r
+logx2505 log10 0062.2377135315858392802612812022807838599572017342  ->   1.7940536293085066199287632725026837018486533544141 Inexact Rounded\r
+logx2506 log10 6.3767634652071053619977602804724129652981747879532  ->   0.80460030789825961615100163576080761326857374098644 Inexact Rounded\r
+logx2507 log10 63.297088981313278529306533814195068850532666658798  ->   1.8013837373724427092417170149098614410849353839673 Inexact Rounded\r
+logx2508 log10 0.00000077239693316881797717820110898167721602299187 ->  -6.1121594592718550613773886241951966264826760310047 Inexact Rounded\r
+logx2509 log10 0.00000003953580359780185534830572461922527831395002 ->  -7.4030094293833847136252547069905477213541787177561 Inexact Rounded\r
+logx2510 log10 754.62905817369989169188998111527272688791544577204  ->   2.8777335243761300047758534304371912099958057545416 Inexact Rounded\r
+logx2511 log10 0.00000048360378410241428936607147056283282849158312 ->  -6.3155103095309353457604038397980091650760346334512 Inexact Rounded\r
+logx2512 log10 0.00007509037583645612577196104591672080542932166089 ->  -4.1244157219700166314012344705538088030592896111026 Inexact Rounded\r
+logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded\r
+logx2514 log10 9.6210300460497657917445410947099633479609165120661  ->   0.98322157093260978206633922877716078683518617768411 Inexact Rounded\r
+logx2515 log10 0.00000000050150361386555527496607245976120864985611 ->  -9.2997259330798261040411086835563234390934934629340 Inexact Rounded\r
+logx2516 log10 098.24754029731994125797723545333677604490074810751  ->   1.9923216862874337077795278629351060819105679670633 Inexact Rounded\r
+logx2517 log10 7.5091998150046994320441463854301624742491015752980  ->   0.87559366078005924080766469158763499725414024128781 Inexact Rounded\r
+logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded\r
+logx2519 log10 0.00000042395034799555215782907515074134154915491701 ->  -6.3726850039125381134069450802108893075604464135297 Inexact Rounded\r
+logx2520 log10 56.683376304674355481905023145238799909301732694982  ->   1.7534557107853480435703421826077606250636580091754 Inexact Rounded\r
+logx2521 log10 48.734033811444195070807606721517169810438049581227  ->   1.6878323602741065190942654710049433808208291564049 Inexact Rounded\r
+logx2522 log10 0.00074830310930046865009851706989430228561880221063 ->  -3.1259224502209974082223667712016445572431791920618 Inexact Rounded\r
+logx2523 log10 36.677348885111593384020836720396262497122708598359  ->   1.5643979364260796086754530282302605477567469395425 Inexact Rounded\r
+logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded\r
+logx2525 log10 9509.5854013650642799374159131940108748594774307104  ->   3.9781615829916326741100166519726824430945406302661 Inexact Rounded\r
+logx2526 log10 0.07834891268689177014044454793608715276615743819097 ->  -1.1059670262197643147805517398621288897669876996348 Inexact Rounded\r
+logx2527 log10 0.00000029584529880706128444454688454999032801904794 ->  -6.5289353275814043710076526920566721570375026917206 Inexact Rounded\r
+logx2528 log10 3.0713496544497618098794332787772186176981011904294  ->   0.48732926103896828546424341029492468100431414072994 Inexact Rounded\r
+logx2529 log10 352.66392670788816474407442785460803833927136413943  ->   2.5473610388199562714709836398243933320284077008314 Inexact Rounded\r
+logx2530 log10 0.00304743125181876267210516527361742185617091801650 ->  -2.5160660830163981967774124745311497447050056400207 Inexact Rounded\r
+logx2531 log10 0.00000076120535894952136499250364604538117729437183 ->  -6.1184981629047051532448413863950776496652483019415 Inexact Rounded\r
+logx2532 log10 769.88795978534353052965286195053735007473187735815  ->   2.8864275277862652709986498581064117950288798222100 Inexact Rounded\r
+logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded\r
+logx2534 log10 860.88864595714426940247940960258558876903741966974  ->   2.9349469800554277915920278090647283233440859155176 Inexact Rounded\r
+logx2535 log10 5839.0328812994787235900178587371051096898683972444  ->   3.7663409208972392569269125539438874737147906238543 Inexact Rounded\r
+logx2536 log10 0.00000028532710151284840471670497112821201598377841 ->  -6.5446569753514027675878879843238065488490618159490 Inexact Rounded\r
+logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded\r
+logx2538 log10 5.8610949526439529489252302463450302981511714144330  ->   0.76797875722452549281028552067645732490929361952278 Inexact Rounded\r
+logx2539 log10 6.6282432221115923372151148990137179611977576327206  ->   0.82139843639227213211012044000785757267155736071361 Inexact Rounded\r
+logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded\r
+\r
+-- P=34, within 0-9999\r
+Precision: 34\r
+logx2201 log10 1.522513203889714179088327328864183  -> 0.1825610677098896250496651330492109 Inexact Rounded\r
+logx2202 log10 0.171123774769717316154080888930404  -> -0.7666896483548462582461898092764408 Inexact Rounded\r
+logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded\r
+logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded\r
+logx2205 log10 1.938274868738032930709498221236758  -> 0.2874153648259449520201536171714594 Inexact Rounded\r
+logx2206 log10 479.5667847823826713082613445010097  -> 2.680849095850361068709165157286435 Inexact Rounded\r
+logx2207 log10 8856.136599178820202141823157336804  -> 3.947244306584767101480454261950559 Inexact Rounded\r
+logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded\r
+logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded\r
+logx2210 log10 6.962605370078885647639503548229695  -> 0.8427717807200322352686396925992250 Inexact Rounded\r
+logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded\r
+logx2212 log10 2.079864257474859008252165836663504  -> 0.3180349916198059046812506741388856 Inexact Rounded\r
+logx2213 log10 2805.479529292939499220276986621988  -> 3.448007104139974344565978780624744 Inexact Rounded\r
+logx2214 log10 66.45731133034187374557028537213949  -> 1.822542767005644041661520936223086 Inexact Rounded\r
+logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded\r
+logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded\r
+logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded\r
+logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded\r
+logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded\r
+logx2220 log10 14.12936879385863410081087750645856  -> 1.150122760895466989841057385742662 Inexact Rounded\r
+logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded\r
+logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded\r
+logx2223 log10 7080.122562705399744969319589806194  -> 3.850040775747103318724330047546916 Inexact Rounded\r
+logx2224 log10 261.3491411363679209175524790255725  -> 2.417221077227536319655699517530855 Inexact Rounded\r
+logx2225 log10 003.9945581449915240094728380041494  -> 0.6014687471531988260823066997845691 Inexact Rounded\r
+logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded\r
+logx2227 log10 9567.961832607240278342761088487484  -> 3.980819434211107631569386147016368 Inexact Rounded\r
+logx2228 log10 06.26592979160342972777219828867033  -> 0.7969855243966221408595024012574729 Inexact Rounded\r
+logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded\r
+logx2230 log10 567.9388648235589204769442863724997  -> 2.754301589058313576472380262907638 Inexact Rounded\r
+logx2231 log10 039.7790325480037778918162264883415  -> 1.599654216592019199639285308997886 Inexact Rounded\r
+logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded\r
+logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded\r
+logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded\r
+logx2235 log10 260.2400250475967528429943779126507  -> 2.415374092073799204236801383070064 Inexact Rounded\r
+logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded\r
+logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded\r
+logx2238 log10 60.24078375568814769010333711509928  -> 1.779890613567084253168373266648922 Inexact Rounded\r
+logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded\r
+logx2240 log10 230.9450930197841600611503095185600  -> 2.363508739056822846742942599628966 Inexact Rounded\r
+\r
+-- P=16, within 0-999\r
+Precision: 16\r
+logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded\r
+logx2102 log10 503.6828482226624  -> 2.702157162195652 Inexact Rounded\r
+logx2103 log10 64.96074447821815  -> 1.812650993464174 Inexact Rounded\r
+logx2104 log10 48.75408597467246  -> 1.688011018842600 Inexact Rounded\r
+logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded\r
+logx2106 log10 223.5320415060633  -> 2.349339784523410 Inexact Rounded\r
+logx2107 log10 73.12765002292194  -> 1.864081617476268 Inexact Rounded\r
+logx2108 log10 487.3749378358509  -> 2.687863192802252 Inexact Rounded\r
+logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded\r
+logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded\r
+logx2111 log10 33.10311638788998  -> 1.519868880976773 Inexact Rounded\r
+logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded\r
+logx2113 log10 258.9416193626484  -> 2.413201859654145 Inexact Rounded\r
+logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded\r
+logx2115 log10 65.78490393408572  -> 1.818126244825109 Inexact Rounded\r
+logx2116 log10 504.2328842073510  -> 2.702631165346958 Inexact Rounded\r
+logx2117 log10 9.417432755815027  -> 0.9739325278524503 Inexact Rounded\r
+logx2118 log10 006.7054835355498  -> 0.8264301004947640 Inexact Rounded\r
+logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded\r
+logx2120 log10 5.959404385244921  -> 0.7752028561953401 Inexact Rounded\r
+logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded\r
+logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded\r
+logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded\r
+logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded\r
+logx2125 log10 88.06005885607414  -> 1.944778971389913 Inexact Rounded\r
+logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded\r
+logx2127 log10 3.419622484059565  -> 0.5339781639101145 Inexact Rounded\r
+logx2128 log10 5.171123353858721  -> 0.7135848977142854 Inexact Rounded\r
+logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded\r
+logx2130 log10 46.21086703136966  -> 1.664744117045149 Inexact Rounded\r
+logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded\r
+logx2132 log10 78.66019196870698  -> 1.895755001962469 Inexact Rounded\r
+logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded\r
+logx2134 log10 45.52509819928536  -> 1.658250891256892 Inexact Rounded\r
+logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded\r
+logx2136 log10 26.24438641426669  -> 1.419036423550599 Inexact Rounded\r
+logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded\r
+logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded\r
+logx2139 log10 8.417059176469655  -> 0.9251603805112778 Inexact Rounded\r
+logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded\r
+\r
+-- P=7, within 0-99\r
+Precision: 7\r
+logx2001 log10 57.26089  -> 1.757858 Inexact Rounded\r
+logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded\r
+logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded\r
+logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded\r
+logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded\r
+logx2006 log10 9.926963  -> 0.9968164 Inexact Rounded\r
+logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded\r
+logx2008 log10 84.15412  -> 1.925075 Inexact Rounded\r
+logx2009 log10 2.466856  -> 0.3921438 Inexact Rounded\r
+logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded\r
+logx2011 log10 9.885154  -> 0.9949834 Inexact Rounded\r
+logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded\r
+logx2013 log10 34.65736  -> 1.539795 Inexact Rounded\r
+logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded\r
+logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded\r
+logx2016 log10 66.01407  -> 1.819637 Inexact Rounded\r
+logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded\r
+logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded\r
+logx2019 log10 9.838983  -> 0.9929502 Inexact Rounded\r
+logx2020 log10 15.89696  -> 1.201314 Inexact Rounded\r
+logx2021 log10 8.459247  -> 0.9273317 Inexact Rounded\r
+logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded\r
+logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded\r
+logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded\r
+logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded\r
+logx2026 log10 51.11152  -> 1.708519 Inexact Rounded\r
+logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded\r
+logx2028 log10 2.254721  -> 0.3530928 Inexact Rounded\r
+logx2029 log10 6.568444  -> 0.8174625 Inexact Rounded\r
+logx2030 log10 83.72639  -> 1.922862 Inexact Rounded\r
+logx2031 log10 6.720585  -> 0.8274071 Inexact Rounded\r
+logx2032 log10 87.90366  -> 1.944007 Inexact Rounded\r
+logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded\r
+logx2034 log10 34.63912  -> 1.539567 Inexact Rounded\r
+logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded\r
+logx2036 log10 7.793405  -> 0.8917272 Inexact Rounded\r
+logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded\r
+logx2038 log10 7.135417  -> 0.8534194 Inexact Rounded\r
+logx2039 log10 12.49570  -> 1.096761 Inexact Rounded\r
+logx2040 log10 6.356276  -> 0.8032027 Inexact Rounded\r
+\r
+--------\r
+maxExponent: 384\r
+minExponent: -383\r
+precision:   16\r
+rounding:    half_even\r
+\r
+-- special values\r
+logx820  log10   Infinity ->   Infinity\r
+logx821  log10   0        ->  -Infinity\r
+logx822  log10   NaN      ->   NaN\r
+logx823  log10   sNaN     ->   NaN     Invalid_operation\r
+-- propagating NaNs\r
+logx824  log10   sNaN123  ->   NaN123  Invalid_operation\r
+logx825  log10   -sNaN321 ->  -NaN321  Invalid_operation\r
+logx826  log10   NaN456   ->   NaN456\r
+logx827  log10   -NaN654  ->  -NaN654\r
+logx828  log10   NaN1     ->   NaN1\r
+\r
+\r
+-- Invalid operations due to restrictions\r
+-- [next two probably skipped by most test harnesses]\r
+precision: 100000000\r
+logx901  log10 1 ->  NaN            Invalid_context\r
+precision:  99999999\r
+logx902  log10 0 ->  NaN            Invalid_context\r
+\r
+precision: 9\r
+maxExponent:   1000000\r
+minExponent:   -999999\r
+logx903  log10 1   ->  NaN            Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999999\r
+logx904  log10 0 ->  -Infinity\r
+maxExponent:    999999\r
+minExponent:  -1000000\r
+logx905  log10 1   ->  NaN            Invalid_context\r
+maxExponent:    999999\r
+minExponent:   -999998\r
+logx906  log10 0 ->  -Infinity\r
+\r
+-- Null test\r
+logx900  log10 #   -> NaN Invalid_operation\r
+\r
+\r
diff --git a/Lib/test/decimaltestdata/logb.decTest b/Lib/test/decimaltestdata/logb.decTest
new file mode 100644 (file)
index 0000000..577f7a4
--- /dev/null
@@ -0,0 +1,162 @@
+------------------------------------------------------------------------\r
+-- logb.decTest -- return integral adjusted exponent as per 754r      --\r
+-- Copyright (c) IBM Corporation, 2005, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This emphasises the testing of notable cases, as they will often\r
+-- have unusual paths (especially the 10**n results).\r
+\r
+extended:    1\r
+rounding:    half_even\r
+maxExponent: 999\r
+minexponent: -999\r
+\r
+-- basics & examples\r
+precision:   9\r
+logbx001 logb  0                 -> -Infinity  Division_by_zero\r
+logbx002 logb  1E-999            -> -999\r
+logbx003 logb  9E-999            -> -999\r
+logbx004 logb  0.001             -> -3\r
+logbx005 logb  0.03              -> -2\r
+logbx006 logb  1                 ->  0\r
+logbx007 logb  2                 ->  0\r
+logbx008 logb  2.5               ->  0\r
+logbx009 logb  2.50              ->  0\r
+logbx010 logb  10                ->  1\r
+logbx011 logb  70                ->  1\r
+logbx012 logb  100               ->  2\r
+logbx013 logb  250               ->  2\r
+logbx014 logb +Infinity          ->  Infinity\r
+\r
+-- negatives are treated as positives\r
+logbx021 logb -0                 -> -Infinity  Division_by_zero\r
+logbx022 logb -1E-999            -> -999\r
+logbx023 logb -9E-999            -> -999\r
+logbx024 logb -0.001             -> -3\r
+logbx025 logb -1                 ->  0\r
+logbx026 logb -2                 ->  0\r
+logbx027 logb -10                ->  1\r
+logbx028 logb -70                ->  1\r
+logbx029 logb -100               ->  2\r
+logbx030 logb -100000000         ->  8\r
+logbx031 logb -Infinity          ->  Infinity\r
+\r
+-- zeros\r
+logbx111 logb          0   -> -Infinity  Division_by_zero\r
+logbx112 logb         -0   -> -Infinity  Division_by_zero\r
+logbx113 logb       0E+4   -> -Infinity  Division_by_zero\r
+logbx114 logb      -0E+4   -> -Infinity  Division_by_zero\r
+logbx115 logb     0.0000   -> -Infinity  Division_by_zero\r
+logbx116 logb    -0.0000   -> -Infinity  Division_by_zero\r
+logbx117 logb      0E-141  -> -Infinity  Division_by_zero\r
+logbx118 logb     -0E-141  -> -Infinity  Division_by_zero\r
+\r
+-- full coefficients, alternating bits\r
+logbx121 logb   268268268        -> 8\r
+logbx122 logb  -268268268        -> 8\r
+logbx123 logb   134134134        -> 8\r
+logbx124 logb  -134134134        -> 8\r
+\r
+-- Nmax, Nmin, Ntiny\r
+logbx131 logb  9.99999999E+999   -> 999\r
+logbx132 logb  1E-999            -> -999\r
+logbx133 logb  1.00000000E-999   -> -999\r
+logbx134 logb  1E-1007           -> -1007\r
+\r
+logbx135 logb  -1E-1007          -> -1007\r
+logbx136 logb  -1.00000000E-999  -> -999\r
+logbx137 logb  -1E-999           -> -999\r
+logbx138 logb  -9.99999999E+999  ->  999\r
+\r
+-- ones\r
+logbx0061 logb  1                 ->   0\r
+logbx0062 logb  1.0               ->   0\r
+logbx0063 logb  1.000000000000000 ->   0\r
+logbx0064 logb  1.000000000000000000 ->   0\r
+\r
+-- notable cases -- exact powers of 10\r
+logbx1100 logb 1             -> 0\r
+logbx1101 logb 10            -> 1\r
+logbx1102 logb 100           -> 2\r
+logbx1103 logb 1000          -> 3\r
+logbx1104 logb 10000         -> 4\r
+logbx1105 logb 100000        -> 5\r
+logbx1106 logb 1000000       -> 6\r
+logbx1107 logb 10000000      -> 7\r
+logbx1108 logb 100000000     -> 8\r
+logbx1109 logb 1000000000    -> 9\r
+logbx1110 logb 10000000000   -> 10\r
+logbx1111 logb 100000000000  -> 11\r
+logbx1112 logb 1000000000000 -> 12\r
+logbx1113 logb 0.00000000001 -> -11\r
+logbx1114 logb 0.0000000001 -> -10\r
+logbx1115 logb 0.000000001 -> -9\r
+logbx1116 logb 0.00000001 -> -8\r
+logbx1117 logb 0.0000001 -> -7\r
+logbx1118 logb 0.000001 -> -6\r
+logbx1119 logb 0.00001 -> -5\r
+logbx1120 logb 0.0001 -> -4\r
+logbx1121 logb 0.001 -> -3\r
+logbx1122 logb 0.01 -> -2\r
+logbx1123 logb 0.1 -> -1\r
+logbx1124 logb 1E-99  -> -99\r
+logbx1125 logb 1E-100 -> -100\r
+logbx1126 logb 1E-383 -> -383\r
+logbx1127 logb 1E-999 -> -999\r
+\r
+-- suggestions from Ilan Nehama\r
+logbx1400 logb 10E-3    -> -2\r
+logbx1401 logb 10E-2    -> -1\r
+logbx1402 logb 100E-2   ->  0\r
+logbx1403 logb 1000E-2  ->  1\r
+logbx1404 logb 10000E-2 ->  2\r
+logbx1405 logb 10E-1    ->  0\r
+logbx1406 logb 100E-1   ->  1\r
+logbx1407 logb 1000E-1  ->  2\r
+logbx1408 logb 10000E-1 ->  3\r
+logbx1409 logb 10E0     ->  1\r
+logbx1410 logb 100E0    ->  2\r
+logbx1411 logb 1000E0   ->  3\r
+logbx1412 logb 10000E0  ->  4\r
+logbx1413 logb 10E1     ->  2\r
+logbx1414 logb 100E1    ->  3\r
+logbx1415 logb 1000E1   ->  4\r
+logbx1416 logb 10000E1  ->  5\r
+logbx1417 logb 10E2     ->  3\r
+logbx1418 logb 100E2    ->  4\r
+logbx1419 logb 1000E2   ->  5\r
+logbx1420 logb 10000E2  ->  6\r
+\r
+-- special values\r
+logbx820  logb   Infinity ->   Infinity\r
+logbx821  logb  -Infinity ->   Infinity\r
+logbx822  logb   0        ->  -Infinity Division_by_zero\r
+logbx823  logb   NaN      ->   NaN\r
+logbx824  logb   sNaN     ->   NaN     Invalid_operation\r
+-- propagating NaNs\r
+logbx825  logb   sNaN123  ->   NaN123  Invalid_operation\r
+logbx826  logb   -sNaN321 ->  -NaN321  Invalid_operation\r
+logbx827  logb   NaN456   ->   NaN456\r
+logbx828  logb   -NaN654  ->  -NaN654\r
+logbx829  logb   NaN1     ->   NaN1\r
+\r
+-- Null test\r
+logbx900  logb #   -> NaN Invalid_operation\r
+\r
+\r
index 9798ae2aaa2ddd803aecc024aad8065c823a5449..88d0b5e1b1bd6f567d8e28be4e04c4e698a4c3fe 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- max.decTest -- decimal maximum                                     --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- we assume that base comparison is tested in compare.decTest, so
 -- these mainly cover special cases and rounding
@@ -331,6 +331,33 @@ maxx465 max -1E+3   1000    ->  1000
 maxx466 max -1000  -1E+3    -> -1000
 maxx467 max -1E+3  -1000    -> -1000
 
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+maxx470 max  1      .5     ->  1
+maxx471 max  10     5      ->  10
+maxx472 max  100    50     ->  100
+maxx473 max  1000   500    ->  1.00E+3 Rounded
+maxx474 max  10000  5000   ->  1.00E+4 Rounded
+maxx475 max  6      .5     ->  6
+maxx476 max  66     5      ->  66
+maxx477 max  666    50     ->  666
+maxx478 max  6666   500    ->  6.67E+3 Rounded Inexact
+maxx479 max  66666  5000   ->  6.67E+4 Rounded Inexact
+maxx480 max  33333  5000   ->  3.33E+4 Rounded Inexact
+maxx481 max  .5     1      ->  1
+maxx482 max  .5     10     ->  10
+maxx483 max  .5     100    ->  100
+maxx484 max  .5     1000   ->  1.00E+3 Rounded
+maxx485 max  .5     10000  ->  1.00E+4 Rounded
+maxx486 max  .5     6      ->  6
+maxx487 max  .5     66     ->  66
+maxx488 max  .5     666    ->  666
+maxx489 max  .5     6666   ->  6.67E+3 Rounded Inexact
+maxx490 max  .5     66666  ->  6.67E+4 Rounded Inexact
+maxx491 max  .5     33333  ->  3.33E+4 Rounded Inexact
 
 -- overflow tests
 maxexponent: 999999999
@@ -348,13 +375,13 @@ maxx511 max  0.1E-999        0  ->   1E-1000   Subnormal
 maxx512 max  0.10E-999       0  ->   1.0E-1000 Subnormal
 maxx513 max  0.100E-999      0  ->   1.0E-1000 Subnormal Rounded
 maxx514 max  0.01E-999       0  ->   1E-1001   Subnormal
--- next is rounded to Emin
+-- next is rounded to Nmin
 maxx515 max  0.999E-999      0  ->   1.00E-999 Inexact Rounded Subnormal Underflow
 maxx516 max  0.099E-999      0  ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 maxx517 max  0.009E-999      0  ->   1E-1001   Inexact Rounded Subnormal Underflow
-maxx518 max  0.001E-999      0  ->   0E-1001   Inexact Rounded Subnormal Underflow
-maxx519 max  0.0009E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow
-maxx520 max  0.0001E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow
+maxx518 max  0.001E-999      0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+maxx519 max  0.0009E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+maxx520 max  0.0001E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 maxx530 max -1.00E-999       0  ->   0
 maxx531 max -0.1E-999        0  ->   0
@@ -368,6 +395,27 @@ maxx538 max -0.001E-999      0  ->   0
 maxx539 max -0.0009E-999     0  ->   0
 maxx540 max -0.0001E-999     0  ->   0
 
+-- misalignment traps for little-endian
+precision: 9
+maxx551 max      1.0       0.1  -> 1.0
+maxx552 max      0.1       1.0  -> 1.0
+maxx553 max     10.0       0.1  -> 10.0
+maxx554 max      0.1      10.0  -> 10.0
+maxx555 max      100       1.0  -> 100
+maxx556 max      1.0       100  -> 100
+maxx557 max     1000      10.0  -> 1000
+maxx558 max     10.0      1000  -> 1000
+maxx559 max    10000     100.0  -> 10000
+maxx560 max    100.0     10000  -> 10000
+maxx661 max   100000    1000.0  -> 100000
+maxx662 max   1000.0    100000  -> 100000
+maxx663 max  1000000   10000.0  -> 1000000
+maxx664 max  10000.0   1000000  -> 1000000
+
+-- payload decapitate
+precision: 5
+maxx670 max      11 -sNaN12345678901 -> -NaN78901  Invalid_operation
+
 -- Null tests
 maxx900 max 10  #  -> NaN Invalid_operation
 maxx901 max  # 10  -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/maxmag.decTest b/Lib/test/decimaltestdata/maxmag.decTest
new file mode 100644 (file)
index 0000000..b14d015
--- /dev/null
@@ -0,0 +1,404 @@
+------------------------------------------------------------------------\r
+-- maxmag.decTest -- decimal maximum by magnitude                     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- sanity checks\r
+mxgx001 maxmag  -2  -2  -> -2\r
+mxgx002 maxmag  -2  -1  -> -2\r
+mxgx003 maxmag  -2   0  -> -2\r
+mxgx004 maxmag  -2   1  -> -2\r
+mxgx005 maxmag  -2   2  ->  2\r
+mxgx006 maxmag  -1  -2  -> -2\r
+mxgx007 maxmag  -1  -1  -> -1\r
+mxgx008 maxmag  -1   0  -> -1\r
+mxgx009 maxmag  -1   1  ->  1\r
+mxgx010 maxmag  -1   2  ->  2\r
+mxgx011 maxmag   0  -2  -> -2\r
+mxgx012 maxmag   0  -1  -> -1\r
+mxgx013 maxmag   0   0  ->  0\r
+mxgx014 maxmag   0   1  ->  1\r
+mxgx015 maxmag   0   2  ->  2\r
+mxgx016 maxmag   1  -2  -> -2\r
+mxgx017 maxmag   1  -1  ->  1\r
+mxgx018 maxmag   1   0  ->  1\r
+mxgx019 maxmag   1   1  ->  1\r
+mxgx020 maxmag   1   2  ->  2\r
+mxgx021 maxmag   2  -2  ->  2\r
+mxgx022 maxmag   2  -1  ->  2\r
+mxgx023 maxmag   2   0  ->  2\r
+mxgx025 maxmag   2   1  ->  2\r
+mxgx026 maxmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+mxgx030 maxmag   0     0   ->  0\r
+mxgx031 maxmag   0    -0   ->  0\r
+mxgx032 maxmag   0    -0.0 ->  0\r
+mxgx033 maxmag   0     0.0 ->  0\r
+mxgx034 maxmag  -0     0   ->  0    -- note: -0 = 0, but 0 chosen\r
+mxgx035 maxmag  -0    -0   -> -0\r
+mxgx036 maxmag  -0    -0.0 -> -0.0\r
+mxgx037 maxmag  -0     0.0 ->  0.0\r
+mxgx038 maxmag   0.0   0   ->  0\r
+mxgx039 maxmag   0.0  -0   ->  0.0\r
+mxgx040 maxmag   0.0  -0.0 ->  0.0\r
+mxgx041 maxmag   0.0   0.0 ->  0.0\r
+mxgx042 maxmag  -0.0   0   ->  0\r
+mxgx043 maxmag  -0.0  -0   -> -0.0\r
+mxgx044 maxmag  -0.0  -0.0 -> -0.0\r
+mxgx045 maxmag  -0.0   0.0 ->  0.0\r
+\r
+mxgx050 maxmag  -0E1   0E1 ->  0E+1\r
+mxgx051 maxmag  -0E2   0E2 ->  0E+2\r
+mxgx052 maxmag  -0E2   0E1 ->  0E+1\r
+mxgx053 maxmag  -0E1   0E2 ->  0E+2\r
+mxgx054 maxmag   0E1  -0E1 ->  0E+1\r
+mxgx055 maxmag   0E2  -0E2 ->  0E+2\r
+mxgx056 maxmag   0E2  -0E1 ->  0E+2\r
+mxgx057 maxmag   0E1  -0E2 ->  0E+1\r
+\r
+mxgx058 maxmag   0E1   0E1 ->  0E+1\r
+mxgx059 maxmag   0E2   0E2 ->  0E+2\r
+mxgx060 maxmag   0E2   0E1 ->  0E+2\r
+mxgx061 maxmag   0E1   0E2 ->  0E+2\r
+mxgx062 maxmag  -0E1  -0E1 -> -0E+1\r
+mxgx063 maxmag  -0E2  -0E2 -> -0E+2\r
+mxgx064 maxmag  -0E2  -0E1 -> -0E+1\r
+mxgx065 maxmag  -0E1  -0E2 -> -0E+1\r
+\r
+-- Specials\r
+precision: 9\r
+mxgx090 maxmag  Inf  -Inf   ->  Infinity\r
+mxgx091 maxmag  Inf  -1000  ->  Infinity\r
+mxgx092 maxmag  Inf  -1     ->  Infinity\r
+mxgx093 maxmag  Inf  -0     ->  Infinity\r
+mxgx094 maxmag  Inf   0     ->  Infinity\r
+mxgx095 maxmag  Inf   1     ->  Infinity\r
+mxgx096 maxmag  Inf   1000  ->  Infinity\r
+mxgx097 maxmag  Inf   Inf   ->  Infinity\r
+mxgx098 maxmag -1000  Inf   ->  Infinity\r
+mxgx099 maxmag -Inf   Inf   ->  Infinity\r
+mxgx100 maxmag -1     Inf   ->  Infinity\r
+mxgx101 maxmag -0     Inf   ->  Infinity\r
+mxgx102 maxmag  0     Inf   ->  Infinity\r
+mxgx103 maxmag  1     Inf   ->  Infinity\r
+mxgx104 maxmag  1000  Inf   ->  Infinity\r
+mxgx105 maxmag  Inf   Inf   ->  Infinity\r
+\r
+mxgx120 maxmag -Inf  -Inf   -> -Infinity\r
+mxgx121 maxmag -Inf  -1000  -> -Infinity\r
+mxgx122 maxmag -Inf  -1     -> -Infinity\r
+mxgx123 maxmag -Inf  -0     -> -Infinity\r
+mxgx124 maxmag -Inf   0     -> -Infinity\r
+mxgx125 maxmag -Inf   1     -> -Infinity\r
+mxgx126 maxmag -Inf   1000  -> -Infinity\r
+mxgx127 maxmag -Inf   Inf   ->  Infinity\r
+mxgx128 maxmag -Inf  -Inf   -> -Infinity\r
+mxgx129 maxmag -1000 -Inf   -> -Infinity\r
+mxgx130 maxmag -1    -Inf   -> -Infinity\r
+mxgx131 maxmag -0    -Inf   -> -Infinity\r
+mxgx132 maxmag  0    -Inf   -> -Infinity\r
+mxgx133 maxmag  1    -Inf   -> -Infinity\r
+mxgx134 maxmag  1000 -Inf   -> -Infinity\r
+mxgx135 maxmag  Inf  -Inf   ->  Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+mxgx141 maxmag  NaN -Inf    -> -Infinity\r
+mxgx142 maxmag  NaN -1000   -> -1000\r
+mxgx143 maxmag  NaN -1      -> -1\r
+mxgx144 maxmag  NaN -0      -> -0\r
+mxgx145 maxmag  NaN  0      ->  0\r
+mxgx146 maxmag  NaN  1      ->  1\r
+mxgx147 maxmag  NaN  1000   ->  1000\r
+mxgx148 maxmag  NaN  Inf    ->  Infinity\r
+mxgx149 maxmag  NaN  NaN    ->  NaN\r
+mxgx150 maxmag -Inf  NaN    -> -Infinity\r
+mxgx151 maxmag -1000 NaN    -> -1000\r
+mxgx152 maxmag -1    NaN    -> -1\r
+mxgx153 maxmag -0    NaN    -> -0\r
+mxgx154 maxmag  0    NaN    ->  0\r
+mxgx155 maxmag  1    NaN    ->  1\r
+mxgx156 maxmag  1000 NaN    ->  1000\r
+mxgx157 maxmag  Inf  NaN    ->  Infinity\r
+\r
+mxgx161 maxmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+mxgx162 maxmag  sNaN -1000  ->  NaN  Invalid_operation\r
+mxgx163 maxmag  sNaN -1     ->  NaN  Invalid_operation\r
+mxgx164 maxmag  sNaN -0     ->  NaN  Invalid_operation\r
+mxgx165 maxmag  sNaN  0     ->  NaN  Invalid_operation\r
+mxgx166 maxmag  sNaN  1     ->  NaN  Invalid_operation\r
+mxgx167 maxmag  sNaN  1000  ->  NaN  Invalid_operation\r
+mxgx168 maxmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+mxgx169 maxmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+mxgx170 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+mxgx171 maxmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+mxgx172 maxmag -1000 sNaN   ->  NaN  Invalid_operation\r
+mxgx173 maxmag -1    sNaN   ->  NaN  Invalid_operation\r
+mxgx174 maxmag -0    sNaN   ->  NaN  Invalid_operation\r
+mxgx175 maxmag  0    sNaN   ->  NaN  Invalid_operation\r
+mxgx176 maxmag  1    sNaN   ->  NaN  Invalid_operation\r
+mxgx177 maxmag  1000 sNaN   ->  NaN  Invalid_operation\r
+mxgx178 maxmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+mxgx179 maxmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+mxgx181 maxmag  NaN9  -Inf   -> -Infinity\r
+mxgx182 maxmag  NaN8     9   ->  9\r
+mxgx183 maxmag -NaN7   Inf   ->  Infinity\r
+\r
+mxgx184 maxmag -NaN1   NaN11 -> -NaN1\r
+mxgx185 maxmag  NaN2   NaN12 ->  NaN2\r
+mxgx186 maxmag -NaN13 -NaN7  -> -NaN13\r
+mxgx187 maxmag  NaN14 -NaN5  ->  NaN14\r
+\r
+mxgx188 maxmag -Inf    NaN4  -> -Infinity\r
+mxgx189 maxmag -9     -NaN3  -> -9\r
+mxgx190 maxmag  Inf    NaN2  ->  Infinity\r
+\r
+mxgx191 maxmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+mxgx192 maxmag  sNaN98 -1      ->  NaN98 Invalid_operation\r
+mxgx193 maxmag -sNaN97  NaN    -> -NaN97 Invalid_operation\r
+mxgx194 maxmag  sNaN96 sNaN94  ->  NaN96 Invalid_operation\r
+mxgx195 maxmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+mxgx196 maxmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+mxgx197 maxmag  0      sNaN91  ->  NaN91 Invalid_operation\r
+mxgx198 maxmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+mxgx199 maxmag  NaN    sNaN89  ->  NaN89 Invalid_operation\r
+\r
+-- rounding checks\r
+maxexponent: 999\r
+minexponent: -999\r
+precision: 9\r
+mxgx201 maxmag 12345678000 1  -> 1.23456780E+10 Rounded\r
+mxgx202 maxmag 1 12345678000  -> 1.23456780E+10 Rounded\r
+mxgx203 maxmag 1234567800  1  -> 1.23456780E+9 Rounded\r
+mxgx204 maxmag 1 1234567800   -> 1.23456780E+9 Rounded\r
+mxgx205 maxmag 1234567890  1  -> 1.23456789E+9 Rounded\r
+mxgx206 maxmag 1 1234567890   -> 1.23456789E+9 Rounded\r
+mxgx207 maxmag 1234567891  1  -> 1.23456789E+9 Inexact Rounded\r
+mxgx208 maxmag 1 1234567891   -> 1.23456789E+9 Inexact Rounded\r
+mxgx209 maxmag 12345678901 1  -> 1.23456789E+10 Inexact Rounded\r
+mxgx210 maxmag 1 12345678901  -> 1.23456789E+10 Inexact Rounded\r
+mxgx211 maxmag 1234567896  1  -> 1.23456790E+9 Inexact Rounded\r
+mxgx212 maxmag 1 1234567896   -> 1.23456790E+9 Inexact Rounded\r
+mxgx213 maxmag -1234567891  1 -> -1.23456789E+9   Inexact Rounded\r
+mxgx214 maxmag 1 -1234567891  -> -1.23456789E+9   Inexact Rounded\r
+mxgx215 maxmag -12345678901 1 -> -1.23456789E+10  Inexact Rounded\r
+mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10  Inexact Rounded\r
+mxgx217 maxmag -1234567896  1 -> -1.23456790E+9   Inexact Rounded\r
+mxgx218 maxmag 1 -1234567896  -> -1.23456790E+9   Inexact Rounded\r
+\r
+precision: 15\r
+mxgx221 maxmag 12345678000 1  -> 12345678000\r
+mxgx222 maxmag 1 12345678000  -> 12345678000\r
+mxgx223 maxmag 1234567800  1  -> 1234567800\r
+mxgx224 maxmag 1 1234567800   -> 1234567800\r
+mxgx225 maxmag 1234567890  1  -> 1234567890\r
+mxgx226 maxmag 1 1234567890   -> 1234567890\r
+mxgx227 maxmag 1234567891  1  -> 1234567891\r
+mxgx228 maxmag 1 1234567891   -> 1234567891\r
+mxgx229 maxmag 12345678901 1  -> 12345678901\r
+mxgx230 maxmag 1 12345678901  -> 12345678901\r
+mxgx231 maxmag 1234567896  1  -> 1234567896\r
+mxgx232 maxmag 1 1234567896   -> 1234567896\r
+mxgx233 maxmag -1234567891  1 -> -1234567891\r
+mxgx234 maxmag 1 -1234567891  -> -1234567891\r
+mxgx235 maxmag -12345678901 1 -> -12345678901\r
+mxgx236 maxmag 1 -12345678901 -> -12345678901\r
+mxgx237 maxmag -1234567896  1 -> -1234567896\r
+mxgx238 maxmag 1 -1234567896  -> -1234567896\r
+\r
+-- from examples\r
+mxgx280 maxmag '3'   '2'  ->  '3'\r
+mxgx281 maxmag '-10' '3'  ->  '-10'\r
+mxgx282 maxmag '1.0' '1'  ->  '1'\r
+mxgx283 maxmag '1' '1.0'  ->  '1'\r
+mxgx284 maxmag '7' 'NaN'  ->  '7'\r
+\r
+-- overflow and underflow tests ...\r
+maxExponent: 999999999\r
+minexponent: -999999999\r
+mxgx330 maxmag +1.23456789012345E-0 9E+999999999 ->  9E+999999999\r
+mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 ->  9E+999999999\r
+mxgx332 maxmag +0.100 9E-999999999               ->  0.100\r
+mxgx333 maxmag 9E-999999999 +0.100               ->  0.100\r
+mxgx335 maxmag -1.23456789012345E-0 9E+999999999 ->  9E+999999999\r
+mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 ->  9E+999999999\r
+mxgx337 maxmag -0.100 9E-999999999               ->  -0.100\r
+mxgx338 maxmag 9E-999999999 -0.100               ->  -0.100\r
+\r
+mxgx339 maxmag 1e-599999999 1e-400000001   ->  1E-400000001\r
+mxgx340 maxmag 1e-599999999 1e-400000000   ->  1E-400000000\r
+mxgx341 maxmag 1e-600000000 1e-400000000   ->  1E-400000000\r
+mxgx342 maxmag 9e-999999998 0.01           ->  0.01\r
+mxgx343 maxmag 9e-999999998 0.1            ->  0.1\r
+mxgx344 maxmag 0.01 9e-999999998           ->  0.01\r
+mxgx345 maxmag 1e599999999 1e400000001     ->  1E+599999999\r
+mxgx346 maxmag 1e599999999 1e400000000     ->  1E+599999999\r
+mxgx347 maxmag 1e600000000 1e400000000     ->  1E+600000000\r
+mxgx348 maxmag 9e999999998 100             ->  9E+999999998\r
+mxgx349 maxmag 9e999999998 10              ->  9E+999999998\r
+mxgx350 maxmag 100  9e999999998            ->  9E+999999998\r
+-- signs\r
+mxgx351 maxmag  1e+777777777  1e+411111111 ->  1E+777777777\r
+mxgx352 maxmag  1e+777777777 -1e+411111111 ->  1E+777777777\r
+mxgx353 maxmag -1e+777777777  1e+411111111 -> -1E+777777777\r
+mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777\r
+mxgx355 maxmag  1e-777777777  1e-411111111 ->  1E-411111111\r
+mxgx356 maxmag  1e-777777777 -1e-411111111 -> -1E-411111111\r
+mxgx357 maxmag -1e-777777777  1e-411111111 ->  1E-411111111\r
+mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+mxgx401 maxmag  Inf    1.1     ->  Infinity\r
+mxgx402 maxmag  1.1    1       ->  1.1\r
+mxgx403 maxmag  1      1.0     ->  1\r
+mxgx404 maxmag  1.0    0.1     ->  1.0\r
+mxgx405 maxmag  0.1    0.10    ->  0.1\r
+mxgx406 maxmag  0.10   0.100   ->  0.10\r
+mxgx407 maxmag  0.10   0       ->  0.10\r
+mxgx408 maxmag  0      0.0     ->  0\r
+mxgx409 maxmag  0.0   -0       ->  0.0\r
+mxgx410 maxmag  0.0   -0.0     ->  0.0\r
+mxgx411 maxmag  0.00  -0.0     ->  0.00\r
+mxgx412 maxmag  0.0   -0.00    ->  0.0\r
+mxgx413 maxmag  0     -0.0     ->  0\r
+mxgx414 maxmag  0     -0       ->  0\r
+mxgx415 maxmag -0.0   -0       -> -0.0\r
+mxgx416 maxmag -0     -0.100   -> -0.100\r
+mxgx417 maxmag -0.100 -0.10    -> -0.100\r
+mxgx418 maxmag -0.10  -0.1     -> -0.10\r
+mxgx419 maxmag -0.1   -1.0     -> -1.0\r
+mxgx420 maxmag -1.0   -1       -> -1.0\r
+mxgx421 maxmag -1     -1.1     -> -1.1\r
+mxgx423 maxmag -1.1   -Inf     -> -Infinity\r
+-- same with operands reversed\r
+mxgx431 maxmag  1.1    Inf     ->  Infinity\r
+mxgx432 maxmag  1      1.1     ->  1.1\r
+mxgx433 maxmag  1.0    1       ->  1\r
+mxgx434 maxmag  0.1    1.0     ->  1.0\r
+mxgx435 maxmag  0.10   0.1     ->  0.1\r
+mxgx436 maxmag  0.100  0.10    ->  0.10\r
+mxgx437 maxmag  0      0.10    ->  0.10\r
+mxgx438 maxmag  0.0    0       ->  0\r
+mxgx439 maxmag -0      0.0     ->  0.0\r
+mxgx440 maxmag -0.0    0.0     ->  0.0\r
+mxgx441 maxmag -0.0    0.00    ->  0.00\r
+mxgx442 maxmag -0.00   0.0     ->  0.0\r
+mxgx443 maxmag -0.0    0       ->  0\r
+mxgx444 maxmag -0      0       ->  0\r
+mxgx445 maxmag -0     -0.0     -> -0.0\r
+mxgx446 maxmag -0.100 -0       -> -0.100\r
+mxgx447 maxmag -0.10  -0.100   -> -0.100\r
+mxgx448 maxmag -0.1   -0.10    -> -0.10\r
+mxgx449 maxmag -1.0   -0.1     -> -1.0\r
+mxgx450 maxmag -1     -1.0     -> -1.0\r
+mxgx451 maxmag -1.1   -1       -> -1.1\r
+mxgx453 maxmag -Inf   -1.1     -> -Infinity\r
+-- largies\r
+mxgx460 maxmag  1000   1E+3    ->  1E+3\r
+mxgx461 maxmag  1E+3   1000    ->  1E+3\r
+mxgx462 maxmag  1000  -1E+3    ->  1000\r
+mxgx463 maxmag  1E+3  -1000    ->  1E+3\r
+mxgx464 maxmag -1000   1E+3    ->  1E+3\r
+mxgx465 maxmag -1E+3   1000    ->  1000\r
+mxgx466 maxmag -1000  -1E+3    -> -1000\r
+mxgx467 maxmag -1E+3  -1000    -> -1000\r
+\r
+-- rounding (results treated as though plus)\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+precision: 3\r
+\r
+mxgx470 maxmag  1      .5     ->  1\r
+mxgx471 maxmag  10     5      ->  10\r
+mxgx472 maxmag  100    50     ->  100\r
+mxgx473 maxmag  1000   500    ->  1.00E+3 Rounded\r
+mxgx474 maxmag  10000  5000   ->  1.00E+4 Rounded\r
+mxgx475 maxmag  6      .5     ->  6\r
+mxgx476 maxmag  66     5      ->  66\r
+mxgx477 maxmag  666    50     ->  666\r
+mxgx478 maxmag  6666   500    ->  6.67E+3 Rounded Inexact\r
+mxgx479 maxmag  66666  5000   ->  6.67E+4 Rounded Inexact\r
+mxgx480 maxmag  33333  5000   ->  3.33E+4 Rounded Inexact\r
+mxgx481 maxmag  .5     1      ->  1\r
+mxgx482 maxmag  .5     10     ->  10\r
+mxgx483 maxmag  .5     100    ->  100\r
+mxgx484 maxmag  .5     1000   ->  1.00E+3 Rounded\r
+mxgx485 maxmag  .5     10000  ->  1.00E+4 Rounded\r
+mxgx486 maxmag  .5     6      ->  6\r
+mxgx487 maxmag  .5     66     ->  66\r
+mxgx488 maxmag  .5     666    ->  666\r
+mxgx489 maxmag  .5     6666   ->  6.67E+3 Rounded Inexact\r
+mxgx490 maxmag  .5     66666  ->  6.67E+4 Rounded Inexact\r
+mxgx491 maxmag  .5     33333  ->  3.33E+4 Rounded Inexact\r
+\r
+-- overflow tests\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+precision: 3\r
+mxgx500 maxmag 9.999E+999999999  0 ->  Infinity Inexact Overflow Rounded\r
+mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded\r
+\r
+-- subnormals and underflow\r
+precision: 3\r
+maxexponent: 999\r
+minexponent: -999\r
+mxgx510 maxmag  1.00E-999       0  ->   1.00E-999\r
+mxgx511 maxmag  0.1E-999        0  ->   1E-1000   Subnormal\r
+mxgx512 maxmag  0.10E-999       0  ->   1.0E-1000 Subnormal\r
+mxgx513 maxmag  0.100E-999      0  ->   1.0E-1000 Subnormal Rounded\r
+mxgx514 maxmag  0.01E-999       0  ->   1E-1001   Subnormal\r
+-- next is rounded to Nmin\r
+mxgx515 maxmag  0.999E-999      0  ->   1.00E-999 Inexact Rounded Subnormal Underflow\r
+mxgx516 maxmag  0.099E-999      0  ->   1.0E-1000 Inexact Rounded Subnormal Underflow\r
+mxgx517 maxmag  0.009E-999      0  ->   1E-1001   Inexact Rounded Subnormal Underflow\r
+mxgx518 maxmag  0.001E-999      0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+mxgx519 maxmag  0.0009E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+mxgx520 maxmag  0.0001E-999     0  ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+\r
+mxgx530 maxmag -1.00E-999       0  ->  -1.00E-999\r
+mxgx531 maxmag -0.1E-999        0  ->  -1E-1000   Subnormal\r
+mxgx532 maxmag -0.10E-999       0  ->  -1.0E-1000 Subnormal\r
+mxgx533 maxmag -0.100E-999      0  ->  -1.0E-1000 Subnormal Rounded\r
+mxgx534 maxmag -0.01E-999       0  ->  -1E-1001   Subnormal\r
+-- next is rounded to -Nmin\r
+mxgx535 maxmag -0.999E-999      0  ->  -1.00E-999 Inexact Rounded Subnormal Underflow\r
+mxgx536 maxmag -0.099E-999      0  ->  -1.0E-1000 Inexact Rounded Subnormal Underflow\r
+mxgx537 maxmag -0.009E-999      0  ->  -1E-1001   Inexact Rounded Subnormal Underflow\r
+mxgx538 maxmag -0.001E-999      0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+mxgx539 maxmag -0.0009E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+mxgx540 maxmag -0.0001E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped\r
+\r
+-- Null tests\r
+mxgx900 maxmag 10  #  -> NaN Invalid_operation\r
+mxgx901 maxmag  # 10  -> NaN Invalid_operation\r
+\r
+\r
+\r
index 60464016f156d300f6fde578d5514e2836a89f32..345e3ebd588579710fdd48b7f0fdfefd85052ab2 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- min.decTest -- decimal minimum                                     --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- we assume that base comparison is tested in compare.decTest, so
 -- these mainly cover special cases and rounding
@@ -320,6 +320,34 @@ mnmx465 min -1E+3   1000    -> -1E+3
 mnmx466 min -1000  -1E+3    -> -1E+3
 mnmx467 min -1E+3  -1000    -> -1E+3
 
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+mnmx470 min  1      5      ->  1
+mnmx471 min  10     50     ->  10
+mnmx472 min  100    500    ->  100
+mnmx473 min  1000   5000   ->  1.00E+3 Rounded
+mnmx474 min  10000  50000  ->  1.00E+4 Rounded
+mnmx475 min  6      50     ->  6
+mnmx476 min  66     500    ->  66
+mnmx477 min  666    5000   ->  666
+mnmx478 min  6666   50000  ->  6.67E+3 Rounded Inexact
+mnmx479 min  66666  500000 ->  6.67E+4 Rounded Inexact
+mnmx480 min  33333  500000 ->  3.33E+4 Rounded Inexact
+mnmx481 min  75401  1      ->  1
+mnmx482 min  75402  10     ->  10
+mnmx483 min  75403  100    ->  100
+mnmx484 min  75404  1000   ->  1.00E+3 Rounded
+mnmx485 min  75405  10000  ->  1.00E+4 Rounded
+mnmx486 min  75406  6      ->  6
+mnmx487 min  75407  66     ->  66
+mnmx488 min  75408  666    ->  666
+mnmx489 min  75409  6666   ->  6.67E+3 Rounded Inexact
+mnmx490 min  75410  66666  ->  6.67E+4 Rounded Inexact
+mnmx491 min  75411  33333  ->  3.33E+4 Rounded Inexact
+
 
 -- overflow tests
 maxexponent: 999999999
@@ -349,14 +377,30 @@ mnmx531 min -0.1E-999        0  ->  -1E-1000   Subnormal
 mnmx532 min -0.10E-999       0  ->  -1.0E-1000 Subnormal
 mnmx533 min -0.100E-999      0  ->  -1.0E-1000 Subnormal Rounded
 mnmx534 min -0.01E-999       0  ->  -1E-1001   Subnormal
--- next is rounded to Emin
+-- next is rounded to Nmin
 mnmx535 min -0.999E-999      0  ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 mnmx536 min -0.099E-999      0  ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 mnmx537 min -0.009E-999      0  ->  -1E-1001   Inexact Rounded Subnormal Underflow
-mnmx538 min -0.001E-999      0  ->  -0E-1001   Inexact Rounded Subnormal Underflow
-mnmx539 min -0.0009E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow
-mnmx540 min -0.0001E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow
+mnmx538 min -0.001E-999      0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+mnmx539 min -0.0009E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+mnmx540 min -0.0001E-999     0  ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
+-- misalignment traps for little-endian
+precision: 9
+mnmx551 min      1.0       0.1  -> 0.1
+mnmx552 min      0.1       1.0  -> 0.1
+mnmx553 min     10.0       0.1  -> 0.1
+mnmx554 min      0.1      10.0  -> 0.1
+mnmx555 min      100       1.0  -> 1.0
+mnmx556 min      1.0       100  -> 1.0
+mnmx557 min     1000      10.0  -> 10.0
+mnmx558 min     10.0      1000  -> 10.0
+mnmx559 min    10000     100.0  -> 100.0
+mnmx560 min    100.0     10000  -> 100.0
+mnmx561 min   100000    1000.0  -> 1000.0
+mnmx562 min   1000.0    100000  -> 1000.0
+mnmx563 min  1000000   10000.0  -> 10000.0
+mnmx564 min  10000.0   1000000  -> 10000.0
 
 -- Null tests
 mnm900 min 10  # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/minmag.decTest b/Lib/test/decimaltestdata/minmag.decTest
new file mode 100644 (file)
index 0000000..fa9d927
--- /dev/null
@@ -0,0 +1,390 @@
+------------------------------------------------------------------------\r
+-- minmag.decTest -- decimal minimum by magnitude                     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- we assume that base comparison is tested in compare.decTest, so\r
+-- these mainly cover special cases and rounding\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- sanity checks\r
+mngx001 minmag  -2  -2  -> -2\r
+mngx002 minmag  -2  -1  -> -1\r
+mngx003 minmag  -2   0  ->  0\r
+mngx004 minmag  -2   1  ->  1\r
+mngx005 minmag  -2   2  -> -2\r
+mngx006 minmag  -1  -2  -> -1\r
+mngx007 minmag  -1  -1  -> -1\r
+mngx008 minmag  -1   0  ->  0\r
+mngx009 minmag  -1   1  -> -1\r
+mngx010 minmag  -1   2  -> -1\r
+mngx011 minmag   0  -2  ->  0\r
+mngx012 minmag   0  -1  ->  0\r
+mngx013 minmag   0   0  ->  0\r
+mngx014 minmag   0   1  ->  0\r
+mngx015 minmag   0   2  ->  0\r
+mngx016 minmag   1  -2  ->  1\r
+mngx017 minmag   1  -1  -> -1\r
+mngx018 minmag   1   0  ->  0\r
+mngx019 minmag   1   1  ->  1\r
+mngx020 minmag   1   2  ->  1\r
+mngx021 minmag   2  -2  -> -2\r
+mngx022 minmag   2  -1  -> -1\r
+mngx023 minmag   2   0  ->  0\r
+mngx025 minmag   2   1  ->  1\r
+mngx026 minmag   2   2  ->  2\r
+\r
+-- extended zeros\r
+mngx030 minmag   0     0   ->  0\r
+mngx031 minmag   0    -0   -> -0\r
+mngx032 minmag   0    -0.0 -> -0.0\r
+mngx033 minmag   0     0.0 ->  0.0\r
+mngx034 minmag  -0     0   -> -0\r
+mngx035 minmag  -0    -0   -> -0\r
+mngx036 minmag  -0    -0.0 -> -0\r
+mngx037 minmag  -0     0.0 -> -0\r
+mngx038 minmag   0.0   0   ->  0.0\r
+mngx039 minmag   0.0  -0   -> -0\r
+mngx040 minmag   0.0  -0.0 -> -0.0\r
+mngx041 minmag   0.0   0.0 ->  0.0\r
+mngx042 minmag  -0.0   0   -> -0.0\r
+mngx043 minmag  -0.0  -0   -> -0\r
+mngx044 minmag  -0.0  -0.0 -> -0.0\r
+mngx045 minmag  -0.0   0.0 -> -0.0\r
+\r
+mngx046 minmag   0E1  -0E1 -> -0E+1\r
+mngx047 minmag  -0E1   0E2 -> -0E+1\r
+mngx048 minmag   0E2   0E1 ->  0E+1\r
+mngx049 minmag   0E1   0E2 ->  0E+1\r
+mngx050 minmag  -0E3  -0E2 -> -0E+3\r
+mngx051 minmag  -0E2  -0E3 -> -0E+3\r
+\r
+-- Specials\r
+precision: 9\r
+mngx090 minmag  Inf  -Inf   -> -Infinity\r
+mngx091 minmag  Inf  -1000  -> -1000\r
+mngx092 minmag  Inf  -1     -> -1\r
+mngx093 minmag  Inf  -0     -> -0\r
+mngx094 minmag  Inf   0     ->  0\r
+mngx095 minmag  Inf   1     ->  1\r
+mngx096 minmag  Inf   1000  ->  1000\r
+mngx097 minmag  Inf   Inf   ->  Infinity\r
+mngx098 minmag -1000  Inf   -> -1000\r
+mngx099 minmag -Inf   Inf   -> -Infinity\r
+mngx100 minmag -1     Inf   -> -1\r
+mngx101 minmag -0     Inf   -> -0\r
+mngx102 minmag  0     Inf   ->  0\r
+mngx103 minmag  1     Inf   ->  1\r
+mngx104 minmag  1000  Inf   ->  1000\r
+mngx105 minmag  Inf   Inf   ->  Infinity\r
+\r
+mngx120 minmag -Inf  -Inf   -> -Infinity\r
+mngx121 minmag -Inf  -1000  -> -1000\r
+mngx122 minmag -Inf  -1     -> -1\r
+mngx123 minmag -Inf  -0     -> -0\r
+mngx124 minmag -Inf   0     ->  0\r
+mngx125 minmag -Inf   1     ->  1\r
+mngx126 minmag -Inf   1000  ->  1000\r
+mngx127 minmag -Inf   Inf   -> -Infinity\r
+mngx128 minmag -Inf  -Inf   -> -Infinity\r
+mngx129 minmag -1000 -Inf   -> -1000\r
+mngx130 minmag -1    -Inf   -> -1\r
+mngx131 minmag -0    -Inf   -> -0\r
+mngx132 minmag  0    -Inf   ->  0\r
+mngx133 minmag  1    -Inf   ->  1\r
+mngx134 minmag  1000 -Inf   ->  1000\r
+mngx135 minmag  Inf  -Inf   -> -Infinity\r
+\r
+-- 2004.08.02 754r chooses number over NaN in mixed cases\r
+mngx141 minmag  NaN -Inf    ->  -Infinity\r
+mngx142 minmag  NaN -1000   ->  -1000\r
+mngx143 minmag  NaN -1      ->  -1\r
+mngx144 minmag  NaN -0      ->  -0\r
+mngx145 minmag  NaN  0      ->  0\r
+mngx146 minmag  NaN  1      ->  1\r
+mngx147 minmag  NaN  1000   ->  1000\r
+mngx148 minmag  NaN  Inf    ->  Infinity\r
+mngx149 minmag  NaN  NaN    ->  NaN\r
+mngx150 minmag -Inf  NaN    -> -Infinity\r
+mngx151 minmag -1000 NaN    -> -1000\r
+mngx152 minmag -1   -NaN    -> -1\r
+mngx153 minmag -0    NaN    -> -0\r
+mngx154 minmag  0   -NaN    ->  0\r
+mngx155 minmag  1    NaN    ->  1\r
+mngx156 minmag  1000 NaN    ->  1000\r
+mngx157 minmag  Inf  NaN    ->  Infinity\r
+\r
+mngx161 minmag  sNaN -Inf   ->  NaN  Invalid_operation\r
+mngx162 minmag  sNaN -1000  ->  NaN  Invalid_operation\r
+mngx163 minmag  sNaN -1     ->  NaN  Invalid_operation\r
+mngx164 minmag  sNaN -0     ->  NaN  Invalid_operation\r
+mngx165 minmag -sNaN  0     -> -NaN  Invalid_operation\r
+mngx166 minmag -sNaN  1     -> -NaN  Invalid_operation\r
+mngx167 minmag  sNaN  1000  ->  NaN  Invalid_operation\r
+mngx168 minmag  sNaN  NaN   ->  NaN  Invalid_operation\r
+mngx169 minmag  sNaN sNaN   ->  NaN  Invalid_operation\r
+mngx170 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+mngx171 minmag -Inf  sNaN   ->  NaN  Invalid_operation\r
+mngx172 minmag -1000 sNaN   ->  NaN  Invalid_operation\r
+mngx173 minmag -1    sNaN   ->  NaN  Invalid_operation\r
+mngx174 minmag -0    sNaN   ->  NaN  Invalid_operation\r
+mngx175 minmag  0    sNaN   ->  NaN  Invalid_operation\r
+mngx176 minmag  1    sNaN   ->  NaN  Invalid_operation\r
+mngx177 minmag  1000 sNaN   ->  NaN  Invalid_operation\r
+mngx178 minmag  Inf  sNaN   ->  NaN  Invalid_operation\r
+mngx179 minmag  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+mngx181 minmag  NaN9   -Inf   -> -Infinity\r
+mngx182 minmag -NaN8    9990  ->  9990\r
+mngx183 minmag  NaN71   Inf   ->  Infinity\r
+\r
+mngx184 minmag  NaN1    NaN54 ->  NaN1\r
+mngx185 minmag  NaN22  -NaN53 ->  NaN22\r
+mngx186 minmag -NaN3    NaN6  -> -NaN3\r
+mngx187 minmag -NaN44   NaN7  -> -NaN44\r
+\r
+mngx188 minmag -Inf     NaN41 -> -Infinity\r
+mngx189 minmag -9999   -NaN33 -> -9999\r
+mngx190 minmag  Inf     NaN2  ->  Infinity\r
+\r
+mngx191 minmag  sNaN99 -Inf    ->  NaN99 Invalid_operation\r
+mngx192 minmag  sNaN98 -11     ->  NaN98 Invalid_operation\r
+mngx193 minmag -sNaN97  NaN8   -> -NaN97 Invalid_operation\r
+mngx194 minmag  sNaN69 sNaN94  ->  NaN69 Invalid_operation\r
+mngx195 minmag  NaN95  sNaN93  ->  NaN93 Invalid_operation\r
+mngx196 minmag -Inf    sNaN92  ->  NaN92 Invalid_operation\r
+mngx197 minmag  088    sNaN91  ->  NaN91 Invalid_operation\r
+mngx198 minmag  Inf   -sNaN90  -> -NaN90 Invalid_operation\r
+mngx199 minmag  NaN    sNaN86  ->  NaN86 Invalid_operation\r
+\r
+-- rounding checks -- chosen is rounded, or not\r
+maxExponent: 999\r
+minexponent: -999\r
+precision: 9\r
+mngx201 minmag -12345678000 1  -> 1\r
+mngx202 minmag 1 -12345678000  -> 1\r
+mngx203 minmag -1234567800  1  -> 1\r
+mngx204 minmag 1 -1234567800   -> 1\r
+mngx205 minmag -1234567890  1  -> 1\r
+mngx206 minmag 1 -1234567890   -> 1\r
+mngx207 minmag -1234567891  1  -> 1\r
+mngx208 minmag 1 -1234567891   -> 1\r
+mngx209 minmag -12345678901 1  -> 1\r
+mngx210 minmag 1 -12345678901  -> 1\r
+mngx211 minmag -1234567896  1  -> 1\r
+mngx212 minmag 1 -1234567896   -> 1\r
+mngx213 minmag 1234567891  1   -> 1\r
+mngx214 minmag 1 1234567891    -> 1\r
+mngx215 minmag 12345678901 1   -> 1\r
+mngx216 minmag 1 12345678901   -> 1\r
+mngx217 minmag 1234567896  1   -> 1\r
+mngx218 minmag 1 1234567896    -> 1\r
+\r
+precision: 15\r
+mngx221 minmag -12345678000 1  -> 1\r
+mngx222 minmag 1 -12345678000  -> 1\r
+mngx223 minmag -1234567800  1  -> 1\r
+mngx224 minmag 1 -1234567800   -> 1\r
+mngx225 minmag -1234567890  1  -> 1\r
+mngx226 minmag 1 -1234567890   -> 1\r
+mngx227 minmag -1234567891  1  -> 1\r
+mngx228 minmag 1 -1234567891   -> 1\r
+mngx229 minmag -12345678901 1  -> 1\r
+mngx230 minmag 1 -12345678901  -> 1\r
+mngx231 minmag -1234567896  1  -> 1\r
+mngx232 minmag 1 -1234567896   -> 1\r
+mngx233 minmag 1234567891  1   -> 1\r
+mngx234 minmag 1 1234567891    -> 1\r
+mngx235 minmag 12345678901 1   -> 1\r
+mngx236 minmag 1 12345678901   -> 1\r
+mngx237 minmag 1234567896  1   -> 1\r
+mngx238 minmag 1 1234567896    -> 1\r
+\r
+-- from examples\r
+mngx280 minmag '3'   '2'  ->  '2'\r
+mngx281 minmag '-10' '3'  ->  '3'\r
+mngx282 minmag '1.0' '1'  ->  '1.0'\r
+mngx283 minmag '1' '1.0'  ->  '1.0'\r
+mngx284 minmag '7' 'NaN'  ->  '7'\r
+\r
+-- overflow and underflow tests .. subnormal results [inputs] now allowed\r
+maxExponent: 999999999\r
+minexponent: -999999999\r
+mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345\r
+mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345\r
+mngx332 minmag -0.100 -9E-999999999               -> -9E-999999999\r
+mngx333 minmag -9E-999999999 -0.100               -> -9E-999999999\r
+mngx335 minmag +1.23456789012345E-0 -9E+999999999 ->  1.23456789012345\r
+mngx336 minmag -9E+999999999 1.23456789012345E-0  ->  1.23456789012345\r
+mngx337 minmag +0.100 -9E-999999999               -> -9E-999999999\r
+mngx338 minmag -9E-999999999 0.100                -> -9E-999999999\r
+\r
+mngx339 minmag -1e-599999999 -1e-400000001   ->  -1E-599999999\r
+mngx340 minmag -1e-599999999 -1e-400000000   ->  -1E-599999999\r
+mngx341 minmag -1e-600000000 -1e-400000000   ->  -1E-600000000\r
+mngx342 minmag -9e-999999998 -0.01           ->  -9E-999999998\r
+mngx343 minmag -9e-999999998 -0.1            ->  -9E-999999998\r
+mngx344 minmag -0.01         -9e-999999998   ->  -9E-999999998\r
+mngx345 minmag -1e599999999  -1e400000001    ->  -1E+400000001\r
+mngx346 minmag -1e599999999  -1e400000000    ->  -1E+400000000\r
+mngx347 minmag -1e600000000  -1e400000000    ->  -1E+400000000\r
+mngx348 minmag -9e999999998  -100            ->  -100\r
+mngx349 minmag -9e999999998  -10             ->  -10\r
+mngx350 minmag -100          -9e999999998    ->  -100\r
+-- signs\r
+mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111\r
+mngx352 minmag -1e+777777777 +1e+411111111 ->  1E+411111111\r
+mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111\r
+mngx354 minmag +1e+777777777 +1e+411111111 ->  1E+411111111\r
+mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777\r
+mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777\r
+mngx357 minmag +1e-777777777 -1e-411111111 ->  1E-777777777\r
+mngx358 minmag +1e-777777777 +1e-411111111 ->  1E-777777777\r
+\r
+-- expanded list from min/max 754r purple prose\r
+-- [explicit tests for exponent ordering]\r
+mngx401 minmag  Inf    1.1     ->  1.1\r
+mngx402 minmag  1.1    1       ->  1\r
+mngx403 minmag  1      1.0     ->  1.0\r
+mngx404 minmag  1.0    0.1     ->  0.1\r
+mngx405 minmag  0.1    0.10    ->  0.10\r
+mngx406 minmag  0.10   0.100   ->  0.100\r
+mngx407 minmag  0.10   0       ->  0\r
+mngx408 minmag  0      0.0     ->  0.0\r
+mngx409 minmag  0.0   -0       -> -0\r
+mngx410 minmag  0.0   -0.0     -> -0.0\r
+mngx411 minmag  0.00  -0.0     -> -0.0\r
+mngx412 minmag  0.0   -0.00    -> -0.00\r
+mngx413 minmag  0     -0.0     -> -0.0\r
+mngx414 minmag  0     -0       -> -0\r
+mngx415 minmag -0.0   -0       -> -0\r
+mngx416 minmag -0     -0.100   -> -0\r
+mngx417 minmag -0.100 -0.10    -> -0.10\r
+mngx418 minmag -0.10  -0.1     -> -0.1\r
+mngx419 minmag -0.1   -1.0     -> -0.1\r
+mngx420 minmag -1.0   -1       -> -1\r
+mngx421 minmag -1     -1.1     -> -1\r
+mngx423 minmag -1.1   -Inf     -> -1.1\r
+-- same with operands reversed\r
+mngx431 minmag  1.1    Inf     ->  1.1\r
+mngx432 minmag  1      1.1     ->  1\r
+mngx433 minmag  1.0    1       ->  1.0\r
+mngx434 minmag  0.1    1.0     ->  0.1\r
+mngx435 minmag  0.10   0.1     ->  0.10\r
+mngx436 minmag  0.100  0.10    ->  0.100\r
+mngx437 minmag  0      0.10    ->  0\r
+mngx438 minmag  0.0    0       ->  0.0\r
+mngx439 minmag -0      0.0     -> -0\r
+mngx440 minmag -0.0    0.0     -> -0.0\r
+mngx441 minmag -0.0    0.00    -> -0.0\r
+mngx442 minmag -0.00   0.0     -> -0.00\r
+mngx443 minmag -0.0    0       -> -0.0\r
+mngx444 minmag -0      0       -> -0\r
+mngx445 minmag -0     -0.0     -> -0\r
+mngx446 minmag -0.100 -0       -> -0\r
+mngx447 minmag -0.10  -0.100   -> -0.10\r
+mngx448 minmag -0.1   -0.10    -> -0.1\r
+mngx449 minmag -1.0   -0.1     -> -0.1\r
+mngx450 minmag -1     -1.0     -> -1\r
+mngx451 minmag -1.1   -1       -> -1\r
+mngx453 minmag -Inf   -1.1     -> -1.1\r
+-- largies\r
+mngx460 minmag  1000   1E+3    ->  1000\r
+mngx461 minmag  1E+3   1000    ->  1000\r
+mngx462 minmag  1000  -1E+3    -> -1E+3\r
+mngx463 minmag  1E+3  -1000    -> -1000\r
+mngx464 minmag -1000   1E+3    -> -1000\r
+mngx465 minmag -1E+3   1000    -> -1E+3\r
+mngx466 minmag -1000  -1E+3    -> -1E+3\r
+mngx467 minmag -1E+3  -1000    -> -1E+3\r
+\r
+-- rounding (results treated as though plus)\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+precision: 3\r
+\r
+mngx470 minmag  1      5      ->  1\r
+mngx471 minmag  10     50     ->  10\r
+mngx472 minmag  100    500    ->  100\r
+mngx473 minmag  1000   5000   ->  1.00E+3 Rounded\r
+mngx474 minmag  10000  50000  ->  1.00E+4 Rounded\r
+mngx475 minmag  6      50     ->  6\r
+mngx476 minmag  66     500    ->  66\r
+mngx477 minmag  666    5000   ->  666\r
+mngx478 minmag  6666   50000  ->  6.67E+3 Rounded Inexact\r
+mngx479 minmag  66666  500000 ->  6.67E+4 Rounded Inexact\r
+mngx480 minmag  33333  500000 ->  3.33E+4 Rounded Inexact\r
+mngx481 minmag  75401  1      ->  1\r
+mngx482 minmag  75402  10     ->  10\r
+mngx483 minmag  75403  100    ->  100\r
+mngx484 minmag  75404  1000   ->  1.00E+3 Rounded\r
+mngx485 minmag  75405  10000  ->  1.00E+4 Rounded\r
+mngx486 minmag  75406  6      ->  6\r
+mngx487 minmag  75407  66     ->  66\r
+mngx488 minmag  75408  666    ->  666\r
+mngx489 minmag  75409  6666   ->  6.67E+3 Rounded Inexact\r
+mngx490 minmag  75410  66666  ->  6.67E+4 Rounded Inexact\r
+mngx491 minmag  75411  33333  ->  3.33E+4 Rounded Inexact\r
+\r
+\r
+-- overflow tests\r
+maxexponent: 999999999\r
+minexponent: -999999999\r
+precision: 3\r
+mngx500 minmag 9.999E+999999999  0 ->  0\r
+mngx501 minmag -9.999E+999999999 0 ->  0\r
+\r
+-- subnormals and underflow\r
+precision: 3\r
+maxexponent: 999\r
+minexponent: -999\r
+mngx510 minmag  1.00E-999       0  ->   0\r
+mngx511 minmag  0.1E-999        0  ->   0\r
+mngx512 minmag  0.10E-999       0  ->   0\r
+mngx513 minmag  0.100E-999      0  ->   0\r
+mngx514 minmag  0.01E-999       0  ->   0\r
+mngx515 minmag  0.999E-999      0  ->   0\r
+mngx516 minmag  0.099E-999      0  ->   0\r
+mngx517 minmag  0.009E-999      0  ->   0\r
+mngx518 minmag  0.001E-999      0  ->   0\r
+mngx519 minmag  0.0009E-999     0  ->   0\r
+mngx520 minmag  0.0001E-999     0  ->   0\r
+\r
+mngx530 minmag -1.00E-999       0  ->   0\r
+mngx531 minmag -0.1E-999        0  ->   0\r
+mngx532 minmag -0.10E-999       0  ->   0\r
+mngx533 minmag -0.100E-999      0  ->   0\r
+mngx534 minmag -0.01E-999       0  ->   0\r
+mngx535 minmag -0.999E-999      0  ->   0\r
+mngx536 minmag -0.099E-999      0  ->   0\r
+mngx537 minmag -0.009E-999      0  ->   0\r
+mngx538 minmag -0.001E-999      0  ->   0\r
+mngx539 minmag -0.0009E-999     0  ->   0\r
+mngx540 minmag -0.0001E-999     0  ->   0\r
+\r
+\r
+-- Null tests\r
+mng900 minmag 10  # -> NaN Invalid_operation\r
+mng901 minmag  # 10 -> NaN Invalid_operation\r
index d21af839ef8e34e8593bb31dc354d84fd0b1ef6a..e9afc3a091acc9cc95c0edfa4b12660fd91dd531 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- minus.decTest -- decimal negation                                  --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- This set of tests primarily tests the existence of the operator.
 -- Subtraction, rounding, and more overflows are tested elsewhere.
@@ -127,9 +127,9 @@ minx114 minus  0.01E-999        ->  -1E-1001   Subnormal
 minx115 minus  0.999E-999       ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 minx116 minus  0.099E-999       ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 minx117 minus  0.009E-999       ->  -1E-1001   Inexact Rounded Subnormal Underflow
-minx118 minus  0.001E-999       ->  -0E-1001   Inexact Rounded Subnormal Underflow
-minx119 minus  0.0009E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
-minx120 minus  0.0001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
+minx118 minus  0.001E-999       ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+minx119 minus  0.0009E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+minx120 minus  0.0001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 minx130 minus -1.00E-999        ->   1.00E-999
 minx131 minus -0.1E-999         ->   1E-1000   Subnormal
@@ -140,9 +140,9 @@ minx134 minus -0.01E-999        ->   1E-1001   Subnormal
 minx135 minus -0.999E-999       ->   1.00E-999 Inexact Rounded Subnormal Underflow
 minx136 minus -0.099E-999       ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 minx137 minus -0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
-minx138 minus -0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow
-minx139 minus -0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
-minx140 minus -0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
+minx138 minus -0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+minx139 minus -0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+minx140 minus -0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 
 -- long operand checks
index f6501505204eff6eed2eff9ab30f612de86d8910..71f591ab7cd3e3ca8b1842d2e170614a74e5fb2e 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- multiply.decTest -- decimal multiplication                         --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -44,21 +44,28 @@ mulx014 multiply 9.999999999 9.999999999 -> 100.000000 Inexact Rounded
 mulx015 multiply 2.50   4 -> 10.00
 precision: 6
 mulx016 multiply 2.50   4 -> 10.00
-mulx017 multiply 9.999999999 9.999999999 -> 100.000 Inexact Rounded
+mulx017 multiply  9.999999999  9.999999999 ->  100.000 Inexact Rounded
+mulx018 multiply  9.999999999 -9.999999999 -> -100.000 Inexact Rounded
+mulx019 multiply -9.999999999  9.999999999 -> -100.000 Inexact Rounded
+mulx020 multiply -9.999999999 -9.999999999 ->  100.000 Inexact Rounded
 
 -- 1999.12.21: next one is a edge case if intermediate longs are used
 precision: 15
-mulx019 multiply 999999999999 9765625 -> 9.76562499999023E+18 Inexact Rounded
+mulx059 multiply 999999999999 9765625 -> 9.76562499999023E+18 Inexact Rounded
 precision: 30
 mulx160 multiply 999999999999 9765625 -> 9765624999990234375
 precision: 9
 -----
 
 -- zeros, etc.
-mulx020 multiply  0      0     ->  0
-mulx021 multiply  0     -0     -> -0
-mulx022 multiply -0      0     -> -0
-mulx023 multiply -0     -0     ->  0
+mulx021 multiply  0      0     ->  0
+mulx022 multiply  0     -0     -> -0
+mulx023 multiply -0      0     -> -0
+mulx024 multiply -0     -0     ->  0
+mulx025 multiply -0.0   -0.0   ->  0.00
+mulx026 multiply -0.0   -0.0   ->  0.00
+mulx027 multiply -0.0   -0.0   ->  0.00
+mulx028 multiply -0.0   -0.0   ->  0.00
 mulx030 multiply  5.00   1E-3  ->  0.00500
 mulx031 multiply  00.00  0.000 ->  0.00000
 mulx032 multiply  00.00  0E-3  ->  0.00000     -- rhs is 0
@@ -94,17 +101,17 @@ mulx066 multiply 123.45 1e13 ->  1.2345E+15
 
 -- test some intermediate lengths
 precision: 9
-mulx080 multiply 0.1 123456789           -> 12345678.9
-mulx081 multiply 0.1 1234567891          -> 123456789 Inexact Rounded
-mulx082 multiply 0.1 12345678912         -> 1.23456789E+9 Inexact Rounded
-mulx083 multiply 0.1 12345678912345      -> 1.23456789E+12 Inexact Rounded
-mulx084 multiply 0.1 123456789           -> 12345678.9
+mulx080 multiply 0.1 123456789          -> 12345678.9
+mulx081 multiply 0.1 1234567891         -> 123456789 Inexact Rounded
+mulx082 multiply 0.1 12345678912        -> 1.23456789E+9 Inexact Rounded
+mulx083 multiply 0.1 12345678912345     -> 1.23456789E+12 Inexact Rounded
+mulx084 multiply 0.1 123456789          -> 12345678.9
 precision: 8
-mulx085 multiply 0.1 12345678912         -> 1.2345679E+9 Inexact Rounded
-mulx086 multiply 0.1 12345678912345      -> 1.2345679E+12 Inexact Rounded
+mulx085 multiply 0.1 12345678912        -> 1.2345679E+9 Inexact Rounded
+mulx086 multiply 0.1 12345678912345     -> 1.2345679E+12 Inexact Rounded
 precision: 7
-mulx087 multiply 0.1 12345678912         -> 1.234568E+9 Inexact Rounded
-mulx088 multiply 0.1 12345678912345      -> 1.234568E+12 Inexact Rounded
+mulx087 multiply 0.1 12345678912        -> 1.234568E+9 Inexact Rounded
+mulx088 multiply 0.1 12345678912345     -> 1.234568E+12 Inexact Rounded
 
 precision: 9
 mulx090 multiply 123456789          0.1 -> 12345678.9
@@ -280,6 +287,41 @@ mulx277 multiply 30269.587755640502150977251770554 4.804600973599087339593630964
 precision:  1
 mulx278 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1E+5                          Inexact Rounded
 
+-- test some edge cases with exact rounding
+maxexponent: 9999
+minexponent: -9999
+precision: 9
+mulx301 multiply 9 9   -> 81
+mulx302 multiply 9 90   -> 810
+mulx303 multiply 9 900   -> 8100
+mulx304 multiply 9 9000   -> 81000
+mulx305 multiply 9 90000   -> 810000
+mulx306 multiply 9 900000   -> 8100000
+mulx307 multiply 9 9000000   -> 81000000
+mulx308 multiply 9 90000000   -> 810000000
+mulx309 multiply 9 900000000   -> 8.10000000E+9   Rounded
+mulx310 multiply 9 9000000000   -> 8.10000000E+10  Rounded
+mulx311 multiply 9 90000000000   -> 8.10000000E+11  Rounded
+mulx312 multiply 9 900000000000   -> 8.10000000E+12  Rounded
+mulx313 multiply 9 9000000000000   -> 8.10000000E+13  Rounded
+mulx314 multiply 9 90000000000000   -> 8.10000000E+14  Rounded
+mulx315 multiply 9 900000000000000   -> 8.10000000E+15  Rounded
+mulx316 multiply 9 9000000000000000   -> 8.10000000E+16  Rounded
+mulx317 multiply 9 90000000000000000   -> 8.10000000E+17  Rounded
+mulx318 multiply 9 900000000000000000   -> 8.10000000E+18  Rounded
+mulx319 multiply 9 9000000000000000000   -> 8.10000000E+19  Rounded
+mulx320 multiply 9 90000000000000000000   -> 8.10000000E+20  Rounded
+mulx321 multiply 9 900000000000000000000   -> 8.10000000E+21  Rounded
+mulx322 multiply 9 9000000000000000000000   -> 8.10000000E+22  Rounded
+mulx323 multiply 9 90000000000000000000000   -> 8.10000000E+23  Rounded
+
+-- fastpath breakers
+precision:   29
+mulx330 multiply 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 -> 1.6487212707001281468486507878 Inexact Rounded
+precision:   55
+mulx331 multiply 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
+
+
 -- tryzeros cases
 precision:   7
 rounding:    half_up
@@ -486,10 +528,10 @@ mulx751 multiply  1e+777777777  1e+411111111 ->  Infinity Overflow Inexact Round
 mulx752 multiply  1e+777777777 -1e+411111111 -> -Infinity Overflow Inexact Rounded
 mulx753 multiply -1e+777777777  1e+411111111 -> -Infinity Overflow Inexact Rounded
 mulx754 multiply -1e+777777777 -1e+411111111 ->  Infinity Overflow Inexact Rounded
-mulx755 multiply  1e-777777777  1e-411111111 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
-mulx756 multiply  1e-777777777 -1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-mulx757 multiply -1e-777777777  1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
-mulx758 multiply -1e-777777777 -1e-411111111 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
+mulx755 multiply  1e-777777777  1e-411111111 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+mulx756 multiply  1e-777777777 -1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+mulx757 multiply -1e-777777777  1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+mulx758 multiply -1e-777777777 -1e-411111111 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 
 -- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
 precision: 9
@@ -500,9 +542,9 @@ mulx763 multiply 1e-600000000 1e-400000004 -> 1E-1000000004 Subnormal
 mulx764 multiply 1e-600000000 1e-400000005 -> 1E-1000000005 Subnormal
 mulx765 multiply 1e-600000000 1e-400000006 -> 1E-1000000006 Subnormal
 mulx766 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal
-mulx767 multiply 1e-600000000 1e-400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-mulx768 multiply 1e-600000000 1e-400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
-mulx769 multiply 1e-600000000 1e-400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded
+mulx767 multiply 1e-600000000 1e-400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+mulx768 multiply 1e-600000000 1e-400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+mulx769 multiply 1e-600000000 1e-400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 -- [no equivalent of 'subnormal' for overflow]
 mulx770 multiply 1e+600000000 1e+400000001 -> Infinity Overflow Inexact Rounded
 mulx771 multiply 1e+600000000 1e+400000002 -> Infinity Overflow Inexact Rounded
@@ -520,31 +562,31 @@ precision: 99
 mulx780 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal
 mulx781 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal
 mulx782 multiply 1e-600000000 1e-400000097 -> 1E-1000000097 Subnormal
-mulx783 multiply 1e-600000000 1e-400000098 -> 0E-1000000097 Underflow Subnormal Inexact Rounded
+mulx783 multiply 1e-600000000 1e-400000098 -> 0E-1000000097 Underflow Subnormal Inexact Rounded Clamped
 precision: 999
 mulx784 multiply 1e-600000000 1e-400000997 -> 1E-1000000997 Subnormal
-mulx785 multiply 1e-600000000 1e-400000998 -> 0E-1000000997 Underflow Subnormal Inexact Rounded
+mulx785 multiply 1e-600000000 1e-400000998 -> 0E-1000000997 Underflow Subnormal Inexact Rounded Clamped
 
 -- following testcases [through mulx800] not yet run against code
 precision: 9999
 mulx786 multiply 1e-600000000 1e-400009997 -> 1E-1000009997 Subnormal
-mulx787 multiply 1e-600000000 1e-400009998 -> 0E-1000009997 Underflow Subnormal Inexact Rounded
+mulx787 multiply 1e-600000000 1e-400009998 -> 0E-1000009997 Underflow Subnormal Inexact Rounded Clamped
 precision: 99999
 mulx788 multiply 1e-600000000 1e-400099997 -> 1E-1000099997 Subnormal
-mulx789 multiply 1e-600000000 1e-400099998 -> 0E-1000099997 Underflow Subnormal Inexact Rounded
+mulx789 multiply 1e-600000000 1e-400099998 -> 0E-1000099997 Underflow Subnormal Inexact Rounded Clamped
 precision: 999999
 mulx790 multiply 1e-600000000 1e-400999997 -> 1E-1000999997 Subnormal
-mulx791 multiply 1e-600000000 1e-400999998 -> 0E-1000999997 Underflow Subnormal Inexact Rounded
+mulx791 multiply 1e-600000000 1e-400999998 -> 0E-1000999997 Underflow Subnormal Inexact Rounded Clamped
 precision: 9999999
 mulx792 multiply 1e-600000000 1e-409999997 -> 1E-1009999997 Subnormal
-mulx793 multiply 1e-600000000 1e-409999998 -> 0E-1009999997 Underflow Subnormal Inexact Rounded
+mulx793 multiply 1e-600000000 1e-409999998 -> 0E-1009999997 Underflow Subnormal Inexact Rounded Clamped
 precision: 99999999
 mulx794 multiply 1e-600000000 1e-499999997 -> 1E-1099999997 Subnormal
-mulx795 multiply 1e-600000000 1e-499999998 -> 0E-1099999997 Underflow Subnormal Inexact Rounded
+mulx795 multiply 1e-600000000 1e-499999998 -> 0E-1099999997 Underflow Subnormal Inexact Rounded Clamped
 precision: 999999999
 mulx796 multiply 1e-999999999 1e-999999997 -> 1E-1999999996 Subnormal
 mulx797 multiply 1e-999999999 1e-999999998 -> 1E-1999999997 Subnormal
-mulx798 multiply 1e-999999999 1e-999999999 -> 0E-1999999997 Underflow Subnormal Inexact Rounded
+mulx798 multiply 1e-999999999 1e-999999999 -> 0E-1999999997 Underflow Subnormal Inexact Rounded Clamped
 mulx799 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal
 mulx800 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal
 
@@ -573,19 +615,19 @@ mulx816 multiply  2.50E-999    1e-4  -> 2E-1003     Underflow Subnormal Inexact
 mulx817 multiply  2.51E-999    1e-4  -> 3E-1003     Underflow Subnormal Inexact Rounded
 
 mulx818 multiply  1E-999       1e-4  -> 1E-1003     Subnormal
-mulx819 multiply  3E-999       1e-5  -> 0E-1003     Underflow Subnormal Inexact Rounded
-mulx820 multiply  5E-999       1e-5  -> 0E-1003     Underflow Subnormal Inexact Rounded
+mulx819 multiply  3E-999       1e-5  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
+mulx820 multiply  5E-999       1e-5  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
 mulx821 multiply  7E-999       1e-5  -> 1E-1003     Underflow Subnormal Inexact Rounded
 mulx822 multiply  9E-999       1e-5  -> 1E-1003     Underflow Subnormal Inexact Rounded
 mulx823 multiply  9.9E-999     1e-5  -> 1E-1003     Underflow Subnormal Inexact Rounded
 
 mulx824 multiply  1E-999      -1e-4  -> -1E-1003    Subnormal
-mulx825 multiply  3E-999      -1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded
-mulx826 multiply -5E-999       1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded
+mulx825 multiply  3E-999      -1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
+mulx826 multiply -5E-999       1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
 mulx827 multiply  7E-999      -1e-5  -> -1E-1003    Underflow Subnormal Inexact Rounded
 mulx828 multiply -9E-999       1e-5  -> -1E-1003    Underflow Subnormal Inexact Rounded
 mulx829 multiply  9.9E-999    -1e-5  -> -1E-1003    Underflow Subnormal Inexact Rounded
-mulx830 multiply  3.0E-999    -1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded
+mulx830 multiply  3.0E-999    -1e-5  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
 
 mulx831 multiply  1.0E-501     1e-501 -> 1.0E-1002   Subnormal
 mulx832 multiply  2.0E-501     2e-501 -> 4.0E-1002   Subnormal
@@ -595,7 +637,7 @@ mulx835 multiply 30.0E-501    30e-501 -> 9.000E-1000 Subnormal
 mulx836 multiply 40.0E-501    40e-501 -> 1.6000E-999
 
 -- squares
-mulx840 multiply  1E-502       1e-502 -> 0E-1003     Underflow Subnormal Inexact Rounded
+mulx840 multiply  1E-502       1e-502 -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
 mulx841 multiply  1E-501       1e-501 -> 1E-1002     Subnormal
 mulx842 multiply  2E-501       2e-501 -> 4E-1002     Subnormal
 mulx843 multiply  4E-501       4e-501 -> 1.6E-1001   Subnormal
@@ -604,7 +646,7 @@ mulx845 multiply 30E-501      30e-501 -> 9.00E-1000  Subnormal
 mulx846 multiply 40E-501      40e-501 -> 1.600E-999
 
 -- cubes
-mulx850 multiply  1E-670     1e-335 -> 0E-1003    Underflow Subnormal Inexact Rounded
+mulx850 multiply  1E-670     1e-335 -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped
 mulx851 multiply  1E-668     1e-334 -> 1E-1002    Subnormal
 mulx852 multiply  4E-668     2e-334 -> 8E-1002    Subnormal
 mulx853 multiply  9E-668     3e-334 -> 2.7E-1001  Subnormal
@@ -612,7 +654,7 @@ mulx854 multiply 16E-668     4e-334 -> 6.4E-1001  Subnormal
 mulx855 multiply 25E-668     5e-334 -> 1.25E-1000 Subnormal
 mulx856 multiply 10E-668   100e-334 -> 1.000E-999
 
--- test from 0.099 ** 999 at 15 digits
+-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
 precision: 19
 mulx860 multiply  6636851557994578716E-520 6636851557994578716E-520 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
 
@@ -629,14 +671,16 @@ mulx873 multiply   -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded
 precision:   5
 maxexponent: 79
 minexponent: -79
-mulx881 multiply  1.2347E-40  1.2347E-40  ->  1.524E-80 Inexact Rounded Subnormal Underflow
-mulx882 multiply  1.234E-40  1.234E-40  ->  1.523E-80 Inexact Rounded Subnormal Underflow
-mulx883 multiply  1.23E-40   1.23E-40   ->  1.513E-80 Inexact Rounded Subnormal Underflow
-mulx884 multiply  1.2E-40    1.2E-40    ->  1.44E-80  Subnormal
-mulx885 multiply  1.2E-40    1.2E-41    ->  1.44E-81  Subnormal
-mulx886 multiply  1.2E-40    1.2E-42    ->  1.4E-82   Subnormal Inexact Rounded Underflow
-mulx887 multiply  1.2E-40    1.3E-42    ->  1.6E-82   Subnormal Inexact Rounded Underflow
-mulx888 multiply  1.3E-40    1.3E-42    ->  1.7E-82   Subnormal Inexact Rounded Underflow
+mulx881 multiply  1.2347E-40  1.2347E-40  ->  1.524E-80  Inexact Rounded Subnormal Underflow
+mulx882 multiply  1.234E-40  1.234E-40    ->  1.523E-80  Inexact Rounded Subnormal Underflow
+mulx883 multiply  1.23E-40   1.23E-40     ->  1.513E-80  Inexact Rounded Subnormal Underflow
+mulx884 multiply  1.2E-40    1.2E-40      ->  1.44E-80   Subnormal
+mulx885 multiply  1.2E-40    1.2E-41      ->  1.44E-81   Subnormal
+mulx886 multiply  1.2E-40    1.2E-42      ->  1.4E-82    Subnormal Inexact Rounded Underflow
+mulx887 multiply  1.2E-40    1.3E-42      ->  1.6E-82    Subnormal Inexact Rounded Underflow
+mulx888 multiply  1.3E-40    1.3E-42      ->  1.7E-82    Subnormal Inexact Rounded Underflow
+mulx889 multiply  1.3E-40    1.3E-43      ->    2E-83    Subnormal Inexact Rounded Underflow
+mulx890 multiply  1.3E-41    1.3E-43      ->    0E-83    Clamped Subnormal Inexact Rounded Underflow
 
 mulx891 multiply  1.2345E-39   1.234E-40  ->  1.5234E-79 Inexact Rounded
 mulx892 multiply  1.23456E-39  1.234E-40  ->  1.5234E-79 Inexact Rounded
@@ -645,7 +689,43 @@ mulx894 multiply  1.23456E-40  1.234E-40  ->  1.523E-80  Inexact Rounded Subnorm
 mulx895 multiply  1.2345E-41   1.234E-40  ->  1.52E-81   Inexact Rounded Subnormal Underflow
 mulx896 multiply  1.23456E-41  1.234E-40  ->  1.52E-81   Inexact Rounded Subnormal Underflow
 
+-- Now explore the case where we get a normal result with Underflow
+precision:   16
+rounding:    half_up
+maxExponent: 384
+minExponent: -383
+
+mulx900 multiply  0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
+mulx901 multiply  0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+mulx902 multiply  9.999999999999999E-383  0.0999999999999         -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+mulx903 multiply  9.999999999999999E-383  0.09999999999999        -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+mulx904 multiply  9.999999999999999E-383  0.099999999999999       -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+mulx905 multiply  9.999999999999999E-383  0.0999999999999999      -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- prove operands are exact
+mulx906 multiply  9.999999999999999E-383  1                       -> 9.999999999999999E-383
+mulx907 multiply                       1  0.09999999999999999     -> 0.09999999999999999
+-- the next rounds to Nmin
+mulx908 multiply  9.999999999999999E-383  0.09999999999999999     -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+mulx909 multiply  9.999999999999999E-383  0.099999999999999999    -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+mulx910 multiply  9.999999999999999E-383  0.0999999999999999999   -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+mulx911 multiply  9.999999999999999E-383  0.09999999999999999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision:   34
+rounding:    half_up
+maxExponent: 6144
+minExponent: -6143
+mulx1001  multiply 130E-2  120E-2 -> 1.5600
+mulx1002  multiply 130E-2  12E-1  -> 1.560
+mulx1003  multiply 130E-2  1E0    -> 1.30
+mulx1004  multiply 1E2     1E4    -> 1E+6
+
+-- payload decapitate
+precision: 5
+mulx1010  multiply 11 -sNaN1234567890 -> -NaN67890  Invalid_operation
+
 -- Null tests
-mulx900 multiply 10  # -> NaN Invalid_operation
-mulx901 multiply  # 10 -> NaN Invalid_operation
+mulx990 multiply 10  # -> NaN Invalid_operation
+mulx991 multiply  # 10 -> NaN Invalid_operation
 
diff --git a/Lib/test/decimaltestdata/nextminus.decTest b/Lib/test/decimaltestdata/nextminus.decTest
new file mode 100644 (file)
index 0000000..200580d
--- /dev/null
@@ -0,0 +1,148 @@
+------------------------------------------------------------------------\r
+-- nextminus.decTest -- decimal next that is less [754r nextdown]     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+nextm001 nextminus  0.999999995 ->   0.999999994\r
+nextm002 nextminus  0.999999996 ->   0.999999995\r
+nextm003 nextminus  0.999999997 ->   0.999999996\r
+nextm004 nextminus  0.999999998 ->   0.999999997\r
+nextm005 nextminus  0.999999999 ->   0.999999998\r
+nextm006 nextminus  1.00000000  ->   0.999999999\r
+nextm007 nextminus  1.0         ->   0.999999999\r
+nextm008 nextminus  1           ->   0.999999999\r
+nextm009 nextminus  1.00000001  ->   1.00000000\r
+nextm010 nextminus  1.00000002  ->   1.00000001\r
+nextm011 nextminus  1.00000003  ->   1.00000002\r
+nextm012 nextminus  1.00000004  ->   1.00000003\r
+nextm013 nextminus  1.00000005  ->   1.00000004\r
+nextm014 nextminus  1.00000006  ->   1.00000005\r
+nextm015 nextminus  1.00000007  ->   1.00000006\r
+nextm016 nextminus  1.00000008  ->   1.00000007\r
+nextm017 nextminus  1.00000009  ->   1.00000008\r
+nextm018 nextminus  1.00000010  ->   1.00000009\r
+nextm019 nextminus  1.00000011  ->   1.00000010\r
+nextm020 nextminus  1.00000012  ->   1.00000011\r
+\r
+nextm021 nextminus -0.999999995 ->  -0.999999996\r
+nextm022 nextminus -0.999999996 ->  -0.999999997\r
+nextm023 nextminus -0.999999997 ->  -0.999999998\r
+nextm024 nextminus -0.999999998 ->  -0.999999999\r
+nextm025 nextminus -0.999999999 ->  -1.00000000\r
+nextm026 nextminus -1.00000000  ->  -1.00000001\r
+nextm027 nextminus -1.0         ->  -1.00000001\r
+nextm028 nextminus -1           ->  -1.00000001\r
+nextm029 nextminus -1.00000001  ->  -1.00000002\r
+nextm030 nextminus -1.00000002  ->  -1.00000003\r
+nextm031 nextminus -1.00000003  ->  -1.00000004\r
+nextm032 nextminus -1.00000004  ->  -1.00000005\r
+nextm033 nextminus -1.00000005  ->  -1.00000006\r
+nextm034 nextminus -1.00000006  ->  -1.00000007\r
+nextm035 nextminus -1.00000007  ->  -1.00000008\r
+nextm036 nextminus -1.00000008  ->  -1.00000009\r
+nextm037 nextminus -1.00000009  ->  -1.00000010\r
+nextm038 nextminus -1.00000010  ->  -1.00000011\r
+nextm039 nextminus -1.00000011  ->  -1.00000012\r
+\r
+-- input operand is >precision\r
+nextm041 nextminus  1.00000010998  ->   1.00000010\r
+nextm042 nextminus  1.00000010999  ->   1.00000010\r
+nextm043 nextminus  1.00000011000  ->   1.00000010\r
+nextm044 nextminus  1.00000011001  ->   1.00000011\r
+nextm045 nextminus  1.00000011002  ->   1.00000011\r
+nextm046 nextminus  1.00000011002  ->   1.00000011\r
+nextm047 nextminus  1.00000011052  ->   1.00000011\r
+nextm048 nextminus  1.00000011552  ->   1.00000011\r
+nextm049 nextminus -1.00000010998  ->  -1.00000011\r
+nextm050 nextminus -1.00000010999  ->  -1.00000011\r
+nextm051 nextminus -1.00000011000  ->  -1.00000012\r
+nextm052 nextminus -1.00000011001  ->  -1.00000012\r
+nextm053 nextminus -1.00000011002  ->  -1.00000012\r
+nextm054 nextminus -1.00000011002  ->  -1.00000012\r
+nextm055 nextminus -1.00000011052  ->  -1.00000012\r
+nextm056 nextminus -1.00000011552  ->  -1.00000012\r
+-- ultra-tiny inputs\r
+nextm060 nextminus  1E-99999       ->   0E-391\r
+nextm061 nextminus  1E-999999999   ->   0E-391\r
+nextm062 nextminus  1E-391         ->   0E-391\r
+nextm063 nextminus -1E-99999       ->  -1E-391\r
+nextm064 nextminus -1E-999999999   ->  -1E-391\r
+nextm065 nextminus -1E-391         ->  -2E-391\r
+\r
+-- Zeros\r
+nextm100 nextminus -0           -> -1E-391\r
+nextm101 nextminus  0           -> -1E-391\r
+nextm102 nextminus  0.00        -> -1E-391\r
+nextm103 nextminus -0.00        -> -1E-391\r
+nextm104 nextminus  0E-300      -> -1E-391\r
+nextm105 nextminus  0E+300      -> -1E-391\r
+nextm106 nextminus  0E+30000    -> -1E-391\r
+nextm107 nextminus -0E+30000    -> -1E-391\r
+\r
+precision: 9\r
+maxExponent: 999\r
+minexponent: -999\r
+-- specials\r
+nextm150 nextminus   Inf    ->  9.99999999E+999\r
+nextm151 nextminus  -Inf    -> -Infinity\r
+nextm152 nextminus   NaN    ->  NaN\r
+nextm153 nextminus  sNaN    ->  NaN   Invalid_operation\r
+nextm154 nextminus   NaN77  ->  NaN77\r
+nextm155 nextminus  sNaN88  ->  NaN88 Invalid_operation\r
+nextm156 nextminus  -NaN    -> -NaN\r
+nextm157 nextminus -sNaN    -> -NaN   Invalid_operation\r
+nextm158 nextminus  -NaN77  -> -NaN77\r
+nextm159 nextminus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+nextm170 nextminus  9.99999999E+999   -> 9.99999998E+999\r
+nextm171 nextminus  9.99999998E+999   -> 9.99999997E+999\r
+nextm172 nextminus  1E-999            -> 9.9999999E-1000\r
+nextm173 nextminus  1.00000000E-999   -> 9.9999999E-1000\r
+nextm174 nextminus  9E-1007           -> 8E-1007\r
+nextm175 nextminus  9.9E-1006         -> 9.8E-1006\r
+nextm176 nextminus  9.9999E-1003      -> 9.9998E-1003\r
+nextm177 nextminus  9.9999999E-1000   -> 9.9999998E-1000\r
+nextm178 nextminus  9.9999998E-1000   -> 9.9999997E-1000\r
+nextm179 nextminus  9.9999997E-1000   -> 9.9999996E-1000\r
+nextm180 nextminus  0E-1007           -> -1E-1007\r
+nextm181 nextminus  1E-1007           -> 0E-1007\r
+nextm182 nextminus  2E-1007           -> 1E-1007\r
+\r
+nextm183 nextminus  -0E-1007          -> -1E-1007\r
+nextm184 nextminus  -1E-1007          -> -2E-1007\r
+nextm185 nextminus  -2E-1007          -> -3E-1007\r
+nextm186 nextminus  -10E-1007         -> -1.1E-1006\r
+nextm187 nextminus  -100E-1007        -> -1.01E-1005\r
+nextm188 nextminus  -100000E-1007     -> -1.00001E-1002\r
+nextm189 nextminus  -1.0000E-999      -> -1.00000001E-999\r
+nextm190 nextminus  -1.00000000E-999  -> -1.00000001E-999\r
+nextm191 nextminus  -1E-999           -> -1.00000001E-999\r
+nextm192 nextminus  -9.99999998E+999  -> -9.99999999E+999\r
+nextm193 nextminus  -9.99999999E+999  -> -Infinity\r
+\r
+-- Null tests\r
+nextm900 nextminus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/nextplus.decTest b/Lib/test/decimaltestdata/nextplus.decTest
new file mode 100644 (file)
index 0000000..01815ee
--- /dev/null
@@ -0,0 +1,150 @@
+------------------------------------------------------------------------\r
+-- nextplus.decTest -- decimal next that is greater [754r nextup]     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+nextp001 nextplus  0.999999995 ->   0.999999996\r
+nextp002 nextplus  0.999999996 ->   0.999999997\r
+nextp003 nextplus  0.999999997 ->   0.999999998\r
+nextp004 nextplus  0.999999998 ->   0.999999999\r
+nextp005 nextplus  0.999999999 ->   1.00000000\r
+nextp006 nextplus  1.00000000  ->   1.00000001\r
+nextp007 nextplus  1.0         ->   1.00000001\r
+nextp008 nextplus  1           ->   1.00000001\r
+nextp009 nextplus  1.00000001  ->   1.00000002\r
+nextp010 nextplus  1.00000002  ->   1.00000003\r
+nextp011 nextplus  1.00000003  ->   1.00000004\r
+nextp012 nextplus  1.00000004  ->   1.00000005\r
+nextp013 nextplus  1.00000005  ->   1.00000006\r
+nextp014 nextplus  1.00000006  ->   1.00000007\r
+nextp015 nextplus  1.00000007  ->   1.00000008\r
+nextp016 nextplus  1.00000008  ->   1.00000009\r
+nextp017 nextplus  1.00000009  ->   1.00000010\r
+nextp018 nextplus  1.00000010  ->   1.00000011\r
+nextp019 nextplus  1.00000011  ->   1.00000012\r
+\r
+nextp021 nextplus -0.999999995 ->  -0.999999994\r
+nextp022 nextplus -0.999999996 ->  -0.999999995\r
+nextp023 nextplus -0.999999997 ->  -0.999999996\r
+nextp024 nextplus -0.999999998 ->  -0.999999997\r
+nextp025 nextplus -0.999999999 ->  -0.999999998\r
+nextp026 nextplus -1.00000000  ->  -0.999999999\r
+nextp027 nextplus -1.0         ->  -0.999999999\r
+nextp028 nextplus -1           ->  -0.999999999\r
+nextp029 nextplus -1.00000001  ->  -1.00000000\r
+nextp030 nextplus -1.00000002  ->  -1.00000001\r
+nextp031 nextplus -1.00000003  ->  -1.00000002\r
+nextp032 nextplus -1.00000004  ->  -1.00000003\r
+nextp033 nextplus -1.00000005  ->  -1.00000004\r
+nextp034 nextplus -1.00000006  ->  -1.00000005\r
+nextp035 nextplus -1.00000007  ->  -1.00000006\r
+nextp036 nextplus -1.00000008  ->  -1.00000007\r
+nextp037 nextplus -1.00000009  ->  -1.00000008\r
+nextp038 nextplus -1.00000010  ->  -1.00000009\r
+nextp039 nextplus -1.00000011  ->  -1.00000010\r
+nextp040 nextplus -1.00000012  ->  -1.00000011\r
+\r
+-- input operand is >precision\r
+nextp041 nextplus  1.00000010998  ->   1.00000011\r
+nextp042 nextplus  1.00000010999  ->   1.00000011\r
+nextp043 nextplus  1.00000011000  ->   1.00000012\r
+nextp044 nextplus  1.00000011001  ->   1.00000012\r
+nextp045 nextplus  1.00000011002  ->   1.00000012\r
+nextp046 nextplus  1.00000011002  ->   1.00000012\r
+nextp047 nextplus  1.00000011052  ->   1.00000012\r
+nextp048 nextplus  1.00000011552  ->   1.00000012\r
+nextp049 nextplus -1.00000010998  ->  -1.00000010\r
+nextp050 nextplus -1.00000010999  ->  -1.00000010\r
+nextp051 nextplus -1.00000011000  ->  -1.00000010\r
+nextp052 nextplus -1.00000011001  ->  -1.00000011\r
+nextp053 nextplus -1.00000011002  ->  -1.00000011\r
+nextp054 nextplus -1.00000011002  ->  -1.00000011\r
+nextp055 nextplus -1.00000011052  ->  -1.00000011\r
+nextp056 nextplus -1.00000011552  ->  -1.00000011\r
+-- ultra-tiny inputs\r
+nextp060 nextplus  1E-99999       ->   1E-391\r
+nextp061 nextplus  1E-999999999   ->   1E-391\r
+nextp062 nextplus  1E-391         ->   2E-391\r
+nextp063 nextplus -1E-99999       ->  -0E-391\r
+nextp064 nextplus -1E-999999999   ->  -0E-391\r
+nextp065 nextplus -1E-391         ->  -0E-391\r
+\r
+-- Zeros\r
+nextp100 nextplus  0           ->  1E-391\r
+nextp101 nextplus  0.00        ->  1E-391\r
+nextp102 nextplus  0E-300      ->  1E-391\r
+nextp103 nextplus  0E+300      ->  1E-391\r
+nextp104 nextplus  0E+30000    ->  1E-391\r
+nextp105 nextplus -0           ->  1E-391\r
+nextp106 nextplus -0.00        ->  1E-391\r
+nextp107 nextplus -0E-300      ->  1E-391\r
+nextp108 nextplus -0E+300      ->  1E-391\r
+nextp109 nextplus -0E+30000    ->  1E-391\r
+\r
+maxExponent: 999\r
+minexponent: -999\r
+precision: 9\r
+-- specials\r
+nextp150 nextplus   Inf    ->  Infinity\r
+nextp151 nextplus  -Inf    -> -9.99999999E+999\r
+nextp152 nextplus   NaN    ->  NaN\r
+nextp153 nextplus  sNaN    ->  NaN   Invalid_operation\r
+nextp154 nextplus   NaN77  ->  NaN77\r
+nextp155 nextplus  sNaN88  ->  NaN88 Invalid_operation\r
+nextp156 nextplus  -NaN    -> -NaN\r
+nextp157 nextplus -sNaN    -> -NaN   Invalid_operation\r
+nextp158 nextplus  -NaN77  -> -NaN77\r
+nextp159 nextplus -sNaN88  -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+nextp170 nextplus  9.99999999E+999   -> Infinity\r
+nextp171 nextplus  9.99999998E+999   -> 9.99999999E+999\r
+nextp172 nextplus  1E-999            -> 1.00000001E-999\r
+nextp173 nextplus  1.00000000E-999   -> 1.00000001E-999\r
+nextp174 nextplus  9E-1007           -> 1.0E-1006\r
+nextp175 nextplus  9.9E-1006         -> 1.00E-1005\r
+nextp176 nextplus  9.9999E-1003      -> 1.00000E-1002\r
+nextp177 nextplus  9.9999999E-1000   -> 1.00000000E-999\r
+nextp178 nextplus  9.9999998E-1000   -> 9.9999999E-1000\r
+nextp179 nextplus  9.9999997E-1000   -> 9.9999998E-1000\r
+nextp180 nextplus  0E-1007           -> 1E-1007\r
+nextp181 nextplus  1E-1007           -> 2E-1007\r
+nextp182 nextplus  2E-1007           -> 3E-1007\r
+\r
+nextp183 nextplus  -0E-1007          ->  1E-1007\r
+nextp184 nextplus  -1E-1007          -> -0E-1007\r
+nextp185 nextplus  -2E-1007          -> -1E-1007\r
+nextp186 nextplus  -10E-1007         -> -9E-1007\r
+nextp187 nextplus  -100E-1007        -> -9.9E-1006\r
+nextp188 nextplus  -100000E-1007     -> -9.9999E-1003\r
+nextp189 nextplus  -1.0000E-999      -> -9.9999999E-1000\r
+nextp190 nextplus  -1.00000000E-999  -> -9.9999999E-1000\r
+nextp191 nextplus  -1E-999           -> -9.9999999E-1000\r
+nextp192 nextplus  -9.99999998E+999  -> -9.99999997E+999\r
+nextp193 nextplus  -9.99999999E+999  -> -9.99999998E+999\r
+\r
+-- Null tests\r
+nextp900 nextplus  # -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/nexttoward.decTest b/Lib/test/decimaltestdata/nexttoward.decTest
new file mode 100644 (file)
index 0000000..cb60f57
--- /dev/null
@@ -0,0 +1,426 @@
+------------------------------------------------------------------------\r
+-- nexttoward.decTest -- decimal next toward rhs [754r nextafter]     --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- Sanity check with a scattering of numerics\r
+nextt001 nexttoward   10    10   ->  10\r
+nextt002 nexttoward  -10   -10   -> -10\r
+nextt003 nexttoward   1     10   ->  1.00000001\r
+nextt004 nexttoward   1    -10   ->  0.999999999\r
+nextt005 nexttoward  -1     10   -> -0.999999999\r
+nextt006 nexttoward  -1    -10   -> -1.00000001\r
+nextt007 nexttoward   0     10   ->  1E-391       Underflow Subnormal Inexact Rounded\r
+nextt008 nexttoward   0    -10   -> -1E-391       Underflow Subnormal Inexact Rounded\r
+nextt009 nexttoward   9.99999999E+384 +Infinity ->  Infinity Overflow Inexact Rounded\r
+nextt010 nexttoward  -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded\r
+\r
+------- lhs=rhs\r
+-- finites\r
+nextt101 nexttoward          7       7 ->  7\r
+nextt102 nexttoward         -7      -7 -> -7\r
+nextt103 nexttoward         75      75 ->  75\r
+nextt104 nexttoward        -75     -75 -> -75\r
+nextt105 nexttoward       7.50     7.5 ->  7.50\r
+nextt106 nexttoward      -7.50   -7.50 -> -7.50\r
+nextt107 nexttoward       7.500 7.5000 ->  7.500\r
+nextt108 nexttoward      -7.500   -7.5 -> -7.500\r
+\r
+-- zeros\r
+nextt111 nexttoward          0       0 ->  0\r
+nextt112 nexttoward         -0      -0 -> -0\r
+nextt113 nexttoward       0E+4       0 ->  0E+4\r
+nextt114 nexttoward      -0E+4      -0 -> -0E+4\r
+nextt115 nexttoward     0.0000 0.00000 ->  0.0000\r
+nextt116 nexttoward    -0.0000   -0.00 -> -0.0000\r
+nextt117 nexttoward      0E-141      0 ->  0E-141\r
+nextt118 nexttoward     -0E-141   -000 -> -0E-141\r
+\r
+-- full coefficients, alternating bits\r
+nextt121 nexttoward   268268268    268268268 ->   268268268\r
+nextt122 nexttoward  -268268268   -268268268 ->  -268268268\r
+nextt123 nexttoward   134134134    134134134 ->   134134134\r
+nextt124 nexttoward  -134134134   -134134134 ->  -134134134\r
+\r
+-- Nmax, Nmin, Ntiny\r
+nextt131 nexttoward  9.99999999E+384  9.99999999E+384   ->   9.99999999E+384\r
+nextt132 nexttoward  1E-383           1E-383            ->   1E-383\r
+nextt133 nexttoward  1.00000000E-383  1.00000000E-383   ->   1.00000000E-383\r
+nextt134 nexttoward  1E-391           1E-391            ->   1E-391\r
+\r
+nextt135 nexttoward  -1E-391          -1E-391           ->  -1E-391\r
+nextt136 nexttoward  -1.00000000E-383 -1.00000000E-383  ->  -1.00000000E-383\r
+nextt137 nexttoward  -1E-383          -1E-383           ->  -1E-383\r
+nextt138 nexttoward  -9.99999999E+384 -9.99999999E+384  ->  -9.99999999E+384\r
+\r
+------- lhs<rhs\r
+nextt201 nexttoward  0.999999995 Infinity ->   0.999999996\r
+nextt202 nexttoward  0.999999996 Infinity ->   0.999999997\r
+nextt203 nexttoward  0.999999997 Infinity ->   0.999999998\r
+nextt204 nexttoward  0.999999998 Infinity ->   0.999999999\r
+nextt205 nexttoward  0.999999999 Infinity ->   1.00000000\r
+nextt206 nexttoward  1.00000000  Infinity ->   1.00000001\r
+nextt207 nexttoward  1.0         Infinity ->   1.00000001\r
+nextt208 nexttoward  1           Infinity ->   1.00000001\r
+nextt209 nexttoward  1.00000001  Infinity ->   1.00000002\r
+nextt210 nexttoward  1.00000002  Infinity ->   1.00000003\r
+nextt211 nexttoward  1.00000003  Infinity ->   1.00000004\r
+nextt212 nexttoward  1.00000004  Infinity ->   1.00000005\r
+nextt213 nexttoward  1.00000005  Infinity ->   1.00000006\r
+nextt214 nexttoward  1.00000006  Infinity ->   1.00000007\r
+nextt215 nexttoward  1.00000007  Infinity ->   1.00000008\r
+nextt216 nexttoward  1.00000008  Infinity ->   1.00000009\r
+nextt217 nexttoward  1.00000009  Infinity ->   1.00000010\r
+nextt218 nexttoward  1.00000010  Infinity ->   1.00000011\r
+nextt219 nexttoward  1.00000011  Infinity ->   1.00000012\r
+\r
+nextt221 nexttoward -0.999999995 Infinity ->  -0.999999994\r
+nextt222 nexttoward -0.999999996 Infinity ->  -0.999999995\r
+nextt223 nexttoward -0.999999997 Infinity ->  -0.999999996\r
+nextt224 nexttoward -0.999999998 Infinity ->  -0.999999997\r
+nextt225 nexttoward -0.999999999 Infinity ->  -0.999999998\r
+nextt226 nexttoward -1.00000000  Infinity ->  -0.999999999\r
+nextt227 nexttoward -1.0         Infinity ->  -0.999999999\r
+nextt228 nexttoward -1           Infinity ->  -0.999999999\r
+nextt229 nexttoward -1.00000001  Infinity ->  -1.00000000\r
+nextt230 nexttoward -1.00000002  Infinity ->  -1.00000001\r
+nextt231 nexttoward -1.00000003  Infinity ->  -1.00000002\r
+nextt232 nexttoward -1.00000004  Infinity ->  -1.00000003\r
+nextt233 nexttoward -1.00000005  Infinity ->  -1.00000004\r
+nextt234 nexttoward -1.00000006  Infinity ->  -1.00000005\r
+nextt235 nexttoward -1.00000007  Infinity ->  -1.00000006\r
+nextt236 nexttoward -1.00000008  Infinity ->  -1.00000007\r
+nextt237 nexttoward -1.00000009  Infinity ->  -1.00000008\r
+nextt238 nexttoward -1.00000010  Infinity ->  -1.00000009\r
+nextt239 nexttoward -1.00000011  Infinity ->  -1.00000010\r
+nextt240 nexttoward -1.00000012  Infinity ->  -1.00000011\r
+\r
+-- input operand is >precision\r
+nextt241 nexttoward  1.00000010998  Infinity ->   1.00000011\r
+nextt242 nexttoward  1.00000010999  Infinity ->   1.00000011\r
+nextt243 nexttoward  1.00000011000  Infinity ->   1.00000012\r
+nextt244 nexttoward  1.00000011001  Infinity ->   1.00000012\r
+nextt245 nexttoward  1.00000011002  Infinity ->   1.00000012\r
+nextt246 nexttoward  1.00000011002  Infinity ->   1.00000012\r
+nextt247 nexttoward  1.00000011052  Infinity ->   1.00000012\r
+nextt248 nexttoward  1.00000011552  Infinity ->   1.00000012\r
+nextt249 nexttoward -1.00000010998  Infinity ->  -1.00000010\r
+nextt250 nexttoward -1.00000010999  Infinity ->  -1.00000010\r
+nextt251 nexttoward -1.00000011000  Infinity ->  -1.00000010\r
+nextt252 nexttoward -1.00000011001  Infinity ->  -1.00000011\r
+nextt253 nexttoward -1.00000011002  Infinity ->  -1.00000011\r
+nextt254 nexttoward -1.00000011002  Infinity ->  -1.00000011\r
+nextt255 nexttoward -1.00000011052  Infinity ->  -1.00000011\r
+nextt256 nexttoward -1.00000011552  Infinity ->  -1.00000011\r
+-- ultra-tiny inputs\r
+nextt260 nexttoward  1E-99999       Infinity ->   1E-391          Underflow Subnormal Inexact Rounded\r
+nextt261 nexttoward  1E-999999999   Infinity ->   1E-391          Underflow Subnormal Inexact Rounded\r
+nextt262 nexttoward  1E-391         Infinity ->   2E-391          Underflow Subnormal Inexact Rounded\r
+nextt263 nexttoward -1E-99999       Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped\r
+nextt264 nexttoward -1E-999999999   Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped\r
+nextt265 nexttoward -1E-391         Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped\r
+\r
+-- Zeros\r
+nextt300 nexttoward  0           Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt301 nexttoward  0.00        Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt302 nexttoward  0E-300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt303 nexttoward  0E+300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt304 nexttoward  0E+30000    Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt305 nexttoward -0           Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt306 nexttoward -0.00        Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt307 nexttoward -0E-300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt308 nexttoward -0E+300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+nextt309 nexttoward -0E+30000    Infinity ->  1E-391              Underflow Subnormal Inexact Rounded\r
+\r
+-- specials\r
+nextt350 nexttoward   Inf    Infinity ->  Infinity\r
+nextt351 nexttoward  -Inf    Infinity -> -9.99999999E+384\r
+nextt352 nexttoward   NaN    Infinity ->  NaN\r
+nextt353 nexttoward  sNaN    Infinity ->  NaN   Invalid_operation\r
+nextt354 nexttoward   NaN77  Infinity ->  NaN77\r
+nextt355 nexttoward  sNaN88  Infinity ->  NaN88 Invalid_operation\r
+nextt356 nexttoward  -NaN    Infinity -> -NaN\r
+nextt357 nexttoward -sNaN    Infinity -> -NaN   Invalid_operation\r
+nextt358 nexttoward  -NaN77  Infinity -> -NaN77\r
+nextt359 nexttoward -sNaN88  Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+maxExponent: 999\r
+minexponent: -999\r
+nextt370 nexttoward  9.99999999E+999   Infinity -> Infinity        Overflow Inexact Rounded\r
+nextt371 nexttoward  9.99999998E+999   Infinity -> 9.99999999E+999\r
+nextt372 nexttoward  1E-999            Infinity -> 1.00000001E-999\r
+nextt373 nexttoward  1.00000000E-999   Infinity -> 1.00000001E-999\r
+nextt374 nexttoward  0.999999999E-999  Infinity -> 1.00000000E-999\r
+nextt375 nexttoward  0.99999999E-999   Infinity -> 1.00000000E-999\r
+nextt376 nexttoward  9E-1007           Infinity -> 1.0E-1006       Underflow Subnormal Inexact Rounded\r
+nextt377 nexttoward  9.9E-1006         Infinity -> 1.00E-1005      Underflow Subnormal Inexact Rounded\r
+nextt378 nexttoward  9.9999E-1003      Infinity -> 1.00000E-1002   Underflow Subnormal Inexact Rounded\r
+nextt379 nexttoward  9.9999998E-1000   Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded\r
+nextt380 nexttoward  9.9999997E-1000   Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded\r
+nextt381 nexttoward  0E-1007           Infinity -> 1E-1007         Underflow Subnormal Inexact Rounded\r
+nextt382 nexttoward  1E-1007           Infinity -> 2E-1007         Underflow Subnormal Inexact Rounded\r
+nextt383 nexttoward  2E-1007           Infinity -> 3E-1007         Underflow Subnormal Inexact Rounded\r
+\r
+nextt385 nexttoward  -0E-1007          Infinity ->  1E-1007        Underflow Subnormal Inexact Rounded\r
+nextt386 nexttoward  -1E-1007          Infinity -> -0E-1007        Underflow Subnormal Inexact Rounded Clamped\r
+nextt387 nexttoward  -2E-1007          Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded\r
+nextt388 nexttoward  -10E-1007         Infinity -> -9E-1007        Underflow Subnormal Inexact Rounded\r
+nextt389 nexttoward  -100E-1007        Infinity -> -9.9E-1006      Underflow Subnormal Inexact Rounded\r
+nextt390 nexttoward  -100000E-1007     Infinity -> -9.9999E-1003   Underflow Subnormal Inexact Rounded\r
+nextt391 nexttoward  -1.0000E-999      Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded\r
+nextt392 nexttoward  -1.00000000E-999  Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded\r
+nextt393 nexttoward  -1E-999           Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded\r
+nextt394 nexttoward  -9.99999998E+999  Infinity -> -9.99999997E+999\r
+nextt395 nexttoward  -9.99999999E+999  Infinity -> -9.99999998E+999\r
+\r
+------- lhs>rhs\r
+maxExponent: 384\r
+minexponent: -383\r
+nextt401 nexttoward  0.999999995  -Infinity ->   0.999999994\r
+nextt402 nexttoward  0.999999996  -Infinity ->   0.999999995\r
+nextt403 nexttoward  0.999999997  -Infinity ->   0.999999996\r
+nextt404 nexttoward  0.999999998  -Infinity ->   0.999999997\r
+nextt405 nexttoward  0.999999999  -Infinity ->   0.999999998\r
+nextt406 nexttoward  1.00000000   -Infinity ->   0.999999999\r
+nextt407 nexttoward  1.0          -Infinity ->   0.999999999\r
+nextt408 nexttoward  1            -Infinity ->   0.999999999\r
+nextt409 nexttoward  1.00000001   -Infinity ->   1.00000000\r
+nextt410 nexttoward  1.00000002   -Infinity ->   1.00000001\r
+nextt411 nexttoward  1.00000003   -Infinity ->   1.00000002\r
+nextt412 nexttoward  1.00000004   -Infinity ->   1.00000003\r
+nextt413 nexttoward  1.00000005   -Infinity ->   1.00000004\r
+nextt414 nexttoward  1.00000006   -Infinity ->   1.00000005\r
+nextt415 nexttoward  1.00000007   -Infinity ->   1.00000006\r
+nextt416 nexttoward  1.00000008   -Infinity ->   1.00000007\r
+nextt417 nexttoward  1.00000009   -Infinity ->   1.00000008\r
+nextt418 nexttoward  1.00000010   -Infinity ->   1.00000009\r
+nextt419 nexttoward  1.00000011   -Infinity ->   1.00000010\r
+nextt420 nexttoward  1.00000012   -Infinity ->   1.00000011\r
+\r
+nextt421 nexttoward -0.999999995  -Infinity ->  -0.999999996\r
+nextt422 nexttoward -0.999999996  -Infinity ->  -0.999999997\r
+nextt423 nexttoward -0.999999997  -Infinity ->  -0.999999998\r
+nextt424 nexttoward -0.999999998  -Infinity ->  -0.999999999\r
+nextt425 nexttoward -0.999999999  -Infinity ->  -1.00000000\r
+nextt426 nexttoward -1.00000000   -Infinity ->  -1.00000001\r
+nextt427 nexttoward -1.0          -Infinity ->  -1.00000001\r
+nextt428 nexttoward -1            -Infinity ->  -1.00000001\r
+nextt429 nexttoward -1.00000001   -Infinity ->  -1.00000002\r
+nextt430 nexttoward -1.00000002   -Infinity ->  -1.00000003\r
+nextt431 nexttoward -1.00000003   -Infinity ->  -1.00000004\r
+nextt432 nexttoward -1.00000004   -Infinity ->  -1.00000005\r
+nextt433 nexttoward -1.00000005   -Infinity ->  -1.00000006\r
+nextt434 nexttoward -1.00000006   -Infinity ->  -1.00000007\r
+nextt435 nexttoward -1.00000007   -Infinity ->  -1.00000008\r
+nextt436 nexttoward -1.00000008   -Infinity ->  -1.00000009\r
+nextt437 nexttoward -1.00000009   -Infinity ->  -1.00000010\r
+nextt438 nexttoward -1.00000010   -Infinity ->  -1.00000011\r
+nextt439 nexttoward -1.00000011   -Infinity ->  -1.00000012\r
+\r
+-- input operand is >precision\r
+nextt441 nexttoward  1.00000010998   -Infinity ->   1.00000010\r
+nextt442 nexttoward  1.00000010999   -Infinity ->   1.00000010\r
+nextt443 nexttoward  1.00000011000   -Infinity ->   1.00000010\r
+nextt444 nexttoward  1.00000011001   -Infinity ->   1.00000011\r
+nextt445 nexttoward  1.00000011002   -Infinity ->   1.00000011\r
+nextt446 nexttoward  1.00000011002   -Infinity ->   1.00000011\r
+nextt447 nexttoward  1.00000011052   -Infinity ->   1.00000011\r
+nextt448 nexttoward  1.00000011552   -Infinity ->   1.00000011\r
+nextt449 nexttoward -1.00000010998   -Infinity ->  -1.00000011\r
+nextt450 nexttoward -1.00000010999   -Infinity ->  -1.00000011\r
+nextt451 nexttoward -1.00000011000   -Infinity ->  -1.00000012\r
+nextt452 nexttoward -1.00000011001   -Infinity ->  -1.00000012\r
+nextt453 nexttoward -1.00000011002   -Infinity ->  -1.00000012\r
+nextt454 nexttoward -1.00000011002   -Infinity ->  -1.00000012\r
+nextt455 nexttoward -1.00000011052   -Infinity ->  -1.00000012\r
+nextt456 nexttoward -1.00000011552   -Infinity ->  -1.00000012\r
+-- ultra-tiny inputs\r
+nextt460 nexttoward  1E-99999        -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped\r
+nextt461 nexttoward  1E-999999999    -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped\r
+nextt462 nexttoward  1E-391          -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped\r
+nextt463 nexttoward -1E-99999        -Infinity ->  -1E-391     Underflow Subnormal Inexact Rounded\r
+nextt464 nexttoward -1E-999999999    -Infinity ->  -1E-391     Underflow Subnormal Inexact Rounded\r
+nextt465 nexttoward -1E-391          -Infinity ->  -2E-391     Underflow Subnormal Inexact Rounded\r
+\r
+-- Zeros\r
+nextt500 nexttoward -0            -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt501 nexttoward  0            -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt502 nexttoward  0.00         -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt503 nexttoward -0.00         -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt504 nexttoward  0E-300       -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt505 nexttoward  0E+300       -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt506 nexttoward  0E+30000     -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt507 nexttoward -0E+30000     -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded\r
+nextt508 nexttoward  0.00         -0.0000   -> -0.00\r
+\r
+-- specials\r
+nextt550 nexttoward   Inf     -Infinity ->  9.99999999E+384\r
+nextt551 nexttoward  -Inf     -Infinity -> -Infinity\r
+nextt552 nexttoward   NaN     -Infinity ->  NaN\r
+nextt553 nexttoward  sNaN     -Infinity ->  NaN   Invalid_operation\r
+nextt554 nexttoward   NaN77   -Infinity ->  NaN77\r
+nextt555 nexttoward  sNaN88   -Infinity ->  NaN88 Invalid_operation\r
+nextt556 nexttoward  -NaN     -Infinity -> -NaN\r
+nextt557 nexttoward -sNaN     -Infinity -> -NaN   Invalid_operation\r
+nextt558 nexttoward  -NaN77   -Infinity -> -NaN77\r
+nextt559 nexttoward -sNaN88   -Infinity -> -NaN88 Invalid_operation\r
+\r
+-- Nmax, Nmin, Ntiny, subnormals\r
+maxExponent: 999\r
+minexponent: -999\r
+nextt570 nexttoward  9.99999999E+999    -Infinity -> 9.99999998E+999\r
+nextt571 nexttoward  9.99999998E+999    -Infinity -> 9.99999997E+999\r
+nextt572 nexttoward  1E-999             -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded\r
+nextt573 nexttoward  1.00000000E-999    -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded\r
+nextt574 nexttoward  9E-1007            -Infinity -> 8E-1007         Underflow Subnormal Inexact Rounded\r
+nextt575 nexttoward  9.9E-1006          -Infinity -> 9.8E-1006       Underflow Subnormal Inexact Rounded\r
+nextt576 nexttoward  9.9999E-1003       -Infinity -> 9.9998E-1003    Underflow Subnormal Inexact Rounded\r
+nextt577 nexttoward  9.9999999E-1000    -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded\r
+nextt578 nexttoward  9.9999998E-1000    -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded\r
+nextt579 nexttoward  9.9999997E-1000    -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded\r
+nextt580 nexttoward  0E-1007            -Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded\r
+nextt581 nexttoward  1E-1007            -Infinity -> 0E-1007         Underflow Subnormal Inexact Rounded Clamped\r
+nextt582 nexttoward  2E-1007            -Infinity -> 1E-1007         Underflow Subnormal Inexact Rounded\r
+\r
+nextt583 nexttoward  -0E-1007           -Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded\r
+nextt584 nexttoward  -1E-1007           -Infinity -> -2E-1007        Underflow Subnormal Inexact Rounded\r
+nextt585 nexttoward  -2E-1007           -Infinity -> -3E-1007        Underflow Subnormal Inexact Rounded\r
+nextt586 nexttoward  -10E-1007          -Infinity -> -1.1E-1006      Underflow Subnormal Inexact Rounded\r
+nextt587 nexttoward  -100E-1007         -Infinity -> -1.01E-1005     Underflow Subnormal Inexact Rounded\r
+nextt588 nexttoward  -100000E-1007      -Infinity -> -1.00001E-1002  Underflow Subnormal Inexact Rounded\r
+nextt589 nexttoward  -1.0000E-999       -Infinity -> -1.00000001E-999\r
+nextt590 nexttoward  -1.00000000E-999   -Infinity -> -1.00000001E-999\r
+nextt591 nexttoward  -1E-999            -Infinity -> -1.00000001E-999\r
+nextt592 nexttoward  -9.99999998E+999   -Infinity -> -9.99999999E+999\r
+nextt593 nexttoward  -9.99999999E+999   -Infinity -> -Infinity Overflow Inexact Rounded\r
+\r
+\r
+\r
+\r
+------- Specials\r
+maxExponent: 384\r
+minexponent: -383\r
+nextt780 nexttoward -Inf  -Inf   -> -Infinity\r
+nextt781 nexttoward -Inf  -1000  -> -9.99999999E+384\r
+nextt782 nexttoward -Inf  -1     -> -9.99999999E+384\r
+nextt783 nexttoward -Inf  -0     -> -9.99999999E+384\r
+nextt784 nexttoward -Inf   0     -> -9.99999999E+384\r
+nextt785 nexttoward -Inf   1     -> -9.99999999E+384\r
+nextt786 nexttoward -Inf   1000  -> -9.99999999E+384\r
+nextt787 nexttoward -1000 -Inf   -> -1000.00001\r
+nextt788 nexttoward -Inf  -Inf   -> -Infinity\r
+nextt789 nexttoward -1    -Inf   -> -1.00000001\r
+nextt790 nexttoward -0    -Inf   -> -1E-391           Underflow Subnormal Inexact Rounded\r
+nextt791 nexttoward  0    -Inf   -> -1E-391           Underflow Subnormal Inexact Rounded\r
+nextt792 nexttoward  1    -Inf   ->  0.999999999\r
+nextt793 nexttoward  1000 -Inf   ->  999.999999\r
+nextt794 nexttoward  Inf  -Inf   ->  9.99999999E+384\r
+\r
+nextt800 nexttoward  Inf  -Inf   ->  9.99999999E+384\r
+nextt801 nexttoward  Inf  -1000  ->  9.99999999E+384\r
+nextt802 nexttoward  Inf  -1     ->  9.99999999E+384\r
+nextt803 nexttoward  Inf  -0     ->  9.99999999E+384\r
+nextt804 nexttoward  Inf   0     ->  9.99999999E+384\r
+nextt805 nexttoward  Inf   1     ->  9.99999999E+384\r
+nextt806 nexttoward  Inf   1000  ->  9.99999999E+384\r
+nextt807 nexttoward  Inf   Inf   ->  Infinity\r
+nextt808 nexttoward -1000  Inf   -> -999.999999\r
+nextt809 nexttoward -Inf   Inf   -> -9.99999999E+384\r
+nextt810 nexttoward -1     Inf   -> -0.999999999\r
+nextt811 nexttoward -0     Inf   ->  1E-391           Underflow Subnormal Inexact Rounded\r
+nextt812 nexttoward  0     Inf   ->  1E-391           Underflow Subnormal Inexact Rounded\r
+nextt813 nexttoward  1     Inf   ->  1.00000001\r
+nextt814 nexttoward  1000  Inf   ->  1000.00001\r
+nextt815 nexttoward  Inf   Inf   ->  Infinity\r
+\r
+nextt821 nexttoward  NaN -Inf    ->  NaN\r
+nextt822 nexttoward  NaN -1000   ->  NaN\r
+nextt823 nexttoward  NaN -1      ->  NaN\r
+nextt824 nexttoward  NaN -0      ->  NaN\r
+nextt825 nexttoward  NaN  0      ->  NaN\r
+nextt826 nexttoward  NaN  1      ->  NaN\r
+nextt827 nexttoward  NaN  1000   ->  NaN\r
+nextt828 nexttoward  NaN  Inf    ->  NaN\r
+nextt829 nexttoward  NaN  NaN    ->  NaN\r
+nextt830 nexttoward -Inf  NaN    ->  NaN\r
+nextt831 nexttoward -1000 NaN    ->  NaN\r
+nextt832 nexttoward -1    NaN    ->  NaN\r
+nextt833 nexttoward -0    NaN    ->  NaN\r
+nextt834 nexttoward  0    NaN    ->  NaN\r
+nextt835 nexttoward  1    NaN    ->  NaN\r
+nextt836 nexttoward  1000 NaN    ->  NaN\r
+nextt837 nexttoward  Inf  NaN    ->  NaN\r
+\r
+nextt841 nexttoward  sNaN -Inf   ->  NaN  Invalid_operation\r
+nextt842 nexttoward  sNaN -1000  ->  NaN  Invalid_operation\r
+nextt843 nexttoward  sNaN -1     ->  NaN  Invalid_operation\r
+nextt844 nexttoward  sNaN -0     ->  NaN  Invalid_operation\r
+nextt845 nexttoward  sNaN  0     ->  NaN  Invalid_operation\r
+nextt846 nexttoward  sNaN  1     ->  NaN  Invalid_operation\r
+nextt847 nexttoward  sNaN  1000  ->  NaN  Invalid_operation\r
+nextt848 nexttoward  sNaN  NaN   ->  NaN  Invalid_operation\r
+nextt849 nexttoward  sNaN sNaN   ->  NaN  Invalid_operation\r
+nextt850 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+nextt851 nexttoward -Inf  sNaN   ->  NaN  Invalid_operation\r
+nextt852 nexttoward -1000 sNaN   ->  NaN  Invalid_operation\r
+nextt853 nexttoward -1    sNaN   ->  NaN  Invalid_operation\r
+nextt854 nexttoward -0    sNaN   ->  NaN  Invalid_operation\r
+nextt855 nexttoward  0    sNaN   ->  NaN  Invalid_operation\r
+nextt856 nexttoward  1    sNaN   ->  NaN  Invalid_operation\r
+nextt857 nexttoward  1000 sNaN   ->  NaN  Invalid_operation\r
+nextt858 nexttoward  Inf  sNaN   ->  NaN  Invalid_operation\r
+nextt859 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+nextt861 nexttoward  NaN1   -Inf    ->  NaN1\r
+nextt862 nexttoward +NaN2   -1000   ->  NaN2\r
+nextt863 nexttoward  NaN3    1000   ->  NaN3\r
+nextt864 nexttoward  NaN4    Inf    ->  NaN4\r
+nextt865 nexttoward  NaN5   +NaN6   ->  NaN5\r
+nextt866 nexttoward -Inf     NaN7   ->  NaN7\r
+nextt867 nexttoward -1000    NaN8   ->  NaN8\r
+nextt868 nexttoward  1000    NaN9   ->  NaN9\r
+nextt869 nexttoward  Inf    +NaN10  ->  NaN10\r
+nextt871 nexttoward  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+nextt872 nexttoward  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+nextt873 nexttoward  sNaN13   1000  ->  NaN13  Invalid_operation\r
+nextt874 nexttoward  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+nextt875 nexttoward  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+nextt876 nexttoward  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+nextt877 nexttoward -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+nextt878 nexttoward -1000    sNaN21 ->  NaN21  Invalid_operation\r
+nextt879 nexttoward  1000    sNaN22 ->  NaN22  Invalid_operation\r
+nextt880 nexttoward  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+nextt881 nexttoward +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+nextt882 nexttoward -NaN26    NaN28 -> -NaN26\r
+nextt883 nexttoward -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+nextt884 nexttoward  1000    -NaN30 -> -NaN30\r
+nextt885 nexttoward  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- Null tests\r
+nextt900 nexttoward 1  # -> NaN Invalid_operation\r
+nextt901 nexttoward #  1 -> NaN Invalid_operation\r
+\r
diff --git a/Lib/test/decimaltestdata/normalize.decTest b/Lib/test/decimaltestdata/normalize.decTest
deleted file mode 100644 (file)
index 5708839..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-------------------------------------------------------------------------
--- normalize.decTest -- remove trailing zeros                         --
--- Copyright (c) IBM Corporation, 2003.  All rights reserved.         --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases"     --
--- at http://www2.hursley.ibm.com/decimal for the description of      --
--- these testcases.                                                   --
---                                                                    --
--- These testcases are experimental ('beta' versions), and they       --
--- may contain errors.  They are offered on an as-is basis.  In       --
--- particular, achieving the same results as the tests here is not    --
--- a guarantee that an implementation complies with any Standard      --
--- or specification.  The tests are not exhaustive.                   --
---                                                                    --
--- Please send comments, suggestions, and corrections to the author:  --
---   Mike Cowlishaw, IBM Fellow                                       --
---   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
---   mfc@uk.ibm.com                                                   --
-------------------------------------------------------------------------
-version: 2.39
-
-extended:    1
-precision:   9
-rounding:    half_up
-maxExponent: 999
-minexponent: -999
-
-nrmx001 normalize '1'      -> '1'
-nrmx002 normalize '-1'     -> '-1'
-nrmx003 normalize '1.00'   -> '1'
-nrmx004 normalize '-1.00'  -> '-1'
-nrmx005 normalize '0'      -> '0'
-nrmx006 normalize '0.00'   -> '0'
-nrmx007 normalize '00.0'   -> '0'
-nrmx008 normalize '00.00'  -> '0'
-nrmx009 normalize '00'     -> '0'
-nrmx010 normalize '0E+1'   -> '0'
-nrmx011 normalize '0E+5'   -> '0'
-
-nrmx012 normalize '-2'     -> '-2'
-nrmx013 normalize '2'      -> '2'
-nrmx014 normalize '-2.00'  -> '-2'
-nrmx015 normalize '2.00'   -> '2'
-nrmx016 normalize '-0'     -> '-0'
-nrmx017 normalize '-0.00'  -> '-0'
-nrmx018 normalize '-00.0'  -> '-0'
-nrmx019 normalize '-00.00' -> '-0'
-nrmx020 normalize '-00'    -> '-0'
-nrmx021 normalize '-0E+5'   -> '-0'
-nrmx022 normalize '-0E+1'  -> '-0'
-
-nrmx030 normalize '+0.1'            -> '0.1'
-nrmx031 normalize '-0.1'            -> '-0.1'
-nrmx032 normalize '+0.01'           -> '0.01'
-nrmx033 normalize '-0.01'           -> '-0.01'
-nrmx034 normalize '+0.001'          -> '0.001'
-nrmx035 normalize '-0.001'          -> '-0.001'
-nrmx036 normalize '+0.000001'       -> '0.000001'
-nrmx037 normalize '-0.000001'       -> '-0.000001'
-nrmx038 normalize '+0.000000000001' -> '1E-12'
-nrmx039 normalize '-0.000000000001' -> '-1E-12'
-
-nrmx041 normalize 1.1        -> 1.1
-nrmx042 normalize 1.10       -> 1.1
-nrmx043 normalize 1.100      -> 1.1
-nrmx044 normalize 1.110      -> 1.11
-nrmx045 normalize -1.1       -> -1.1
-nrmx046 normalize -1.10      -> -1.1
-nrmx047 normalize -1.100     -> -1.1
-nrmx048 normalize -1.110     -> -1.11
-nrmx049 normalize 9.9        -> 9.9
-nrmx050 normalize 9.90       -> 9.9
-nrmx051 normalize 9.900      -> 9.9
-nrmx052 normalize 9.990      -> 9.99
-nrmx053 normalize -9.9       -> -9.9
-nrmx054 normalize -9.90      -> -9.9
-nrmx055 normalize -9.900     -> -9.9
-nrmx056 normalize -9.990     -> -9.99
-
--- some trailing fractional zeros with zeros in units
-nrmx060 normalize  10.0        -> 1E+1
-nrmx061 normalize  10.00       -> 1E+1
-nrmx062 normalize  100.0       -> 1E+2
-nrmx063 normalize  100.00      -> 1E+2
-nrmx064 normalize  1.1000E+3   -> 1.1E+3
-nrmx065 normalize  1.10000E+3  -> 1.1E+3
-nrmx066 normalize -10.0        -> -1E+1
-nrmx067 normalize -10.00       -> -1E+1
-nrmx068 normalize -100.0       -> -1E+2
-nrmx069 normalize -100.00      -> -1E+2
-nrmx070 normalize -1.1000E+3   -> -1.1E+3
-nrmx071 normalize -1.10000E+3  -> -1.1E+3
-
--- some insignificant trailing zeros with positive exponent
-nrmx080 normalize  10E+1       -> 1E+2
-nrmx081 normalize  100E+1      -> 1E+3
-nrmx082 normalize  1.0E+2      -> 1E+2
-nrmx083 normalize  1.0E+3      -> 1E+3
-nrmx084 normalize  1.1E+3      -> 1.1E+3
-nrmx085 normalize  1.00E+3     -> 1E+3
-nrmx086 normalize  1.10E+3     -> 1.1E+3
-nrmx087 normalize -10E+1       -> -1E+2
-nrmx088 normalize -100E+1      -> -1E+3
-nrmx089 normalize -1.0E+2      -> -1E+2
-nrmx090 normalize -1.0E+3      -> -1E+3
-nrmx091 normalize -1.1E+3      -> -1.1E+3
-nrmx092 normalize -1.00E+3     -> -1E+3
-nrmx093 normalize -1.10E+3     -> -1.1E+3
-
--- some significant trailing zeros, were we to be trimming
-nrmx100 normalize  11          -> 11
-nrmx101 normalize  10          -> 1E+1
-nrmx102 normalize  10.         -> 1E+1
-nrmx103 normalize  1.1E+1      -> 11
-nrmx104 normalize  1.0E+1      -> 1E+1
-nrmx105 normalize  1.10E+2     -> 1.1E+2
-nrmx106 normalize  1.00E+2     -> 1E+2
-nrmx107 normalize  1.100E+3    -> 1.1E+3
-nrmx108 normalize  1.000E+3    -> 1E+3
-nrmx109 normalize  1.000000E+6 -> 1E+6
-nrmx110 normalize -11          -> -11
-nrmx111 normalize -10          -> -1E+1
-nrmx112 normalize -10.         -> -1E+1
-nrmx113 normalize -1.1E+1      -> -11
-nrmx114 normalize -1.0E+1      -> -1E+1
-nrmx115 normalize -1.10E+2     -> -1.1E+2
-nrmx116 normalize -1.00E+2     -> -1E+2
-nrmx117 normalize -1.100E+3    -> -1.1E+3
-nrmx118 normalize -1.000E+3    -> -1E+3
-nrmx119 normalize -1.00000E+5  -> -1E+5
-nrmx120 normalize -1.000000E+6 -> -1E+6
-nrmx121 normalize -10.00000E+6 -> -1E+7
-nrmx122 normalize -100.0000E+6 -> -1E+8
-nrmx123 normalize -1000.000E+6 -> -1E+9
-nrmx124 normalize -10000.00E+6 -> -1E+10
-nrmx125 normalize -100000.0E+6 -> -1E+11
-nrmx126 normalize -1000000.E+6 -> -1E+12
-
--- examples from decArith
-nrmx140 normalize '2.1'     ->  '2.1'
-nrmx141 normalize '-2.0'    ->  '-2'
-nrmx142 normalize '1.200'   ->  '1.2'
-nrmx143 normalize '-120'    ->  '-1.2E+2'
-nrmx144 normalize '120.00'  ->  '1.2E+2'
-nrmx145 normalize '0.00'    ->  '0'
-
--- overflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-nrmx160 normalize 9.999E+999999999  ->  Infinity Inexact Overflow Rounded
-nrmx161 normalize -9.999E+999999999 -> -Infinity Inexact Overflow Rounded
-
--- subnormals and underflow
-precision: 3
-maxexponent: 999
-minexponent: -999
-nrmx210 normalize  1.00E-999        ->   1E-999
-nrmx211 normalize  0.1E-999         ->   1E-1000   Subnormal
-nrmx212 normalize  0.10E-999        ->   1E-1000   Subnormal
-nrmx213 normalize  0.100E-999       ->   1E-1000   Subnormal Rounded
-nrmx214 normalize  0.01E-999        ->   1E-1001   Subnormal
--- next is rounded to Emin
-nrmx215 normalize  0.999E-999       ->   1E-999    Inexact Rounded Subnormal Underflow
-nrmx216 normalize  0.099E-999       ->   1E-1000   Inexact Rounded Subnormal Underflow
-nrmx217 normalize  0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
-nrmx218 normalize  0.001E-999       ->   0         Inexact Rounded Subnormal Underflow
-nrmx219 normalize  0.0009E-999      ->   0         Inexact Rounded Subnormal Underflow
-nrmx220 normalize  0.0001E-999      ->   0         Inexact Rounded Subnormal Underflow
-
-nrmx230 normalize -1.00E-999        ->  -1E-999
-nrmx231 normalize -0.1E-999         ->  -1E-1000   Subnormal
-nrmx232 normalize -0.10E-999        ->  -1E-1000   Subnormal
-nrmx233 normalize -0.100E-999       ->  -1E-1000   Subnormal Rounded
-nrmx234 normalize -0.01E-999        ->  -1E-1001   Subnormal
--- next is rounded to Emin
-nrmx235 normalize -0.999E-999       ->  -1E-999    Inexact Rounded Subnormal Underflow
-nrmx236 normalize -0.099E-999       ->  -1E-1000   Inexact Rounded Subnormal Underflow
-nrmx237 normalize -0.009E-999       ->  -1E-1001   Inexact Rounded Subnormal Underflow
-nrmx238 normalize -0.001E-999       ->  -0         Inexact Rounded Subnormal Underflow
-nrmx239 normalize -0.0009E-999      ->  -0         Inexact Rounded Subnormal Underflow
-nrmx240 normalize -0.0001E-999      ->  -0         Inexact Rounded Subnormal Underflow
-
--- more reshaping
-precision: 9
-nrmx260 normalize '56260E-10'   -> '0.000005626'
-nrmx261 normalize '56260E-5'    -> '0.5626'
-nrmx262 normalize '56260E-2'    -> '562.6'
-nrmx263 normalize '56260E-1'    -> '5626'
-nrmx265 normalize '56260E-0'    -> '5.626E+4'
-nrmx266 normalize '56260E+0'    -> '5.626E+4'
-nrmx267 normalize '56260E+1'    -> '5.626E+5'
-nrmx268 normalize '56260E+2'    -> '5.626E+6'
-nrmx269 normalize '56260E+3'    -> '5.626E+7'
-nrmx270 normalize '56260E+4'    -> '5.626E+8'
-nrmx271 normalize '56260E+5'    -> '5.626E+9'
-nrmx272 normalize '56260E+6'    -> '5.626E+10'
-nrmx280 normalize '-56260E-10'  -> '-0.000005626'
-nrmx281 normalize '-56260E-5'   -> '-0.5626'
-nrmx282 normalize '-56260E-2'   -> '-562.6'
-nrmx283 normalize '-56260E-1'   -> '-5626'
-nrmx285 normalize '-56260E-0'   -> '-5.626E+4'
-nrmx286 normalize '-56260E+0'   -> '-5.626E+4'
-nrmx287 normalize '-56260E+1'   -> '-5.626E+5'
-nrmx288 normalize '-56260E+2'   -> '-5.626E+6'
-nrmx289 normalize '-56260E+3'   -> '-5.626E+7'
-nrmx290 normalize '-56260E+4'   -> '-5.626E+8'
-nrmx291 normalize '-56260E+5'   -> '-5.626E+9'
-nrmx292 normalize '-56260E+6'   -> '-5.626E+10'
-
-
--- specials
-nrmx820 normalize 'Inf'    -> 'Infinity'
-nrmx821 normalize '-Inf'   -> '-Infinity'
-nrmx822 normalize   NaN    ->  NaN
-nrmx823 normalize  sNaN    ->  NaN    Invalid_operation
-nrmx824 normalize   NaN101 ->  NaN101
-nrmx825 normalize  sNaN010 ->  NaN10  Invalid_operation
-nrmx827 normalize  -NaN    -> -NaN
-nrmx828 normalize -sNaN    -> -NaN    Invalid_operation
-nrmx829 normalize  -NaN101 -> -NaN101
-nrmx830 normalize -sNaN010 -> -NaN10  Invalid_operation
-
--- Null test
-nrmx900 normalize  # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/or.decTest b/Lib/test/decimaltestdata/or.decTest
new file mode 100644 (file)
index 0000000..928939e
--- /dev/null
@@ -0,0 +1,334 @@
+------------------------------------------------------------------------\r
+-- or.decTest -- digitwise logical OR                                 --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check (truth table)\r
+orx001 or             0    0 ->    0\r
+orx002 or             0    1 ->    1\r
+orx003 or             1    0 ->    1\r
+orx004 or             1    1 ->    1\r
+orx005 or          1100 1010 -> 1110\r
+-- and at msd and msd-1\r
+orx006 or 000000000 000000000 ->           0\r
+orx007 or 000000000 100000000 ->   100000000\r
+orx008 or 100000000 000000000 ->   100000000\r
+orx009 or 100000000 100000000 ->   100000000\r
+orx010 or 000000000 000000000 ->           0\r
+orx011 or 000000000 010000000 ->    10000000\r
+orx012 or 010000000 000000000 ->    10000000\r
+orx013 or 010000000 010000000 ->    10000000\r
+\r
+-- Various lengths\r
+--        123456789     123456789      123456789\r
+orx021 or 111111111     111111111  ->  111111111\r
+orx022 or 111111111111  111111111  ->  111111111\r
+orx023 or  11111111      11111111  ->   11111111\r
+orx025 or   1111111       1111111  ->    1111111\r
+orx026 or    111111        111111  ->     111111\r
+orx027 or     11111         11111  ->      11111\r
+orx028 or      1111          1111  ->       1111\r
+orx029 or       111           111  ->        111\r
+orx031 or        11            11  ->         11\r
+orx032 or         1             1  ->          1\r
+orx033 or 111111111111 1111111111  ->  111111111\r
+orx034 or 11111111111 11111111111  ->  111111111\r
+orx035 or 1111111111 111111111111  ->  111111111\r
+orx036 or 111111111 1111111111111  ->  111111111\r
+\r
+orx040 or 111111111  111111111111  ->  111111111\r
+orx041 or  11111111  111111111111  ->  111111111\r
+orx042 or  11111111     111111111  ->  111111111\r
+orx043 or   1111111     100000010  ->  101111111\r
+orx044 or    111111     100000100  ->  100111111\r
+orx045 or     11111     100001000  ->  100011111\r
+orx046 or      1111     100010000  ->  100011111\r
+orx047 or       111     100100000  ->  100100111\r
+orx048 or        11     101000000  ->  101000011\r
+orx049 or         1     110000000  ->  110000001\r
+\r
+orx050 or 1111111111  1  ->  111111111\r
+orx051 or  111111111  1  ->  111111111\r
+orx052 or   11111111  1  ->  11111111\r
+orx053 or    1111111  1  ->  1111111\r
+orx054 or     111111  1  ->  111111\r
+orx055 or      11111  1  ->  11111\r
+orx056 or       1111  1  ->  1111\r
+orx057 or        111  1  ->  111\r
+orx058 or         11  1  ->  11\r
+orx059 or          1  1  ->  1\r
+\r
+orx060 or 1111111111  0  ->  111111111\r
+orx061 or  111111111  0  ->  111111111\r
+orx062 or   11111111  0  ->  11111111\r
+orx063 or    1111111  0  ->  1111111\r
+orx064 or     111111  0  ->  111111\r
+orx065 or      11111  0  ->  11111\r
+orx066 or       1111  0  ->  1111\r
+orx067 or        111  0  ->  111\r
+orx068 or         11  0  ->  11\r
+orx069 or          1  0  ->  1\r
+\r
+orx070 or 1  1111111111  ->  111111111\r
+orx071 or 1   111111111  ->  111111111\r
+orx072 or 1    11111111  ->  11111111\r
+orx073 or 1     1111111  ->  1111111\r
+orx074 or 1      111111  ->  111111\r
+orx075 or 1       11111  ->  11111\r
+orx076 or 1        1111  ->  1111\r
+orx077 or 1         111  ->  111\r
+orx078 or 1          11  ->  11\r
+orx079 or 1           1  ->  1\r
+\r
+orx080 or 0  1111111111  ->  111111111\r
+orx081 or 0   111111111  ->  111111111\r
+orx082 or 0    11111111  ->  11111111\r
+orx083 or 0     1111111  ->  1111111\r
+orx084 or 0      111111  ->  111111\r
+orx085 or 0       11111  ->  11111\r
+orx086 or 0        1111  ->  1111\r
+orx087 or 0         111  ->  111\r
+orx088 or 0          11  ->  11\r
+orx089 or 0           1  ->  1\r
+\r
+orx090 or 011111111  111101111  ->  111111111\r
+orx091 or 101111111  111101111  ->  111111111\r
+orx092 or 110111111  111101111  ->  111111111\r
+orx093 or 111011111  111101111  ->  111111111\r
+orx094 or 111101111  111101111  ->  111101111\r
+orx095 or 111110111  111101111  ->  111111111\r
+orx096 or 111111011  111101111  ->  111111111\r
+orx097 or 111111101  111101111  ->  111111111\r
+orx098 or 111111110  111101111  ->  111111111\r
+\r
+orx100 or 111101111  011111111  ->  111111111\r
+orx101 or 111101111  101111111  ->  111111111\r
+orx102 or 111101111  110111111  ->  111111111\r
+orx103 or 111101111  111011111  ->  111111111\r
+orx104 or 111101111  111101111  ->  111101111\r
+orx105 or 111101111  111110111  ->  111111111\r
+orx106 or 111101111  111111011  ->  111111111\r
+orx107 or 111101111  111111101  ->  111111111\r
+orx108 or 111101111  111111110  ->  111111111\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+orx220 or 111111112  111111111  ->  NaN Invalid_operation\r
+orx221 or 333333333  333333333  ->  NaN Invalid_operation\r
+orx222 or 555555555  555555555  ->  NaN Invalid_operation\r
+orx223 or 777777777  777777777  ->  NaN Invalid_operation\r
+orx224 or 999999999  999999999  ->  NaN Invalid_operation\r
+orx225 or 222222222  999999999  ->  NaN Invalid_operation\r
+orx226 or 444444444  999999999  ->  NaN Invalid_operation\r
+orx227 or 666666666  999999999  ->  NaN Invalid_operation\r
+orx228 or 888888888  999999999  ->  NaN Invalid_operation\r
+orx229 or 999999999  222222222  ->  NaN Invalid_operation\r
+orx230 or 999999999  444444444  ->  NaN Invalid_operation\r
+orx231 or 999999999  666666666  ->  NaN Invalid_operation\r
+orx232 or 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+orx240 or  567468689 -934981942 ->  NaN Invalid_operation\r
+orx241 or  567367689  934981942 ->  NaN Invalid_operation\r
+orx242 or -631917772 -706014634 ->  NaN Invalid_operation\r
+orx243 or -756253257  138579234 ->  NaN Invalid_operation\r
+orx244 or  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+orx250 or  200000000 100000000 ->  NaN Invalid_operation\r
+orx251 or  700000000 100000000 ->  NaN Invalid_operation\r
+orx252 or  800000000 100000000 ->  NaN Invalid_operation\r
+orx253 or  900000000 100000000 ->  NaN Invalid_operation\r
+orx254 or  200000000 000000000 ->  NaN Invalid_operation\r
+orx255 or  700000000 000000000 ->  NaN Invalid_operation\r
+orx256 or  800000000 000000000 ->  NaN Invalid_operation\r
+orx257 or  900000000 000000000 ->  NaN Invalid_operation\r
+orx258 or  100000000 200000000 ->  NaN Invalid_operation\r
+orx259 or  100000000 700000000 ->  NaN Invalid_operation\r
+orx260 or  100000000 800000000 ->  NaN Invalid_operation\r
+orx261 or  100000000 900000000 ->  NaN Invalid_operation\r
+orx262 or  000000000 200000000 ->  NaN Invalid_operation\r
+orx263 or  000000000 700000000 ->  NaN Invalid_operation\r
+orx264 or  000000000 800000000 ->  NaN Invalid_operation\r
+orx265 or  000000000 900000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+orx270 or  020000000 100000000 ->  NaN Invalid_operation\r
+orx271 or  070100000 100000000 ->  NaN Invalid_operation\r
+orx272 or  080010000 100000001 ->  NaN Invalid_operation\r
+orx273 or  090001000 100000010 ->  NaN Invalid_operation\r
+orx274 or  100000100 020010100 ->  NaN Invalid_operation\r
+orx275 or  100000000 070001000 ->  NaN Invalid_operation\r
+orx276 or  100000010 080010100 ->  NaN Invalid_operation\r
+orx277 or  100000000 090000010 ->  NaN Invalid_operation\r
+-- test LSD\r
+orx280 or  001000002 100000000 ->  NaN Invalid_operation\r
+orx281 or  000000007 100000000 ->  NaN Invalid_operation\r
+orx282 or  000000008 100000000 ->  NaN Invalid_operation\r
+orx283 or  000000009 100000000 ->  NaN Invalid_operation\r
+orx284 or  100000000 000100002 ->  NaN Invalid_operation\r
+orx285 or  100100000 001000007 ->  NaN Invalid_operation\r
+orx286 or  100010000 010000008 ->  NaN Invalid_operation\r
+orx287 or  100001000 100000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+orx288 or  001020000 100000000 ->  NaN Invalid_operation\r
+orx289 or  000070001 100000000 ->  NaN Invalid_operation\r
+orx290 or  000080000 100010000 ->  NaN Invalid_operation\r
+orx291 or  000090000 100001000 ->  NaN Invalid_operation\r
+orx292 or  100000010 000020100 ->  NaN Invalid_operation\r
+orx293 or  100100000 000070010 ->  NaN Invalid_operation\r
+orx294 or  100010100 000080001 ->  NaN Invalid_operation\r
+orx295 or  100001000 000090000 ->  NaN Invalid_operation\r
+-- signs\r
+orx296 or -100001000 -000000000 ->  NaN Invalid_operation\r
+orx297 or -100001000  000010000 ->  NaN Invalid_operation\r
+orx298 or  100001000 -000000000 ->  NaN Invalid_operation\r
+orx299 or  100001000  000011000 ->  100011000\r
+\r
+-- Nmax, Nmin, Ntiny\r
+orx331 or  2   9.99999999E+999     -> NaN Invalid_operation\r
+orx332 or  3   1E-999              -> NaN Invalid_operation\r
+orx333 or  4   1.00000000E-999     -> NaN Invalid_operation\r
+orx334 or  5   1E-1007             -> NaN Invalid_operation\r
+orx335 or  6   -1E-1007            -> NaN Invalid_operation\r
+orx336 or  7   -1.00000000E-999    -> NaN Invalid_operation\r
+orx337 or  8   -1E-999             -> NaN Invalid_operation\r
+orx338 or  9   -9.99999999E+999    -> NaN Invalid_operation\r
+orx341 or  9.99999999E+999     -18 -> NaN Invalid_operation\r
+orx342 or  1E-999               01 -> NaN Invalid_operation\r
+orx343 or  1.00000000E-999     -18 -> NaN Invalid_operation\r
+orx344 or  1E-1007              18 -> NaN Invalid_operation\r
+orx345 or  -1E-1007            -10 -> NaN Invalid_operation\r
+orx346 or  -1.00000000E-999     18 -> NaN Invalid_operation\r
+orx347 or  -1E-999              10 -> NaN Invalid_operation\r
+orx348 or  -9.99999999E+999    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+orx361 or  1.0                  1  -> NaN Invalid_operation\r
+orx362 or  1E+1                 1  -> NaN Invalid_operation\r
+orx363 or  0.0                  1  -> NaN Invalid_operation\r
+orx364 or  0E+1                 1  -> NaN Invalid_operation\r
+orx365 or  9.9                  1  -> NaN Invalid_operation\r
+orx366 or  9E+1                 1  -> NaN Invalid_operation\r
+orx371 or  0 1.0                   -> NaN Invalid_operation\r
+orx372 or  0 1E+1                  -> NaN Invalid_operation\r
+orx373 or  0 0.0                   -> NaN Invalid_operation\r
+orx374 or  0 0E+1                  -> NaN Invalid_operation\r
+orx375 or  0 9.9                   -> NaN Invalid_operation\r
+orx376 or  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+orx780 or -Inf  -Inf   -> NaN Invalid_operation\r
+orx781 or -Inf  -1000  -> NaN Invalid_operation\r
+orx782 or -Inf  -1     -> NaN Invalid_operation\r
+orx783 or -Inf  -0     -> NaN Invalid_operation\r
+orx784 or -Inf   0     -> NaN Invalid_operation\r
+orx785 or -Inf   1     -> NaN Invalid_operation\r
+orx786 or -Inf   1000  -> NaN Invalid_operation\r
+orx787 or -1000 -Inf   -> NaN Invalid_operation\r
+orx788 or -Inf  -Inf   -> NaN Invalid_operation\r
+orx789 or -1    -Inf   -> NaN Invalid_operation\r
+orx790 or -0    -Inf   -> NaN Invalid_operation\r
+orx791 or  0    -Inf   -> NaN Invalid_operation\r
+orx792 or  1    -Inf   -> NaN Invalid_operation\r
+orx793 or  1000 -Inf   -> NaN Invalid_operation\r
+orx794 or  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+orx800 or  Inf  -Inf   -> NaN Invalid_operation\r
+orx801 or  Inf  -1000  -> NaN Invalid_operation\r
+orx802 or  Inf  -1     -> NaN Invalid_operation\r
+orx803 or  Inf  -0     -> NaN Invalid_operation\r
+orx804 or  Inf   0     -> NaN Invalid_operation\r
+orx805 or  Inf   1     -> NaN Invalid_operation\r
+orx806 or  Inf   1000  -> NaN Invalid_operation\r
+orx807 or  Inf   Inf   -> NaN Invalid_operation\r
+orx808 or -1000  Inf   -> NaN Invalid_operation\r
+orx809 or -Inf   Inf   -> NaN Invalid_operation\r
+orx810 or -1     Inf   -> NaN Invalid_operation\r
+orx811 or -0     Inf   -> NaN Invalid_operation\r
+orx812 or  0     Inf   -> NaN Invalid_operation\r
+orx813 or  1     Inf   -> NaN Invalid_operation\r
+orx814 or  1000  Inf   -> NaN Invalid_operation\r
+orx815 or  Inf   Inf   -> NaN Invalid_operation\r
+\r
+orx821 or  NaN -Inf    -> NaN Invalid_operation\r
+orx822 or  NaN -1000   -> NaN Invalid_operation\r
+orx823 or  NaN -1      -> NaN Invalid_operation\r
+orx824 or  NaN -0      -> NaN Invalid_operation\r
+orx825 or  NaN  0      -> NaN Invalid_operation\r
+orx826 or  NaN  1      -> NaN Invalid_operation\r
+orx827 or  NaN  1000   -> NaN Invalid_operation\r
+orx828 or  NaN  Inf    -> NaN Invalid_operation\r
+orx829 or  NaN  NaN    -> NaN Invalid_operation\r
+orx830 or -Inf  NaN    -> NaN Invalid_operation\r
+orx831 or -1000 NaN    -> NaN Invalid_operation\r
+orx832 or -1    NaN    -> NaN Invalid_operation\r
+orx833 or -0    NaN    -> NaN Invalid_operation\r
+orx834 or  0    NaN    -> NaN Invalid_operation\r
+orx835 or  1    NaN    -> NaN Invalid_operation\r
+orx836 or  1000 NaN    -> NaN Invalid_operation\r
+orx837 or  Inf  NaN    -> NaN Invalid_operation\r
+\r
+orx841 or  sNaN -Inf   ->  NaN  Invalid_operation\r
+orx842 or  sNaN -1000  ->  NaN  Invalid_operation\r
+orx843 or  sNaN -1     ->  NaN  Invalid_operation\r
+orx844 or  sNaN -0     ->  NaN  Invalid_operation\r
+orx845 or  sNaN  0     ->  NaN  Invalid_operation\r
+orx846 or  sNaN  1     ->  NaN  Invalid_operation\r
+orx847 or  sNaN  1000  ->  NaN  Invalid_operation\r
+orx848 or  sNaN  NaN   ->  NaN  Invalid_operation\r
+orx849 or  sNaN sNaN   ->  NaN  Invalid_operation\r
+orx850 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+orx851 or -Inf  sNaN   ->  NaN  Invalid_operation\r
+orx852 or -1000 sNaN   ->  NaN  Invalid_operation\r
+orx853 or -1    sNaN   ->  NaN  Invalid_operation\r
+orx854 or -0    sNaN   ->  NaN  Invalid_operation\r
+orx855 or  0    sNaN   ->  NaN  Invalid_operation\r
+orx856 or  1    sNaN   ->  NaN  Invalid_operation\r
+orx857 or  1000 sNaN   ->  NaN  Invalid_operation\r
+orx858 or  Inf  sNaN   ->  NaN  Invalid_operation\r
+orx859 or  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+orx861 or  NaN1   -Inf    -> NaN Invalid_operation\r
+orx862 or +NaN2   -1000   -> NaN Invalid_operation\r
+orx863 or  NaN3    1000   -> NaN Invalid_operation\r
+orx864 or  NaN4    Inf    -> NaN Invalid_operation\r
+orx865 or  NaN5   +NaN6   -> NaN Invalid_operation\r
+orx866 or -Inf     NaN7   -> NaN Invalid_operation\r
+orx867 or -1000    NaN8   -> NaN Invalid_operation\r
+orx868 or  1000    NaN9   -> NaN Invalid_operation\r
+orx869 or  Inf    +NaN10  -> NaN Invalid_operation\r
+orx871 or  sNaN11  -Inf   -> NaN Invalid_operation\r
+orx872 or  sNaN12  -1000  -> NaN Invalid_operation\r
+orx873 or  sNaN13   1000  -> NaN Invalid_operation\r
+orx874 or  sNaN14   NaN17 -> NaN Invalid_operation\r
+orx875 or  sNaN15  sNaN18 -> NaN Invalid_operation\r
+orx876 or  NaN16   sNaN19 -> NaN Invalid_operation\r
+orx877 or -Inf    +sNaN20 -> NaN Invalid_operation\r
+orx878 or -1000    sNaN21 -> NaN Invalid_operation\r
+orx879 or  1000    sNaN22 -> NaN Invalid_operation\r
+orx880 or  Inf     sNaN23 -> NaN Invalid_operation\r
+orx881 or +NaN25  +sNaN24 -> NaN Invalid_operation\r
+orx882 or -NaN26    NaN28 -> NaN Invalid_operation\r
+orx883 or -sNaN27  sNaN29 -> NaN Invalid_operation\r
+orx884 or  1000    -NaN30 -> NaN Invalid_operation\r
+orx885 or  1000   -sNaN31 -> NaN Invalid_operation\r
index a6d8e58c35eb6b84e3077377de59587cccfb71bc..9af4c0e990ef59d248fc4576bff1e7692c136605 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- plus.decTest -- decimal monadic addition                           --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- This set of tests primarily tests the existence of the operator.
 -- Addition and rounding, and most overflows, are tested elsewhere.
@@ -138,9 +138,9 @@ plux214 plus  0.01E-999        ->   1E-1001   Subnormal
 plux215 plus  0.999E-999       ->   1.00E-999 Inexact Rounded Subnormal Underflow
 plux216 plus  0.099E-999       ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 plux217 plus  0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
-plux218 plus  0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow
-plux219 plus  0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
-plux220 plus  0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
+plux218 plus  0.001E-999       ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+plux219 plus  0.0009E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+plux220 plus  0.0001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 plux230 plus -1.00E-999        ->  -1.00E-999
 plux231 plus -0.1E-999         ->  -1E-1000   Subnormal
@@ -151,9 +151,23 @@ plux234 plus -0.01E-999        ->  -1E-1001   Subnormal
 plux235 plus -0.999E-999       ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 plux236 plus -0.099E-999       ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 plux237 plus -0.009E-999       ->  -1E-1001   Inexact Rounded Subnormal Underflow
-plux238 plus -0.001E-999       ->  -0E-1001   Inexact Rounded Subnormal Underflow
-plux239 plus -0.0009E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
-plux240 plus -0.0001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
+plux238 plus -0.001E-999       ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+plux239 plus -0.0009E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+plux240 plus -0.0001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+
+-- subnormals clamped to 0-Etiny
+precision:   16
+maxExponent: 384
+minExponent: -383
+plux251 plus 7E-398     -> 7E-398 Subnormal
+plux252 plus 0E-398     -> 0E-398
+plux253 plus 7E-399     -> 1E-398 Subnormal Underflow Inexact Rounded
+plux254 plus 4E-399     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+plux255 plus 7E-400     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+plux256 plus 7E-401     -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
+plux257 plus 0E-399     -> 0E-398 Clamped
+plux258 plus 0E-400     -> 0E-398 Clamped
+plux259 plus 0E-401     -> 0E-398 Clamped
 
 -- long operand checks
 maxexponent: 999
index 748d66a3e0a0c05b1901e374352a986987811c7d..78c1e072fd192a2c5dd025d3f706b6a9022e52c2 100644 (file)
@@ -1,6 +1,6 @@
-----------------------------------------------------------------------
--- power.decTest -- decimal exponentiation                            --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+------------------------------------------------------------------------
+-- power.decTest -- decimal exponentiation [power(x, y)]              --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
--- This set of testcases tests raising numbers to an integer power only.
--- If arbitrary powers were supported, 1 ulp differences would be
--- permitted.
+-- In addition to the power operator testcases here, see also the file
+-- powersqrt.decTest which includes all the tests from
+-- squareroot.decTest implemented using power(x, 0.5)
 
 extended:    1
-precision:   9
-rounding:    half_up
-maxExponent: 999
-minexponent: -999
+precision:   16
+rounding:    half_even
+maxExponent: 384
+minExponent: -383
 
 -- base checks.  Note 0**0 is an error.
 powx001 power    '0'  '0'         -> NaN Invalid_operation
@@ -52,51 +52,54 @@ powx021 power    '2'  '11'        -> '2048'
 powx022 power    '2'  '12'        -> '4096'
 powx023 power    '2'  '15'        -> '32768'
 powx024 power    '2'  '16'        -> '65536'
-powx025 power    '2'  '31'        -> '2.14748365E+9' Inexact Rounded
+powx025 power    '2'  '31'        -> '2147483648'
 -- NB 0 not stripped in next
-powx026 power    '2'  '32'        -> '4.29496730E+9' Inexact Rounded
+powx026 power    '2'  '32'        -> '4294967296'
+
+precision: 9
+powx027 power    '2'  '31'        -> '2.14748365E+9' Inexact Rounded
+-- NB 0 not stripped in next
+powx028 power    '2'  '32'        -> '4.29496730E+9' Inexact Rounded
 precision: 10
-powx027 power    '2'  '31'        -> '2147483648'
-powx028 power    '2'  '32'        -> '4294967296'
+powx029 power    '2'  '31'        -> '2147483648'
+powx030 power    '2'  '32'        -> '4294967296'
 precision: 9
 
-powx030 power    '3'  '2'         -> 9
-powx031 power    '4'  '2'         -> 16
-powx032 power    '5'  '2'         -> 25
-powx033 power    '6'  '2'         -> 36
-powx034 power    '7'  '2'         -> 49
-powx035 power    '8'  '2'         -> 64
-powx036 power    '9'  '2'         -> 81
-powx037 power    '10' '2'         -> 100
-powx038 power    '11' '2'         -> 121
-powx039 power    '12' '2'         -> 144
-
-powx040 power    '3'  '3'         -> 27
-powx041 power    '4'  '3'         -> 64
-powx042 power    '5'  '3'         -> 125
-powx043 power    '6'  '3'         -> 216
-powx044 power    '7'  '3'         -> 343
-
-powx050 power   '10'  '0'         -> 1
-powx051 power   '10'  '1'         -> 10
-powx052 power   '10'  '2'         -> 100
-powx053 power   '10'  '3'         -> 1000
-powx054 power   '10'  '4'         -> 10000
-powx055 power   '10'  '5'         -> 100000
-powx056 power   '10'  '6'         -> 1000000
-powx057 power   '10'  '7'         -> 10000000
-powx058 power   '10'  '8'         -> 100000000
-powx059 power   '10'  '9'         -> 1.00000000E+9 Rounded
-powx060 power   '10'  '22'        -> 1.00000000E+22 Rounded
-powx061 power   '10'  '77'        -> 1.00000000E+77 Rounded
-powx062 power   '10'  '99'        -> 1.00000000E+99 Rounded
+powx031 power    '3'  '2'         -> 9
+powx032 power    '4'  '2'         -> 16
+powx033 power    '5'  '2'         -> 25
+powx034 power    '6'  '2'         -> 36
+powx035 power    '7'  '2'         -> 49
+powx036 power    '8'  '2'         -> 64
+powx037 power    '9'  '2'         -> 81
+powx038 power    '10' '2'         -> 100
+powx039 power    '11' '2'         -> 121
+powx040 power    '12' '2'         -> 144
 
-maxexponent: 999999999
-minexponent: -999999999
-powx063 power   '10'  '999999999' -> '1.00000000E+999999999' Rounded
-powx064 power   '10'  '999999998' -> '1.00000000E+999999998' Rounded
-powx065 power   '10'  '999999997' -> '1.00000000E+999999997' Rounded
-powx066 power   '10'  '333333333' -> '1.00000000E+333333333' Rounded
+powx041 power    '3'  '3'         -> 27
+powx042 power    '4'  '3'         -> 64
+powx043 power    '5'  '3'         -> 125
+powx044 power    '6'  '3'         -> 216
+powx045 power    '7'  '3'         -> 343
+powx047 power   '-3'  '3'         -> -27
+powx048 power   '-4'  '3'         -> -64
+powx049 power   '-5'  '3'         -> -125
+powx050 power   '-6'  '3'         -> -216
+powx051 power   '-7'  '3'         -> -343
+
+powx052 power   '10'  '0'         -> 1
+powx053 power   '10'  '1'         -> 10
+powx054 power   '10'  '2'         -> 100
+powx055 power   '10'  '3'         -> 1000
+powx056 power   '10'  '4'         -> 10000
+powx057 power   '10'  '5'         -> 100000
+powx058 power   '10'  '6'         -> 1000000
+powx059 power   '10'  '7'         -> 10000000
+powx060 power   '10'  '8'         -> 100000000
+powx061 power   '10'  '9'         -> 1.00000000E+9 Rounded
+powx062 power   '10'  '22'        -> 1.00000000E+22 Rounded
+powx063 power   '10'  '77'        -> 1.00000000E+77 Rounded
+powx064 power   '10'  '99'        -> 1.00000000E+99 Rounded
 
 powx070 power  '0.3'  '0'           -> '1'
 powx071 power  '0.3'  '1'           -> '0.3'
@@ -127,71 +130,52 @@ powx094 power   101    6            -> 1.06152015E+12 Inexact Rounded
 powx095 power   101    7            -> 1.07213535E+14 Inexact Rounded
 
 -- negative powers
-powx101 power  '2'  '-1'  -> 0.5
-powx102 power  '2'  '-2'  -> 0.25
-powx103 power  '2'  '-4'  -> 0.0625
-powx104 power  '2'  '-8'  -> 0.00390625
-powx105 power  '2'  '-16' -> 0.0000152587891 Inexact Rounded
-powx106 power  '2'  '-32' -> 2.32830644E-10 Inexact Rounded
-powx108 power  '2'  '-64' -> 5.42101086E-20 Inexact Rounded
-powx110 power  '10'  '-8' -> 1E-8
-powx111 power  '10'  '-7' -> 1E-7
-powx112 power  '10'  '-6' -> 0.000001
-powx113 power  '10'  '-5' -> 0.00001
-powx114 power  '10'  '-4' -> 0.0001
-powx115 power  '10'  '-3' -> 0.001
-powx116 power  '10'  '-2' -> 0.01
-powx117 power  '10'  '-1' -> 0.1
-
-powx118 power  '10'  '-333333333'   -> 1E-333333333
-powx119 power  '10'  '-999999998'   -> 1E-999999998
-powx120 power  '10'  '-999999999'   -> 1E-999999999
-powx121 power  '10'  '-77'          -> '1E-77'
-powx122 power  '10'  '-22'          -> '1E-22'
-
-powx123 power   '2'  '-1'           -> '0.5'
-powx124 power   '2'  '-2'           -> '0.25'
-powx125 power   '2'  '-4'           -> '0.0625'
-powx126 power   '0'  '-1'           -> Infinity Division_by_zero
-powx127 power   '0'  '-2'           -> Infinity Division_by_zero
-powx128 power   -0   '-1'           -> -Infinity Division_by_zero
-powx129 power   -0   '-2'           -> Infinity Division_by_zero
+powx099 power  '1'  '-1'    -> 1
+powx100 power  '3'  '-1'    -> 0.333333333 Inexact Rounded
+powx101 power  '2'  '-1'    -> 0.5
+powx102 power  '2'  '-2'    -> 0.25
+powx103 power  '2'  '-4'    -> 0.0625
+powx104 power  '2'  '-8'    -> 0.00390625
+powx105 power  '2'  '-16'   -> 0.0000152587891 Inexact Rounded
+powx106 power  '2'  '-32'   -> 2.32830644E-10 Inexact Rounded
+powx108 power  '2'  '-64'   -> 5.42101086E-20 Inexact Rounded
+powx110 power  '10'  '-8'   -> 1E-8
+powx111 power  '10'  '-7'   -> 1E-7
+powx112 power  '10'  '-6'   -> 0.000001
+powx113 power  '10'  '-5'   -> 0.00001
+powx114 power  '10'  '-4'   -> 0.0001
+powx115 power  '10'  '-3'   -> 0.001
+powx116 power  '10'  '-2'   -> 0.01
+powx117 power  '10'  '-1'   -> 0.1
+powx121 power  '10'  '-77'  -> '1E-77'
+powx122 power  '10'  '-22'  -> '1E-22'
 
--- out-of-range edge cases
-powx181 power   '7'   '999999998'   -> 2.10892313E+845098038 Inexact Rounded
-powx182 power   '7'   '999999999'   -> 1.47624619E+845098039 Inexact Rounded
-powx183 power   '7'   '1000000000'  -> NaN Invalid_operation
-powx184 power   '7'   '1000000001'  -> NaN Invalid_operation
-powx185 power   '7'   '10000000000' -> NaN Invalid_operation
-powx186 power   '7'   '-1000000001' -> NaN Invalid_operation
-powx187 power   '7'   '-1000000000' -> NaN Invalid_operation
-powx189 power   '7'   '-999999999'  -> 6.77393787E-845098040 Inexact Rounded
-powx190 power   '7'   '-999999998'  -> 4.74175651E-845098039 Inexact Rounded
-
--- some baddies [more below]
-powx191 power   '2'   '2.000001'     -> NaN Invalid_operation
-powx192 power   '2'   '2.00000000'   -> 4
-powx193 power   '2'   '2.000000001'  -> NaN Invalid_operation
-powx194 power   '2'   '2.0000000001' -> NaN Invalid_operation
+powx123 power   '2'  '-1'   -> '0.5'
+powx124 power   '2'  '-2'   -> '0.25'
+powx125 power   '2'  '-4'   -> '0.0625'
+
+powx126 power   '0'  '-1'   -> Infinity
+powx127 power   '0'  '-2'   -> Infinity
+powx128 power   -0   '-1'   -> -Infinity
+powx129 power   -0   '-2'   -> Infinity
 
 -- "0.5" tests from original Rexx diagnostics [loop unrolled]
-powx200 power   0.5    0            -> 1
-powx201 power   0.5    1            -> 0.5
-powx202 power   0.5    2            -> 0.25
-powx203 power   0.5    3            -> 0.125
-powx204 power   0.5    4            -> 0.0625
-powx205 power   0.5    5            -> 0.03125
-powx206 power   0.5    6            -> 0.015625
-powx207 power   0.5    7            -> 0.0078125
-powx208 power   0.5    8            -> 0.00390625
-powx209 power   0.5    9            -> 0.001953125
-powx210 power   0.5   10            -> 0.0009765625
-
--- A (rare) case where the last digit is not within 0.5 ULP
-precision: 9
-powx215 power "-21971575.0E+31454441" "-7" -> "-4.04549503E-220181139" Inexact Rounded
-precision: 20
-powx216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139" Inexact Rounded
+powx200 power   0.5    0    -> 1
+powx201 power   0.5    1    -> 0.5
+powx202 power   0.5    2    -> 0.25
+powx203 power   0.5    3    -> 0.125
+powx204 power   0.5    4    -> 0.0625
+powx205 power   0.5    5    -> 0.03125
+powx206 power   0.5    6    -> 0.015625
+powx207 power   0.5    7    -> 0.0078125
+powx208 power   0.5    8    -> 0.00390625
+powx209 power   0.5    9    -> 0.001953125
+powx210 power   0.5   10    -> 0.0009765625
+
+powx211 power 1  100000000  -> 1
+powx212 power 1  999999998  -> 1
+powx213 power 1  999999999  -> 1
+
 
 -- The Vienna case.  Checks both setup and 1/acc working precision
 -- Modified 1998.12.14 as RHS no longer rounded before use (must fit)
@@ -201,185 +185,64 @@ powx216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139
 -- Modified 2002.10.06 -- finally, no input rounding
 -- With input rounding, result would be 8.74E-2226
 precision: 3
+maxexponent: 5000
+minexponent: -5000
 powx219 power '123456789E+10' '-1.23000e+2' -> '5.54E-2226' Inexact Rounded
 
--- whole number checks
-precision: 9
-powx221 power 1 1234 -> 1
-precision: 4
-powx222 power 1 1234 -> 1
-precision: 3
-powx223 power 1 1234     -> 1
-powx224 power 1 12.34e+2 -> 1
-powx225 power 1 12.3     -> NaN Invalid_operation
-powx226 power 1 12.0     -> 1
-powx227 power 1 1.01     -> NaN Invalid_operation
-powx228 power 2 1.00     -> 2
-powx229 power 2 2.00     -> 4
-precision: 9
-powx230 power 1 1.0001           -> NaN Invalid_operation
-powx231 power 1 1.0000001        -> NaN Invalid_operation
-powx232 power 1 1.0000000001     -> NaN Invalid_operation
-powx233 power 1 1.0000000000001  -> NaN Invalid_operation
-precision: 5
-powx234 power 1 1.0001           -> NaN Invalid_operation
-powx235 power 1 1.0000001        -> NaN Invalid_operation
-powx236 power 1 1.0000000001     -> NaN Invalid_operation
-powx237 power 1 1.0000000000001  -> NaN Invalid_operation
-powx238 power 1 1.0000000000001  -> NaN Invalid_operation
-
-maxexponent: 999999999
-minexponent: -999999999
-powx239 power 1 5.67E-987654321  -> NaN Invalid_operation
-
-powx240 power 1  100000000 -> 1
-powx241 power 1  999999998 -> 1
-powx242 power 1  999999999 -> 1
-powx243 power 1 1000000000 -> NaN Invalid_operation
-powx244 power 1 9999999999 -> NaN Invalid_operation
-
--- Checks for 'Too much precision needed'
--- For x^12, digits+elength+1 = digits+3
-precision: 999999999
-powx249 add 1 1 -> 2   -- check basic operation at this precision
-powx250 power          2 12  -> Infinity Overflow
-precision: 999999998
-powx251 power          2 12  -> Infinity Overflow
-precision: 999999997
-powx252 power          2 12  -> Infinity Overflow
-precision: 999999996
-powx253 power          2 12  -> 4096
-precision: 999999995
-powx254 power          2 12  -> 4096
-
 -- zeros
 maxexponent: +96
 minexponent: -95
 precision: 7
-powx260 power          0E-34 3  ->  0E-101 Clamped
-powx261 power          0E-33 3  ->  0E-99
-powx262 power          0E-32 3  ->  0E-96
-powx263 power          0E-30 3  ->  0E-90
-powx264 power          0E-10 3  ->  0E-30
-powx265 power          0E-1  3  ->  0.000
-powx266 power          0E+0  3  ->  0
-powx267 power          0     3  ->  0
-powx268 power          0E+1  3  ->  0E+3
-powx269 power          0E+10 3  ->  0E+30
-powx270 power          0E+30 3  ->  0E+90
-powx271 power          0E+32 3  ->  0E+96
-powx272 power          0E+33 3  ->  0E+96  Clamped
-
--- overflow and underflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 9
-powx280 power  9            999999999 -> 3.05550054E+954242508 Inexact Rounded
-powx281 power 10            999999999 -> 1.00000000E+999999999 Rounded
-powx282 power 10.0001       999999999 -> Infinity Overflow Inexact Rounded
-powx283 power 10.1          999999999 -> Infinity Overflow Inexact Rounded
-powx284 power 11            999999999 -> Infinity Overflow Inexact Rounded
-powx285 power 12            999999999 -> Infinity Overflow Inexact Rounded
-powx286 power 999           999999999 -> Infinity Overflow Inexact Rounded
-powx287 power 999999        999999999 -> Infinity Overflow Inexact Rounded
-powx288 power 999999999     999999999 -> Infinity Overflow Inexact Rounded
-powx289 power 9.9E999999999 999999999 -> Infinity Overflow Inexact Rounded
-
-powx290 power 0.5           999999999 -> 4.33559594E-301029996 Inexact Rounded
-powx291 power 0.1           999999999 -> 1E-999999999  -- unrounded
-powx292 power 0.09          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx293 power 0.05          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx294 power 0.01          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx295 power 0.0001        999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx297 power 0.0000001     999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx298 power 0.0000000001  999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx299 power 1E-999999999  999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-
-powx310 power -9             999999999 -> -3.05550054E+954242508 Inexact Rounded
-powx311 power -10            999999999 -> -1.00000000E+999999999 Rounded
-powx312 power -10.0001       999999999 -> -Infinity Overflow Inexact Rounded
-powx313 power -10.1          999999999 -> -Infinity Overflow Inexact Rounded
-powx314 power -11            999999999 -> -Infinity Overflow Inexact Rounded
-powx315 power -12            999999999 -> -Infinity Overflow Inexact Rounded
-powx316 power -999           999999999 -> -Infinity Overflow Inexact Rounded
-powx317 power -999999        999999999 -> -Infinity Overflow Inexact Rounded
-powx318 power -999999999     999999999 -> -Infinity Overflow Inexact Rounded
-powx319 power -9.9E999999999 999999999 -> -Infinity Overflow Inexact Rounded
-
-powx320 power -0.5           999999999 -> -4.33559594E-301029996 Inexact Rounded
-powx321 power -0.1           999999999 -> -1E-999999999
-powx322 power -0.09          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx323 power -0.05          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx324 power -0.01          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx325 power -0.0001        999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx327 power -0.0000001     999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx328 power -0.0000000001  999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx329 power -1E-999999999  999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-
--- note no trim of next result
-powx330 power -9             999999998 ->  3.39500060E+954242507 Inexact Rounded
-powx331 power -10            999999998 ->  1.00000000E+999999998 Rounded
-powx332 power -10.0001       999999998 ->  Infinity Overflow Inexact Rounded
-powx333 power -10.1          999999998 ->  Infinity Overflow Inexact Rounded
-powx334 power -11            999999998 ->  Infinity Overflow Inexact Rounded
-powx335 power -12            999999998 ->  Infinity Overflow Inexact Rounded
-powx336 power -999           999999998 ->  Infinity Overflow Inexact Rounded
-powx337 power -999999        999999998 ->  Infinity Overflow Inexact Rounded
-powx338 power -999999999     999999998 ->  Infinity Overflow Inexact Rounded
-powx339 power -9.9E999999999 999999998 ->  Infinity Overflow Inexact Rounded
-
-powx340 power -0.5           999999998 ->  8.67119187E-301029996 Inexact Rounded
-powx341 power -0.1           999999998 ->  1E-999999998  -- NB exact unrounded
-powx342 power -0.09          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx343 power -0.05          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx344 power -0.01          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx345 power -0.0001        999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx347 power -0.0000001     999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx348 power -0.0000000001  999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx349 power -1E-999999999  999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx223 power          0E-30 3  ->  0
+powx224 power          0E-10 3  ->  0
+powx225 power          0E-1  3  ->  0
+powx226 power          0E+0  3  ->  0
+powx227 power          0     3  ->  0
+powx228 power          0E+1  3  ->  0
+powx229 power          0E+10 3  ->  0
+powx230 power          0E+30 3  ->  0
+powx231 power     3    0E-30    ->  1
+powx232 power     3    0E-10    ->  1
+powx233 power     3    0E-1     ->  1
+powx234 power     3    0E+0     ->  1
+powx235 power     3    0        ->  1
+powx236 power     3    0E+1     ->  1
+powx237 power     3    0E+10    ->  1
+powx238 power     3    0E+30    ->  1
+powx239 power          0E-30 -3 ->  Infinity
+powx240 power          0E-10 -3 ->  Infinity
+powx241 power          0E-1  -3 ->  Infinity
+powx242 power          0E+0  -3 ->  Infinity
+powx243 power          0     -3 ->  Infinity
+powx244 power          0E+1  -3 ->  Infinity
+powx245 power          0E+10 -3 ->  Infinity
+powx246 power          0E+30 -3 ->  Infinity
+powx247 power    -3    0E-30    ->  1
+powx248 power    -3    0E-10    ->  1
+powx249 power    -3    0E-1     ->  1
+powx250 power    -3    0E+0     ->  1
+powx251 power    -3    0        ->  1
+powx252 power    -3    0E+1     ->  1
+powx253 power    -3    0E+10    ->  1
+powx254 power    -3    0E+30    ->  1
 
--- some subnormals
+-- a few lhs negatives
 precision: 9
--- [precision is 9, so smallest exponent is -1000000007
-powx350 power  1e-1          500000000 ->  1E-500000000
-powx351 power  1e-2          999999999 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-powx352 power  1e-2          500000000 ->  1E-1000000000 Subnormal
-powx353 power  1e-2          500000001 ->  1E-1000000002 Subnormal
-powx354 power  1e-2          500000002 ->  1E-1000000004 Subnormal
-powx355 power  1e-2          500000003 ->  1E-1000000006 Subnormal
-powx356 power  1e-2          500000004 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
-
-powx360 power  0.010001      500000000 ->  4.34941988E-999978287 Inexact Rounded
-powx361 power  0.010000001   500000000 ->  5.18469257E-999999979 Inexact Rounded
-powx362 power  0.010000001   500000001 ->  5.18469309E-999999981 Inexact Rounded
-powx363 power  0.0100000009  500000000 ->  3.49342003E-999999981 Inexact Rounded
-powx364 power  0.0100000001  500000000 ->  1.48413155E-999999998 Inexact Rounded
-powx365 power  0.01          500000000 ->  1E-1000000000 Subnormal
-powx366 power  0.0099999999  500000000 ->  6.7379E-1000000003 Underflow Subnormal Inexact Rounded
-powx367 power  0.0099999998  500000000 ->  4.54E-1000000005 Underflow Subnormal Inexact Rounded
-powx368 power  0.0099999997  500000000 ->  3E-1000000007 Underflow Subnormal Inexact Rounded
-powx369 power  0.0099999996  500000000 ->  0E-1000000007 Underflow Subnormal Inexact Rounded
-powx370 power  0.009         500000000 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
-
--- 1/subnormal -> overflow
-powx371 power  1e-1         -500000000 ->  1E+500000000
-powx372 power  1e-2         -999999999 ->  Infinity Overflow Inexact Rounded
-powx373 power  1e-2         -500000000 ->  Infinity Overflow Inexact Rounded
-powx374 power  1e-2         -500000001 ->  Infinity Overflow Inexact Rounded
-powx375 power  1e-2         -500000002 ->  Infinity Overflow Inexact Rounded
-powx376 power  1e-2         -500000003 ->  Infinity Overflow Inexact Rounded
-powx377 power  1e-2         -500000004 ->  Infinity Overflow Inexact Rounded
-
-powx381 power  0.010001     -500000000 ->  2.29915719E+999978286 Inexact Rounded
-powx382 power  0.010000001  -500000000 ->  1.92875467E+999999978 Inexact Rounded
-powx383 power  0.010000001  -500000001 ->  1.92875448E+999999980 Inexact Rounded
-powx384 power  0.0100000009 -500000000 ->  2.86252438E+999999980 Inexact Rounded
-powx385 power  0.0100000001 -500000000 ->  6.73794717E+999999997 Inexact Rounded
-powx386 power  0.01         -500000000 ->  Infinity Overflow Inexact Rounded
-powx387 power  0.009999     -500000000 ->  Infinity Overflow Inexact Rounded
-
--- negative power giving subnormal
-powx388 power  100.000001   -500000000 ->  6.7379E-1000000003 Underflow Subnormal Inexact Rounded
+maxExponent: 999
+minexponent: -999
+powx260 power   -10   '0'         -> 1
+powx261 power   -10   '1'         -> -10
+powx262 power   -10   '2'         -> 100
+powx263 power   -10   '3'         -> -1000
+powx264 power   -10   '4'         -> 10000
+powx265 power   -10   '5'         -> -100000
+powx266 power   -10   '6'         -> 1000000
+powx267 power   -10   '7'         -> -10000000
+powx268 power   -10   '8'         -> 100000000
+powx269 power   -10   '9'         -> -1.00000000E+9 Rounded
+powx270 power   -10   '22'        -> 1.00000000E+22 Rounded
+powx271 power   -10   '77'        -> -1.00000000E+77 Rounded
+powx272 power   -10   '99'        -> -1.00000000E+99 Rounded
 
 -- some more edge cases
 precision:   15
@@ -389,8 +252,9 @@ powx391 power  0.1   999 -> 1E-999
 powx392 power  0.099 999 -> 4.360732062E-1004 Underflow Subnormal Inexact Rounded
 powx393 power  0.098 999 -> 1.71731E-1008 Underflow Subnormal Inexact Rounded
 powx394 power  0.097 999 -> 6E-1013 Underflow Subnormal Inexact Rounded
-powx395 power  0.096 999 -> 0E-1013 Underflow Subnormal Inexact Rounded
+powx395 power  0.096 999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped
 powx396 power  0.01  999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped
+powx397 power  0.02 100000000 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped
 
 -- multiply tests are here to aid checking and test for consistent handling
 -- of underflow
@@ -399,7 +263,7 @@ maxexponent: 999
 minexponent: -999
 
 -- squares
-mulx400 multiply  1E-502     1e-502 -> 0E-1003    Subnormal Inexact Underflow Rounded
+mulx400 multiply  1E-502     1e-502 -> 0E-1003    Subnormal Inexact Underflow Rounded Clamped
 mulx401 multiply  1E-501     1e-501 -> 1E-1002    Subnormal
 mulx402 multiply  2E-501     2e-501 -> 4E-1002    Subnormal
 mulx403 multiply  4E-501     4e-501 -> 1.6E-1001  Subnormal
@@ -407,7 +271,7 @@ mulx404 multiply 10E-501    10e-501 -> 1.00E-1000 Subnormal
 mulx405 multiply 30E-501    30e-501 -> 9.00E-1000 Subnormal
 mulx406 multiply 40E-501    40e-501 -> 1.600E-999
 
-powx400 power     1E-502     2      -> 0E-1003    Underflow Subnormal Inexact Rounded
+powx400 power     1E-502     2      -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped
 powx401 power     1E-501     2      -> 1E-1002    Subnormal
 powx402 power     2E-501     2      -> 4E-1002    Subnormal
 powx403 power     4E-501     2      -> 1.6E-1001  Subnormal
@@ -416,7 +280,7 @@ powx405 power    30E-501     2      -> 9.00E-1000 Subnormal
 powx406 power    40E-501     2      -> 1.600E-999
 
 -- cubes
-mulx410 multiply  1E-670     1e-335 -> 0E-1003    Underflow Subnormal Inexact Rounded
+mulx410 multiply  1E-670     1e-335 -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped
 mulx411 multiply  1E-668     1e-334 -> 1E-1002    Subnormal
 mulx412 multiply  4E-668     2e-334 -> 8E-1002    Subnormal
 mulx413 multiply  9E-668     3e-334 -> 2.7E-1001  Subnormal
@@ -424,7 +288,7 @@ mulx414 multiply 16E-668     4e-334 -> 6.4E-1001  Subnormal
 mulx415 multiply 25E-668     5e-334 -> 1.25E-1000 Subnormal
 mulx416 multiply 10E-668   100e-334 -> 1.000E-999
 
-powx410 power     1E-335     3      -> 0E-1003    Underflow Subnormal Inexact Rounded
+powx410 power     1E-335     3      -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped
 powx411 power     1E-334     3      -> 1E-1002    Subnormal
 powx412 power     2E-334     3      -> 8E-1002    Subnormal
 powx413 power     3E-334     3      -> 2.7E-1001  Subnormal
@@ -442,24 +306,24 @@ powx422 power  2.5E-500     -2         ->  1.6E+999
 powx423 power  2.5E+499     -2         ->  1.6E-999
 powx424 power  2.5E+500     -2         ->  1.6E-1001 Subnormal
 powx425 power  2.5E+501     -2         ->    2E-1003 Underflow Subnormal Inexact Rounded
-powx426 power  2.5E+502     -2         ->    0E-1003 Underflow Subnormal Inexact Rounded
+powx426 power  2.5E+502     -2         ->    0E-1003 Underflow Subnormal Inexact Rounded Clamped
 
 powx427 power 0.25E+499     -2         ->  1.6E-997
 powx428 power 0.25E+500     -2         ->  1.6E-999
 powx429 power 0.25E+501     -2         ->  1.6E-1001 Subnormal
 powx430 power 0.25E+502     -2         ->    2E-1003 Underflow Subnormal Inexact Rounded
-powx431 power 0.25E+503     -2         ->    0E-1003 Underflow Subnormal Inexact Rounded
+powx431 power 0.25E+503     -2         ->    0E-1003 Underflow Subnormal Inexact Rounded Clamped
 
 powx432 power 0.04E+499     -2         ->  6.25E-996
 powx433 power 0.04E+500     -2         ->  6.25E-998
 powx434 power 0.04E+501     -2         ->  6.25E-1000 Subnormal
-powx435 power 0.04E+502     -2         ->   6.3E-1002 Underflow Subnormal Inexact Rounded
+powx435 power 0.04E+502     -2         ->   6.2E-1002 Underflow Subnormal Inexact Rounded
 powx436 power 0.04E+503     -2         ->     1E-1003 Underflow Subnormal Inexact Rounded
-powx437 power 0.04E+504     -2         ->     0E-1003 Underflow Subnormal Inexact Rounded
+powx437 power 0.04E+504     -2         ->     0E-1003 Underflow Subnormal Inexact Rounded Clamped
 
 powx441 power 0.04E+334     -3         ->  1.5625E-998
 powx442 power 0.04E+335     -3         ->    1.56E-1001 Underflow Subnormal Inexact Rounded
-powx443 power 0.04E+336     -3         ->       0E-1003 Underflow Subnormal Inexact Rounded
+powx443 power 0.04E+336     -3         ->       0E-1003 Underflow Subnormal Inexact Rounded Clamped
 powx444 power 0.25E+333     -3         ->     6.4E-998
 powx445 power 0.25E+334     -3         ->     6.4E-1001 Subnormal
 powx446 power 0.25E+335     -3         ->       1E-1003 Underflow Subnormal Inexact Rounded
@@ -467,7 +331,7 @@ powx447 power 0.25E+336     -3         ->       0E-1003 Underflow Subnormal Inex
 -- check sign for cubes  and a few squares
 powx448 power -0.04E+334    -3         -> -1.5625E-998
 powx449 power -0.04E+335    -3         ->   -1.56E-1001 Underflow Subnormal Inexact Rounded
-powx450 power -0.04E+336    -3         ->      -0E-1003 Underflow Subnormal Inexact Rounded
+powx450 power -0.04E+336    -3         ->      -0E-1003 Underflow Subnormal Inexact Rounded Clamped
 powx451 power -0.25E+333    -3         ->    -6.4E-998
 powx452 power -0.25E+334    -3         ->    -6.4E-1001 Subnormal
 powx453 power -0.25E+335    -3         ->      -1E-1003 Underflow Subnormal Inexact Rounded
@@ -475,7 +339,7 @@ powx454 power -0.25E+336    -3         ->      -0E-1003 Underflow Subnormal Inex
 powx455 power -0.04E+499    -2         ->    6.25E-996
 powx456 power -0.04E+500    -2         ->    6.25E-998
 powx457 power -0.04E+501    -2         ->    6.25E-1000 Subnormal
-powx458 power -0.04E+502    -2         ->     6.3E-1002 Underflow Subnormal Inexact Rounded
+powx458 power -0.04E+502    -2         ->     6.2E-1002 Underflow Subnormal Inexact Rounded
 
 -- test -0s
 precision: 9
@@ -488,123 +352,124 @@ powx565 power  1 -0        ->  1
 powx566 power -1  0        ->  1
 powx567 power -1 -0        ->  1
 powx568 power  0  1        ->  0
-powx569 power  0 -1        ->  Infinity Division_by_zero
+powx569 power  0 -1        ->  Infinity
 powx570 power -0  1        -> -0
-powx571 power -0 -1        -> -Infinity Division_by_zero
+powx571 power -0 -1        -> -Infinity
 powx572 power  0  2        ->  0
-powx573 power  0 -2        ->  Infinity Division_by_zero
+powx573 power  0 -2        ->  Infinity
 powx574 power -0  2        ->  0
-powx575 power -0 -2        ->  Infinity Division_by_zero
+powx575 power -0 -2        ->  Infinity
 powx576 power  0  3        ->  0
-powx577 power  0 -3        ->  Infinity Division_by_zero
+powx577 power  0 -3        ->  Infinity
 powx578 power -0  3        -> -0
-powx579 power -0 -3        -> -Infinity Division_by_zero
+powx579 power -0 -3        -> -Infinity
 
 -- Specials
-powx580 power  Inf  -Inf   ->  NaN  Invalid_operation
+powx580 power  Inf  -Inf   ->  0
 powx581 power  Inf  -1000  ->  0
 powx582 power  Inf  -1     ->  0
-powx583 power  Inf  -0     ->  1
-powx584 power  Inf   0     ->  1
-powx585 power  Inf   1     ->  Infinity
-powx586 power  Inf   1000  ->  Infinity
-powx587 power  Inf   Inf   ->  NaN  Invalid_operation
-powx588 power -1000  Inf   ->  NaN  Invalid_operation
-powx589 power -Inf   Inf   ->  NaN  Invalid_operation
-powx590 power -1     Inf   ->  NaN  Invalid_operation
-powx591 power -0     Inf   ->  NaN  Invalid_operation
-powx592 power  0     Inf   ->  NaN  Invalid_operation
-powx593 power  1     Inf   ->  NaN  Invalid_operation
-powx594 power  1000  Inf   ->  NaN  Invalid_operation
-powx595 power  Inf   Inf   ->  NaN  Invalid_operation
+powx583 power  Inf  -0.5   ->  0
+powx584 power  Inf  -0     ->  1
+powx585 power  Inf   0     ->  1
+powx586 power  Inf   0.5   ->  Infinity
+powx587 power  Inf   1     ->  Infinity
+powx588 power  Inf   1000  ->  Infinity
+powx589 power  Inf   Inf   ->  Infinity
+powx590 power -1000  Inf   ->  NaN  Invalid_operation
+powx591 power -Inf   Inf   ->  NaN  Invalid_operation
+powx592 power -1     Inf   ->  NaN  Invalid_operation
+powx593 power -0.5   Inf   ->  NaN  Invalid_operation
+powx594 power -0     Inf   ->  0
+powx595 power  0     Inf   ->  0
+powx596 power  0.5   Inf   ->  0
+powx597 power  1     Inf   ->  1.00000000 Inexact Rounded
+powx598 power  1000  Inf   ->  Infinity
+powx599 power  Inf   Inf   ->  Infinity
 
 powx600 power -Inf  -Inf   ->  NaN  Invalid_operation
 powx601 power -Inf  -1000  ->  0
 powx602 power -Inf  -1     -> -0
-powx603 power -Inf  -0     ->  1
-powx604 power -Inf   0     ->  1
-powx605 power -Inf   1     -> -Infinity
-powx606 power -Inf   1000  ->  Infinity
-powx607 power -Inf   Inf   ->  NaN  Invalid_operation
-powx608 power -1000  Inf   ->  NaN  Invalid_operation
-powx609 power -Inf  -Inf   ->  NaN  Invalid_operation
-powx610 power -1    -Inf   ->  NaN  Invalid_operation
-powx611 power -0    -Inf   ->  NaN  Invalid_operation
-powx612 power  0    -Inf   ->  NaN  Invalid_operation
-powx613 power  1    -Inf   ->  NaN  Invalid_operation
-powx614 power  1000 -Inf   ->  NaN  Invalid_operation
-powx615 power  Inf  -Inf   ->  NaN  Invalid_operation
-
-powx621 power  NaN -Inf    ->  NaN  Invalid_operation
+powx603 power -Inf  -0.5   ->  NaN  Invalid_operation
+powx604 power -Inf  -0     ->  1
+powx605 power -Inf   0     ->  1
+powx606 power -Inf   0.5   ->  NaN  Invalid_operation
+powx607 power -Inf   1     -> -Infinity
+powx608 power -Inf   1000  ->  Infinity
+powx609 power -Inf   Inf   ->  NaN  Invalid_operation
+powx610 power -1000  Inf   ->  NaN  Invalid_operation
+powx611 power -Inf  -Inf   ->  NaN  Invalid_operation
+powx612 power -1    -Inf   ->  NaN  Invalid_operation
+powx613 power -0.5  -Inf   ->  NaN  Invalid_operation
+powx614 power -0    -Inf   ->  Infinity
+powx615 power  0    -Inf   ->  Infinity
+powx616 power  0.5  -Inf   ->  Infinity
+powx617 power  1    -Inf   ->  1.00000000 Inexact Rounded
+powx618 power  1000 -Inf   ->  0
+powx619 power  Inf  -Inf   ->  0
+
+powx621 power  NaN -Inf    ->  NaN
 powx622 power  NaN -1000   ->  NaN
 powx623 power  NaN -1      ->  NaN
-powx624 power  NaN -0      ->  NaN
-powx625 power  NaN  0      ->  NaN
-powx626 power  NaN  1      ->  NaN
-powx627 power  NaN  1000   ->  NaN
-powx628 power  NaN  Inf    ->  NaN  Invalid_operation
-powx629 power  NaN  NaN    ->  NaN
-powx630 power -Inf  NaN    ->  NaN
-powx631 power -1000 NaN    ->  NaN
-powx632 power -1    NaN    ->  NaN
-powx633 power -0    NaN    ->  NaN
-powx634 power  0    NaN    ->  NaN
-powx635 power  1    NaN    ->  NaN
-powx636 power  1000 NaN    ->  NaN
-powx637 power  Inf  NaN    ->  NaN
+powx624 power  NaN -0.5    ->  NaN
+powx625 power  NaN -0      ->  NaN
+powx626 power  NaN  0      ->  NaN
+powx627 power  NaN  0.5    ->  NaN
+powx628 power  NaN  1      ->  NaN
+powx629 power  NaN  1000   ->  NaN
+powx630 power  NaN  Inf    ->  NaN
+powx631 power  NaN  NaN    ->  NaN
+powx632 power -Inf  NaN    ->  NaN
+powx633 power -1000 NaN    ->  NaN
+powx634 power -1    NaN    ->  NaN
+powx635 power -0    NaN    ->  NaN
+powx636 power  0    NaN    ->  NaN
+powx637 power  1    NaN    ->  NaN
+powx638 power  1000 NaN    ->  NaN
+powx639 power  Inf  NaN    ->  NaN
 
 powx641 power  sNaN -Inf   ->  NaN  Invalid_operation
 powx642 power  sNaN -1000  ->  NaN  Invalid_operation
 powx643 power  sNaN -1     ->  NaN  Invalid_operation
-powx644 power  sNaN -0     ->  NaN  Invalid_operation
-powx645 power  sNaN  0     ->  NaN  Invalid_operation
-powx646 power  sNaN  1     ->  NaN  Invalid_operation
-powx647 power  sNaN  1000  ->  NaN  Invalid_operation
-powx648 power  sNaN  NaN   ->  NaN  Invalid_operation
-powx649 power  sNaN sNaN   ->  NaN  Invalid_operation
-powx650 power  NaN  sNaN   ->  NaN  Invalid_operation
-powx651 power -Inf  sNaN   ->  NaN  Invalid_operation
-powx652 power -1000 sNaN   ->  NaN  Invalid_operation
-powx653 power -1    sNaN   ->  NaN  Invalid_operation
-powx654 power -0    sNaN   ->  NaN  Invalid_operation
-powx655 power  0    sNaN   ->  NaN  Invalid_operation
-powx656 power  1    sNaN   ->  NaN  Invalid_operation
-powx657 power  1000 sNaN   ->  NaN  Invalid_operation
-powx658 power  Inf  sNaN   ->  NaN  Invalid_operation
-powx659 power  NaN  sNaN   ->  NaN  Invalid_operation
+powx644 power  sNaN -0.5   ->  NaN  Invalid_operation
+powx645 power  sNaN -0     ->  NaN  Invalid_operation
+powx646 power  sNaN  0     ->  NaN  Invalid_operation
+powx647 power  sNaN  0.5   ->  NaN  Invalid_operation
+powx648 power  sNaN  1     ->  NaN  Invalid_operation
+powx649 power  sNaN  1000  ->  NaN  Invalid_operation
+powx650 power  sNaN  NaN   ->  NaN  Invalid_operation
+powx651 power  sNaN sNaN   ->  NaN  Invalid_operation
+powx652 power  NaN  sNaN   ->  NaN  Invalid_operation
+powx653 power -Inf  sNaN   ->  NaN  Invalid_operation
+powx654 power -1000 sNaN   ->  NaN  Invalid_operation
+powx655 power -1    sNaN   ->  NaN  Invalid_operation
+powx656 power -0.5  sNaN   ->  NaN  Invalid_operation
+powx657 power -0    sNaN   ->  NaN  Invalid_operation
+powx658 power  0    sNaN   ->  NaN  Invalid_operation
+powx659 power  0.5  sNaN   ->  NaN  Invalid_operation
+powx660 power  1    sNaN   ->  NaN  Invalid_operation
+powx661 power  1000 sNaN   ->  NaN  Invalid_operation
+powx662 power  Inf  sNaN   ->  NaN  Invalid_operation
+powx663 power  NaN  sNaN   ->  NaN  Invalid_operation
 
 -- NaN propagation
-powx660 power  NaN3  sNaN7  ->  NaN7  Invalid_operation
-powx661 power  sNaN8  NaN6  ->  NaN8  Invalid_operation
-powx662 power  1     sNaN7  ->  NaN7  Invalid_operation
-powx663 power  sNaN8  1     ->  NaN8  Invalid_operation
-powx664 power  Inf   sNaN7  ->  NaN7  Invalid_operation
-powx665 power  sNaN8  Inf   ->  NaN   Invalid_operation
-powx666 power  Inf    NaN9  ->  NaN9
-powx667 power  NaN6   Inf   ->  NaN   Invalid_operation
-powx668 power  1      NaN5  ->  NaN5
-powx669 power  NaN2   1     ->  NaN2
-powx670 power  NaN2   Nan4  ->  NaN2
-powx671 power  NaN    Nan4  ->  NaN
-powx672 power  NaN345 Nan   ->  NaN345
-powx673 power  Inf    -sNaN7 -> -NaN7 Invalid_operation
-powx674 power  -sNaN8  Inf   -> NaN   Invalid_operation
-powx675 power  Inf    -NaN9  -> -NaN9
-powx676 power  -NaN6   Inf   -> NaN   Invalid_operation
-powx677 power  -NaN2  -Nan4  -> -NaN2
-
--- Examples from extended specification
-powx690 power  Inf  -2     ->  0
-powx691 power  Inf  -1     ->  0
-powx692 power  Inf   0     ->  1
-powx693 power  Inf   1     ->  Infinity
-powx694 power  Inf   2     ->  Infinity
-powx695 power -Inf  -2     ->  0
-powx696 power -Inf  -1     ->  -0
-powx697 power -Inf   0     ->  1
-powx698 power -Inf   1     ->  -Infinity
-powx699 power -Inf   2     ->  Infinity
-powx700 power    0   0     ->  NaN Invalid_operation
+powx670 power  NaN3  sNaN7  ->  NaN7  Invalid_operation
+powx671 power  sNaN8  NaN6  ->  NaN8  Invalid_operation
+powx672 power  1     sNaN7  ->  NaN7  Invalid_operation
+powx673 power  sNaN8  1     ->  NaN8  Invalid_operation
+powx674 power  Inf   sNaN7  ->  NaN7  Invalid_operation
+powx675 power  sNaN8  Inf   ->  NaN8  Invalid_operation
+powx676 power  Inf    NaN9  ->  NaN9
+powx677 power  NaN6   Inf   ->  NaN6
+powx678 power  1      NaN5  ->  NaN5
+powx679 power  NaN2   1     ->  NaN2
+powx680 power  NaN2   Nan4  ->  NaN2
+powx681 power  NaN    Nan4  ->  NaN
+powx682 power  NaN345 Nan   ->  NaN345
+powx683 power  Inf    -sNaN7 -> -NaN7  Invalid_operation
+powx684 power  -sNaN8  Inf   -> -NaN8  Invalid_operation
+powx685 power  Inf    -NaN9  -> -NaN9
+powx686 power  -NaN6   Inf   -> -NaN6
+powx687 power  -NaN2  -Nan4  -> -NaN2
 
 -- long operand and RHS range checks
 maxexponent: 999
@@ -616,15 +481,6 @@ powx703 power 1234567890  1 -> 1.23456789E+9 Rounded
 powx704 power 1234567891  1 -> 1.23456789E+9 Inexact Rounded
 powx705 power 12345678901 1 -> 1.23456789E+10 Inexact Rounded
 powx706 power 1234567896  1 -> 1.23456790E+9 Inexact Rounded
-powx707 power 1 12345678000  -> NaN Invalid_operation
-powx708 power 1 1234567800   -> NaN Invalid_operation
-powx709 power 1 1234567890   -> NaN Invalid_operation
-powx710 power 1 11234567891  -> NaN Invalid_operation
-powx711 power 1 12345678901  -> NaN Invalid_operation
-powx712 power 1 1234567896   -> NaN Invalid_operation
-powx713 power 1 -1234567896  -> NaN Invalid_operation
-powx714 power 1 1000000000   -> NaN Invalid_operation
-powx715 power 1 -1000000000  -> NaN Invalid_operation
 
 precision: 15
 -- still checking
@@ -634,12 +490,182 @@ powx743 power 1234567890  1 -> 1234567890
 powx744 power 1234567891  1 -> 1234567891
 powx745 power 12345678901 1 -> 12345678901
 powx746 power 1234567896  1 -> 1234567896
-powx747 power 1 12345678000  -> NaN Invalid_operation
-powx748 power 1 -1234567896  -> NaN Invalid_operation
-powx749 power 1 1000000000   -> NaN Invalid_operation
-powx740 power 1 -1000000000  -> NaN Invalid_operation
 
--- check for double-rounded subnormals
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+
+-- near out-of-range edge cases
+powx163 power   '10'  '999999' -> '1.00000000E+999999' Rounded
+powx164 power   '10'  '999998' -> '1.00000000E+999998' Rounded
+powx165 power   '10'  '999997' -> '1.00000000E+999997' Rounded
+powx166 power   '10'  '333333' -> '1.00000000E+333333' Rounded
+powx183 power   '7'   '1000000'  -> 1.09651419E+845098 Inexact Rounded
+powx184 power   '7'   '1000001'  -> 7.67559934E+845098 Inexact Rounded
+powx186 power   '7'   '-1000001' -> 1.30282986E-845099 Inexact Rounded
+powx187 power   '7'   '-1000000' -> 9.11980901E-845099 Inexact Rounded
+powx118 power  '10'  '-333333'   -> 1E-333333
+powx119 power  '10'  '-999998'   -> 1E-999998
+powx120 power  '10'  '-999999'   -> 1E-999999
+powx181 power   '7'   '999998'   -> 2.23778406E+845096 Inexact Rounded
+powx182 power   '7'   '999999'   -> 1.56644884E+845097 Inexact Rounded
+powx189 power   '7'   '-999999'  -> 6.38386631E-845098 Inexact Rounded
+powx190 power   '7'   '-999998'  -> 4.46870641E-845097 Inexact Rounded
+
+-- overflow and underflow tests
+precision: 9
+
+powx277 power  9             999999 -> 3.59084629E+954241 Inexact Rounded
+powx278 power  9.99999999    999999 -> 9.99000501E+999998 Inexact Rounded
+powx279 power 10             999999 -> 1.00000000E+999999         Rounded
+powx280 power 10.0000001     999999 -> 1.01005016E+999999 Inexact Rounded
+powx281 power 10.000001      999999 -> 1.10517080E+999999 Inexact Rounded
+powx282 power 10.00001       999999 -> 2.71827775E+999999 Inexact Rounded
+powx283 power 10.0001        999999 -> Infinity Overflow Inexact Rounded
+powx285 power 11             999999 -> Infinity Overflow Inexact Rounded
+powx286 power 12             999999 -> Infinity Overflow Inexact Rounded
+powx287 power 999            999999 -> Infinity Overflow Inexact Rounded
+powx288 power 999999999      999999 -> Infinity Overflow Inexact Rounded
+powx289 power 9.9E999999999  999999 -> Infinity Overflow Inexact Rounded
+
+powx290 power 0.5            999999 -> 2.02006812E-301030 Inexact Rounded
+powx291 power 0.1            999999 -> 1E-999999  -- unrounded
+powx292 power 0.09           999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx293 power 0.05           999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx294 power 0.01           999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx295 power 0.0001         999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx297 power 0.0000001      999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx298 power 0.0000000001   999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx299 power 1E-999999999   999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+powx310 power -9             999999 -> -3.59084629E+954241 Inexact Rounded
+powx311 power -10            999999 -> -1.00000000E+999999 Rounded
+powx312 power -10.0001       999999 -> -Infinity Overflow Inexact Rounded
+powx313 power -10.1          999999 -> -Infinity Overflow Inexact Rounded
+powx314 power -11            999999 -> -Infinity Overflow Inexact Rounded
+powx315 power -12            999999 -> -Infinity Overflow Inexact Rounded
+powx316 power -999           999999 -> -Infinity Overflow Inexact Rounded
+powx317 power -999999        999999 -> -Infinity Overflow Inexact Rounded
+powx318 power -999999999     999999 -> -Infinity Overflow Inexact Rounded
+powx319 power -9.9E999999999 999999 -> -Infinity Overflow Inexact Rounded
+
+powx320 power -0.5           999999 -> -2.02006812E-301030 Inexact Rounded
+powx321 power -0.1           999999 -> -1E-999999
+powx322 power -0.09          999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx323 power -0.05          999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx324 power -0.01          999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx325 power -0.0001        999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx327 power -0.0000001     999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx328 power -0.0000000001  999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx329 power -1E-999999999  999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- note no trim of next result
+powx330 power -9             999998 ->  3.98982921E+954240 Inexact Rounded
+powx331 power -10            999998 ->  1.00000000E+999998 Rounded
+powx332 power -10.0001       999998 ->  Infinity Overflow Inexact Rounded
+powx333 power -10.1          999998 ->  Infinity Overflow Inexact Rounded
+powx334 power -11            999998 ->  Infinity Overflow Inexact Rounded
+powx335 power -12            999998 ->  Infinity Overflow Inexact Rounded
+powx336 power -999           999998 ->  Infinity Overflow Inexact Rounded
+powx337 power -999999        999998 ->  Infinity Overflow Inexact Rounded
+powx338 power -999999999     999998 ->  Infinity Overflow Inexact Rounded
+powx339 power -9.9E999999999 999998 ->  Infinity Overflow Inexact Rounded
+
+powx340 power -0.5           999998 ->  4.04013624E-301030 Inexact Rounded
+powx341 power -0.1           999998 ->  1E-999998  -- NB exact unrounded
+powx342 power -0.09          999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx343 power -0.05          999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx344 power -0.01          999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx345 power -0.0001        999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx347 power -0.0000001     999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx348 power -0.0000000001  999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx349 power -1E-999999999  999998 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- some subnormals
+precision: 9
+-- [precision is 9, so smallest exponent is -1000000007
+powx350 power  1e-1          500000 ->  1E-500000
+powx351 power  1e-2          999999 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+powx352 power  1e-2          500000 ->  1E-1000000 Subnormal
+powx353 power  1e-2          500001 ->  1E-1000002 Subnormal
+powx354 power  1e-2          500002 ->  1E-1000004 Subnormal
+powx355 power  1e-2          500003 ->  1E-1000006 Subnormal
+powx356 power  1e-2          500004 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+powx360 power  0.010001      500000 ->  5.17176082E-999979 Inexact Rounded
+powx361 power  0.010000001   500000 ->  1.0512711E-1000000 Underflow Subnormal Inexact Rounded
+powx362 power  0.010000001   500001 ->  1.05127E-1000002 Underflow Subnormal Inexact Rounded
+powx363 power  0.0100000009  500000 ->  1.0460279E-1000000 Underflow Subnormal Inexact Rounded
+powx364 power  0.0100000001  500000 ->  1.0050125E-1000000 Underflow Subnormal Inexact Rounded
+powx365 power  0.01          500000 ->  1E-1000000 Subnormal
+powx366 power  0.0099999999  500000 ->  9.950125E-1000001 Underflow Subnormal Inexact Rounded
+powx367 power  0.0099999998  500000 ->  9.900498E-1000001 Underflow Subnormal Inexact Rounded
+powx368 power  0.0099999997  500000 ->  9.851119E-1000001 Underflow Subnormal Inexact Rounded
+powx369 power  0.0099999996  500000 ->  9.801987E-1000001 Underflow Subnormal Inexact Rounded
+powx370 power  0.009         500000 ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- 1/subnormal -> overflow
+powx371 power  1e-1         -500000 ->  1E+500000
+powx372 power  1e-2         -999999 ->  Infinity Overflow Inexact Rounded
+powx373 power  1e-2         -500000 ->  Infinity Overflow Inexact Rounded
+powx374 power  1e-2         -500001 ->  Infinity Overflow Inexact Rounded
+powx375 power  1e-2         -500002 ->  Infinity Overflow Inexact Rounded
+powx376 power  1e-2         -500003 ->  Infinity Overflow Inexact Rounded
+powx377 power  1e-2         -500004 ->  Infinity Overflow Inexact Rounded
+
+powx381 power  0.010001     -500000 ->  1.93357743E+999978 Inexact Rounded
+powx382 power  0.010000001  -500000 ->  9.51229427E+999999 Inexact Rounded
+powx383 power  0.010000001  -500001 ->  Infinity Overflow  Inexact Rounded
+powx384 power  0.0100000009 -500000 ->  9.55997484E+999999 Inexact Rounded
+powx385 power  0.0100000001 -500000 ->  9.95012479E+999999 Inexact Rounded
+powx386 power  0.01         -500000 ->  Infinity Overflow Inexact Rounded
+powx387 power  0.009999     -500000 ->  Infinity Overflow Inexact Rounded
+
+-- negative power giving subnormal
+powx388 power  100.000001   -500000 ->  9.950125E-1000001 Underflow Subnormal Inexact Rounded
+
+
+-- test some 'false integer' boundaries
+precision:   16
+rounding:    half_even
+maxExponent: 384
+minExponent: -383
+powx501 power  100  1E+1   ->  1.000000000000000E+20     Rounded
+powx502 power  100  1E+2   ->  1.000000000000000E+200    Rounded
+powx503 power  100  1E+3   ->  Infinity Overflow Inexact Rounded
+powx504 power  100  1E+4   ->  Infinity Overflow Inexact Rounded
+powx505 power  100  1E+5   ->  Infinity Overflow Inexact Rounded
+powx506 power  100  1E+6   ->  Infinity Overflow Inexact Rounded
+powx507 power  100  1E+7   ->  Infinity Overflow Inexact Rounded
+powx508 power  100  1E+8   ->  Infinity Overflow Inexact Rounded
+powx509 power  100  1E+9   ->  Infinity Overflow Inexact Rounded
+powx510 power  100  1E+10  ->  Infinity Overflow Inexact Rounded
+powx511 power  100  1E+11  ->  Infinity Overflow Inexact Rounded
+powx512 power  100  1E+12  ->  Infinity Overflow Inexact Rounded
+powx513 power  100  1E+13  ->  Infinity Overflow Inexact Rounded
+powx514 power  100  1E+14  ->  Infinity Overflow Inexact Rounded
+powx515 power  100  1E+15  ->  Infinity Overflow Inexact Rounded
+powx516 power  100  1E+16  ->  Infinity Overflow Inexact Rounded
+powx517 power  100  1E+17  ->  Infinity Overflow Inexact Rounded
+powx518 power  100  1E+18  ->  Infinity Overflow Inexact Rounded
+powx519 power  100  1E+19  ->  Infinity Overflow Inexact Rounded
+powx520 power  100  1E+20  ->  Infinity Overflow Inexact Rounded
+powx521 power  100  1E+21  ->  Infinity Overflow Inexact Rounded
+powx522 power  100  1E+22  ->  Infinity Overflow Inexact Rounded
+powx523 power  100  1E+23  ->  Infinity Overflow Inexact Rounded
+powx524 power  100  1E+24  ->  Infinity Overflow Inexact Rounded
+powx525 power  100  1E+25  ->  Infinity Overflow Inexact Rounded
+powx526 power  100  1E+26  ->  Infinity Overflow Inexact Rounded
+powx527 power  100  1E+27  ->  Infinity Overflow Inexact Rounded
+powx528 power  100  1E+28  ->  Infinity Overflow Inexact Rounded
+powx529 power  100  1E+29  ->  Infinity Overflow Inexact Rounded
+powx530 power  100  1E+30  ->  Infinity Overflow Inexact Rounded
+powx531 power  100  1E+40  ->  Infinity Overflow Inexact Rounded
+powx532 power  100  1E+50  ->  Infinity Overflow Inexact Rounded
+powx533 power  100  1E+100 ->  Infinity Overflow Inexact Rounded
+powx534 power  100  1E+383 ->  Infinity Overflow Inexact Rounded
+
+-- a check for double-rounded subnormals
 precision:   5
 maxexponent: 79
 minexponent: -79
@@ -649,3 +675,950 @@ powx750 power     1.2347E-40  2      ->  1.524E-80 Inexact Rounded Subnormal Und
 powx900 power  1 # -> NaN Invalid_operation
 powx901 power  # 1 -> NaN Invalid_operation
 
+----------------------------------------------------------------------
+-- Below here are tests with a precision or context outside of the  --
+-- decNumber 'mathematical functions' restricted range.  These      --
+-- remain supported in decNumber to minimize breakage, but may be   --
+-- outside the range of other implementations.                      --
+----------------------------------------------------------------------
+maxexponent: 999999999
+minexponent: -999999999
+precision: 9
+powx1063 power   '10'  '999999999' -> '1.00000000E+999999999' Rounded
+powx1064 power   '10'  '999999998' -> '1.00000000E+999999998' Rounded
+powx1065 power   '10'  '999999997' -> '1.00000000E+999999997' Rounded
+powx1066 power   '10'  '333333333' -> '1.00000000E+333333333' Rounded
+-- next two are integer-out-of range
+powx1183 power   '7'   '1000000000'  -> NaN Invalid_context
+powx1184 power   '7'   '1000000001'  -> NaN Invalid_context
+powx1186 power   '7'   '-1000000001' -> 1.38243630E-845098041 Inexact Rounded
+powx1187 power   '7'   '-1000000000' -> 9.67705411E-845098041 Inexact Rounded
+
+-- out-of-range edge cases
+powx1118 power  '10'  '-333333333'   -> 1E-333333333
+powx1119 power  '10'  '-999999998'   -> 1E-999999998
+powx1120 power  '10'  '-999999999'   -> 1E-999999999
+powx1181 power   '7'   '999999998'   -> 2.10892313E+845098038 Inexact Rounded
+powx1182 power   '7'   '999999999'   -> 1.47624619E+845098039 Inexact Rounded
+powx1189 power   '7'   '-999999999'  -> 6.77393787E-845098040 Inexact Rounded
+powx1190 power   '7'   '-999999998'  -> 4.74175651E-845098039 Inexact Rounded
+
+-- A (rare) case where the last digit is not within 0.5 ULP with classic precision
+precision: 9
+powx1215 power "-21971575.0E+31454441" "-7" -> "-4.04549502E-220181139" Inexact Rounded
+precision: 20
+powx1216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139" Inexact Rounded
+
+-- overflow and underflow tests
+precision: 9
+powx1280 power  9            999999999 -> 3.05550054E+954242508 Inexact Rounded
+powx1281 power 10            999999999 -> 1.00000000E+999999999 Rounded
+powx1282 power 10.0001       999999999 -> Infinity Overflow Inexact Rounded
+powx1283 power 10.1          999999999 -> Infinity Overflow Inexact Rounded
+powx1284 power 11            999999999 -> Infinity Overflow Inexact Rounded
+powx1285 power 12            999999999 -> Infinity Overflow Inexact Rounded
+powx1286 power 999           999999999 -> Infinity Overflow Inexact Rounded
+powx1287 power 999999        999999999 -> Infinity Overflow Inexact Rounded
+powx1288 power 999999999     999999999 -> Infinity Overflow Inexact Rounded
+powx1289 power 9.9E999999999 999999999 -> Infinity Overflow Inexact Rounded
+
+powx1290 power 0.5           999999999 -> 4.33559594E-301029996 Inexact Rounded
+powx1291 power 0.1           999999999 -> 1E-999999999  -- unrounded
+powx1292 power 0.09          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1293 power 0.05          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1294 power 0.01          999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1295 power 0.0001        999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1297 power 0.0000001     999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1298 power 0.0000000001  999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1299 power 1E-999999999  999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+
+powx1310 power -9             999999999 -> -3.05550054E+954242508 Inexact Rounded
+powx1311 power -10            999999999 -> -1.00000000E+999999999 Rounded
+powx1312 power -10.0001       999999999 -> -Infinity Overflow Inexact Rounded
+powx1313 power -10.1          999999999 -> -Infinity Overflow Inexact Rounded
+powx1314 power -11            999999999 -> -Infinity Overflow Inexact Rounded
+powx1315 power -12            999999999 -> -Infinity Overflow Inexact Rounded
+powx1316 power -999           999999999 -> -Infinity Overflow Inexact Rounded
+powx1317 power -999999        999999999 -> -Infinity Overflow Inexact Rounded
+powx1318 power -999999999     999999999 -> -Infinity Overflow Inexact Rounded
+powx1319 power -9.9E999999999 999999999 -> -Infinity Overflow Inexact Rounded
+
+powx1320 power -0.5           999999999 -> -4.33559594E-301029996 Inexact Rounded
+powx1321 power -0.1           999999999 -> -1E-999999999
+powx1322 power -0.09          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1323 power -0.05          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1324 power -0.01          999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1325 power -0.0001        999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1327 power -0.0000001     999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1328 power -0.0000000001  999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1329 power -1E-999999999  999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- note no trim of next result
+powx1330 power -9             999999998 ->  3.39500060E+954242507 Inexact Rounded
+powx1331 power -10            999999998 ->  1.00000000E+999999998 Rounded
+powx1332 power -10.0001       999999998 ->  Infinity Overflow Inexact Rounded
+powx1333 power -10.1          999999998 ->  Infinity Overflow Inexact Rounded
+powx1334 power -11            999999998 ->  Infinity Overflow Inexact Rounded
+powx1335 power -12            999999998 ->  Infinity Overflow Inexact Rounded
+powx1336 power -999           999999998 ->  Infinity Overflow Inexact Rounded
+powx1337 power -999999        999999998 ->  Infinity Overflow Inexact Rounded
+powx1338 power -999999999     999999998 ->  Infinity Overflow Inexact Rounded
+powx1339 power -9.9E999999999 999999998 ->  Infinity Overflow Inexact Rounded
+
+powx1340 power -0.5           999999998 ->  8.67119187E-301029996 Inexact Rounded
+powx1341 power -0.1           999999998 ->  1E-999999998  -- NB exact unrounded
+powx1342 power -0.09          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1343 power -0.05          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1344 power -0.01          999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1345 power -0.0001        999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1347 power -0.0000001     999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1348 power -0.0000000001  999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1349 power -1E-999999999  999999998 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- some subnormals
+precision: 9
+-- [precision is 9, so smallest exponent is -1000000007
+powx1350 power  1e-1          500000000 ->  1E-500000000
+powx1351 power  1e-2          999999999 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1352 power  1e-2          500000000 ->  1E-1000000000 Subnormal
+powx1353 power  1e-2          500000001 ->  1E-1000000002 Subnormal
+powx1354 power  1e-2          500000002 ->  1E-1000000004 Subnormal
+powx1355 power  1e-2          500000003 ->  1E-1000000006 Subnormal
+powx1356 power  1e-2          500000004 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+
+powx1360 power  0.010001      500000000 ->  4.34941988E-999978287 Inexact Rounded
+powx1361 power  0.010000001   500000000 ->  5.18469257E-999999979 Inexact Rounded
+powx1362 power  0.010000001   500000001 ->  5.18469309E-999999981 Inexact Rounded
+powx1363 power  0.0100000009  500000000 ->  3.49342003E-999999981 Inexact Rounded
+powx1364 power  0.0100000001  500000000 ->  1.48413155E-999999998 Inexact Rounded
+powx1365 power  0.01          500000000 ->  1E-1000000000 Subnormal
+powx1366 power  0.0099999999  500000000 ->  6.7379E-1000000003 Underflow Subnormal Inexact Rounded
+powx1367 power  0.0099999998  500000000 ->  4.54E-1000000005 Underflow Subnormal Inexact Rounded
+powx1368 power  0.0099999997  500000000 ->  3E-1000000007 Underflow Subnormal Inexact Rounded
+powx1369 power  0.0099999996  500000000 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+powx1370 power  0.009         500000000 ->  0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- 1/subnormal -> overflow
+powx1371 power  1e-1         -500000000 ->  1E+500000000
+powx1372 power  1e-2         -999999999 ->  Infinity Overflow Inexact Rounded
+powx1373 power  1e-2         -500000000 ->  Infinity Overflow Inexact Rounded
+powx1374 power  1e-2         -500000001 ->  Infinity Overflow Inexact Rounded
+powx1375 power  1e-2         -500000002 ->  Infinity Overflow Inexact Rounded
+powx1376 power  1e-2         -500000003 ->  Infinity Overflow Inexact Rounded
+powx1377 power  1e-2         -500000004 ->  Infinity Overflow Inexact Rounded
+
+powx1381 power  0.010001     -500000000 ->  2.29915719E+999978286 Inexact Rounded
+powx1382 power  0.010000001  -500000000 ->  1.92875467E+999999978 Inexact Rounded
+powx1383 power  0.010000001  -500000001 ->  1.92875448E+999999980 Inexact Rounded
+powx1384 power  0.0100000009 -500000000 ->  2.86252438E+999999980 Inexact Rounded
+powx1385 power  0.0100000001 -500000000 ->  6.73794717E+999999997 Inexact Rounded
+powx1386 power  0.01         -500000000 ->  Infinity Overflow Inexact Rounded
+powx1387 power  0.009999     -500000000 ->  Infinity Overflow Inexact Rounded
+
+-- negative power giving subnormal
+powx1388 power  100.000001   -500000000 ->  6.7379E-1000000003 Underflow Subnormal Inexact Rounded
+
+----------------------------------------------------------------------
+-- Below here are the tests with a non-integer rhs, including the   --
+-- tests that previously caused Invalid operation.  An integer-only --
+-- (on rhs) implementation should handle all the tests above as     --
+-- shown, and would flag most of the following tests as Invalid.    --
+----------------------------------------------------------------------
+precision:   16
+rounding:    half_even
+maxExponent: 384
+minExponent: -383
+
+powx2000 power 7 '10000000000'        -> Infinity Overflow Inexact Rounded
+powx2001 power 2 '2.000001'           -> 4.000002772589683 Inexact Rounded
+powx2002 power 2 '2.00000000'         -> 4
+powx2003 power 2 '2.000000001'        -> 4.000000002772589 Inexact Rounded
+powx2004 power 2 '2.0000000001'       -> 4.000000000277259 Inexact Rounded
+powx2005 power 2 '2.00000000001'      -> 4.000000000027726 Inexact Rounded
+powx2006 power 2 '2.000000000001'     -> 4.000000000002773 Inexact Rounded
+powx2007 power 2 '2.0000000000001'    -> 4.000000000000277 Inexact Rounded
+powx2008 power 2 '2.00000000000001'   -> 4.000000000000028 Inexact Rounded
+powx2009 power 2 '2.000000000000001'  -> 4.000000000000003 Inexact Rounded
+powx2010 power 2 '2.0000000000000001' -> 4.000000000000000 Inexact Rounded
+--                1 234567890123456
+
+powx2011 power 1 1234 -> 1
+precision: 4
+powx2012 power 1 1234 -> 1
+precision: 3
+powx2013 power 1 1234     -> 1
+powx2014 power 1 12.34e+2 -> 1
+powx2015 power 1 12.3     -> 1.00 Inexact Rounded
+powx2016 power 1 12.0     -> 1
+powx2017 power 1 1.01     -> 1.00 Inexact Rounded
+powx2018 power 2 1.00     -> 2
+powx2019 power 2 2.00     -> 4
+precision: 9
+powx2030 power 1 1.0001           -> 1.00000000 Inexact Rounded
+powx2031 power 1 1.0000001        -> 1.00000000 Inexact Rounded
+powx2032 power 1 1.0000000001     -> 1.00000000 Inexact Rounded
+powx2033 power 1 1.0000000000001  -> 1.00000000 Inexact Rounded
+precision: 5
+powx2034 power 1 1.0001           -> 1.0000 Inexact Rounded
+powx2035 power 1 1.0000001        -> 1.0000 Inexact Rounded
+powx2036 power 1 1.0000000001     -> 1.0000 Inexact Rounded
+powx2037 power 1 1.0000000000001  -> 1.0000 Inexact Rounded
+powx2038 power 1 1.0000000000001  -> 1.0000 Inexact Rounded
+
+rounding: ceiling
+precision: 3
+powx2039 power 1 1.01     -> 1.00 Inexact Rounded
+powx2040 power 1 12.3     -> 1.00 Inexact Rounded
+rounding: half_even
+
+-- 1 ** any integer, including big ones, should be exact
+powx2041 power 1 1000000000   -> 1
+powx2042 power 1 9999999999   -> 1
+powx2043 power 1 12345678000  -> 1
+powx2044 power 1 1234567800   -> 1
+powx2045 power 1 1234567890   -> 1
+powx2046 power 1 11234567891  -> 1
+powx2047 power 1 12345678901  -> 1
+powx2048 power 1 1234567896   -> 1
+powx2049 power 1 -1234567896  -> 1
+powx2051 power 1 1000000000   -> 1
+powx2052 power 1 -1000000000  -> 1
+powx2053 power 1 12345678000  -> 1
+powx2054 power 1 -1234567896  -> 1
+powx2055 power 1 1000000000   -> 1
+powx2056 power 1 4300000000   -> 1
+powx2057 power 1 -1000000000  -> 1
+-- negatives ... but not out of range for decNumber
+powx2061 power -1 100000   -> 1
+powx2062 power -1 999999   -> -1
+powx2063 power -1 1278000  -> 1
+powx2064 power -1 127803   -> -1
+powx2065 power -1 127890   -> 1
+powx2066 power -1 1167891  -> -1
+powx2067 power -1 1278901  -> -1
+powx2068 power -1 127896   -> 1
+powx2069 power -1 -167897  -> -1
+powx2071 power -1 100000   -> 1
+powx2072 power -1 -100001  -> -1
+powx2073 power -1 1278000  -> 1
+powx2074 power -1 -167896  -> 1
+powx2075 power -1 100000   -> 1
+powx2076 power -1 -100009  -> -1
+
+-- The above were derived from the earlier version of power.decTest;
+-- now start new tests for power(x,y) for non-integer y
+precision: 9
+
+-- tests from specification
+powx2081 power 2           3    ->  '8'
+powx2082 power -2          3    ->  '-8'
+powx2083 power 2          -3    ->  '0.125'
+powx2084 power 1.7        '8'   ->  '69.7575744' Inexact Rounded
+powx2085 power 10 0.301029996   ->  2.00000000   Inexact Rounded
+powx2086 power Infinity   '-1'  ->  '0'
+powx2087 power Infinity   '0'   ->  '1'
+powx2088 power Infinity   '1'   ->  'Infinity'
+powx2089 power -Infinity  '-1'  ->  '-0'
+powx2090 power -Infinity  '0'   ->  '1'
+powx2091 power -Infinity  '1'   ->  '-Infinity'
+powx2092 power -Infinity  '2'   ->  'Infinity'
+powx2093 power 0  0             ->  'NaN' Invalid_operation
+
+precision:   16
+rounding:    half_even
+maxExponent: 384
+minExponent: -383
+
+-- basics
+powx2100 power 1E-7     1E-7   -> 0.9999983881917339      Inexact Rounded
+powx2101 power 0.003    1E-7   -> 0.9999994190858697      Inexact Rounded
+powx2102 power 0.7      1E-7   -> 0.9999999643325062      Inexact Rounded
+powx2103 power 1.2      1E-7   -> 1.000000018232156       Inexact Rounded
+powx2104 power 71       1E-7   -> 1.000000426268079       Inexact Rounded
+powx2105 power 9E+9     1E-7   -> 1.000002292051668       Inexact Rounded
+
+powx2110 power 1E-7     0.003  -> 0.9527961640236519      Inexact Rounded
+powx2111 power 0.003    0.003  -> 0.9827235503366797      Inexact Rounded
+powx2112 power 0.7      0.003  -> 0.9989305474406207      Inexact Rounded
+powx2113 power 1.2      0.003  -> 1.000547114282834       Inexact Rounded
+powx2114 power 71       0.003  -> 1.012870156273545       Inexact Rounded
+powx2115 power 9E+9     0.003  -> 1.071180671278787       Inexact Rounded
+
+powx2120 power 1E-7     0.7    -> 0.00001258925411794167  Inexact Rounded
+powx2121 power 0.003    0.7    -> 0.01713897630281030     Inexact Rounded
+powx2122 power 0.7      0.7    -> 0.7790559126704491      Inexact Rounded
+powx2123 power 1.2      0.7    -> 1.136126977198889       Inexact Rounded
+powx2124 power 71       0.7    -> 19.76427300093870       Inexact Rounded
+powx2125 power 9E+9     0.7    -> 9289016.976853710       Inexact Rounded
+
+powx2130 power 1E-7     1.2    -> 3.981071705534973E-9    Inexact Rounded
+powx2131 power 0.003    1.2    -> 0.0009387403933595694   Inexact Rounded
+powx2132 power 0.7      1.2    -> 0.6518049405663864      Inexact Rounded
+powx2133 power 1.2      1.2    -> 1.244564747203978       Inexact Rounded
+powx2134 power 71       1.2    -> 166.5367244638552       Inexact Rounded
+powx2135 power 9E+9     1.2    -> 881233526124.8791       Inexact Rounded
+
+powx2140 power 1E-7     71     -> 0E-398                  Inexact Rounded Underflow Subnormal Clamped
+powx2141 power 0.003    71     -> 7.509466514979725E-180  Inexact Rounded
+powx2142 power 0.7      71     -> 1.004525211269079E-11   Inexact Rounded
+powx2143 power 1.2      71     -> 418666.7483186515       Inexact Rounded
+powx2144 power 71       71     -> 2.750063734834616E+131  Inexact Rounded
+powx2145 power 9E+9     71     -> Infinity                Inexact Rounded Overflow
+
+powx2150 power 1E-7     9E+9   -> 0E-398                  Inexact Rounded Underflow Subnormal Clamped
+powx2151 power 0.003    9E+9   -> 0E-398                  Inexact Rounded Underflow Subnormal Clamped
+powx2152 power 0.7      9E+9   -> 0E-398                  Inexact Rounded Underflow Subnormal Clamped
+powx2153 power 1.2      9E+9   -> Infinity                Inexact Rounded Overflow
+powx2154 power 71       9E+9   -> Infinity                Inexact Rounded Overflow
+powx2155 power 9E+9     9E+9   -> Infinity                Inexact Rounded Overflow
+
+-- number line milestones with lhs<1 and lhs>1
+
+-- Overflow boundary (Nmax)
+powx2202 power 71     207.966651583983200 -> Infinity Inexact Rounded Overflow
+powx2201 power 71     207.966651583983199 -> 9.999999999999994E+384 Inexact Rounded
+powx2204 power 0.003 -152.603449817093577 -> Infinity Inexact Rounded Overflow
+powx2203 power 0.003 -152.603449817093576 -> 9.999999999999994E+384 Inexact Rounded
+
+-- Nmin boundary
+powx2211 power 71    -206.886305341988480 -> 1.000000000000005E-383 Inexact Rounded
+powx2212 power 71    -206.886305341988481 -> 1.000000000000001E-383 Inexact Rounded
+powx2213 power 71    -206.886305341988482 -> 9.99999999999997E-384  Inexact Rounded Underflow Subnormal
+powx2214 power 71    -206.886305341988483 -> 9.99999999999992E-384  Inexact Rounded Underflow Subnormal
+--                                           9.999999999999924565357019820
+
+powx2215 power 0.003  151.810704623238543 -> 1.000000000000009E-383 Inexact Rounded
+powx2216 power 0.003  151.810704623238544 -> 1.000000000000003E-383 Inexact Rounded
+powx2217 power 0.003  151.810704623238545 -> 9.99999999999997E-384  Inexact Rounded Underflow Subnormal
+powx2218 power 0.003  151.810704623238546 -> 9.99999999999991E-384  Inexact Rounded Underflow Subnormal
+
+-- Ntiny boundary, these edge cases determined using half_up rounding
+rounding: half_up
+powx2221 power 71    -215.151510469220498 -> 1E-398    Inexact Rounded Underflow Subnormal
+powx2222 power 71    -215.151510469220499 -> 1E-398    Inexact Rounded Underflow Subnormal
+powx2223 power 71    -215.151510469220500 -> 0E-398    Inexact Rounded Underflow Subnormal Clamped
+powx2224 power 71    -215.151510469220501 -> 0E-398    Inexact Rounded Underflow Subnormal Clamped
+
+powx2225 power 0.003  157.875613618285691 -> 1E-398    Inexact Rounded Underflow Subnormal
+powx2226 power 0.003  157.875613618285692 -> 1E-398    Inexact Rounded Underflow Subnormal
+powx2227 power 0.003  157.875613618285693 -> 0E-398    Inexact Rounded Underflow Subnormal Clamped
+powx2228 power 0.003  220                 -> 0E-398    Inexact Rounded Underflow Subnormal Clamped
+rounding: half_even
+
+-- power(10, y) are important ...
+
+-- Integer powers are exact, unless over/underflow
+powx2301 power 10     385     -> Infinity Overflow Inexact Rounded
+powx2302 power 10     384     -> 1.000000000000000E+384 Rounded
+powx2303 power 10      17     -> 1.000000000000000E+17 Rounded
+powx2304 power 10      16     -> 1.000000000000000E+16 Rounded
+powx2305 power 10      15     -> 1000000000000000
+powx2306 power 10      10     -> 10000000000
+powx2307 power 10       5     -> 100000
+powx2308 power 10       1     -> 10
+powx2309 power 10       0     -> 1
+powx2310 power 10      -1     -> 0.1
+powx2311 power 10      -5     -> 0.00001
+powx2312 power 10      -6     -> 0.000001
+powx2313 power 10      -7     -> 1E-7
+powx2314 power 10      -8     -> 1E-8
+powx2315 power 10      -9     -> 1E-9
+powx2316 power 10     -10     -> 1E-10
+powx2317 power 10    -383     -> 1E-383
+powx2318 power 10    -384     -> 1E-384 Subnormal
+powx2319 power 10    -385     -> 1E-385 Subnormal
+powx2320 power 10    -397     -> 1E-397 Subnormal
+powx2321 power 10    -398     -> 1E-398 Subnormal
+powx2322 power 10    -399     -> 0E-398 Subnormal Underflow Inexact Rounded Clamped
+powx2323 power 10    -400     -> 0E-398 Subnormal Underflow Inexact Rounded Clamped
+
+-- Independent sanity check: 1961 Godfrey & Siddons four-figure logs
+powx2351 power 10   0.0000    -> 1
+powx2352 power 10   0.3010    -> 1.999861869632744 Inexact Rounded
+powx2353 power 10   0.4771    -> 2.999853181190793 Inexact Rounded
+powx2354 power 10   0.6021    -> 4.000368510461250 Inexact Rounded
+powx2355 power 10   0.6990    -> 5.000345349769785 Inexact Rounded
+powx2356 power 10   0.7782    -> 6.000673538641164 Inexact Rounded
+powx2357 power 10   0.8451    -> 7.000031591308969 Inexact Rounded
+powx2358 power 10   0.9031    -> 8.000184448550990 Inexact Rounded
+powx2359 power 10   0.9542    -> 8.999119108700520 Inexact Rounded
+powx2360 power 10   0.9956    -> 9.899197750805841 Inexact Rounded
+powx2361 power 10   0.9996    -> 9.990793899844618 Inexact Rounded
+precision: 4
+powx2371 power 10   0.0000    -> 1
+powx2372 power 10   0.3010    -> 2.000 Inexact Rounded
+powx2373 power 10   0.4771    -> 3.000 Inexact Rounded
+powx2374 power 10   0.6021    -> 4.000 Inexact Rounded
+powx2375 power 10   0.6990    -> 5.000 Inexact Rounded
+powx2376 power 10   0.7782    -> 6.001 Inexact Rounded
+powx2377 power 10   0.8451    -> 7.000 Inexact Rounded
+powx2378 power 10   0.9031    -> 8.000 Inexact Rounded
+powx2379 power 10   0.9542    -> 8.999 Inexact Rounded
+powx2380 power 10   0.9956    -> 9.899 Inexact Rounded
+powx2381 power 10   0.9996    -> 9.991 Inexact Rounded
+
+-- 10**x ~=2 (inverse of the test in log10.decTest)
+precision: 50
+powx2401 power 10 0.30102999566398119521373889472449302676818988146211 -> 2.0000000000000000000000000000000000000000000000000 Inexact Rounded
+precision: 49
+powx2402 power 10 0.3010299956639811952137388947244930267681898814621 -> 2.000000000000000000000000000000000000000000000000 Inexact Rounded
+precision: 48
+powx2403 power 10 0.301029995663981195213738894724493026768189881462 -> 2.00000000000000000000000000000000000000000000000 Inexact Rounded
+precision: 47
+powx2404 power 10 0.30102999566398119521373889472449302676818988146 -> 2.0000000000000000000000000000000000000000000000 Inexact Rounded
+precision: 46
+powx2405 power 10 0.3010299956639811952137388947244930267681898815 -> 2.000000000000000000000000000000000000000000000 Inexact Rounded
+precision: 45
+powx2406 power 10 0.301029995663981195213738894724493026768189881 -> 2.00000000000000000000000000000000000000000000 Inexact Rounded
+precision: 44
+powx2407 power 10 0.30102999566398119521373889472449302676818988 -> 2.0000000000000000000000000000000000000000000 Inexact Rounded
+precision: 43
+powx2408 power 10 0.3010299956639811952137388947244930267681899 -> 2.000000000000000000000000000000000000000000 Inexact Rounded
+precision: 42
+powx2409 power 10 0.301029995663981195213738894724493026768190 -> 2.00000000000000000000000000000000000000000 Inexact Rounded
+precision: 41
+powx2410 power 10 0.30102999566398119521373889472449302676819 -> 2.0000000000000000000000000000000000000000 Inexact Rounded
+precision: 40
+powx2411 power 10 0.3010299956639811952137388947244930267682 -> 2.000000000000000000000000000000000000000 Inexact Rounded
+precision: 39
+powx2412 power 10 0.301029995663981195213738894724493026768 -> 2.00000000000000000000000000000000000000 Inexact Rounded
+precision: 38
+powx2413 power 10 0.30102999566398119521373889472449302677 -> 2.0000000000000000000000000000000000000 Inexact Rounded
+precision: 37
+powx2414 power 10 0.3010299956639811952137388947244930268 -> 2.000000000000000000000000000000000000 Inexact Rounded
+precision: 36
+powx2415 power 10 0.301029995663981195213738894724493027 -> 2.00000000000000000000000000000000000 Inexact Rounded
+precision: 35
+powx2416 power 10 0.30102999566398119521373889472449303 -> 2.0000000000000000000000000000000000 Inexact Rounded
+precision: 34
+powx2417 power 10 0.3010299956639811952137388947244930 -> 2.000000000000000000000000000000000 Inexact Rounded
+precision: 33
+powx2418 power 10 0.301029995663981195213738894724493 -> 2.00000000000000000000000000000000 Inexact Rounded
+precision: 32
+powx2419 power 10 0.30102999566398119521373889472449 -> 2.0000000000000000000000000000000 Inexact Rounded
+precision: 31
+powx2420 power 10 0.3010299956639811952137388947245 -> 2.000000000000000000000000000000 Inexact Rounded
+precision: 30
+powx2421 power 10 0.301029995663981195213738894725 -> 2.00000000000000000000000000000 Inexact Rounded
+precision: 29
+powx2422 power 10 0.30102999566398119521373889472 -> 2.0000000000000000000000000000 Inexact Rounded
+precision: 28
+powx2423 power 10 0.3010299956639811952137388947 -> 2.000000000000000000000000000 Inexact Rounded
+precision: 27
+powx2424 power 10 0.301029995663981195213738895 -> 2.00000000000000000000000000 Inexact Rounded
+precision: 26
+powx2425 power 10 0.30102999566398119521373889 -> 2.0000000000000000000000000 Inexact Rounded
+precision: 25
+powx2426 power 10 0.3010299956639811952137389 -> 2.000000000000000000000000 Inexact Rounded
+precision: 24
+powx2427 power 10 0.301029995663981195213739 -> 2.00000000000000000000000 Inexact Rounded
+precision: 23
+powx2428 power 10 0.30102999566398119521374 -> 2.0000000000000000000000 Inexact Rounded
+precision: 22
+powx2429 power 10 0.3010299956639811952137 -> 2.000000000000000000000 Inexact Rounded
+precision: 21
+powx2430 power 10 0.301029995663981195214 -> 2.00000000000000000000 Inexact Rounded
+precision: 20
+powx2431 power 10 0.30102999566398119521 -> 2.0000000000000000000 Inexact Rounded
+precision: 19
+powx2432 power 10 0.3010299956639811952 -> 2.000000000000000000 Inexact Rounded
+precision: 18
+powx2433 power 10 0.301029995663981195 -> 2.00000000000000000 Inexact Rounded
+precision: 17
+powx2434 power 10 0.30102999566398120 -> 2.0000000000000000 Inexact Rounded
+precision: 16
+powx2435 power 10 0.3010299956639812 -> 2.000000000000000 Inexact Rounded
+precision: 15
+powx2436 power 10 0.301029995663981 -> 2.00000000000000 Inexact Rounded
+precision: 14
+powx2437 power 10 0.30102999566398 -> 2.0000000000000 Inexact Rounded
+precision: 13
+powx2438 power 10 0.3010299956640 -> 2.000000000000 Inexact Rounded
+precision: 12
+powx2439 power 10 0.301029995664 -> 2.00000000000 Inexact Rounded
+precision: 11
+powx2440 power 10 0.30102999566 -> 2.0000000000 Inexact Rounded
+precision: 10
+powx2441 power 10 0.3010299957 -> 2.000000000 Inexact Rounded
+precision:  9
+powx2442 power 10 0.301029996 -> 2.00000000 Inexact Rounded
+precision:  8
+powx2443 power 10 0.30103000 -> 2.0000000 Inexact Rounded
+precision:  7
+powx2444 power 10 0.3010300 -> 2.000000 Inexact Rounded
+precision:  6
+powx2445 power 10 0.301030 -> 2.00000 Inexact Rounded
+precision:  5
+powx2446 power 10 0.30103 -> 2.0000 Inexact Rounded
+precision:  4
+powx2447 power 10 0.3010 -> 2.000 Inexact Rounded
+precision:  3
+powx2448 power 10 0.301 -> 2.00 Inexact Rounded
+precision:  2
+powx2449 power 10 0.30 -> 2.0 Inexact Rounded
+precision:  1
+powx2450 power 10 0.3 -> 2 Inexact Rounded
+
+maxExponent: 384
+minExponent: -383
+precision:   16
+rounding:    half_even
+
+-- Close-to-e tests
+precision:   34
+powx2500 power 10 0.4342944819032518276511289189166048     -> 2.718281828459045235360287471352661  Inexact Rounded
+powx2501 power 10 0.4342944819032518276511289189166049     -> 2.718281828459045235360287471352661  Inexact Rounded
+powx2502 power 10 0.4342944819032518276511289189166050     -> 2.718281828459045235360287471352662  Inexact Rounded
+powx2503 power 10 0.4342944819032518276511289189166051     -> 2.718281828459045235360287471352663  Inexact Rounded
+powx2504 power 10 0.4342944819032518276511289189166052     -> 2.718281828459045235360287471352663  Inexact Rounded
+
+-- e**e, 16->34
+powx2505 power 2.718281828459045 2.718281828459045 -> '15.15426224147925705633739513098219' Inexact Rounded
+
+-- Sequence around an integer
+powx2512 power 10 2.9999999999999999999999999999999997     -> 999.9999999999999999999999999999993  Inexact Rounded
+powx2513 power 10 2.9999999999999999999999999999999998     -> 999.9999999999999999999999999999995  Inexact Rounded
+powx2514 power 10 2.9999999999999999999999999999999999     -> 999.9999999999999999999999999999998  Inexact Rounded
+powx2515 power 10 3.0000000000000000000000000000000000     -> 1000
+powx2516 power 10 3.0000000000000000000000000000000001     -> 1000.000000000000000000000000000000  Inexact Rounded
+powx2517 power 10 3.0000000000000000000000000000000002     -> 1000.000000000000000000000000000000  Inexact Rounded
+powx2518 power 10 3.0000000000000000000000000000000003     -> 1000.000000000000000000000000000001  Inexact Rounded
+
+-- randomly generated tests
+maxExponent: 384
+minExponent: -383
+
+-- P=34, within 0-999 -- positive arg2
+Precision: 34
+powx3201 power 5.301557744131969249145904611290735  369.3175647984435534243813466380579 -> 3.427165676345688240023113326603960E+267 Inexact Rounded
+powx3202 power 0.0000000000506875655819165973738225 21.93514102704466434121826965196878 -> 1.498169860033487321566659495340789E-226 Inexact Rounded
+powx3203 power 97.88877680721519917858007810494043  5.159898445242793470476673109899554 -> 18705942904.43290467281449559427982      Inexact Rounded
+powx3204 power 7.380441015594399747973924380493799  17.93614173904818313507525109033288 -> 3715757985820076.273336082702577274      Inexact Rounded
+powx3205 power 2.045623627647350918819219169855040  1082.999652407430697958175966996254 -> 4.208806435006704867447150904279854E+336 Inexact Rounded
+powx3206 power 0.0000000762582873112118926142955423 20.30534237055073996975203864170432 -> 2.967574278677013090697130349198877E-145 Inexact Rounded
+powx3207 power 0.0000000000194091470907814855660535 14.71164213947722238856835440242911 -> 2.564391397469554735037158345963280E-158 Inexact Rounded
+powx3208 power 0.0000000000509434185382818596853504 20.97051498204188277347203735421595 -> 1.420157372748083000927138678417272E-216 Inexact Rounded
+powx3209 power 0.0005389217212073307301395750745119 43.96798225485747315858678755538971 -> 1.957850185781292007977898626137240E-144 Inexact Rounded
+powx3210 power 498.5690105989136050444077447411198  128.1038813807243375878831104745803 -> 3.882212970903893127009102293596268E+345 Inexact Rounded
+powx3211 power 0.0000000935428918637303954281938975 5.736933454863278597460091596496099 -> 4.733219644540496152403967823635195E-41  Inexact Rounded
+powx3212 power 8.581586784734161309180363110126352  252.0229459968869784643374981477208 -> 1.907464842458674622356177850049873E+235 Inexact Rounded
+powx3213 power 294.1005302951621709143320795278305  155.5466374141708615975111014663722 -> 9.251717033292072959166737280729728E+383 Inexact Rounded
+powx3214 power 0.0000000041253343654396865855722090 19.00170974760425576247662125110472 -> 4.779566288553864405790921353593512E-160 Inexact Rounded
+powx3215 power 0.0000000000046912257352141395184092 24.66089523148729269098773236636878 -> 4.205126874048597849476723538057527E-280 Inexact Rounded
+powx3216 power 0.0000000000036796674296520639450494 22.09713956900694689234335912523078 -> 2.173081843837539818472071316420405E-253 Inexact Rounded
+powx3217 power 9.659887100303037657934372148567685  277.3765665424320875993026404492216 -> 1.614974043145519382749740616665041E+273 Inexact Rounded
+powx3218 power 0.0000083231310642229204398943076403 29.33123211782131466471359128190372 -> 1.013330439786660210757226597785328E-149 Inexact Rounded
+powx3219 power 0.0938084859086450954956863725653664 262.6091918199905272837286784975012 -> 1.262802485286301066967555821509344E-270 Inexact Rounded
+powx3220 power 8.194926977580900145696305910223304  184.3705133945546202012995485297248 -> 2.696353910907824016690021495828584E+168 Inexact Rounded
+powx3221 power 72.39594594653085161522285114566120  168.7721909489321402152033939836725 -> 7.379858293630460043361584410795031E+313 Inexact Rounded
+powx3222 power 0.0000000000003436856010144185445537 26.34329868961274988994452526178983 -> 4.585379573595865689605567720192768E-329 Inexact Rounded
+powx3223 power 20.18365633762226550254542489492623  127.2099705237021350103678072707790 -> 1.020919629336979353690271762206060E+166 Inexact Rounded
+powx3224 power 0.0000000553723990761530290129268131 8.157597566134754638015199501162405 -> 6.349030513396147480954474615067145E-60  Inexact Rounded
+powx3225 power 0.0001028742674265840656614682618035 93.99842317306603797965470281716482 -> 1.455871110222736531854990397769940E-375 Inexact Rounded
+powx3226 power 95.90195152775543876489746343266050  143.5992850002211509777720799352475 -> 3.881540015848530405189834366588567E+284 Inexact Rounded
+powx3227 power 0.0000000000041783747057233878360333 12.14591167764993506821334760954430 -> 6.190998557456885985124592807383163E-139 Inexact Rounded
+powx3228 power 0.5572830497086740798434917090018768 1001.921811263919522230330241349166 -> 3.871145158537170450093833881625838E-255 Inexact Rounded
+powx3229 power 516.4754759779093954790813881333232  29.23812463126309057800793645336343 -> 2.110986192408878294012450052929185E+79  Inexact Rounded
+powx3230 power 0.0000835892099464584776847299020706 27.64279992884843877453592659341588 -> 1.891535098905506689512376224943293E-113 Inexact Rounded
+powx3231 power 72.45836577748571838139900165184955  166.2562890735032545091688015160084 -> 1.784091549041561516923092542939141E+309 Inexact Rounded
+powx3232 power 305.1823317643335924007629563009032  83.01065159508472884219290136319623 -> 1.757493136164395229602456782779110E+206 Inexact Rounded
+powx3233 power 7.108527102951713603542835791733786  145.7057852766236365450463428821948 -> 1.285934774113104362663619896550528E+124 Inexact Rounded
+powx3234 power 6.471393503175464828149365697049824  64.11741937262455725284754171995720 -> 9.978990355881803195280027533011699E+51  Inexact Rounded
+powx3235 power 39.72898094138459885662380866268385  239.9677288017447400786672779735168 -> 5.422218208517098335832848487375086E+383 Inexact Rounded
+powx3236 power 0.0002865592332736973000183287329933 90.34733869590583787065642532641096 -> 8.293733126976212033209243257136796E-321 Inexact Rounded
+powx3237 power 0.0000011343384394864811195077357936 1.926568285528399656789140809399396 -> 3.516055639378350146874261077470142E-12  Inexact Rounded
+powx3238 power 0.0000000035321610295065299384889224 7.583861778824284092434085265265582 -> 7.970899823817369764381976286536230E-65  Inexact Rounded
+powx3239 power 657.5028301569352677543770758346683  90.55778453811965116200206020172758 -> 1.522530898581564200655160665723268E+255 Inexact Rounded
+powx3240 power 8.484756398325748879450577520251447  389.7468292476262478578280531222417 -> 8.595142803587368093392510310811218E+361 Inexact Rounded
+
+-- P=16, within 0-99 -- positive arg2
+Precision: 16
+powx3101 power 0.0000215524639223 48.37532522355252 -> 1.804663257287277E-226 Inexact Rounded
+powx3102 power 00.80705856227999  2706.777535121391 -> 1.029625065876157E-252 Inexact Rounded
+powx3103 power 3.445441676383689  428.5185892455830 -> 1.657401683096454E+230 Inexact Rounded
+powx3104 power 0.0040158689495826 159.5725558816240 -> 4.255743665762492E-383 Inexact Rounded
+powx3105 power 0.0000841553281215 38.32504413453944 -> 6.738653902512052E-157 Inexact Rounded
+powx3106 power 0.7322610252571353 502.1254457674118 -> 1.109978126985943E-68  Inexact Rounded
+powx3107 power 10.75052532144880  67.34180604734781 -> 2.873015019470189E+69  Inexact Rounded
+powx3108 power 26.20425952945617  104.6002671186488 -> 2.301859355777030E+148 Inexact Rounded
+powx3109 power 0.0000055737473850 31.16285859005424 -> 1.883348470100446E-164 Inexact Rounded
+powx3110 power 61.06096011360700  10.93608439088726 -> 3.382686473028249E+19  Inexact Rounded
+powx3111 power 9.340880853257137  179.9094938131726 -> 3.819299795937696E+174 Inexact Rounded
+powx3112 power 0.0000050767371756 72.03346394186741 -> 4.216236691569869E-382 Inexact Rounded
+powx3113 power 6.838478807860596  47.49665590602285 -> 4.547621630099203E+39  Inexact Rounded
+powx3114 power 0.1299324346439081 397.7440523576938 -> 3.065047705553981E-353 Inexact Rounded
+powx3115 power 0.0003418047034264 20.00516791512018 -> 4.546189665380487E-70  Inexact Rounded
+powx3116 power 0.0001276899611715 78.12968287355703 -> 5.960217405063995E-305 Inexact Rounded
+powx3117 power 25.93160588180509  252.6245071004620 -> 1.472171597589146E+357 Inexact Rounded
+powx3118 power 35.47516857763178  86.14723037360925 -> 3.324299908481125E+133 Inexact Rounded
+powx3119 power 0.0000048171086721 43.31965603038666 -> 4.572331516616228E-231 Inexact Rounded
+powx3120 power 17.97652681097851  144.4684576550292 -> 1.842509906097860E+181 Inexact Rounded
+powx3121 power 3.622765141518729  305.1948680344950 -> 4.132320967578704E+170 Inexact Rounded
+powx3122 power 0.0080959002453519 143.9899444945627 -> 6.474627812947047E-302 Inexact Rounded
+powx3123 power 9.841699927276571  299.2466668837188 -> 1.489097656208736E+297 Inexact Rounded
+powx3124 power 0.0786659206232355 347.4750796962570 -> 2.05764809646925E-384  Inexact Rounded Underflow Subnormal
+powx3125 power 0.0000084459792645 52.47348690745487 -> 6.076251876516942E-267 Inexact Rounded
+powx3126 power 27.86589909967504  191.7296537102283 -> 1.157064112989386E+277 Inexact Rounded
+powx3127 power 0.0000419907937234 58.44957702730767 -> 1.496950672075162E-256 Inexact Rounded
+powx3128 power 0.0000664977739382 80.06749213261876 -> 3.488517620107875E-335 Inexact Rounded
+powx3129 power 58.49554484886656  125.8480768373499 -> 2.449089862146640E+222 Inexact Rounded
+powx3130 power 15.02820060024449  212.3527988973338 -> 8.307913932682067E+249 Inexact Rounded
+powx3131 power 0.0002650089942992 30.92173123678761 -> 2.517827664836147E-111 Inexact Rounded
+powx3132 power 0.0007342977426578 69.49168880741123 -> 1.600168665674440E-218 Inexact Rounded
+powx3133 power 0.0063816068650629 150.1400094183812 -> 2.705057295799001E-330 Inexact Rounded
+powx3134 power 9.912921122728791  297.8274013633411 -> 4.967624993438900E+296 Inexact Rounded
+powx3135 power 1.988603563989245  768.4862967922182 -> 2.692842474899596E+229 Inexact Rounded
+powx3136 power 8.418014519517691  164.2431359980725 -> 9.106211585888836E+151 Inexact Rounded
+powx3137 power 6.068823604450686  120.2955212365837 -> 1.599431918105982E+94  Inexact Rounded
+powx3138 power 56.90062738303850  54.90468294683645 -> 2.312839177902428E+96  Inexact Rounded
+powx3139 power 5.710905139750871  73.44608752962156 -> 3.775876053709929E+55  Inexact Rounded
+powx3140 power 0.0000017446761203 1.223981492228899 -> 8.952936595465635E-8   Inexact Rounded
+
+-- P=7, within 0-9 -- positive arg2
+Precision: 7
+powx3001 power 8.738689  55.96523 -> 4.878180E+52  Inexact Rounded
+powx3002 power 0.0404763 147.4965 -> 3.689722E-206 Inexact Rounded
+powx3003 power 0.0604232 76.69778 -> 3.319183E-94  Inexact Rounded
+powx3004 power 0.0058855 107.5018 -> 1.768875E-240 Inexact Rounded
+powx3005 power 2.058302  1173.050 -> 5.778899E+367 Inexact Rounded
+powx3006 power 0.0056998 85.70157 -> 4.716783E-193 Inexact Rounded
+powx3007 power 0.8169297 3693.537 -> 4.475962E-325 Inexact Rounded
+powx3008 power 0.2810153 659.9568 -> 1.533177E-364 Inexact Rounded
+powx3009 power 4.617478  15.68308 -> 2.629748E+10  Inexact Rounded
+powx3010 power 0.0296418 244.2302 -> 6.207949E-374 Inexact Rounded
+powx3011 power 0.0036456 127.9987 -> 8.120891E-313 Inexact Rounded
+powx3012 power 0.5012813 577.5418 -> 6.088802E-174 Inexact Rounded
+powx3013 power 0.0033275 119.9800 -> 5.055049E-298 Inexact Rounded
+powx3014 power 0.0037652 111.7092 -> 1.560351E-271 Inexact Rounded
+powx3015 power 0.6463252 239.0568 -> 4.864564E-46  Inexact Rounded
+powx3016 power 4.784378  475.0521 -> 8.964460E+322 Inexact Rounded
+powx3017 power 4.610305  563.1791 -> 6.290298E+373 Inexact Rounded
+powx3018 power 0.0175167 80.52208 -> 3.623472E-142 Inexact Rounded
+powx3019 power 5.238307  356.7944 -> 4.011461E+256 Inexact Rounded
+powx3020 power 0.0003527 96.26347 -> 4.377932E-333 Inexact Rounded
+powx3021 power 0.0015155 136.0516 -> 2.57113E-384  Inexact Rounded Underflow Subnormal
+powx3022 power 5.753573  273.2340 -> 4.373184E+207 Inexact Rounded
+powx3023 power 7.778665  332.7917 -> 3.060640E+296 Inexact Rounded
+powx3024 power 1.432479  2046.064 -> 2.325829E+319 Inexact Rounded
+powx3025 power 5.610516  136.4563 -> 1.607502E+102 Inexact Rounded
+powx3026 power 0.0050697 137.4513 -> 3.522315E-316 Inexact Rounded
+powx3027 power 5.678737  85.16253 -> 1.713909E+64  Inexact Rounded
+powx3028 power 0.0816167 236.1973 -> 9.228802E-258 Inexact Rounded
+powx3029 power 0.2602805 562.0157 -> 2.944556E-329 Inexact Rounded
+powx3030 power 0.0080936 24.25367 -> 1.839755E-51  Inexact Rounded
+powx3031 power 4.092016  82.94603 -> 5.724948E+50  Inexact Rounded
+powx3032 power 0.0078255 7.204184 -> 6.675342E-16  Inexact Rounded
+powx3033 power 0.9917693 29846.44 -> 7.430177E-108 Inexact Rounded
+powx3034 power 1.610380  301.2467 -> 2.170142E+62  Inexact Rounded
+powx3035 power 0.0588236 212.1097 -> 1.023196E-261 Inexact Rounded
+powx3036 power 2.498069  531.4647 -> 2.054561E+211 Inexact Rounded
+powx3037 power 9.964342  326.5438 -> 1.089452E+326 Inexact Rounded
+powx3038 power 0.0820626 268.8718 -> 1.107350E-292 Inexact Rounded
+powx3039 power 6.176486  360.7779 -> 1.914449E+285 Inexact Rounded
+powx3040 power 4.206363  16.17288 -> 1.231314E+10  Inexact Rounded
+
+-- P=34, within 0-999 -- negative arg2
+Precision: 34
+powx3701 power 376.0915270000109486633402827007902  -35.69822349904102131649243701958463 -> 1.165722831225506457828653413200143E-92  Inexact Rounded
+powx3702 power 0.0000000503747440074613191665845314 -9.520308341497979093021813571450575 -> 3.000432478861883953977971226770410E+69  Inexact Rounded
+powx3703 power 290.6858731495339778337953407938308  -118.5459048597789693292455673428367 -> 9.357969047113989238392527565200302E-293 Inexact Rounded
+powx3704 power 4.598864607620052062908700928454182  -299.8323667698931125720218537483753 -> 2.069641269855413539579128114448478E-199 Inexact Rounded
+powx3705 power 2.556952676986830645708349254938903  -425.1755373251941383147998924703593 -> 4.428799777833598654260883861514638E-174 Inexact Rounded
+powx3706 power 0.0000005656198763404221986640610118 -32.83361380678301321230028730075315 -> 1.340270622401829145968477601029251E+205 Inexact Rounded
+powx3707 power 012.4841978642452960750801410372125  -214.3734291828712962809866663321921 -> 9.319857751170603140459057535971202E-236 Inexact Rounded
+powx3708 power 0.0000000056041586148066919174315551 -37.21129049213858341528033343116533 -> 1.118345010652454313186702341873169E+307 Inexact Rounded
+powx3709 power 0.0694569218941833767199998804202152 -8.697509072368973932501239815677732 -> 11862866995.51026489032838174290271      Inexact Rounded
+powx3710 power 6.380984024259450398729243522354144  -451.0635696889193561457985486366827 -> 8.800353109387322474809325670314330E-364 Inexact Rounded
+powx3711 power 786.0264840756809048288007204917801  -43.09935384678762773057342161718540 -> 1.616324183365644133979585419925934E-125 Inexact Rounded
+powx3712 power 96.07836427113204744101287948445130  -185.1414572546330024388914720271876 -> 8.586320815218383004023264980018610E-368 Inexact Rounded
+powx3713 power 0.0000000002332189796855870659792406 -5.779561613164628076880609893753327 -> 4.678450775876385793618570483345066E+55  Inexact Rounded
+powx3714 power 0.7254146672024602242369943237968857 -2115.512891397828615710130092245691 -> 8.539080958041689288202111403102495E+294 Inexact Rounded
+powx3715 power 0.0017380543649702864796144008592137 -6.307668017761022788220578633538713 -> 256309141459075651.2275798017695017      Inexact Rounded
+powx3716 power 05.29498758952276908267649116142379  -287.3233896734103442991981056134167 -> 1.039130027847489364009368608104291E-208 Inexact Rounded
+powx3717 power 15.64403593865932622003462779104178  -110.5296633358063267478609032002475 -> 9.750540276026524527375125980296142E-133 Inexact Rounded
+powx3718 power 89.69639006761571087634945077373508  -181.3209914139357665609268339422627 -> 8.335034232277762924539395632025281E-355 Inexact Rounded
+powx3719 power 6.974087483731006359914914110135058  -174.6815625746710345173615508179842 -> 4.553072265122011176641590109568031E-148 Inexact Rounded
+powx3720 power 0.0034393024010554821130553772681993 -93.60931598413919272595497100497364 -> 4.067468855817145539589988349449394E+230 Inexact Rounded
+powx3721 power 63.32834072300379155053737260965633  -168.3926799435088324825751446957616 -> 4.207907835462640471617519501741094E-304 Inexact Rounded
+powx3722 power 00.00216088174206276369011255907785  -70.12279562855442784757874508991013 -> 8.000657143378187029609343435067057E+186 Inexact Rounded
+powx3723 power 934.5957982703545893572134393004375  -102.2287735565878252484031426026726 -> 2.073813769209257617246544424827240E-304 Inexact Rounded
+powx3724 power 107.9116792558793921873995885441177  -44.11941092260869786313838181499158 -> 2.005476533631183268912552168759595E-90  Inexact Rounded
+powx3725 power 0.0000000000188049827381428191769262 -19.32118917192242027966847501724073 -> 1.713174297100918857053338286389034E+207 Inexact Rounded
+powx3726 power 614.9820907366248142166636259027728  -4.069913257030791586645250035698123 -> 4.462432572576935752713876293746717E-12  Inexact Rounded
+powx3727 power 752.0655175769182096165651274049422  -22.59292060348797472013598378334370 -> 1.039881526694635205040192531504131E-65  Inexact Rounded
+powx3728 power 72.20446632047659449616175456059013  -175.4705356401853924020842356605072 -> 7.529540175791582421966947814549028E-327 Inexact Rounded
+powx3729 power 518.8346486600403405764055847937416  -65.87320268592761588756963215588232 -> 1.420189426992170936958891180073151E-179 Inexact Rounded
+powx3730 power 3.457164372003960576453458502270716  -440.3201118177861273814529713443698 -> 6.176418595751201287186292664257369E-238 Inexact Rounded
+powx3731 power 7.908352793344189720739467675503991  -298.6646112894719680394152664740255 -> 5.935857120229147638104675057695125E-269 Inexact Rounded
+powx3732 power 0.0000004297399403788595027926075086 -22.66504617185071293588817501468339 -> 2.012270405520600820469665145636204E+144 Inexact Rounded
+powx3733 power 0.0000008592124097322966354868716443 -9.913109586558030204789520190180906 -> 1.354958763843310237046818832755215E+60  Inexact Rounded
+powx3734 power 161.4806080561258105880907470989925  -70.72907837434814261716311990271578 -> 6.632555003698945544941329872901929E-157 Inexact Rounded
+powx3735 power 0.0000000090669568624173832705631918 -36.53759624613665940127058439106640 -> 7.161808401023414735428130112941559E+293 Inexact Rounded
+powx3736 power 0.0000000000029440295978365709342752 -1.297354238738921988884421117731562 -> 911731060579291.7661267358872917380      Inexact Rounded
+powx3737 power 21.37477220144832172175460425143692  -76.95949933640539226475686997477889 -> 4.481741242418091914011962399912885E-103 Inexact Rounded
+powx3738 power 0.0000000000186657798201636342150903 -20.18296240350678245567049161730909 -> 3.483954007114900406906338526575672E+216 Inexact Rounded
+powx3739 power 0.0006522464792960191985996959126792 -80.03762491483514679886504099194414 -> 9.266548513614215557228467517053035E+254 Inexact Rounded
+powx3740 power 0.0000000032851343694200568966168055 -21.53462116926375512242403160008026 -> 4.873201679668455240861376213601189E+182 Inexact Rounded
+
+-- P=16, within 0-99 -- negative arg2
+Precision: 16
+powx3601 power 0.0000151338748474 -40.84655618364688 -> 7.628470824137755E+196 Inexact Rounded
+powx3602 power 0.1542771848654862 -435.8830009466800 -> 6.389817177800744E+353 Inexact Rounded
+powx3603 power 48.28477749367364  -218.5929209902050 -> 8.531049532576154E-369 Inexact Rounded
+powx3604 power 7.960775891584911  -12.78113732182505 -> 3.053270889769488E-12  Inexact Rounded
+powx3605 power 0.9430340651863058 -9010.470056913748 -> 3.313374654923807E+229 Inexact Rounded
+powx3606 power 0.0000202661501602 -65.57915207383306 -> 5.997379176536464E+307 Inexact Rounded
+powx3607 power 04.33007440798390  -232.0476834666588 -> 2.007827183010456E-148 Inexact Rounded
+powx3608 power 0.0000141944643914 -11.32407921958717 -> 7.902934485074846E+54  Inexact Rounded
+powx3609 power 0.0000021977758261 -53.53706138253307 -> 8.195631772317815E+302 Inexact Rounded
+powx3610 power 39.51297655474188  -19.40370976012326 -> 1.040699608072659E-31  Inexact Rounded
+powx3611 power 38.71210232488775  -66.58341618227921 -> 1.886855066146495E-106 Inexact Rounded
+powx3612 power 0.0000804235229062 -6.715207948992859 -> 3.134757864389333E+27  Inexact Rounded
+powx3613 power 0.0000073547092399 -11.27725685719934 -> 7.781428390953695E+57  Inexact Rounded
+powx3614 power 52.72181272599316  -186.1422311607435 -> 2.916601998744177E-321 Inexact Rounded
+powx3615 power 0.0969519963083306 -280.8220862151369 -> 3.955906885970987E+284 Inexact Rounded
+powx3616 power 94.07263302150081  -148.2031146071230 -> 3.361958990752490E-293 Inexact Rounded
+powx3617 power 85.80286965053704  -90.21453695813759 -> 3.715602429645798E-175 Inexact Rounded
+powx3618 power 03.52699858152259  -492.0414362539196 -> 4.507309220081092E-270 Inexact Rounded
+powx3619 power 0.0508278086396068 -181.0871731572167 -> 2.034428013017949E+234 Inexact Rounded
+powx3620 power 0.395576740303172  -915.5524507432392 -> 5.706585187437578E+368 Inexact Rounded
+powx3621 power 38.06105826789202  -49.75913753435335 -> 2.273188991431738E-79  Inexact Rounded
+powx3622 power 0.0003656748910646 -73.28988491310354 -> 7.768936940568763E+251 Inexact Rounded
+powx3623 power 0.0000006373551809 -51.30825234200690 -> 7.697618167701985E+317 Inexact Rounded
+powx3624 power 82.41729920673856  -35.73319631625699 -> 3.424042354585529E-69  Inexact Rounded
+powx3625 power 0.7845821453127670 -971.4982028897663 -> 2.283415527661089E+102 Inexact Rounded
+powx3626 power 4.840983673433497  -182.3730452370515 -> 1.220591407927770E-125 Inexact Rounded
+powx3627 power 0.0000006137592139 -2.122139474431484 -> 15231217034839.29      Inexact Rounded
+powx3628 power 0.0003657962862984 -35.97993782448099 -> 4.512701319250839E+123 Inexact Rounded
+powx3629 power 40.93693004443150  -165.1362408792997 -> 6.044276411057239E-267 Inexact Rounded
+powx3630 power 0.2941552583028898 -17.41046264945892 -> 1787833103.503346      Inexact Rounded
+powx3631 power 63.99335135369977  -69.92417205168579 -> 5.099359804872509E-127 Inexact Rounded
+powx3632 power 0.0000657924467388 -89.14497293588313 -> 6.145878266688521E+372 Inexact Rounded
+powx3633 power 11.35071250339147  -323.3705865614542 -> 6.863626248766775E-342 Inexact Rounded
+powx3634 power 23.88024718470895  -277.7117513329510 -> 2.006441422612815E-383 Inexact Rounded
+powx3635 power 0.0000009111939914 -58.51782946929182 -> 2.954352883996773E+353 Inexact Rounded
+powx3636 power 0.0000878179048782 -75.81060420238669 -> 3.306878455207585E+307 Inexact Rounded
+powx3637 power 07.39190564273779  -287.5047307244636 -> 1.692080354659805E-250 Inexact Rounded
+powx3638 power 0.0000298310819799 -1.844740377759355 -> 222874718.7238888      Inexact Rounded
+powx3639 power 0.0000006412929384 -28.24850078229290 -> 8.737164230666529E+174 Inexact Rounded
+powx3640 power 0.0000010202965998 -47.17573701956498 -> 4.392845306049341E+282 Inexact Rounded
+
+-- P=7, within 0-9 -- negative arg2
+Precision: 7
+powx3501 power 0.326324  -71.96509  -> 1.000673E+35  Inexact Rounded
+powx3502 power 0.0017635 -0.7186967 -> 95.28419      Inexact Rounded
+powx3503 power 8.564155  -253.0899  -> 8.850512E-237 Inexact Rounded
+powx3504 power 8.987272  -2.155789  -> 0.008793859   Inexact Rounded
+powx3505 power 9.604856  -139.9630  -> 3.073492E-138 Inexact Rounded
+powx3506 power 0.8472919 -2539.085  -> 5.372686E+182 Inexact Rounded
+powx3507 power 5.312329  -60.32965  -> 1.753121E-44  Inexact Rounded
+powx3508 power 0.0338294 -100.5440  -> 7.423939E+147 Inexact Rounded
+powx3509 power 0.0017777 -130.8583  -> 7.565629E+359 Inexact Rounded
+powx3510 power 8.016154  -405.5689  -> 2.395977E-367 Inexact Rounded
+powx3511 power 5.016570  -327.8906  -> 2.203784E-230 Inexact Rounded
+powx3512 power 0.8161743 -744.5276  -> 4.786899E+65  Inexact Rounded
+powx3513 power 0.0666343 -164.7320  -> 5.951240E+193 Inexact Rounded
+powx3514 power 0.0803966 -202.2666  -> 2.715512E+221 Inexact Rounded
+powx3515 power 0.0014752 -12.55547  -> 3.518905E+35  Inexact Rounded
+powx3516 power 9.737565  -14.69615  -> 2.975672E-15  Inexact Rounded
+powx3517 power 0.6634172 -152.7308  -> 1.654458E+27  Inexact Rounded
+powx3518 power 0.0009337 -33.32939  -> 9.575039E+100 Inexact Rounded
+powx3519 power 8.679922  -224.4194  -> 2.392446E-211 Inexact Rounded
+powx3520 power 7.390494  -161.9483  -> 2.088375E-141 Inexact Rounded
+powx3521 power 0.4631489 -417.1673  -> 2.821106E+139 Inexact Rounded
+powx3522 power 0.0095471 -7.677458  -> 3.231855E+15  Inexact Rounded
+powx3523 power 6.566339  -176.1867  -> 9.965633E-145 Inexact Rounded
+powx3524 power 2.696128  -26.15501  -> 5.419731E-12  Inexact Rounded
+powx3525 power 0.4464366 -852.1893  -> 2.957725E+298 Inexact Rounded
+powx3526 power 0.4772006 -921.4111  -> 1.118105E+296 Inexact Rounded
+powx3527 power 8.923696  -359.2211  -> 3.501573E-342 Inexact Rounded
+powx3528 power 0.0018008 -66.91252  -> 4.402718E+183 Inexact Rounded
+powx3529 power 0.0811964 -92.83278  -> 1.701111E+101 Inexact Rounded
+powx3530 power 0.0711219 -58.94347  -> 4.644148E+67  Inexact Rounded
+powx3531 power 7.958121  -50.66123  -> 2.311161E-46  Inexact Rounded
+powx3532 power 6.106466  -81.83610  -> 4.943285E-65  Inexact Rounded
+powx3533 power 4.557634  -129.5268  -> 4.737917E-86  Inexact Rounded
+powx3534 power 0.0027348 -9.180135  -> 3.383524E+23  Inexact Rounded
+powx3535 power 0.0083924 -46.24016  -> 9.996212E+95  Inexact Rounded
+powx3536 power 2.138523  -47.25897  -> 2.507009E-16  Inexact Rounded
+powx3537 power 1.626728  -1573.830  -> 2.668117E-333 Inexact Rounded
+powx3538 power 0.082615  -164.5842  -> 1.717882E+178 Inexact Rounded
+powx3539 power 7.636003  -363.6763  -> 8.366174E-322 Inexact Rounded
+powx3540 power 0.0021481 -138.0065  -> 1.562505E+368 Inexact Rounded
+
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+powx4001  power 1 1.1 ->  NaN         Invalid_context
+precision:  99999999
+powx4002  power 1 1.1 ->  NaN         Invalid_context
+
+precision: 9
+maxExponent:   1000000
+minExponent:   -999999
+powx4003  power 1 1.1  ->  NaN        Invalid_context
+maxExponent:    999999
+minExponent:   -999999
+powx4004  power 1 1.1  ->  1.00000000 Inexact Rounded
+maxExponent:    999999
+minExponent:  -1000000
+powx4005  power 1 1.1  ->  NaN        Invalid_context
+maxExponent:    999999
+minExponent:   -999998
+powx4006  power 1 1.1  ->  1.00000000 Inexact Rounded
+
+-- operand range violations
+powx4007  power 1             1.1E+999999  ->  1
+powx4008  power 1             1.1E+1000000 ->  NaN Invalid_operation
+powx4009  power 1.1E+999999   1.1          ->  Infinity Overflow Inexact Rounded
+powx4010  power 1.1E+1000000  1.1          ->  NaN Invalid_operation
+powx4011  power 1             1.1E-1999997 ->  1.00000000 Inexact Rounded
+powx4012  power 1             1.1E-1999998 ->  NaN Invalid_operation
+powx4013  power 1.1E-1999997  1.1          ->  0E-1000006 Underflow Inexact Rounded Clamped Subnormal
+powx4014  power 1.1E-1999998  1.1          ->  NaN Invalid_operation
+
+-- rounding modes -- power is sensitive
+precision:   7
+maxExponent: 99
+minExponent: -99
+
+--   0.7  ** 3.3 =>   0.30819354053418943822
+--   0.7  ** 3.4 =>   0.29739477638272533854
+--  -1.2  ** 17  => -22.18611106740436992
+--  -1.3  ** 17  => -86.50415919381337933
+--   0.5  ** 11  =>   0.00048828125
+--   3.15 ** 3   =>  31.255875
+
+rounding: up
+powx4100  power      0.7  3.3 ->  0.3081936 Inexact Rounded
+powx4101  power      0.7  3.4 ->  0.2973948 Inexact Rounded
+powx4102  power     -1.2  17  -> -22.18612  Inexact Rounded
+powx4103  power     -1.3  17  -> -86.50416  Inexact Rounded
+powx4104  power  17 81.27115  -> 9.999974E+99 Inexact Rounded
+powx4105  power  17 81.27116  -> Infinity     Overflow Inexact Rounded
+
+rounding: down
+powx4120  power      0.7  3.3 ->  0.3081935 Inexact Rounded
+powx4121  power      0.7  3.4 ->  0.2973947 Inexact Rounded
+powx4122  power     -1.2  17  -> -22.18611  Inexact Rounded
+powx4123  power     -1.3  17  -> -86.50415  Inexact Rounded
+powx4124  power  17 81.27115  -> 9.999973E+99 Inexact Rounded
+powx4125  power  17 81.27116  -> 9.999999E+99 Overflow Inexact Rounded
+
+rounding: floor
+powx4140  power      0.7  3.3 ->  0.3081935 Inexact Rounded
+powx4141  power      0.7  3.4 ->  0.2973947 Inexact Rounded
+powx4142  power     -1.2  17  -> -22.18612  Inexact Rounded
+powx4143  power     -1.3  17  -> -86.50416  Inexact Rounded
+powx4144  power  17 81.27115  -> 9.999973E+99 Inexact Rounded
+powx4145  power  17 81.27116  -> 9.999999E+99 Overflow Inexact Rounded
+
+rounding: ceiling
+powx4160  power      0.7  3.3 ->  0.3081936 Inexact Rounded
+powx4161  power      0.7  3.4 ->  0.2973948 Inexact Rounded
+powx4162  power     -1.2  17  -> -22.18611  Inexact Rounded
+powx4163  power     -1.3  17  -> -86.50415  Inexact Rounded
+powx4164  power  17 81.27115  -> 9.999974E+99 Inexact Rounded
+powx4165  power  17 81.27116  -> Infinity     Overflow Inexact Rounded
+
+rounding: half_up
+powx4180  power      0.7  3.3 ->  0.3081935 Inexact Rounded
+powx4181  power      0.7  3.4 ->  0.2973948 Inexact Rounded
+powx4182  power     -1.2  17  -> -22.18611  Inexact Rounded
+powx4183  power     -1.3  17  -> -86.50416  Inexact Rounded
+powx4184  power      0.5  11  ->  0.0004882813 Inexact Rounded
+powx4185  power      3.15  3  ->  31.25588  Inexact Rounded
+powx4186  power  17 81.27115  -> 9.999974E+99 Inexact Rounded
+powx4187  power  17 81.27116  -> Infinity     Overflow Inexact Rounded
+
+rounding: half_even
+powx4200  power      0.7  3.3 ->  0.3081935 Inexact Rounded
+powx4201  power      0.7  3.4 ->  0.2973948 Inexact Rounded
+powx4202  power     -1.2  17  -> -22.18611  Inexact Rounded
+powx4203  power     -1.3  17  -> -86.50416  Inexact Rounded
+powx4204  power      0.5  11  ->  0.0004882812 Inexact Rounded
+powx4205  power      3.15  3  ->  31.25588  Inexact Rounded
+powx4206  power  17 81.27115  -> 9.999974E+99 Inexact Rounded
+powx4207  power  17 81.27116  -> Infinity     Overflow Inexact Rounded
+
+rounding: half_down
+powx4220  power      0.7  3.3 ->  0.3081935 Inexact Rounded
+powx4221  power      0.7  3.4 ->  0.2973948 Inexact Rounded
+powx4222  power     -1.2  17  -> -22.18611  Inexact Rounded
+powx4223  power     -1.3  17  -> -86.50416  Inexact Rounded
+powx4224  power      0.5  11  ->  0.0004882812 Inexact Rounded
+powx4225  power      3.15  3  ->  31.25587  Inexact Rounded
+powx4226  power     -3.15  3  -> -31.25587  Inexact Rounded
+powx4227  power  17 81.27115  -> 9.999974E+99 Inexact Rounded
+powx4228  power  17 81.27116  -> Infinity     Overflow Inexact Rounded
+
+
+-- more rounding tests as per Ilan Nehama's suggestions & analysis
+-- these are likely to show > 0.5 ulp error for very small powers
+precision:   7
+maxExponent: 96
+minExponent: -95
+
+-- For x=nextfp(1)=1.00..001 (where the number of 0s is precision-2)
+--   power(x,y)=x when the rounding is up (e.g., toward_pos_inf or
+--   ceil) for any y in (0,1].
+rounding: ceiling
+powx4301  power  1.000001 0          -> 1
+-- The next test should be skipped for decNumber
+powx4302  power  1.000001 1e-101     -> 1.000001   Inexact Rounded
+-- The next test should be skipped for decNumber
+powx4303  power  1.000001 1e-95      -> 1.000001   Inexact Rounded
+powx4304  power  1.000001 1e-10      -> 1.000001   Inexact Rounded
+powx4305  power  1.000001 0.1        -> 1.000001   Inexact Rounded
+powx4306  power  1.000001 0.1234567  -> 1.000001   Inexact Rounded
+powx4307  power  1.000001 0.7        -> 1.000001   Inexact Rounded
+powx4308  power  1.000001 0.9999999  -> 1.000001   Inexact Rounded
+powx4309  power  1.000001 1.000000   -> 1.000001
+--   power(x,y)=1 when the rounding is down (e.g. toward_zero or
+--   floor) for any y in [0,1).
+rounding: floor
+powx4321  power  1.000001 0          -> 1
+powx4322  power  1.000001 1e-101     -> 1.000000   Inexact Rounded
+powx4323  power  1.000001 1e-95      -> 1.000000   Inexact Rounded
+powx4324  power  1.000001 1e-10      -> 1.000000   Inexact Rounded
+powx4325  power  1.000001 0.1        -> 1.000000   Inexact Rounded
+powx4326  power  1.000001 0.1234567  -> 1.000000   Inexact Rounded
+powx4327  power  1.000001 0.7        -> 1.000000   Inexact Rounded
+powx4328  power  1.000001 0.9999999  -> 1.000000   Inexact Rounded
+powx4329  power  1.000001 1.000000   -> 1.000001
+
+-- For x=prevfp(1)=0.99..99 (where the number of 9s is precision)
+--   power(x,y)=x when the rounding is down for any y in (0,1].
+rounding: floor
+powx4341  power  0.9999999 0          -> 1
+-- The next test should be skipped for decNumber
+powx4342  power  0.9999999 1e-101     -> 0.9999999   Inexact Rounded
+-- The next test should be skipped for decNumber
+powx4343  power  0.9999999 1e-95      -> 0.9999999   Inexact Rounded
+powx4344  power  0.9999999 1e-10      -> 0.9999999   Inexact Rounded
+powx4345  power  0.9999999 0.1        -> 0.9999999   Inexact Rounded
+powx4346  power  0.9999999 0.1234567  -> 0.9999999   Inexact Rounded
+powx4347  power  0.9999999 0.7        -> 0.9999999   Inexact Rounded
+powx4348  power  0.9999999 0.9999999  -> 0.9999999   Inexact Rounded
+powx4349  power  0.9999999 1.000000   -> 0.9999999
+--   power(x,y)=1 when the rounding is up for any y in (0,1].
+rounding: ceiling
+powx4361  power  0.9999999 0          -> 1
+powx4362  power  0.9999999 1e-101     -> 1.000000    Inexact Rounded
+powx4363  power  0.9999999 1e-95      -> 1.000000    Inexact Rounded
+powx4364  power  0.9999999 1e-10      -> 1.000000    Inexact Rounded
+powx4365  power  0.9999999 0.1        -> 1.000000    Inexact Rounded
+powx4366  power  0.9999999 0.1234567  -> 1.000000    Inexact Rounded
+powx4367  power  0.9999999 0.7        -> 1.000000    Inexact Rounded
+powx4368  power  0.9999999 0.9999999  -> 1.000000    Inexact Rounded
+powx4369  power  0.9999999 1.000000   -> 0.9999999
+
+-- For x=nextfp(0)
+--   power(x,y)=0 when the rounding is down for any y larger than 1.
+rounding: floor
+powx4382  power  1e-101    0          -> 1
+powx4383  power  1e-101    0.9999999  -> 1E-101 Underflow Subnormal Inexact Rounded
+powx4384  power  1e-101    1.000000   -> 1E-101 Subnormal
+powx4385  power  1e-101    1.000001   -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+powx4386  power  1e-101    2.000000   -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
diff --git a/Lib/test/decimaltestdata/powersqrt.decTest b/Lib/test/decimaltestdata/powersqrt.decTest
new file mode 100644 (file)
index 0000000..36e5cbb
--- /dev/null
@@ -0,0 +1,2970 @@
+------------------------------------------------------------------------\r
+-- powersqrt.decTest -- decimal square root, using power              --\r
+-- Copyright (c) IBM Corporation, 2004, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- These testcases are taken from squareroot.decTest but are\r
+-- evaluated using the power operator.  The differences in results\r
+-- (153 out of 2856) fall into the following categories:\r
+--\r
+--    x    ** 0.5 (x>0) has no preferred exponent, and is Inexact\r
+--                (and hence full precision); almost all differences are\r
+--                in this category\r
+--    0.00 ** 0.5 becomes 0 (not 0.0), etc.\r
+--   -0    ** 0.5 becomes 0 (never -0)\r
+--    Some exact subnormals become inexact and hence underflows\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_even\r
+maxExponent: 384\r
+minexponent: -383\r
+\r
+-- basics\r
+pwsx001  power 1        0.5 -> 1.00000000 Inexact Rounded\r
+pwsx002  power -1       0.5 -> NaN Invalid_operation\r
+pwsx003  power 1.00     0.5 -> 1.00000000 Inexact Rounded\r
+pwsx004  power -1.00    0.5 -> NaN Invalid_operation\r
+pwsx005  power 0        0.5 -> 0\r
+pwsx006  power 00.0     0.5 -> 0\r
+pwsx007  power 0.00     0.5 -> 0\r
+pwsx008  power 00.00    0.5 -> 0\r
+pwsx009  power 00.000   0.5 -> 0\r
+pwsx010  power 00.0000  0.5 -> 0\r
+pwsx011  power 00       0.5 -> 0\r
+\r
+pwsx012  power -2       0.5 -> NaN Invalid_operation\r
+pwsx013  power 2        0.5 -> 1.41421356 Inexact Rounded\r
+pwsx014  power -2.00    0.5 -> NaN Invalid_operation\r
+pwsx015  power 2.00     0.5 -> 1.41421356 Inexact Rounded\r
+pwsx016  power -0       0.5 -> 0\r
+pwsx017  power -0.0     0.5 -> 0\r
+pwsx018  power -00.00   0.5 -> 0\r
+pwsx019  power -00.000  0.5 -> 0\r
+pwsx020  power -0.0000  0.5 -> 0\r
+pwsx021  power -0E+9    0.5 -> 0\r
+pwsx022  power -0E+10   0.5 -> 0\r
+pwsx023  power -0E+11   0.5 -> 0\r
+pwsx024  power -0E+12   0.5 -> 0\r
+pwsx025  power -00      0.5 -> 0\r
+pwsx026  power 0E+5     0.5 -> 0\r
+pwsx027  power 4.0      0.5 -> 2.00000000 Inexact Rounded\r
+pwsx028  power 4.00     0.5 -> 2.00000000 Inexact Rounded\r
+\r
+pwsx030  power +0.1             0.5 -> 0.316227766 Inexact Rounded\r
+pwsx031  power -0.1             0.5 -> NaN Invalid_operation\r
+pwsx032  power +0.01            0.5 -> 0.100000000 Inexact Rounded\r
+pwsx033  power -0.01            0.5 -> NaN Invalid_operation\r
+pwsx034  power +0.001           0.5 -> 0.0316227766 Inexact Rounded\r
+pwsx035  power -0.001           0.5 -> NaN Invalid_operation\r
+pwsx036  power +0.000001        0.5 -> 0.00100000000 Inexact Rounded\r
+pwsx037  power -0.000001        0.5 -> NaN Invalid_operation\r
+pwsx038  power +0.000000000001  0.5 -> 0.00000100000000 Inexact Rounded\r
+pwsx039  power -0.000000000001  0.5 -> NaN Invalid_operation\r
+\r
+pwsx041  power 1.1         0.5 -> 1.04880885 Inexact Rounded\r
+pwsx042  power 1.10        0.5 -> 1.04880885 Inexact Rounded\r
+pwsx043  power 1.100       0.5 -> 1.04880885 Inexact Rounded\r
+pwsx044  power 1.110       0.5 -> 1.05356538 Inexact Rounded\r
+pwsx045  power -1.1        0.5 -> NaN Invalid_operation\r
+pwsx046  power -1.10       0.5 -> NaN Invalid_operation\r
+pwsx047  power -1.100      0.5 -> NaN Invalid_operation\r
+pwsx048  power -1.110      0.5 -> NaN Invalid_operation\r
+pwsx049  power 9.9         0.5 -> 3.14642654 Inexact Rounded\r
+pwsx050  power 9.90        0.5 -> 3.14642654 Inexact Rounded\r
+pwsx051  power 9.900       0.5 -> 3.14642654 Inexact Rounded\r
+pwsx052  power 9.990       0.5 -> 3.16069613 Inexact Rounded\r
+pwsx053  power -9.9        0.5 -> NaN Invalid_operation\r
+pwsx054  power -9.90       0.5 -> NaN Invalid_operation\r
+pwsx055  power -9.900      0.5 -> NaN Invalid_operation\r
+pwsx056  power -9.990      0.5 -> NaN Invalid_operation\r
+\r
+pwsx060  power  1            0.5 -> 1.00000000 Inexact Rounded\r
+pwsx061  power  1.0          0.5 -> 1.00000000 Inexact Rounded\r
+pwsx062  power  1.00         0.5 -> 1.00000000 Inexact Rounded\r
+pwsx063  power  10.0         0.5 -> 3.16227766 Inexact Rounded\r
+pwsx064  power  10.0         0.5 -> 3.16227766 Inexact Rounded\r
+pwsx065  power  10.0         0.5 -> 3.16227766 Inexact Rounded\r
+pwsx066  power  10.00        0.5 -> 3.16227766 Inexact Rounded\r
+pwsx067  power  100          0.5 -> 10.0000000 Inexact Rounded\r
+pwsx068  power  100.0        0.5 -> 10.0000000 Inexact Rounded\r
+pwsx069  power  100.00       0.5 -> 10.0000000 Inexact Rounded\r
+pwsx070  power  1.1000E+3    0.5 -> 33.1662479 Inexact Rounded\r
+pwsx071  power  1.10000E+3   0.5 -> 33.1662479 Inexact Rounded\r
+pwsx072  power -10.0         0.5 -> NaN Invalid_operation\r
+pwsx073  power -10.00        0.5 -> NaN Invalid_operation\r
+pwsx074  power -100.0        0.5 -> NaN Invalid_operation\r
+pwsx075  power -100.00       0.5 -> NaN Invalid_operation\r
+pwsx076  power -1.1000E+3    0.5 -> NaN Invalid_operation\r
+pwsx077  power -1.10000E+3   0.5 -> NaN Invalid_operation\r
+\r
+-- famous squares\r
+pwsx080  power     1   0.5 -> 1.00000000 Inexact Rounded\r
+pwsx081  power     4   0.5 -> 2.00000000 Inexact Rounded\r
+pwsx082  power     9   0.5 -> 3.00000000 Inexact Rounded\r
+pwsx083  power    16   0.5 -> 4.00000000 Inexact Rounded\r
+pwsx084  power    25   0.5 -> 5.00000000 Inexact Rounded\r
+pwsx085  power    36   0.5 -> 6.00000000 Inexact Rounded\r
+pwsx086  power    49   0.5 -> 7.00000000 Inexact Rounded\r
+pwsx087  power    64   0.5 -> 8.00000000 Inexact Rounded\r
+pwsx088  power    81   0.5 -> 9.00000000 Inexact Rounded\r
+pwsx089  power   100   0.5 -> 10.0000000 Inexact Rounded\r
+pwsx090  power   121   0.5 -> 11.0000000 Inexact Rounded\r
+pwsx091  power   144   0.5 -> 12.0000000 Inexact Rounded\r
+pwsx092  power   169   0.5 -> 13.0000000 Inexact Rounded\r
+pwsx093  power   256   0.5 -> 16.0000000 Inexact Rounded\r
+pwsx094  power  1024   0.5 -> 32.0000000 Inexact Rounded\r
+pwsx095  power  4096   0.5 -> 64.0000000 Inexact Rounded\r
+pwsx100  power   0.01  0.5 -> 0.100000000 Inexact Rounded\r
+pwsx101  power   0.04  0.5 -> 0.200000000 Inexact Rounded\r
+pwsx102  power   0.09  0.5 -> 0.300000000 Inexact Rounded\r
+pwsx103  power   0.16  0.5 -> 0.400000000 Inexact Rounded\r
+pwsx104  power   0.25  0.5 -> 0.500000000 Inexact Rounded\r
+pwsx105  power   0.36  0.5 -> 0.600000000 Inexact Rounded\r
+pwsx106  power   0.49  0.5 -> 0.700000000 Inexact Rounded\r
+pwsx107  power   0.64  0.5 -> 0.800000000 Inexact Rounded\r
+pwsx108  power   0.81  0.5 -> 0.900000000 Inexact Rounded\r
+pwsx109  power   1.00  0.5 -> 1.00000000 Inexact Rounded\r
+pwsx110  power   1.21  0.5 -> 1.10000000 Inexact Rounded\r
+pwsx111  power   1.44  0.5 -> 1.20000000 Inexact Rounded\r
+pwsx112  power   1.69  0.5 -> 1.30000000 Inexact Rounded\r
+pwsx113  power   2.56  0.5 -> 1.60000000 Inexact Rounded\r
+pwsx114  power  10.24  0.5 -> 3.20000000 Inexact Rounded\r
+pwsx115  power  40.96  0.5 -> 6.40000000 Inexact Rounded\r
+\r
+-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts]\r
+rounding:    half_even\r
+maxExponent: 999\r
+minexponent: -999\r
+precision:   1\r
+pwsx1201  power 0.1  0.5 -> 0.3  Inexact Rounded\r
+pwsx1202  power 0.01  0.5 -> 0.1 Inexact Rounded\r
+pwsx1203  power 1.0E-1  0.5 -> 0.3  Inexact Rounded\r
+pwsx1204  power 1.00E-2  0.5 -> 0.1  Inexact Rounded\r
+pwsx1205  power 1E-3  0.5 -> 0.03  Inexact Rounded\r
+pwsx1206  power 1E+1  0.5 -> 3  Inexact Rounded\r
+pwsx1207  power 1E+2  0.5 -> 1E+1 Inexact Rounded\r
+pwsx1208  power 1E+3  0.5 -> 3E+1  Inexact Rounded\r
+pwsx1209  power 0.2  0.5 -> 0.4  Inexact Rounded\r
+pwsx1210  power 0.02  0.5 -> 0.1  Inexact Rounded\r
+pwsx1211  power 2.0E-1  0.5 -> 0.4  Inexact Rounded\r
+pwsx1212  power 2.00E-2  0.5 -> 0.1  Inexact Rounded\r
+pwsx1213  power 2E-3  0.5 -> 0.04  Inexact Rounded\r
+pwsx1214  power 2E+1  0.5 -> 4  Inexact Rounded\r
+pwsx1215  power 2E+2  0.5 -> 1E+1  Inexact Rounded\r
+pwsx1216  power 2E+3  0.5 -> 4E+1  Inexact Rounded\r
+pwsx1217  power 0.3  0.5 -> 0.5  Inexact Rounded\r
+pwsx1218  power 0.03  0.5 -> 0.2  Inexact Rounded\r
+pwsx1219  power 3.0E-1  0.5 -> 0.5  Inexact Rounded\r
+pwsx1220  power 3.00E-2  0.5 -> 0.2  Inexact Rounded\r
+pwsx1221  power 3E-3  0.5 -> 0.05  Inexact Rounded\r
+pwsx1222  power 3E+1  0.5 -> 5  Inexact Rounded\r
+pwsx1223  power 3E+2  0.5 -> 2E+1  Inexact Rounded\r
+pwsx1224  power 3E+3  0.5 -> 5E+1  Inexact Rounded\r
+pwsx1225  power 0.4  0.5 -> 0.6  Inexact Rounded\r
+pwsx1226  power 0.04  0.5 -> 0.2 Inexact Rounded\r
+pwsx1227  power 4.0E-1  0.5 -> 0.6  Inexact Rounded\r
+pwsx1228  power 4.00E-2  0.5 -> 0.2  Inexact Rounded\r
+pwsx1229  power 4E-3  0.5 -> 0.06  Inexact Rounded\r
+pwsx1230  power 4E+1  0.5 -> 6  Inexact Rounded\r
+pwsx1231  power 4E+2  0.5 -> 2E+1 Inexact Rounded\r
+pwsx1232  power 4E+3  0.5 -> 6E+1  Inexact Rounded\r
+pwsx1233  power 0.5  0.5 -> 0.7  Inexact Rounded\r
+pwsx1234  power 0.05  0.5 -> 0.2  Inexact Rounded\r
+pwsx1235  power 5.0E-1  0.5 -> 0.7  Inexact Rounded\r
+pwsx1236  power 5.00E-2  0.5 -> 0.2  Inexact Rounded\r
+pwsx1237  power 5E-3  0.5 -> 0.07  Inexact Rounded\r
+pwsx1238  power 5E+1  0.5 -> 7  Inexact Rounded\r
+pwsx1239  power 5E+2  0.5 -> 2E+1  Inexact Rounded\r
+pwsx1240  power 5E+3  0.5 -> 7E+1  Inexact Rounded\r
+pwsx1241  power 0.6  0.5 -> 0.8  Inexact Rounded\r
+pwsx1242  power 0.06  0.5 -> 0.2  Inexact Rounded\r
+pwsx1243  power 6.0E-1  0.5 -> 0.8  Inexact Rounded\r
+pwsx1244  power 6.00E-2  0.5 -> 0.2  Inexact Rounded\r
+pwsx1245  power 6E-3  0.5 -> 0.08  Inexact Rounded\r
+pwsx1246  power 6E+1  0.5 -> 8  Inexact Rounded\r
+pwsx1247  power 6E+2  0.5 -> 2E+1  Inexact Rounded\r
+pwsx1248  power 6E+3  0.5 -> 8E+1  Inexact Rounded\r
+pwsx1249  power 0.7  0.5 -> 0.8  Inexact Rounded\r
+pwsx1250  power 0.07  0.5 -> 0.3  Inexact Rounded\r
+pwsx1251  power 7.0E-1  0.5 -> 0.8  Inexact Rounded\r
+pwsx1252  power 7.00E-2  0.5 -> 0.3  Inexact Rounded\r
+pwsx1253  power 7E-3  0.5 -> 0.08  Inexact Rounded\r
+pwsx1254  power 7E+1  0.5 -> 8  Inexact Rounded\r
+pwsx1255  power 7E+2  0.5 -> 3E+1  Inexact Rounded\r
+pwsx1256  power 7E+3  0.5 -> 8E+1  Inexact Rounded\r
+pwsx1257  power 0.8  0.5 -> 0.9  Inexact Rounded\r
+pwsx1258  power 0.08  0.5 -> 0.3  Inexact Rounded\r
+pwsx1259  power 8.0E-1  0.5 -> 0.9  Inexact Rounded\r
+pwsx1260  power 8.00E-2  0.5 -> 0.3  Inexact Rounded\r
+pwsx1261  power 8E-3  0.5 -> 0.09  Inexact Rounded\r
+pwsx1262  power 8E+1  0.5 -> 9  Inexact Rounded\r
+pwsx1263  power 8E+2  0.5 -> 3E+1  Inexact Rounded\r
+pwsx1264  power 8E+3  0.5 -> 9E+1  Inexact Rounded\r
+pwsx1265  power 0.9  0.5 -> 0.9  Inexact Rounded\r
+pwsx1266  power 0.09  0.5 -> 0.3 Inexact Rounded\r
+pwsx1267  power 9.0E-1  0.5 -> 0.9  Inexact Rounded\r
+pwsx1268  power 9.00E-2  0.5 -> 0.3  Inexact Rounded\r
+pwsx1269  power 9E-3  0.5 -> 0.09  Inexact Rounded\r
+pwsx1270  power 9E+1  0.5 -> 9  Inexact Rounded\r
+pwsx1271  power 9E+2  0.5 -> 3E+1 Inexact Rounded\r
+pwsx1272  power 9E+3  0.5 -> 9E+1  Inexact Rounded\r
+\r
+-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts]\r
+rounding:    half_even\r
+maxExponent: 999\r
+minexponent: -999\r
+precision:   2\r
+pwsx2201  power 0.1  0.5 -> 0.32  Inexact Rounded\r
+pwsx2202  power 0.01  0.5 -> 0.10 Inexact Rounded\r
+pwsx2203  power 1.0E-1  0.5 -> 0.32  Inexact Rounded\r
+pwsx2204  power 1.00E-2  0.5 -> 0.10 Inexact Rounded\r
+pwsx2205  power 1E-3  0.5 -> 0.032  Inexact Rounded\r
+pwsx2206  power 1E+1  0.5 -> 3.2  Inexact Rounded\r
+pwsx2207  power 1E+2  0.5 -> 10 Inexact Rounded\r
+pwsx2208  power 1E+3  0.5 -> 32  Inexact Rounded\r
+pwsx2209  power 0.2  0.5 -> 0.45  Inexact Rounded\r
+pwsx2210  power 0.02  0.5 -> 0.14  Inexact Rounded\r
+pwsx2211  power 2.0E-1  0.5 -> 0.45  Inexact Rounded\r
+pwsx2212  power 2.00E-2  0.5 -> 0.14  Inexact Rounded\r
+pwsx2213  power 2E-3  0.5 -> 0.045  Inexact Rounded\r
+pwsx2214  power 2E+1  0.5 -> 4.5  Inexact Rounded\r
+pwsx2215  power 2E+2  0.5 -> 14  Inexact Rounded\r
+pwsx2216  power 2E+3  0.5 -> 45  Inexact Rounded\r
+pwsx2217  power 0.3  0.5 -> 0.55  Inexact Rounded\r
+pwsx2218  power 0.03  0.5 -> 0.17  Inexact Rounded\r
+pwsx2219  power 3.0E-1  0.5 -> 0.55  Inexact Rounded\r
+pwsx2220  power 3.00E-2  0.5 -> 0.17  Inexact Rounded\r
+pwsx2221  power 3E-3  0.5 -> 0.055  Inexact Rounded\r
+pwsx2222  power 3E+1  0.5 -> 5.5  Inexact Rounded\r
+pwsx2223  power 3E+2  0.5 -> 17  Inexact Rounded\r
+pwsx2224  power 3E+3  0.5 -> 55  Inexact Rounded\r
+pwsx2225  power 0.4  0.5 -> 0.63  Inexact Rounded\r
+pwsx2226  power 0.04  0.5 -> 0.20 Inexact Rounded\r
+pwsx2227  power 4.0E-1  0.5 -> 0.63  Inexact Rounded\r
+pwsx2228  power 4.00E-2  0.5 -> 0.20 Inexact Rounded\r
+pwsx2229  power 4E-3  0.5 -> 0.063  Inexact Rounded\r
+pwsx2230  power 4E+1  0.5 -> 6.3  Inexact Rounded\r
+pwsx2231  power 4E+2  0.5 -> 20 Inexact Rounded\r
+pwsx2232  power 4E+3  0.5 -> 63  Inexact Rounded\r
+pwsx2233  power 0.5  0.5 -> 0.71  Inexact Rounded\r
+pwsx2234  power 0.05  0.5 -> 0.22  Inexact Rounded\r
+pwsx2235  power 5.0E-1  0.5 -> 0.71  Inexact Rounded\r
+pwsx2236  power 5.00E-2  0.5 -> 0.22  Inexact Rounded\r
+pwsx2237  power 5E-3  0.5 -> 0.071  Inexact Rounded\r
+pwsx2238  power 5E+1  0.5 -> 7.1  Inexact Rounded\r
+pwsx2239  power 5E+2  0.5 -> 22  Inexact Rounded\r
+pwsx2240  power 5E+3  0.5 -> 71  Inexact Rounded\r
+pwsx2241  power 0.6  0.5 -> 0.77  Inexact Rounded\r
+pwsx2242  power 0.06  0.5 -> 0.24  Inexact Rounded\r
+pwsx2243  power 6.0E-1  0.5 -> 0.77  Inexact Rounded\r
+pwsx2244  power 6.00E-2  0.5 -> 0.24  Inexact Rounded\r
+pwsx2245  power 6E-3  0.5 -> 0.077  Inexact Rounded\r
+pwsx2246  power 6E+1  0.5 -> 7.7  Inexact Rounded\r
+pwsx2247  power 6E+2  0.5 -> 24  Inexact Rounded\r
+pwsx2248  power 6E+3  0.5 -> 77  Inexact Rounded\r
+pwsx2249  power 0.7  0.5 -> 0.84  Inexact Rounded\r
+pwsx2250  power 0.07  0.5 -> 0.26  Inexact Rounded\r
+pwsx2251  power 7.0E-1  0.5 -> 0.84  Inexact Rounded\r
+pwsx2252  power 7.00E-2  0.5 -> 0.26  Inexact Rounded\r
+pwsx2253  power 7E-3  0.5 -> 0.084  Inexact Rounded\r
+pwsx2254  power 7E+1  0.5 -> 8.4  Inexact Rounded\r
+pwsx2255  power 7E+2  0.5 -> 26  Inexact Rounded\r
+pwsx2256  power 7E+3  0.5 -> 84  Inexact Rounded\r
+pwsx2257  power 0.8  0.5 -> 0.89  Inexact Rounded\r
+pwsx2258  power 0.08  0.5 -> 0.28  Inexact Rounded\r
+pwsx2259  power 8.0E-1  0.5 -> 0.89  Inexact Rounded\r
+pwsx2260  power 8.00E-2  0.5 -> 0.28  Inexact Rounded\r
+pwsx2261  power 8E-3  0.5 -> 0.089  Inexact Rounded\r
+pwsx2262  power 8E+1  0.5 -> 8.9  Inexact Rounded\r
+pwsx2263  power 8E+2  0.5 -> 28  Inexact Rounded\r
+pwsx2264  power 8E+3  0.5 -> 89  Inexact Rounded\r
+pwsx2265  power 0.9  0.5 -> 0.95  Inexact Rounded\r
+pwsx2266  power 0.09  0.5 -> 0.30  Inexact Rounded\r
+pwsx2267  power 9.0E-1  0.5 -> 0.95  Inexact Rounded\r
+pwsx2268  power 9.00E-2  0.5 -> 0.30 Inexact Rounded\r
+pwsx2269  power 9E-3  0.5 -> 0.095  Inexact Rounded\r
+pwsx2270  power 9E+1  0.5 -> 9.5  Inexact Rounded\r
+pwsx2271  power 9E+2  0.5 -> 30 Inexact Rounded\r
+pwsx2272  power 9E+3  0.5 -> 95  Inexact Rounded\r
+pwsx2273  power 0.10  0.5 -> 0.32  Inexact Rounded\r
+pwsx2274  power 0.010  0.5 -> 0.10 Inexact Rounded\r
+pwsx2275  power 10.0E-1  0.5 -> 1.0 Inexact Rounded\r
+pwsx2276  power 10.00E-2  0.5 -> 0.32  Inexact Rounded\r
+pwsx2277  power 10E-3  0.5 -> 0.10 Inexact Rounded\r
+pwsx2278  power 10E+1  0.5 -> 10 Inexact Rounded\r
+pwsx2279  power 10E+2  0.5 -> 32  Inexact Rounded\r
+pwsx2280  power 10E+3  0.5 -> 1.0E+2 Inexact Rounded\r
+pwsx2281  power 0.11  0.5 -> 0.33  Inexact Rounded\r
+pwsx2282  power 0.011  0.5 -> 0.10  Inexact Rounded\r
+pwsx2283  power 11.0E-1  0.5 -> 1.0  Inexact Rounded\r
+pwsx2284  power 11.00E-2  0.5 -> 0.33  Inexact Rounded\r
+pwsx2285  power 11E-3  0.5 -> 0.10  Inexact Rounded\r
+pwsx2286  power 11E+1  0.5 -> 10  Inexact Rounded\r
+pwsx2287  power 11E+2  0.5 -> 33  Inexact Rounded\r
+pwsx2288  power 11E+3  0.5 -> 1.0E+2  Inexact Rounded\r
+pwsx2289  power 0.12  0.5 -> 0.35  Inexact Rounded\r
+pwsx2290  power 0.012  0.5 -> 0.11  Inexact Rounded\r
+pwsx2291  power 12.0E-1  0.5 -> 1.1  Inexact Rounded\r
+pwsx2292  power 12.00E-2  0.5 -> 0.35  Inexact Rounded\r
+pwsx2293  power 12E-3  0.5 -> 0.11  Inexact Rounded\r
+pwsx2294  power 12E+1  0.5 -> 11  Inexact Rounded\r
+pwsx2295  power 12E+2  0.5 -> 35  Inexact Rounded\r
+pwsx2296  power 12E+3  0.5 -> 1.1E+2  Inexact Rounded\r
+pwsx2297  power 0.13  0.5 -> 0.36  Inexact Rounded\r
+pwsx2298  power 0.013  0.5 -> 0.11  Inexact Rounded\r
+pwsx2299  power 13.0E-1  0.5 -> 1.1  Inexact Rounded\r
+pwsx2300  power 13.00E-2  0.5 -> 0.36  Inexact Rounded\r
+pwsx2301  power 13E-3  0.5 -> 0.11  Inexact Rounded\r
+pwsx2302  power 13E+1  0.5 -> 11  Inexact Rounded\r
+pwsx2303  power 13E+2  0.5 -> 36  Inexact Rounded\r
+pwsx2304  power 13E+3  0.5 -> 1.1E+2  Inexact Rounded\r
+pwsx2305  power 0.14  0.5 -> 0.37  Inexact Rounded\r
+pwsx2306  power 0.014  0.5 -> 0.12  Inexact Rounded\r
+pwsx2307  power 14.0E-1  0.5 -> 1.2  Inexact Rounded\r
+pwsx2308  power 14.00E-2  0.5 -> 0.37  Inexact Rounded\r
+pwsx2309  power 14E-3  0.5 -> 0.12  Inexact Rounded\r
+pwsx2310  power 14E+1  0.5 -> 12  Inexact Rounded\r
+pwsx2311  power 14E+2  0.5 -> 37  Inexact Rounded\r
+pwsx2312  power 14E+3  0.5 -> 1.2E+2  Inexact Rounded\r
+pwsx2313  power 0.15  0.5 -> 0.39  Inexact Rounded\r
+pwsx2314  power 0.015  0.5 -> 0.12  Inexact Rounded\r
+pwsx2315  power 15.0E-1  0.5 -> 1.2  Inexact Rounded\r
+pwsx2316  power 15.00E-2  0.5 -> 0.39  Inexact Rounded\r
+pwsx2317  power 15E-3  0.5 -> 0.12  Inexact Rounded\r
+pwsx2318  power 15E+1  0.5 -> 12  Inexact Rounded\r
+pwsx2319  power 15E+2  0.5 -> 39  Inexact Rounded\r
+pwsx2320  power 15E+3  0.5 -> 1.2E+2  Inexact Rounded\r
+pwsx2321  power 0.16  0.5 -> 0.40 Inexact Rounded\r
+pwsx2322  power 0.016  0.5 -> 0.13  Inexact Rounded\r
+pwsx2323  power 16.0E-1  0.5 -> 1.3  Inexact Rounded\r
+pwsx2324  power 16.00E-2  0.5 -> 0.40 Inexact Rounded\r
+pwsx2325  power 16E-3  0.5 -> 0.13  Inexact Rounded\r
+pwsx2326  power 16E+1  0.5 -> 13  Inexact Rounded\r
+pwsx2327  power 16E+2  0.5 -> 40 Inexact Rounded\r
+pwsx2328  power 16E+3  0.5 -> 1.3E+2  Inexact Rounded\r
+pwsx2329  power 0.17  0.5 -> 0.41  Inexact Rounded\r
+pwsx2330  power 0.017  0.5 -> 0.13  Inexact Rounded\r
+pwsx2331  power 17.0E-1  0.5 -> 1.3  Inexact Rounded\r
+pwsx2332  power 17.00E-2  0.5 -> 0.41  Inexact Rounded\r
+pwsx2333  power 17E-3  0.5 -> 0.13  Inexact Rounded\r
+pwsx2334  power 17E+1  0.5 -> 13  Inexact Rounded\r
+pwsx2335  power 17E+2  0.5 -> 41  Inexact Rounded\r
+pwsx2336  power 17E+3  0.5 -> 1.3E+2  Inexact Rounded\r
+pwsx2337  power 0.18  0.5 -> 0.42  Inexact Rounded\r
+pwsx2338  power 0.018  0.5 -> 0.13  Inexact Rounded\r
+pwsx2339  power 18.0E-1  0.5 -> 1.3  Inexact Rounded\r
+pwsx2340  power 18.00E-2  0.5 -> 0.42  Inexact Rounded\r
+pwsx2341  power 18E-3  0.5 -> 0.13  Inexact Rounded\r
+pwsx2342  power 18E+1  0.5 -> 13  Inexact Rounded\r
+pwsx2343  power 18E+2  0.5 -> 42  Inexact Rounded\r
+pwsx2344  power 18E+3  0.5 -> 1.3E+2  Inexact Rounded\r
+pwsx2345  power 0.19  0.5 -> 0.44  Inexact Rounded\r
+pwsx2346  power 0.019  0.5 -> 0.14  Inexact Rounded\r
+pwsx2347  power 19.0E-1  0.5 -> 1.4  Inexact Rounded\r
+pwsx2348  power 19.00E-2  0.5 -> 0.44  Inexact Rounded\r
+pwsx2349  power 19E-3  0.5 -> 0.14  Inexact Rounded\r
+pwsx2350  power 19E+1  0.5 -> 14  Inexact Rounded\r
+pwsx2351  power 19E+2  0.5 -> 44  Inexact Rounded\r
+pwsx2352  power 19E+3  0.5 -> 1.4E+2  Inexact Rounded\r
+pwsx2353  power 0.20  0.5 -> 0.45  Inexact Rounded\r
+pwsx2354  power 0.020  0.5 -> 0.14  Inexact Rounded\r
+pwsx2355  power 20.0E-1  0.5 -> 1.4  Inexact Rounded\r
+pwsx2356  power 20.00E-2  0.5 -> 0.45  Inexact Rounded\r
+pwsx2357  power 20E-3  0.5 -> 0.14  Inexact Rounded\r
+pwsx2358  power 20E+1  0.5 -> 14  Inexact Rounded\r
+pwsx2359  power 20E+2  0.5 -> 45  Inexact Rounded\r
+pwsx2360  power 20E+3  0.5 -> 1.4E+2  Inexact Rounded\r
+pwsx2361  power 0.21  0.5 -> 0.46  Inexact Rounded\r
+pwsx2362  power 0.021  0.5 -> 0.14  Inexact Rounded\r
+pwsx2363  power 21.0E-1  0.5 -> 1.4  Inexact Rounded\r
+pwsx2364  power 21.00E-2  0.5 -> 0.46  Inexact Rounded\r
+pwsx2365  power 21E-3  0.5 -> 0.14  Inexact Rounded\r
+pwsx2366  power 21E+1  0.5 -> 14  Inexact Rounded\r
+pwsx2367  power 21E+2  0.5 -> 46  Inexact Rounded\r
+pwsx2368  power 21E+3  0.5 -> 1.4E+2  Inexact Rounded\r
+pwsx2369  power 0.22  0.5 -> 0.47  Inexact Rounded\r
+pwsx2370  power 0.022  0.5 -> 0.15  Inexact Rounded\r
+pwsx2371  power 22.0E-1  0.5 -> 1.5  Inexact Rounded\r
+pwsx2372  power 22.00E-2  0.5 -> 0.47  Inexact Rounded\r
+pwsx2373  power 22E-3  0.5 -> 0.15  Inexact Rounded\r
+pwsx2374  power 22E+1  0.5 -> 15  Inexact Rounded\r
+pwsx2375  power 22E+2  0.5 -> 47  Inexact Rounded\r
+pwsx2376  power 22E+3  0.5 -> 1.5E+2  Inexact Rounded\r
+pwsx2377  power 0.23  0.5 -> 0.48  Inexact Rounded\r
+pwsx2378  power 0.023  0.5 -> 0.15  Inexact Rounded\r
+pwsx2379  power 23.0E-1  0.5 -> 1.5  Inexact Rounded\r
+pwsx2380  power 23.00E-2  0.5 -> 0.48  Inexact Rounded\r
+pwsx2381  power 23E-3  0.5 -> 0.15  Inexact Rounded\r
+pwsx2382  power 23E+1  0.5 -> 15  Inexact Rounded\r
+pwsx2383  power 23E+2  0.5 -> 48  Inexact Rounded\r
+pwsx2384  power 23E+3  0.5 -> 1.5E+2  Inexact Rounded\r
+pwsx2385  power 0.24  0.5 -> 0.49  Inexact Rounded\r
+pwsx2386  power 0.024  0.5 -> 0.15  Inexact Rounded\r
+pwsx2387  power 24.0E-1  0.5 -> 1.5  Inexact Rounded\r
+pwsx2388  power 24.00E-2  0.5 -> 0.49  Inexact Rounded\r
+pwsx2389  power 24E-3  0.5 -> 0.15  Inexact Rounded\r
+pwsx2390  power 24E+1  0.5 -> 15  Inexact Rounded\r
+pwsx2391  power 24E+2  0.5 -> 49  Inexact Rounded\r
+pwsx2392  power 24E+3  0.5 -> 1.5E+2  Inexact Rounded\r
+pwsx2393  power 0.25  0.5 -> 0.50 Inexact Rounded\r
+pwsx2394  power 0.025  0.5 -> 0.16  Inexact Rounded\r
+pwsx2395  power 25.0E-1  0.5 -> 1.6  Inexact Rounded\r
+pwsx2396  power 25.00E-2  0.5 -> 0.50 Inexact Rounded\r
+pwsx2397  power 25E-3  0.5 -> 0.16  Inexact Rounded\r
+pwsx2398  power 25E+1  0.5 -> 16  Inexact Rounded\r
+pwsx2399  power 25E+2  0.5 -> 50 Inexact Rounded\r
+pwsx2400  power 25E+3  0.5 -> 1.6E+2  Inexact Rounded\r
+pwsx2401  power 0.26  0.5 -> 0.51  Inexact Rounded\r
+pwsx2402  power 0.026  0.5 -> 0.16  Inexact Rounded\r
+pwsx2403  power 26.0E-1  0.5 -> 1.6  Inexact Rounded\r
+pwsx2404  power 26.00E-2  0.5 -> 0.51  Inexact Rounded\r
+pwsx2405  power 26E-3  0.5 -> 0.16  Inexact Rounded\r
+pwsx2406  power 26E+1  0.5 -> 16  Inexact Rounded\r
+pwsx2407  power 26E+2  0.5 -> 51  Inexact Rounded\r
+pwsx2408  power 26E+3  0.5 -> 1.6E+2  Inexact Rounded\r
+pwsx2409  power 0.27  0.5 -> 0.52  Inexact Rounded\r
+pwsx2410  power 0.027  0.5 -> 0.16  Inexact Rounded\r
+pwsx2411  power 27.0E-1  0.5 -> 1.6  Inexact Rounded\r
+pwsx2412  power 27.00E-2  0.5 -> 0.52  Inexact Rounded\r
+pwsx2413  power 27E-3  0.5 -> 0.16  Inexact Rounded\r
+pwsx2414  power 27E+1  0.5 -> 16  Inexact Rounded\r
+pwsx2415  power 27E+2  0.5 -> 52  Inexact Rounded\r
+pwsx2416  power 27E+3  0.5 -> 1.6E+2  Inexact Rounded\r
+pwsx2417  power 0.28  0.5 -> 0.53  Inexact Rounded\r
+pwsx2418  power 0.028  0.5 -> 0.17  Inexact Rounded\r
+pwsx2419  power 28.0E-1  0.5 -> 1.7  Inexact Rounded\r
+pwsx2420  power 28.00E-2  0.5 -> 0.53  Inexact Rounded\r
+pwsx2421  power 28E-3  0.5 -> 0.17  Inexact Rounded\r
+pwsx2422  power 28E+1  0.5 -> 17  Inexact Rounded\r
+pwsx2423  power 28E+2  0.5 -> 53  Inexact Rounded\r
+pwsx2424  power 28E+3  0.5 -> 1.7E+2  Inexact Rounded\r
+pwsx2425  power 0.29  0.5 -> 0.54  Inexact Rounded\r
+pwsx2426  power 0.029  0.5 -> 0.17  Inexact Rounded\r
+pwsx2427  power 29.0E-1  0.5 -> 1.7  Inexact Rounded\r
+pwsx2428  power 29.00E-2  0.5 -> 0.54  Inexact Rounded\r
+pwsx2429  power 29E-3  0.5 -> 0.17  Inexact Rounded\r
+pwsx2430  power 29E+1  0.5 -> 17  Inexact Rounded\r
+pwsx2431  power 29E+2  0.5 -> 54  Inexact Rounded\r
+pwsx2432  power 29E+3  0.5 -> 1.7E+2  Inexact Rounded\r
+pwsx2433  power 0.30  0.5 -> 0.55  Inexact Rounded\r
+pwsx2434  power 0.030  0.5 -> 0.17  Inexact Rounded\r
+pwsx2435  power 30.0E-1  0.5 -> 1.7  Inexact Rounded\r
+pwsx2436  power 30.00E-2  0.5 -> 0.55  Inexact Rounded\r
+pwsx2437  power 30E-3  0.5 -> 0.17  Inexact Rounded\r
+pwsx2438  power 30E+1  0.5 -> 17  Inexact Rounded\r
+pwsx2439  power 30E+2  0.5 -> 55  Inexact Rounded\r
+pwsx2440  power 30E+3  0.5 -> 1.7E+2  Inexact Rounded\r
+pwsx2441  power 0.31  0.5 -> 0.56  Inexact Rounded\r
+pwsx2442  power 0.031  0.5 -> 0.18  Inexact Rounded\r
+pwsx2443  power 31.0E-1  0.5 -> 1.8  Inexact Rounded\r
+pwsx2444  power 31.00E-2  0.5 -> 0.56  Inexact Rounded\r
+pwsx2445  power 31E-3  0.5 -> 0.18  Inexact Rounded\r
+pwsx2446  power 31E+1  0.5 -> 18  Inexact Rounded\r
+pwsx2447  power 31E+2  0.5 -> 56  Inexact Rounded\r
+pwsx2448  power 31E+3  0.5 -> 1.8E+2  Inexact Rounded\r
+pwsx2449  power 0.32  0.5 -> 0.57  Inexact Rounded\r
+pwsx2450  power 0.032  0.5 -> 0.18  Inexact Rounded\r
+pwsx2451  power 32.0E-1  0.5 -> 1.8  Inexact Rounded\r
+pwsx2452  power 32.00E-2  0.5 -> 0.57  Inexact Rounded\r
+pwsx2453  power 32E-3  0.5 -> 0.18  Inexact Rounded\r
+pwsx2454  power 32E+1  0.5 -> 18  Inexact Rounded\r
+pwsx2455  power 32E+2  0.5 -> 57  Inexact Rounded\r
+pwsx2456  power 32E+3  0.5 -> 1.8E+2  Inexact Rounded\r
+pwsx2457  power 0.33  0.5 -> 0.57  Inexact Rounded\r
+pwsx2458  power 0.033  0.5 -> 0.18  Inexact Rounded\r
+pwsx2459  power 33.0E-1  0.5 -> 1.8  Inexact Rounded\r
+pwsx2460  power 33.00E-2  0.5 -> 0.57  Inexact Rounded\r
+pwsx2461  power 33E-3  0.5 -> 0.18  Inexact Rounded\r
+pwsx2462  power 33E+1  0.5 -> 18  Inexact Rounded\r
+pwsx2463  power 33E+2  0.5 -> 57  Inexact Rounded\r
+pwsx2464  power 33E+3  0.5 -> 1.8E+2  Inexact Rounded\r
+pwsx2465  power 0.34  0.5 -> 0.58  Inexact Rounded\r
+pwsx2466  power 0.034  0.5 -> 0.18  Inexact Rounded\r
+pwsx2467  power 34.0E-1  0.5 -> 1.8  Inexact Rounded\r
+pwsx2468  power 34.00E-2  0.5 -> 0.58  Inexact Rounded\r
+pwsx2469  power 34E-3  0.5 -> 0.18  Inexact Rounded\r
+pwsx2470  power 34E+1  0.5 -> 18  Inexact Rounded\r
+pwsx2471  power 34E+2  0.5 -> 58  Inexact Rounded\r
+pwsx2472  power 34E+3  0.5 -> 1.8E+2  Inexact Rounded\r
+pwsx2473  power 0.35  0.5 -> 0.59  Inexact Rounded\r
+pwsx2474  power 0.035  0.5 -> 0.19  Inexact Rounded\r
+pwsx2475  power 35.0E-1  0.5 -> 1.9  Inexact Rounded\r
+pwsx2476  power 35.00E-2  0.5 -> 0.59  Inexact Rounded\r
+pwsx2477  power 35E-3  0.5 -> 0.19  Inexact Rounded\r
+pwsx2478  power 35E+1  0.5 -> 19  Inexact Rounded\r
+pwsx2479  power 35E+2  0.5 -> 59  Inexact Rounded\r
+pwsx2480  power 35E+3  0.5 -> 1.9E+2  Inexact Rounded\r
+pwsx2481  power 0.36  0.5 -> 0.60 Inexact Rounded\r
+pwsx2482  power 0.036  0.5 -> 0.19  Inexact Rounded\r
+pwsx2483  power 36.0E-1  0.5 -> 1.9  Inexact Rounded\r
+pwsx2484  power 36.00E-2  0.5 -> 0.60 Inexact Rounded\r
+pwsx2485  power 36E-3  0.5 -> 0.19  Inexact Rounded\r
+pwsx2486  power 36E+1  0.5 -> 19  Inexact Rounded\r
+pwsx2487  power 36E+2  0.5 -> 60 Inexact Rounded\r
+pwsx2488  power 36E+3  0.5 -> 1.9E+2  Inexact Rounded\r
+pwsx2489  power 0.37  0.5 -> 0.61  Inexact Rounded\r
+pwsx2490  power 0.037  0.5 -> 0.19  Inexact Rounded\r
+pwsx2491  power 37.0E-1  0.5 -> 1.9  Inexact Rounded\r
+pwsx2492  power 37.00E-2  0.5 -> 0.61  Inexact Rounded\r
+pwsx2493  power 37E-3  0.5 -> 0.19  Inexact Rounded\r
+pwsx2494  power 37E+1  0.5 -> 19  Inexact Rounded\r
+pwsx2495  power 37E+2  0.5 -> 61  Inexact Rounded\r
+pwsx2496  power 37E+3  0.5 -> 1.9E+2  Inexact Rounded\r
+pwsx2497  power 0.38  0.5 -> 0.62  Inexact Rounded\r
+pwsx2498  power 0.038  0.5 -> 0.19  Inexact Rounded\r
+pwsx2499  power 38.0E-1  0.5 -> 1.9  Inexact Rounded\r
+pwsx2500  power 38.00E-2  0.5 -> 0.62  Inexact Rounded\r
+pwsx2501  power 38E-3  0.5 -> 0.19  Inexact Rounded\r
+pwsx2502  power 38E+1  0.5 -> 19  Inexact Rounded\r
+pwsx2503  power 38E+2  0.5 -> 62  Inexact Rounded\r
+pwsx2504  power 38E+3  0.5 -> 1.9E+2  Inexact Rounded\r
+pwsx2505  power 0.39  0.5 -> 0.62  Inexact Rounded\r
+pwsx2506  power 0.039  0.5 -> 0.20  Inexact Rounded\r
+pwsx2507  power 39.0E-1  0.5 -> 2.0  Inexact Rounded\r
+pwsx2508  power 39.00E-2  0.5 -> 0.62  Inexact Rounded\r
+pwsx2509  power 39E-3  0.5 -> 0.20  Inexact Rounded\r
+pwsx2510  power 39E+1  0.5 -> 20  Inexact Rounded\r
+pwsx2511  power 39E+2  0.5 -> 62  Inexact Rounded\r
+pwsx2512  power 39E+3  0.5 -> 2.0E+2  Inexact Rounded\r
+pwsx2513  power 0.40  0.5 -> 0.63  Inexact Rounded\r
+pwsx2514  power 0.040  0.5 -> 0.20 Inexact Rounded\r
+pwsx2515  power 40.0E-1  0.5 -> 2.0 Inexact Rounded\r
+pwsx2516  power 40.00E-2  0.5 -> 0.63  Inexact Rounded\r
+pwsx2517  power 40E-3  0.5 -> 0.20 Inexact Rounded\r
+pwsx2518  power 40E+1  0.5 -> 20 Inexact Rounded\r
+pwsx2519  power 40E+2  0.5 -> 63  Inexact Rounded\r
+pwsx2520  power 40E+3  0.5 -> 2.0E+2 Inexact Rounded\r
+pwsx2521  power 0.41  0.5 -> 0.64  Inexact Rounded\r
+pwsx2522  power 0.041  0.5 -> 0.20  Inexact Rounded\r
+pwsx2523  power 41.0E-1  0.5 -> 2.0  Inexact Rounded\r
+pwsx2524  power 41.00E-2  0.5 -> 0.64  Inexact Rounded\r
+pwsx2525  power 41E-3  0.5 -> 0.20  Inexact Rounded\r
+pwsx2526  power 41E+1  0.5 -> 20  Inexact Rounded\r
+pwsx2527  power 41E+2  0.5 -> 64  Inexact Rounded\r
+pwsx2528  power 41E+3  0.5 -> 2.0E+2  Inexact Rounded\r
+pwsx2529  power 0.42  0.5 -> 0.65  Inexact Rounded\r
+pwsx2530  power 0.042  0.5 -> 0.20  Inexact Rounded\r
+pwsx2531  power 42.0E-1  0.5 -> 2.0  Inexact Rounded\r
+pwsx2532  power 42.00E-2  0.5 -> 0.65  Inexact Rounded\r
+pwsx2533  power 42E-3  0.5 -> 0.20  Inexact Rounded\r
+pwsx2534  power 42E+1  0.5 -> 20  Inexact Rounded\r
+pwsx2535  power 42E+2  0.5 -> 65  Inexact Rounded\r
+pwsx2536  power 42E+3  0.5 -> 2.0E+2  Inexact Rounded\r
+pwsx2537  power 0.43  0.5 -> 0.66  Inexact Rounded\r
+pwsx2538  power 0.043  0.5 -> 0.21  Inexact Rounded\r
+pwsx2539  power 43.0E-1  0.5 -> 2.1  Inexact Rounded\r
+pwsx2540  power 43.00E-2  0.5 -> 0.66  Inexact Rounded\r
+pwsx2541  power 43E-3  0.5 -> 0.21  Inexact Rounded\r
+pwsx2542  power 43E+1  0.5 -> 21  Inexact Rounded\r
+pwsx2543  power 43E+2  0.5 -> 66  Inexact Rounded\r
+pwsx2544  power 43E+3  0.5 -> 2.1E+2  Inexact Rounded\r
+pwsx2545  power 0.44  0.5 -> 0.66  Inexact Rounded\r
+pwsx2546  power 0.044  0.5 -> 0.21  Inexact Rounded\r
+pwsx2547  power 44.0E-1  0.5 -> 2.1  Inexact Rounded\r
+pwsx2548  power 44.00E-2  0.5 -> 0.66  Inexact Rounded\r
+pwsx2549  power 44E-3  0.5 -> 0.21  Inexact Rounded\r
+pwsx2550  power 44E+1  0.5 -> 21  Inexact Rounded\r
+pwsx2551  power 44E+2  0.5 -> 66  Inexact Rounded\r
+pwsx2552  power 44E+3  0.5 -> 2.1E+2  Inexact Rounded\r
+pwsx2553  power 0.45  0.5 -> 0.67  Inexact Rounded\r
+pwsx2554  power 0.045  0.5 -> 0.21  Inexact Rounded\r
+pwsx2555  power 45.0E-1  0.5 -> 2.1  Inexact Rounded\r
+pwsx2556  power 45.00E-2  0.5 -> 0.67  Inexact Rounded\r
+pwsx2557  power 45E-3  0.5 -> 0.21  Inexact Rounded\r
+pwsx2558  power 45E+1  0.5 -> 21  Inexact Rounded\r
+pwsx2559  power 45E+2  0.5 -> 67  Inexact Rounded\r
+pwsx2560  power 45E+3  0.5 -> 2.1E+2  Inexact Rounded\r
+pwsx2561  power 0.46  0.5 -> 0.68  Inexact Rounded\r
+pwsx2562  power 0.046  0.5 -> 0.21  Inexact Rounded\r
+pwsx2563  power 46.0E-1  0.5 -> 2.1  Inexact Rounded\r
+pwsx2564  power 46.00E-2  0.5 -> 0.68  Inexact Rounded\r
+pwsx2565  power 46E-3  0.5 -> 0.21  Inexact Rounded\r
+pwsx2566  power 46E+1  0.5 -> 21  Inexact Rounded\r
+pwsx2567  power 46E+2  0.5 -> 68  Inexact Rounded\r
+pwsx2568  power 46E+3  0.5 -> 2.1E+2  Inexact Rounded\r
+pwsx2569  power 0.47  0.5 -> 0.69  Inexact Rounded\r
+pwsx2570  power 0.047  0.5 -> 0.22  Inexact Rounded\r
+pwsx2571  power 47.0E-1  0.5 -> 2.2  Inexact Rounded\r
+pwsx2572  power 47.00E-2  0.5 -> 0.69  Inexact Rounded\r
+pwsx2573  power 47E-3  0.5 -> 0.22  Inexact Rounded\r
+pwsx2574  power 47E+1  0.5 -> 22  Inexact Rounded\r
+pwsx2575  power 47E+2  0.5 -> 69  Inexact Rounded\r
+pwsx2576  power 47E+3  0.5 -> 2.2E+2  Inexact Rounded\r
+pwsx2577  power 0.48  0.5 -> 0.69  Inexact Rounded\r
+pwsx2578  power 0.048  0.5 -> 0.22  Inexact Rounded\r
+pwsx2579  power 48.0E-1  0.5 -> 2.2  Inexact Rounded\r
+pwsx2580  power 48.00E-2  0.5 -> 0.69  Inexact Rounded\r
+pwsx2581  power 48E-3  0.5 -> 0.22  Inexact Rounded\r
+pwsx2582  power 48E+1  0.5 -> 22  Inexact Rounded\r
+pwsx2583  power 48E+2  0.5 -> 69  Inexact Rounded\r
+pwsx2584  power 48E+3  0.5 -> 2.2E+2  Inexact Rounded\r
+pwsx2585  power 0.49  0.5 -> 0.70 Inexact Rounded\r
+pwsx2586  power 0.049  0.5 -> 0.22  Inexact Rounded\r
+pwsx2587  power 49.0E-1  0.5 -> 2.2  Inexact Rounded\r
+pwsx2588  power 49.00E-2  0.5 -> 0.70 Inexact Rounded\r
+pwsx2589  power 49E-3  0.5 -> 0.22  Inexact Rounded\r
+pwsx2590  power 49E+1  0.5 -> 22  Inexact Rounded\r
+pwsx2591  power 49E+2  0.5 -> 70 Inexact Rounded\r
+pwsx2592  power 49E+3  0.5 -> 2.2E+2  Inexact Rounded\r
+pwsx2593  power 0.50  0.5 -> 0.71  Inexact Rounded\r
+pwsx2594  power 0.050  0.5 -> 0.22  Inexact Rounded\r
+pwsx2595  power 50.0E-1  0.5 -> 2.2  Inexact Rounded\r
+pwsx2596  power 50.00E-2  0.5 -> 0.71  Inexact Rounded\r
+pwsx2597  power 50E-3  0.5 -> 0.22  Inexact Rounded\r
+pwsx2598  power 50E+1  0.5 -> 22  Inexact Rounded\r
+pwsx2599  power 50E+2  0.5 -> 71  Inexact Rounded\r
+pwsx2600  power 50E+3  0.5 -> 2.2E+2  Inexact Rounded\r
+pwsx2601  power 0.51  0.5 -> 0.71  Inexact Rounded\r
+pwsx2602  power 0.051  0.5 -> 0.23  Inexact Rounded\r
+pwsx2603  power 51.0E-1  0.5 -> 2.3  Inexact Rounded\r
+pwsx2604  power 51.00E-2  0.5 -> 0.71  Inexact Rounded\r
+pwsx2605  power 51E-3  0.5 -> 0.23  Inexact Rounded\r
+pwsx2606  power 51E+1  0.5 -> 23  Inexact Rounded\r
+pwsx2607  power 51E+2  0.5 -> 71  Inexact Rounded\r
+pwsx2608  power 51E+3  0.5 -> 2.3E+2  Inexact Rounded\r
+pwsx2609  power 0.52  0.5 -> 0.72  Inexact Rounded\r
+pwsx2610  power 0.052  0.5 -> 0.23  Inexact Rounded\r
+pwsx2611  power 52.0E-1  0.5 -> 2.3  Inexact Rounded\r
+pwsx2612  power 52.00E-2  0.5 -> 0.72  Inexact Rounded\r
+pwsx2613  power 52E-3  0.5 -> 0.23  Inexact Rounded\r
+pwsx2614  power 52E+1  0.5 -> 23  Inexact Rounded\r
+pwsx2615  power 52E+2  0.5 -> 72  Inexact Rounded\r
+pwsx2616  power 52E+3  0.5 -> 2.3E+2  Inexact Rounded\r
+pwsx2617  power 0.53  0.5 -> 0.73  Inexact Rounded\r
+pwsx2618  power 0.053  0.5 -> 0.23  Inexact Rounded\r
+pwsx2619  power 53.0E-1  0.5 -> 2.3  Inexact Rounded\r
+pwsx2620  power 53.00E-2  0.5 -> 0.73  Inexact Rounded\r
+pwsx2621  power 53E-3  0.5 -> 0.23  Inexact Rounded\r
+pwsx2622  power 53E+1  0.5 -> 23  Inexact Rounded\r
+pwsx2623  power 53E+2  0.5 -> 73  Inexact Rounded\r
+pwsx2624  power 53E+3  0.5 -> 2.3E+2  Inexact Rounded\r
+pwsx2625  power 0.54  0.5 -> 0.73  Inexact Rounded\r
+pwsx2626  power 0.054  0.5 -> 0.23  Inexact Rounded\r
+pwsx2627  power 54.0E-1  0.5 -> 2.3  Inexact Rounded\r
+pwsx2628  power 54.00E-2  0.5 -> 0.73  Inexact Rounded\r
+pwsx2629  power 54E-3  0.5 -> 0.23  Inexact Rounded\r
+pwsx2630  power 54E+1  0.5 -> 23  Inexact Rounded\r
+pwsx2631  power 54E+2  0.5 -> 73  Inexact Rounded\r
+pwsx2632  power 54E+3  0.5 -> 2.3E+2  Inexact Rounded\r
+pwsx2633  power 0.55  0.5 -> 0.74  Inexact Rounded\r
+pwsx2634  power 0.055  0.5 -> 0.23  Inexact Rounded\r
+pwsx2635  power 55.0E-1  0.5 -> 2.3  Inexact Rounded\r
+pwsx2636  power 55.00E-2  0.5 -> 0.74  Inexact Rounded\r
+pwsx2637  power 55E-3  0.5 -> 0.23  Inexact Rounded\r
+pwsx2638  power 55E+1  0.5 -> 23  Inexact Rounded\r
+pwsx2639  power 55E+2  0.5 -> 74  Inexact Rounded\r
+pwsx2640  power 55E+3  0.5 -> 2.3E+2  Inexact Rounded\r
+pwsx2641  power 0.56  0.5 -> 0.75  Inexact Rounded\r
+pwsx2642  power 0.056  0.5 -> 0.24  Inexact Rounded\r
+pwsx2643  power 56.0E-1  0.5 -> 2.4  Inexact Rounded\r
+pwsx2644  power 56.00E-2  0.5 -> 0.75  Inexact Rounded\r
+pwsx2645  power 56E-3  0.5 -> 0.24  Inexact Rounded\r
+pwsx2646  power 56E+1  0.5 -> 24  Inexact Rounded\r
+pwsx2647  power 56E+2  0.5 -> 75  Inexact Rounded\r
+pwsx2648  power 56E+3  0.5 -> 2.4E+2  Inexact Rounded\r
+pwsx2649  power 0.57  0.5 -> 0.75  Inexact Rounded\r
+pwsx2650  power 0.057  0.5 -> 0.24  Inexact Rounded\r
+pwsx2651  power 57.0E-1  0.5 -> 2.4  Inexact Rounded\r
+pwsx2652  power 57.00E-2  0.5 -> 0.75  Inexact Rounded\r
+pwsx2653  power 57E-3  0.5 -> 0.24  Inexact Rounded\r
+pwsx2654  power 57E+1  0.5 -> 24  Inexact Rounded\r
+pwsx2655  power 57E+2  0.5 -> 75  Inexact Rounded\r
+pwsx2656  power 57E+3  0.5 -> 2.4E+2  Inexact Rounded\r
+pwsx2657  power 0.58  0.5 -> 0.76  Inexact Rounded\r
+pwsx2658  power 0.058  0.5 -> 0.24  Inexact Rounded\r
+pwsx2659  power 58.0E-1  0.5 -> 2.4  Inexact Rounded\r
+pwsx2660  power 58.00E-2  0.5 -> 0.76  Inexact Rounded\r
+pwsx2661  power 58E-3  0.5 -> 0.24  Inexact Rounded\r
+pwsx2662  power 58E+1  0.5 -> 24  Inexact Rounded\r
+pwsx2663  power 58E+2  0.5 -> 76  Inexact Rounded\r
+pwsx2664  power 58E+3  0.5 -> 2.4E+2  Inexact Rounded\r
+pwsx2665  power 0.59  0.5 -> 0.77  Inexact Rounded\r
+pwsx2666  power 0.059  0.5 -> 0.24  Inexact Rounded\r
+pwsx2667  power 59.0E-1  0.5 -> 2.4  Inexact Rounded\r
+pwsx2668  power 59.00E-2  0.5 -> 0.77  Inexact Rounded\r
+pwsx2669  power 59E-3  0.5 -> 0.24  Inexact Rounded\r
+pwsx2670  power 59E+1  0.5 -> 24  Inexact Rounded\r
+pwsx2671  power 59E+2  0.5 -> 77  Inexact Rounded\r
+pwsx2672  power 59E+3  0.5 -> 2.4E+2  Inexact Rounded\r
+pwsx2673  power 0.60  0.5 -> 0.77  Inexact Rounded\r
+pwsx2674  power 0.060  0.5 -> 0.24  Inexact Rounded\r
+pwsx2675  power 60.0E-1  0.5 -> 2.4  Inexact Rounded\r
+pwsx2676  power 60.00E-2  0.5 -> 0.77  Inexact Rounded\r
+pwsx2677  power 60E-3  0.5 -> 0.24  Inexact Rounded\r
+pwsx2678  power 60E+1  0.5 -> 24  Inexact Rounded\r
+pwsx2679  power 60E+2  0.5 -> 77  Inexact Rounded\r
+pwsx2680  power 60E+3  0.5 -> 2.4E+2  Inexact Rounded\r
+pwsx2681  power 0.61  0.5 -> 0.78  Inexact Rounded\r
+pwsx2682  power 0.061  0.5 -> 0.25  Inexact Rounded\r
+pwsx2683  power 61.0E-1  0.5 -> 2.5  Inexact Rounded\r
+pwsx2684  power 61.00E-2  0.5 -> 0.78  Inexact Rounded\r
+pwsx2685  power 61E-3  0.5 -> 0.25  Inexact Rounded\r
+pwsx2686  power 61E+1  0.5 -> 25  Inexact Rounded\r
+pwsx2687  power 61E+2  0.5 -> 78  Inexact Rounded\r
+pwsx2688  power 61E+3  0.5 -> 2.5E+2  Inexact Rounded\r
+pwsx2689  power 0.62  0.5 -> 0.79  Inexact Rounded\r
+pwsx2690  power 0.062  0.5 -> 0.25  Inexact Rounded\r
+pwsx2691  power 62.0E-1  0.5 -> 2.5  Inexact Rounded\r
+pwsx2692  power 62.00E-2  0.5 -> 0.79  Inexact Rounded\r
+pwsx2693  power 62E-3  0.5 -> 0.25  Inexact Rounded\r
+pwsx2694  power 62E+1  0.5 -> 25  Inexact Rounded\r
+pwsx2695  power 62E+2  0.5 -> 79  Inexact Rounded\r
+pwsx2696  power 62E+3  0.5 -> 2.5E+2  Inexact Rounded\r
+pwsx2697  power 0.63  0.5 -> 0.79  Inexact Rounded\r
+pwsx2698  power 0.063  0.5 -> 0.25  Inexact Rounded\r
+pwsx2699  power 63.0E-1  0.5 -> 2.5  Inexact Rounded\r
+pwsx2700  power 63.00E-2  0.5 -> 0.79  Inexact Rounded\r
+pwsx2701  power 63E-3  0.5 -> 0.25  Inexact Rounded\r
+pwsx2702  power 63E+1  0.5 -> 25  Inexact Rounded\r
+pwsx2703  power 63E+2  0.5 -> 79  Inexact Rounded\r
+pwsx2704  power 63E+3  0.5 -> 2.5E+2  Inexact Rounded\r
+pwsx2705  power 0.64  0.5 -> 0.80 Inexact Rounded\r
+pwsx2706  power 0.064  0.5 -> 0.25  Inexact Rounded\r
+pwsx2707  power 64.0E-1  0.5 -> 2.5  Inexact Rounded\r
+pwsx2708  power 64.00E-2  0.5 -> 0.80 Inexact Rounded\r
+pwsx2709  power 64E-3  0.5 -> 0.25  Inexact Rounded\r
+pwsx2710  power 64E+1  0.5 -> 25  Inexact Rounded\r
+pwsx2711  power 64E+2  0.5 -> 80 Inexact Rounded\r
+pwsx2712  power 64E+3  0.5 -> 2.5E+2  Inexact Rounded\r
+pwsx2713  power 0.65  0.5 -> 0.81  Inexact Rounded\r
+pwsx2714  power 0.065  0.5 -> 0.25  Inexact Rounded\r
+pwsx2715  power 65.0E-1  0.5 -> 2.5  Inexact Rounded\r
+pwsx2716  power 65.00E-2  0.5 -> 0.81  Inexact Rounded\r
+pwsx2717  power 65E-3  0.5 -> 0.25  Inexact Rounded\r
+pwsx2718  power 65E+1  0.5 -> 25  Inexact Rounded\r
+pwsx2719  power 65E+2  0.5 -> 81  Inexact Rounded\r
+pwsx2720  power 65E+3  0.5 -> 2.5E+2  Inexact Rounded\r
+pwsx2721  power 0.66  0.5 -> 0.81  Inexact Rounded\r
+pwsx2722  power 0.066  0.5 -> 0.26  Inexact Rounded\r
+pwsx2723  power 66.0E-1  0.5 -> 2.6  Inexact Rounded\r
+pwsx2724  power 66.00E-2  0.5 -> 0.81  Inexact Rounded\r
+pwsx2725  power 66E-3  0.5 -> 0.26  Inexact Rounded\r
+pwsx2726  power 66E+1  0.5 -> 26  Inexact Rounded\r
+pwsx2727  power 66E+2  0.5 -> 81  Inexact Rounded\r
+pwsx2728  power 66E+3  0.5 -> 2.6E+2  Inexact Rounded\r
+pwsx2729  power 0.67  0.5 -> 0.82  Inexact Rounded\r
+pwsx2730  power 0.067  0.5 -> 0.26  Inexact Rounded\r
+pwsx2731  power 67.0E-1  0.5 -> 2.6  Inexact Rounded\r
+pwsx2732  power 67.00E-2  0.5 -> 0.82  Inexact Rounded\r
+pwsx2733  power 67E-3  0.5 -> 0.26  Inexact Rounded\r
+pwsx2734  power 67E+1  0.5 -> 26  Inexact Rounded\r
+pwsx2735  power 67E+2  0.5 -> 82  Inexact Rounded\r
+pwsx2736  power 67E+3  0.5 -> 2.6E+2  Inexact Rounded\r
+pwsx2737  power 0.68  0.5 -> 0.82  Inexact Rounded\r
+pwsx2738  power 0.068  0.5 -> 0.26  Inexact Rounded\r
+pwsx2739  power 68.0E-1  0.5 -> 2.6  Inexact Rounded\r
+pwsx2740  power 68.00E-2  0.5 -> 0.82  Inexact Rounded\r
+pwsx2741  power 68E-3  0.5 -> 0.26  Inexact Rounded\r
+pwsx2742  power 68E+1  0.5 -> 26  Inexact Rounded\r
+pwsx2743  power 68E+2  0.5 -> 82  Inexact Rounded\r
+pwsx2744  power 68E+3  0.5 -> 2.6E+2  Inexact Rounded\r
+pwsx2745  power 0.69  0.5 -> 0.83  Inexact Rounded\r
+pwsx2746  power 0.069  0.5 -> 0.26  Inexact Rounded\r
+pwsx2747  power 69.0E-1  0.5 -> 2.6  Inexact Rounded\r
+pwsx2748  power 69.00E-2  0.5 -> 0.83  Inexact Rounded\r
+pwsx2749  power 69E-3  0.5 -> 0.26  Inexact Rounded\r
+pwsx2750  power 69E+1  0.5 -> 26  Inexact Rounded\r
+pwsx2751  power 69E+2  0.5 -> 83  Inexact Rounded\r
+pwsx2752  power 69E+3  0.5 -> 2.6E+2  Inexact Rounded\r
+pwsx2753  power 0.70  0.5 -> 0.84  Inexact Rounded\r
+pwsx2754  power 0.070  0.5 -> 0.26  Inexact Rounded\r
+pwsx2755  power 70.0E-1  0.5 -> 2.6  Inexact Rounded\r
+pwsx2756  power 70.00E-2  0.5 -> 0.84  Inexact Rounded\r
+pwsx2757  power 70E-3  0.5 -> 0.26  Inexact Rounded\r
+pwsx2758  power 70E+1  0.5 -> 26  Inexact Rounded\r
+pwsx2759  power 70E+2  0.5 -> 84  Inexact Rounded\r
+pwsx2760  power 70E+3  0.5 -> 2.6E+2  Inexact Rounded\r
+pwsx2761  power 0.71  0.5 -> 0.84  Inexact Rounded\r
+pwsx2762  power 0.071  0.5 -> 0.27  Inexact Rounded\r
+pwsx2763  power 71.0E-1  0.5 -> 2.7  Inexact Rounded\r
+pwsx2764  power 71.00E-2  0.5 -> 0.84  Inexact Rounded\r
+pwsx2765  power 71E-3  0.5 -> 0.27  Inexact Rounded\r
+pwsx2766  power 71E+1  0.5 -> 27  Inexact Rounded\r
+pwsx2767  power 71E+2  0.5 -> 84  Inexact Rounded\r
+pwsx2768  power 71E+3  0.5 -> 2.7E+2  Inexact Rounded\r
+pwsx2769  power 0.72  0.5 -> 0.85  Inexact Rounded\r
+pwsx2770  power 0.072  0.5 -> 0.27  Inexact Rounded\r
+pwsx2771  power 72.0E-1  0.5 -> 2.7  Inexact Rounded\r
+pwsx2772  power 72.00E-2  0.5 -> 0.85  Inexact Rounded\r
+pwsx2773  power 72E-3  0.5 -> 0.27  Inexact Rounded\r
+pwsx2774  power 72E+1  0.5 -> 27  Inexact Rounded\r
+pwsx2775  power 72E+2  0.5 -> 85  Inexact Rounded\r
+pwsx2776  power 72E+3  0.5 -> 2.7E+2  Inexact Rounded\r
+pwsx2777  power 0.73  0.5 -> 0.85  Inexact Rounded\r
+pwsx2778  power 0.073  0.5 -> 0.27  Inexact Rounded\r
+pwsx2779  power 73.0E-1  0.5 -> 2.7  Inexact Rounded\r
+pwsx2780  power 73.00E-2  0.5 -> 0.85  Inexact Rounded\r
+pwsx2781  power 73E-3  0.5 -> 0.27  Inexact Rounded\r
+pwsx2782  power 73E+1  0.5 -> 27  Inexact Rounded\r
+pwsx2783  power 73E+2  0.5 -> 85  Inexact Rounded\r
+pwsx2784  power 73E+3  0.5 -> 2.7E+2  Inexact Rounded\r
+pwsx2785  power 0.74  0.5 -> 0.86  Inexact Rounded\r
+pwsx2786  power 0.074  0.5 -> 0.27  Inexact Rounded\r
+pwsx2787  power 74.0E-1  0.5 -> 2.7  Inexact Rounded\r
+pwsx2788  power 74.00E-2  0.5 -> 0.86  Inexact Rounded\r
+pwsx2789  power 74E-3  0.5 -> 0.27  Inexact Rounded\r
+pwsx2790  power 74E+1  0.5 -> 27  Inexact Rounded\r
+pwsx2791  power 74E+2  0.5 -> 86  Inexact Rounded\r
+pwsx2792  power 74E+3  0.5 -> 2.7E+2  Inexact Rounded\r
+pwsx2793  power 0.75  0.5 -> 0.87  Inexact Rounded\r
+pwsx2794  power 0.075  0.5 -> 0.27  Inexact Rounded\r
+pwsx2795  power 75.0E-1  0.5 -> 2.7  Inexact Rounded\r
+pwsx2796  power 75.00E-2  0.5 -> 0.87  Inexact Rounded\r
+pwsx2797  power 75E-3  0.5 -> 0.27  Inexact Rounded\r
+pwsx2798  power 75E+1  0.5 -> 27  Inexact Rounded\r
+pwsx2799  power 75E+2  0.5 -> 87  Inexact Rounded\r
+pwsx2800  power 75E+3  0.5 -> 2.7E+2  Inexact Rounded\r
+pwsx2801  power 0.76  0.5 -> 0.87  Inexact Rounded\r
+pwsx2802  power 0.076  0.5 -> 0.28  Inexact Rounded\r
+pwsx2803  power 76.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2804  power 76.00E-2  0.5 -> 0.87  Inexact Rounded\r
+pwsx2805  power 76E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2806  power 76E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2807  power 76E+2  0.5 -> 87  Inexact Rounded\r
+pwsx2808  power 76E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2809  power 0.77  0.5 -> 0.88  Inexact Rounded\r
+pwsx2810  power 0.077  0.5 -> 0.28  Inexact Rounded\r
+pwsx2811  power 77.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2812  power 77.00E-2  0.5 -> 0.88  Inexact Rounded\r
+pwsx2813  power 77E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2814  power 77E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2815  power 77E+2  0.5 -> 88  Inexact Rounded\r
+pwsx2816  power 77E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2817  power 0.78  0.5 -> 0.88  Inexact Rounded\r
+pwsx2818  power 0.078  0.5 -> 0.28  Inexact Rounded\r
+pwsx2819  power 78.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2820  power 78.00E-2  0.5 -> 0.88  Inexact Rounded\r
+pwsx2821  power 78E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2822  power 78E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2823  power 78E+2  0.5 -> 88  Inexact Rounded\r
+pwsx2824  power 78E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2825  power 0.79  0.5 -> 0.89  Inexact Rounded\r
+pwsx2826  power 0.079  0.5 -> 0.28  Inexact Rounded\r
+pwsx2827  power 79.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2828  power 79.00E-2  0.5 -> 0.89  Inexact Rounded\r
+pwsx2829  power 79E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2830  power 79E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2831  power 79E+2  0.5 -> 89  Inexact Rounded\r
+pwsx2832  power 79E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2833  power 0.80  0.5 -> 0.89  Inexact Rounded\r
+pwsx2834  power 0.080  0.5 -> 0.28  Inexact Rounded\r
+pwsx2835  power 80.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2836  power 80.00E-2  0.5 -> 0.89  Inexact Rounded\r
+pwsx2837  power 80E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2838  power 80E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2839  power 80E+2  0.5 -> 89  Inexact Rounded\r
+pwsx2840  power 80E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2841  power 0.81  0.5 -> 0.90 Inexact Rounded\r
+pwsx2842  power 0.081  0.5 -> 0.28  Inexact Rounded\r
+pwsx2843  power 81.0E-1  0.5 -> 2.8  Inexact Rounded\r
+pwsx2844  power 81.00E-2  0.5 -> 0.90 Inexact Rounded\r
+pwsx2845  power 81E-3  0.5 -> 0.28  Inexact Rounded\r
+pwsx2846  power 81E+1  0.5 -> 28  Inexact Rounded\r
+pwsx2847  power 81E+2  0.5 -> 90 Inexact Rounded\r
+pwsx2848  power 81E+3  0.5 -> 2.8E+2  Inexact Rounded\r
+pwsx2849  power 0.82  0.5 -> 0.91  Inexact Rounded\r
+pwsx2850  power 0.082  0.5 -> 0.29  Inexact Rounded\r
+pwsx2851  power 82.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2852  power 82.00E-2  0.5 -> 0.91  Inexact Rounded\r
+pwsx2853  power 82E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2854  power 82E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2855  power 82E+2  0.5 -> 91  Inexact Rounded\r
+pwsx2856  power 82E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2857  power 0.83  0.5 -> 0.91  Inexact Rounded\r
+pwsx2858  power 0.083  0.5 -> 0.29  Inexact Rounded\r
+pwsx2859  power 83.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2860  power 83.00E-2  0.5 -> 0.91  Inexact Rounded\r
+pwsx2861  power 83E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2862  power 83E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2863  power 83E+2  0.5 -> 91  Inexact Rounded\r
+pwsx2864  power 83E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2865  power 0.84  0.5 -> 0.92  Inexact Rounded\r
+pwsx2866  power 0.084  0.5 -> 0.29  Inexact Rounded\r
+pwsx2867  power 84.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2868  power 84.00E-2  0.5 -> 0.92  Inexact Rounded\r
+pwsx2869  power 84E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2870  power 84E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2871  power 84E+2  0.5 -> 92  Inexact Rounded\r
+pwsx2872  power 84E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2873  power 0.85  0.5 -> 0.92  Inexact Rounded\r
+pwsx2874  power 0.085  0.5 -> 0.29  Inexact Rounded\r
+pwsx2875  power 85.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2876  power 85.00E-2  0.5 -> 0.92  Inexact Rounded\r
+pwsx2877  power 85E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2878  power 85E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2879  power 85E+2  0.5 -> 92  Inexact Rounded\r
+pwsx2880  power 85E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2881  power 0.86  0.5 -> 0.93  Inexact Rounded\r
+pwsx2882  power 0.086  0.5 -> 0.29  Inexact Rounded\r
+pwsx2883  power 86.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2884  power 86.00E-2  0.5 -> 0.93  Inexact Rounded\r
+pwsx2885  power 86E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2886  power 86E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2887  power 86E+2  0.5 -> 93  Inexact Rounded\r
+pwsx2888  power 86E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2889  power 0.87  0.5 -> 0.93  Inexact Rounded\r
+pwsx2890  power 0.087  0.5 -> 0.29  Inexact Rounded\r
+pwsx2891  power 87.0E-1  0.5 -> 2.9  Inexact Rounded\r
+pwsx2892  power 87.00E-2  0.5 -> 0.93  Inexact Rounded\r
+pwsx2893  power 87E-3  0.5 -> 0.29  Inexact Rounded\r
+pwsx2894  power 87E+1  0.5 -> 29  Inexact Rounded\r
+pwsx2895  power 87E+2  0.5 -> 93  Inexact Rounded\r
+pwsx2896  power 87E+3  0.5 -> 2.9E+2  Inexact Rounded\r
+pwsx2897  power 0.88  0.5 -> 0.94  Inexact Rounded\r
+pwsx2898  power 0.088  0.5 -> 0.30  Inexact Rounded\r
+pwsx2899  power 88.0E-1  0.5 -> 3.0  Inexact Rounded\r
+pwsx2900  power 88.00E-2  0.5 -> 0.94  Inexact Rounded\r
+pwsx2901  power 88E-3  0.5 -> 0.30  Inexact Rounded\r
+pwsx2902  power 88E+1  0.5 -> 30  Inexact Rounded\r
+pwsx2903  power 88E+2  0.5 -> 94  Inexact Rounded\r
+pwsx2904  power 88E+3  0.5 -> 3.0E+2  Inexact Rounded\r
+pwsx2905  power 0.89  0.5 -> 0.94  Inexact Rounded\r
+pwsx2906  power 0.089  0.5 -> 0.30  Inexact Rounded\r
+pwsx2907  power 89.0E-1  0.5 -> 3.0  Inexact Rounded\r
+pwsx2908  power 89.00E-2  0.5 -> 0.94  Inexact Rounded\r
+pwsx2909  power 89E-3  0.5 -> 0.30  Inexact Rounded\r
+pwsx2910  power 89E+1  0.5 -> 30  Inexact Rounded\r
+pwsx2911  power 89E+2  0.5 -> 94  Inexact Rounded\r
+pwsx2912  power 89E+3  0.5 -> 3.0E+2  Inexact Rounded\r
+pwsx2913  power 0.90  0.5 -> 0.95  Inexact Rounded\r
+pwsx2914  power 0.090  0.5 -> 0.30 Inexact Rounded\r
+pwsx2915  power 90.0E-1  0.5 -> 3.0 Inexact Rounded\r
+pwsx2916  power 90.00E-2  0.5 -> 0.95  Inexact Rounded\r
+pwsx2917  power 90E-3  0.5 -> 0.30 Inexact Rounded\r
+pwsx2918  power 90E+1  0.5 -> 30 Inexact Rounded\r
+pwsx2919  power 90E+2  0.5 -> 95  Inexact Rounded\r
+pwsx2920  power 90E+3  0.5 -> 3.0E+2 Inexact Rounded\r
+pwsx2921  power 0.91  0.5 -> 0.95  Inexact Rounded\r
+pwsx2922  power 0.091  0.5 -> 0.30  Inexact Rounded\r
+pwsx2923  power 91.0E-1  0.5 -> 3.0  Inexact Rounded\r
+pwsx2924  power 91.00E-2  0.5 -> 0.95  Inexact Rounded\r
+pwsx2925  power 91E-3  0.5 -> 0.30  Inexact Rounded\r
+pwsx2926  power 91E+1  0.5 -> 30  Inexact Rounded\r
+pwsx2927  power 91E+2  0.5 -> 95  Inexact Rounded\r
+pwsx2928  power 91E+3  0.5 -> 3.0E+2  Inexact Rounded\r
+pwsx2929  power 0.92  0.5 -> 0.96  Inexact Rounded\r
+pwsx2930  power 0.092  0.5 -> 0.30  Inexact Rounded\r
+pwsx2931  power 92.0E-1  0.5 -> 3.0  Inexact Rounded\r
+pwsx2932  power 92.00E-2  0.5 -> 0.96  Inexact Rounded\r
+pwsx2933  power 92E-3  0.5 -> 0.30  Inexact Rounded\r
+pwsx2934  power 92E+1  0.5 -> 30  Inexact Rounded\r
+pwsx2935  power 92E+2  0.5 -> 96  Inexact Rounded\r
+pwsx2936  power 92E+3  0.5 -> 3.0E+2  Inexact Rounded\r
+pwsx2937  power 0.93  0.5 -> 0.96  Inexact Rounded\r
+pwsx2938  power 0.093  0.5 -> 0.30  Inexact Rounded\r
+pwsx2939  power 93.0E-1  0.5 -> 3.0  Inexact Rounded\r
+pwsx2940  power 93.00E-2  0.5 -> 0.96  Inexact Rounded\r
+pwsx2941  power 93E-3  0.5 -> 0.30  Inexact Rounded\r
+pwsx2942  power 93E+1  0.5 -> 30  Inexact Rounded\r
+pwsx2943  power 93E+2  0.5 -> 96  Inexact Rounded\r
+pwsx2944  power 93E+3  0.5 -> 3.0E+2  Inexact Rounded\r
+pwsx2945  power 0.94  0.5 -> 0.97  Inexact Rounded\r
+pwsx2946  power 0.094  0.5 -> 0.31  Inexact Rounded\r
+pwsx2947  power 94.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2948  power 94.00E-2  0.5 -> 0.97  Inexact Rounded\r
+pwsx2949  power 94E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2950  power 94E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2951  power 94E+2  0.5 -> 97  Inexact Rounded\r
+pwsx2952  power 94E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+pwsx2953  power 0.95  0.5 -> 0.97  Inexact Rounded\r
+pwsx2954  power 0.095  0.5 -> 0.31  Inexact Rounded\r
+pwsx2955  power 95.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2956  power 95.00E-2  0.5 -> 0.97  Inexact Rounded\r
+pwsx2957  power 95E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2958  power 95E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2959  power 95E+2  0.5 -> 97  Inexact Rounded\r
+pwsx2960  power 95E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+pwsx2961  power 0.96  0.5 -> 0.98  Inexact Rounded\r
+pwsx2962  power 0.096  0.5 -> 0.31  Inexact Rounded\r
+pwsx2963  power 96.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2964  power 96.00E-2  0.5 -> 0.98  Inexact Rounded\r
+pwsx2965  power 96E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2966  power 96E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2967  power 96E+2  0.5 -> 98  Inexact Rounded\r
+pwsx2968  power 96E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+pwsx2969  power 0.97  0.5 -> 0.98  Inexact Rounded\r
+pwsx2970  power 0.097  0.5 -> 0.31  Inexact Rounded\r
+pwsx2971  power 97.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2972  power 97.00E-2  0.5 -> 0.98  Inexact Rounded\r
+pwsx2973  power 97E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2974  power 97E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2975  power 97E+2  0.5 -> 98  Inexact Rounded\r
+pwsx2976  power 97E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+pwsx2977  power 0.98  0.5 -> 0.99  Inexact Rounded\r
+pwsx2978  power 0.098  0.5 -> 0.31  Inexact Rounded\r
+pwsx2979  power 98.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2980  power 98.00E-2  0.5 -> 0.99  Inexact Rounded\r
+pwsx2981  power 98E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2982  power 98E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2983  power 98E+2  0.5 -> 99  Inexact Rounded\r
+pwsx2984  power 98E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+pwsx2985  power 0.99  0.5 -> 0.99  Inexact Rounded\r
+pwsx2986  power 0.099  0.5 -> 0.31  Inexact Rounded\r
+pwsx2987  power 99.0E-1  0.5 -> 3.1  Inexact Rounded\r
+pwsx2988  power 99.00E-2  0.5 -> 0.99  Inexact Rounded\r
+pwsx2989  power 99E-3  0.5 -> 0.31  Inexact Rounded\r
+pwsx2990  power 99E+1  0.5 -> 31  Inexact Rounded\r
+pwsx2991  power 99E+2  0.5 -> 99  Inexact Rounded\r
+pwsx2992  power 99E+3  0.5 -> 3.1E+2  Inexact Rounded\r
+\r
+-- Precision 3 squareroot tests [exhaustive, f and f/10]\r
+rounding:    half_even\r
+maxExponent: 999\r
+minexponent: -999\r
+precision:   3\r
+pwsx3001  power 0.1  0.5 -> 0.316  Inexact Rounded\r
+pwsx3002  power 0.01  0.5 -> 0.100  Inexact Rounded\r
+pwsx3003  power 0.2  0.5 -> 0.447  Inexact Rounded\r
+pwsx3004  power 0.02  0.5 -> 0.141  Inexact Rounded\r
+pwsx3005  power 0.3  0.5 -> 0.548  Inexact Rounded\r
+pwsx3006  power 0.03  0.5 -> 0.173  Inexact Rounded\r
+pwsx3007  power 0.4  0.5 -> 0.632  Inexact Rounded\r
+pwsx3008  power 0.04  0.5 -> 0.200  Inexact Rounded\r
+pwsx3009  power 0.5  0.5 -> 0.707  Inexact Rounded\r
+pwsx3010  power 0.05  0.5 -> 0.224  Inexact Rounded\r
+pwsx3011  power 0.6  0.5 -> 0.775  Inexact Rounded\r
+pwsx3012  power 0.06  0.5 -> 0.245  Inexact Rounded\r
+pwsx3013  power 0.7  0.5 -> 0.837  Inexact Rounded\r
+pwsx3014  power 0.07  0.5 -> 0.265  Inexact Rounded\r
+pwsx3015  power 0.8  0.5 -> 0.894  Inexact Rounded\r
+pwsx3016  power 0.08  0.5 -> 0.283  Inexact Rounded\r
+pwsx3017  power 0.9  0.5 -> 0.949  Inexact Rounded\r
+pwsx3018  power 0.09  0.5 -> 0.300  Inexact Rounded\r
+pwsx3019  power 0.11  0.5 -> 0.332  Inexact Rounded\r
+pwsx3020  power 0.011  0.5 -> 0.105  Inexact Rounded\r
+pwsx3021  power 0.12  0.5 -> 0.346  Inexact Rounded\r
+pwsx3022  power 0.012  0.5 -> 0.110  Inexact Rounded\r
+pwsx3023  power 0.13  0.5 -> 0.361  Inexact Rounded\r
+pwsx3024  power 0.013  0.5 -> 0.114  Inexact Rounded\r
+pwsx3025  power 0.14  0.5 -> 0.374  Inexact Rounded\r
+pwsx3026  power 0.014  0.5 -> 0.118  Inexact Rounded\r
+pwsx3027  power 0.15  0.5 -> 0.387  Inexact Rounded\r
+pwsx3028  power 0.015  0.5 -> 0.122  Inexact Rounded\r
+pwsx3029  power 0.16  0.5 -> 0.400  Inexact Rounded\r
+pwsx3030  power 0.016  0.5 -> 0.126  Inexact Rounded\r
+pwsx3031  power 0.17  0.5 -> 0.412  Inexact Rounded\r
+pwsx3032  power 0.017  0.5 -> 0.130  Inexact Rounded\r
+pwsx3033  power 0.18  0.5 -> 0.424  Inexact Rounded\r
+pwsx3034  power 0.018  0.5 -> 0.134  Inexact Rounded\r
+pwsx3035  power 0.19  0.5 -> 0.436  Inexact Rounded\r
+pwsx3036  power 0.019  0.5 -> 0.138  Inexact Rounded\r
+pwsx3037  power 0.21  0.5 -> 0.458  Inexact Rounded\r
+pwsx3038  power 0.021  0.5 -> 0.145  Inexact Rounded\r
+pwsx3039  power 0.22  0.5 -> 0.469  Inexact Rounded\r
+pwsx3040  power 0.022  0.5 -> 0.148  Inexact Rounded\r
+pwsx3041  power 0.23  0.5 -> 0.480  Inexact Rounded\r
+pwsx3042  power 0.023  0.5 -> 0.152  Inexact Rounded\r
+pwsx3043  power 0.24  0.5 -> 0.490  Inexact Rounded\r
+pwsx3044  power 0.024  0.5 -> 0.155  Inexact Rounded\r
+pwsx3045  power 0.25  0.5 -> 0.500  Inexact Rounded\r
+pwsx3046  power 0.025  0.5 -> 0.158  Inexact Rounded\r
+pwsx3047  power 0.26  0.5 -> 0.510  Inexact Rounded\r
+pwsx3048  power 0.026  0.5 -> 0.161  Inexact Rounded\r
+pwsx3049  power 0.27  0.5 -> 0.520  Inexact Rounded\r
+pwsx3050  power 0.027  0.5 -> 0.164  Inexact Rounded\r
+pwsx3051  power 0.28  0.5 -> 0.529  Inexact Rounded\r
+pwsx3052  power 0.028  0.5 -> 0.167  Inexact Rounded\r
+pwsx3053  power 0.29  0.5 -> 0.539  Inexact Rounded\r
+pwsx3054  power 0.029  0.5 -> 0.170  Inexact Rounded\r
+pwsx3055  power 0.31  0.5 -> 0.557  Inexact Rounded\r
+pwsx3056  power 0.031  0.5 -> 0.176  Inexact Rounded\r
+pwsx3057  power 0.32  0.5 -> 0.566  Inexact Rounded\r
+pwsx3058  power 0.032  0.5 -> 0.179  Inexact Rounded\r
+pwsx3059  power 0.33  0.5 -> 0.574  Inexact Rounded\r
+pwsx3060  power 0.033  0.5 -> 0.182  Inexact Rounded\r
+pwsx3061  power 0.34  0.5 -> 0.583  Inexact Rounded\r
+pwsx3062  power 0.034  0.5 -> 0.184  Inexact Rounded\r
+pwsx3063  power 0.35  0.5 -> 0.592  Inexact Rounded\r
+pwsx3064  power 0.035  0.5 -> 0.187  Inexact Rounded\r
+pwsx3065  power 0.36  0.5 -> 0.600  Inexact Rounded\r
+pwsx3066  power 0.036  0.5 -> 0.190  Inexact Rounded\r
+pwsx3067  power 0.37  0.5 -> 0.608  Inexact Rounded\r
+pwsx3068  power 0.037  0.5 -> 0.192  Inexact Rounded\r
+pwsx3069  power 0.38  0.5 -> 0.616  Inexact Rounded\r
+pwsx3070  power 0.038  0.5 -> 0.195  Inexact Rounded\r
+pwsx3071  power 0.39  0.5 -> 0.624  Inexact Rounded\r
+pwsx3072  power 0.039  0.5 -> 0.197  Inexact Rounded\r
+pwsx3073  power 0.41  0.5 -> 0.640  Inexact Rounded\r
+pwsx3074  power 0.041  0.5 -> 0.202  Inexact Rounded\r
+pwsx3075  power 0.42  0.5 -> 0.648  Inexact Rounded\r
+pwsx3076  power 0.042  0.5 -> 0.205  Inexact Rounded\r
+pwsx3077  power 0.43  0.5 -> 0.656  Inexact Rounded\r
+pwsx3078  power 0.043  0.5 -> 0.207  Inexact Rounded\r
+pwsx3079  power 0.44  0.5 -> 0.663  Inexact Rounded\r
+pwsx3080  power 0.044  0.5 -> 0.210  Inexact Rounded\r
+pwsx3081  power 0.45  0.5 -> 0.671  Inexact Rounded\r
+pwsx3082  power 0.045  0.5 -> 0.212  Inexact Rounded\r
+pwsx3083  power 0.46  0.5 -> 0.678  Inexact Rounded\r
+pwsx3084  power 0.046  0.5 -> 0.214  Inexact Rounded\r
+pwsx3085  power 0.47  0.5 -> 0.686  Inexact Rounded\r
+pwsx3086  power 0.047  0.5 -> 0.217  Inexact Rounded\r
+pwsx3087  power 0.48  0.5 -> 0.693  Inexact Rounded\r
+pwsx3088  power 0.048  0.5 -> 0.219  Inexact Rounded\r
+pwsx3089  power 0.49  0.5 -> 0.700  Inexact Rounded\r
+pwsx3090  power 0.049  0.5 -> 0.221  Inexact Rounded\r
+pwsx3091  power 0.51  0.5 -> 0.714  Inexact Rounded\r
+pwsx3092  power 0.051  0.5 -> 0.226  Inexact Rounded\r
+pwsx3093  power 0.52  0.5 -> 0.721  Inexact Rounded\r
+pwsx3094  power 0.052  0.5 -> 0.228  Inexact Rounded\r
+pwsx3095  power 0.53  0.5 -> 0.728  Inexact Rounded\r
+pwsx3096  power 0.053  0.5 -> 0.230  Inexact Rounded\r
+pwsx3097  power 0.54  0.5 -> 0.735  Inexact Rounded\r
+pwsx3098  power 0.054  0.5 -> 0.232  Inexact Rounded\r
+pwsx3099  power 0.55  0.5 -> 0.742  Inexact Rounded\r
+pwsx3100  power 0.055  0.5 -> 0.235  Inexact Rounded\r
+pwsx3101  power 0.56  0.5 -> 0.748  Inexact Rounded\r
+pwsx3102  power 0.056  0.5 -> 0.237  Inexact Rounded\r
+pwsx3103  power 0.57  0.5 -> 0.755  Inexact Rounded\r
+pwsx3104  power 0.057  0.5 -> 0.239  Inexact Rounded\r
+pwsx3105  power 0.58  0.5 -> 0.762  Inexact Rounded\r
+pwsx3106  power 0.058  0.5 -> 0.241  Inexact Rounded\r
+pwsx3107  power 0.59  0.5 -> 0.768  Inexact Rounded\r
+pwsx3108  power 0.059  0.5 -> 0.243  Inexact Rounded\r
+pwsx3109  power 0.61  0.5 -> 0.781  Inexact Rounded\r
+pwsx3110  power 0.061  0.5 -> 0.247  Inexact Rounded\r
+pwsx3111  power 0.62  0.5 -> 0.787  Inexact Rounded\r
+pwsx3112  power 0.062  0.5 -> 0.249  Inexact Rounded\r
+pwsx3113  power 0.63  0.5 -> 0.794  Inexact Rounded\r
+pwsx3114  power 0.063  0.5 -> 0.251  Inexact Rounded\r
+pwsx3115  power 0.64  0.5 -> 0.800  Inexact Rounded\r
+pwsx3116  power 0.064  0.5 -> 0.253  Inexact Rounded\r
+pwsx3117  power 0.65  0.5 -> 0.806  Inexact Rounded\r
+pwsx3118  power 0.065  0.5 -> 0.255  Inexact Rounded\r
+pwsx3119  power 0.66  0.5 -> 0.812  Inexact Rounded\r
+pwsx3120  power 0.066  0.5 -> 0.257  Inexact Rounded\r
+pwsx3121  power 0.67  0.5 -> 0.819  Inexact Rounded\r
+pwsx3122  power 0.067  0.5 -> 0.259  Inexact Rounded\r
+pwsx3123  power 0.68  0.5 -> 0.825  Inexact Rounded\r
+pwsx3124  power 0.068  0.5 -> 0.261  Inexact Rounded\r
+pwsx3125  power 0.69  0.5 -> 0.831  Inexact Rounded\r
+pwsx3126  power 0.069  0.5 -> 0.263  Inexact Rounded\r
+pwsx3127  power 0.71  0.5 -> 0.843  Inexact Rounded\r
+pwsx3128  power 0.071  0.5 -> 0.266  Inexact Rounded\r
+pwsx3129  power 0.72  0.5 -> 0.849  Inexact Rounded\r
+pwsx3130  power 0.072  0.5 -> 0.268  Inexact Rounded\r
+pwsx3131  power 0.73  0.5 -> 0.854  Inexact Rounded\r
+pwsx3132  power 0.073  0.5 -> 0.270  Inexact Rounded\r
+pwsx3133  power 0.74  0.5 -> 0.860  Inexact Rounded\r
+pwsx3134  power 0.074  0.5 -> 0.272  Inexact Rounded\r
+pwsx3135  power 0.75  0.5 -> 0.866  Inexact Rounded\r
+pwsx3136  power 0.075  0.5 -> 0.274  Inexact Rounded\r
+pwsx3137  power 0.76  0.5 -> 0.872  Inexact Rounded\r
+pwsx3138  power 0.076  0.5 -> 0.276  Inexact Rounded\r
+pwsx3139  power 0.77  0.5 -> 0.877  Inexact Rounded\r
+pwsx3140  power 0.077  0.5 -> 0.277  Inexact Rounded\r
+pwsx3141  power 0.78  0.5 -> 0.883  Inexact Rounded\r
+pwsx3142  power 0.078  0.5 -> 0.279  Inexact Rounded\r
+pwsx3143  power 0.79  0.5 -> 0.889  Inexact Rounded\r
+pwsx3144  power 0.079  0.5 -> 0.281  Inexact Rounded\r
+pwsx3145  power 0.81  0.5 -> 0.900  Inexact Rounded\r
+pwsx3146  power 0.081  0.5 -> 0.285  Inexact Rounded\r
+pwsx3147  power 0.82  0.5 -> 0.906  Inexact Rounded\r
+pwsx3148  power 0.082  0.5 -> 0.286  Inexact Rounded\r
+pwsx3149  power 0.83  0.5 -> 0.911  Inexact Rounded\r
+pwsx3150  power 0.083  0.5 -> 0.288  Inexact Rounded\r
+pwsx3151  power 0.84  0.5 -> 0.917  Inexact Rounded\r
+pwsx3152  power 0.084  0.5 -> 0.290  Inexact Rounded\r
+pwsx3153  power 0.85  0.5 -> 0.922  Inexact Rounded\r
+pwsx3154  power 0.085  0.5 -> 0.292  Inexact Rounded\r
+pwsx3155  power 0.86  0.5 -> 0.927  Inexact Rounded\r
+pwsx3156  power 0.086  0.5 -> 0.293  Inexact Rounded\r
+pwsx3157  power 0.87  0.5 -> 0.933  Inexact Rounded\r
+pwsx3158  power 0.087  0.5 -> 0.295  Inexact Rounded\r
+pwsx3159  power 0.88  0.5 -> 0.938  Inexact Rounded\r
+pwsx3160  power 0.088  0.5 -> 0.297  Inexact Rounded\r
+pwsx3161  power 0.89  0.5 -> 0.943  Inexact Rounded\r
+pwsx3162  power 0.089  0.5 -> 0.298  Inexact Rounded\r
+pwsx3163  power 0.91  0.5 -> 0.954  Inexact Rounded\r
+pwsx3164  power 0.091  0.5 -> 0.302  Inexact Rounded\r
+pwsx3165  power 0.92  0.5 -> 0.959  Inexact Rounded\r
+pwsx3166  power 0.092  0.5 -> 0.303  Inexact Rounded\r
+pwsx3167  power 0.93  0.5 -> 0.964  Inexact Rounded\r
+pwsx3168  power 0.093  0.5 -> 0.305  Inexact Rounded\r
+pwsx3169  power 0.94  0.5 -> 0.970  Inexact Rounded\r
+pwsx3170  power 0.094  0.5 -> 0.307  Inexact Rounded\r
+pwsx3171  power 0.95  0.5 -> 0.975  Inexact Rounded\r
+pwsx3172  power 0.095  0.5 -> 0.308  Inexact Rounded\r
+pwsx3173  power 0.96  0.5 -> 0.980  Inexact Rounded\r
+pwsx3174  power 0.096  0.5 -> 0.310  Inexact Rounded\r
+pwsx3175  power 0.97  0.5 -> 0.985  Inexact Rounded\r
+pwsx3176  power 0.097  0.5 -> 0.311  Inexact Rounded\r
+pwsx3177  power 0.98  0.5 -> 0.990  Inexact Rounded\r
+pwsx3178  power 0.098  0.5 -> 0.313  Inexact Rounded\r
+pwsx3179  power 0.99  0.5 -> 0.995  Inexact Rounded\r
+pwsx3180  power 0.099  0.5 -> 0.315  Inexact Rounded\r
+pwsx3181  power 0.101  0.5 -> 0.318  Inexact Rounded\r
+pwsx3182  power 0.0101  0.5 -> 0.100  Inexact Rounded\r
+pwsx3183  power 0.102  0.5 -> 0.319  Inexact Rounded\r
+pwsx3184  power 0.0102  0.5 -> 0.101  Inexact Rounded\r
+pwsx3185  power 0.103  0.5 -> 0.321  Inexact Rounded\r
+pwsx3186  power 0.0103  0.5 -> 0.101  Inexact Rounded\r
+pwsx3187  power 0.104  0.5 -> 0.322  Inexact Rounded\r
+pwsx3188  power 0.0104  0.5 -> 0.102  Inexact Rounded\r
+pwsx3189  power 0.105  0.5 -> 0.324  Inexact Rounded\r
+pwsx3190  power 0.0105  0.5 -> 0.102  Inexact Rounded\r
+pwsx3191  power 0.106  0.5 -> 0.326  Inexact Rounded\r
+pwsx3192  power 0.0106  0.5 -> 0.103  Inexact Rounded\r
+pwsx3193  power 0.107  0.5 -> 0.327  Inexact Rounded\r
+pwsx3194  power 0.0107  0.5 -> 0.103  Inexact Rounded\r
+pwsx3195  power 0.108  0.5 -> 0.329  Inexact Rounded\r
+pwsx3196  power 0.0108  0.5 -> 0.104  Inexact Rounded\r
+pwsx3197  power 0.109  0.5 -> 0.330  Inexact Rounded\r
+pwsx3198  power 0.0109  0.5 -> 0.104  Inexact Rounded\r
+pwsx3199  power 0.111  0.5 -> 0.333  Inexact Rounded\r
+pwsx3200  power 0.0111  0.5 -> 0.105  Inexact Rounded\r
+pwsx3201  power 0.112  0.5 -> 0.335  Inexact Rounded\r
+pwsx3202  power 0.0112  0.5 -> 0.106  Inexact Rounded\r
+pwsx3203  power 0.113  0.5 -> 0.336  Inexact Rounded\r
+pwsx3204  power 0.0113  0.5 -> 0.106  Inexact Rounded\r
+pwsx3205  power 0.114  0.5 -> 0.338  Inexact Rounded\r
+pwsx3206  power 0.0114  0.5 -> 0.107  Inexact Rounded\r
+pwsx3207  power 0.115  0.5 -> 0.339  Inexact Rounded\r
+pwsx3208  power 0.0115  0.5 -> 0.107  Inexact Rounded\r
+pwsx3209  power 0.116  0.5 -> 0.341  Inexact Rounded\r
+pwsx3210  power 0.0116  0.5 -> 0.108  Inexact Rounded\r
+pwsx3211  power 0.117  0.5 -> 0.342  Inexact Rounded\r
+pwsx3212  power 0.0117  0.5 -> 0.108  Inexact Rounded\r
+pwsx3213  power 0.118  0.5 -> 0.344  Inexact Rounded\r
+pwsx3214  power 0.0118  0.5 -> 0.109  Inexact Rounded\r
+pwsx3215  power 0.119  0.5 -> 0.345  Inexact Rounded\r
+pwsx3216  power 0.0119  0.5 -> 0.109  Inexact Rounded\r
+pwsx3217  power 0.121  0.5 -> 0.348  Inexact Rounded\r
+pwsx3218  power 0.0121  0.5 -> 0.110  Inexact Rounded\r
+pwsx3219  power 0.122  0.5 -> 0.349  Inexact Rounded\r
+pwsx3220  power 0.0122  0.5 -> 0.110  Inexact Rounded\r
+pwsx3221  power 0.123  0.5 -> 0.351  Inexact Rounded\r
+pwsx3222  power 0.0123  0.5 -> 0.111  Inexact Rounded\r
+pwsx3223  power 0.124  0.5 -> 0.352  Inexact Rounded\r
+pwsx3224  power 0.0124  0.5 -> 0.111  Inexact Rounded\r
+pwsx3225  power 0.125  0.5 -> 0.354  Inexact Rounded\r
+pwsx3226  power 0.0125  0.5 -> 0.112  Inexact Rounded\r
+pwsx3227  power 0.126  0.5 -> 0.355  Inexact Rounded\r
+pwsx3228  power 0.0126  0.5 -> 0.112  Inexact Rounded\r
+pwsx3229  power 0.127  0.5 -> 0.356  Inexact Rounded\r
+pwsx3230  power 0.0127  0.5 -> 0.113  Inexact Rounded\r
+pwsx3231  power 0.128  0.5 -> 0.358  Inexact Rounded\r
+pwsx3232  power 0.0128  0.5 -> 0.113  Inexact Rounded\r
+pwsx3233  power 0.129  0.5 -> 0.359  Inexact Rounded\r
+pwsx3234  power 0.0129  0.5 -> 0.114  Inexact Rounded\r
+pwsx3235  power 0.131  0.5 -> 0.362  Inexact Rounded\r
+pwsx3236  power 0.0131  0.5 -> 0.114  Inexact Rounded\r
+pwsx3237  power 0.132  0.5 -> 0.363  Inexact Rounded\r
+pwsx3238  power 0.0132  0.5 -> 0.115  Inexact Rounded\r
+pwsx3239  power 0.133  0.5 -> 0.365  Inexact Rounded\r
+pwsx3240  power 0.0133  0.5 -> 0.115  Inexact Rounded\r
+pwsx3241  power 0.134  0.5 -> 0.366  Inexact Rounded\r
+pwsx3242  power 0.0134  0.5 -> 0.116  Inexact Rounded\r
+pwsx3243  power 0.135  0.5 -> 0.367  Inexact Rounded\r
+pwsx3244  power 0.0135  0.5 -> 0.116  Inexact Rounded\r
+pwsx3245  power 0.136  0.5 -> 0.369  Inexact Rounded\r
+pwsx3246  power 0.0136  0.5 -> 0.117  Inexact Rounded\r
+pwsx3247  power 0.137  0.5 -> 0.370  Inexact Rounded\r
+pwsx3248  power 0.0137  0.5 -> 0.117  Inexact Rounded\r
+pwsx3249  power 0.138  0.5 -> 0.371  Inexact Rounded\r
+pwsx3250  power 0.0138  0.5 -> 0.117  Inexact Rounded\r
+pwsx3251  power 0.139  0.5 -> 0.373  Inexact Rounded\r
+pwsx3252  power 0.0139  0.5 -> 0.118  Inexact Rounded\r
+pwsx3253  power 0.141  0.5 -> 0.375  Inexact Rounded\r
+pwsx3254  power 0.0141  0.5 -> 0.119  Inexact Rounded\r
+pwsx3255  power 0.142  0.5 -> 0.377  Inexact Rounded\r
+pwsx3256  power 0.0142  0.5 -> 0.119  Inexact Rounded\r
+pwsx3257  power 0.143  0.5 -> 0.378  Inexact Rounded\r
+pwsx3258  power 0.0143  0.5 -> 0.120  Inexact Rounded\r
+pwsx3259  power 0.144  0.5 -> 0.379  Inexact Rounded\r
+pwsx3260  power 0.0144  0.5 -> 0.120  Inexact Rounded\r
+pwsx3261  power 0.145  0.5 -> 0.381  Inexact Rounded\r
+pwsx3262  power 0.0145  0.5 -> 0.120  Inexact Rounded\r
+pwsx3263  power 0.146  0.5 -> 0.382  Inexact Rounded\r
+pwsx3264  power 0.0146  0.5 -> 0.121  Inexact Rounded\r
+pwsx3265  power 0.147  0.5 -> 0.383  Inexact Rounded\r
+pwsx3266  power 0.0147  0.5 -> 0.121  Inexact Rounded\r
+pwsx3267  power 0.148  0.5 -> 0.385  Inexact Rounded\r
+pwsx3268  power 0.0148  0.5 -> 0.122  Inexact Rounded\r
+pwsx3269  power 0.149  0.5 -> 0.386  Inexact Rounded\r
+pwsx3270  power 0.0149  0.5 -> 0.122  Inexact Rounded\r
+pwsx3271  power 0.151  0.5 -> 0.389  Inexact Rounded\r
+pwsx3272  power 0.0151  0.5 -> 0.123  Inexact Rounded\r
+pwsx3273  power 0.152  0.5 -> 0.390  Inexact Rounded\r
+pwsx3274  power 0.0152  0.5 -> 0.123  Inexact Rounded\r
+pwsx3275  power 0.153  0.5 -> 0.391  Inexact Rounded\r
+pwsx3276  power 0.0153  0.5 -> 0.124  Inexact Rounded\r
+pwsx3277  power 0.154  0.5 -> 0.392  Inexact Rounded\r
+pwsx3278  power 0.0154  0.5 -> 0.124  Inexact Rounded\r
+pwsx3279  power 0.155  0.5 -> 0.394  Inexact Rounded\r
+pwsx3280  power 0.0155  0.5 -> 0.124  Inexact Rounded\r
+pwsx3281  power 0.156  0.5 -> 0.395  Inexact Rounded\r
+pwsx3282  power 0.0156  0.5 -> 0.125  Inexact Rounded\r
+pwsx3283  power 0.157  0.5 -> 0.396  Inexact Rounded\r
+pwsx3284  power 0.0157  0.5 -> 0.125  Inexact Rounded\r
+pwsx3285  power 0.158  0.5 -> 0.397  Inexact Rounded\r
+pwsx3286  power 0.0158  0.5 -> 0.126  Inexact Rounded\r
+pwsx3287  power 0.159  0.5 -> 0.399  Inexact Rounded\r
+pwsx3288  power 0.0159  0.5 -> 0.126  Inexact Rounded\r
+pwsx3289  power 0.161  0.5 -> 0.401  Inexact Rounded\r
+pwsx3290  power 0.0161  0.5 -> 0.127  Inexact Rounded\r
+pwsx3291  power 0.162  0.5 -> 0.402  Inexact Rounded\r
+pwsx3292  power 0.0162  0.5 -> 0.127  Inexact Rounded\r
+pwsx3293  power 0.163  0.5 -> 0.404  Inexact Rounded\r
+pwsx3294  power 0.0163  0.5 -> 0.128  Inexact Rounded\r
+pwsx3295  power 0.164  0.5 -> 0.405  Inexact Rounded\r
+pwsx3296  power 0.0164  0.5 -> 0.128  Inexact Rounded\r
+pwsx3297  power 0.165  0.5 -> 0.406  Inexact Rounded\r
+pwsx3298  power 0.0165  0.5 -> 0.128  Inexact Rounded\r
+pwsx3299  power 0.166  0.5 -> 0.407  Inexact Rounded\r
+pwsx3300  power 0.0166  0.5 -> 0.129  Inexact Rounded\r
+pwsx3301  power 0.167  0.5 -> 0.409  Inexact Rounded\r
+pwsx3302  power 0.0167  0.5 -> 0.129  Inexact Rounded\r
+pwsx3303  power 0.168  0.5 -> 0.410  Inexact Rounded\r
+pwsx3304  power 0.0168  0.5 -> 0.130  Inexact Rounded\r
+pwsx3305  power 0.169  0.5 -> 0.411  Inexact Rounded\r
+pwsx3306  power 0.0169  0.5 -> 0.130  Inexact Rounded\r
+pwsx3307  power 0.171  0.5 -> 0.414  Inexact Rounded\r
+pwsx3308  power 0.0171  0.5 -> 0.131  Inexact Rounded\r
+pwsx3309  power 0.172  0.5 -> 0.415  Inexact Rounded\r
+pwsx3310  power 0.0172  0.5 -> 0.131  Inexact Rounded\r
+pwsx3311  power 0.173  0.5 -> 0.416  Inexact Rounded\r
+pwsx3312  power 0.0173  0.5 -> 0.132  Inexact Rounded\r
+pwsx3313  power 0.174  0.5 -> 0.417  Inexact Rounded\r
+pwsx3314  power 0.0174  0.5 -> 0.132  Inexact Rounded\r
+pwsx3315  power 0.175  0.5 -> 0.418  Inexact Rounded\r
+pwsx3316  power 0.0175  0.5 -> 0.132  Inexact Rounded\r
+pwsx3317  power 0.176  0.5 -> 0.420  Inexact Rounded\r
+pwsx3318  power 0.0176  0.5 -> 0.133  Inexact Rounded\r
+pwsx3319  power 0.177  0.5 -> 0.421  Inexact Rounded\r
+pwsx3320  power 0.0177  0.5 -> 0.133  Inexact Rounded\r
+pwsx3321  power 0.178  0.5 -> 0.422  Inexact Rounded\r
+pwsx3322  power 0.0178  0.5 -> 0.133  Inexact Rounded\r
+pwsx3323  power 0.179  0.5 -> 0.423  Inexact Rounded\r
+pwsx3324  power 0.0179  0.5 -> 0.134  Inexact Rounded\r
+pwsx3325  power 0.181  0.5 -> 0.425  Inexact Rounded\r
+pwsx3326  power 0.0181  0.5 -> 0.135  Inexact Rounded\r
+pwsx3327  power 0.182  0.5 -> 0.427  Inexact Rounded\r
+pwsx3328  power 0.0182  0.5 -> 0.135  Inexact Rounded\r
+pwsx3329  power 0.183  0.5 -> 0.428  Inexact Rounded\r
+pwsx3330  power 0.0183  0.5 -> 0.135  Inexact Rounded\r
+pwsx3331  power 0.184  0.5 -> 0.429  Inexact Rounded\r
+pwsx3332  power 0.0184  0.5 -> 0.136  Inexact Rounded\r
+pwsx3333  power 0.185  0.5 -> 0.430  Inexact Rounded\r
+pwsx3334  power 0.0185  0.5 -> 0.136  Inexact Rounded\r
+pwsx3335  power 0.186  0.5 -> 0.431  Inexact Rounded\r
+pwsx3336  power 0.0186  0.5 -> 0.136  Inexact Rounded\r
+pwsx3337  power 0.187  0.5 -> 0.432  Inexact Rounded\r
+pwsx3338  power 0.0187  0.5 -> 0.137  Inexact Rounded\r
+pwsx3339  power 0.188  0.5 -> 0.434  Inexact Rounded\r
+pwsx3340  power 0.0188  0.5 -> 0.137  Inexact Rounded\r
+pwsx3341  power 0.189  0.5 -> 0.435  Inexact Rounded\r
+pwsx3342  power 0.0189  0.5 -> 0.137  Inexact Rounded\r
+pwsx3343  power 0.191  0.5 -> 0.437  Inexact Rounded\r
+pwsx3344  power 0.0191  0.5 -> 0.138  Inexact Rounded\r
+pwsx3345  power 0.192  0.5 -> 0.438  Inexact Rounded\r
+pwsx3346  power 0.0192  0.5 -> 0.139  Inexact Rounded\r
+pwsx3347  power 0.193  0.5 -> 0.439  Inexact Rounded\r
+pwsx3348  power 0.0193  0.5 -> 0.139  Inexact Rounded\r
+pwsx3349  power 0.194  0.5 -> 0.440  Inexact Rounded\r
+pwsx3350  power 0.0194  0.5 -> 0.139  Inexact Rounded\r
+pwsx3351  power 0.195  0.5 -> 0.442  Inexact Rounded\r
+pwsx3352  power 0.0195  0.5 -> 0.140  Inexact Rounded\r
+pwsx3353  power 0.196  0.5 -> 0.443  Inexact Rounded\r
+pwsx3354  power 0.0196  0.5 -> 0.140  Inexact Rounded\r
+pwsx3355  power 0.197  0.5 -> 0.444  Inexact Rounded\r
+pwsx3356  power 0.0197  0.5 -> 0.140  Inexact Rounded\r
+pwsx3357  power 0.198  0.5 -> 0.445  Inexact Rounded\r
+pwsx3358  power 0.0198  0.5 -> 0.141  Inexact Rounded\r
+pwsx3359  power 0.199  0.5 -> 0.446  Inexact Rounded\r
+pwsx3360  power 0.0199  0.5 -> 0.141  Inexact Rounded\r
+pwsx3361  power 0.201  0.5 -> 0.448  Inexact Rounded\r
+pwsx3362  power 0.0201  0.5 -> 0.142  Inexact Rounded\r
+pwsx3363  power 0.202  0.5 -> 0.449  Inexact Rounded\r
+pwsx3364  power 0.0202  0.5 -> 0.142  Inexact Rounded\r
+pwsx3365  power 0.203  0.5 -> 0.451  Inexact Rounded\r
+pwsx3366  power 0.0203  0.5 -> 0.142  Inexact Rounded\r
+pwsx3367  power 0.204  0.5 -> 0.452  Inexact Rounded\r
+pwsx3368  power 0.0204  0.5 -> 0.143  Inexact Rounded\r
+pwsx3369  power 0.205  0.5 -> 0.453  Inexact Rounded\r
+pwsx3370  power 0.0205  0.5 -> 0.143  Inexact Rounded\r
+pwsx3371  power 0.206  0.5 -> 0.454  Inexact Rounded\r
+pwsx3372  power 0.0206  0.5 -> 0.144  Inexact Rounded\r
+pwsx3373  power 0.207  0.5 -> 0.455  Inexact Rounded\r
+pwsx3374  power 0.0207  0.5 -> 0.144  Inexact Rounded\r
+pwsx3375  power 0.208  0.5 -> 0.456  Inexact Rounded\r
+pwsx3376  power 0.0208  0.5 -> 0.144  Inexact Rounded\r
+pwsx3377  power 0.209  0.5 -> 0.457  Inexact Rounded\r
+pwsx3378  power 0.0209  0.5 -> 0.145  Inexact Rounded\r
+pwsx3379  power 0.211  0.5 -> 0.459  Inexact Rounded\r
+pwsx3380  power 0.0211  0.5 -> 0.145  Inexact Rounded\r
+pwsx3381  power 0.212  0.5 -> 0.460  Inexact Rounded\r
+pwsx3382  power 0.0212  0.5 -> 0.146  Inexact Rounded\r
+pwsx3383  power 0.213  0.5 -> 0.462  Inexact Rounded\r
+pwsx3384  power 0.0213  0.5 -> 0.146  Inexact Rounded\r
+pwsx3385  power 0.214  0.5 -> 0.463  Inexact Rounded\r
+pwsx3386  power 0.0214  0.5 -> 0.146  Inexact Rounded\r
+pwsx3387  power 0.215  0.5 -> 0.464  Inexact Rounded\r
+pwsx3388  power 0.0215  0.5 -> 0.147  Inexact Rounded\r
+pwsx3389  power 0.216  0.5 -> 0.465  Inexact Rounded\r
+pwsx3390  power 0.0216  0.5 -> 0.147  Inexact Rounded\r
+pwsx3391  power 0.217  0.5 -> 0.466  Inexact Rounded\r
+pwsx3392  power 0.0217  0.5 -> 0.147  Inexact Rounded\r
+pwsx3393  power 0.218  0.5 -> 0.467  Inexact Rounded\r
+pwsx3394  power 0.0218  0.5 -> 0.148  Inexact Rounded\r
+pwsx3395  power 0.219  0.5 -> 0.468  Inexact Rounded\r
+pwsx3396  power 0.0219  0.5 -> 0.148  Inexact Rounded\r
+pwsx3397  power 0.221  0.5 -> 0.470  Inexact Rounded\r
+pwsx3398  power 0.0221  0.5 -> 0.149  Inexact Rounded\r
+pwsx3399  power 0.222  0.5 -> 0.471  Inexact Rounded\r
+pwsx3400  power 0.0222  0.5 -> 0.149  Inexact Rounded\r
+pwsx3401  power 0.223  0.5 -> 0.472  Inexact Rounded\r
+pwsx3402  power 0.0223  0.5 -> 0.149  Inexact Rounded\r
+pwsx3403  power 0.224  0.5 -> 0.473  Inexact Rounded\r
+pwsx3404  power 0.0224  0.5 -> 0.150  Inexact Rounded\r
+pwsx3405  power 0.225  0.5 -> 0.474  Inexact Rounded\r
+pwsx3406  power 0.0225  0.5 -> 0.150  Inexact Rounded\r
+pwsx3407  power 0.226  0.5 -> 0.475  Inexact Rounded\r
+pwsx3408  power 0.0226  0.5 -> 0.150  Inexact Rounded\r
+pwsx3409  power 0.227  0.5 -> 0.476  Inexact Rounded\r
+pwsx3410  power 0.0227  0.5 -> 0.151  Inexact Rounded\r
+pwsx3411  power 0.228  0.5 -> 0.477  Inexact Rounded\r
+pwsx3412  power 0.0228  0.5 -> 0.151  Inexact Rounded\r
+pwsx3413  power 0.229  0.5 -> 0.479  Inexact Rounded\r
+pwsx3414  power 0.0229  0.5 -> 0.151  Inexact Rounded\r
+pwsx3415  power 0.231  0.5 -> 0.481  Inexact Rounded\r
+pwsx3416  power 0.0231  0.5 -> 0.152  Inexact Rounded\r
+pwsx3417  power 0.232  0.5 -> 0.482  Inexact Rounded\r
+pwsx3418  power 0.0232  0.5 -> 0.152  Inexact Rounded\r
+pwsx3419  power 0.233  0.5 -> 0.483  Inexact Rounded\r
+pwsx3420  power 0.0233  0.5 -> 0.153  Inexact Rounded\r
+pwsx3421  power 0.234  0.5 -> 0.484  Inexact Rounded\r
+pwsx3422  power 0.0234  0.5 -> 0.153  Inexact Rounded\r
+pwsx3423  power 0.235  0.5 -> 0.485  Inexact Rounded\r
+pwsx3424  power 0.0235  0.5 -> 0.153  Inexact Rounded\r
+pwsx3425  power 0.236  0.5 -> 0.486  Inexact Rounded\r
+pwsx3426  power 0.0236  0.5 -> 0.154  Inexact Rounded\r
+pwsx3427  power 0.237  0.5 -> 0.487  Inexact Rounded\r
+pwsx3428  power 0.0237  0.5 -> 0.154  Inexact Rounded\r
+pwsx3429  power 0.238  0.5 -> 0.488  Inexact Rounded\r
+pwsx3430  power 0.0238  0.5 -> 0.154  Inexact Rounded\r
+pwsx3431  power 0.239  0.5 -> 0.489  Inexact Rounded\r
+pwsx3432  power 0.0239  0.5 -> 0.155  Inexact Rounded\r
+pwsx3433  power 0.241  0.5 -> 0.491  Inexact Rounded\r
+pwsx3434  power 0.0241  0.5 -> 0.155  Inexact Rounded\r
+pwsx3435  power 0.242  0.5 -> 0.492  Inexact Rounded\r
+pwsx3436  power 0.0242  0.5 -> 0.156  Inexact Rounded\r
+pwsx3437  power 0.243  0.5 -> 0.493  Inexact Rounded\r
+pwsx3438  power 0.0243  0.5 -> 0.156  Inexact Rounded\r
+pwsx3439  power 0.244  0.5 -> 0.494  Inexact Rounded\r
+pwsx3440  power 0.0244  0.5 -> 0.156  Inexact Rounded\r
+pwsx3441  power 0.245  0.5 -> 0.495  Inexact Rounded\r
+pwsx3442  power 0.0245  0.5 -> 0.157  Inexact Rounded\r
+pwsx3443  power 0.246  0.5 -> 0.496  Inexact Rounded\r
+pwsx3444  power 0.0246  0.5 -> 0.157  Inexact Rounded\r
+pwsx3445  power 0.247  0.5 -> 0.497  Inexact Rounded\r
+pwsx3446  power 0.0247  0.5 -> 0.157  Inexact Rounded\r
+pwsx3447  power 0.248  0.5 -> 0.498  Inexact Rounded\r
+pwsx3448  power 0.0248  0.5 -> 0.157  Inexact Rounded\r
+pwsx3449  power 0.249  0.5 -> 0.499  Inexact Rounded\r
+pwsx3450  power 0.0249  0.5 -> 0.158  Inexact Rounded\r
+pwsx3451  power 0.251  0.5 -> 0.501  Inexact Rounded\r
+pwsx3452  power 0.0251  0.5 -> 0.158  Inexact Rounded\r
+pwsx3453  power 0.252  0.5 -> 0.502  Inexact Rounded\r
+pwsx3454  power 0.0252  0.5 -> 0.159  Inexact Rounded\r
+pwsx3455  power 0.253  0.5 -> 0.503  Inexact Rounded\r
+pwsx3456  power 0.0253  0.5 -> 0.159  Inexact Rounded\r
+pwsx3457  power 0.254  0.5 -> 0.504  Inexact Rounded\r
+pwsx3458  power 0.0254  0.5 -> 0.159  Inexact Rounded\r
+pwsx3459  power 0.255  0.5 -> 0.505  Inexact Rounded\r
+pwsx3460  power 0.0255  0.5 -> 0.160  Inexact Rounded\r
+pwsx3461  power 0.256  0.5 -> 0.506  Inexact Rounded\r
+pwsx3462  power 0.0256  0.5 -> 0.160  Inexact Rounded\r
+pwsx3463  power 0.257  0.5 -> 0.507  Inexact Rounded\r
+pwsx3464  power 0.0257  0.5 -> 0.160  Inexact Rounded\r
+pwsx3465  power 0.258  0.5 -> 0.508  Inexact Rounded\r
+pwsx3466  power 0.0258  0.5 -> 0.161  Inexact Rounded\r
+pwsx3467  power 0.259  0.5 -> 0.509  Inexact Rounded\r
+pwsx3468  power 0.0259  0.5 -> 0.161  Inexact Rounded\r
+pwsx3469  power 0.261  0.5 -> 0.511  Inexact Rounded\r
+pwsx3470  power 0.0261  0.5 -> 0.162  Inexact Rounded\r
+pwsx3471  power 0.262  0.5 -> 0.512  Inexact Rounded\r
+pwsx3472  power 0.0262  0.5 -> 0.162  Inexact Rounded\r
+pwsx3473  power 0.263  0.5 -> 0.513  Inexact Rounded\r
+pwsx3474  power 0.0263  0.5 -> 0.162  Inexact Rounded\r
+pwsx3475  power 0.264  0.5 -> 0.514  Inexact Rounded\r
+pwsx3476  power 0.0264  0.5 -> 0.162  Inexact Rounded\r
+pwsx3477  power 0.265  0.5 -> 0.515  Inexact Rounded\r
+pwsx3478  power 0.0265  0.5 -> 0.163  Inexact Rounded\r
+pwsx3479  power 0.266  0.5 -> 0.516  Inexact Rounded\r
+pwsx3480  power 0.0266  0.5 -> 0.163  Inexact Rounded\r
+pwsx3481  power 0.267  0.5 -> 0.517  Inexact Rounded\r
+pwsx3482  power 0.0267  0.5 -> 0.163  Inexact Rounded\r
+pwsx3483  power 0.268  0.5 -> 0.518  Inexact Rounded\r
+pwsx3484  power 0.0268  0.5 -> 0.164  Inexact Rounded\r
+pwsx3485  power 0.269  0.5 -> 0.519  Inexact Rounded\r
+pwsx3486  power 0.0269  0.5 -> 0.164  Inexact Rounded\r
+pwsx3487  power 0.271  0.5 -> 0.521  Inexact Rounded\r
+pwsx3488  power 0.0271  0.5 -> 0.165  Inexact Rounded\r
+pwsx3489  power 0.272  0.5 -> 0.522  Inexact Rounded\r
+pwsx3490  power 0.0272  0.5 -> 0.165  Inexact Rounded\r
+pwsx3491  power 0.273  0.5 -> 0.522  Inexact Rounded\r
+pwsx3492  power 0.0273  0.5 -> 0.165  Inexact Rounded\r
+pwsx3493  power 0.274  0.5 -> 0.523  Inexact Rounded\r
+pwsx3494  power 0.0274  0.5 -> 0.166  Inexact Rounded\r
+pwsx3495  power 0.275  0.5 -> 0.524  Inexact Rounded\r
+pwsx3496  power 0.0275  0.5 -> 0.166  Inexact Rounded\r
+pwsx3497  power 0.276  0.5 -> 0.525  Inexact Rounded\r
+pwsx3498  power 0.0276  0.5 -> 0.166  Inexact Rounded\r
+pwsx3499  power 0.277  0.5 -> 0.526  Inexact Rounded\r
+pwsx3500  power 0.0277  0.5 -> 0.166  Inexact Rounded\r
+pwsx3501  power 0.278  0.5 -> 0.527  Inexact Rounded\r
+pwsx3502  power 0.0278  0.5 -> 0.167  Inexact Rounded\r
+pwsx3503  power 0.279  0.5 -> 0.528  Inexact Rounded\r
+pwsx3504  power 0.0279  0.5 -> 0.167  Inexact Rounded\r
+pwsx3505  power 0.281  0.5 -> 0.530  Inexact Rounded\r
+pwsx3506  power 0.0281  0.5 -> 0.168  Inexact Rounded\r
+pwsx3507  power 0.282  0.5 -> 0.531  Inexact Rounded\r
+pwsx3508  power 0.0282  0.5 -> 0.168  Inexact Rounded\r
+pwsx3509  power 0.283  0.5 -> 0.532  Inexact Rounded\r
+pwsx3510  power 0.0283  0.5 -> 0.168  Inexact Rounded\r
+pwsx3511  power 0.284  0.5 -> 0.533  Inexact Rounded\r
+pwsx3512  power 0.0284  0.5 -> 0.169  Inexact Rounded\r
+pwsx3513  power 0.285  0.5 -> 0.534  Inexact Rounded\r
+pwsx3514  power 0.0285  0.5 -> 0.169  Inexact Rounded\r
+pwsx3515  power 0.286  0.5 -> 0.535  Inexact Rounded\r
+pwsx3516  power 0.0286  0.5 -> 0.169  Inexact Rounded\r
+pwsx3517  power 0.287  0.5 -> 0.536  Inexact Rounded\r
+pwsx3518  power 0.0287  0.5 -> 0.169  Inexact Rounded\r
+pwsx3519  power 0.288  0.5 -> 0.537  Inexact Rounded\r
+pwsx3520  power 0.0288  0.5 -> 0.170  Inexact Rounded\r
+pwsx3521  power 0.289  0.5 -> 0.538  Inexact Rounded\r
+pwsx3522  power 0.0289  0.5 -> 0.170  Inexact Rounded\r
+pwsx3523  power 0.291  0.5 -> 0.539  Inexact Rounded\r
+pwsx3524  power 0.0291  0.5 -> 0.171  Inexact Rounded\r
+pwsx3525  power 0.292  0.5 -> 0.540  Inexact Rounded\r
+pwsx3526  power 0.0292  0.5 -> 0.171  Inexact Rounded\r
+pwsx3527  power 0.293  0.5 -> 0.541  Inexact Rounded\r
+pwsx3528  power 0.0293  0.5 -> 0.171  Inexact Rounded\r
+pwsx3529  power 0.294  0.5 -> 0.542  Inexact Rounded\r
+pwsx3530  power 0.0294  0.5 -> 0.171  Inexact Rounded\r
+pwsx3531  power 0.295  0.5 -> 0.543  Inexact Rounded\r
+pwsx3532  power 0.0295  0.5 -> 0.172  Inexact Rounded\r
+pwsx3533  power 0.296  0.5 -> 0.544  Inexact Rounded\r
+pwsx3534  power 0.0296  0.5 -> 0.172  Inexact Rounded\r
+pwsx3535  power 0.297  0.5 -> 0.545  Inexact Rounded\r
+pwsx3536  power 0.0297  0.5 -> 0.172  Inexact Rounded\r
+pwsx3537  power 0.298  0.5 -> 0.546  Inexact Rounded\r
+pwsx3538  power 0.0298  0.5 -> 0.173  Inexact Rounded\r
+pwsx3539  power 0.299  0.5 -> 0.547  Inexact Rounded\r
+pwsx3540  power 0.0299  0.5 -> 0.173  Inexact Rounded\r
+pwsx3541  power 0.301  0.5 -> 0.549  Inexact Rounded\r
+pwsx3542  power 0.0301  0.5 -> 0.173  Inexact Rounded\r
+pwsx3543  power 0.302  0.5 -> 0.550  Inexact Rounded\r
+pwsx3544  power 0.0302  0.5 -> 0.174  Inexact Rounded\r
+pwsx3545  power 0.303  0.5 -> 0.550  Inexact Rounded\r
+pwsx3546  power 0.0303  0.5 -> 0.174  Inexact Rounded\r
+pwsx3547  power 0.304  0.5 -> 0.551  Inexact Rounded\r
+pwsx3548  power 0.0304  0.5 -> 0.174  Inexact Rounded\r
+pwsx3549  power 0.305  0.5 -> 0.552  Inexact Rounded\r
+pwsx3550  power 0.0305  0.5 -> 0.175  Inexact Rounded\r
+pwsx3551  power 0.306  0.5 -> 0.553  Inexact Rounded\r
+pwsx3552  power 0.0306  0.5 -> 0.175  Inexact Rounded\r
+pwsx3553  power 0.307  0.5 -> 0.554  Inexact Rounded\r
+pwsx3554  power 0.0307  0.5 -> 0.175  Inexact Rounded\r
+pwsx3555  power 0.308  0.5 -> 0.555  Inexact Rounded\r
+pwsx3556  power 0.0308  0.5 -> 0.175  Inexact Rounded\r
+pwsx3557  power 0.309  0.5 -> 0.556  Inexact Rounded\r
+pwsx3558  power 0.0309  0.5 -> 0.176  Inexact Rounded\r
+pwsx3559  power 0.311  0.5 -> 0.558  Inexact Rounded\r
+pwsx3560  power 0.0311  0.5 -> 0.176  Inexact Rounded\r
+pwsx3561  power 0.312  0.5 -> 0.559  Inexact Rounded\r
+pwsx3562  power 0.0312  0.5 -> 0.177  Inexact Rounded\r
+pwsx3563  power 0.313  0.5 -> 0.559  Inexact Rounded\r
+pwsx3564  power 0.0313  0.5 -> 0.177  Inexact Rounded\r
+pwsx3565  power 0.314  0.5 -> 0.560  Inexact Rounded\r
+pwsx3566  power 0.0314  0.5 -> 0.177  Inexact Rounded\r
+pwsx3567  power 0.315  0.5 -> 0.561  Inexact Rounded\r
+pwsx3568  power 0.0315  0.5 -> 0.177  Inexact Rounded\r
+pwsx3569  power 0.316  0.5 -> 0.562  Inexact Rounded\r
+pwsx3570  power 0.0316  0.5 -> 0.178  Inexact Rounded\r
+pwsx3571  power 0.317  0.5 -> 0.563  Inexact Rounded\r
+pwsx3572  power 0.0317  0.5 -> 0.178  Inexact Rounded\r
+pwsx3573  power 0.318  0.5 -> 0.564  Inexact Rounded\r
+pwsx3574  power 0.0318  0.5 -> 0.178  Inexact Rounded\r
+pwsx3575  power 0.319  0.5 -> 0.565  Inexact Rounded\r
+pwsx3576  power 0.0319  0.5 -> 0.179  Inexact Rounded\r
+pwsx3577  power 0.321  0.5 -> 0.567  Inexact Rounded\r
+pwsx3578  power 0.0321  0.5 -> 0.179  Inexact Rounded\r
+pwsx3579  power 0.322  0.5 -> 0.567  Inexact Rounded\r
+pwsx3580  power 0.0322  0.5 -> 0.179  Inexact Rounded\r
+pwsx3581  power 0.323  0.5 -> 0.568  Inexact Rounded\r
+pwsx3582  power 0.0323  0.5 -> 0.180  Inexact Rounded\r
+pwsx3583  power 0.324  0.5 -> 0.569  Inexact Rounded\r
+pwsx3584  power 0.0324  0.5 -> 0.180  Inexact Rounded\r
+pwsx3585  power 0.325  0.5 -> 0.570  Inexact Rounded\r
+pwsx3586  power 0.0325  0.5 -> 0.180  Inexact Rounded\r
+pwsx3587  power 0.326  0.5 -> 0.571  Inexact Rounded\r
+pwsx3588  power 0.0326  0.5 -> 0.181  Inexact Rounded\r
+pwsx3589  power 0.327  0.5 -> 0.572  Inexact Rounded\r
+pwsx3590  power 0.0327  0.5 -> 0.181  Inexact Rounded\r
+pwsx3591  power 0.328  0.5 -> 0.573  Inexact Rounded\r
+pwsx3592  power 0.0328  0.5 -> 0.181  Inexact Rounded\r
+pwsx3593  power 0.329  0.5 -> 0.574  Inexact Rounded\r
+pwsx3594  power 0.0329  0.5 -> 0.181  Inexact Rounded\r
+pwsx3595  power 0.331  0.5 -> 0.575  Inexact Rounded\r
+pwsx3596  power 0.0331  0.5 -> 0.182  Inexact Rounded\r
+pwsx3597  power 0.332  0.5 -> 0.576  Inexact Rounded\r
+pwsx3598  power 0.0332  0.5 -> 0.182  Inexact Rounded\r
+pwsx3599  power 0.333  0.5 -> 0.577  Inexact Rounded\r
+pwsx3600  power 0.0333  0.5 -> 0.182  Inexact Rounded\r
+pwsx3601  power 0.334  0.5 -> 0.578  Inexact Rounded\r
+pwsx3602  power 0.0334  0.5 -> 0.183  Inexact Rounded\r
+pwsx3603  power 0.335  0.5 -> 0.579  Inexact Rounded\r
+pwsx3604  power 0.0335  0.5 -> 0.183  Inexact Rounded\r
+pwsx3605  power 0.336  0.5 -> 0.580  Inexact Rounded\r
+pwsx3606  power 0.0336  0.5 -> 0.183  Inexact Rounded\r
+pwsx3607  power 0.337  0.5 -> 0.581  Inexact Rounded\r
+pwsx3608  power 0.0337  0.5 -> 0.184  Inexact Rounded\r
+pwsx3609  power 0.338  0.5 -> 0.581  Inexact Rounded\r
+pwsx3610  power 0.0338  0.5 -> 0.184  Inexact Rounded\r
+pwsx3611  power 0.339  0.5 -> 0.582  Inexact Rounded\r
+pwsx3612  power 0.0339  0.5 -> 0.184  Inexact Rounded\r
+pwsx3613  power 0.341  0.5 -> 0.584  Inexact Rounded\r
+pwsx3614  power 0.0341  0.5 -> 0.185  Inexact Rounded\r
+pwsx3615  power 0.342  0.5 -> 0.585  Inexact Rounded\r
+pwsx3616  power 0.0342  0.5 -> 0.185  Inexact Rounded\r
+pwsx3617  power 0.343  0.5 -> 0.586  Inexact Rounded\r
+pwsx3618  power 0.0343  0.5 -> 0.185  Inexact Rounded\r
+pwsx3619  power 0.344  0.5 -> 0.587  Inexact Rounded\r
+pwsx3620  power 0.0344  0.5 -> 0.185  Inexact Rounded\r
+pwsx3621  power 0.345  0.5 -> 0.587  Inexact Rounded\r
+pwsx3622  power 0.0345  0.5 -> 0.186  Inexact Rounded\r
+pwsx3623  power 0.346  0.5 -> 0.588  Inexact Rounded\r
+pwsx3624  power 0.0346  0.5 -> 0.186  Inexact Rounded\r
+pwsx3625  power 0.347  0.5 -> 0.589  Inexact Rounded\r
+pwsx3626  power 0.0347  0.5 -> 0.186  Inexact Rounded\r
+pwsx3627  power 0.348  0.5 -> 0.590  Inexact Rounded\r
+pwsx3628  power 0.0348  0.5 -> 0.187  Inexact Rounded\r
+pwsx3629  power 0.349  0.5 -> 0.591  Inexact Rounded\r
+pwsx3630  power 0.0349  0.5 -> 0.187  Inexact Rounded\r
+pwsx3631  power 0.351  0.5 -> 0.592  Inexact Rounded\r
+pwsx3632  power 0.0351  0.5 -> 0.187  Inexact Rounded\r
+pwsx3633  power 0.352  0.5 -> 0.593  Inexact Rounded\r
+pwsx3634  power 0.0352  0.5 -> 0.188  Inexact Rounded\r
+pwsx3635  power 0.353  0.5 -> 0.594  Inexact Rounded\r
+pwsx3636  power 0.0353  0.5 -> 0.188  Inexact Rounded\r
+pwsx3637  power 0.354  0.5 -> 0.595  Inexact Rounded\r
+pwsx3638  power 0.0354  0.5 -> 0.188  Inexact Rounded\r
+pwsx3639  power 0.355  0.5 -> 0.596  Inexact Rounded\r
+pwsx3640  power 0.0355  0.5 -> 0.188  Inexact Rounded\r
+pwsx3641  power 0.356  0.5 -> 0.597  Inexact Rounded\r
+pwsx3642  power 0.0356  0.5 -> 0.189  Inexact Rounded\r
+pwsx3643  power 0.357  0.5 -> 0.597  Inexact Rounded\r
+pwsx3644  power 0.0357  0.5 -> 0.189  Inexact Rounded\r
+pwsx3645  power 0.358  0.5 -> 0.598  Inexact Rounded\r
+pwsx3646  power 0.0358  0.5 -> 0.189  Inexact Rounded\r
+pwsx3647  power 0.359  0.5 -> 0.599  Inexact Rounded\r
+pwsx3648  power 0.0359  0.5 -> 0.189  Inexact Rounded\r
+pwsx3649  power 0.361  0.5 -> 0.601  Inexact Rounded\r
+pwsx3650  power 0.0361  0.5 -> 0.190  Inexact Rounded\r
+pwsx3651  power 0.362  0.5 -> 0.602  Inexact Rounded\r
+pwsx3652  power 0.0362  0.5 -> 0.190  Inexact Rounded\r
+pwsx3653  power 0.363  0.5 -> 0.602  Inexact Rounded\r
+pwsx3654  power 0.0363  0.5 -> 0.191  Inexact Rounded\r
+pwsx3655  power 0.364  0.5 -> 0.603  Inexact Rounded\r
+pwsx3656  power 0.0364  0.5 -> 0.191  Inexact Rounded\r
+pwsx3657  power 0.365  0.5 -> 0.604  Inexact Rounded\r
+pwsx3658  power 0.0365  0.5 -> 0.191  Inexact Rounded\r
+pwsx3659  power 0.366  0.5 -> 0.605  Inexact Rounded\r
+pwsx3660  power 0.0366  0.5 -> 0.191  Inexact Rounded\r
+pwsx3661  power 0.367  0.5 -> 0.606  Inexact Rounded\r
+pwsx3662  power 0.0367  0.5 -> 0.192  Inexact Rounded\r
+pwsx3663  power 0.368  0.5 -> 0.607  Inexact Rounded\r
+pwsx3664  power 0.0368  0.5 -> 0.192  Inexact Rounded\r
+pwsx3665  power 0.369  0.5 -> 0.607  Inexact Rounded\r
+pwsx3666  power 0.0369  0.5 -> 0.192  Inexact Rounded\r
+pwsx3667  power 0.371  0.5 -> 0.609  Inexact Rounded\r
+pwsx3668  power 0.0371  0.5 -> 0.193  Inexact Rounded\r
+pwsx3669  power 0.372  0.5 -> 0.610  Inexact Rounded\r
+pwsx3670  power 0.0372  0.5 -> 0.193  Inexact Rounded\r
+pwsx3671  power 0.373  0.5 -> 0.611  Inexact Rounded\r
+pwsx3672  power 0.0373  0.5 -> 0.193  Inexact Rounded\r
+pwsx3673  power 0.374  0.5 -> 0.612  Inexact Rounded\r
+pwsx3674  power 0.0374  0.5 -> 0.193  Inexact Rounded\r
+pwsx3675  power 0.375  0.5 -> 0.612  Inexact Rounded\r
+pwsx3676  power 0.0375  0.5 -> 0.194  Inexact Rounded\r
+pwsx3677  power 0.376  0.5 -> 0.613  Inexact Rounded\r
+pwsx3678  power 0.0376  0.5 -> 0.194  Inexact Rounded\r
+pwsx3679  power 0.377  0.5 -> 0.614  Inexact Rounded\r
+pwsx3680  power 0.0377  0.5 -> 0.194  Inexact Rounded\r
+pwsx3681  power 0.378  0.5 -> 0.615  Inexact Rounded\r
+pwsx3682  power 0.0378  0.5 -> 0.194  Inexact Rounded\r
+pwsx3683  power 0.379  0.5 -> 0.616  Inexact Rounded\r
+pwsx3684  power 0.0379  0.5 -> 0.195  Inexact Rounded\r
+pwsx3685  power 0.381  0.5 -> 0.617  Inexact Rounded\r
+pwsx3686  power 0.0381  0.5 -> 0.195  Inexact Rounded\r
+pwsx3687  power 0.382  0.5 -> 0.618  Inexact Rounded\r
+pwsx3688  power 0.0382  0.5 -> 0.195  Inexact Rounded\r
+pwsx3689  power 0.383  0.5 -> 0.619  Inexact Rounded\r
+pwsx3690  power 0.0383  0.5 -> 0.196  Inexact Rounded\r
+pwsx3691  power 0.384  0.5 -> 0.620  Inexact Rounded\r
+pwsx3692  power 0.0384  0.5 -> 0.196  Inexact Rounded\r
+pwsx3693  power 0.385  0.5 -> 0.620  Inexact Rounded\r
+pwsx3694  power 0.0385  0.5 -> 0.196  Inexact Rounded\r
+pwsx3695  power 0.386  0.5 -> 0.621  Inexact Rounded\r
+pwsx3696  power 0.0386  0.5 -> 0.196  Inexact Rounded\r
+pwsx3697  power 0.387  0.5 -> 0.622  Inexact Rounded\r
+pwsx3698  power 0.0387  0.5 -> 0.197  Inexact Rounded\r
+pwsx3699  power 0.388  0.5 -> 0.623  Inexact Rounded\r
+pwsx3700  power 0.0388  0.5 -> 0.197  Inexact Rounded\r
+pwsx3701  power 0.389  0.5 -> 0.624  Inexact Rounded\r
+pwsx3702  power 0.0389  0.5 -> 0.197  Inexact Rounded\r
+pwsx3703  power 0.391  0.5 -> 0.625  Inexact Rounded\r
+pwsx3704  power 0.0391  0.5 -> 0.198  Inexact Rounded\r
+pwsx3705  power 0.392  0.5 -> 0.626  Inexact Rounded\r
+pwsx3706  power 0.0392  0.5 -> 0.198  Inexact Rounded\r
+pwsx3707  power 0.393  0.5 -> 0.627  Inexact Rounded\r
+pwsx3708  power 0.0393  0.5 -> 0.198  Inexact Rounded\r
+pwsx3709  power 0.394  0.5 -> 0.628  Inexact Rounded\r
+pwsx3710  power 0.0394  0.5 -> 0.198  Inexact Rounded\r
+pwsx3711  power 0.395  0.5 -> 0.628  Inexact Rounded\r
+pwsx3712  power 0.0395  0.5 -> 0.199  Inexact Rounded\r
+pwsx3713  power 0.396  0.5 -> 0.629  Inexact Rounded\r
+pwsx3714  power 0.0396  0.5 -> 0.199  Inexact Rounded\r
+pwsx3715  power 0.397  0.5 -> 0.630  Inexact Rounded\r
+pwsx3716  power 0.0397  0.5 -> 0.199  Inexact Rounded\r
+pwsx3717  power 0.398  0.5 -> 0.631  Inexact Rounded\r
+pwsx3718  power 0.0398  0.5 -> 0.199  Inexact Rounded\r
+pwsx3719  power 0.399  0.5 -> 0.632  Inexact Rounded\r
+pwsx3720  power 0.0399  0.5 -> 0.200  Inexact Rounded\r
+pwsx3721  power 0.401  0.5 -> 0.633  Inexact Rounded\r
+pwsx3722  power 0.0401  0.5 -> 0.200  Inexact Rounded\r
+pwsx3723  power 0.402  0.5 -> 0.634  Inexact Rounded\r
+pwsx3724  power 0.0402  0.5 -> 0.200  Inexact Rounded\r
+pwsx3725  power 0.403  0.5 -> 0.635  Inexact Rounded\r
+pwsx3726  power 0.0403  0.5 -> 0.201  Inexact Rounded\r
+pwsx3727  power 0.404  0.5 -> 0.636  Inexact Rounded\r
+pwsx3728  power 0.0404  0.5 -> 0.201  Inexact Rounded\r
+pwsx3729  power 0.405  0.5 -> 0.636  Inexact Rounded\r
+pwsx3730  power 0.0405  0.5 -> 0.201  Inexact Rounded\r
+pwsx3731  power 0.406  0.5 -> 0.637  Inexact Rounded\r
+pwsx3732  power 0.0406  0.5 -> 0.201  Inexact Rounded\r
+pwsx3733  power 0.407  0.5 -> 0.638  Inexact Rounded\r
+pwsx3734  power 0.0407  0.5 -> 0.202  Inexact Rounded\r
+pwsx3735  power 0.408  0.5 -> 0.639  Inexact Rounded\r
+pwsx3736  power 0.0408  0.5 -> 0.202  Inexact Rounded\r
+pwsx3737  power 0.409  0.5 -> 0.640  Inexact Rounded\r
+pwsx3738  power 0.0409  0.5 -> 0.202  Inexact Rounded\r
+pwsx3739  power 0.411  0.5 -> 0.641  Inexact Rounded\r
+pwsx3740  power 0.0411  0.5 -> 0.203  Inexact Rounded\r
+pwsx3741  power 0.412  0.5 -> 0.642  Inexact Rounded\r
+pwsx3742  power 0.0412  0.5 -> 0.203  Inexact Rounded\r
+pwsx3743  power 0.413  0.5 -> 0.643  Inexact Rounded\r
+pwsx3744  power 0.0413  0.5 -> 0.203  Inexact Rounded\r
+pwsx3745  power 0.414  0.5 -> 0.643  Inexact Rounded\r
+pwsx3746  power 0.0414  0.5 -> 0.203  Inexact Rounded\r
+pwsx3747  power 0.415  0.5 -> 0.644  Inexact Rounded\r
+pwsx3748  power 0.0415  0.5 -> 0.204  Inexact Rounded\r
+pwsx3749  power 0.416  0.5 -> 0.645  Inexact Rounded\r
+pwsx3750  power 0.0416  0.5 -> 0.204  Inexact Rounded\r
+pwsx3751  power 0.417  0.5 -> 0.646  Inexact Rounded\r
+pwsx3752  power 0.0417  0.5 -> 0.204  Inexact Rounded\r
+pwsx3753  power 0.418  0.5 -> 0.647  Inexact Rounded\r
+pwsx3754  power 0.0418  0.5 -> 0.204  Inexact Rounded\r
+pwsx3755  power 0.419  0.5 -> 0.647  Inexact Rounded\r
+pwsx3756  power 0.0419  0.5 -> 0.205  Inexact Rounded\r
+pwsx3757  power 0.421  0.5 -> 0.649  Inexact Rounded\r
+pwsx3758  power 0.0421  0.5 -> 0.205  Inexact Rounded\r
+pwsx3759  power 0.422  0.5 -> 0.650  Inexact Rounded\r
+pwsx3760  power 0.0422  0.5 -> 0.205  Inexact Rounded\r
+pwsx3761  power 0.423  0.5 -> 0.650  Inexact Rounded\r
+pwsx3762  power 0.0423  0.5 -> 0.206  Inexact Rounded\r
+pwsx3763  power 0.424  0.5 -> 0.651  Inexact Rounded\r
+pwsx3764  power 0.0424  0.5 -> 0.206  Inexact Rounded\r
+pwsx3765  power 0.425  0.5 -> 0.652  Inexact Rounded\r
+pwsx3766  power 0.0425  0.5 -> 0.206  Inexact Rounded\r
+pwsx3767  power 0.426  0.5 -> 0.653  Inexact Rounded\r
+pwsx3768  power 0.0426  0.5 -> 0.206  Inexact Rounded\r
+pwsx3769  power 0.427  0.5 -> 0.653  Inexact Rounded\r
+pwsx3770  power 0.0427  0.5 -> 0.207  Inexact Rounded\r
+pwsx3771  power 0.428  0.5 -> 0.654  Inexact Rounded\r
+pwsx3772  power 0.0428  0.5 -> 0.207  Inexact Rounded\r
+pwsx3773  power 0.429  0.5 -> 0.655  Inexact Rounded\r
+pwsx3774  power 0.0429  0.5 -> 0.207  Inexact Rounded\r
+pwsx3775  power 0.431  0.5 -> 0.657  Inexact Rounded\r
+pwsx3776  power 0.0431  0.5 -> 0.208  Inexact Rounded\r
+pwsx3777  power 0.432  0.5 -> 0.657  Inexact Rounded\r
+pwsx3778  power 0.0432  0.5 -> 0.208  Inexact Rounded\r
+pwsx3779  power 0.433  0.5 -> 0.658  Inexact Rounded\r
+pwsx3780  power 0.0433  0.5 -> 0.208  Inexact Rounded\r
+pwsx3781  power 0.434  0.5 -> 0.659  Inexact Rounded\r
+pwsx3782  power 0.0434  0.5 -> 0.208  Inexact Rounded\r
+pwsx3783  power 0.435  0.5 -> 0.660  Inexact Rounded\r
+pwsx3784  power 0.0435  0.5 -> 0.209  Inexact Rounded\r
+pwsx3785  power 0.436  0.5 -> 0.660  Inexact Rounded\r
+pwsx3786  power 0.0436  0.5 -> 0.209  Inexact Rounded\r
+pwsx3787  power 0.437  0.5 -> 0.661  Inexact Rounded\r
+pwsx3788  power 0.0437  0.5 -> 0.209  Inexact Rounded\r
+pwsx3789  power 0.438  0.5 -> 0.662  Inexact Rounded\r
+pwsx3790  power 0.0438  0.5 -> 0.209  Inexact Rounded\r
+pwsx3791  power 0.439  0.5 -> 0.663  Inexact Rounded\r
+pwsx3792  power 0.0439  0.5 -> 0.210  Inexact Rounded\r
+pwsx3793  power 0.441  0.5 -> 0.664  Inexact Rounded\r
+pwsx3794  power 0.0441  0.5 -> 0.210  Inexact Rounded\r
+pwsx3795  power 0.442  0.5 -> 0.665  Inexact Rounded\r
+pwsx3796  power 0.0442  0.5 -> 0.210  Inexact Rounded\r
+pwsx3797  power 0.443  0.5 -> 0.666  Inexact Rounded\r
+pwsx3798  power 0.0443  0.5 -> 0.210  Inexact Rounded\r
+pwsx3799  power 0.444  0.5 -> 0.666  Inexact Rounded\r
+pwsx3800  power 0.0444  0.5 -> 0.211  Inexact Rounded\r
+pwsx3801  power 0.445  0.5 -> 0.667  Inexact Rounded\r
+pwsx3802  power 0.0445  0.5 -> 0.211  Inexact Rounded\r
+pwsx3803  power 0.446  0.5 -> 0.668  Inexact Rounded\r
+pwsx3804  power 0.0446  0.5 -> 0.211  Inexact Rounded\r
+pwsx3805  power 0.447  0.5 -> 0.669  Inexact Rounded\r
+pwsx3806  power 0.0447  0.5 -> 0.211  Inexact Rounded\r
+pwsx3807  power 0.448  0.5 -> 0.669  Inexact Rounded\r
+pwsx3808  power 0.0448  0.5 -> 0.212  Inexact Rounded\r
+pwsx3809  power 0.449  0.5 -> 0.670  Inexact Rounded\r
+pwsx3810  power 0.0449  0.5 -> 0.212  Inexact Rounded\r
+pwsx3811  power 0.451  0.5 -> 0.672  Inexact Rounded\r
+pwsx3812  power 0.0451  0.5 -> 0.212  Inexact Rounded\r
+pwsx3813  power 0.452  0.5 -> 0.672  Inexact Rounded\r
+pwsx3814  power 0.0452  0.5 -> 0.213  Inexact Rounded\r
+pwsx3815  power 0.453  0.5 -> 0.673  Inexact Rounded\r
+pwsx3816  power 0.0453  0.5 -> 0.213  Inexact Rounded\r
+pwsx3817  power 0.454  0.5 -> 0.674  Inexact Rounded\r
+pwsx3818  power 0.0454  0.5 -> 0.213  Inexact Rounded\r
+pwsx3819  power 0.455  0.5 -> 0.675  Inexact Rounded\r
+pwsx3820  power 0.0455  0.5 -> 0.213  Inexact Rounded\r
+pwsx3821  power 0.456  0.5 -> 0.675  Inexact Rounded\r
+pwsx3822  power 0.0456  0.5 -> 0.214  Inexact Rounded\r
+pwsx3823  power 0.457  0.5 -> 0.676  Inexact Rounded\r
+pwsx3824  power 0.0457  0.5 -> 0.214  Inexact Rounded\r
+pwsx3825  power 0.458  0.5 -> 0.677  Inexact Rounded\r
+pwsx3826  power 0.0458  0.5 -> 0.214  Inexact Rounded\r
+pwsx3827  power 0.459  0.5 -> 0.677  Inexact Rounded\r
+pwsx3828  power 0.0459  0.5 -> 0.214  Inexact Rounded\r
+pwsx3829  power 0.461  0.5 -> 0.679  Inexact Rounded\r
+pwsx3830  power 0.0461  0.5 -> 0.215  Inexact Rounded\r
+pwsx3831  power 0.462  0.5 -> 0.680  Inexact Rounded\r
+pwsx3832  power 0.0462  0.5 -> 0.215  Inexact Rounded\r
+pwsx3833  power 0.463  0.5 -> 0.680  Inexact Rounded\r
+pwsx3834  power 0.0463  0.5 -> 0.215  Inexact Rounded\r
+pwsx3835  power 0.464  0.5 -> 0.681  Inexact Rounded\r
+pwsx3836  power 0.0464  0.5 -> 0.215  Inexact Rounded\r
+pwsx3837  power 0.465  0.5 -> 0.682  Inexact Rounded\r
+pwsx3838  power 0.0465  0.5 -> 0.216  Inexact Rounded\r
+pwsx3839  power 0.466  0.5 -> 0.683  Inexact Rounded\r
+pwsx3840  power 0.0466  0.5 -> 0.216  Inexact Rounded\r
+pwsx3841  power 0.467  0.5 -> 0.683  Inexact Rounded\r
+pwsx3842  power 0.0467  0.5 -> 0.216  Inexact Rounded\r
+pwsx3843  power 0.468  0.5 -> 0.684  Inexact Rounded\r
+pwsx3844  power 0.0468  0.5 -> 0.216  Inexact Rounded\r
+pwsx3845  power 0.469  0.5 -> 0.685  Inexact Rounded\r
+pwsx3846  power 0.0469  0.5 -> 0.217  Inexact Rounded\r
+pwsx3847  power 0.471  0.5 -> 0.686  Inexact Rounded\r
+pwsx3848  power 0.0471  0.5 -> 0.217  Inexact Rounded\r
+pwsx3849  power 0.472  0.5 -> 0.687  Inexact Rounded\r
+pwsx3850  power 0.0472  0.5 -> 0.217  Inexact Rounded\r
+pwsx3851  power 0.473  0.5 -> 0.688  Inexact Rounded\r
+pwsx3852  power 0.0473  0.5 -> 0.217  Inexact Rounded\r
+pwsx3853  power 0.474  0.5 -> 0.688  Inexact Rounded\r
+pwsx3854  power 0.0474  0.5 -> 0.218  Inexact Rounded\r
+pwsx3855  power 0.475  0.5 -> 0.689  Inexact Rounded\r
+pwsx3856  power 0.0475  0.5 -> 0.218  Inexact Rounded\r
+pwsx3857  power 0.476  0.5 -> 0.690  Inexact Rounded\r
+pwsx3858  power 0.0476  0.5 -> 0.218  Inexact Rounded\r
+pwsx3859  power 0.477  0.5 -> 0.691  Inexact Rounded\r
+pwsx3860  power 0.0477  0.5 -> 0.218  Inexact Rounded\r
+pwsx3861  power 0.478  0.5 -> 0.691  Inexact Rounded\r
+pwsx3862  power 0.0478  0.5 -> 0.219  Inexact Rounded\r
+pwsx3863  power 0.479  0.5 -> 0.692  Inexact Rounded\r
+pwsx3864  power 0.0479  0.5 -> 0.219  Inexact Rounded\r
+pwsx3865  power 0.481  0.5 -> 0.694  Inexact Rounded\r
+pwsx3866  power 0.0481  0.5 -> 0.219  Inexact Rounded\r
+pwsx3867  power 0.482  0.5 -> 0.694  Inexact Rounded\r
+pwsx3868  power 0.0482  0.5 -> 0.220  Inexact Rounded\r
+pwsx3869  power 0.483  0.5 -> 0.695  Inexact Rounded\r
+pwsx3870  power 0.0483  0.5 -> 0.220  Inexact Rounded\r
+pwsx3871  power 0.484  0.5 -> 0.696  Inexact Rounded\r
+pwsx3872  power 0.0484  0.5 -> 0.220  Inexact Rounded\r
+pwsx3873  power 0.485  0.5 -> 0.696  Inexact Rounded\r
+pwsx3874  power 0.0485  0.5 -> 0.220  Inexact Rounded\r
+pwsx3875  power 0.486  0.5 -> 0.697  Inexact Rounded\r
+pwsx3876  power 0.0486  0.5 -> 0.220  Inexact Rounded\r
+pwsx3877  power 0.487  0.5 -> 0.698  Inexact Rounded\r
+pwsx3878  power 0.0487  0.5 -> 0.221  Inexact Rounded\r
+pwsx3879  power 0.488  0.5 -> 0.699  Inexact Rounded\r
+pwsx3880  power 0.0488  0.5 -> 0.221  Inexact Rounded\r
+pwsx3881  power 0.489  0.5 -> 0.699  Inexact Rounded\r
+pwsx3882  power 0.0489  0.5 -> 0.221  Inexact Rounded\r
+pwsx3883  power 0.491  0.5 -> 0.701  Inexact Rounded\r
+pwsx3884  power 0.0491  0.5 -> 0.222  Inexact Rounded\r
+pwsx3885  power 0.492  0.5 -> 0.701  Inexact Rounded\r
+pwsx3886  power 0.0492  0.5 -> 0.222  Inexact Rounded\r
+pwsx3887  power 0.493  0.5 -> 0.702  Inexact Rounded\r
+pwsx3888  power 0.0493  0.5 -> 0.222  Inexact Rounded\r
+pwsx3889  power 0.494  0.5 -> 0.703  Inexact Rounded\r
+pwsx3890  power 0.0494  0.5 -> 0.222  Inexact Rounded\r
+pwsx3891  power 0.495  0.5 -> 0.704  Inexact Rounded\r
+pwsx3892  power 0.0495  0.5 -> 0.222  Inexact Rounded\r
+pwsx3893  power 0.496  0.5 -> 0.704  Inexact Rounded\r
+pwsx3894  power 0.0496  0.5 -> 0.223  Inexact Rounded\r
+pwsx3895  power 0.497  0.5 -> 0.705  Inexact Rounded\r
+pwsx3896  power 0.0497  0.5 -> 0.223  Inexact Rounded\r
+pwsx3897  power 0.498  0.5 -> 0.706  Inexact Rounded\r
+pwsx3898  power 0.0498  0.5 -> 0.223  Inexact Rounded\r
+pwsx3899  power 0.499  0.5 -> 0.706  Inexact Rounded\r
+pwsx3900  power 0.0499  0.5 -> 0.223  Inexact Rounded\r
+pwsx3901  power 0.501  0.5 -> 0.708  Inexact Rounded\r
+pwsx3902  power 0.0501  0.5 -> 0.224  Inexact Rounded\r
+pwsx3903  power 0.502  0.5 -> 0.709  Inexact Rounded\r
+pwsx3904  power 0.0502  0.5 -> 0.224  Inexact Rounded\r
+pwsx3905  power 0.503  0.5 -> 0.709  Inexact Rounded\r
+pwsx3906  power 0.0503  0.5 -> 0.224  Inexact Rounded\r
+pwsx3907  power 0.504  0.5 -> 0.710  Inexact Rounded\r
+pwsx3908  power 0.0504  0.5 -> 0.224  Inexact Rounded\r
+pwsx3909  power 0.505  0.5 -> 0.711  Inexact Rounded\r
+pwsx3910  power 0.0505  0.5 -> 0.225  Inexact Rounded\r
+pwsx3911  power 0.506  0.5 -> 0.711  Inexact Rounded\r
+pwsx3912  power 0.0506  0.5 -> 0.225  Inexact Rounded\r
+pwsx3913  power 0.507  0.5 -> 0.712  Inexact Rounded\r
+pwsx3914  power 0.0507  0.5 -> 0.225  Inexact Rounded\r
+pwsx3915  power 0.508  0.5 -> 0.713  Inexact Rounded\r
+pwsx3916  power 0.0508  0.5 -> 0.225  Inexact Rounded\r
+pwsx3917  power 0.509  0.5 -> 0.713  Inexact Rounded\r
+pwsx3918  power 0.0509  0.5 -> 0.226  Inexact Rounded\r
+pwsx3919  power 0.511  0.5 -> 0.715  Inexact Rounded\r
+pwsx3920  power 0.0511  0.5 -> 0.226  Inexact Rounded\r
+pwsx3921  power 0.512  0.5 -> 0.716  Inexact Rounded\r
+pwsx3922  power 0.0512  0.5 -> 0.226  Inexact Rounded\r
+pwsx3923  power 0.513  0.5 -> 0.716  Inexact Rounded\r
+pwsx3924  power 0.0513  0.5 -> 0.226  Inexact Rounded\r
+pwsx3925  power 0.514  0.5 -> 0.717  Inexact Rounded\r
+pwsx3926  power 0.0514  0.5 -> 0.227  Inexact Rounded\r
+pwsx3927  power 0.515  0.5 -> 0.718  Inexact Rounded\r
+pwsx3928  power 0.0515  0.5 -> 0.227  Inexact Rounded\r
+pwsx3929  power 0.516  0.5 -> 0.718  Inexact Rounded\r
+pwsx3930  power 0.0516  0.5 -> 0.227  Inexact Rounded\r
+pwsx3931  power 0.517  0.5 -> 0.719  Inexact Rounded\r
+pwsx3932  power 0.0517  0.5 -> 0.227  Inexact Rounded\r
+pwsx3933  power 0.518  0.5 -> 0.720  Inexact Rounded\r
+pwsx3934  power 0.0518  0.5 -> 0.228  Inexact Rounded\r
+pwsx3935  power 0.519  0.5 -> 0.720  Inexact Rounded\r
+pwsx3936  power 0.0519  0.5 -> 0.228  Inexact Rounded\r
+pwsx3937  power 0.521  0.5 -> 0.722  Inexact Rounded\r
+pwsx3938  power 0.0521  0.5 -> 0.228  Inexact Rounded\r
+pwsx3939  power 0.522  0.5 -> 0.722  Inexact Rounded\r
+pwsx3940  power 0.0522  0.5 -> 0.228  Inexact Rounded\r
+pwsx3941  power 0.523  0.5 -> 0.723  Inexact Rounded\r
+pwsx3942  power 0.0523  0.5 -> 0.229  Inexact Rounded\r
+pwsx3943  power 0.524  0.5 -> 0.724  Inexact Rounded\r
+pwsx3944  power 0.0524  0.5 -> 0.229  Inexact Rounded\r
+pwsx3945  power 0.525  0.5 -> 0.725  Inexact Rounded\r
+pwsx3946  power 0.0525  0.5 -> 0.229  Inexact Rounded\r
+pwsx3947  power 0.526  0.5 -> 0.725  Inexact Rounded\r
+pwsx3948  power 0.0526  0.5 -> 0.229  Inexact Rounded\r
+pwsx3949  power 0.527  0.5 -> 0.726  Inexact Rounded\r
+pwsx3950  power 0.0527  0.5 -> 0.230  Inexact Rounded\r
+pwsx3951  power 0.528  0.5 -> 0.727  Inexact Rounded\r
+pwsx3952  power 0.0528  0.5 -> 0.230  Inexact Rounded\r
+pwsx3953  power 0.529  0.5 -> 0.727  Inexact Rounded\r
+pwsx3954  power 0.0529  0.5 -> 0.230  Inexact Rounded\r
+pwsx3955  power 0.531  0.5 -> 0.729  Inexact Rounded\r
+pwsx3956  power 0.0531  0.5 -> 0.230  Inexact Rounded\r
+pwsx3957  power 0.532  0.5 -> 0.729  Inexact Rounded\r
+pwsx3958  power 0.0532  0.5 -> 0.231  Inexact Rounded\r
+pwsx3959  power 0.533  0.5 -> 0.730  Inexact Rounded\r
+pwsx3960  power 0.0533  0.5 -> 0.231  Inexact Rounded\r
+pwsx3961  power 0.534  0.5 -> 0.731  Inexact Rounded\r
+pwsx3962  power 0.0534  0.5 -> 0.231  Inexact Rounded\r
+pwsx3963  power 0.535  0.5 -> 0.731  Inexact Rounded\r
+pwsx3964  power 0.0535  0.5 -> 0.231  Inexact Rounded\r
+pwsx3965  power 0.536  0.5 -> 0.732  Inexact Rounded\r
+pwsx3966  power 0.0536  0.5 -> 0.232  Inexact Rounded\r
+pwsx3967  power 0.537  0.5 -> 0.733  Inexact Rounded\r
+pwsx3968  power 0.0537  0.5 -> 0.232  Inexact Rounded\r
+pwsx3969  power 0.538  0.5 -> 0.733  Inexact Rounded\r
+pwsx3970  power 0.0538  0.5 -> 0.232  Inexact Rounded\r
+pwsx3971  power 0.539  0.5 -> 0.734  Inexact Rounded\r
+pwsx3972  power 0.0539  0.5 -> 0.232  Inexact Rounded\r
+pwsx3973  power 0.541  0.5 -> 0.736  Inexact Rounded\r
+pwsx3974  power 0.0541  0.5 -> 0.233  Inexact Rounded\r
+pwsx3975  power 0.542  0.5 -> 0.736  Inexact Rounded\r
+pwsx3976  power 0.0542  0.5 -> 0.233  Inexact Rounded\r
+pwsx3977  power 0.543  0.5 -> 0.737  Inexact Rounded\r
+pwsx3978  power 0.0543  0.5 -> 0.233  Inexact Rounded\r
+pwsx3979  power 0.544  0.5 -> 0.738  Inexact Rounded\r
+pwsx3980  power 0.0544  0.5 -> 0.233  Inexact Rounded\r
+pwsx3981  power 0.545  0.5 -> 0.738  Inexact Rounded\r
+pwsx3982  power 0.0545  0.5 -> 0.233  Inexact Rounded\r
+pwsx3983  power 0.546  0.5 -> 0.739  Inexact Rounded\r
+pwsx3984  power 0.0546  0.5 -> 0.234  Inexact Rounded\r
+pwsx3985  power 0.547  0.5 -> 0.740  Inexact Rounded\r
+pwsx3986  power 0.0547  0.5 -> 0.234  Inexact Rounded\r
+pwsx3987  power 0.548  0.5 -> 0.740  Inexact Rounded\r
+pwsx3988  power 0.0548  0.5 -> 0.234  Inexact Rounded\r
+pwsx3989  power 0.549  0.5 -> 0.741  Inexact Rounded\r
+pwsx3990  power 0.0549  0.5 -> 0.234  Inexact Rounded\r
+pwsx3991  power 0.551  0.5 -> 0.742  Inexact Rounded\r
+pwsx3992  power 0.0551  0.5 -> 0.235  Inexact Rounded\r
+pwsx3993  power 0.552  0.5 -> 0.743  Inexact Rounded\r
+pwsx3994  power 0.0552  0.5 -> 0.235  Inexact Rounded\r
+pwsx3995  power 0.553  0.5 -> 0.744  Inexact Rounded\r
+pwsx3996  power 0.0553  0.5 -> 0.235  Inexact Rounded\r
+pwsx3997  power 0.554  0.5 -> 0.744  Inexact Rounded\r
+pwsx3998  power 0.0554  0.5 -> 0.235  Inexact Rounded\r
+pwsx3999  power 0.555  0.5 -> 0.745  Inexact Rounded\r
+pwsx4000  power 0.0555  0.5 -> 0.236  Inexact Rounded\r
+pwsx4001  power 0.556  0.5 -> 0.746  Inexact Rounded\r
+pwsx4002  power 0.0556  0.5 -> 0.236  Inexact Rounded\r
+pwsx4003  power 0.557  0.5 -> 0.746  Inexact Rounded\r
+pwsx4004  power 0.0557  0.5 -> 0.236  Inexact Rounded\r
+pwsx4005  power 0.558  0.5 -> 0.747  Inexact Rounded\r
+pwsx4006  power 0.0558  0.5 -> 0.236  Inexact Rounded\r
+pwsx4007  power 0.559  0.5 -> 0.748  Inexact Rounded\r
+pwsx4008  power 0.0559  0.5 -> 0.236  Inexact Rounded\r
+pwsx4009  power 0.561  0.5 -> 0.749  Inexact Rounded\r
+pwsx4010  power 0.0561  0.5 -> 0.237  Inexact Rounded\r
+pwsx4011  power 0.562  0.5 -> 0.750  Inexact Rounded\r
+pwsx4012  power 0.0562  0.5 -> 0.237  Inexact Rounded\r
+pwsx4013  power 0.563  0.5 -> 0.750  Inexact Rounded\r
+pwsx4014  power 0.0563  0.5 -> 0.237  Inexact Rounded\r
+pwsx4015  power 0.564  0.5 -> 0.751  Inexact Rounded\r
+pwsx4016  power 0.0564  0.5 -> 0.237  Inexact Rounded\r
+pwsx4017  power 0.565  0.5 -> 0.752  Inexact Rounded\r
+pwsx4018  power 0.0565  0.5 -> 0.238  Inexact Rounded\r
+pwsx4019  power 0.566  0.5 -> 0.752  Inexact Rounded\r
+pwsx4020  power 0.0566  0.5 -> 0.238  Inexact Rounded\r
+pwsx4021  power 0.567  0.5 -> 0.753  Inexact Rounded\r
+pwsx4022  power 0.0567  0.5 -> 0.238  Inexact Rounded\r
+pwsx4023  power 0.568  0.5 -> 0.754  Inexact Rounded\r
+pwsx4024  power 0.0568  0.5 -> 0.238  Inexact Rounded\r
+pwsx4025  power 0.569  0.5 -> 0.754  Inexact Rounded\r
+pwsx4026  power 0.0569  0.5 -> 0.239  Inexact Rounded\r
+pwsx4027  power 0.571  0.5 -> 0.756  Inexact Rounded\r
+pwsx4028  power 0.0571  0.5 -> 0.239  Inexact Rounded\r
+pwsx4029  power 0.572  0.5 -> 0.756  Inexact Rounded\r
+pwsx4030  power 0.0572  0.5 -> 0.239  Inexact Rounded\r
+pwsx4031  power 0.573  0.5 -> 0.757  Inexact Rounded\r
+pwsx4032  power 0.0573  0.5 -> 0.239  Inexact Rounded\r
+pwsx4033  power 0.574  0.5 -> 0.758  Inexact Rounded\r
+pwsx4034  power 0.0574  0.5 -> 0.240  Inexact Rounded\r
+pwsx4035  power 0.575  0.5 -> 0.758  Inexact Rounded\r
+pwsx4036  power 0.0575  0.5 -> 0.240  Inexact Rounded\r
+pwsx4037  power 0.576  0.5 -> 0.759  Inexact Rounded\r
+pwsx4038  power 0.0576  0.5 -> 0.240  Inexact Rounded\r
+pwsx4039  power 0.577  0.5 -> 0.760  Inexact Rounded\r
+pwsx4040  power 0.0577  0.5 -> 0.240  Inexact Rounded\r
+pwsx4041  power 0.578  0.5 -> 0.760  Inexact Rounded\r
+pwsx4042  power 0.0578  0.5 -> 0.240  Inexact Rounded\r
+pwsx4043  power 0.579  0.5 -> 0.761  Inexact Rounded\r
+pwsx4044  power 0.0579  0.5 -> 0.241  Inexact Rounded\r
+pwsx4045  power 0.581  0.5 -> 0.762  Inexact Rounded\r
+pwsx4046  power 0.0581  0.5 -> 0.241  Inexact Rounded\r
+pwsx4047  power 0.582  0.5 -> 0.763  Inexact Rounded\r
+pwsx4048  power 0.0582  0.5 -> 0.241  Inexact Rounded\r
+pwsx4049  power 0.583  0.5 -> 0.764  Inexact Rounded\r
+pwsx4050  power 0.0583  0.5 -> 0.241  Inexact Rounded\r
+pwsx4051  power 0.584  0.5 -> 0.764  Inexact Rounded\r
+pwsx4052  power 0.0584  0.5 -> 0.242  Inexact Rounded\r
+pwsx4053  power 0.585  0.5 -> 0.765  Inexact Rounded\r
+pwsx4054  power 0.0585  0.5 -> 0.242  Inexact Rounded\r
+pwsx4055  power 0.586  0.5 -> 0.766  Inexact Rounded\r
+pwsx4056  power 0.0586  0.5 -> 0.242  Inexact Rounded\r
+pwsx4057  power 0.587  0.5 -> 0.766  Inexact Rounded\r
+pwsx4058  power 0.0587  0.5 -> 0.242  Inexact Rounded\r
+pwsx4059  power 0.588  0.5 -> 0.767  Inexact Rounded\r
+pwsx4060  power 0.0588  0.5 -> 0.242  Inexact Rounded\r
+pwsx4061  power 0.589  0.5 -> 0.767  Inexact Rounded\r
+pwsx4062  power 0.0589  0.5 -> 0.243  Inexact Rounded\r
+pwsx4063  power 0.591  0.5 -> 0.769  Inexact Rounded\r
+pwsx4064  power 0.0591  0.5 -> 0.243  Inexact Rounded\r
+pwsx4065  power 0.592  0.5 -> 0.769  Inexact Rounded\r
+pwsx4066  power 0.0592  0.5 -> 0.243  Inexact Rounded\r
+pwsx4067  power 0.593  0.5 -> 0.770  Inexact Rounded\r
+pwsx4068  power 0.0593  0.5 -> 0.244  Inexact Rounded\r
+pwsx4069  power 0.594  0.5 -> 0.771  Inexact Rounded\r
+pwsx4070  power 0.0594  0.5 -> 0.244  Inexact Rounded\r
+pwsx4071  power 0.595  0.5 -> 0.771  Inexact Rounded\r
+pwsx4072  power 0.0595  0.5 -> 0.244  Inexact Rounded\r
+pwsx4073  power 0.596  0.5 -> 0.772  Inexact Rounded\r
+pwsx4074  power 0.0596  0.5 -> 0.244  Inexact Rounded\r
+pwsx4075  power 0.597  0.5 -> 0.773  Inexact Rounded\r
+pwsx4076  power 0.0597  0.5 -> 0.244  Inexact Rounded\r
+pwsx4077  power 0.598  0.5 -> 0.773  Inexact Rounded\r
+pwsx4078  power 0.0598  0.5 -> 0.245  Inexact Rounded\r
+pwsx4079  power 0.599  0.5 -> 0.774  Inexact Rounded\r
+pwsx4080  power 0.0599  0.5 -> 0.245  Inexact Rounded\r
+pwsx4081  power 0.601  0.5 -> 0.775  Inexact Rounded\r
+pwsx4082  power 0.0601  0.5 -> 0.245  Inexact Rounded\r
+pwsx4083  power 0.602  0.5 -> 0.776  Inexact Rounded\r
+pwsx4084  power 0.0602  0.5 -> 0.245  Inexact Rounded\r
+pwsx4085  power 0.603  0.5 -> 0.777  Inexact Rounded\r
+pwsx4086  power 0.0603  0.5 -> 0.246  Inexact Rounded\r
+pwsx4087  power 0.604  0.5 -> 0.777  Inexact Rounded\r
+pwsx4088  power 0.0604  0.5 -> 0.246  Inexact Rounded\r
+pwsx4089  power 0.605  0.5 -> 0.778  Inexact Rounded\r
+pwsx4090  power 0.0605  0.5 -> 0.246  Inexact Rounded\r
+pwsx4091  power 0.606  0.5 -> 0.778  Inexact Rounded\r
+pwsx4092  power 0.0606  0.5 -> 0.246  Inexact Rounded\r
+pwsx4093  power 0.607  0.5 -> 0.779  Inexact Rounded\r
+pwsx4094  power 0.0607  0.5 -> 0.246  Inexact Rounded\r
+pwsx4095  power 0.608  0.5 -> 0.780  Inexact Rounded\r
+pwsx4096  power 0.0608  0.5 -> 0.247  Inexact Rounded\r
+pwsx4097  power 0.609  0.5 -> 0.780  Inexact Rounded\r
+pwsx4098  power 0.0609  0.5 -> 0.247  Inexact Rounded\r
+pwsx4099  power 0.611  0.5 -> 0.782  Inexact Rounded\r
+pwsx4100  power 0.0611  0.5 -> 0.247  Inexact Rounded\r
+pwsx4101  power 0.612  0.5 -> 0.782  Inexact Rounded\r
+pwsx4102  power 0.0612  0.5 -> 0.247  Inexact Rounded\r
+pwsx4103  power 0.613  0.5 -> 0.783  Inexact Rounded\r
+pwsx4104  power 0.0613  0.5 -> 0.248  Inexact Rounded\r
+pwsx4105  power 0.614  0.5 -> 0.784  Inexact Rounded\r
+pwsx4106  power 0.0614  0.5 -> 0.248  Inexact Rounded\r
+pwsx4107  power 0.615  0.5 -> 0.784  Inexact Rounded\r
+pwsx4108  power 0.0615  0.5 -> 0.248  Inexact Rounded\r
+pwsx4109  power 0.616  0.5 -> 0.785  Inexact Rounded\r
+pwsx4110  power 0.0616  0.5 -> 0.248  Inexact Rounded\r
+pwsx4111  power 0.617  0.5 -> 0.785  Inexact Rounded\r
+pwsx4112  power 0.0617  0.5 -> 0.248  Inexact Rounded\r
+pwsx4113  power 0.618  0.5 -> 0.786  Inexact Rounded\r
+pwsx4114  power 0.0618  0.5 -> 0.249  Inexact Rounded\r
+pwsx4115  power 0.619  0.5 -> 0.787  Inexact Rounded\r
+pwsx4116  power 0.0619  0.5 -> 0.249  Inexact Rounded\r
+pwsx4117  power 0.621  0.5 -> 0.788  Inexact Rounded\r
+pwsx4118  power 0.0621  0.5 -> 0.249  Inexact Rounded\r
+pwsx4119  power 0.622  0.5 -> 0.789  Inexact Rounded\r
+pwsx4120  power 0.0622  0.5 -> 0.249  Inexact Rounded\r
+pwsx4121  power 0.623  0.5 -> 0.789  Inexact Rounded\r
+pwsx4122  power 0.0623  0.5 -> 0.250  Inexact Rounded\r
+pwsx4123  power 0.624  0.5 -> 0.790  Inexact Rounded\r
+pwsx4124  power 0.0624  0.5 -> 0.250  Inexact Rounded\r
+pwsx4125  power 0.625  0.5 -> 0.791  Inexact Rounded\r
+pwsx4126  power 0.0625  0.5 -> 0.250  Inexact Rounded\r
+pwsx4127  power 0.626  0.5 -> 0.791  Inexact Rounded\r
+pwsx4128  power 0.0626  0.5 -> 0.250  Inexact Rounded\r
+pwsx4129  power 0.627  0.5 -> 0.792  Inexact Rounded\r
+pwsx4130  power 0.0627  0.5 -> 0.250  Inexact Rounded\r
+pwsx4131  power 0.628  0.5 -> 0.792  Inexact Rounded\r
+pwsx4132  power 0.0628  0.5 -> 0.251  Inexact Rounded\r
+pwsx4133  power 0.629  0.5 -> 0.793  Inexact Rounded\r
+pwsx4134  power 0.0629  0.5 -> 0.251  Inexact Rounded\r
+pwsx4135  power 0.631  0.5 -> 0.794  Inexact Rounded\r
+pwsx4136  power 0.0631  0.5 -> 0.251  Inexact Rounded\r
+pwsx4137  power 0.632  0.5 -> 0.795  Inexact Rounded\r
+pwsx4138  power 0.0632  0.5 -> 0.251  Inexact Rounded\r
+pwsx4139  power 0.633  0.5 -> 0.796  Inexact Rounded\r
+pwsx4140  power 0.0633  0.5 -> 0.252  Inexact Rounded\r
+pwsx4141  power 0.634  0.5 -> 0.796  Inexact Rounded\r
+pwsx4142  power 0.0634  0.5 -> 0.252  Inexact Rounded\r
+pwsx4143  power 0.635  0.5 -> 0.797  Inexact Rounded\r
+pwsx4144  power 0.0635  0.5 -> 0.252  Inexact Rounded\r
+pwsx4145  power 0.636  0.5 -> 0.797  Inexact Rounded\r
+pwsx4146  power 0.0636  0.5 -> 0.252  Inexact Rounded\r
+pwsx4147  power 0.637  0.5 -> 0.798  Inexact Rounded\r
+pwsx4148  power 0.0637  0.5 -> 0.252  Inexact Rounded\r
+pwsx4149  power 0.638  0.5 -> 0.799  Inexact Rounded\r
+pwsx4150  power 0.0638  0.5 -> 0.253  Inexact Rounded\r
+pwsx4151  power 0.639  0.5 -> 0.799  Inexact Rounded\r
+pwsx4152  power 0.0639  0.5 -> 0.253  Inexact Rounded\r
+pwsx4153  power 0.641  0.5 -> 0.801  Inexact Rounded\r
+pwsx4154  power 0.0641  0.5 -> 0.253  Inexact Rounded\r
+pwsx4155  power 0.642  0.5 -> 0.801  Inexact Rounded\r
+pwsx4156  power 0.0642  0.5 -> 0.253  Inexact Rounded\r
+pwsx4157  power 0.643  0.5 -> 0.802  Inexact Rounded\r
+pwsx4158  power 0.0643  0.5 -> 0.254  Inexact Rounded\r
+pwsx4159  power 0.644  0.5 -> 0.802  Inexact Rounded\r
+pwsx4160  power 0.0644  0.5 -> 0.254  Inexact Rounded\r
+pwsx4161  power 0.645  0.5 -> 0.803  Inexact Rounded\r
+pwsx4162  power 0.0645  0.5 -> 0.254  Inexact Rounded\r
+pwsx4163  power 0.646  0.5 -> 0.804  Inexact Rounded\r
+pwsx4164  power 0.0646  0.5 -> 0.254  Inexact Rounded\r
+pwsx4165  power 0.647  0.5 -> 0.804  Inexact Rounded\r
+pwsx4166  power 0.0647  0.5 -> 0.254  Inexact Rounded\r
+pwsx4167  power 0.648  0.5 -> 0.805  Inexact Rounded\r
+pwsx4168  power 0.0648  0.5 -> 0.255  Inexact Rounded\r
+pwsx4169  power 0.649  0.5 -> 0.806  Inexact Rounded\r
+pwsx4170  power 0.0649  0.5 -> 0.255  Inexact Rounded\r
+pwsx4171  power 0.651  0.5 -> 0.807  Inexact Rounded\r
+pwsx4172  power 0.0651  0.5 -> 0.255  Inexact Rounded\r
+pwsx4173  power 0.652  0.5 -> 0.807  Inexact Rounded\r
+pwsx4174  power 0.0652  0.5 -> 0.255  Inexact Rounded\r
+pwsx4175  power 0.653  0.5 -> 0.808  Inexact Rounded\r
+pwsx4176  power 0.0653  0.5 -> 0.256  Inexact Rounded\r
+pwsx4177  power 0.654  0.5 -> 0.809  Inexact Rounded\r
+pwsx4178  power 0.0654  0.5 -> 0.256  Inexact Rounded\r
+pwsx4179  power 0.655  0.5 -> 0.809  Inexact Rounded\r
+pwsx4180  power 0.0655  0.5 -> 0.256  Inexact Rounded\r
+pwsx4181  power 0.656  0.5 -> 0.810  Inexact Rounded\r
+pwsx4182  power 0.0656  0.5 -> 0.256  Inexact Rounded\r
+pwsx4183  power 0.657  0.5 -> 0.811  Inexact Rounded\r
+pwsx4184  power 0.0657  0.5 -> 0.256  Inexact Rounded\r
+pwsx4185  power 0.658  0.5 -> 0.811  Inexact Rounded\r
+pwsx4186  power 0.0658  0.5 -> 0.257  Inexact Rounded\r
+pwsx4187  power 0.659  0.5 -> 0.812  Inexact Rounded\r
+pwsx4188  power 0.0659  0.5 -> 0.257  Inexact Rounded\r
+pwsx4189  power 0.661  0.5 -> 0.813  Inexact Rounded\r
+pwsx4190  power 0.0661  0.5 -> 0.257  Inexact Rounded\r
+pwsx4191  power 0.662  0.5 -> 0.814  Inexact Rounded\r
+pwsx4192  power 0.0662  0.5 -> 0.257  Inexact Rounded\r
+pwsx4193  power 0.663  0.5 -> 0.814  Inexact Rounded\r
+pwsx4194  power 0.0663  0.5 -> 0.257  Inexact Rounded\r
+pwsx4195  power 0.664  0.5 -> 0.815  Inexact Rounded\r
+pwsx4196  power 0.0664  0.5 -> 0.258  Inexact Rounded\r
+pwsx4197  power 0.665  0.5 -> 0.815  Inexact Rounded\r
+pwsx4198  power 0.0665  0.5 -> 0.258  Inexact Rounded\r
+pwsx4199  power 0.666  0.5 -> 0.816  Inexact Rounded\r
+pwsx4200  power 0.0666  0.5 -> 0.258  Inexact Rounded\r
+pwsx4201  power 0.667  0.5 -> 0.817  Inexact Rounded\r
+pwsx4202  power 0.0667  0.5 -> 0.258  Inexact Rounded\r
+pwsx4203  power 0.668  0.5 -> 0.817  Inexact Rounded\r
+pwsx4204  power 0.0668  0.5 -> 0.258  Inexact Rounded\r
+pwsx4205  power 0.669  0.5 -> 0.818  Inexact Rounded\r
+pwsx4206  power 0.0669  0.5 -> 0.259  Inexact Rounded\r
+pwsx4207  power 0.671  0.5 -> 0.819  Inexact Rounded\r
+pwsx4208  power 0.0671  0.5 -> 0.259  Inexact Rounded\r
+pwsx4209  power 0.672  0.5 -> 0.820  Inexact Rounded\r
+pwsx4210  power 0.0672  0.5 -> 0.259  Inexact Rounded\r
+pwsx4211  power 0.673  0.5 -> 0.820  Inexact Rounded\r
+pwsx4212  power 0.0673  0.5 -> 0.259  Inexact Rounded\r
+pwsx4213  power 0.674  0.5 -> 0.821  Inexact Rounded\r
+pwsx4214  power 0.0674  0.5 -> 0.260  Inexact Rounded\r
+pwsx4215  power 0.675  0.5 -> 0.822  Inexact Rounded\r
+pwsx4216  power 0.0675  0.5 -> 0.260  Inexact Rounded\r
+pwsx4217  power 0.676  0.5 -> 0.822  Inexact Rounded\r
+pwsx4218  power 0.0676  0.5 -> 0.260  Inexact Rounded\r
+pwsx4219  power 0.677  0.5 -> 0.823  Inexact Rounded\r
+pwsx4220  power 0.0677  0.5 -> 0.260  Inexact Rounded\r
+pwsx4221  power 0.678  0.5 -> 0.823  Inexact Rounded\r
+pwsx4222  power 0.0678  0.5 -> 0.260  Inexact Rounded\r
+pwsx4223  power 0.679  0.5 -> 0.824  Inexact Rounded\r
+pwsx4224  power 0.0679  0.5 -> 0.261  Inexact Rounded\r
+pwsx4225  power 0.681  0.5 -> 0.825  Inexact Rounded\r
+pwsx4226  power 0.0681  0.5 -> 0.261  Inexact Rounded\r
+pwsx4227  power 0.682  0.5 -> 0.826  Inexact Rounded\r
+pwsx4228  power 0.0682  0.5 -> 0.261  Inexact Rounded\r
+pwsx4229  power 0.683  0.5 -> 0.826  Inexact Rounded\r
+pwsx4230  power 0.0683  0.5 -> 0.261  Inexact Rounded\r
+pwsx4231  power 0.684  0.5 -> 0.827  Inexact Rounded\r
+pwsx4232  power 0.0684  0.5 -> 0.262  Inexact Rounded\r
+pwsx4233  power 0.685  0.5 -> 0.828  Inexact Rounded\r
+pwsx4234  power 0.0685  0.5 -> 0.262  Inexact Rounded\r
+pwsx4235  power 0.686  0.5 -> 0.828  Inexact Rounded\r
+pwsx4236  power 0.0686  0.5 -> 0.262  Inexact Rounded\r
+pwsx4237  power 0.687  0.5 -> 0.829  Inexact Rounded\r
+pwsx4238  power 0.0687  0.5 -> 0.262  Inexact Rounded\r
+pwsx4239  power 0.688  0.5 -> 0.829  Inexact Rounded\r
+pwsx4240  power 0.0688  0.5 -> 0.262  Inexact Rounded\r
+pwsx4241  power 0.689  0.5 -> 0.830  Inexact Rounded\r
+pwsx4242  power 0.0689  0.5 -> 0.262  Inexact Rounded\r
+pwsx4243  power 0.691  0.5 -> 0.831  Inexact Rounded\r
+pwsx4244  power 0.0691  0.5 -> 0.263  Inexact Rounded\r
+pwsx4245  power 0.692  0.5 -> 0.832  Inexact Rounded\r
+pwsx4246  power 0.0692  0.5 -> 0.263  Inexact Rounded\r
+pwsx4247  power 0.693  0.5 -> 0.832  Inexact Rounded\r
+pwsx4248  power 0.0693  0.5 -> 0.263  Inexact Rounded\r
+pwsx4249  power 0.694  0.5 -> 0.833  Inexact Rounded\r
+pwsx4250  power 0.0694  0.5 -> 0.263  Inexact Rounded\r
+pwsx4251  power 0.695  0.5 -> 0.834  Inexact Rounded\r
+pwsx4252  power 0.0695  0.5 -> 0.264  Inexact Rounded\r
+pwsx4253  power 0.696  0.5 -> 0.834  Inexact Rounded\r
+pwsx4254  power 0.0696  0.5 -> 0.264  Inexact Rounded\r
+pwsx4255  power 0.697  0.5 -> 0.835  Inexact Rounded\r
+pwsx4256  power 0.0697  0.5 -> 0.264  Inexact Rounded\r
+pwsx4257  power 0.698  0.5 -> 0.835  Inexact Rounded\r
+pwsx4258  power 0.0698  0.5 -> 0.264  Inexact Rounded\r
+pwsx4259  power 0.699  0.5 -> 0.836  Inexact Rounded\r
+pwsx4260  power 0.0699  0.5 -> 0.264  Inexact Rounded\r
+pwsx4261  power 0.701  0.5 -> 0.837  Inexact Rounded\r
+pwsx4262  power 0.0701  0.5 -> 0.265  Inexact Rounded\r
+pwsx4263  power 0.702  0.5 -> 0.838  Inexact Rounded\r
+pwsx4264  power 0.0702  0.5 -> 0.265  Inexact Rounded\r
+pwsx4265  power 0.703  0.5 -> 0.838  Inexact Rounded\r
+pwsx4266  power 0.0703  0.5 -> 0.265  Inexact Rounded\r
+pwsx4267  power 0.704  0.5 -> 0.839  Inexact Rounded\r
+pwsx4268  power 0.0704  0.5 -> 0.265  Inexact Rounded\r
+pwsx4269  power 0.705  0.5 -> 0.840  Inexact Rounded\r
+pwsx4270  power 0.0705  0.5 -> 0.266  Inexact Rounded\r
+pwsx4271  power 0.706  0.5 -> 0.840  Inexact Rounded\r
+pwsx4272  power 0.0706  0.5 -> 0.266  Inexact Rounded\r
+pwsx4273  power 0.707  0.5 -> 0.841  Inexact Rounded\r
+pwsx4274  power 0.0707  0.5 -> 0.266  Inexact Rounded\r
+pwsx4275  power 0.708  0.5 -> 0.841  Inexact Rounded\r
+pwsx4276  power 0.0708  0.5 -> 0.266  Inexact Rounded\r
+pwsx4277  power 0.709  0.5 -> 0.842  Inexact Rounded\r
+pwsx4278  power 0.0709  0.5 -> 0.266  Inexact Rounded\r
+pwsx4279  power 0.711  0.5 -> 0.843  Inexact Rounded\r
+pwsx4280  power 0.0711  0.5 -> 0.267  Inexact Rounded\r
+pwsx4281  power 0.712  0.5 -> 0.844  Inexact Rounded\r
+pwsx4282  power 0.0712  0.5 -> 0.267  Inexact Rounded\r
+pwsx4283  power 0.713  0.5 -> 0.844  Inexact Rounded\r
+pwsx4284  power 0.0713  0.5 -> 0.267  Inexact Rounded\r
+pwsx4285  power 0.714  0.5 -> 0.845  Inexact Rounded\r
+pwsx4286  power 0.0714  0.5 -> 0.267  Inexact Rounded\r
+pwsx4287  power 0.715  0.5 -> 0.846  Inexact Rounded\r
+pwsx4288  power 0.0715  0.5 -> 0.267  Inexact Rounded\r
+pwsx4289  power 0.716  0.5 -> 0.846  Inexact Rounded\r
+pwsx4290  power 0.0716  0.5 -> 0.268  Inexact Rounded\r
+pwsx4291  power 0.717  0.5 -> 0.847  Inexact Rounded\r
+pwsx4292  power 0.0717  0.5 -> 0.268  Inexact Rounded\r
+pwsx4293  power 0.718  0.5 -> 0.847  Inexact Rounded\r
+pwsx4294  power 0.0718  0.5 -> 0.268  Inexact Rounded\r
+pwsx4295  power 0.719  0.5 -> 0.848  Inexact Rounded\r
+pwsx4296  power 0.0719  0.5 -> 0.268  Inexact Rounded\r
+pwsx4297  power 0.721  0.5 -> 0.849  Inexact Rounded\r
+pwsx4298  power 0.0721  0.5 -> 0.269  Inexact Rounded\r
+pwsx4299  power 0.722  0.5 -> 0.850  Inexact Rounded\r
+pwsx4300  power 0.0722  0.5 -> 0.269  Inexact Rounded\r
+pwsx4301  power 0.723  0.5 -> 0.850  Inexact Rounded\r
+pwsx4302  power 0.0723  0.5 -> 0.269  Inexact Rounded\r
+pwsx4303  power 0.724  0.5 -> 0.851  Inexact Rounded\r
+pwsx4304  power 0.0724  0.5 -> 0.269  Inexact Rounded\r
+pwsx4305  power 0.725  0.5 -> 0.851  Inexact Rounded\r
+pwsx4306  power 0.0725  0.5 -> 0.269  Inexact Rounded\r
+pwsx4307  power 0.726  0.5 -> 0.852  Inexact Rounded\r
+pwsx4308  power 0.0726  0.5 -> 0.269  Inexact Rounded\r
+pwsx4309  power 0.727  0.5 -> 0.853  Inexact Rounded\r
+pwsx4310  power 0.0727  0.5 -> 0.270  Inexact Rounded\r
+pwsx4311  power 0.728  0.5 -> 0.853  Inexact Rounded\r
+pwsx4312  power 0.0728  0.5 -> 0.270  Inexact Rounded\r
+pwsx4313  power 0.729  0.5 -> 0.854  Inexact Rounded\r
+pwsx4314  power 0.0729  0.5 -> 0.270  Inexact Rounded\r
+pwsx4315  power 0.731  0.5 -> 0.855  Inexact Rounded\r
+pwsx4316  power 0.0731  0.5 -> 0.270  Inexact Rounded\r
+pwsx4317  power 0.732  0.5 -> 0.856  Inexact Rounded\r
+pwsx4318  power 0.0732  0.5 -> 0.271  Inexact Rounded\r
+pwsx4319  power 0.733  0.5 -> 0.856  Inexact Rounded\r
+pwsx4320  power 0.0733  0.5 -> 0.271  Inexact Rounded\r
+pwsx4321  power 0.734  0.5 -> 0.857  Inexact Rounded\r
+pwsx4322  power 0.0734  0.5 -> 0.271  Inexact Rounded\r
+pwsx4323  power 0.735  0.5 -> 0.857  Inexact Rounded\r
+pwsx4324  power 0.0735  0.5 -> 0.271  Inexact Rounded\r
+pwsx4325  power 0.736  0.5 -> 0.858  Inexact Rounded\r
+pwsx4326  power 0.0736  0.5 -> 0.271  Inexact Rounded\r
+pwsx4327  power 0.737  0.5 -> 0.858  Inexact Rounded\r
+pwsx4328  power 0.0737  0.5 -> 0.271  Inexact Rounded\r
+pwsx4329  power 0.738  0.5 -> 0.859  Inexact Rounded\r
+pwsx4330  power 0.0738  0.5 -> 0.272  Inexact Rounded\r
+pwsx4331  power 0.739  0.5 -> 0.860  Inexact Rounded\r
+pwsx4332  power 0.0739  0.5 -> 0.272  Inexact Rounded\r
+pwsx4333  power 0.741  0.5 -> 0.861  Inexact Rounded\r
+pwsx4334  power 0.0741  0.5 -> 0.272  Inexact Rounded\r
+pwsx4335  power 0.742  0.5 -> 0.861  Inexact Rounded\r
+pwsx4336  power 0.0742  0.5 -> 0.272  Inexact Rounded\r
+pwsx4337  power 0.743  0.5 -> 0.862  Inexact Rounded\r
+pwsx4338  power 0.0743  0.5 -> 0.273  Inexact Rounded\r
+pwsx4339  power 0.744  0.5 -> 0.863  Inexact Rounded\r
+pwsx4340  power 0.0744  0.5 -> 0.273  Inexact Rounded\r
+pwsx4341  power 0.745  0.5 -> 0.863  Inexact Rounded\r
+pwsx4342  power 0.0745  0.5 -> 0.273  Inexact Rounded\r
+pwsx4343  power 0.746  0.5 -> 0.864  Inexact Rounded\r
+pwsx4344  power 0.0746  0.5 -> 0.273  Inexact Rounded\r
+pwsx4345  power 0.747  0.5 -> 0.864  Inexact Rounded\r
+pwsx4346  power 0.0747  0.5 -> 0.273  Inexact Rounded\r
+pwsx4347  power 0.748  0.5 -> 0.865  Inexact Rounded\r
+pwsx4348  power 0.0748  0.5 -> 0.273  Inexact Rounded\r
+pwsx4349  power 0.749  0.5 -> 0.865  Inexact Rounded\r
+pwsx4350  power 0.0749  0.5 -> 0.274  Inexact Rounded\r
+pwsx4351  power 0.751  0.5 -> 0.867  Inexact Rounded\r
+pwsx4352  power 0.0751  0.5 -> 0.274  Inexact Rounded\r
+pwsx4353  power 0.752  0.5 -> 0.867  Inexact Rounded\r
+pwsx4354  power 0.0752  0.5 -> 0.274  Inexact Rounded\r
+pwsx4355  power 0.753  0.5 -> 0.868  Inexact Rounded\r
+pwsx4356  power 0.0753  0.5 -> 0.274  Inexact Rounded\r
+pwsx4357  power 0.754  0.5 -> 0.868  Inexact Rounded\r
+pwsx4358  power 0.0754  0.5 -> 0.275  Inexact Rounded\r
+pwsx4359  power 0.755  0.5 -> 0.869  Inexact Rounded\r
+pwsx4360  power 0.0755  0.5 -> 0.275  Inexact Rounded\r
+pwsx4361  power 0.756  0.5 -> 0.869  Inexact Rounded\r
+pwsx4362  power 0.0756  0.5 -> 0.275  Inexact Rounded\r
+pwsx4363  power 0.757  0.5 -> 0.870  Inexact Rounded\r
+pwsx4364  power 0.0757  0.5 -> 0.275  Inexact Rounded\r
+pwsx4365  power 0.758  0.5 -> 0.871  Inexact Rounded\r
+pwsx4366  power 0.0758  0.5 -> 0.275  Inexact Rounded\r
+pwsx4367  power 0.759  0.5 -> 0.871  Inexact Rounded\r
+pwsx4368  power 0.0759  0.5 -> 0.275  Inexact Rounded\r
+pwsx4369  power 0.761  0.5 -> 0.872  Inexact Rounded\r
+pwsx4370  power 0.0761  0.5 -> 0.276  Inexact Rounded\r
+pwsx4371  power 0.762  0.5 -> 0.873  Inexact Rounded\r
+pwsx4372  power 0.0762  0.5 -> 0.276  Inexact Rounded\r
+pwsx4373  power 0.763  0.5 -> 0.873  Inexact Rounded\r
+pwsx4374  power 0.0763  0.5 -> 0.276  Inexact Rounded\r
+pwsx4375  power 0.764  0.5 -> 0.874  Inexact Rounded\r
+pwsx4376  power 0.0764  0.5 -> 0.276  Inexact Rounded\r
+pwsx4377  power 0.765  0.5 -> 0.875  Inexact Rounded\r
+pwsx4378  power 0.0765  0.5 -> 0.277  Inexact Rounded\r
+pwsx4379  power 0.766  0.5 -> 0.875  Inexact Rounded\r
+pwsx4380  power 0.0766  0.5 -> 0.277  Inexact Rounded\r
+pwsx4381  power 0.767  0.5 -> 0.876  Inexact Rounded\r
+pwsx4382  power 0.0767  0.5 -> 0.277  Inexact Rounded\r
+pwsx4383  power 0.768  0.5 -> 0.876  Inexact Rounded\r
+pwsx4384  power 0.0768  0.5 -> 0.277  Inexact Rounded\r
+pwsx4385  power 0.769  0.5 -> 0.877  Inexact Rounded\r
+pwsx4386  power 0.0769  0.5 -> 0.277  Inexact Rounded\r
+pwsx4387  power 0.771  0.5 -> 0.878  Inexact Rounded\r
+pwsx4388  power 0.0771  0.5 -> 0.278  Inexact Rounded\r
+pwsx4389  power 0.772  0.5 -> 0.879  Inexact Rounded\r
+pwsx4390  power 0.0772  0.5 -> 0.278  Inexact Rounded\r
+pwsx4391  power 0.773  0.5 -> 0.879  Inexact Rounded\r
+pwsx4392  power 0.0773  0.5 -> 0.278  Inexact Rounded\r
+pwsx4393  power 0.774  0.5 -> 0.880  Inexact Rounded\r
+pwsx4394  power 0.0774  0.5 -> 0.278  Inexact Rounded\r
+pwsx4395  power 0.775  0.5 -> 0.880  Inexact Rounded\r
+pwsx4396  power 0.0775  0.5 -> 0.278  Inexact Rounded\r
+pwsx4397  power 0.776  0.5 -> 0.881  Inexact Rounded\r
+pwsx4398  power 0.0776  0.5 -> 0.279  Inexact Rounded\r
+pwsx4399  power 0.777  0.5 -> 0.881  Inexact Rounded\r
+pwsx4400  power 0.0777  0.5 -> 0.279  Inexact Rounded\r
+pwsx4401  power 0.778  0.5 -> 0.882  Inexact Rounded\r
+pwsx4402  power 0.0778  0.5 -> 0.279  Inexact Rounded\r
+pwsx4403  power 0.779  0.5 -> 0.883  Inexact Rounded\r
+pwsx4404  power 0.0779  0.5 -> 0.279  Inexact Rounded\r
+pwsx4405  power 0.781  0.5 -> 0.884  Inexact Rounded\r
+pwsx4406  power 0.0781  0.5 -> 0.279  Inexact Rounded\r
+pwsx4407  power 0.782  0.5 -> 0.884  Inexact Rounded\r
+pwsx4408  power 0.0782  0.5 -> 0.280  Inexact Rounded\r
+pwsx4409  power 0.783  0.5 -> 0.885  Inexact Rounded\r
+pwsx4410  power 0.0783  0.5 -> 0.280  Inexact Rounded\r
+pwsx4411  power 0.784  0.5 -> 0.885  Inexact Rounded\r
+pwsx4412  power 0.0784  0.5 -> 0.280  Inexact Rounded\r
+pwsx4413  power 0.785  0.5 -> 0.886  Inexact Rounded\r
+pwsx4414  power 0.0785  0.5 -> 0.280  Inexact Rounded\r
+pwsx4415  power 0.786  0.5 -> 0.887  Inexact Rounded\r
+pwsx4416  power 0.0786  0.5 -> 0.280  Inexact Rounded\r
+pwsx4417  power 0.787  0.5 -> 0.887  Inexact Rounded\r
+pwsx4418  power 0.0787  0.5 -> 0.281  Inexact Rounded\r
+pwsx4419  power 0.788  0.5 -> 0.888  Inexact Rounded\r
+pwsx4420  power 0.0788  0.5 -> 0.281  Inexact Rounded\r
+pwsx4421  power 0.789  0.5 -> 0.888  Inexact Rounded\r
+pwsx4422  power 0.0789  0.5 -> 0.281  Inexact Rounded\r
+pwsx4423  power 0.791  0.5 -> 0.889  Inexact Rounded\r
+pwsx4424  power 0.0791  0.5 -> 0.281  Inexact Rounded\r
+pwsx4425  power 0.792  0.5 -> 0.890  Inexact Rounded\r
+pwsx4426  power 0.0792  0.5 -> 0.281  Inexact Rounded\r
+pwsx4427  power 0.793  0.5 -> 0.891  Inexact Rounded\r
+pwsx4428  power 0.0793  0.5 -> 0.282  Inexact Rounded\r
+pwsx4429  power 0.794  0.5 -> 0.891  Inexact Rounded\r
+pwsx4430  power 0.0794  0.5 -> 0.282  Inexact Rounded\r
+pwsx4431  power 0.795  0.5 -> 0.892  Inexact Rounded\r
+pwsx4432  power 0.0795  0.5 -> 0.282  Inexact Rounded\r
+pwsx4433  power 0.796  0.5 -> 0.892  Inexact Rounded\r
+pwsx4434  power 0.0796  0.5 -> 0.282  Inexact Rounded\r
+pwsx4435  power 0.797  0.5 -> 0.893  Inexact Rounded\r
+pwsx4436  power 0.0797  0.5 -> 0.282  Inexact Rounded\r
+pwsx4437  power 0.798  0.5 -> 0.893  Inexact Rounded\r
+pwsx4438  power 0.0798  0.5 -> 0.282  Inexact Rounded\r
+pwsx4439  power 0.799  0.5 -> 0.894  Inexact Rounded\r
+pwsx4440  power 0.0799  0.5 -> 0.283  Inexact Rounded\r
+pwsx4441  power 0.801  0.5 -> 0.895  Inexact Rounded\r
+pwsx4442  power 0.0801  0.5 -> 0.283  Inexact Rounded\r
+pwsx4443  power 0.802  0.5 -> 0.896  Inexact Rounded\r
+pwsx4444  power 0.0802  0.5 -> 0.283  Inexact Rounded\r
+pwsx4445  power 0.803  0.5 -> 0.896  Inexact Rounded\r
+pwsx4446  power 0.0803  0.5 -> 0.283  Inexact Rounded\r
+pwsx4447  power 0.804  0.5 -> 0.897  Inexact Rounded\r
+pwsx4448  power 0.0804  0.5 -> 0.284  Inexact Rounded\r
+pwsx4449  power 0.805  0.5 -> 0.897  Inexact Rounded\r
+pwsx4450  power 0.0805  0.5 -> 0.284  Inexact Rounded\r
+pwsx4451  power 0.806  0.5 -> 0.898  Inexact Rounded\r
+pwsx4452  power 0.0806  0.5 -> 0.284  Inexact Rounded\r
+pwsx4453  power 0.807  0.5 -> 0.898  Inexact Rounded\r
+pwsx4454  power 0.0807  0.5 -> 0.284  Inexact Rounded\r
+pwsx4455  power 0.808  0.5 -> 0.899  Inexact Rounded\r
+pwsx4456  power 0.0808  0.5 -> 0.284  Inexact Rounded\r
+pwsx4457  power 0.809  0.5 -> 0.899  Inexact Rounded\r
+pwsx4458  power 0.0809  0.5 -> 0.284  Inexact Rounded\r
+pwsx4459  power 0.811  0.5 -> 0.901  Inexact Rounded\r
+pwsx4460  power 0.0811  0.5 -> 0.285  Inexact Rounded\r
+pwsx4461  power 0.812  0.5 -> 0.901  Inexact Rounded\r
+pwsx4462  power 0.0812  0.5 -> 0.285  Inexact Rounded\r
+pwsx4463  power 0.813  0.5 -> 0.902  Inexact Rounded\r
+pwsx4464  power 0.0813  0.5 -> 0.285  Inexact Rounded\r
+pwsx4465  power 0.814  0.5 -> 0.902  Inexact Rounded\r
+pwsx4466  power 0.0814  0.5 -> 0.285  Inexact Rounded\r
+pwsx4467  power 0.815  0.5 -> 0.903  Inexact Rounded\r
+pwsx4468  power 0.0815  0.5 -> 0.285  Inexact Rounded\r
+pwsx4469  power 0.816  0.5 -> 0.903  Inexact Rounded\r
+pwsx4470  power 0.0816  0.5 -> 0.286  Inexact Rounded\r
+pwsx4471  power 0.817  0.5 -> 0.904  Inexact Rounded\r
+pwsx4472  power 0.0817  0.5 -> 0.286  Inexact Rounded\r
+pwsx4473  power 0.818  0.5 -> 0.904  Inexact Rounded\r
+pwsx4474  power 0.0818  0.5 -> 0.286  Inexact Rounded\r
+pwsx4475  power 0.819  0.5 -> 0.905  Inexact Rounded\r
+pwsx4476  power 0.0819  0.5 -> 0.286  Inexact Rounded\r
+pwsx4477  power 0.821  0.5 -> 0.906  Inexact Rounded\r
+pwsx4478  power 0.0821  0.5 -> 0.287  Inexact Rounded\r
+pwsx4479  power 0.822  0.5 -> 0.907  Inexact Rounded\r
+pwsx4480  power 0.0822  0.5 -> 0.287  Inexact Rounded\r
+pwsx4481  power 0.823  0.5 -> 0.907  Inexact Rounded\r
+pwsx4482  power 0.0823  0.5 -> 0.287  Inexact Rounded\r
+pwsx4483  power 0.824  0.5 -> 0.908  Inexact Rounded\r
+pwsx4484  power 0.0824  0.5 -> 0.287  Inexact Rounded\r
+pwsx4485  power 0.825  0.5 -> 0.908  Inexact Rounded\r
+pwsx4486  power 0.0825  0.5 -> 0.287  Inexact Rounded\r
+pwsx4487  power 0.826  0.5 -> 0.909  Inexact Rounded\r
+pwsx4488  power 0.0826  0.5 -> 0.287  Inexact Rounded\r
+pwsx4489  power 0.827  0.5 -> 0.909  Inexact Rounded\r
+pwsx4490  power 0.0827  0.5 -> 0.288  Inexact Rounded\r
+pwsx4491  power 0.828  0.5 -> 0.910  Inexact Rounded\r
+pwsx4492  power 0.0828  0.5 -> 0.288  Inexact Rounded\r
+pwsx4493  power 0.829  0.5 -> 0.910  Inexact Rounded\r
+pwsx4494  power 0.0829  0.5 -> 0.288  Inexact Rounded\r
+pwsx4495  power 0.831  0.5 -> 0.912  Inexact Rounded\r
+pwsx4496  power 0.0831  0.5 -> 0.288  Inexact Rounded\r
+pwsx4497  power 0.832  0.5 -> 0.912  Inexact Rounded\r
+pwsx4498  power 0.0832  0.5 -> 0.288  Inexact Rounded\r
+pwsx4499  power 0.833  0.5 -> 0.913  Inexact Rounded\r
+pwsx4500  power 0.0833  0.5 -> 0.289  Inexact Rounded\r
+pwsx4501  power 0.834  0.5 -> 0.913  Inexact Rounded\r
+pwsx4502  power 0.0834  0.5 -> 0.289  Inexact Rounded\r
+pwsx4503  power 0.835  0.5 -> 0.914  Inexact Rounded\r
+pwsx4504  power 0.0835  0.5 -> 0.289  Inexact Rounded\r
+pwsx4505  power 0.836  0.5 -> 0.914  Inexact Rounded\r
+pwsx4506  power 0.0836  0.5 -> 0.289  Inexact Rounded\r
+pwsx4507  power 0.837  0.5 -> 0.915  Inexact Rounded\r
+pwsx4508  power 0.0837  0.5 -> 0.289  Inexact Rounded\r
+pwsx4509  power 0.838  0.5 -> 0.915  Inexact Rounded\r
+pwsx4510  power 0.0838  0.5 -> 0.289  Inexact Rounded\r
+pwsx4511  power 0.839  0.5 -> 0.916  Inexact Rounded\r
+pwsx4512  power 0.0839  0.5 -> 0.290  Inexact Rounded\r
+pwsx4513  power 0.841  0.5 -> 0.917  Inexact Rounded\r
+pwsx4514  power 0.0841  0.5 -> 0.290  Inexact Rounded\r
+pwsx4515  power 0.842  0.5 -> 0.918  Inexact Rounded\r
+pwsx4516  power 0.0842  0.5 -> 0.290  Inexact Rounded\r
+pwsx4517  power 0.843  0.5 -> 0.918  Inexact Rounded\r
+pwsx4518  power 0.0843  0.5 -> 0.290  Inexact Rounded\r
+pwsx4519  power 0.844  0.5 -> 0.919  Inexact Rounded\r
+pwsx4520  power 0.0844  0.5 -> 0.291  Inexact Rounded\r
+pwsx4521  power 0.845  0.5 -> 0.919  Inexact Rounded\r
+pwsx4522  power 0.0845  0.5 -> 0.291  Inexact Rounded\r
+pwsx4523  power 0.846  0.5 -> 0.920  Inexact Rounded\r
+pwsx4524  power 0.0846  0.5 -> 0.291  Inexact Rounded\r
+pwsx4525  power 0.847  0.5 -> 0.920  Inexact Rounded\r
+pwsx4526  power 0.0847  0.5 -> 0.291  Inexact Rounded\r
+pwsx4527  power 0.848  0.5 -> 0.921  Inexact Rounded\r
+pwsx4528  power 0.0848  0.5 -> 0.291  Inexact Rounded\r
+pwsx4529  power 0.849  0.5 -> 0.921  Inexact Rounded\r
+pwsx4530  power 0.0849  0.5 -> 0.291  Inexact Rounded\r
+pwsx4531  power 0.851  0.5 -> 0.922  Inexact Rounded\r
+pwsx4532  power 0.0851  0.5 -> 0.292  Inexact Rounded\r
+pwsx4533  power 0.852  0.5 -> 0.923  Inexact Rounded\r
+pwsx4534  power 0.0852  0.5 -> 0.292  Inexact Rounded\r
+pwsx4535  power 0.853  0.5 -> 0.924  Inexact Rounded\r
+pwsx4536  power 0.0853  0.5 -> 0.292  Inexact Rounded\r
+pwsx4537  power 0.854  0.5 -> 0.924  Inexact Rounded\r
+pwsx4538  power 0.0854  0.5 -> 0.292  Inexact Rounded\r
+pwsx4539  power 0.855  0.5 -> 0.925  Inexact Rounded\r
+pwsx4540  power 0.0855  0.5 -> 0.292  Inexact Rounded\r
+pwsx4541  power 0.856  0.5 -> 0.925  Inexact Rounded\r
+pwsx4542  power 0.0856  0.5 -> 0.293  Inexact Rounded\r
+pwsx4543  power 0.857  0.5 -> 0.926  Inexact Rounded\r
+pwsx4544  power 0.0857  0.5 -> 0.293  Inexact Rounded\r
+pwsx4545  power 0.858  0.5 -> 0.926  Inexact Rounded\r
+pwsx4546  power 0.0858  0.5 -> 0.293  Inexact Rounded\r
+pwsx4547  power 0.859  0.5 -> 0.927  Inexact Rounded\r
+pwsx4548  power 0.0859  0.5 -> 0.293  Inexact Rounded\r
+pwsx4549  power 0.861  0.5 -> 0.928  Inexact Rounded\r
+pwsx4550  power 0.0861  0.5 -> 0.293  Inexact Rounded\r
+pwsx4551  power 0.862  0.5 -> 0.928  Inexact Rounded\r
+pwsx4552  power 0.0862  0.5 -> 0.294  Inexact Rounded\r
+pwsx4553  power 0.863  0.5 -> 0.929  Inexact Rounded\r
+pwsx4554  power 0.0863  0.5 -> 0.294  Inexact Rounded\r
+pwsx4555  power 0.864  0.5 -> 0.930  Inexact Rounded\r
+pwsx4556  power 0.0864  0.5 -> 0.294  Inexact Rounded\r
+pwsx4557  power 0.865  0.5 -> 0.930  Inexact Rounded\r
+pwsx4558  power 0.0865  0.5 -> 0.294  Inexact Rounded\r
+pwsx4559  power 0.866  0.5 -> 0.931  Inexact Rounded\r
+pwsx4560  power 0.0866  0.5 -> 0.294  Inexact Rounded\r
+pwsx4561  power 0.867  0.5 -> 0.931  Inexact Rounded\r
+pwsx4562  power 0.0867  0.5 -> 0.294  Inexact Rounded\r
+pwsx4563  power 0.868  0.5 -> 0.932  Inexact Rounded\r
+pwsx4564  power 0.0868  0.5 -> 0.295  Inexact Rounded\r
+pwsx4565  power 0.869  0.5 -> 0.932  Inexact Rounded\r
+pwsx4566  power 0.0869  0.5 -> 0.295  Inexact Rounded\r
+pwsx4567  power 0.871  0.5 -> 0.933  Inexact Rounded\r
+pwsx4568  power 0.0871  0.5 -> 0.295  Inexact Rounded\r
+pwsx4569  power 0.872  0.5 -> 0.934  Inexact Rounded\r
+pwsx4570  power 0.0872  0.5 -> 0.295  Inexact Rounded\r
+pwsx4571  power 0.873  0.5 -> 0.934  Inexact Rounded\r
+pwsx4572  power 0.0873  0.5 -> 0.295  Inexact Rounded\r
+pwsx4573  power 0.874  0.5 -> 0.935  Inexact Rounded\r
+pwsx4574  power 0.0874  0.5 -> 0.296  Inexact Rounded\r
+pwsx4575  power 0.875  0.5 -> 0.935  Inexact Rounded\r
+pwsx4576  power 0.0875  0.5 -> 0.296  Inexact Rounded\r
+pwsx4577  power 0.876  0.5 -> 0.936  Inexact Rounded\r
+pwsx4578  power 0.0876  0.5 -> 0.296  Inexact Rounded\r
+pwsx4579  power 0.877  0.5 -> 0.936  Inexact Rounded\r
+pwsx4580  power 0.0877  0.5 -> 0.296  Inexact Rounded\r
+pwsx4581  power 0.878  0.5 -> 0.937  Inexact Rounded\r
+pwsx4582  power 0.0878  0.5 -> 0.296  Inexact Rounded\r
+pwsx4583  power 0.879  0.5 -> 0.938  Inexact Rounded\r
+pwsx4584  power 0.0879  0.5 -> 0.296  Inexact Rounded\r
+pwsx4585  power 0.881  0.5 -> 0.939  Inexact Rounded\r
+pwsx4586  power 0.0881  0.5 -> 0.297  Inexact Rounded\r
+pwsx4587  power 0.882  0.5 -> 0.939  Inexact Rounded\r
+pwsx4588  power 0.0882  0.5 -> 0.297  Inexact Rounded\r
+pwsx4589  power 0.883  0.5 -> 0.940  Inexact Rounded\r
+pwsx4590  power 0.0883  0.5 -> 0.297  Inexact Rounded\r
+pwsx4591  power 0.884  0.5 -> 0.940  Inexact Rounded\r
+pwsx4592  power 0.0884  0.5 -> 0.297  Inexact Rounded\r
+pwsx4593  power 0.885  0.5 -> 0.941  Inexact Rounded\r
+pwsx4594  power 0.0885  0.5 -> 0.297  Inexact Rounded\r
+pwsx4595  power 0.886  0.5 -> 0.941  Inexact Rounded\r
+pwsx4596  power 0.0886  0.5 -> 0.298  Inexact Rounded\r
+pwsx4597  power 0.887  0.5 -> 0.942  Inexact Rounded\r
+pwsx4598  power 0.0887  0.5 -> 0.298  Inexact Rounded\r
+pwsx4599  power 0.888  0.5 -> 0.942  Inexact Rounded\r
+pwsx4600  power 0.0888  0.5 -> 0.298  Inexact Rounded\r
+pwsx4601  power 0.889  0.5 -> 0.943  Inexact Rounded\r
+pwsx4602  power 0.0889  0.5 -> 0.298  Inexact Rounded\r
+pwsx4603  power 0.891  0.5 -> 0.944  Inexact Rounded\r
+pwsx4604  power 0.0891  0.5 -> 0.298  Inexact Rounded\r
+pwsx4605  power 0.892  0.5 -> 0.944  Inexact Rounded\r
+pwsx4606  power 0.0892  0.5 -> 0.299  Inexact Rounded\r
+pwsx4607  power 0.893  0.5 -> 0.945  Inexact Rounded\r
+pwsx4608  power 0.0893  0.5 -> 0.299  Inexact Rounded\r
+pwsx4609  power 0.894  0.5 -> 0.946  Inexact Rounded\r
+pwsx4610  power 0.0894  0.5 -> 0.299  Inexact Rounded\r
+pwsx4611  power 0.895  0.5 -> 0.946  Inexact Rounded\r
+pwsx4612  power 0.0895  0.5 -> 0.299  Inexact Rounded\r
+pwsx4613  power 0.896  0.5 -> 0.947  Inexact Rounded\r
+pwsx4614  power 0.0896  0.5 -> 0.299  Inexact Rounded\r
+pwsx4615  power 0.897  0.5 -> 0.947  Inexact Rounded\r
+pwsx4616  power 0.0897  0.5 -> 0.299  Inexact Rounded\r
+pwsx4617  power 0.898  0.5 -> 0.948  Inexact Rounded\r
+pwsx4618  power 0.0898  0.5 -> 0.300  Inexact Rounded\r
+pwsx4619  power 0.899  0.5 -> 0.948  Inexact Rounded\r
+pwsx4620  power 0.0899  0.5 -> 0.300  Inexact Rounded\r
+pwsx4621  power 0.901  0.5 -> 0.949  Inexact Rounded\r
+pwsx4622  power 0.0901  0.5 -> 0.300  Inexact Rounded\r
+pwsx4623  power 0.902  0.5 -> 0.950  Inexact Rounded\r
+pwsx4624  power 0.0902  0.5 -> 0.300  Inexact Rounded\r
+pwsx4625  power 0.903  0.5 -> 0.950  Inexact Rounded\r
+pwsx4626  power 0.0903  0.5 -> 0.300  Inexact Rounded\r
+pwsx4627  power 0.904  0.5 -> 0.951  Inexact Rounded\r
+pwsx4628  power 0.0904  0.5 -> 0.301  Inexact Rounded\r
+pwsx4629  power 0.905  0.5 -> 0.951  Inexact Rounded\r
+pwsx4630  power 0.0905  0.5 -> 0.301  Inexact Rounded\r
+pwsx4631  power 0.906  0.5 -> 0.952  Inexact Rounded\r
+pwsx4632  power 0.0906  0.5 -> 0.301  Inexact Rounded\r
+pwsx4633  power 0.907  0.5 -> 0.952  Inexact Rounded\r
+pwsx4634  power 0.0907  0.5 -> 0.301  Inexact Rounded\r
+pwsx4635  power 0.908  0.5 -> 0.953  Inexact Rounded\r
+pwsx4636  power 0.0908  0.5 -> 0.301  Inexact Rounded\r
+pwsx4637  power 0.909  0.5 -> 0.953  Inexact Rounded\r
+pwsx4638  power 0.0909  0.5 -> 0.301  Inexact Rounded\r
+pwsx4639  power 0.911  0.5 -> 0.954  Inexact Rounded\r
+pwsx4640  power 0.0911  0.5 -> 0.302  Inexact Rounded\r
+pwsx4641  power 0.912  0.5 -> 0.955  Inexact Rounded\r
+pwsx4642  power 0.0912  0.5 -> 0.302  Inexact Rounded\r
+pwsx4643  power 0.913  0.5 -> 0.956  Inexact Rounded\r
+pwsx4644  power 0.0913  0.5 -> 0.302  Inexact Rounded\r
+pwsx4645  power 0.914  0.5 -> 0.956  Inexact Rounded\r
+pwsx4646  power 0.0914  0.5 -> 0.302  Inexact Rounded\r
+pwsx4647  power 0.915  0.5 -> 0.957  Inexact Rounded\r
+pwsx4648  power 0.0915  0.5 -> 0.302  Inexact Rounded\r
+pwsx4649  power 0.916  0.5 -> 0.957  Inexact Rounded\r
+pwsx4650  power 0.0916  0.5 -> 0.303  Inexact Rounded\r
+pwsx4651  power 0.917  0.5 -> 0.958  Inexact Rounded\r
+pwsx4652  power 0.0917  0.5 -> 0.303  Inexact Rounded\r
+pwsx4653  power 0.918  0.5 -> 0.958  Inexact Rounded\r
+pwsx4654  power 0.0918  0.5 -> 0.303  Inexact Rounded\r
+pwsx4655  power 0.919  0.5 -> 0.959  Inexact Rounded\r
+pwsx4656  power 0.0919  0.5 -> 0.303  Inexact Rounded\r
+pwsx4657  power 0.921  0.5 -> 0.960  Inexact Rounded\r
+pwsx4658  power 0.0921  0.5 -> 0.303  Inexact Rounded\r
+pwsx4659  power 0.922  0.5 -> 0.960  Inexact Rounded\r
+pwsx4660  power 0.0922  0.5 -> 0.304  Inexact Rounded\r
+pwsx4661  power 0.923  0.5 -> 0.961  Inexact Rounded\r
+pwsx4662  power 0.0923  0.5 -> 0.304  Inexact Rounded\r
+pwsx4663  power 0.924  0.5 -> 0.961  Inexact Rounded\r
+pwsx4664  power 0.0924  0.5 -> 0.304  Inexact Rounded\r
+pwsx4665  power 0.925  0.5 -> 0.962  Inexact Rounded\r
+pwsx4666  power 0.0925  0.5 -> 0.304  Inexact Rounded\r
+pwsx4667  power 0.926  0.5 -> 0.962  Inexact Rounded\r
+pwsx4668  power 0.0926  0.5 -> 0.304  Inexact Rounded\r
+pwsx4669  power 0.927  0.5 -> 0.963  Inexact Rounded\r
+pwsx4670  power 0.0927  0.5 -> 0.304  Inexact Rounded\r
+pwsx4671  power 0.928  0.5 -> 0.963  Inexact Rounded\r
+pwsx4672  power 0.0928  0.5 -> 0.305  Inexact Rounded\r
+pwsx4673  power 0.929  0.5 -> 0.964  Inexact Rounded\r
+pwsx4674  power 0.0929  0.5 -> 0.305  Inexact Rounded\r
+pwsx4675  power 0.931  0.5 -> 0.965  Inexact Rounded\r
+pwsx4676  power 0.0931  0.5 -> 0.305  Inexact Rounded\r
+pwsx4677  power 0.932  0.5 -> 0.965  Inexact Rounded\r
+pwsx4678  power 0.0932  0.5 -> 0.305  Inexact Rounded\r
+pwsx4679  power 0.933  0.5 -> 0.966  Inexact Rounded\r
+pwsx4680  power 0.0933  0.5 -> 0.305  Inexact Rounded\r
+pwsx4681  power 0.934  0.5 -> 0.966  Inexact Rounded\r
+pwsx4682  power 0.0934  0.5 -> 0.306  Inexact Rounded\r
+pwsx4683  power 0.935  0.5 -> 0.967  Inexact Rounded\r
+pwsx4684  power 0.0935  0.5 -> 0.306  Inexact Rounded\r
+pwsx4685  power 0.936  0.5 -> 0.967  Inexact Rounded\r
+pwsx4686  power 0.0936  0.5 -> 0.306  Inexact Rounded\r
+pwsx4687  power 0.937  0.5 -> 0.968  Inexact Rounded\r
+pwsx4688  power 0.0937  0.5 -> 0.306  Inexact Rounded\r
+pwsx4689  power 0.938  0.5 -> 0.969  Inexact Rounded\r
+pwsx4690  power 0.0938  0.5 -> 0.306  Inexact Rounded\r
+pwsx4691  power 0.939  0.5 -> 0.969  Inexact Rounded\r
+pwsx4692  power 0.0939  0.5 -> 0.306  Inexact Rounded\r
+pwsx4693  power 0.941  0.5 -> 0.970  Inexact Rounded\r
+pwsx4694  power 0.0941  0.5 -> 0.307  Inexact Rounded\r
+pwsx4695  power 0.942  0.5 -> 0.971  Inexact Rounded\r
+pwsx4696  power 0.0942  0.5 -> 0.307  Inexact Rounded\r
+pwsx4697  power 0.943  0.5 -> 0.971  Inexact Rounded\r
+pwsx4698  power 0.0943  0.5 -> 0.307  Inexact Rounded\r
+pwsx4699  power 0.944  0.5 -> 0.972  Inexact Rounded\r
+pwsx4700  power 0.0944  0.5 -> 0.307  Inexact Rounded\r
+pwsx4701  power 0.945  0.5 -> 0.972  Inexact Rounded\r
+pwsx4702  power 0.0945  0.5 -> 0.307  Inexact Rounded\r
+pwsx4703  power 0.946  0.5 -> 0.973  Inexact Rounded\r
+pwsx4704  power 0.0946  0.5 -> 0.308  Inexact Rounded\r
+pwsx4705  power 0.947  0.5 -> 0.973  Inexact Rounded\r
+pwsx4706  power 0.0947  0.5 -> 0.308  Inexact Rounded\r
+pwsx4707  power 0.948  0.5 -> 0.974  Inexact Rounded\r
+pwsx4708  power 0.0948  0.5 -> 0.308  Inexact Rounded\r
+pwsx4709  power 0.949  0.5 -> 0.974  Inexact Rounded\r
+pwsx4710  power 0.0949  0.5 -> 0.308  Inexact Rounded\r
+pwsx4711  power 0.951  0.5 -> 0.975  Inexact Rounded\r
+pwsx4712  power 0.0951  0.5 -> 0.308  Inexact Rounded\r
+pwsx4713  power 0.952  0.5 -> 0.976  Inexact Rounded\r
+pwsx4714  power 0.0952  0.5 -> 0.309  Inexact Rounded\r
+pwsx4715  power 0.953  0.5 -> 0.976  Inexact Rounded\r
+pwsx4716  power 0.0953  0.5 -> 0.309  Inexact Rounded\r
+pwsx4717  power 0.954  0.5 -> 0.977  Inexact Rounded\r
+pwsx4718  power 0.0954  0.5 -> 0.309  Inexact Rounded\r
+pwsx4719  power 0.955  0.5 -> 0.977  Inexact Rounded\r
+pwsx4720  power 0.0955  0.5 -> 0.309  Inexact Rounded\r
+pwsx4721  power 0.956  0.5 -> 0.978  Inexact Rounded\r
+pwsx4722  power 0.0956  0.5 -> 0.309  Inexact Rounded\r
+pwsx4723  power 0.957  0.5 -> 0.978  Inexact Rounded\r
+pwsx4724  power 0.0957  0.5 -> 0.309  Inexact Rounded\r
+pwsx4725  power 0.958  0.5 -> 0.979  Inexact Rounded\r
+pwsx4726  power 0.0958  0.5 -> 0.310  Inexact Rounded\r
+pwsx4727  power 0.959  0.5 -> 0.979  Inexact Rounded\r
+pwsx4728  power 0.0959  0.5 -> 0.310  Inexact Rounded\r
+pwsx4729  power 0.961  0.5 -> 0.980  Inexact Rounded\r
+pwsx4730  power 0.0961  0.5 -> 0.310  Inexact Rounded\r
+pwsx4731  power 0.962  0.5 -> 0.981  Inexact Rounded\r
+pwsx4732  power 0.0962  0.5 -> 0.310  Inexact Rounded\r
+pwsx4733  power 0.963  0.5 -> 0.981  Inexact Rounded\r
+pwsx4734  power 0.0963  0.5 -> 0.310  Inexact Rounded\r
+pwsx4735  power 0.964  0.5 -> 0.982  Inexact Rounded\r
+pwsx4736  power 0.0964  0.5 -> 0.310  Inexact Rounded\r
+pwsx4737  power 0.965  0.5 -> 0.982  Inexact Rounded\r
+pwsx4738  power 0.0965  0.5 -> 0.311  Inexact Rounded\r
+pwsx4739  power 0.966  0.5 -> 0.983  Inexact Rounded\r
+pwsx4740  power 0.0966  0.5 -> 0.311  Inexact Rounded\r
+pwsx4741  power 0.967  0.5 -> 0.983  Inexact Rounded\r
+pwsx4742  power 0.0967  0.5 -> 0.311  Inexact Rounded\r
+pwsx4743  power 0.968  0.5 -> 0.984  Inexact Rounded\r
+pwsx4744  power 0.0968  0.5 -> 0.311  Inexact Rounded\r
+pwsx4745  power 0.969  0.5 -> 0.984  Inexact Rounded\r
+pwsx4746  power 0.0969  0.5 -> 0.311  Inexact Rounded\r
+pwsx4747  power 0.971  0.5 -> 0.985  Inexact Rounded\r
+pwsx4748  power 0.0971  0.5 -> 0.312  Inexact Rounded\r
+pwsx4749  power 0.972  0.5 -> 0.986  Inexact Rounded\r
+pwsx4750  power 0.0972  0.5 -> 0.312  Inexact Rounded\r
+pwsx4751  power 0.973  0.5 -> 0.986  Inexact Rounded\r
+pwsx4752  power 0.0973  0.5 -> 0.312  Inexact Rounded\r
+pwsx4753  power 0.974  0.5 -> 0.987  Inexact Rounded\r
+pwsx4754  power 0.0974  0.5 -> 0.312  Inexact Rounded\r
+pwsx4755  power 0.975  0.5 -> 0.987  Inexact Rounded\r
+pwsx4756  power 0.0975  0.5 -> 0.312  Inexact Rounded\r
+pwsx4757  power 0.976  0.5 -> 0.988  Inexact Rounded\r
+pwsx4758  power 0.0976  0.5 -> 0.312  Inexact Rounded\r
+pwsx4759  power 0.977  0.5 -> 0.988  Inexact Rounded\r
+pwsx4760  power 0.0977  0.5 -> 0.313  Inexact Rounded\r
+pwsx4761  power 0.978  0.5 -> 0.989  Inexact Rounded\r
+pwsx4762  power 0.0978  0.5 -> 0.313  Inexact Rounded\r
+pwsx4763  power 0.979  0.5 -> 0.989  Inexact Rounded\r
+pwsx4764  power 0.0979  0.5 -> 0.313  Inexact Rounded\r
+pwsx4765  power 0.981  0.5 -> 0.990  Inexact Rounded\r
+pwsx4766  power 0.0981  0.5 -> 0.313  Inexact Rounded\r
+pwsx4767  power 0.982  0.5 -> 0.991  Inexact Rounded\r
+pwsx4768  power 0.0982  0.5 -> 0.313  Inexact Rounded\r
+pwsx4769  power 0.983  0.5 -> 0.991  Inexact Rounded\r
+pwsx4770  power 0.0983  0.5 -> 0.314  Inexact Rounded\r
+pwsx4771  power 0.984  0.5 -> 0.992  Inexact Rounded\r
+pwsx4772  power 0.0984  0.5 -> 0.314  Inexact Rounded\r
+pwsx4773  power 0.985  0.5 -> 0.992  Inexact Rounded\r
+pwsx4774  power 0.0985  0.5 -> 0.314  Inexact Rounded\r
+pwsx4775  power 0.986  0.5 -> 0.993  Inexact Rounded\r
+pwsx4776  power 0.0986  0.5 -> 0.314  Inexact Rounded\r
+pwsx4777  power 0.987  0.5 -> 0.993  Inexact Rounded\r
+pwsx4778  power 0.0987  0.5 -> 0.314  Inexact Rounded\r
+pwsx4779  power 0.988  0.5 -> 0.994  Inexact Rounded\r
+pwsx4780  power 0.0988  0.5 -> 0.314  Inexact Rounded\r
+pwsx4781  power 0.989  0.5 -> 0.994  Inexact Rounded\r
+pwsx4782  power 0.0989  0.5 -> 0.314  Inexact Rounded\r
+pwsx4783  power 0.991  0.5 -> 0.995  Inexact Rounded\r
+pwsx4784  power 0.0991  0.5 -> 0.315  Inexact Rounded\r
+pwsx4785  power 0.992  0.5 -> 0.996  Inexact Rounded\r
+pwsx4786  power 0.0992  0.5 -> 0.315  Inexact Rounded\r
+pwsx4787  power 0.993  0.5 -> 0.996  Inexact Rounded\r
+pwsx4788  power 0.0993  0.5 -> 0.315  Inexact Rounded\r
+pwsx4789  power 0.994  0.5 -> 0.997  Inexact Rounded\r
+pwsx4790  power 0.0994  0.5 -> 0.315  Inexact Rounded\r
+pwsx4791  power 0.995  0.5 -> 0.997  Inexact Rounded\r
+pwsx4792  power 0.0995  0.5 -> 0.315  Inexact Rounded\r
+pwsx4793  power 0.996  0.5 -> 0.998  Inexact Rounded\r
+pwsx4794  power 0.0996  0.5 -> 0.316  Inexact Rounded\r
+pwsx4795  power 0.997  0.5 -> 0.998  Inexact Rounded\r
+pwsx4796  power 0.0997  0.5 -> 0.316  Inexact Rounded\r
+pwsx4797  power 0.998  0.5 -> 0.999  Inexact Rounded\r
+pwsx4798  power 0.0998  0.5 -> 0.316  Inexact Rounded\r
+pwsx4799  power 0.999  0.5 -> 0.999  Inexact Rounded\r
+pwsx4800  power 0.0999  0.5 -> 0.316  Inexact Rounded\r
+\r
+-- A group of precision 4 tests where Hull & Abrham adjustments are\r
+-- needed in some cases (both up and down) [see Hull1985b]\r
+rounding:    half_even\r
+maxExponent: 999\r
+minexponent: -999\r
+precision:   4\r
+pwsx5001  power 0.0118   0.5 -> 0.1086  Inexact Rounded\r
+pwsx5002  power 0.119    0.5 -> 0.3450  Inexact Rounded\r
+pwsx5003  power 0.0119   0.5 -> 0.1091  Inexact Rounded\r
+pwsx5004  power 0.121    0.5 -> 0.3479  Inexact Rounded\r
+pwsx5005  power 0.0121   0.5 -> 0.1100  Inexact Rounded\r
+pwsx5006  power 0.122    0.5 -> 0.3493  Inexact Rounded\r
+pwsx5007  power 0.0122   0.5 -> 0.1105  Inexact Rounded\r
+pwsx5008  power 0.123    0.5 -> 0.3507  Inexact Rounded\r
+pwsx5009  power 0.494    0.5 -> 0.7029  Inexact Rounded\r
+pwsx5010  power 0.0669   0.5 -> 0.2587  Inexact Rounded\r
+pwsx5011  power 0.9558   0.5 -> 0.9777  Inexact Rounded\r
+pwsx5012  power 0.9348   0.5 -> 0.9669  Inexact Rounded\r
+pwsx5013  power 0.9345   0.5 -> 0.9667  Inexact Rounded\r
+pwsx5014  power 0.09345  0.5 -> 0.3057  Inexact Rounded\r
+pwsx5015  power 0.9346   0.5 -> 0.9667  Inexact Rounded\r
+pwsx5016  power 0.09346  0.5 -> 0.3057  Inexact Rounded\r
+pwsx5017  power 0.9347   0.5 -> 0.9668  Inexact Rounded\r
+\r
+-- examples from decArith\r
+precision: 9\r
+pwsx700  power  0        0.5 -> '0'\r
+pwsx701  power  -0       0.5 -> '0'\r
+pwsx702  power  0.39     0.5 -> 0.624499800    Inexact Rounded\r
+pwsx703  power  100      0.5 -> '10.0000000'   Inexact Rounded\r
+pwsx704  power  1.00     0.5 -> '1.00000000'   Inexact Rounded\r
+pwsx705  power  7        0.5 -> '2.64575131'   Inexact Rounded\r
+pwsx706  power  10       0.5 -> 3.16227766     Inexact Rounded\r
+\r
+-- some one-offs\r
+precision: 9\r
+pwsx711  power  0.1      0.5 -> 0.316227766    Inexact Rounded\r
+pwsx712  power  0.2      0.5 -> 0.447213595    Inexact Rounded\r
+pwsx713  power  0.3      0.5 -> 0.547722558    Inexact Rounded\r
+pwsx714  power  0.4      0.5 -> 0.632455532    Inexact Rounded\r
+pwsx715  power  0.5      0.5 -> 0.707106781    Inexact Rounded\r
+pwsx716  power  0.6      0.5 -> 0.774596669    Inexact Rounded\r
+pwsx717  power  0.7      0.5 -> 0.836660027    Inexact Rounded\r
+pwsx718  power  0.8      0.5 -> 0.894427191    Inexact Rounded\r
+pwsx719  power  0.9      0.5 -> 0.948683298    Inexact Rounded\r
+precision: 10               -- note no normalizatoin here\r
+pwsx720  power +0.1      0.5 -> 0.3162277660   Inexact Rounded\r
+precision: 11\r
+pwsx721  power +0.1      0.5 -> 0.31622776602  Inexact Rounded\r
+precision: 12\r
+pwsx722  power +0.1      0.5 -> 0.316227766017 Inexact Rounded\r
+precision: 9\r
+pwsx723  power  0.39     0.5 -> 0.624499800    Inexact Rounded\r
+precision: 15\r
+pwsx724  power  0.39     0.5 -> 0.624499799839840 Inexact Rounded\r
+\r
+-- discussion cases\r
+precision: 7\r
+pwsx731  power     9    0.5 -> 3.000000  Inexact Rounded\r
+pwsx732  power   100    0.5 -> 10.00000  Inexact Rounded\r
+pwsx733  power   123    0.5 -> 11.09054  Inexact Rounded\r
+pwsx734  power   144    0.5 -> 12.00000  Inexact Rounded\r
+pwsx735  power   156    0.5 -> 12.49000  Inexact Rounded\r
+pwsx736  power 10000    0.5 -> 100.0000  Inexact Rounded\r
+\r
+-- values close to overflow (if there were input rounding)\r
+maxexponent: 99\r
+minexponent: -99\r
+precision: 5\r
+pwsx760  power  9.9997E+99    0.5 -> 9.9998E+49 Inexact Rounded\r
+pwsx761  power  9.9998E+99    0.5 -> 9.9999E+49 Inexact Rounded\r
+pwsx762  power  9.9999E+99    0.5 -> 9.9999E+49 Inexact Rounded\r
+pwsx763  power  9.99991E+99   0.5 -> 1.0000E+50 Inexact Rounded\r
+pwsx764  power  9.99994E+99   0.5 -> 1.0000E+50 Inexact Rounded\r
+pwsx765  power  9.99995E+99   0.5 -> 1.0000E+50 Inexact Rounded\r
+pwsx766  power  9.99999E+99   0.5 -> 1.0000E+50 Inexact Rounded\r
+precision: 9\r
+pwsx770  power  9.9997E+99    0.5 -> 9.99985000E+49  Inexact Rounded\r
+pwsx771  power  9.9998E+99    0.5 -> 9.99990000E+49  Inexact Rounded\r
+pwsx772  power  9.9999E+99    0.5 -> 9.99995000E+49  Inexact Rounded\r
+pwsx773  power  9.99991E+99   0.5 -> 9.99995500E+49  Inexact Rounded\r
+pwsx774  power  9.99994E+99   0.5 -> 9.99997000E+49  Inexact Rounded\r
+pwsx775  power  9.99995E+99   0.5 -> 9.99997500E+49  Inexact Rounded\r
+pwsx776  power  9.99999E+99   0.5 -> 9.99999500E+49  Inexact Rounded\r
+precision: 20\r
+pwsx780  power  9.9997E+99    0.5 -> '9.9998499988749831247E+49' Inexact Rounded\r
+pwsx781  power  9.9998E+99    0.5 -> '9.9998999994999949999E+49' Inexact Rounded\r
+pwsx782  power  9.9999E+99    0.5 -> '9.9999499998749993750E+49' Inexact Rounded\r
+pwsx783  power  9.99991E+99   0.5 -> '9.9999549998987495444E+49' Inexact Rounded\r
+pwsx784  power  9.99994E+99   0.5 -> '9.9999699999549998650E+49' Inexact Rounded\r
+pwsx785  power  9.99995E+99   0.5 -> '9.9999749999687499219E+49' Inexact Rounded\r
+pwsx786  power  9.99999E+99   0.5 -> '9.9999949999987499994E+49' Inexact Rounded\r
+\r
+-- subnormals and underflows [these can only result when eMax is < digits+1]\r
+-- Etiny = -(Emax + (precision-1))\r
+-- start with subnormal operands and normal results\r
+maxexponent: 9\r
+minexponent: -9\r
+precision: 9                -- Etiny=-17\r
+pwsx800  power  1E-17    0.5 -> 3.16227766E-9 Inexact Rounded\r
+pwsx801  power 10E-17    0.5 -> 1.00000000E-8 Inexact Rounded\r
+precision: 10               -- Etiny=-18\r
+pwsx802  power 10E-18    0.5 -> 3.162277660E-9 Inexact Rounded\r
+pwsx803  power  1E-18    0.5 -> 1.000000000E-9 Inexact Rounded\r
+\r
+precision: 11               -- Etiny=-19\r
+pwsx804  power  1E-19    0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded\r
+-- The next test should be skipped for decNumber\r
+pwsx805  power 10E-19    0.5 -> 1.0000000000E-9 Inexact Rounded\r
+precision: 12               -- Etiny=-20\r
+pwsx806  power 10E-20    0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded\r
+pwsx807  power  1E-20    0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded\r
+\r
+precision: 13               -- Etiny=-21\r
+pwsx808  power  1E-21    0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded\r
+pwsx809  power 10E-21    0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded\r
+precision: 14               -- Etiny=-22\r
+pwsx810  power  1E-21    0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded\r
+pwsx811  power 10E-22    0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded\r
+pwsx812  power  1E-22    0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded\r
+\r
+\r
+-- special values\r
+maxexponent: 999\r
+minexponent: -999\r
+pwsx820  power   Inf     0.5 -> Infinity\r
+pwsx821  power  -Inf     0.5 -> NaN Invalid_operation\r
+pwsx822  power   NaN     0.5 -> NaN\r
+pwsx823  power  sNaN     0.5 -> NaN Invalid_operation\r
+-- propagating NaNs\r
+pwsx824  power  sNaN123  0.5 -> NaN123 Invalid_operation\r
+pwsx825  power -sNaN321  0.5 -> -NaN321 Invalid_operation\r
+pwsx826  power   NaN456  0.5 -> NaN456\r
+pwsx827  power  -NaN654  0.5 -> -NaN654\r
+pwsx828  power   NaN1    0.5 -> NaN1\r
+\r
+-- Null test\r
+pwsx900  power  #  0.5 -> NaN Invalid_operation\r
index dc1b130187a249eb7eedad7d5aee9489871f8884..a60f1bf553f8fdb469d4e5e8f45525bdc5c73e1c 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- quantize.decTest -- decimal quantize operation                     --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- Most of the tests here assume a "regular pattern", where the
 -- sign and coefficient are +1.
 -- 2004.03.15 Underflow for quantize is suppressed
+-- 2005.06.08 More extensive tests for 'does not fit'
 
 extended:    1
 precision:   9
@@ -123,10 +124,6 @@ quax123 quantize   1.04   1e0 ->  1 Inexact Rounded
 quax124 quantize   1.05  1e-3 ->  1.050
 quax125 quantize   1.05  1e-2 ->  1.05
 quax126 quantize   1.05  1e-1 ->  1.1 Inexact Rounded
-quax127 quantize   1.05   1e0 ->  1 Inexact Rounded
-quax128 quantize   1.05  1e-3 ->  1.050
-quax129 quantize   1.05  1e-2 ->  1.05
-quax130 quantize   1.05  1e-1 ->  1.1 Inexact Rounded
 quax131 quantize   1.05   1e0 ->  1 Inexact Rounded
 quax132 quantize   1.06  1e-3 ->  1.060
 quax133 quantize   1.06  1e-2 ->  1.06
@@ -435,6 +432,102 @@ quax471 quantize   9.999E-15     1e-1 ->  0.0       Inexact Rounded
 quax472 quantize   9.999E-15      1e0 ->  0         Inexact Rounded
 quax473 quantize   9.999E-15      1e1 ->  0E+1      Inexact Rounded
 
+precision: 7
+quax900 quantize   9.999E-15    1e-22 ->  NaN       Invalid_operation
+quax901 quantize   9.999E-15    1e-21 ->  9.999000E-15
+quax902 quantize   9.999E-15    1e-20 ->  9.99900E-15
+quax903 quantize   9.999E-15    1e-19 ->  9.9990E-15
+quax904 quantize   9.999E-15    1e-18 ->  9.999E-15
+quax905 quantize   9.999E-15    1e-17 ->  1.000E-14 Inexact Rounded
+quax906 quantize   9.999E-15    1e-16 ->  1.00E-14  Inexact Rounded
+quax907 quantize   9.999E-15    1e-15 ->  1.0E-14   Inexact Rounded
+quax908 quantize   9.999E-15    1e-14 ->  1E-14     Inexact Rounded
+quax909 quantize   9.999E-15    1e-13 ->  0E-13     Inexact Rounded
+quax910 quantize   9.999E-15    1e-12 ->  0E-12     Inexact Rounded
+quax911 quantize   9.999E-15    1e-11 ->  0E-11     Inexact Rounded
+quax912 quantize   9.999E-15    1e-10 ->  0E-10     Inexact Rounded
+quax913 quantize   9.999E-15     1e-9 ->  0E-9      Inexact Rounded
+quax914 quantize   9.999E-15     1e-8 ->  0E-8      Inexact Rounded
+quax915 quantize   9.999E-15     1e-7 ->  0E-7      Inexact Rounded
+quax916 quantize   9.999E-15     1e-6 ->  0.000000  Inexact Rounded
+quax917 quantize   9.999E-15     1e-5 ->  0.00000   Inexact Rounded
+quax918 quantize   9.999E-15     1e-4 ->  0.0000    Inexact Rounded
+quax919 quantize   9.999E-15     1e-3 ->  0.000     Inexact Rounded
+quax920 quantize   9.999E-15     1e-2 ->  0.00      Inexact Rounded
+quax921 quantize   9.999E-15     1e-1 ->  0.0       Inexact Rounded
+quax922 quantize   9.999E-15      1e0 ->  0         Inexact Rounded
+quax923 quantize   9.999E-15      1e1 ->  0E+1      Inexact Rounded
+
+precision: 6
+quax930 quantize   9.999E-15    1e-22 ->  NaN       Invalid_operation
+quax931 quantize   9.999E-15    1e-21 ->  NaN       Invalid_operation
+quax932 quantize   9.999E-15    1e-20 ->  9.99900E-15
+quax933 quantize   9.999E-15    1e-19 ->  9.9990E-15
+quax934 quantize   9.999E-15    1e-18 ->  9.999E-15
+quax935 quantize   9.999E-15    1e-17 ->  1.000E-14 Inexact Rounded
+quax936 quantize   9.999E-15    1e-16 ->  1.00E-14  Inexact Rounded
+quax937 quantize   9.999E-15    1e-15 ->  1.0E-14   Inexact Rounded
+quax938 quantize   9.999E-15    1e-14 ->  1E-14     Inexact Rounded
+quax939 quantize   9.999E-15    1e-13 ->  0E-13     Inexact Rounded
+quax940 quantize   9.999E-15    1e-12 ->  0E-12     Inexact Rounded
+quax941 quantize   9.999E-15    1e-11 ->  0E-11     Inexact Rounded
+quax942 quantize   9.999E-15    1e-10 ->  0E-10     Inexact Rounded
+quax943 quantize   9.999E-15     1e-9 ->  0E-9      Inexact Rounded
+quax944 quantize   9.999E-15     1e-8 ->  0E-8      Inexact Rounded
+quax945 quantize   9.999E-15     1e-7 ->  0E-7      Inexact Rounded
+quax946 quantize   9.999E-15     1e-6 ->  0.000000  Inexact Rounded
+quax947 quantize   9.999E-15     1e-5 ->  0.00000   Inexact Rounded
+quax948 quantize   9.999E-15     1e-4 ->  0.0000    Inexact Rounded
+quax949 quantize   9.999E-15     1e-3 ->  0.000     Inexact Rounded
+quax950 quantize   9.999E-15     1e-2 ->  0.00      Inexact Rounded
+quax951 quantize   9.999E-15     1e-1 ->  0.0       Inexact Rounded
+quax952 quantize   9.999E-15      1e0 ->  0         Inexact Rounded
+quax953 quantize   9.999E-15      1e1 ->  0E+1      Inexact Rounded
+
+precision: 3
+quax960 quantize   9.999E-15    1e-22 ->  NaN       Invalid_operation
+quax961 quantize   9.999E-15    1e-21 ->  NaN       Invalid_operation
+quax962 quantize   9.999E-15    1e-20 ->  NaN       Invalid_operation
+quax963 quantize   9.999E-15    1e-19 ->  NaN       Invalid_operation
+quax964 quantize   9.999E-15    1e-18 ->  NaN       Invalid_operation
+quax965 quantize   9.999E-15    1e-17 ->  NaN       Invalid_operation
+quax966 quantize   9.999E-15    1e-16 ->  1.00E-14  Inexact Rounded
+quax967 quantize   9.999E-15    1e-15 ->  1.0E-14   Inexact Rounded
+quax968 quantize   9.999E-15    1e-14 ->  1E-14     Inexact Rounded
+quax969 quantize   9.999E-15    1e-13 ->  0E-13     Inexact Rounded
+quax970 quantize   9.999E-15    1e-12 ->  0E-12     Inexact Rounded
+quax971 quantize   9.999E-15    1e-11 ->  0E-11     Inexact Rounded
+quax972 quantize   9.999E-15    1e-10 ->  0E-10     Inexact Rounded
+quax973 quantize   9.999E-15     1e-9 ->  0E-9      Inexact Rounded
+quax974 quantize   9.999E-15     1e-8 ->  0E-8      Inexact Rounded
+quax975 quantize   9.999E-15     1e-7 ->  0E-7      Inexact Rounded
+quax976 quantize   9.999E-15     1e-6 ->  0.000000  Inexact Rounded
+quax977 quantize   9.999E-15     1e-5 ->  0.00000   Inexact Rounded
+quax978 quantize   9.999E-15     1e-4 ->  0.0000    Inexact Rounded
+quax979 quantize   9.999E-15     1e-3 ->  0.000     Inexact Rounded
+quax980 quantize   9.999E-15     1e-2 ->  0.00      Inexact Rounded
+quax981 quantize   9.999E-15     1e-1 ->  0.0       Inexact Rounded
+quax982 quantize   9.999E-15      1e0 ->  0         Inexact Rounded
+quax983 quantize   9.999E-15      1e1 ->  0E+1      Inexact Rounded
+
+-- Fung Lee's case & similar
+precision: 3
+quax1001 quantize  0.000        0.001 ->  0.000
+quax1002 quantize  0.001        0.001 ->  0.001
+quax1003 quantize  0.0012       0.001 ->  0.001     Inexact Rounded
+quax1004 quantize  0.0018       0.001 ->  0.002     Inexact Rounded
+quax1005 quantize  0.501        0.001 ->  0.501
+quax1006 quantize  0.5012       0.001 ->  0.501     Inexact Rounded
+quax1007 quantize  0.5018       0.001 ->  0.502     Inexact Rounded
+quax1008 quantize  0.999        0.001 ->  0.999
+quax1009 quantize  0.9992       0.001 ->  0.999     Inexact Rounded
+quax1010 quantize  0.9998       0.001 ->  NaN       Invalid_operation
+quax1011 quantize  1.0001       0.001 ->  NaN       Invalid_operation
+quax1012 quantize  1.0051       0.001 ->  NaN       Invalid_operation
+quax1013 quantize  1.0551       0.001 ->  NaN       Invalid_operation
+quax1014 quantize  1.5551       0.001 ->  NaN       Invalid_operation
+quax1015 quantize  1.9999       0.001 ->  NaN       Invalid_operation
+
 -- long operand checks [rhs checks removed]
 maxexponent: 999
 minexponent: -999
@@ -775,6 +868,81 @@ quax864 quantize   1  1e-2147483647 -> NaN Invalid_operation
 quax865 quantize   1  1e-2147483648 -> NaN Invalid_operation
 quax866 quantize   1  1e-2147483649 -> NaN Invalid_operation
 
+-- More from Fung Lee
+precision:   16
+rounding:    half_up
+maxExponent: 384
+minExponent: -383
+quax1021 quantize    8.666666666666000E+384     1.000000000000000E+384  -> 8.666666666666000E+384
+quax1022 quantize 64#8.666666666666000E+384  64#1.000000000000000E+384  -> 8.666666666666000E+384
+quax1023 quantize 64#8.666666666666000E+384  128#1.000000000000000E+384 -> 8.666666666666000E+384
+quax1024 quantize 64#8.666666666666000E+384  64#1E+384                  -> 8.666666666666000E+384
+quax1025 quantize 64#8.666666666666000E+384  64#1E+384   -> 64#8.666666666666000E+384
+quax1026 quantize 64#8.666666666666000E+384 128#1E+384   -> 64#9E+384 Inexact Rounded Clamped
+quax1027 quantize 64#8.666666666666000E+323  64#1E+31    -> NaN Invalid_operation
+quax1028 quantize 64#8.666666666666000E+323 128#1E+31    -> NaN Invalid_operation
+quax1029 quantize 64#8.66666666E+3          128#1E+10    -> 64#0E10 Inexact Rounded
+quax1030 quantize    8.66666666E+3              1E+3     -> 9E+3 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+quax1040 quantize -2147483646     0 -> -2147483646
+quax1041 quantize -2147483647     0 -> -2147483647
+quax1042 quantize -2147483648     0 -> -2147483648
+quax1043 quantize -2147483649     0 -> -2147483649
+quax1044 quantize  2147483646     0 ->  2147483646
+quax1045 quantize  2147483647     0 ->  2147483647
+quax1046 quantize  2147483648     0 ->  2147483648
+quax1047 quantize  2147483649     0 ->  2147483649
+quax1048 quantize  4294967294     0 ->  4294967294
+quax1049 quantize  4294967295     0 ->  4294967295
+quax1050 quantize  4294967296     0 ->  4294967296
+quax1051 quantize  4294967297     0 ->  4294967297
+-- and powers of ten for same
+quax1101 quantize  5000000000     0 ->  5000000000
+quax1102 quantize  4000000000     0 ->  4000000000
+quax1103 quantize  2000000000     0 ->  2000000000
+quax1104 quantize  1000000000     0 ->  1000000000
+quax1105 quantize  0100000000     0 ->  100000000
+quax1106 quantize  0010000000     0 ->  10000000
+quax1107 quantize  0001000000     0 ->  1000000
+quax1108 quantize  0000100000     0 ->  100000
+quax1109 quantize  0000010000     0 ->  10000
+quax1110 quantize  0000001000     0 ->  1000
+quax1111 quantize  0000000100     0 ->  100
+quax1112 quantize  0000000010     0 ->  10
+quax1113 quantize  0000000001     0 ->  1
+quax1114 quantize  0000000000     0 ->  0
+-- and powers of ten for same
+quax1121 quantize -5000000000     0 -> -5000000000
+quax1122 quantize -4000000000     0 -> -4000000000
+quax1123 quantize -2000000000     0 -> -2000000000
+quax1124 quantize -1000000000     0 -> -1000000000
+quax1125 quantize -0100000000     0 -> -100000000
+quax1126 quantize -0010000000     0 -> -10000000
+quax1127 quantize -0001000000     0 -> -1000000
+quax1128 quantize -0000100000     0 -> -100000
+quax1129 quantize -0000010000     0 -> -10000
+quax1130 quantize -0000001000     0 -> -1000
+quax1131 quantize -0000000100     0 -> -100
+quax1132 quantize -0000000010     0 -> -10
+quax1133 quantize -0000000001     0 -> -1
+quax1134 quantize -0000000000     0 -> -0
+
+-- Some miscellany
+precision:   34
+rounding:    half_up
+maxExponent: 6144
+minExponent: -6143
+--                             1         2         3
+--                   1 234567890123456789012345678901234
+quax0a1 quantize     8.555555555555555555555555555555555E+6143  1E+6143      -> 9E+6143   Inexact Rounded
+quax0a2 quantize 128#8.555555555555555555555555555555555E+6143  128#1E+6143  -> 8.55555555555555555555555555555556E+6143   Rounded Inexact
+quax0a3 quantize 128#8.555555555555555555555555555555555E+6144  128#1E+6144  -> 8.555555555555555555555555555555555E+6144
+
+-- payload decapitate
+precision: 5
+quax62100 quantize 11 -sNaN1234567890 -> -NaN67890  Invalid_operation
+
 -- Null tests
-quax900 quantize 10    # -> NaN Invalid_operation
-quax901 quantize  # 1e10 -> NaN Invalid_operation
+quax998 quantize 10    # -> NaN Invalid_operation
+quax999 quantize  # 1e10 -> NaN Invalid_operation
index 308589c1485f9ccbd24136df0fbed4f1853dd20d..7f115adcfed3e6ea5988c6834d668317a36b3a5b 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- randomBound32.decTest -- decimal testcases -- boundaries near 32   --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.55
 
 -- These testcases test calculations at precisions 31, 32, and 33, to
 -- exercise the boundaries around 2**5
@@ -90,7 +90,7 @@ comx3008 compare 75353574493.84484153484918212042 -86841116950958499222630441912
 divx3008 divide 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8.677177026223536475531592432118E-21 Inexact Rounded
 dvix3008 divideint 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -0
 mulx3008 multiply 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -6.543788575292743281456830701127E+41 Inexact Rounded
-powx3008 power 75353574493.84484153484918212042 -9 -> 1.276630670287906925570645490708E-98 Inexact Rounded
+powx3008 power 75353574493.84484153484918212042 -9 -> 1.276630670287906925570645490707E-98 Inexact Rounded
 remx3008 remainder 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 75353574493.84484153484918212042
 subx3008 subtract 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 8684111695095849922338397765715 Inexact Rounded
 addx3009 add 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907061.073440802792400108035410 Inexact Rounded
@@ -1040,7 +1040,7 @@ comx3226 compare 47.525676459351505682005359699680E+704 -58631943508436657383369
 divx3226 divide 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -8.1057651538555854520994438038537E+673 Inexact Rounded
 dvix3226 divideint 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible
 mulx3226 multiply 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -2.7865227773649353769876975366506E+737 Inexact Rounded
-powx3226 power 47.525676459351505682005359699680E+704 -6 -> 8.6782100393941226535150385475463E-4235 Inexact Rounded
+powx3226 power 47.525676459351505682005359699680E+704 -6 -> 8.6782100393941226535150385475464E-4235 Inexact Rounded
 remx3226 remainder 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible
 subx3226 subtract 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded
 addx3227 add -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396977890406.153948943614775470 Inexact Rounded
index 5493f0c955f491bb0052d070945190004e1e829d..1529aec60b2353c24fbcbe884eac732293231448 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- randoms.decTest -- decimal random testcases                        --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 maxexponent: 999999999
@@ -264,7 +264,7 @@ xcom030 compare -225094.28 -88.7723542 -> -1
 xdiv030 divide -225094.28 -88.7723542 -> 2535.63491 Inexact Rounded
 xdvi030 divideint -225094.28 -88.7723542 -> 2535
 xmul030 multiply -225094.28 -88.7723542 -> 19982149.2 Inexact Rounded
-xpow030 power -225094.28 -89 -> -4.36076964E-477 Inexact Rounded
+xpow030 power -225094.28 -89 -> -4.36076965E-477 Inexact Rounded
 xrem030 remainder -225094.28 -88.7723542 -> -56.3621030
 xsub030 subtract -225094.28 -88.7723542 -> -225005.508 Inexact Rounded
 xadd031 add 50.4442340 82.7952169E+880120759 -> 8.27952169E+880120760 Inexact Rounded
@@ -295,7 +295,7 @@ xadd034 add 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-41994141
 xcom034 compare 592.142173E-419941416 -3.46079109E-844011845 -> 1
 xdiv034 divide 592.142173E-419941416 -3.46079109E-844011845 -> -1.71100236E+424070431 Inexact Rounded
 xdvi034 divideint 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible
-xmul034 multiply 592.142173E-419941416 -3.46079109E-844011845 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul034 multiply 592.142173E-419941416 -3.46079109E-844011845 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow034 power 592.142173E-419941416 -3 -> Infinity Overflow Inexact Rounded
 xrem034 remainder 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible
 xsub034 subtract 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-419941414 Inexact Rounded
@@ -487,7 +487,7 @@ xadd058 add 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174
 xcom058 compare 151795163E-371727182 -488.09788E-738852245 -> 1
 xdiv058 divide 151795163E-371727182 -488.09788E-738852245 -> -3.10993285E+367125068 Inexact Rounded
 xdvi058 divideint 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible
-xmul058 multiply 151795163E-371727182 -488.09788E-738852245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul058 multiply 151795163E-371727182 -488.09788E-738852245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow058 power 151795163E-371727182 -5 -> Infinity Overflow Inexact Rounded
 xrem058 remainder 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible
 xsub058 subtract 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174 Inexact Rounded
@@ -568,7 +568,7 @@ xcom068 compare -12393257.2 76803689E+949125770 -> -1
 xdiv068 divide -12393257.2 76803689E+949125770 -> -1.61362786E-949125771 Inexact Rounded
 xdvi068 divideint -12393257.2 76803689E+949125770 -> -0
 xmul068 multiply -12393257.2 76803689E+949125770 -> -9.51847872E+949125784 Inexact Rounded
-xpow068 power -12393257.2 8 -> 5.56523750E+56 Inexact Rounded
+xpow068 power -12393257.2 8 -> 5.56523749E+56 Inexact Rounded
 xrem068 remainder -12393257.2 76803689E+949125770 -> -12393257.2
 xsub068 subtract -12393257.2 76803689E+949125770 -> -7.68036890E+949125777 Inexact Rounded
 xadd069 add -754771634.E+716555026 -292336.311 -> -7.54771634E+716555034 Inexact Rounded
@@ -775,7 +775,7 @@ xadd094 add -671.507198E-908587890 3057429.32E-555230623 -> 3.05742932E-55523061
 xcom094 compare -671.507198E-908587890 3057429.32E-555230623 -> -1
 xdiv094 divide -671.507198E-908587890 3057429.32E-555230623 -> -2.19631307E-353357271 Inexact Rounded
 xdvi094 divideint -671.507198E-908587890 3057429.32E-555230623 -> -0
-xmul094 multiply -671.507198E-908587890 3057429.32E-555230623 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul094 multiply -671.507198E-908587890 3057429.32E-555230623 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow094 power -671.507198E-908587890 3 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem094 remainder -671.507198E-908587890 3057429.32E-555230623 -> -6.71507198E-908587888
 xsub094 subtract -671.507198E-908587890 3057429.32E-555230623 -> -3.05742932E-555230617 Inexact Rounded
@@ -856,7 +856,7 @@ xcom104 compare 553527296. -7924.40185 -> 1
 xdiv104 divide 553527296. -7924.40185 -> -69850.9877 Inexact Rounded
 xdvi104 divideint 553527296. -7924.40185 -> -69850
 xmul104 multiply 553527296. -7924.40185 -> -4.38637273E+12 Inexact Rounded
-xpow104 power 553527296. -7924 -> 2.32397213E-69281 Inexact Rounded
+xpow104 power 553527296. -7924 -> 2.32397214E-69281 Inexact Rounded
 xrem104 remainder 553527296. -7924.40185 -> 7826.77750
 xsub104 subtract 553527296. -7924.40185 -> 553535220 Inexact Rounded
 xadd105 add -38.7465207 64936.2942 -> 64897.5477 Inexact Rounded
@@ -919,7 +919,7 @@ xadd112 add -51.1632090E-753968082 8.96207471E-585797887 -> 8.96207471E-58579788
 xcom112 compare -51.1632090E-753968082 8.96207471E-585797887 -> -1
 xdiv112 divide -51.1632090E-753968082 8.96207471E-585797887 -> -5.70885768E-168170195 Inexact Rounded
 xdvi112 divideint -51.1632090E-753968082 8.96207471E-585797887 -> -0
-xmul112 multiply -51.1632090E-753968082 8.96207471E-585797887 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul112 multiply -51.1632090E-753968082 8.96207471E-585797887 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow112 power -51.1632090E-753968082 9 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem112 remainder -51.1632090E-753968082 8.96207471E-585797887 -> -5.11632090E-753968081
 xsub112 subtract -51.1632090E-753968082 8.96207471E-585797887 -> -8.96207471E-585797887 Inexact Rounded
@@ -989,7 +989,7 @@ xrem120 remainder 14239029. -36527.2221 -> 29939.6031
 xsub120 subtract 14239029. -36527.2221 -> 14275556.2 Inexact Rounded
 xadd121 add 72333.2654E-544425548 -690.664836E+662155120 -> -6.90664836E+662155122 Inexact Rounded
 xcom121 compare 72333.2654E-544425548 -690.664836E+662155120 -> 1
-xdiv121 divide 72333.2654E-544425548 -690.664836E+662155120 -> -0E-1000000007 Inexact Rounded Underflow Subnormal
+xdiv121 divide 72333.2654E-544425548 -690.664836E+662155120 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped
 xdvi121 divideint 72333.2654E-544425548 -690.664836E+662155120 -> -0
 xmul121 multiply 72333.2654E-544425548 -690.664836E+662155120 -> -4.99580429E+117729579 Inexact Rounded
 xpow121 power 72333.2654E-544425548 -7 -> Infinity Overflow Inexact Rounded
@@ -1005,7 +1005,7 @@ xrem122 remainder -37721.1567E-115787341 -828949864E-76251747 -> -3.77211567E-11
 xsub122 subtract -37721.1567E-115787341 -828949864E-76251747 -> 8.28949864E-76251739 Inexact Rounded
 xadd123 add -2078852.83E-647080089 -119779858.E+734665461 -> -1.19779858E+734665469 Inexact Rounded
 xcom123 compare -2078852.83E-647080089 -119779858.E+734665461 -> 1
-xdiv123 divide -2078852.83E-647080089 -119779858.E+734665461 -> 0E-1000000007 Inexact Rounded Underflow Subnormal
+xdiv123 divide -2078852.83E-647080089 -119779858.E+734665461 -> 0E-1000000007 Inexact Rounded Underflow Subnormal Clamped
 xdvi123 divideint -2078852.83E-647080089 -119779858.E+734665461 -> 0
 xmul123 multiply -2078852.83E-647080089 -119779858.E+734665461 -> 2.49004697E+87585386 Inexact Rounded
 xpow123 power -2078852.83E-647080089 -1 -> -4.81034533E+647080082 Inexact Rounded
@@ -1183,7 +1183,7 @@ xadd145 add -477067757.E-961684940 7.70122608E-741072245 -> 7.70122608E-74107224
 xcom145 compare -477067757.E-961684940 7.70122608E-741072245 -> -1
 xdiv145 divide -477067757.E-961684940 7.70122608E-741072245 -> -6.19469877E-220612688 Inexact Rounded
 xdvi145 divideint -477067757.E-961684940 7.70122608E-741072245 -> -0
-xmul145 multiply -477067757.E-961684940 7.70122608E-741072245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul145 multiply -477067757.E-961684940 7.70122608E-741072245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow145 power -477067757.E-961684940 8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem145 remainder -477067757.E-961684940 7.70122608E-741072245 -> -4.77067757E-961684932
 xsub145 subtract -477067757.E-961684940 7.70122608E-741072245 -> -7.70122608E-741072245 Inexact Rounded
@@ -1296,7 +1296,7 @@ xcom159 compare -18861647. 99794586.7 -> -1
 xdiv159 divide -18861647. 99794586.7 -> -0.189004711 Inexact Rounded
 xdvi159 divideint -18861647. 99794586.7 -> -0
 xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded
-xpow159 power -18861647. 99794587 -> -4.28957460E+726063462 Inexact Rounded
+xpow159 power -18861647. 99794587 -> -4.28957459E+726063462 Inexact Rounded
 xrem159 remainder -18861647. 99794586.7 -> -18861647.0
 xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded
 xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded
@@ -1519,7 +1519,7 @@ xadd187 add -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138
 xcom187 compare -29.356551E-282816139 37141748E-903397821 -> -1
 xdiv187 divide -29.356551E-282816139 37141748E-903397821 -> -7.90392283E+620581675 Inexact Rounded
 xdvi187 divideint -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible
-xmul187 multiply -29.356551E-282816139 37141748E-903397821 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul187 multiply -29.356551E-282816139 37141748E-903397821 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow187 power -29.356551E-282816139 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem187 remainder -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible
 xsub187 subtract -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138 Inexact Rounded
@@ -1760,7 +1760,7 @@ xcom217 compare 7428219.97 667.326760 -> 1
 xdiv217 divide 7428219.97 667.326760 -> 11131.3084 Inexact Rounded
 xdvi217 divideint 7428219.97 667.326760 -> 11131
 xmul217 multiply 7428219.97 667.326760 -> 4.95704997E+9 Inexact Rounded
-xpow217 power 7428219.97 667 -> 7.58808510E+4582 Inexact Rounded
+xpow217 power 7428219.97 667 -> 7.58808509E+4582 Inexact Rounded
 xrem217 remainder 7428219.97 667.326760 -> 205.804440
 xsub217 subtract 7428219.97 667.326760 -> 7427552.64 Inexact Rounded
 xadd218 add -7291.19212 209.64966E-588526476 -> -7291.19212 Inexact Rounded
@@ -2200,7 +2200,7 @@ xcom272 compare 513115529. 27775075.6E+217133352 -> -1
 xdiv272 divide 513115529. 27775075.6E+217133352 -> 1.84739562E-217133351 Inexact Rounded
 xdvi272 divideint 513115529. 27775075.6E+217133352 -> 0
 xmul272 multiply 513115529. 27775075.6E+217133352 -> 1.42518226E+217133368 Inexact Rounded
-xpow272 power 513115529. 3 -> 1.35096929E+26 Inexact Rounded
+xpow272 power 513115529. 3 -> 1.35096928E+26 Inexact Rounded
 xrem272 remainder 513115529. 27775075.6E+217133352 -> 513115529
 xsub272 subtract 513115529. 27775075.6E+217133352 -> -2.77750756E+217133359 Inexact Rounded
 xadd273 add -247157.208 -532990.453 -> -780147.661
@@ -2327,7 +2327,7 @@ xadd288 add -4.18074650E-858746879 571035.277E-279409165 -> 5.71035277E-27940916
 xcom288 compare -4.18074650E-858746879 571035.277E-279409165 -> -1
 xdiv288 divide -4.18074650E-858746879 571035.277E-279409165 -> -7.32134540E-579337720 Inexact Rounded
 xdvi288 divideint -4.18074650E-858746879 571035.277E-279409165 -> -0
-xmul288 multiply -4.18074650E-858746879 571035.277E-279409165 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul288 multiply -4.18074650E-858746879 571035.277E-279409165 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow288 power -4.18074650E-858746879 6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem288 remainder -4.18074650E-858746879 571035.277E-279409165 -> -4.18074650E-858746879
 xsub288 subtract -4.18074650E-858746879 571035.277E-279409165 -> -5.71035277E-279409160 Inexact Rounded
@@ -2599,7 +2599,7 @@ xadd322 add 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-32191930
 xcom322 compare 82.4185291E-321919303 -215747737.E-995147400 -> 1
 xdiv322 divide 82.4185291E-321919303 -215747737.E-995147400 -> -3.82013412E+673228090 Inexact Rounded
 xdvi322 divideint 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible
-xmul322 multiply 82.4185291E-321919303 -215747737.E-995147400 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul322 multiply 82.4185291E-321919303 -215747737.E-995147400 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow322 power 82.4185291E-321919303 -2 -> 1.47214396E+643838602 Inexact Rounded
 xrem322 remainder 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible
 xsub322 subtract 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-321919302 Inexact Rounded
@@ -2640,7 +2640,7 @@ xcom327 compare 2512953.3 -3769170.35E-993621645 -> 1
 xdiv327 divide 2512953.3 -3769170.35E-993621645 -> -6.66712583E+993621644 Inexact Rounded
 xdvi327 divideint 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible
 xmul327 multiply 2512953.3 -3769170.35E-993621645 -> -9.47174907E-993621633 Inexact Rounded
-xpow327 power 2512953.3 -4 -> 2.50762349E-26 Inexact Rounded
+xpow327 power 2512953.3 -4 -> 2.50762348E-26 Inexact Rounded
 xrem327 remainder 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible
 xsub327 subtract 2512953.3 -3769170.35E-993621645 -> 2512953.30 Inexact Rounded
 xadd328 add -682.796370 71131.0224 -> 70448.2260 Inexact Rounded
@@ -2656,7 +2656,7 @@ xcom329 compare 89.9997490 -4993.69831 -> 1
 xdiv329 divide 89.9997490 -4993.69831 -> -0.0180226644 Inexact Rounded
 xdvi329 divideint 89.9997490 -4993.69831 -> -0
 xmul329 multiply 89.9997490 -4993.69831 -> -449431.594 Inexact Rounded
-xpow329 power 89.9997490 -4994 -> 3.30336526E-9760 Inexact Rounded
+xpow329 power 89.9997490 -4994 -> 3.30336525E-9760 Inexact Rounded
 xrem329 remainder 89.9997490 -4993.69831 -> 89.9997490
 xsub329 subtract 89.9997490 -4993.69831 -> 5083.69806 Inexact Rounded
 xadd330 add 76563354.6E-112338836 278271.585E-511481095 -> 7.65633546E-112338829 Inexact Rounded
@@ -2821,7 +2821,7 @@ xrem349 remainder -4037911.02E+641367645 29.5713010 -> NaN Division_impossible
 xsub349 subtract -4037911.02E+641367645 29.5713010 -> -4.03791102E+641367651 Inexact Rounded
 xadd350 add -688755561.E-95301699 978.275312E+913812609 -> 9.78275312E+913812611 Inexact Rounded
 xcom350 compare -688755561.E-95301699 978.275312E+913812609 -> -1
-xdiv350 divide -688755561.E-95301699 978.275312E+913812609 -> -0E-1000000007 Inexact Rounded Underflow Subnormal
+xdiv350 divide -688755561.E-95301699 978.275312E+913812609 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped
 xdvi350 divideint -688755561.E-95301699 978.275312E+913812609 -> -0
 xmul350 multiply -688755561.E-95301699 978.275312E+913812609 -> -6.73792561E+818510921 Inexact Rounded
 xpow350 power -688755561.E-95301699 10 -> 2.40243244E-953016902 Inexact Rounded
@@ -3024,7 +3024,7 @@ xcom375 compare -5549320.1 -93580684.1 -> 1
 xdiv375 divide -5549320.1 -93580684.1 -> 0.0592998454 Inexact Rounded
 xdvi375 divideint -5549320.1 -93580684.1 -> 0
 xmul375 multiply -5549320.1 -93580684.1 -> 5.19309171E+14 Inexact Rounded
-xpow375 power -5549320.1 -93580684 -> 4.20662080E-631130572 Inexact Rounded
+xpow375 power -5549320.1 -93580684 -> 4.20662079E-631130572 Inexact Rounded
 xrem375 remainder -5549320.1 -93580684.1 -> -5549320.1
 xsub375 subtract -5549320.1 -93580684.1 -> 88031364.0
 xadd376 add -14677053.1 -25784.7358 -> -14702837.8 Inexact Rounded
@@ -3191,7 +3191,7 @@ xadd396 add 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618
 xcom396 compare 4880.06442E-382222621 -115627239E-912834031 -> 1
 xdiv396 divide 4880.06442E-382222621 -115627239E-912834031 -> -4.22051453E+530611405 Inexact Rounded
 xdvi396 divideint 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible
-xmul396 multiply 4880.06442E-382222621 -115627239E-912834031 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul396 multiply 4880.06442E-382222621 -115627239E-912834031 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow396 power 4880.06442E-382222621 -1 -> 2.04915328E+382222617 Inexact Rounded
 xrem396 remainder 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible
 xsub396 subtract 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618 Inexact Rounded
@@ -3295,7 +3295,7 @@ xadd409 add -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-8072101
 xcom409 compare -54.3684171E-807210192 1.04592973E-984041807 -> -1
 xdiv409 divide -54.3684171E-807210192 1.04592973E-984041807 -> -5.19809463E+176831616 Inexact Rounded
 xdvi409 divideint -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible
-xmul409 multiply -54.3684171E-807210192 1.04592973E-984041807 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul409 multiply -54.3684171E-807210192 1.04592973E-984041807 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow409 power -54.3684171E-807210192 1 -> -5.43684171E-807210191
 xrem409 remainder -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible
 xsub409 subtract -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-807210191 Inexact Rounded
@@ -3391,7 +3391,7 @@ xadd421 add -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-30174949
 xcom421 compare -4.09492571E-301749490 434.20199E-749390952 -> -1
 xdiv421 divide -4.09492571E-301749490 434.20199E-749390952 -> -9.43092341E+447641459 Inexact Rounded
 xdvi421 divideint -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible
-xmul421 multiply -4.09492571E-301749490 434.20199E-749390952 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul421 multiply -4.09492571E-301749490 434.20199E-749390952 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow421 power -4.09492571E-301749490 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xrem421 remainder -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible
 xsub421 subtract -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-301749490 Inexact Rounded
@@ -3423,7 +3423,7 @@ xadd425 add 6.88891136E-935467395 -785049.562E-741671442 -> -7.85049562E-7416714
 xcom425 compare 6.88891136E-935467395 -785049.562E-741671442 -> 1
 xdiv425 divide 6.88891136E-935467395 -785049.562E-741671442 -> -8.77512923E-193795959 Inexact Rounded
 xdvi425 divideint 6.88891136E-935467395 -785049.562E-741671442 -> -0
-xmul425 multiply 6.88891136E-935467395 -785049.562E-741671442 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul425 multiply 6.88891136E-935467395 -785049.562E-741671442 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow425 power 6.88891136E-935467395 -8 -> Infinity Overflow Inexact Rounded
 xrem425 remainder 6.88891136E-935467395 -785049.562E-741671442 -> 6.88891136E-935467395
 xsub425 subtract 6.88891136E-935467395 -785049.562E-741671442 -> 7.85049562E-741671437 Inexact Rounded
@@ -3535,7 +3535,7 @@ xadd439 add 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244
 xcom439 compare 971113.655E-695540249 -419351120E-977743823 -> 1
 xdiv439 divide 971113.655E-695540249 -419351120E-977743823 -> -2.31575310E+282203571 Inexact Rounded
 xdvi439 divideint 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible
-xmul439 multiply 971113.655E-695540249 -419351120E-977743823 -> -0E-1000000007 Underflow Subnormal Inexact Rounded
+xmul439 multiply 971113.655E-695540249 -419351120E-977743823 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
 xpow439 power 971113.655E-695540249 -4 -> Infinity Overflow Inexact Rounded
 xrem439 remainder 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible
 xsub439 subtract 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244 Inexact Rounded
@@ -3600,7 +3600,7 @@ xcom447 compare -9.95836312 -866466703 -> 1
 xdiv447 divide -9.95836312 -866466703 -> 1.14930707E-8 Inexact Rounded
 xdvi447 divideint -9.95836312 -866466703 -> 0
 xmul447 multiply -9.95836312 -866466703 -> 8.62859006E+9 Inexact Rounded
-xpow447 power -9.95836312 -866466703 -> -6.71744368E-864896630 Inexact Rounded
+xpow447 power -9.95836312 -866466703 -> -6.71744369E-864896630 Inexact Rounded
 xrem447 remainder -9.95836312 -866466703 -> -9.95836312
 xsub447 subtract -9.95836312 -866466703 -> 866466693 Inexact Rounded
 xadd448 add 80919339.2E-967231586 219.824266 -> 219.824266 Inexact Rounded
@@ -3616,7 +3616,7 @@ xcom449 compare 159579.444 -89827.5229 -> 1
 xdiv449 divide 159579.444 -89827.5229 -> -1.77650946 Inexact Rounded
 xdvi449 divideint 159579.444 -89827.5229 -> -1
 xmul449 multiply 159579.444 -89827.5229 -> -1.43346262E+10 Inexact Rounded
-xpow449 power 159579.444 -89828 -> 9.69955849E-467374 Inexact Rounded
+xpow449 power 159579.444 -89828 -> 9.69955850E-467374 Inexact Rounded
 xrem449 remainder 159579.444 -89827.5229 -> 69751.9211
 xsub449 subtract 159579.444 -89827.5229 -> 249406.967 Inexact Rounded
 xadd450 add -4.54000153 6966333.74 -> 6966329.20 Inexact Rounded
@@ -3640,7 +3640,7 @@ xcom452 compare -361382575. -7976.15286E+898491169 -> 1
 xdiv452 divide -361382575. -7976.15286E+898491169 -> 4.53078798E-898491165 Inexact Rounded
 xdvi452 divideint -361382575. -7976.15286E+898491169 -> 0
 xmul452 multiply -361382575. -7976.15286E+898491169 -> 2.88244266E+898491181 Inexact Rounded
-xpow452 power -361382575. -8 -> 3.43765536E-69 Inexact Rounded
+xpow452 power -361382575. -8 -> 3.43765537E-69 Inexact Rounded
 xrem452 remainder -361382575. -7976.15286E+898491169 -> -361382575
 xsub452 subtract -361382575. -7976.15286E+898491169 -> 7.97615286E+898491172 Inexact Rounded
 xadd453 add 7021805.61 1222952.83 -> 8244758.44
@@ -3720,7 +3720,7 @@ xcom462 compare -51592.2698 -713885.741 -> 1
 xdiv462 divide -51592.2698 -713885.741 -> 0.0722696460 Inexact Rounded
 xdvi462 divideint -51592.2698 -713885.741 -> 0
 xmul462 multiply -51592.2698 -713885.741 -> 3.68309858E+10 Inexact Rounded
-xpow462 power -51592.2698 -713886 -> 6.38576921E-3364249 Inexact Rounded
+xpow462 power -51592.2698 -713886 -> 6.38576920E-3364249 Inexact Rounded
 xrem462 remainder -51592.2698 -713885.741 -> -51592.2698
 xsub462 subtract -51592.2698 -713885.741 -> 662293.471 Inexact Rounded
 xadd463 add 51.2279848E+80439745 207.55925E+865165070 -> 2.07559250E+865165072 Inexact Rounded
@@ -3768,7 +3768,7 @@ xcom468 compare -5.32711606 -8447286.21 -> 1
 xdiv468 divide -5.32711606 -8447286.21 -> 6.30630468E-7 Inexact Rounded
 xdvi468 divideint -5.32711606 -8447286.21 -> 0
 xmul468 multiply -5.32711606 -8447286.21 -> 44999674.0 Inexact Rounded
-xpow468 power -5.32711606 -8447286 -> 9.09138729E-6136888 Inexact Rounded
+xpow468 power -5.32711606 -8447286 -> 9.09138728E-6136888 Inexact Rounded
 xrem468 remainder -5.32711606 -8447286.21 -> -5.32711606
 xsub468 subtract -5.32711606 -8447286.21 -> 8447280.88 Inexact Rounded
 xadd469 add -82272171.8 -776.238587E-372690416 -> -82272171.8 Inexact Rounded
@@ -4027,3 +4027,4 @@ xmul500 multiply -525445087.E+231529167 188227460 -> -9.89031941E+231529183 Inex
 xpow500 power -525445087.E+231529167 188227460 -> Infinity Overflow Inexact Rounded
 xrem500 remainder -525445087.E+231529167 188227460 -> NaN Division_impossible
 xsub500 subtract -525445087.E+231529167 188227460 -> -5.25445087E+231529175 Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/reduce.decTest b/Lib/test/decimaltestdata/reduce.decTest
new file mode 100644 (file)
index 0000000..ddce0c9
--- /dev/null
@@ -0,0 +1,234 @@
+------------------------------------------------------------------------
+-- reduce.decTest -- remove trailing zeros                            --
+-- Copyright (c) IBM Corporation, 2003, 2007.  All rights reserved.   --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases"     --
+-- at http://www2.hursley.ibm.com/decimal for the description of      --
+-- these testcases.                                                   --
+--                                                                    --
+-- These testcases are experimental ('beta' versions), and they       --
+-- may contain errors.  They are offered on an as-is basis.  In       --
+-- particular, achieving the same results as the tests here is not    --
+-- a guarantee that an implementation complies with any Standard      --
+-- or specification.  The tests are not exhaustive.                   --
+--                                                                    --
+-- Please send comments, suggestions, and corrections to the author:  --
+--   Mike Cowlishaw, IBM Fellow                                       --
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
+--   mfc@uk.ibm.com                                                   --
+------------------------------------------------------------------------
+-- [This used to be called normalize.]
+
+version: 2.56
+
+extended:    1
+precision:   9
+rounding:    half_up
+maxExponent: 999
+minexponent: -999
+
+redx001 reduce '1'      -> '1'
+redx002 reduce '-1'     -> '-1'
+redx003 reduce '1.00'   -> '1'
+redx004 reduce '-1.00'  -> '-1'
+redx005 reduce '0'      -> '0'
+redx006 reduce '0.00'   -> '0'
+redx007 reduce '00.0'   -> '0'
+redx008 reduce '00.00'  -> '0'
+redx009 reduce '00'     -> '0'
+redx010 reduce '0E+1'   -> '0'
+redx011 reduce '0E+5'   -> '0'
+
+redx012 reduce '-2'     -> '-2'
+redx013 reduce '2'      -> '2'
+redx014 reduce '-2.00'  -> '-2'
+redx015 reduce '2.00'   -> '2'
+redx016 reduce '-0'     -> '-0'
+redx017 reduce '-0.00'  -> '-0'
+redx018 reduce '-00.0'  -> '-0'
+redx019 reduce '-00.00' -> '-0'
+redx020 reduce '-00'    -> '-0'
+redx021 reduce '-0E+5'   -> '-0'
+redx022 reduce '-0E+1'  -> '-0'
+
+redx030 reduce '+0.1'            -> '0.1'
+redx031 reduce '-0.1'            -> '-0.1'
+redx032 reduce '+0.01'           -> '0.01'
+redx033 reduce '-0.01'           -> '-0.01'
+redx034 reduce '+0.001'          -> '0.001'
+redx035 reduce '-0.001'          -> '-0.001'
+redx036 reduce '+0.000001'       -> '0.000001'
+redx037 reduce '-0.000001'       -> '-0.000001'
+redx038 reduce '+0.000000000001' -> '1E-12'
+redx039 reduce '-0.000000000001' -> '-1E-12'
+
+redx041 reduce 1.1        -> 1.1
+redx042 reduce 1.10       -> 1.1
+redx043 reduce 1.100      -> 1.1
+redx044 reduce 1.110      -> 1.11
+redx045 reduce -1.1       -> -1.1
+redx046 reduce -1.10      -> -1.1
+redx047 reduce -1.100     -> -1.1
+redx048 reduce -1.110     -> -1.11
+redx049 reduce 9.9        -> 9.9
+redx050 reduce 9.90       -> 9.9
+redx051 reduce 9.900      -> 9.9
+redx052 reduce 9.990      -> 9.99
+redx053 reduce -9.9       -> -9.9
+redx054 reduce -9.90      -> -9.9
+redx055 reduce -9.900     -> -9.9
+redx056 reduce -9.990     -> -9.99
+
+-- some trailing fractional zeros with zeros in units
+redx060 reduce  10.0        -> 1E+1
+redx061 reduce  10.00       -> 1E+1
+redx062 reduce  100.0       -> 1E+2
+redx063 reduce  100.00      -> 1E+2
+redx064 reduce  1.1000E+3   -> 1.1E+3
+redx065 reduce  1.10000E+3  -> 1.1E+3
+redx066 reduce -10.0        -> -1E+1
+redx067 reduce -10.00       -> -1E+1
+redx068 reduce -100.0       -> -1E+2
+redx069 reduce -100.00      -> -1E+2
+redx070 reduce -1.1000E+3   -> -1.1E+3
+redx071 reduce -1.10000E+3  -> -1.1E+3
+
+-- some insignificant trailing zeros with positive exponent
+redx080 reduce  10E+1       -> 1E+2
+redx081 reduce  100E+1      -> 1E+3
+redx082 reduce  1.0E+2      -> 1E+2
+redx083 reduce  1.0E+3      -> 1E+3
+redx084 reduce  1.1E+3      -> 1.1E+3
+redx085 reduce  1.00E+3     -> 1E+3
+redx086 reduce  1.10E+3     -> 1.1E+3
+redx087 reduce -10E+1       -> -1E+2
+redx088 reduce -100E+1      -> -1E+3
+redx089 reduce -1.0E+2      -> -1E+2
+redx090 reduce -1.0E+3      -> -1E+3
+redx091 reduce -1.1E+3      -> -1.1E+3
+redx092 reduce -1.00E+3     -> -1E+3
+redx093 reduce -1.10E+3     -> -1.1E+3
+
+-- some significant trailing zeros, were we to be trimming
+redx100 reduce  11          -> 11
+redx101 reduce  10          -> 1E+1
+redx102 reduce  10.         -> 1E+1
+redx103 reduce  1.1E+1      -> 11
+redx104 reduce  1.0E+1      -> 1E+1
+redx105 reduce  1.10E+2     -> 1.1E+2
+redx106 reduce  1.00E+2     -> 1E+2
+redx107 reduce  1.100E+3    -> 1.1E+3
+redx108 reduce  1.000E+3    -> 1E+3
+redx109 reduce  1.000000E+6 -> 1E+6
+redx110 reduce -11          -> -11
+redx111 reduce -10          -> -1E+1
+redx112 reduce -10.         -> -1E+1
+redx113 reduce -1.1E+1      -> -11
+redx114 reduce -1.0E+1      -> -1E+1
+redx115 reduce -1.10E+2     -> -1.1E+2
+redx116 reduce -1.00E+2     -> -1E+2
+redx117 reduce -1.100E+3    -> -1.1E+3
+redx118 reduce -1.000E+3    -> -1E+3
+redx119 reduce -1.00000E+5  -> -1E+5
+redx120 reduce -1.000000E+6 -> -1E+6
+redx121 reduce -10.00000E+6 -> -1E+7
+redx122 reduce -100.0000E+6 -> -1E+8
+redx123 reduce -1000.000E+6 -> -1E+9
+redx124 reduce -10000.00E+6 -> -1E+10
+redx125 reduce -100000.0E+6 -> -1E+11
+redx126 reduce -1000000.E+6 -> -1E+12
+
+-- examples from decArith
+redx140 reduce '2.1'     ->  '2.1'
+redx141 reduce '-2.0'    ->  '-2'
+redx142 reduce '1.200'   ->  '1.2'
+redx143 reduce '-120'    ->  '-1.2E+2'
+redx144 reduce '120.00'  ->  '1.2E+2'
+redx145 reduce '0.00'    ->  '0'
+
+-- overflow tests
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+redx160 reduce 9.999E+999999999  ->  Infinity Inexact Overflow Rounded
+redx161 reduce -9.999E+999999999 -> -Infinity Inexact Overflow Rounded
+
+-- subnormals and underflow
+precision: 3
+maxexponent: 999
+minexponent: -999
+redx210 reduce  1.00E-999        ->   1E-999
+redx211 reduce  0.1E-999         ->   1E-1000   Subnormal
+redx212 reduce  0.10E-999        ->   1E-1000   Subnormal
+redx213 reduce  0.100E-999       ->   1E-1000   Subnormal Rounded
+redx214 reduce  0.01E-999        ->   1E-1001   Subnormal
+-- next is rounded to Emin
+redx215 reduce  0.999E-999       ->   1E-999    Inexact Rounded Subnormal Underflow
+redx216 reduce  0.099E-999       ->   1E-1000   Inexact Rounded Subnormal Underflow
+redx217 reduce  0.009E-999       ->   1E-1001   Inexact Rounded Subnormal Underflow
+redx218 reduce  0.001E-999       ->   0         Inexact Rounded Subnormal Underflow Clamped
+redx219 reduce  0.0009E-999      ->   0         Inexact Rounded Subnormal Underflow Clamped
+redx220 reduce  0.0001E-999      ->   0         Inexact Rounded Subnormal Underflow Clamped
+
+redx230 reduce -1.00E-999        ->  -1E-999
+redx231 reduce -0.1E-999         ->  -1E-1000   Subnormal
+redx232 reduce -0.10E-999        ->  -1E-1000   Subnormal
+redx233 reduce -0.100E-999       ->  -1E-1000   Subnormal Rounded
+redx234 reduce -0.01E-999        ->  -1E-1001   Subnormal
+-- next is rounded to Emin
+redx235 reduce -0.999E-999       ->  -1E-999    Inexact Rounded Subnormal Underflow
+redx236 reduce -0.099E-999       ->  -1E-1000   Inexact Rounded Subnormal Underflow
+redx237 reduce -0.009E-999       ->  -1E-1001   Inexact Rounded Subnormal Underflow
+redx238 reduce -0.001E-999       ->  -0         Inexact Rounded Subnormal Underflow Clamped
+redx239 reduce -0.0009E-999      ->  -0         Inexact Rounded Subnormal Underflow Clamped
+redx240 reduce -0.0001E-999      ->  -0         Inexact Rounded Subnormal Underflow Clamped
+
+-- more reshaping
+precision: 9
+redx260 reduce '56260E-10'   -> '0.000005626'
+redx261 reduce '56260E-5'    -> '0.5626'
+redx262 reduce '56260E-2'    -> '562.6'
+redx263 reduce '56260E-1'    -> '5626'
+redx265 reduce '56260E-0'    -> '5.626E+4'
+redx266 reduce '56260E+0'    -> '5.626E+4'
+redx267 reduce '56260E+1'    -> '5.626E+5'
+redx268 reduce '56260E+2'    -> '5.626E+6'
+redx269 reduce '56260E+3'    -> '5.626E+7'
+redx270 reduce '56260E+4'    -> '5.626E+8'
+redx271 reduce '56260E+5'    -> '5.626E+9'
+redx272 reduce '56260E+6'    -> '5.626E+10'
+redx280 reduce '-56260E-10'  -> '-0.000005626'
+redx281 reduce '-56260E-5'   -> '-0.5626'
+redx282 reduce '-56260E-2'   -> '-562.6'
+redx283 reduce '-56260E-1'   -> '-5626'
+redx285 reduce '-56260E-0'   -> '-5.626E+4'
+redx286 reduce '-56260E+0'   -> '-5.626E+4'
+redx287 reduce '-56260E+1'   -> '-5.626E+5'
+redx288 reduce '-56260E+2'   -> '-5.626E+6'
+redx289 reduce '-56260E+3'   -> '-5.626E+7'
+redx290 reduce '-56260E+4'   -> '-5.626E+8'
+redx291 reduce '-56260E+5'   -> '-5.626E+9'
+redx292 reduce '-56260E+6'   -> '-5.626E+10'
+
+-- FL test
+precision: 40
+redx295 reduce 9892345673.0123456780000000000 -> 9892345673.012345678
+
+-- specials
+redx820 reduce 'Inf'    -> 'Infinity'
+redx821 reduce '-Inf'   -> '-Infinity'
+redx822 reduce   NaN    ->  NaN
+redx823 reduce  sNaN    ->  NaN    Invalid_operation
+redx824 reduce   NaN101 ->  NaN101
+redx825 reduce  sNaN010 ->  NaN10  Invalid_operation
+redx827 reduce  -NaN    -> -NaN
+redx828 reduce -sNaN    -> -NaN    Invalid_operation
+redx829 reduce  -NaN101 -> -NaN101
+redx830 reduce -sNaN010 -> -NaN10  Invalid_operation
+
+-- payload decapitate
+precision: 5
+redx62100 reduce  sNaN1234567890 -> NaN67890  Invalid_operation
+
+-- Null test
+redx900 reduce  # -> NaN Invalid_operation
index 6eb49c32a1884e5e404e1f75ed2be8481929c120..4c92d0c93b8aab3ea0cfb7e839d45645f2302079 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- remainder.decTest -- decimal remainder                             --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -351,6 +351,17 @@ remx407 remainder   0.5555555   1   ->  0.5555555
 remx408 remainder   0.55555555  1   ->  0.55555555
 remx409 remainder   0.555555555 1   ->  0.555555555
 
+-- zero signs
+remx650 remainder  1  1 ->  0
+remx651 remainder -1  1 -> -0
+remx652 remainder  1 -1 ->  0
+remx653 remainder -1 -1 -> -0
+remx654 remainder  0  1 ->  0
+remx655 remainder -0  1 -> -0
+remx656 remainder  0 -1 ->  0
+remx657 remainder -0 -1 -> -0
+remx658 remainder  0.00  1  ->  0.00
+remx659 remainder -0.00  1  -> -0.00
 
 -- Specials
 remx680 remainder  Inf  -Inf   ->  NaN Invalid_operation
index d007bdae908ad879b55325d1584d7cef700773d7..cfca91b14ad3f74c0af9d3a22113dfb24bf85cdf 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- remainderNear.decTest -- decimal remainder-near (IEEE remainder)   --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.55
 
 extended:    1
 precision:   9
index fd63f0f715a8c46b88081a9dfe195c9e08b6dabd..30597db113cb1180d0af7f0d94873fa974c28fab 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- rescale.decTest -- decimal rescale operation                       --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- [obsolete]   Quantize.decTest has the improved version
 
@@ -379,7 +379,7 @@ resx445 rescale   0.000999      0  ->  0        Inexact Rounded
 resx446 rescale   0.000999      1  -> 0E+1      Inexact Rounded
 
 precision: 8
-resx449 rescale   9.999E-15    -23 ->  NaN Invalid_operation
+resx449 rescale   9.999E-15    -23 ->  NaN      Invalid_operation
 resx450 rescale   9.999E-15    -22 ->  9.9990000E-15
 resx451 rescale   9.999E-15    -21 ->  9.999000E-15
 resx452 rescale   9.999E-15    -20 ->  9.99900E-15
@@ -405,6 +405,12 @@ resx471 rescale   9.999E-15     -1 ->  0.0       Inexact Rounded
 resx472 rescale   9.999E-15      0 ->  0         Inexact Rounded
 resx473 rescale   9.999E-15      1 ->  0E+1      Inexact Rounded
 
+-- [additional tests for "don't fit" edge cases are in
+-- quantize.decTest.  Here's a critical one.]
+precision: 3
+resx480 rescale   0.9999        -3 ->  NaN       Invalid_operation
+
+
 -- long operand checks [rhs checks removed]
 maxexponent: 999
 minexponent: -999
diff --git a/Lib/test/decimaltestdata/rotate.decTest b/Lib/test/decimaltestdata/rotate.decTest
new file mode 100644 (file)
index 0000000..c5ced59
--- /dev/null
@@ -0,0 +1,247 @@
+------------------------------------------------------------------------\r
+-- rotate.decTest -- rotate coefficient left or right                 --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check\r
+rotx001 rotate          0    0  ->  0\r
+rotx002 rotate          0    2  ->  0\r
+rotx003 rotate          1    2  ->  100\r
+rotx004 rotate         34    8  ->  400000003\r
+rotx005 rotate          1    9  ->  1\r
+rotx006 rotate          1   -1  ->  100000000\r
+rotx007 rotate  123456789   -1  ->  912345678\r
+rotx008 rotate  123456789   -8  ->  234567891\r
+rotx009 rotate  123456789   -9  ->  123456789\r
+rotx010 rotate          0   -2  ->  0\r
+\r
+-- rhs must be an integer\r
+rotx011 rotate        1    1.5    -> NaN Invalid_operation\r
+rotx012 rotate        1    1.0    -> NaN Invalid_operation\r
+rotx013 rotate        1    0.1    -> NaN Invalid_operation\r
+rotx014 rotate        1    0.0    -> NaN Invalid_operation\r
+rotx015 rotate        1    1E+1   -> NaN Invalid_operation\r
+rotx016 rotate        1    1E+99  -> NaN Invalid_operation\r
+rotx017 rotate        1    Inf    -> NaN Invalid_operation\r
+rotx018 rotate        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+rotx020 rotate        1    -1000  -> NaN Invalid_operation\r
+rotx021 rotate        1    -10    -> NaN Invalid_operation\r
+rotx022 rotate        1     10    -> NaN Invalid_operation\r
+rotx023 rotate        1     1000  -> NaN Invalid_operation\r
+\r
+-- full pattern\r
+rotx030 rotate  123456789          -9   -> 123456789\r
+rotx031 rotate  123456789          -8   -> 234567891\r
+rotx032 rotate  123456789          -7   -> 345678912\r
+rotx033 rotate  123456789          -6   -> 456789123\r
+rotx034 rotate  123456789          -5   -> 567891234\r
+rotx035 rotate  123456789          -4   -> 678912345\r
+rotx036 rotate  123456789          -3   -> 789123456\r
+rotx037 rotate  123456789          -2   -> 891234567\r
+rotx038 rotate  123456789          -1   -> 912345678\r
+rotx039 rotate  123456789          -0   -> 123456789\r
+rotx040 rotate  123456789          +0   -> 123456789\r
+rotx041 rotate  123456789          +1   -> 234567891\r
+rotx042 rotate  123456789          +2   -> 345678912\r
+rotx043 rotate  123456789          +3   -> 456789123\r
+rotx044 rotate  123456789          +4   -> 567891234\r
+rotx045 rotate  123456789          +5   -> 678912345\r
+rotx046 rotate  123456789          +6   -> 789123456\r
+rotx047 rotate  123456789          +7   -> 891234567\r
+rotx048 rotate  123456789          +8   -> 912345678\r
+rotx049 rotate  123456789          +9   -> 123456789\r
+\r
+-- zeros\r
+rotx060 rotate  0E-10              +9   ->   0E-10\r
+rotx061 rotate  0E-10              -9   ->   0E-10\r
+rotx062 rotate  0.000              +9   ->   0.000\r
+rotx063 rotate  0.000              -9   ->   0.000\r
+rotx064 rotate  0E+10              +9   ->   0E+10\r
+rotx065 rotate  0E+10              -9   ->   0E+10\r
+rotx066 rotate -0E-10              +9   ->  -0E-10\r
+rotx067 rotate -0E-10              -9   ->  -0E-10\r
+rotx068 rotate -0.000              +9   ->  -0.000\r
+rotx069 rotate -0.000              -9   ->  -0.000\r
+rotx070 rotate -0E+10              +9   ->  -0E+10\r
+rotx071 rotate -0E+10              -9   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+rotx141 rotate  9.99999999E+999     -1  -> 9.99999999E+999\r
+rotx142 rotate  9.99999999E+999     -8  -> 9.99999999E+999\r
+rotx143 rotate  9.99999999E+999      1  -> 9.99999999E+999\r
+rotx144 rotate  9.99999999E+999      8  -> 9.99999999E+999\r
+rotx145 rotate  1E-999              -1  -> 1.00000000E-991\r
+rotx146 rotate  1E-999              -8  -> 1.0E-998\r
+rotx147 rotate  1E-999               1  -> 1.0E-998\r
+rotx148 rotate  1E-999               8  -> 1.00000000E-991\r
+rotx151 rotate  1.00000000E-999     -1  -> 1.0000000E-1000\r
+rotx152 rotate  1.00000000E-999     -8  -> 1E-1007\r
+rotx153 rotate  1.00000000E-999      1  -> 1E-1007\r
+rotx154 rotate  1.00000000E-999      8  -> 1.0000000E-1000\r
+rotx155 rotate  9.00000000E-999     -1  -> 9.0000000E-1000\r
+rotx156 rotate  9.00000000E-999     -8  -> 9E-1007\r
+rotx157 rotate  9.00000000E-999      1  -> 9E-1007\r
+rotx158 rotate  9.00000000E-999      8  -> 9.0000000E-1000\r
+rotx160 rotate  1E-1007             -1  -> 1.00000000E-999\r
+rotx161 rotate  1E-1007             -8  -> 1.0E-1006\r
+rotx162 rotate  1E-1007              1  -> 1.0E-1006\r
+rotx163 rotate  1E-1007              8  -> 1.00000000E-999\r
+--  negatives\r
+rotx171 rotate -9.99999999E+999     -1  -> -9.99999999E+999\r
+rotx172 rotate -9.99999999E+999     -8  -> -9.99999999E+999\r
+rotx173 rotate -9.99999999E+999      1  -> -9.99999999E+999\r
+rotx174 rotate -9.99999999E+999      8  -> -9.99999999E+999\r
+rotx175 rotate -1E-999              -1  -> -1.00000000E-991\r
+rotx176 rotate -1E-999              -8  -> -1.0E-998\r
+rotx177 rotate -1E-999               1  -> -1.0E-998\r
+rotx178 rotate -1E-999               8  -> -1.00000000E-991\r
+rotx181 rotate -1.00000000E-999     -1  -> -1.0000000E-1000\r
+rotx182 rotate -1.00000000E-999     -8  -> -1E-1007\r
+rotx183 rotate -1.00000000E-999      1  -> -1E-1007\r
+rotx184 rotate -1.00000000E-999      8  -> -1.0000000E-1000\r
+rotx185 rotate -9.00000000E-999     -1  -> -9.0000000E-1000\r
+rotx186 rotate -9.00000000E-999     -8  -> -9E-1007\r
+rotx187 rotate -9.00000000E-999      1  -> -9E-1007\r
+rotx188 rotate -9.00000000E-999      8  -> -9.0000000E-1000\r
+rotx190 rotate -1E-1007             -1  -> -1.00000000E-999\r
+rotx191 rotate -1E-1007             -8  -> -1.0E-1006\r
+rotx192 rotate -1E-1007              1  -> -1.0E-1006\r
+rotx193 rotate -1E-1007              8  -> -1.00000000E-999\r
+\r
+-- more negatives (of sanities)\r
+rotx201 rotate         -0    0  ->  -0\r
+rotx202 rotate         -0    2  ->  -0\r
+rotx203 rotate         -1    2  ->  -100\r
+rotx204 rotate         -1    8  ->  -100000000\r
+rotx205 rotate         -1    9  ->  -1\r
+rotx206 rotate         -1   -1  ->  -100000000\r
+rotx207 rotate -123456789   -1  ->  -912345678\r
+rotx208 rotate -123456789   -8  ->  -234567891\r
+rotx209 rotate -123456789   -9  ->  -123456789\r
+rotx210 rotate         -0   -2  ->  -0\r
+\r
+-- Specials; NaNs are handled as usual\r
+rotx781 rotate -Inf  -8     -> -Infinity\r
+rotx782 rotate -Inf  -1     -> -Infinity\r
+rotx783 rotate -Inf  -0     -> -Infinity\r
+rotx784 rotate -Inf   0     -> -Infinity\r
+rotx785 rotate -Inf   1     -> -Infinity\r
+rotx786 rotate -Inf   8     -> -Infinity\r
+rotx787 rotate -1000 -Inf   -> NaN Invalid_operation\r
+rotx788 rotate -Inf  -Inf   -> NaN Invalid_operation\r
+rotx789 rotate -1    -Inf   -> NaN Invalid_operation\r
+rotx790 rotate -0    -Inf   -> NaN Invalid_operation\r
+rotx791 rotate  0    -Inf   -> NaN Invalid_operation\r
+rotx792 rotate  1    -Inf   -> NaN Invalid_operation\r
+rotx793 rotate  1000 -Inf   -> NaN Invalid_operation\r
+rotx794 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+rotx800 rotate  Inf  -Inf   -> NaN Invalid_operation\r
+rotx801 rotate  Inf  -8     -> Infinity\r
+rotx802 rotate  Inf  -1     -> Infinity\r
+rotx803 rotate  Inf  -0     -> Infinity\r
+rotx804 rotate  Inf   0     -> Infinity\r
+rotx805 rotate  Inf   1     -> Infinity\r
+rotx806 rotate  Inf   8     -> Infinity\r
+rotx807 rotate  Inf   Inf   -> NaN Invalid_operation\r
+rotx808 rotate -1000  Inf   -> NaN Invalid_operation\r
+rotx809 rotate -Inf   Inf   -> NaN Invalid_operation\r
+rotx810 rotate -1     Inf   -> NaN Invalid_operation\r
+rotx811 rotate -0     Inf   -> NaN Invalid_operation\r
+rotx812 rotate  0     Inf   -> NaN Invalid_operation\r
+rotx813 rotate  1     Inf   -> NaN Invalid_operation\r
+rotx814 rotate  1000  Inf   -> NaN Invalid_operation\r
+rotx815 rotate  Inf   Inf   -> NaN Invalid_operation\r
+\r
+rotx821 rotate  NaN -Inf    ->  NaN\r
+rotx822 rotate  NaN -1000   ->  NaN\r
+rotx823 rotate  NaN -1      ->  NaN\r
+rotx824 rotate  NaN -0      ->  NaN\r
+rotx825 rotate  NaN  0      ->  NaN\r
+rotx826 rotate  NaN  1      ->  NaN\r
+rotx827 rotate  NaN  1000   ->  NaN\r
+rotx828 rotate  NaN  Inf    ->  NaN\r
+rotx829 rotate  NaN  NaN    ->  NaN\r
+rotx830 rotate -Inf  NaN    ->  NaN\r
+rotx831 rotate -1000 NaN    ->  NaN\r
+rotx832 rotate -1    NaN    ->  NaN\r
+rotx833 rotate -0    NaN    ->  NaN\r
+rotx834 rotate  0    NaN    ->  NaN\r
+rotx835 rotate  1    NaN    ->  NaN\r
+rotx836 rotate  1000 NaN    ->  NaN\r
+rotx837 rotate  Inf  NaN    ->  NaN\r
+\r
+\r
+\r
+rotx841 rotate  sNaN -Inf   ->  NaN  Invalid_operation\r
+rotx842 rotate  sNaN -1000  ->  NaN  Invalid_operation\r
+rotx843 rotate  sNaN -1     ->  NaN  Invalid_operation\r
+rotx844 rotate  sNaN -0     ->  NaN  Invalid_operation\r
+rotx845 rotate  sNaN  0     ->  NaN  Invalid_operation\r
+rotx846 rotate  sNaN  1     ->  NaN  Invalid_operation\r
+rotx847 rotate  sNaN  1000  ->  NaN  Invalid_operation\r
+rotx848 rotate  sNaN  NaN   ->  NaN  Invalid_operation\r
+rotx849 rotate  sNaN sNaN   ->  NaN  Invalid_operation\r
+rotx850 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+rotx851 rotate -Inf  sNaN   ->  NaN  Invalid_operation\r
+rotx852 rotate -1000 sNaN   ->  NaN  Invalid_operation\r
+rotx853 rotate -1    sNaN   ->  NaN  Invalid_operation\r
+rotx854 rotate -0    sNaN   ->  NaN  Invalid_operation\r
+rotx855 rotate  0    sNaN   ->  NaN  Invalid_operation\r
+rotx856 rotate  1    sNaN   ->  NaN  Invalid_operation\r
+rotx857 rotate  1000 sNaN   ->  NaN  Invalid_operation\r
+rotx858 rotate  Inf  sNaN   ->  NaN  Invalid_operation\r
+rotx859 rotate  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+rotx861 rotate  NaN1   -Inf    ->  NaN1\r
+rotx862 rotate +NaN2   -1000   ->  NaN2\r
+rotx863 rotate  NaN3    1000   ->  NaN3\r
+rotx864 rotate  NaN4    Inf    ->  NaN4\r
+rotx865 rotate  NaN5   +NaN6   ->  NaN5\r
+rotx866 rotate -Inf     NaN7   ->  NaN7\r
+rotx867 rotate -1000    NaN8   ->  NaN8\r
+rotx868 rotate  1000    NaN9   ->  NaN9\r
+rotx869 rotate  Inf    +NaN10  ->  NaN10\r
+rotx871 rotate  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+rotx872 rotate  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+rotx873 rotate  sNaN13   1000  ->  NaN13  Invalid_operation\r
+rotx874 rotate  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+rotx875 rotate  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+rotx876 rotate  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+rotx877 rotate -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+rotx878 rotate -1000    sNaN21 ->  NaN21  Invalid_operation\r
+rotx879 rotate  1000    sNaN22 ->  NaN22  Invalid_operation\r
+rotx880 rotate  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+rotx881 rotate +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+rotx882 rotate -NaN26    NaN28 -> -NaN26\r
+rotx883 rotate -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+rotx884 rotate  1000    -NaN30 -> -NaN30\r
+rotx885 rotate  1000   -sNaN31 -> -NaN31  Invalid_operation\r
+\r
+-- payload decapitate\r
+precision: 5\r
+rotx886 rotate  11 -sNaN1234567890 -> -NaN67890  Invalid_operation\r
index f1437a50eaea70fb47bbda93df29d0f82a7bc1e1..d24fbfb37fec0ac97276d874ba902b186a8c5cf3 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- rounding.decTest -- decimal rounding modes testcases               --
--- Copyright (c) IBM Corporation, 1981, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- These tests require that implementations take account of residues in
 -- order to get correct results for some rounding modes.  Rather than
@@ -26,8 +26,11 @@ version: 2.39
 -- is rounding of negatives (if the latter works for addition, assume it
 -- works for the others, too).]
 --
--- Underflow Subnormal and overflow behaviours are tested under the individual
--- operators.
+-- Round-for-reround (05UP) is tested as a separate block, mostly for
+-- 'historical' reasons.
+--
+-- Underflow Subnormal and overflow behaviours are tested under the
+-- individual operators.
 
 extended:    1
 precision:   5           -- for easier visual inspection
@@ -980,8 +983,8 @@ minexponent: -999999999
 rounding: down
 rovx100  multiply   10    9E+999999999 ->  9.9999E+999999999 Overflow Inexact Rounded
 rovx101  multiply  -10    9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded
-rovx102  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded
-rovx104  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx102  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
+rovx104  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 
 rounding: up
 rovx110  multiply   10    9E+999999999 ->  Infinity Overflow Inexact Rounded
@@ -993,31 +996,31 @@ rounding: ceiling
 rovx120  multiply   10    9E+999999999 ->  Infinity Overflow Inexact Rounded
 rovx121  multiply  -10    9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded
 rovx122  divide     1E-9  9E+999999999 ->  1E-1000000003 Underflow Subnormal Inexact Rounded
-rovx124  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx124  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 
 rounding: floor
 rovx130  multiply   10    9E+999999999 ->  9.9999E+999999999 Overflow Inexact Rounded
 rovx131  multiply  -10    9E+999999999 -> -Infinity Overflow Inexact Rounded
-rovx132  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx132  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 rovx134  divide    -1E-9  9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded
 
 rounding: half_up
 rovx140  multiply   10    9E+999999999 ->  Infinity Overflow Inexact Rounded
 rovx141  multiply  -10    9E+999999999 -> -Infinity Overflow Inexact Rounded
-rovx142  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded
-rovx144  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx142  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
+rovx144  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 
 rounding: half_even
 rovx150  multiply   10    9E+999999999 ->  Infinity Overflow Inexact Rounded
 rovx151  multiply  -10    9E+999999999 -> -Infinity Overflow Inexact Rounded
-rovx152  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded
-rovx154  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx152  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
+rovx154  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 
 rounding: half_down
 rovx160  multiply   10    9E+999999999 ->  Infinity Overflow Inexact Rounded
 rovx161  multiply  -10    9E+999999999 -> -Infinity Overflow Inexact Rounded
-rovx162  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded
-rovx164  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded
+rovx162  divide     1E-9  9E+999999999 ->  0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
+rovx164  divide    -1E-9  9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped
 
 -- check maximum finite value over a range of precisions
 rounding: down
@@ -1077,3 +1080,224 @@ rounding: down
 rmex412 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded
 rmex413 multiply  9.999E+999999999 10 ->  9.99999999E+999999999 Overflow Inexact Rounded
 
+----- Round-for-reround -----
+rounding:    05up
+precision:   5           -- for easier visual inspection
+maxExponent: 999
+minexponent: -999
+
+-- basic rounding; really is just 0 and 5 up
+r05up001 add 12340  0.001     -> 12341 Inexact Rounded
+r05up002 add 12341  0.001     -> 12341 Inexact Rounded
+r05up003 add 12342  0.001     -> 12342 Inexact Rounded
+r05up004 add 12343  0.001     -> 12343 Inexact Rounded
+r05up005 add 12344  0.001     -> 12344 Inexact Rounded
+r05up006 add 12345  0.001     -> 12346 Inexact Rounded
+r05up007 add 12346  0.001     -> 12346 Inexact Rounded
+r05up008 add 12347  0.001     -> 12347 Inexact Rounded
+r05up009 add 12348  0.001     -> 12348 Inexact Rounded
+r05up010 add 12349  0.001     -> 12349 Inexact Rounded
+
+r05up011 add 12340  0.000     -> 12340 Rounded
+r05up012 add 12341  0.000     -> 12341 Rounded
+r05up013 add 12342  0.000     -> 12342 Rounded
+r05up014 add 12343  0.000     -> 12343 Rounded
+r05up015 add 12344  0.000     -> 12344 Rounded
+r05up016 add 12345  0.000     -> 12345 Rounded
+r05up017 add 12346  0.000     -> 12346 Rounded
+r05up018 add 12347  0.000     -> 12347 Rounded
+r05up019 add 12348  0.000     -> 12348 Rounded
+r05up020 add 12349  0.000     -> 12349 Rounded
+
+r05up021 add 12340  0.901     -> 12341 Inexact Rounded
+r05up022 add 12341  0.901     -> 12341 Inexact Rounded
+r05up023 add 12342  0.901     -> 12342 Inexact Rounded
+r05up024 add 12343  0.901     -> 12343 Inexact Rounded
+r05up025 add 12344  0.901     -> 12344 Inexact Rounded
+r05up026 add 12345  0.901     -> 12346 Inexact Rounded
+r05up027 add 12346  0.901     -> 12346 Inexact Rounded
+r05up028 add 12347  0.901     -> 12347 Inexact Rounded
+r05up029 add 12348  0.901     -> 12348 Inexact Rounded
+r05up030 add 12349  0.901     -> 12349 Inexact Rounded
+
+r05up031 add -12340  -0.001     -> -12341 Inexact Rounded
+r05up032 add -12341  -0.001     -> -12341 Inexact Rounded
+r05up033 add -12342  -0.001     -> -12342 Inexact Rounded
+r05up034 add -12343  -0.001     -> -12343 Inexact Rounded
+r05up035 add -12344  -0.001     -> -12344 Inexact Rounded
+r05up036 add -12345  -0.001     -> -12346 Inexact Rounded
+r05up037 add -12346  -0.001     -> -12346 Inexact Rounded
+r05up038 add -12347  -0.001     -> -12347 Inexact Rounded
+r05up039 add -12348  -0.001     -> -12348 Inexact Rounded
+r05up040 add -12349  -0.001     -> -12349 Inexact Rounded
+
+r05up041 add -12340   0.001     -> -12339 Inexact Rounded
+r05up042 add -12341   0.001     -> -12341 Inexact Rounded
+r05up043 add -12342   0.001     -> -12341 Inexact Rounded
+r05up044 add -12343   0.001     -> -12342 Inexact Rounded
+r05up045 add -12344   0.001     -> -12343 Inexact Rounded
+r05up046 add -12345   0.001     -> -12344 Inexact Rounded
+r05up047 add -12346   0.001     -> -12346 Inexact Rounded
+r05up048 add -12347   0.001     -> -12346 Inexact Rounded
+r05up049 add -12348   0.001     -> -12347 Inexact Rounded
+r05up050 add -12349   0.001     -> -12348 Inexact Rounded
+
+-- Addition operators -------------------------------------------------
+-- [The first few of these check negative residue possibilities; these
+-- cases may be implemented as a negative residue in fastpaths]
+
+r0adx100  add 12345 -0.1       -> 12344 Inexact Rounded
+r0adx101  add 12345 -0.01      -> 12344 Inexact Rounded
+r0adx102  add 12345 -0.001     -> 12344 Inexact Rounded
+r0adx103  add 12345 -0.00001   -> 12344 Inexact Rounded
+r0adx104  add 12345 -0.000001  -> 12344 Inexact Rounded
+r0adx105  add 12345 -0.0000001 -> 12344 Inexact Rounded
+r0adx106  add 12345  0         -> 12345
+r0adx107  add 12345  0.0000001 -> 12346 Inexact Rounded
+r0adx108  add 12345  0.000001  -> 12346 Inexact Rounded
+r0adx109  add 12345  0.00001   -> 12346 Inexact Rounded
+r0adx110  add 12345  0.0001    -> 12346 Inexact Rounded
+r0adx111  add 12345  0.001     -> 12346 Inexact Rounded
+r0adx112  add 12345  0.01      -> 12346 Inexact Rounded
+r0adx113  add 12345  0.1       -> 12346 Inexact Rounded
+
+r0adx115  add 12346  0.49999   -> 12346 Inexact Rounded
+r0adx116  add 12346  0.5       -> 12346 Inexact Rounded
+r0adx117  add 12346  0.50001   -> 12346 Inexact Rounded
+
+r0adx120  add 12345  0.4       -> 12346 Inexact Rounded
+r0adx121  add 12345  0.49      -> 12346 Inexact Rounded
+r0adx122  add 12345  0.499     -> 12346 Inexact Rounded
+r0adx123  add 12345  0.49999   -> 12346 Inexact Rounded
+r0adx124  add 12345  0.5       -> 12346 Inexact Rounded
+r0adx125  add 12345  0.50001   -> 12346 Inexact Rounded
+r0adx126  add 12345  0.5001    -> 12346 Inexact Rounded
+r0adx127  add 12345  0.501     -> 12346 Inexact Rounded
+r0adx128  add 12345  0.51      -> 12346 Inexact Rounded
+r0adx129  add 12345  0.6       -> 12346 Inexact Rounded
+
+-- negatives...
+
+r0sux100  add -12345 -0.1       -> -12346 Inexact Rounded
+r0sux101  add -12345 -0.01      -> -12346 Inexact Rounded
+r0sux102  add -12345 -0.001     -> -12346 Inexact Rounded
+r0sux103  add -12345 -0.00001   -> -12346 Inexact Rounded
+r0sux104  add -12345 -0.000001  -> -12346 Inexact Rounded
+r0sux105  add -12345 -0.0000001 -> -12346 Inexact Rounded
+r0sux106  add -12345  0         -> -12345
+r0sux107  add -12345  0.0000001 -> -12344 Inexact Rounded
+r0sux108  add -12345  0.000001  -> -12344 Inexact Rounded
+r0sux109  add -12345  0.00001   -> -12344 Inexact Rounded
+r0sux110  add -12345  0.0001    -> -12344 Inexact Rounded
+r0sux111  add -12345  0.001     -> -12344 Inexact Rounded
+r0sux112  add -12345  0.01      -> -12344 Inexact Rounded
+r0sux113  add -12345  0.1       -> -12344 Inexact Rounded
+
+r0sux115  add -12346  0.49999   -> -12346 Inexact Rounded
+r0sux116  add -12346  0.5       -> -12346 Inexact Rounded
+r0sux117  add -12346  0.50001   -> -12346 Inexact Rounded
+
+r0sux120  add -12345  0.4       -> -12344 Inexact Rounded
+r0sux121  add -12345  0.49      -> -12344 Inexact Rounded
+r0sux122  add -12345  0.499     -> -12344 Inexact Rounded
+r0sux123  add -12345  0.49999   -> -12344 Inexact Rounded
+r0sux124  add -12345  0.5       -> -12344 Inexact Rounded
+r0sux125  add -12345  0.50001   -> -12344 Inexact Rounded
+r0sux126  add -12345  0.5001    -> -12344 Inexact Rounded
+r0sux127  add -12345  0.501     -> -12344 Inexact Rounded
+r0sux128  add -12345  0.51      -> -12344 Inexact Rounded
+r0sux129  add -12345  0.6       -> -12344 Inexact Rounded
+
+-- Check cancellation subtractions
+-- (The IEEE 854 'curious rule' in $6.3)
+
+r0zex001  add  0    0    ->  0
+r0zex002  add  0   -0    ->  0
+r0zex003  add -0    0    ->  0
+r0zex004  add -0   -0    -> -0
+r0zex005  add  1   -1    ->  0
+r0zex006  add -1    1    ->  0
+r0zex007  add  1.5 -1.5  ->  0.0
+r0zex008  add -1.5  1.5  ->  0.0
+r0zex009  add  2   -2    ->  0
+r0zex010  add -2    2    ->  0
+
+
+-- Division operators -------------------------------------------------
+
+r0dvx101  divide 12345  1         ->  12345
+r0dvx102  divide 12345  1.0001    ->  12343 Inexact Rounded
+r0dvx103  divide 12345  1.001     ->  12332 Inexact Rounded
+r0dvx104  divide 12345  1.01      ->  12222 Inexact Rounded
+r0dvx105  divide 12345  1.1       ->  11222 Inexact Rounded
+r0dvx106  divide 12355  4         ->   3088.7 Inexact Rounded
+r0dvx107  divide 12345  4         ->   3086.2 Inexact Rounded
+r0dvx108  divide 12355  4.0001    ->   3088.6 Inexact Rounded
+r0dvx109  divide 12345  4.0001    ->   3086.1 Inexact Rounded
+r0dvx110  divide 12345  4.9       ->   2519.3 Inexact Rounded
+r0dvx111  divide 12345  4.99      ->   2473.9 Inexact Rounded
+r0dvx112  divide 12345  4.999     ->   2469.4 Inexact Rounded
+r0dvx113  divide 12345  4.9999    ->   2469.1 Inexact Rounded
+r0dvx114  divide 12345  5         ->   2469
+r0dvx115  divide 12345  5.0001    ->  2468.9 Inexact Rounded
+r0dvx116  divide 12345  5.001     ->  2468.6 Inexact Rounded
+r0dvx117  divide 12345  5.01      ->  2464.1 Inexact Rounded
+r0dvx118  divide 12345  5.1       ->  2420.6 Inexact Rounded
+
+-- [divideInteger and remainder unaffected]
+
+-- Multiplication operator --------------------------------------------
+
+r0mux101  multiply 12345  1         ->  12345
+r0mux102  multiply 12345  1.0001    ->  12346 Inexact Rounded
+r0mux103  multiply 12345  1.001     ->  12357 Inexact Rounded
+r0mux104  multiply 12345  1.01      ->  12468 Inexact Rounded
+r0mux105  multiply 12345  1.1       ->  13579 Inexact Rounded
+r0mux106  multiply 12345  4         ->  49380
+r0mux107  multiply 12345  4.0001    ->  49381 Inexact Rounded
+r0mux108  multiply 12345  4.9       ->  60491 Inexact Rounded
+r0mux109  multiply 12345  4.99      ->  61601 Inexact Rounded
+r0mux110  multiply 12345  4.999     ->  61712 Inexact Rounded
+r0mux111  multiply 12345  4.9999    ->  61723 Inexact Rounded
+r0mux112  multiply 12345  5         ->  61725
+r0mux113  multiply 12345  5.0001    ->  61726 Inexact Rounded
+r0mux114  multiply 12345  5.001     ->  61737 Inexact Rounded
+r0mux115  multiply 12345  5.01      ->  61848 Inexact Rounded
+r0mux116  multiply 12345  12        ->  1.4814E+5 Rounded
+r0mux117  multiply 12345  13        ->  1.6048E+5 Inexact Rounded
+r0mux118  multiply 12355  12        ->  1.4826E+5 Rounded
+r0mux119  multiply 12355  13        ->  1.6061E+5 Inexact Rounded
+
+
+-- Power operator -----------------------------------------------------
+
+r0pox101  power 12345  -5        ->  3.4877E-21 Inexact Rounded
+r0pox102  power 12345  -4        ->  4.3056E-17 Inexact Rounded
+r0pox103  power 12345  -3        ->  5.3152E-13 Inexact Rounded
+r0pox104  power 12345  -2        ->  6.5617E-9 Inexact Rounded
+r0pox105  power 12345  -1        ->  0.000081004 Inexact Rounded
+r0pox106  power 12345  0         ->  1
+r0pox107  power 12345  1         ->  12345
+r0pox108  power 12345  2         ->  1.5239E+8 Inexact Rounded
+r0pox109  power 12345  3         ->  1.8813E+12 Inexact Rounded
+r0pox110  power 12345  4         ->  2.3226E+16 Inexact Rounded
+r0pox111  power 12345  5         ->  2.8671E+20 Inexact Rounded
+r0pox112  power   415  2         ->  1.7222E+5 Inexact Rounded
+r0pox113  power    75  3         ->  4.2187E+5 Inexact Rounded
+
+
+-- Underflow Subnormal and overflow values vary with rounding mode and sign
+maxexponent: 999999999
+minexponent: -999999999
+-- [round down gives Nmax on first two and .0E... on the next two]
+r0ovx100  multiply   10    9E+999999999 ->  9.9999E+999999999 Overflow Inexact Rounded
+r0ovx101  multiply  -10    9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded
+r0ovx102  divide     1E-9  9E+999999999 ->  1E-1000000003 Underflow Subnormal Inexact Rounded
+r0ovx104  divide    -1E-9  9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded
+
+-- reprise rounding mode effect (using multiplies so precision directive used)
+precision: 9
+maxexponent: 999999999
+r0mex412 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded
+r0mex413 multiply  9.999E+999999999 10 ->  9.99999999E+999999999 Overflow Inexact Rounded
+
index bdea0008024e8563e47361d8a755daafff45725b..0b1efff24c797824138102d2c718973a7470fe20 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- samequantum.decTest -- check quantums match                        --
--- Copyright (c) IBM Corporation, 2001, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -64,8 +64,44 @@ samq047 samequantum -0E-17  0.0E-17 -> 0
 samq048 samequantum -0E-17 -0.0E-16 -> 1
 samq049 samequantum -0E-17 -0.0E-17 -> 0
 
--- specials & combinations
+-- Nmax, Nmin, Ntiny
+samq051 samequantum  9.99999999E+999    9.99999999E+999  -> 1
+samq052 samequantum  1E-999             1E-999           -> 1
+samq053 samequantum  1.00000000E-999    1.00000000E-999  -> 1
+samq054 samequantum  1E-1007            1E-1007          -> 1
+samq055 samequantum  9.99999999E+999    9.99999999E+999  -> 1
+samq056 samequantum  1E-999             1E-999           -> 1
+samq057 samequantum  1.00000000E-999    1.00000000E-999  -> 1
+samq058 samequantum  1E-1007            1E-1007          -> 1
+
+samq061 samequantum  -1E-1007           -1E-1007         -> 1
+samq062 samequantum  -1.00000000E-999   -1.00000000E-999 -> 1
+samq063 samequantum  -1E-999            -1E-999          -> 1
+samq064 samequantum  -9.99999999E+999   -9.99999999E+999 -> 1
+samq065 samequantum  -1E-1007           -1E-1007         -> 1
+samq066 samequantum  -1.00000000E-999   -1.00000000E-999 -> 1
+samq067 samequantum  -1E-999            -1E-999          -> 1
+samq068 samequantum  -9.99999999E+999   -9.99999999E+999 -> 1
+
+samq071 samequantum  -4E-1007           -1E-1007         -> 1
+samq072 samequantum  -4.00000000E-999   -1.00004000E-999 -> 1
+samq073 samequantum  -4E-999            -1E-999          -> 1
+samq074 samequantum  -4.99999999E+999   -9.99949999E+999 -> 1
+samq075 samequantum  -4E-1007           -1E-1007         -> 1
+samq076 samequantum  -4.00000000E-999   -1.00400000E-999 -> 1
+samq077 samequantum  -4E-999            -1E-999          -> 1
+samq078 samequantum  -4.99999999E+999   -9.94999999E+999 -> 1
 
+samq081 samequantum  -4E-1006           -1E-1007         -> 0
+samq082 samequantum  -4.00000000E-999   -1.00004000E-996 -> 0
+samq083 samequantum  -4E-996            -1E-999          -> 0
+samq084 samequantum  -4.99999999E+999   -9.99949999E+996 -> 0
+samq085 samequantum  -4E-1006           -1E-1007         -> 0
+samq086 samequantum  -4.00000000E-999   -1.00400000E-996 -> 0
+samq087 samequantum  -4E-996            -1E-999          -> 0
+samq088 samequantum  -4.99999999E+999   -9.94999999E+996 -> 0
+
+-- specials & combinations
 samq0110 samequantum  -Inf    -Inf   -> 1
 samq0111 samequantum  -Inf     Inf   -> 1
 samq0112 samequantum  -Inf     NaN   -> 0
diff --git a/Lib/test/decimaltestdata/scaleb.decTest b/Lib/test/decimaltestdata/scaleb.decTest
new file mode 100644 (file)
index 0000000..0761dea
--- /dev/null
@@ -0,0 +1,200 @@
+------------------------------------------------------------------------\r
+-- scaleb.decTest -- scale a number by powers of 10                   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Max |rhs| is 2*(999+9) = 2016\r
+\r
+-- Sanity checks\r
+scbx001 scaleb       7.50   10 -> 7.50E+10\r
+scbx002 scaleb       7.50    3 -> 7.50E+3\r
+scbx003 scaleb       7.50    2 -> 750\r
+scbx004 scaleb       7.50    1 -> 75.0\r
+scbx005 scaleb       7.50    0 -> 7.50\r
+scbx006 scaleb       7.50   -1 -> 0.750\r
+scbx007 scaleb       7.50   -2 -> 0.0750\r
+scbx008 scaleb       7.50  -10 -> 7.50E-10\r
+scbx009 scaleb      -7.50    3 -> -7.50E+3\r
+scbx010 scaleb      -7.50    2 -> -750\r
+scbx011 scaleb      -7.50    1 -> -75.0\r
+scbx012 scaleb      -7.50    0 -> -7.50\r
+scbx013 scaleb      -7.50   -1 -> -0.750\r
+\r
+-- Infinities\r
+scbx014 scaleb  Infinity   1 -> Infinity\r
+scbx015 scaleb  -Infinity  2 -> -Infinity\r
+scbx016 scaleb  Infinity  -1 -> Infinity\r
+scbx017 scaleb  -Infinity -2 -> -Infinity\r
+\r
+-- Next two are somewhat undefined in 754r; treat as non-integer\r
+scbx018 scaleb  10  Infinity -> NaN Invalid_operation\r
+scbx019 scaleb  10 -Infinity -> NaN Invalid_operation\r
+\r
+-- NaNs are undefined in 754r; assume usual processing\r
+-- NaNs, 0 payload\r
+scbx021 scaleb         NaN  1 -> NaN\r
+scbx022 scaleb        -NaN -1 -> -NaN\r
+scbx023 scaleb        sNaN  1 -> NaN Invalid_operation\r
+scbx024 scaleb       -sNaN  1 -> -NaN Invalid_operation\r
+scbx025 scaleb    4    NaN    -> NaN\r
+scbx026 scaleb -Inf   -NaN    -> -NaN\r
+scbx027 scaleb    4   sNaN    -> NaN Invalid_operation\r
+scbx028 scaleb  Inf  -sNaN    -> -NaN Invalid_operation\r
+\r
+-- non-integer RHS\r
+scbx030 scaleb  1.23    1    ->  12.3\r
+scbx031 scaleb  1.23    1.00 ->  NaN Invalid_operation\r
+scbx032 scaleb  1.23    1.1  ->  NaN Invalid_operation\r
+scbx033 scaleb  1.23    1.01 ->  NaN Invalid_operation\r
+scbx034 scaleb  1.23    0.01 ->  NaN Invalid_operation\r
+scbx035 scaleb  1.23    0.11 ->  NaN Invalid_operation\r
+scbx036 scaleb  1.23    0.999999999 ->  NaN Invalid_operation\r
+scbx037 scaleb  1.23   -1    ->  0.123\r
+scbx038 scaleb  1.23   -1.00 ->  NaN Invalid_operation\r
+scbx039 scaleb  1.23   -1.1  ->  NaN Invalid_operation\r
+scbx040 scaleb  1.23   -1.01 ->  NaN Invalid_operation\r
+scbx041 scaleb  1.23   -0.01 ->  NaN Invalid_operation\r
+scbx042 scaleb  1.23   -0.11 ->  NaN Invalid_operation\r
+scbx043 scaleb  1.23   -0.999999999 ->  NaN Invalid_operation\r
+scbx044 scaleb  1.23    0.1         ->  NaN Invalid_operation\r
+scbx045 scaleb  1.23    1E+1        ->  NaN Invalid_operation\r
+scbx046 scaleb  1.23    1.1234E+6   ->  NaN Invalid_operation\r
+scbx047 scaleb  1.23    1.123E+4    ->  NaN Invalid_operation\r
+\r
+\r
+scbx120 scaleb  1.23    2015        ->  Infinity Overflow Inexact Rounded\r
+scbx121 scaleb  1.23    2016        ->  Infinity Overflow Inexact Rounded\r
+scbx122 scaleb  1.23    2017        ->  NaN Invalid_operation\r
+scbx123 scaleb  1.23    2018        ->  NaN Invalid_operation\r
+scbx124 scaleb  1.23   -2015        ->  0E-1007 Underflow Subnormal Inexact Rounded Clamped\r
+scbx125 scaleb  1.23   -2016        ->  0E-1007 Underflow Subnormal Inexact Rounded Clamped\r
+scbx126 scaleb  1.23   -2017        ->  NaN Invalid_operation\r
+scbx127 scaleb  1.23   -2018        ->  NaN Invalid_operation\r
+\r
+-- NaNs, non-0 payload\r
+-- propagating NaNs\r
+scbx861 scaleb  NaN01   -Inf     ->  NaN1\r
+scbx862 scaleb -NaN02   -1000    -> -NaN2\r
+scbx863 scaleb  NaN03    1000    ->  NaN3\r
+scbx864 scaleb  NaN04    Inf     ->  NaN4\r
+scbx865 scaleb  NaN05    NaN61   ->  NaN5\r
+scbx866 scaleb -Inf     -NaN71   -> -NaN71\r
+scbx867 scaleb -1000     NaN81   ->  NaN81\r
+scbx868 scaleb  1000     NaN91   ->  NaN91\r
+scbx869 scaleb  Inf      NaN101  ->  NaN101\r
+scbx871 scaleb  sNaN011  -Inf    ->  NaN11  Invalid_operation\r
+scbx872 scaleb  sNaN012  -1000   ->  NaN12  Invalid_operation\r
+scbx873 scaleb -sNaN013   1000   -> -NaN13  Invalid_operation\r
+scbx874 scaleb  sNaN014   NaN171 ->  NaN14  Invalid_operation\r
+scbx875 scaleb  sNaN015  sNaN181 ->  NaN15  Invalid_operation\r
+scbx876 scaleb  NaN016   sNaN191 ->  NaN191 Invalid_operation\r
+scbx877 scaleb -Inf      sNaN201 ->  NaN201 Invalid_operation\r
+scbx878 scaleb -1000     sNaN211 ->  NaN211 Invalid_operation\r
+scbx879 scaleb  1000    -sNaN221 -> -NaN221 Invalid_operation\r
+scbx880 scaleb  Inf      sNaN231 ->  NaN231 Invalid_operation\r
+scbx881 scaleb  NaN025   sNaN241 ->  NaN241 Invalid_operation\r
+\r
+-- finites\r
+scbx051 scaleb          7   -2  -> 0.07\r
+scbx052 scaleb         -7   -2  -> -0.07\r
+scbx053 scaleb         75   -2  -> 0.75\r
+scbx054 scaleb        -75   -2  -> -0.75\r
+scbx055 scaleb       7.50   -2  -> 0.0750\r
+scbx056 scaleb      -7.50   -2  -> -0.0750\r
+scbx057 scaleb       7.500  -2  -> 0.07500\r
+scbx058 scaleb      -7.500  -2  -> -0.07500\r
+scbx061 scaleb          7   -1  -> 0.7\r
+scbx062 scaleb         -7   -1  -> -0.7\r
+scbx063 scaleb         75   -1  -> 7.5\r
+scbx064 scaleb        -75   -1  -> -7.5\r
+scbx065 scaleb       7.50   -1  -> 0.750\r
+scbx066 scaleb      -7.50   -1  -> -0.750\r
+scbx067 scaleb       7.500  -1  -> 0.7500\r
+scbx068 scaleb      -7.500  -1  -> -0.7500\r
+scbx071 scaleb          7    0  -> 7\r
+scbx072 scaleb         -7    0  -> -7\r
+scbx073 scaleb         75    0  -> 75\r
+scbx074 scaleb        -75    0  -> -75\r
+scbx075 scaleb       7.50    0  -> 7.50\r
+scbx076 scaleb      -7.50    0  -> -7.50\r
+scbx077 scaleb       7.500   0  -> 7.500\r
+scbx078 scaleb      -7.500   0  -> -7.500\r
+scbx081 scaleb          7    1  -> 7E+1\r
+scbx082 scaleb         -7    1  -> -7E+1\r
+scbx083 scaleb         75    1  -> 7.5E+2\r
+scbx084 scaleb        -75    1  -> -7.5E+2\r
+scbx085 scaleb       7.50    1  -> 75.0\r
+scbx086 scaleb      -7.50    1  -> -75.0\r
+scbx087 scaleb       7.500   1  -> 75.00\r
+scbx088 scaleb      -7.500   1  -> -75.00\r
+scbx091 scaleb          7    2  -> 7E+2\r
+scbx092 scaleb         -7    2  -> -7E+2\r
+scbx093 scaleb         75    2  -> 7.5E+3\r
+scbx094 scaleb        -75    2  -> -7.5E+3\r
+scbx095 scaleb       7.50    2  -> 750\r
+scbx096 scaleb      -7.50    2  -> -750\r
+scbx097 scaleb       7.500   2  -> 750.0\r
+scbx098 scaleb      -7.500   2  -> -750.0\r
+\r
+-- zeros\r
+scbx111 scaleb          0  1 -> 0E+1\r
+scbx112 scaleb         -0  2 -> -0E+2\r
+scbx113 scaleb       0E+4  3 -> 0E+7\r
+scbx114 scaleb      -0E+4  4 -> -0E+8\r
+scbx115 scaleb     0.0000  5 -> 0E+1\r
+scbx116 scaleb    -0.0000  6 -> -0E+2\r
+scbx117 scaleb      0E-141 7 -> 0E-134\r
+scbx118 scaleb     -0E-141 8 -> -0E-133\r
+\r
+-- Nmax, Nmin, Ntiny\r
+scbx132 scaleb  9.99999999E+999 +999 -> Infinity    Overflow Inexact Rounded\r
+scbx133 scaleb  9.99999999E+999  +10 -> Infinity     Overflow Inexact Rounded\r
+scbx134 scaleb  9.99999999E+999  +1  -> Infinity     Overflow Inexact Rounded\r
+scbx135 scaleb  9.99999999E+999   0  -> 9.99999999E+999\r
+scbx136 scaleb  9.99999999E+999  -1  -> 9.99999999E+998\r
+scbx137 scaleb  1E-999           +1  -> 1E-998\r
+scbx138 scaleb  1E-999           -0  -> 1E-999\r
+scbx139 scaleb  1E-999           -1  -> 1E-1000         Subnormal\r
+scbx140 scaleb  1.00000000E-999  +1  -> 1.00000000E-998\r
+scbx141 scaleb  1.00000000E-999   0  -> 1.00000000E-999\r
+scbx142 scaleb  1.00000000E-999  -1  -> 1.0000000E-1000 Subnormal Rounded\r
+scbx143 scaleb  1E-1007          +1  -> 1E-1006         Subnormal\r
+scbx144 scaleb  1E-1007          -0  -> 1E-1007         Subnormal\r
+scbx145 scaleb  1E-1007          -1  -> 0E-1007         Underflow Subnormal Inexact Rounded Clamped\r
+\r
+scbx150 scaleb  -1E-1007         +1  -> -1E-1006        Subnormal\r
+scbx151 scaleb  -1E-1007         -0  -> -1E-1007        Subnormal\r
+scbx152 scaleb  -1E-1007         -1  -> -0E-1007        Underflow Subnormal Inexact Rounded Clamped\r
+scbx153 scaleb  -1.00000000E-999 +1  -> -1.00000000E-998\r
+scbx154 scaleb  -1.00000000E-999 +0  -> -1.00000000E-999\r
+scbx155 scaleb  -1.00000000E-999 -1  -> -1.0000000E-1000 Subnormal Rounded\r
+scbx156 scaleb  -1E-999          +1  -> -1E-998\r
+scbx157 scaleb  -1E-999          -0  -> -1E-999\r
+scbx158 scaleb  -1E-999          -1  -> -1E-1000         Subnormal\r
+scbx159 scaleb  -9.99999999E+999 +1  -> -Infinity        Overflow Inexact Rounded\r
+scbx160 scaleb  -9.99999999E+999 +0  -> -9.99999999E+999\r
+scbx161 scaleb  -9.99999999E+999 -1  -> -9.99999999E+998\r
+scbx162 scaleb  -9E+999          +1  -> -Infinity        Overflow Inexact Rounded\r
+scbx163 scaleb  -1E+999          +1  -> -Infinity        Overflow Inexact Rounded\r
diff --git a/Lib/test/decimaltestdata/shift.decTest b/Lib/test/decimaltestdata/shift.decTest
new file mode 100644 (file)
index 0000000..c2a40cc
--- /dev/null
@@ -0,0 +1,250 @@
+------------------------------------------------------------------------\r
+-- shift.decTest -- shift coefficient left or right                   --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check\r
+shix001 shift          0    0  ->  0\r
+shix002 shift          0    2  ->  0\r
+shix003 shift          1    2  ->  100\r
+shix004 shift          1    8  ->  100000000\r
+shix005 shift          1    9  ->  0\r
+shix006 shift          1   -1  ->  0\r
+shix007 shift  123456789   -1  ->  12345678\r
+shix008 shift  123456789   -8  ->  1\r
+shix009 shift  123456789   -9  ->  0\r
+shix010 shift          0   -2  ->  0\r
+\r
+-- rhs must be an integer\r
+shix011 shift        1    1.5    -> NaN Invalid_operation\r
+shix012 shift        1    1.0    -> NaN Invalid_operation\r
+shix013 shift        1    0.1    -> NaN Invalid_operation\r
+shix014 shift        1    0.0    -> NaN Invalid_operation\r
+shix015 shift        1    1E+1   -> NaN Invalid_operation\r
+shix016 shift        1    1E+99  -> NaN Invalid_operation\r
+shix017 shift        1    Inf    -> NaN Invalid_operation\r
+shix018 shift        1    -Inf   -> NaN Invalid_operation\r
+-- and |rhs| <= precision\r
+shix020 shift        1    -1000  -> NaN Invalid_operation\r
+shix021 shift        1    -10    -> NaN Invalid_operation\r
+shix022 shift        1     10    -> NaN Invalid_operation\r
+shix023 shift        1     1000  -> NaN Invalid_operation\r
+\r
+-- full shifting pattern\r
+shix030 shift  123456789          -9   -> 0\r
+shix031 shift  123456789          -8   -> 1\r
+shix032 shift  123456789          -7   -> 12\r
+shix033 shift  123456789          -6   -> 123\r
+shix034 shift  123456789          -5   -> 1234\r
+shix035 shift  123456789          -4   -> 12345\r
+shix036 shift  123456789          -3   -> 123456\r
+shix037 shift  123456789          -2   -> 1234567\r
+shix038 shift  123456789          -1   -> 12345678\r
+shix039 shift  123456789          -0   -> 123456789\r
+shix040 shift  123456789          +0   -> 123456789\r
+shix041 shift  123456789          +1   -> 234567890\r
+shix042 shift  123456789          +2   -> 345678900\r
+shix043 shift  123456789          +3   -> 456789000\r
+shix044 shift  123456789          +4   -> 567890000\r
+shix045 shift  123456789          +5   -> 678900000\r
+shix046 shift  123456789          +6   -> 789000000\r
+shix047 shift  123456789          +7   -> 890000000\r
+shix048 shift  123456789          +8   -> 900000000\r
+shix049 shift  123456789          +9   -> 0\r
+\r
+-- from examples\r
+shix051 shift 34        8   ->  '400000000'\r
+shix052 shift 12        9   ->  '0'\r
+shix053 shift 123456789 -2  ->  '1234567'\r
+shix054 shift 123456789 0   ->  '123456789'\r
+shix055 shift 123456789 +2  ->  '345678900'\r
+\r
+-- zeros\r
+shix060 shift  0E-10              +9   ->   0E-10\r
+shix061 shift  0E-10              -9   ->   0E-10\r
+shix062 shift  0.000              +9   ->   0.000\r
+shix063 shift  0.000              -9   ->   0.000\r
+shix064 shift  0E+10              +9   ->   0E+10\r
+shix065 shift  0E+10              -9   ->   0E+10\r
+shix066 shift -0E-10              +9   ->  -0E-10\r
+shix067 shift -0E-10              -9   ->  -0E-10\r
+shix068 shift -0.000              +9   ->  -0.000\r
+shix069 shift -0.000              -9   ->  -0.000\r
+shix070 shift -0E+10              +9   ->  -0E+10\r
+shix071 shift -0E+10              -9   ->  -0E+10\r
+\r
+-- Nmax, Nmin, Ntiny\r
+shix141 shift  9.99999999E+999     -1  -> 9.9999999E+998\r
+shix142 shift  9.99999999E+999     -8  -> 9E+991\r
+shix143 shift  9.99999999E+999      1  -> 9.99999990E+999\r
+shix144 shift  9.99999999E+999      8  -> 9.00000000E+999\r
+shix145 shift  1E-999              -1  -> 0E-999\r
+shix146 shift  1E-999              -8  -> 0E-999\r
+shix147 shift  1E-999               1  -> 1.0E-998\r
+shix148 shift  1E-999               8  -> 1.00000000E-991\r
+shix151 shift  1.00000000E-999     -1  -> 1.0000000E-1000\r
+shix152 shift  1.00000000E-999     -8  -> 1E-1007\r
+shix153 shift  1.00000000E-999      1  -> 0E-1007\r
+shix154 shift  1.00000000E-999      8  -> 0E-1007\r
+shix155 shift  9.00000000E-999     -1  -> 9.0000000E-1000\r
+shix156 shift  9.00000000E-999     -8  -> 9E-1007\r
+shix157 shift  9.00000000E-999      1  -> 0E-1007\r
+shix158 shift  9.00000000E-999      8  -> 0E-1007\r
+shix160 shift  1E-1007             -1  -> 0E-1007\r
+shix161 shift  1E-1007             -8  -> 0E-1007\r
+shix162 shift  1E-1007              1  -> 1.0E-1006\r
+shix163 shift  1E-1007              8  -> 1.00000000E-999\r
+--  negatives\r
+shix171 shift -9.99999999E+999     -1  -> -9.9999999E+998\r
+shix172 shift -9.99999999E+999     -8  -> -9E+991\r
+shix173 shift -9.99999999E+999      1  -> -9.99999990E+999\r
+shix174 shift -9.99999999E+999      8  -> -9.00000000E+999\r
+shix175 shift -1E-999              -1  -> -0E-999\r
+shix176 shift -1E-999              -8  -> -0E-999\r
+shix177 shift -1E-999               1  -> -1.0E-998\r
+shix178 shift -1E-999               8  -> -1.00000000E-991\r
+shix181 shift -1.00000000E-999     -1  -> -1.0000000E-1000\r
+shix182 shift -1.00000000E-999     -8  -> -1E-1007\r
+shix183 shift -1.00000000E-999      1  -> -0E-1007\r
+shix184 shift -1.00000000E-999      8  -> -0E-1007\r
+shix185 shift -9.00000000E-999     -1  -> -9.0000000E-1000\r
+shix186 shift -9.00000000E-999     -8  -> -9E-1007\r
+shix187 shift -9.00000000E-999      1  -> -0E-1007\r
+shix188 shift -9.00000000E-999      8  -> -0E-1007\r
+shix190 shift -1E-1007             -1  -> -0E-1007\r
+shix191 shift -1E-1007             -8  -> -0E-1007\r
+shix192 shift -1E-1007              1  -> -1.0E-1006\r
+shix193 shift -1E-1007              8  -> -1.00000000E-999\r
+\r
+-- more negatives (of sanities)\r
+shix201 shift         -0    0  ->  -0\r
+shix202 shift         -0    2  ->  -0\r
+shix203 shift         -1    2  ->  -100\r
+shix204 shift         -1    8  ->  -100000000\r
+shix205 shift         -1    9  ->  -0\r
+shix206 shift         -1   -1  ->  -0\r
+shix207 shift -123456789   -1  ->  -12345678\r
+shix208 shift -123456789   -8  ->  -1\r
+shix209 shift -123456789   -9  ->  -0\r
+shix210 shift         -0   -2  ->  -0\r
+shix211 shift         -0   -0  ->  -0\r
+\r
+\r
+-- Specials; NaNs are handled as usual\r
+shix781 shift -Inf  -8     -> -Infinity\r
+shix782 shift -Inf  -1     -> -Infinity\r
+shix783 shift -Inf  -0     -> -Infinity\r
+shix784 shift -Inf   0     -> -Infinity\r
+shix785 shift -Inf   1     -> -Infinity\r
+shix786 shift -Inf   8     -> -Infinity\r
+shix787 shift -1000 -Inf   -> NaN Invalid_operation\r
+shix788 shift -Inf  -Inf   -> NaN Invalid_operation\r
+shix789 shift -1    -Inf   -> NaN Invalid_operation\r
+shix790 shift -0    -Inf   -> NaN Invalid_operation\r
+shix791 shift  0    -Inf   -> NaN Invalid_operation\r
+shix792 shift  1    -Inf   -> NaN Invalid_operation\r
+shix793 shift  1000 -Inf   -> NaN Invalid_operation\r
+shix794 shift  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+shix800 shift  Inf  -Inf   -> NaN Invalid_operation\r
+shix801 shift  Inf  -8     -> Infinity\r
+shix802 shift  Inf  -1     -> Infinity\r
+shix803 shift  Inf  -0     -> Infinity\r
+shix804 shift  Inf   0     -> Infinity\r
+shix805 shift  Inf   1     -> Infinity\r
+shix806 shift  Inf   8     -> Infinity\r
+shix807 shift  Inf   Inf   -> NaN Invalid_operation\r
+shix808 shift -1000  Inf   -> NaN Invalid_operation\r
+shix809 shift -Inf   Inf   -> NaN Invalid_operation\r
+shix810 shift -1     Inf   -> NaN Invalid_operation\r
+shix811 shift -0     Inf   -> NaN Invalid_operation\r
+shix812 shift  0     Inf   -> NaN Invalid_operation\r
+shix813 shift  1     Inf   -> NaN Invalid_operation\r
+shix814 shift  1000  Inf   -> NaN Invalid_operation\r
+shix815 shift  Inf   Inf   -> NaN Invalid_operation\r
+\r
+shix821 shift  NaN -Inf    ->  NaN\r
+shix822 shift  NaN -1000   ->  NaN\r
+shix823 shift  NaN -1      ->  NaN\r
+shix824 shift  NaN -0      ->  NaN\r
+shix825 shift  NaN  0      ->  NaN\r
+shix826 shift  NaN  1      ->  NaN\r
+shix827 shift  NaN  1000   ->  NaN\r
+shix828 shift  NaN  Inf    ->  NaN\r
+shix829 shift  NaN  NaN    ->  NaN\r
+shix830 shift -Inf  NaN    ->  NaN\r
+shix831 shift -1000 NaN    ->  NaN\r
+shix832 shift -1    NaN    ->  NaN\r
+shix833 shift -0    NaN    ->  NaN\r
+shix834 shift  0    NaN    ->  NaN\r
+shix835 shift  1    NaN    ->  NaN\r
+shix836 shift  1000 NaN    ->  NaN\r
+shix837 shift  Inf  NaN    ->  NaN\r
+\r
+shix841 shift  sNaN -Inf   ->  NaN  Invalid_operation\r
+shix842 shift  sNaN -1000  ->  NaN  Invalid_operation\r
+shix843 shift  sNaN -1     ->  NaN  Invalid_operation\r
+shix844 shift  sNaN -0     ->  NaN  Invalid_operation\r
+shix845 shift  sNaN  0     ->  NaN  Invalid_operation\r
+shix846 shift  sNaN  1     ->  NaN  Invalid_operation\r
+shix847 shift  sNaN  1000  ->  NaN  Invalid_operation\r
+shix848 shift  sNaN  NaN   ->  NaN  Invalid_operation\r
+shix849 shift  sNaN sNaN   ->  NaN  Invalid_operation\r
+shix850 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+shix851 shift -Inf  sNaN   ->  NaN  Invalid_operation\r
+shix852 shift -1000 sNaN   ->  NaN  Invalid_operation\r
+shix853 shift -1    sNaN   ->  NaN  Invalid_operation\r
+shix854 shift -0    sNaN   ->  NaN  Invalid_operation\r
+shix855 shift  0    sNaN   ->  NaN  Invalid_operation\r
+shix856 shift  1    sNaN   ->  NaN  Invalid_operation\r
+shix857 shift  1000 sNaN   ->  NaN  Invalid_operation\r
+shix858 shift  Inf  sNaN   ->  NaN  Invalid_operation\r
+shix859 shift  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+shix861 shift  NaN1   -Inf    ->  NaN1\r
+shix862 shift +NaN2   -1000   ->  NaN2\r
+shix863 shift  NaN3    1000   ->  NaN3\r
+shix864 shift  NaN4    Inf    ->  NaN4\r
+shix865 shift  NaN5   +NaN6   ->  NaN5\r
+shix866 shift -Inf     NaN7   ->  NaN7\r
+shix867 shift -1000    NaN8   ->  NaN8\r
+shix868 shift  1000    NaN9   ->  NaN9\r
+shix869 shift  Inf    +NaN10  ->  NaN10\r
+shix871 shift  sNaN11  -Inf   ->  NaN11  Invalid_operation\r
+shix872 shift  sNaN12  -1000  ->  NaN12  Invalid_operation\r
+shix873 shift  sNaN13   1000  ->  NaN13  Invalid_operation\r
+shix874 shift  sNaN14   NaN17 ->  NaN14  Invalid_operation\r
+shix875 shift  sNaN15  sNaN18 ->  NaN15  Invalid_operation\r
+shix876 shift  NaN16   sNaN19 ->  NaN19  Invalid_operation\r
+shix877 shift -Inf    +sNaN20 ->  NaN20  Invalid_operation\r
+shix878 shift -1000    sNaN21 ->  NaN21  Invalid_operation\r
+shix879 shift  1000    sNaN22 ->  NaN22  Invalid_operation\r
+shix880 shift  Inf     sNaN23 ->  NaN23  Invalid_operation\r
+shix881 shift +NaN25  +sNaN24 ->  NaN24  Invalid_operation\r
+shix882 shift -NaN26    NaN28 -> -NaN26\r
+shix883 shift -sNaN27  sNaN29 -> -NaN27  Invalid_operation\r
+shix884 shift  1000    -NaN30 -> -NaN30\r
+shix885 shift  1000   -sNaN31 -> -NaN31  Invalid_operation\r
index 0c83cc7cca29d99b18c39be4a8cd8523811cd1e6..2ccff5adf5add97f46ad3f43ac6a65cd49a35616 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- squareroot.decTest -- decimal square root                          --
--- Copyright (c) IBM Corporation, 2004.  All rights reserved.         --
+-- Copyright (c) IBM Corporation, 2003, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -102,6 +102,8 @@ sqtx074 squareroot -100.0       -> NaN Invalid_operation
 sqtx075 squareroot -100.00      -> NaN Invalid_operation
 sqtx076 squareroot -1.1000E+3   -> NaN Invalid_operation
 sqtx077 squareroot -1.10000E+3  -> NaN Invalid_operation
+sqtx078 squareroot  1.000       -> 1.00
+sqtx079 squareroot  1.0000      -> 1.00
 
 -- famous squares
 sqtx080 squareroot     1  -> 1
@@ -2926,19 +2928,26 @@ sqtx803 squareroot  1E-18   -> 1E-9
 
 precision: 11               -- Etiny=-19
 sqtx804 squareroot  1E-19   -> 3.162277660E-10 Underflow Subnormal Inexact Rounded
-sqtx805 squareroot 10E-19   -> 1.0E-9
+sqtx805 squareroot 10E-19   -> 1.0E-9            -- exact
 precision: 12               -- Etiny=-20
 sqtx806 squareroot 10E-20   -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded
-sqtx807 squareroot  1E-20   -> 1E-10 Subnormal   -- Exact Subnormal case
+sqtx807 squareroot  1E-20   -> 1E-10 Subnormal   -- exact Subnormal case
 
 precision: 13               -- Etiny=-21
 sqtx808 squareroot  1E-21   -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded
-sqtx809 squareroot 10E-21   -> 1.0E-10 Subnormal
+sqtx809 squareroot 10E-21   -> 1.0E-10 Subnormal -- exact Subnormal case
 precision: 14               -- Etiny=-22
 sqtx810 squareroot  1E-21   -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
 sqtx811 squareroot 10E-22   -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
-sqtx812 squareroot  1E-22   -> 1E-11 Subnormal   -- Exact Subnormal case
+sqtx812 squareroot  1E-22   -> 1E-11 Subnormal   -- exact Subnormal case
 
+-- Not enough digits?
+precision:   16
+maxExponent: 384
+minExponent: -383
+rounding:    half_even
+sqtx815 squareroot 1.0000000001000000E-78  -> 1.000000000050000E-39 Inexact Rounded
+--                                            1 234567890123456
 
 -- special values
 maxexponent: 999
@@ -2954,5 +2963,842 @@ sqtx826 squareroot   NaN456 ->  NaN456
 sqtx827 squareroot  -NaN654 -> -NaN654
 sqtx828 squareroot   NaN1   ->  NaN1
 
+-- payload decapitate
+precision: 5
+sqtx840 squareroot -sNaN1234567890 -> -NaN67890  Invalid_operation
+
+------------------------------------------------------------------------
+--
+-- Special thanks to Mark Dickinson for tests in the range 8000-8999.
+--
+-- Extra tests for the square root function, dealing with a variety of
+-- corner cases.  In particular, these tests concentrate on
+--   (1) cases where the input precision exceeds the context precision, and
+--   (2) cases where the input exponent is outside the current context,
+--       and in particular when the result is subnormal
+--
+-- maxexponent and minexponent are set to 9 and -9 for most of these
+-- cases; only the precision changes.  The rounding also does not
+-- change, because it is ignored for this operation.
+maxexponent: 9
+minexponent: -9
+
+-- exact results, input precision > context precision
+precision: 1
+sqtx8000 squareroot 0 -> 0
+sqtx8001 squareroot 1 -> 1
+sqtx8002 squareroot 4 -> 2
+sqtx8003 squareroot 9 -> 3
+sqtx8004 squareroot 16 -> 4
+sqtx8005 squareroot 25 -> 5
+sqtx8006 squareroot 36 -> 6
+sqtx8007 squareroot 49 -> 7
+sqtx8008 squareroot 64 -> 8
+sqtx8009 squareroot 81 -> 9
+sqtx8010 squareroot 100 -> 1E+1 Rounded
+sqtx8011 squareroot 121 -> 1E+1 Inexact Rounded
+
+precision: 2
+sqtx8012 squareroot 0 -> 0
+sqtx8013 squareroot 1 -> 1
+sqtx8014 squareroot 4 -> 2
+sqtx8015 squareroot 9 -> 3
+sqtx8016 squareroot 16 -> 4
+sqtx8017 squareroot 25 -> 5
+sqtx8018 squareroot 36 -> 6
+sqtx8019 squareroot 49 -> 7
+sqtx8020 squareroot 64 -> 8
+sqtx8021 squareroot 81 -> 9
+sqtx8022 squareroot 100 -> 10
+sqtx8023 squareroot 121 -> 11
+sqtx8024 squareroot 144 -> 12
+sqtx8025 squareroot 169 -> 13
+sqtx8026 squareroot 196 -> 14
+sqtx8027 squareroot 225 -> 15
+sqtx8028 squareroot 256 -> 16
+sqtx8029 squareroot 289 -> 17
+sqtx8030 squareroot 324 -> 18
+sqtx8031 squareroot 361 -> 19
+sqtx8032 squareroot 400 -> 20
+sqtx8033 squareroot 441 -> 21
+sqtx8034 squareroot 484 -> 22
+sqtx8035 squareroot 529 -> 23
+sqtx8036 squareroot 576 -> 24
+sqtx8037 squareroot 625 -> 25
+sqtx8038 squareroot 676 -> 26
+sqtx8039 squareroot 729 -> 27
+sqtx8040 squareroot 784 -> 28
+sqtx8041 squareroot 841 -> 29
+sqtx8042 squareroot 900 -> 30
+sqtx8043 squareroot 961 -> 31
+sqtx8044 squareroot 1024 -> 32
+sqtx8045 squareroot 1089 -> 33
+sqtx8046 squareroot 1156 -> 34
+sqtx8047 squareroot 1225 -> 35
+sqtx8048 squareroot 1296 -> 36
+sqtx8049 squareroot 1369 -> 37
+sqtx8050 squareroot 1444 -> 38
+sqtx8051 squareroot 1521 -> 39
+sqtx8052 squareroot 1600 -> 40
+sqtx8053 squareroot 1681 -> 41
+sqtx8054 squareroot 1764 -> 42
+sqtx8055 squareroot 1849 -> 43
+sqtx8056 squareroot 1936 -> 44
+sqtx8057 squareroot 2025 -> 45
+sqtx8058 squareroot 2116 -> 46
+sqtx8059 squareroot 2209 -> 47
+sqtx8060 squareroot 2304 -> 48
+sqtx8061 squareroot 2401 -> 49
+sqtx8062 squareroot 2500 -> 50
+sqtx8063 squareroot 2601 -> 51
+sqtx8064 squareroot 2704 -> 52
+sqtx8065 squareroot 2809 -> 53
+sqtx8066 squareroot 2916 -> 54
+sqtx8067 squareroot 3025 -> 55
+sqtx8068 squareroot 3136 -> 56
+sqtx8069 squareroot 3249 -> 57
+sqtx8070 squareroot 3364 -> 58
+sqtx8071 squareroot 3481 -> 59
+sqtx8072 squareroot 3600 -> 60
+sqtx8073 squareroot 3721 -> 61
+sqtx8074 squareroot 3844 -> 62
+sqtx8075 squareroot 3969 -> 63
+sqtx8076 squareroot 4096 -> 64
+sqtx8077 squareroot 4225 -> 65
+sqtx8078 squareroot 4356 -> 66
+sqtx8079 squareroot 4489 -> 67
+sqtx8080 squareroot 4624 -> 68
+sqtx8081 squareroot 4761 -> 69
+sqtx8082 squareroot 4900 -> 70
+sqtx8083 squareroot 5041 -> 71
+sqtx8084 squareroot 5184 -> 72
+sqtx8085 squareroot 5329 -> 73
+sqtx8086 squareroot 5476 -> 74
+sqtx8087 squareroot 5625 -> 75
+sqtx8088 squareroot 5776 -> 76
+sqtx8089 squareroot 5929 -> 77
+sqtx8090 squareroot 6084 -> 78
+sqtx8091 squareroot 6241 -> 79
+sqtx8092 squareroot 6400 -> 80
+sqtx8093 squareroot 6561 -> 81
+sqtx8094 squareroot 6724 -> 82
+sqtx8095 squareroot 6889 -> 83
+sqtx8096 squareroot 7056 -> 84
+sqtx8097 squareroot 7225 -> 85
+sqtx8098 squareroot 7396 -> 86
+sqtx8099 squareroot 7569 -> 87
+sqtx8100 squareroot 7744 -> 88
+sqtx8101 squareroot 7921 -> 89
+sqtx8102 squareroot 8100 -> 90
+sqtx8103 squareroot 8281 -> 91
+sqtx8104 squareroot 8464 -> 92
+sqtx8105 squareroot 8649 -> 93
+sqtx8106 squareroot 8836 -> 94
+sqtx8107 squareroot 9025 -> 95
+sqtx8108 squareroot 9216 -> 96
+sqtx8109 squareroot 9409 -> 97
+sqtx8110 squareroot 9604 -> 98
+sqtx8111 squareroot 9801 -> 99
+sqtx8112 squareroot 10000 -> 1.0E+2 Rounded
+sqtx8113 squareroot 10201 -> 1.0E+2 Inexact Rounded
+
+precision: 3
+sqtx8114 squareroot 841 -> 29
+sqtx8115 squareroot 1600 -> 40
+sqtx8116 squareroot 2209 -> 47
+sqtx8117 squareroot 9604 -> 98
+sqtx8118 squareroot 21316 -> 146
+sqtx8119 squareroot 52441 -> 229
+sqtx8120 squareroot 68644 -> 262
+sqtx8121 squareroot 69696 -> 264
+sqtx8122 squareroot 70225 -> 265
+sqtx8123 squareroot 76729 -> 277
+sqtx8124 squareroot 130321 -> 361
+sqtx8125 squareroot 171396 -> 414
+sqtx8126 squareroot 270400 -> 520
+sqtx8127 squareroot 279841 -> 529
+sqtx8128 squareroot 407044 -> 638
+sqtx8129 squareroot 408321 -> 639
+sqtx8130 squareroot 480249 -> 693
+sqtx8131 squareroot 516961 -> 719
+sqtx8132 squareroot 692224 -> 832
+sqtx8133 squareroot 829921 -> 911
+
+-- selection of random exact results
+precision: 6
+sqtx8134 squareroot 2.25E-12 -> 0.0000015
+sqtx8135 squareroot 8.41E-14 -> 2.9E-7
+sqtx8136 squareroot 6.241E-15 -> 7.9E-8
+sqtx8137 squareroot 5.041E+13 -> 7.1E+6
+sqtx8138 squareroot 4761 -> 69
+sqtx8139 squareroot 1.369E+17 -> 3.7E+8
+sqtx8140 squareroot 0.00002116 -> 0.0046
+sqtx8141 squareroot 7.29E+4 -> 2.7E+2
+sqtx8142 squareroot 4.624E-13 -> 6.8E-7
+sqtx8143 squareroot 3.969E+5 -> 6.3E+2
+sqtx8144 squareroot 3.73321E-11 -> 0.00000611
+sqtx8145 squareroot 5.61001E+17 -> 7.49E+8
+sqtx8146 squareroot 2.30400E-11 -> 0.00000480
+sqtx8147 squareroot 4.30336E+17 -> 6.56E+8
+sqtx8148 squareroot 0.057121 -> 0.239
+sqtx8149 squareroot 7.225E+17 -> 8.5E+8
+sqtx8150 squareroot 3.14721E+13 -> 5.61E+6
+sqtx8151 squareroot 4.61041E+17 -> 6.79E+8
+sqtx8152 squareroot 1.39876E-15 -> 3.74E-8
+sqtx8153 squareroot 6.19369E-9 -> 0.0000787
+sqtx8154 squareroot 1.620529E-10 -> 0.00001273
+sqtx8155 squareroot 1177.1761 -> 34.31
+sqtx8156 squareroot 67043344 -> 8188
+sqtx8157 squareroot 4.84E+6 -> 2.2E+3
+sqtx8158 squareroot 1.23904E+11 -> 3.52E+5
+sqtx8159 squareroot 32604100 -> 5710
+sqtx8160 squareroot 2.9757025E-11 -> 0.000005455
+sqtx8161 squareroot 6.3760225E-9 -> 0.00007985
+sqtx8162 squareroot 4.5198729E-11 -> 0.000006723
+sqtx8163 squareroot 1.4745600E-11 -> 0.000003840
+sqtx8164 squareroot 18964283.04 -> 4354.8
+sqtx8165 squareroot 3.308895529E+13 -> 5.7523E+6
+sqtx8166 squareroot 0.0028590409 -> 0.05347
+sqtx8167 squareroot 3572.213824 -> 59.768
+sqtx8168 squareroot 4.274021376E+15 -> 6.5376E+7
+sqtx8169 squareroot 4455476.64 -> 2110.8
+sqtx8170 squareroot 38.44 -> 6.2
+sqtx8171 squareroot 68.558400 -> 8.280
+sqtx8172 squareroot 715402009 -> 26747
+sqtx8173 squareroot 93.373569 -> 9.663
+sqtx8174 squareroot 2.62144000000E+15 -> 5.12000E+7
+sqtx8175 squareroot 7.48225000000E+15 -> 8.65000E+7
+sqtx8176 squareroot 3.38724000000E-9 -> 0.0000582000
+sqtx8177 squareroot 5.64001000000E-13 -> 7.51000E-7
+sqtx8178 squareroot 5.06944000000E-15 -> 7.12000E-8
+sqtx8179 squareroot 4.95616000000E+17 -> 7.04000E+8
+sqtx8180 squareroot 0.0000242064000000 -> 0.00492000
+sqtx8181 squareroot 1.48996000000E-15 -> 3.86000E-8
+sqtx8182 squareroot 9.37024000000E+17 -> 9.68000E+8
+sqtx8183 squareroot 7128900.0000 -> 2670.00
+sqtx8184 squareroot 8.2311610000E-10 -> 0.0000286900
+sqtx8185 squareroot 482747040000 -> 694800
+sqtx8186 squareroot 4.14478440000E+17 -> 6.43800E+8
+sqtx8187 squareroot 5.10510250000E-7 -> 0.000714500
+sqtx8188 squareroot 355096.810000 -> 595.900
+sqtx8189 squareroot 14288400.0000 -> 3780.00
+sqtx8190 squareroot 3.36168040000E-15 -> 5.79800E-8
+sqtx8191 squareroot 1.70899560000E-13 -> 4.13400E-7
+sqtx8192 squareroot 0.0000378348010000 -> 0.00615100
+sqtx8193 squareroot 2.00972890000E-13 -> 4.48300E-7
+sqtx8194 squareroot 4.07222659600E-13 -> 6.38140E-7
+sqtx8195 squareroot 131486012100 -> 362610
+sqtx8196 squareroot 818192611600 -> 904540
+sqtx8197 squareroot 9.8558323600E+16 -> 3.13940E+8
+sqtx8198 squareroot 5641.06144900 -> 75.1070
+sqtx8199 squareroot 4.58789475600E+17 -> 6.77340E+8
+sqtx8200 squareroot 3.21386948100E-9 -> 0.0000566910
+sqtx8201 squareroot 3.9441960000E-8 -> 0.000198600
+sqtx8202 squareroot 242723.728900 -> 492.670
+sqtx8203 squareroot 1874.89000000 -> 43.3000
+sqtx8204 squareroot 2.56722595684E+15 -> 5.06678E+7
+sqtx8205 squareroot 3.96437714689E-17 -> 6.29633E-9
+sqtx8206 squareroot 3.80106774784E-17 -> 6.16528E-9
+sqtx8207 squareroot 1.42403588496E-13 -> 3.77364E-7
+sqtx8208 squareroot 4604.84388100 -> 67.8590
+sqtx8209 squareroot 2157100869.16 -> 46444.6
+sqtx8210 squareroot 355288570.81 -> 18849.1
+sqtx8211 squareroot 4.69775901604E-11 -> 0.00000685402
+sqtx8212 squareroot 8.22115770436E+17 -> 9.06706E+8
+sqtx8213 squareroot 7.16443744900E+15 -> 8.46430E+7
+sqtx8214 squareroot 9.48995498896E+15 -> 9.74164E+7
+sqtx8215 squareroot 0.0000419091801129 -> 0.00647373
+sqtx8216 squareroot 5862627996.84 -> 76567.8
+sqtx8217 squareroot 9369537.3409 -> 3060.97
+sqtx8218 squareroot 7.74792529729E+17 -> 8.80223E+8
+sqtx8219 squareroot 1.08626931396E+17 -> 3.29586E+8
+sqtx8220 squareroot 8.89584739684E-7 -> 0.000943178
+sqtx8221 squareroot 4.0266040896E-18 -> 2.00664E-9
+sqtx8222 squareroot 9.27669480336E-7 -> 0.000963156
+sqtx8223 squareroot 0.00225497717956 -> 0.0474866
+
+-- test use of round-half-even for ties
+precision: 1
+sqtx8224 squareroot 225 -> 2E+1 Inexact Rounded
+sqtx8225 squareroot 625 -> 2E+1 Inexact Rounded
+sqtx8226 squareroot 1225 -> 4E+1 Inexact Rounded
+sqtx8227 squareroot 2025 -> 4E+1 Inexact Rounded
+sqtx8228 squareroot 3025 -> 6E+1 Inexact Rounded
+sqtx8229 squareroot 4225 -> 6E+1 Inexact Rounded
+sqtx8230 squareroot 5625 -> 8E+1 Inexact Rounded
+sqtx8231 squareroot 7225 -> 8E+1 Inexact Rounded
+sqtx8232 squareroot 9025 -> 1E+2 Inexact Rounded
+
+precision: 2
+sqtx8233 squareroot 11025 -> 1.0E+2 Inexact Rounded
+sqtx8234 squareroot 13225 -> 1.2E+2 Inexact Rounded
+sqtx8235 squareroot 15625 -> 1.2E+2 Inexact Rounded
+sqtx8236 squareroot 18225 -> 1.4E+2 Inexact Rounded
+sqtx8237 squareroot 21025 -> 1.4E+2 Inexact Rounded
+sqtx8238 squareroot 24025 -> 1.6E+2 Inexact Rounded
+sqtx8239 squareroot 27225 -> 1.6E+2 Inexact Rounded
+sqtx8240 squareroot 30625 -> 1.8E+2 Inexact Rounded
+sqtx8241 squareroot 34225 -> 1.8E+2 Inexact Rounded
+sqtx8242 squareroot 38025 -> 2.0E+2 Inexact Rounded
+sqtx8243 squareroot 42025 -> 2.0E+2 Inexact Rounded
+sqtx8244 squareroot 46225 -> 2.2E+2 Inexact Rounded
+sqtx8245 squareroot 50625 -> 2.2E+2 Inexact Rounded
+sqtx8246 squareroot 55225 -> 2.4E+2 Inexact Rounded
+sqtx8247 squareroot 60025 -> 2.4E+2 Inexact Rounded
+sqtx8248 squareroot 65025 -> 2.6E+2 Inexact Rounded
+sqtx8249 squareroot 70225 -> 2.6E+2 Inexact Rounded
+sqtx8250 squareroot 75625 -> 2.8E+2 Inexact Rounded
+sqtx8251 squareroot 81225 -> 2.8E+2 Inexact Rounded
+sqtx8252 squareroot 87025 -> 3.0E+2 Inexact Rounded
+sqtx8253 squareroot 93025 -> 3.0E+2 Inexact Rounded
+sqtx8254 squareroot 99225 -> 3.2E+2 Inexact Rounded
+sqtx8255 squareroot 105625 -> 3.2E+2 Inexact Rounded
+sqtx8256 squareroot 112225 -> 3.4E+2 Inexact Rounded
+sqtx8257 squareroot 119025 -> 3.4E+2 Inexact Rounded
+sqtx8258 squareroot 126025 -> 3.6E+2 Inexact Rounded
+sqtx8259 squareroot 133225 -> 3.6E+2 Inexact Rounded
+sqtx8260 squareroot 140625 -> 3.8E+2 Inexact Rounded
+sqtx8261 squareroot 148225 -> 3.8E+2 Inexact Rounded
+sqtx8262 squareroot 156025 -> 4.0E+2 Inexact Rounded
+sqtx8263 squareroot 164025 -> 4.0E+2 Inexact Rounded
+sqtx8264 squareroot 172225 -> 4.2E+2 Inexact Rounded
+sqtx8265 squareroot 180625 -> 4.2E+2 Inexact Rounded
+sqtx8266 squareroot 189225 -> 4.4E+2 Inexact Rounded
+sqtx8267 squareroot 198025 -> 4.4E+2 Inexact Rounded
+sqtx8268 squareroot 207025 -> 4.6E+2 Inexact Rounded
+sqtx8269 squareroot 216225 -> 4.6E+2 Inexact Rounded
+sqtx8270 squareroot 225625 -> 4.8E+2 Inexact Rounded
+sqtx8271 squareroot 235225 -> 4.8E+2 Inexact Rounded
+sqtx8272 squareroot 245025 -> 5.0E+2 Inexact Rounded
+sqtx8273 squareroot 255025 -> 5.0E+2 Inexact Rounded
+sqtx8274 squareroot 265225 -> 5.2E+2 Inexact Rounded
+sqtx8275 squareroot 275625 -> 5.2E+2 Inexact Rounded
+sqtx8276 squareroot 286225 -> 5.4E+2 Inexact Rounded
+sqtx8277 squareroot 297025 -> 5.4E+2 Inexact Rounded
+sqtx8278 squareroot 308025 -> 5.6E+2 Inexact Rounded
+sqtx8279 squareroot 319225 -> 5.6E+2 Inexact Rounded
+sqtx8280 squareroot 330625 -> 5.8E+2 Inexact Rounded
+sqtx8281 squareroot 342225 -> 5.8E+2 Inexact Rounded
+sqtx8282 squareroot 354025 -> 6.0E+2 Inexact Rounded
+sqtx8283 squareroot 366025 -> 6.0E+2 Inexact Rounded
+sqtx8284 squareroot 378225 -> 6.2E+2 Inexact Rounded
+sqtx8285 squareroot 390625 -> 6.2E+2 Inexact Rounded
+sqtx8286 squareroot 403225 -> 6.4E+2 Inexact Rounded
+sqtx8287 squareroot 416025 -> 6.4E+2 Inexact Rounded
+sqtx8288 squareroot 429025 -> 6.6E+2 Inexact Rounded
+sqtx8289 squareroot 442225 -> 6.6E+2 Inexact Rounded
+sqtx8290 squareroot 455625 -> 6.8E+2 Inexact Rounded
+sqtx8291 squareroot 469225 -> 6.8E+2 Inexact Rounded
+sqtx8292 squareroot 483025 -> 7.0E+2 Inexact Rounded
+sqtx8293 squareroot 497025 -> 7.0E+2 Inexact Rounded
+sqtx8294 squareroot 511225 -> 7.2E+2 Inexact Rounded
+sqtx8295 squareroot 525625 -> 7.2E+2 Inexact Rounded
+sqtx8296 squareroot 540225 -> 7.4E+2 Inexact Rounded
+sqtx8297 squareroot 555025 -> 7.4E+2 Inexact Rounded
+sqtx8298 squareroot 570025 -> 7.6E+2 Inexact Rounded
+sqtx8299 squareroot 585225 -> 7.6E+2 Inexact Rounded
+sqtx8300 squareroot 600625 -> 7.8E+2 Inexact Rounded
+sqtx8301 squareroot 616225 -> 7.8E+2 Inexact Rounded
+sqtx8302 squareroot 632025 -> 8.0E+2 Inexact Rounded
+sqtx8303 squareroot 648025 -> 8.0E+2 Inexact Rounded
+sqtx8304 squareroot 664225 -> 8.2E+2 Inexact Rounded
+sqtx8305 squareroot 680625 -> 8.2E+2 Inexact Rounded
+sqtx8306 squareroot 697225 -> 8.4E+2 Inexact Rounded
+sqtx8307 squareroot 714025 -> 8.4E+2 Inexact Rounded
+sqtx8308 squareroot 731025 -> 8.6E+2 Inexact Rounded
+sqtx8309 squareroot 748225 -> 8.6E+2 Inexact Rounded
+sqtx8310 squareroot 765625 -> 8.8E+2 Inexact Rounded
+sqtx8311 squareroot 783225 -> 8.8E+2 Inexact Rounded
+sqtx8312 squareroot 801025 -> 9.0E+2 Inexact Rounded
+sqtx8313 squareroot 819025 -> 9.0E+2 Inexact Rounded
+sqtx8314 squareroot 837225 -> 9.2E+2 Inexact Rounded
+sqtx8315 squareroot 855625 -> 9.2E+2 Inexact Rounded
+sqtx8316 squareroot 874225 -> 9.4E+2 Inexact Rounded
+sqtx8317 squareroot 893025 -> 9.4E+2 Inexact Rounded
+sqtx8318 squareroot 912025 -> 9.6E+2 Inexact Rounded
+sqtx8319 squareroot 931225 -> 9.6E+2 Inexact Rounded
+sqtx8320 squareroot 950625 -> 9.8E+2 Inexact Rounded
+sqtx8321 squareroot 970225 -> 9.8E+2 Inexact Rounded
+sqtx8322 squareroot 990025 -> 1.0E+3 Inexact Rounded
+
+precision: 6
+sqtx8323 squareroot 88975734963025 -> 9.43270E+6 Inexact Rounded
+sqtx8324 squareroot 71085555000625 -> 8.43122E+6 Inexact Rounded
+sqtx8325 squareroot 39994304.051025 -> 6324.10 Inexact Rounded
+sqtx8326 squareroot 0.000007327172265625 -> 0.00270688 Inexact Rounded
+sqtx8327 squareroot 1.0258600439025E-13 -> 3.20290E-7 Inexact Rounded
+sqtx8328 squareroot 0.0034580574275625 -> 0.0588052 Inexact Rounded
+sqtx8329 squareroot 7.6842317700625E-7 -> 0.000876598 Inexact Rounded
+sqtx8330 squareroot 1263834495.2025 -> 35550.4 Inexact Rounded
+sqtx8331 squareroot 433970666460.25 -> 658764 Inexact Rounded
+sqtx8332 squareroot 4.5879286230625E-7 -> 0.000677342 Inexact Rounded
+sqtx8333 squareroot 0.0029305603306225 -> 0.0541346 Inexact Rounded
+sqtx8334 squareroot 70218282.733225 -> 8379.64 Inexact Rounded
+sqtx8335 squareroot 11942519.082025 -> 3455.80 Inexact Rounded
+sqtx8336 squareroot 0.0021230668905625 -> 0.0460768 Inexact Rounded
+sqtx8337 squareroot 0.90081833411025 -> 0.949114 Inexact Rounded
+sqtx8338 squareroot 5.5104120936225E-17 -> 7.42322E-9 Inexact Rounded
+sqtx8339 squareroot 0.10530446854225 -> 0.324506 Inexact Rounded
+sqtx8340 squareroot 8.706069866025E-14 -> 2.95060E-7 Inexact Rounded
+sqtx8341 squareroot 23838.58800625 -> 154.398 Inexact Rounded
+sqtx8342 squareroot 0.0013426911275625 -> 0.0366428 Inexact Rounded
+
+-- test use of round-half-even in underflow situations
+
+-- precisions 2; all cases where result is both subnormal and a tie
+precision: 2
+sqtx8343 squareroot 2.5E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
+sqtx8344 squareroot 2.25E-20 -> 2E-10 Underflow Subnormal Inexact Rounded
+sqtx8345 squareroot 6.25E-20 -> 2E-10 Underflow Subnormal Inexact Rounded
+sqtx8346 squareroot 1.225E-19 -> 4E-10 Underflow Subnormal Inexact Rounded
+sqtx8347 squareroot 2.025E-19 -> 4E-10 Underflow Subnormal Inexact Rounded
+sqtx8348 squareroot 3.025E-19 -> 6E-10 Underflow Subnormal Inexact Rounded
+sqtx8349 squareroot 4.225E-19 -> 6E-10 Underflow Subnormal Inexact Rounded
+sqtx8350 squareroot 5.625E-19 -> 8E-10 Underflow Subnormal Inexact Rounded
+sqtx8351 squareroot 7.225E-19 -> 8E-10 Underflow Subnormal Inexact Rounded
+sqtx8352 squareroot 9.025E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+
+-- precision 3, input precision <= 5
+precision: 3
+sqtx8353 squareroot 2.5E-23 -> 0E-11 Underflow Subnormal Inexact Rounded Clamped
+sqtx8354 squareroot 2.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded
+sqtx8355 squareroot 6.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded
+sqtx8356 squareroot 1.225E-21 -> 4E-11 Underflow Subnormal Inexact Rounded
+sqtx8357 squareroot 2.025E-21 -> 4E-11 Underflow Subnormal Inexact Rounded
+sqtx8358 squareroot 3.025E-21 -> 6E-11 Underflow Subnormal Inexact Rounded
+sqtx8359 squareroot 4.225E-21 -> 6E-11 Underflow Subnormal Inexact Rounded
+sqtx8360 squareroot 5.625E-21 -> 8E-11 Underflow Subnormal Inexact Rounded
+sqtx8361 squareroot 7.225E-21 -> 8E-11 Underflow Subnormal Inexact Rounded
+sqtx8362 squareroot 9.025E-21 -> 1.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8363 squareroot 1.1025E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8364 squareroot 1.3225E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8365 squareroot 1.5625E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8366 squareroot 1.8225E-20 -> 1.4E-10 Underflow Subnormal Inexact Rounded
+sqtx8367 squareroot 2.1025E-20 -> 1.4E-10 Underflow Subnormal Inexact Rounded
+sqtx8368 squareroot 2.4025E-20 -> 1.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8369 squareroot 2.7225E-20 -> 1.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8370 squareroot 3.0625E-20 -> 1.8E-10 Underflow Subnormal Inexact Rounded
+sqtx8371 squareroot 3.4225E-20 -> 1.8E-10 Underflow Subnormal Inexact Rounded
+sqtx8372 squareroot 3.8025E-20 -> 2.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8373 squareroot 4.2025E-20 -> 2.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8374 squareroot 4.6225E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8375 squareroot 5.0625E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8376 squareroot 5.5225E-20 -> 2.4E-10 Underflow Subnormal Inexact Rounded
+sqtx8377 squareroot 6.0025E-20 -> 2.4E-10 Underflow Subnormal Inexact Rounded
+sqtx8378 squareroot 6.5025E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8379 squareroot 7.0225E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8380 squareroot 7.5625E-20 -> 2.8E-10 Underflow Subnormal Inexact Rounded
+sqtx8381 squareroot 8.1225E-20 -> 2.8E-10 Underflow Subnormal Inexact Rounded
+sqtx8382 squareroot 8.7025E-20 -> 3.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8383 squareroot 9.3025E-20 -> 3.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8384 squareroot 9.9225E-20 -> 3.2E-10 Underflow Subnormal Inexact Rounded
+
+--precision 4, input precision <= 4
+precision: 4
+sqtx8385 squareroot 2.5E-25 -> 0E-12 Underflow Subnormal Inexact Rounded Clamped
+sqtx8386 squareroot 2.25E-24 -> 2E-12 Underflow Subnormal Inexact Rounded
+sqtx8387 squareroot 6.25E-24 -> 2E-12 Underflow Subnormal Inexact Rounded
+sqtx8388 squareroot 1.225E-23 -> 4E-12 Underflow Subnormal Inexact Rounded
+sqtx8389 squareroot 2.025E-23 -> 4E-12 Underflow Subnormal Inexact Rounded
+sqtx8390 squareroot 3.025E-23 -> 6E-12 Underflow Subnormal Inexact Rounded
+sqtx8391 squareroot 4.225E-23 -> 6E-12 Underflow Subnormal Inexact Rounded
+sqtx8392 squareroot 5.625E-23 -> 8E-12 Underflow Subnormal Inexact Rounded
+sqtx8393 squareroot 7.225E-23 -> 8E-12 Underflow Subnormal Inexact Rounded
+sqtx8394 squareroot 9.025E-23 -> 1.0E-11 Underflow Subnormal Inexact Rounded
+
+--precision 5, input precision <= 5
+precision: 5
+sqtx8395 squareroot 2.5E-27 -> 0E-13 Underflow Subnormal Inexact Rounded  Clamped
+sqtx8396 squareroot 2.25E-26 -> 2E-13 Underflow Subnormal Inexact Rounded
+sqtx8397 squareroot 6.25E-26 -> 2E-13 Underflow Subnormal Inexact Rounded
+sqtx8398 squareroot 1.225E-25 -> 4E-13 Underflow Subnormal Inexact Rounded
+sqtx8399 squareroot 2.025E-25 -> 4E-13 Underflow Subnormal Inexact Rounded
+sqtx8400 squareroot 3.025E-25 -> 6E-13 Underflow Subnormal Inexact Rounded
+sqtx8401 squareroot 4.225E-25 -> 6E-13 Underflow Subnormal Inexact Rounded
+sqtx8402 squareroot 5.625E-25 -> 8E-13 Underflow Subnormal Inexact Rounded
+sqtx8403 squareroot 7.225E-25 -> 8E-13 Underflow Subnormal Inexact Rounded
+sqtx8404 squareroot 9.025E-25 -> 1.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8405 squareroot 1.1025E-24 -> 1.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8406 squareroot 1.3225E-24 -> 1.2E-12 Underflow Subnormal Inexact Rounded
+sqtx8407 squareroot 1.5625E-24 -> 1.2E-12 Underflow Subnormal Inexact Rounded
+sqtx8408 squareroot 1.8225E-24 -> 1.4E-12 Underflow Subnormal Inexact Rounded
+sqtx8409 squareroot 2.1025E-24 -> 1.4E-12 Underflow Subnormal Inexact Rounded
+sqtx8410 squareroot 2.4025E-24 -> 1.6E-12 Underflow Subnormal Inexact Rounded
+sqtx8411 squareroot 2.7225E-24 -> 1.6E-12 Underflow Subnormal Inexact Rounded
+sqtx8412 squareroot 3.0625E-24 -> 1.8E-12 Underflow Subnormal Inexact Rounded
+sqtx8413 squareroot 3.4225E-24 -> 1.8E-12 Underflow Subnormal Inexact Rounded
+sqtx8414 squareroot 3.8025E-24 -> 2.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8415 squareroot 4.2025E-24 -> 2.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8416 squareroot 4.6225E-24 -> 2.2E-12 Underflow Subnormal Inexact Rounded
+sqtx8417 squareroot 5.0625E-24 -> 2.2E-12 Underflow Subnormal Inexact Rounded
+sqtx8418 squareroot 5.5225E-24 -> 2.4E-12 Underflow Subnormal Inexact Rounded
+sqtx8419 squareroot 6.0025E-24 -> 2.4E-12 Underflow Subnormal Inexact Rounded
+sqtx8420 squareroot 6.5025E-24 -> 2.6E-12 Underflow Subnormal Inexact Rounded
+sqtx8421 squareroot 7.0225E-24 -> 2.6E-12 Underflow Subnormal Inexact Rounded
+sqtx8422 squareroot 7.5625E-24 -> 2.8E-12 Underflow Subnormal Inexact Rounded
+sqtx8423 squareroot 8.1225E-24 -> 2.8E-12 Underflow Subnormal Inexact Rounded
+sqtx8424 squareroot 8.7025E-24 -> 3.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8425 squareroot 9.3025E-24 -> 3.0E-12 Underflow Subnormal Inexact Rounded
+sqtx8426 squareroot 9.9225E-24 -> 3.2E-12 Underflow Subnormal Inexact Rounded
+
+-- a random selection of values that Python2.5.1 rounds incorrectly
+precision: 1
+sqtx8427 squareroot 227 -> 2E+1 Inexact Rounded
+sqtx8428 squareroot 625 -> 2E+1 Inexact Rounded
+sqtx8429 squareroot 1215 -> 3E+1 Inexact Rounded
+sqtx8430 squareroot 2008 -> 4E+1 Inexact Rounded
+sqtx8431 squareroot 2020 -> 4E+1 Inexact Rounded
+sqtx8432 squareroot 2026 -> 5E+1 Inexact Rounded
+sqtx8433 squareroot 2027 -> 5E+1 Inexact Rounded
+sqtx8434 squareroot 2065 -> 5E+1 Inexact Rounded
+sqtx8435 squareroot 2075 -> 5E+1 Inexact Rounded
+sqtx8436 squareroot 2088 -> 5E+1 Inexact Rounded
+sqtx8437 squareroot 3049 -> 6E+1 Inexact Rounded
+sqtx8438 squareroot 3057 -> 6E+1 Inexact Rounded
+sqtx8439 squareroot 3061 -> 6E+1 Inexact Rounded
+sqtx8440 squareroot 3092 -> 6E+1 Inexact Rounded
+sqtx8441 squareroot 4222 -> 6E+1 Inexact Rounded
+sqtx8442 squareroot 5676 -> 8E+1 Inexact Rounded
+sqtx8443 squareroot 5686 -> 8E+1 Inexact Rounded
+sqtx8444 squareroot 7215 -> 8E+1 Inexact Rounded
+sqtx8445 squareroot 9086 -> 1E+2 Inexact Rounded
+sqtx8446 squareroot 9095 -> 1E+2 Inexact Rounded
+
+precision: 2
+sqtx8447 squareroot 1266 -> 36 Inexact Rounded
+sqtx8448 squareroot 2552 -> 51 Inexact Rounded
+sqtx8449 squareroot 5554 -> 75 Inexact Rounded
+sqtx8450 squareroot 7832 -> 88 Inexact Rounded
+sqtx8451 squareroot 13201 -> 1.1E+2 Inexact Rounded
+sqtx8452 squareroot 15695 -> 1.3E+2 Inexact Rounded
+sqtx8453 squareroot 18272 -> 1.4E+2 Inexact Rounded
+sqtx8454 squareroot 21026 -> 1.5E+2 Inexact Rounded
+sqtx8455 squareroot 24069 -> 1.6E+2 Inexact Rounded
+sqtx8456 squareroot 34277 -> 1.9E+2 Inexact Rounded
+sqtx8457 squareroot 46233 -> 2.2E+2 Inexact Rounded
+sqtx8458 squareroot 46251 -> 2.2E+2 Inexact Rounded
+sqtx8459 squareroot 46276 -> 2.2E+2 Inexact Rounded
+sqtx8460 squareroot 70214 -> 2.6E+2 Inexact Rounded
+sqtx8461 squareroot 81249 -> 2.9E+2 Inexact Rounded
+sqtx8462 squareroot 81266 -> 2.9E+2 Inexact Rounded
+sqtx8463 squareroot 93065 -> 3.1E+2 Inexact Rounded
+sqtx8464 squareroot 93083 -> 3.1E+2 Inexact Rounded
+sqtx8465 squareroot 99230 -> 3.2E+2 Inexact Rounded
+sqtx8466 squareroot 99271 -> 3.2E+2 Inexact Rounded
+
+precision: 3
+sqtx8467 squareroot 11349 -> 107 Inexact Rounded
+sqtx8468 squareroot 26738 -> 164 Inexact Rounded
+sqtx8469 squareroot 31508 -> 178 Inexact Rounded
+sqtx8470 squareroot 44734 -> 212 Inexact Rounded
+sqtx8471 squareroot 44738 -> 212 Inexact Rounded
+sqtx8472 squareroot 51307 -> 227 Inexact Rounded
+sqtx8473 squareroot 62259 -> 250 Inexact Rounded
+sqtx8474 squareroot 75901 -> 276 Inexact Rounded
+sqtx8475 squareroot 76457 -> 277 Inexact Rounded
+sqtx8476 squareroot 180287 -> 425 Inexact Rounded
+sqtx8477 squareroot 202053 -> 450 Inexact Rounded
+sqtx8478 squareroot 235747 -> 486 Inexact Rounded
+sqtx8479 squareroot 256537 -> 506 Inexact Rounded
+sqtx8480 squareroot 299772 -> 548 Inexact Rounded
+sqtx8481 squareroot 415337 -> 644 Inexact Rounded
+sqtx8482 squareroot 617067 -> 786 Inexact Rounded
+sqtx8483 squareroot 628022 -> 792 Inexact Rounded
+sqtx8484 squareroot 645629 -> 804 Inexact Rounded
+sqtx8485 squareroot 785836 -> 886 Inexact Rounded
+sqtx8486 squareroot 993066 -> 997 Inexact Rounded
+
+precision: 6
+sqtx8487 squareroot 14917781 -> 3862.35 Inexact Rounded
+sqtx8488 squareroot 17237238 -> 4151.78 Inexact Rounded
+sqtx8489 squareroot 18054463 -> 4249.05 Inexact Rounded
+sqtx8490 squareroot 19990694 -> 4471.10 Inexact Rounded
+sqtx8491 squareroot 29061855 -> 5390.90 Inexact Rounded
+sqtx8492 squareroot 49166257 -> 7011.87 Inexact Rounded
+sqtx8493 squareroot 53082086 -> 7285.75 Inexact Rounded
+sqtx8494 squareroot 56787909 -> 7535.78 Inexact Rounded
+sqtx8495 squareroot 81140019 -> 9007.78 Inexact Rounded
+sqtx8496 squareroot 87977554 -> 9379.64 Inexact Rounded
+sqtx8497 squareroot 93624683 -> 9675.98 Inexact Rounded
+sqtx8498 squareroot 98732747 -> 9936.44 Inexact Rounded
+sqtx8499 squareroot 99222813 -> 9961.06 Inexact Rounded
+sqtx8500 squareroot 143883626 -> 11995.2 Inexact Rounded
+sqtx8501 squareroot 180433301 -> 13432.5 Inexact Rounded
+sqtx8502 squareroot 227034020 -> 15067.6 Inexact Rounded
+sqtx8503 squareroot 283253992 -> 16830.2 Inexact Rounded
+sqtx8504 squareroot 617047954 -> 24840.4 Inexact Rounded
+sqtx8505 squareroot 736870094 -> 27145.4 Inexact Rounded
+sqtx8506 squareroot 897322915 -> 29955.3 Inexact Rounded
+
+-- results close to minimum normal
+precision: 1
+sqtx8507 squareroot 1E-20 -> 0E-9 Underflow Subnormal Inexact Rounded Clamped
+sqtx8508 squareroot 1E-19 -> 0E-9 Underflow Subnormal Inexact Rounded Clamped
+sqtx8509 squareroot 1E-18 -> 1E-9
+
+precision: 2
+sqtx8510 squareroot 8.1E-19 -> 9E-10 Subnormal
+sqtx8511 squareroot 8.10E-19 -> 9E-10 Subnormal Rounded
+sqtx8512 squareroot 9.0E-19 -> 9E-10 Underflow Subnormal Inexact Rounded
+sqtx8513 squareroot 9.02E-19 -> 9E-10 Underflow Subnormal Inexact Rounded
+sqtx8514 squareroot 9.03E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8515 squareroot 9.1E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8516 squareroot 9.9E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8517 squareroot 9.91E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8518 squareroot 9.92E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8519 squareroot 9.95E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8520 squareroot 9.98E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8521 squareroot 9.99E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+sqtx8522 squareroot 1E-18 -> 1E-9
+sqtx8523 squareroot 1.0E-18 -> 1.0E-9
+sqtx8524 squareroot 1.00E-18 -> 1.0E-9
+sqtx8525 squareroot 1.000E-18 -> 1.0E-9 Rounded
+sqtx8526 squareroot 1.0000E-18 -> 1.0E-9 Rounded
+sqtx8527 squareroot 1.01E-18 -> 1.0E-9 Inexact Rounded
+sqtx8528 squareroot 1.02E-18 -> 1.0E-9 Inexact Rounded
+sqtx8529 squareroot 1.1E-18 -> 1.0E-9 Inexact Rounded
+
+precision: 3
+sqtx8530 squareroot 8.1E-19 -> 9E-10 Subnormal
+sqtx8531 squareroot 8.10E-19 -> 9.0E-10 Subnormal
+sqtx8532 squareroot 8.100E-19 -> 9.0E-10 Subnormal
+sqtx8533 squareroot 8.1000E-19 -> 9.0E-10 Subnormal Rounded
+sqtx8534 squareroot 9.9E-19 -> 9.9E-10 Underflow Subnormal Inexact Rounded
+sqtx8535 squareroot 9.91E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded
+sqtx8536 squareroot 9.99E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded
+sqtx8537 squareroot 9.998E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded
+sqtx8538 squareroot 1E-18 -> 1E-9
+sqtx8539 squareroot 1.0E-18 -> 1.0E-9
+sqtx8540 squareroot 1.00E-18 -> 1.0E-9
+sqtx8541 squareroot 1.000E-18 -> 1.00E-9
+sqtx8542 squareroot 1.0000E-18 -> 1.00E-9
+sqtx8543 squareroot 1.00000E-18 -> 1.00E-9 Rounded
+sqtx8544 squareroot 1.000000E-18 -> 1.00E-9 Rounded
+sqtx8545 squareroot 1.01E-18 -> 1.00E-9 Inexact Rounded
+sqtx8546 squareroot 1.02E-18 -> 1.01E-9 Inexact Rounded
+
+-- result exactly representable with precision p, but not necessarily
+-- exactly representable as a subnormal;  check the correct flags are raised
+precision: 2
+sqtx8547 squareroot 1.21E-20 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8548 squareroot 1.44E-20 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8549 squareroot 9.61E-20 -> 3E-10 Underflow Subnormal Inexact Rounded
+sqtx8550 squareroot 8.836E-19 -> 9E-10 Underflow Subnormal Inexact Rounded
+sqtx8551 squareroot 9.216E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+
+precision: 3
+sqtx8552 squareroot 1.21E-22 -> 1E-11 Underflow Subnormal Inexact Rounded
+sqtx8553 squareroot 1.21E-20 -> 1.1E-10 Subnormal
+sqtx8554 squareroot 1.96E-22 -> 1E-11 Underflow Subnormal Inexact Rounded
+sqtx8555 squareroot 1.96E-20 -> 1.4E-10 Subnormal
+sqtx8556 squareroot 2.56E-22 -> 2E-11 Underflow Subnormal Inexact Rounded
+sqtx8557 squareroot 4.00E-22 -> 2E-11 Subnormal Rounded
+sqtx8558 squareroot 7.84E-22 -> 3E-11 Underflow Subnormal Inexact Rounded
+sqtx8559 squareroot 9.801E-21 -> 1.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8560 squareroot 9.801E-19 -> 9.9E-10 Subnormal
+sqtx8561 squareroot 1.0201E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8562 squareroot 1.1025E-20 -> 1.0E-10 Underflow Subnormal Inexact Rounded
+sqtx8563 squareroot 1.1236E-20 -> 1.1E-10 Underflow Subnormal Inexact Rounded
+sqtx8564 squareroot 1.2996E-20 -> 1.1E-10 Underflow Subnormal Inexact Rounded
+sqtx8565 squareroot 1.3225E-20 -> 1.2E-10 Underflow Subnormal Inexact Rounded
+
+-- A selection of subnormal results prone to double rounding errors
+precision: 2
+sqtx8566 squareroot 2.3E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
+sqtx8567 squareroot 2.4E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
+sqtx8568 squareroot 2.5E-21 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
+sqtx8569 squareroot 2.6E-21 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8570 squareroot 2.7E-21 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8571 squareroot 2.8E-21 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8572 squareroot 2.2E-20 -> 1E-10 Underflow Subnormal Inexact Rounded
+sqtx8573 squareroot 2.3E-20 -> 2E-10 Underflow Subnormal Inexact Rounded
+sqtx8574 squareroot 2.4E-20 -> 2E-10 Underflow Subnormal Inexact Rounded
+sqtx8575 squareroot 6.2E-20 -> 2E-10 Underflow Subnormal Inexact Rounded
+sqtx8576 squareroot 6.3E-20 -> 3E-10 Underflow Subnormal Inexact Rounded
+sqtx8577 squareroot 6.4E-20 -> 3E-10 Underflow Subnormal Inexact Rounded
+sqtx8578 squareroot 6.5E-20 -> 3E-10 Underflow Subnormal Inexact Rounded
+sqtx8579 squareroot 1.2E-19 -> 3E-10 Underflow Subnormal Inexact Rounded
+sqtx8580 squareroot 2.0E-19 -> 4E-10 Underflow Subnormal Inexact Rounded
+sqtx8581 squareroot 4.2E-19 -> 6E-10 Underflow Subnormal Inexact Rounded
+sqtx8582 squareroot 5.6E-19 -> 7E-10 Underflow Subnormal Inexact Rounded
+sqtx8583 squareroot 5.7E-19 -> 8E-10 Underflow Subnormal Inexact Rounded
+sqtx8584 squareroot 9.0E-19 -> 9E-10 Underflow Subnormal Inexact Rounded
+sqtx8585 squareroot 9.1E-19 -> 1.0E-9 Underflow Subnormal Inexact Rounded
+precision: 3
+sqtx8586 squareroot 2.6E-23 -> 1E-11 Underflow Subnormal Inexact Rounded
+sqtx8587 squareroot 2.22E-22 -> 1E-11 Underflow Subnormal Inexact Rounded
+sqtx8588 squareroot 6.07E-22 -> 2E-11 Underflow Subnormal Inexact Rounded
+sqtx8589 squareroot 6.25E-22 -> 2E-11 Underflow Subnormal Inexact Rounded
+sqtx8590 squareroot 6.45E-22 -> 3E-11 Underflow Subnormal Inexact Rounded
+sqtx8591 squareroot 6.50E-22 -> 3E-11 Underflow Subnormal Inexact Rounded
+sqtx8592 squareroot 1.22E-21 -> 3E-11 Underflow Subnormal Inexact Rounded
+sqtx8593 squareroot 1.24E-21 -> 4E-11 Underflow Subnormal Inexact Rounded
+sqtx8594 squareroot 4.18E-21 -> 6E-11 Underflow Subnormal Inexact Rounded
+sqtx8595 squareroot 7.19E-21 -> 8E-11 Underflow Subnormal Inexact Rounded
+sqtx8596 squareroot 8.94E-21 -> 9E-11 Underflow Subnormal Inexact Rounded
+sqtx8597 squareroot 1.81E-20 -> 1.3E-10 Underflow Subnormal Inexact Rounded
+sqtx8598 squareroot 4.64E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8599 squareroot 5.06E-20 -> 2.2E-10 Underflow Subnormal Inexact Rounded
+sqtx8600 squareroot 5.08E-20 -> 2.3E-10 Underflow Subnormal Inexact Rounded
+sqtx8601 squareroot 7.00E-20 -> 2.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8602 squareroot 1.81E-19 -> 4.3E-10 Underflow Subnormal Inexact Rounded
+sqtx8603 squareroot 6.64E-19 -> 8.1E-10 Underflow Subnormal Inexact Rounded
+sqtx8604 squareroot 7.48E-19 -> 8.6E-10 Underflow Subnormal Inexact Rounded
+sqtx8605 squareroot 9.91E-19 -> 1.00E-9 Underflow Subnormal Inexact Rounded
+precision: 4
+sqtx8606 squareroot 6.24E-24 -> 2E-12 Underflow Subnormal Inexact Rounded
+sqtx8607 squareroot 7.162E-23 -> 8E-12 Underflow Subnormal Inexact Rounded
+sqtx8608 squareroot 7.243E-23 -> 9E-12 Underflow Subnormal Inexact Rounded
+sqtx8609 squareroot 8.961E-23 -> 9E-12 Underflow Subnormal Inexact Rounded
+sqtx8610 squareroot 9.029E-23 -> 1.0E-11 Underflow Subnormal Inexact Rounded
+sqtx8611 squareroot 4.624E-22 -> 2.2E-11 Underflow Subnormal Inexact Rounded
+sqtx8612 squareroot 5.980E-22 -> 2.4E-11 Underflow Subnormal Inexact Rounded
+sqtx8613 squareroot 6.507E-22 -> 2.6E-11 Underflow Subnormal Inexact Rounded
+sqtx8614 squareroot 1.483E-21 -> 3.9E-11 Underflow Subnormal Inexact Rounded
+sqtx8615 squareroot 3.903E-21 -> 6.2E-11 Underflow Subnormal Inexact Rounded
+sqtx8616 squareroot 8.733E-21 -> 9.3E-11 Underflow Subnormal Inexact Rounded
+sqtx8617 squareroot 1.781E-20 -> 1.33E-10 Underflow Subnormal Inexact Rounded
+sqtx8618 squareroot 6.426E-20 -> 2.53E-10 Underflow Subnormal Inexact Rounded
+sqtx8619 squareroot 7.102E-20 -> 2.66E-10 Underflow Subnormal Inexact Rounded
+sqtx8620 squareroot 7.535E-20 -> 2.74E-10 Underflow Subnormal Inexact Rounded
+sqtx8621 squareroot 9.892E-20 -> 3.15E-10 Underflow Subnormal Inexact Rounded
+sqtx8622 squareroot 1.612E-19 -> 4.01E-10 Underflow Subnormal Inexact Rounded
+sqtx8623 squareroot 1.726E-19 -> 4.15E-10 Underflow Subnormal Inexact Rounded
+sqtx8624 squareroot 1.853E-19 -> 4.30E-10 Underflow Subnormal Inexact Rounded
+sqtx8625 squareroot 4.245E-19 -> 6.52E-10 Underflow Subnormal Inexact Rounded
+
+-- clamping and overflow for large exponents
+precision: 1
+sqtx8626 squareroot 1E+18 -> 1E+9
+sqtx8627 squareroot 1E+19 -> 3E+9 Inexact Rounded
+sqtx8628 squareroot 9E+19 -> 9E+9 Inexact Rounded
+sqtx8629 squareroot 9.1E+19 -> Infinity Overflow Inexact Rounded
+sqtx8630 squareroot 1E+20 -> Infinity Overflow Inexact Rounded
+
+precision: 2
+sqtx8631 squareroot 1E+18 -> 1E+9
+sqtx8632 squareroot 1.0E+18 -> 1.0E+9
+sqtx8633 squareroot 1.00E+18 -> 1.0E+9
+sqtx8634 squareroot 1.000E+18 -> 1.0E+9 Rounded
+sqtx8635 squareroot 1E+20 -> Infinity Overflow Inexact Rounded
+clamp: 1
+sqtx8636 squareroot 1E+18 -> 1.0E+9 Clamped
+sqtx8637 squareroot 1.0E+18 -> 1.0E+9
+sqtx8638 squareroot 1E+20 -> Infinity Overflow Inexact Rounded
+clamp: 0
+
+precision: 6
+sqtx8639 squareroot 1E+18 -> 1E+9
+sqtx8640 squareroot 1.0000000000E+18 -> 1.00000E+9
+sqtx8641 squareroot 1.00000000000E+18 -> 1.00000E+9 Rounded
+sqtx8642 squareroot 1E+20 -> Infinity Overflow Inexact Rounded
+clamp: 1
+sqtx8643 squareroot 1E+8 -> 1E+4
+sqtx8644 squareroot 1E+10 -> 1.0E+5 Clamped
+sqtx8645 squareroot 1.0E+10 -> 1.0E+5
+sqtx8646 squareroot 1E+12 -> 1.00E+6 Clamped
+sqtx8647 squareroot 1.0E+12 -> 1.00E+6 Clamped
+sqtx8648 squareroot 1.00E+12 -> 1.00E+6 Clamped
+sqtx8649 squareroot 1.000E+12 -> 1.00E+6
+sqtx8650 squareroot 1E+18 -> 1.00000E+9 Clamped
+sqtx8651 squareroot 1.00000000E+18 -> 1.00000E+9 Clamped
+sqtx8652 squareroot 1.000000000E+18 -> 1.00000E+9
+sqtx8653 squareroot 1E+20 -> Infinity Overflow Inexact Rounded
+clamp: 0
+
+-- The following example causes a TypeError in Python 2.5.1
+precision: 3
+maxexponent: 9
+minexponent: -9
+sqtx8654 squareroot 10000000000 -> 1.00E+5 Rounded
+
+-- Additional tricky cases of underflown subnormals
+rounding: half_even
+precision: 5
+maxexponent: 999
+minexponent: -999
+sqtx8700 squareroot 2.8073E-2000 -> 1.675E-1000 Underflow Subnormal Inexact Rounded
+sqtx8701 squareroot 2.8883E-2000 -> 1.699E-1000 Underflow Subnormal Inexact Rounded
+sqtx8702 squareroot 3.1524E-2000 -> 1.775E-1000 Underflow Subnormal Inexact Rounded
+sqtx8703 squareroot 3.2382E-2000 -> 1.799E-1000 Underflow Subnormal Inexact Rounded
+sqtx8704 squareroot 3.5175E-2000 -> 1.875E-1000 Underflow Subnormal Inexact Rounded
+sqtx8705 squareroot 3.6081E-2000 -> 1.899E-1000 Underflow Subnormal Inexact Rounded
+sqtx8706 squareroot 3.9026E-2000 -> 1.975E-1000 Underflow Subnormal Inexact Rounded
+sqtx8707 squareroot 3.9980E-2000 -> 1.999E-1000 Underflow Subnormal Inexact Rounded
+sqtx8708 squareroot 4.3077E-2000 -> 2.075E-1000 Underflow Subnormal Inexact Rounded
+sqtx8709 squareroot 4.4079E-2000 -> 2.099E-1000 Underflow Subnormal Inexact Rounded
+sqtx8710 squareroot 4.7328E-2000 -> 2.175E-1000 Underflow Subnormal Inexact Rounded
+sqtx8711 squareroot 4.8378E-2000 -> 2.199E-1000 Underflow Subnormal Inexact Rounded
+sqtx8712 squareroot 5.1779E-2000 -> 2.275E-1000 Underflow Subnormal Inexact Rounded
+sqtx8713 squareroot 5.2877E-2000 -> 2.299E-1000 Underflow Subnormal Inexact Rounded
+sqtx8714 squareroot 5.6430E-2000 -> 2.375E-1000 Underflow Subnormal Inexact Rounded
+sqtx8715 squareroot 5.7576E-2000 -> 2.399E-1000 Underflow Subnormal Inexact Rounded
+sqtx8716 squareroot 6.1281E-2000 -> 2.475E-1000 Underflow Subnormal Inexact Rounded
+sqtx8717 squareroot 6.2475E-2000 -> 2.499E-1000 Underflow Subnormal Inexact Rounded
+sqtx8718 squareroot 6.6332E-2000 -> 2.575E-1000 Underflow Subnormal Inexact Rounded
+sqtx8719 squareroot 6.7574E-2000 -> 2.599E-1000 Underflow Subnormal Inexact Rounded
+sqtx8720 squareroot 7.1583E-2000 -> 2.675E-1000 Underflow Subnormal Inexact Rounded
+sqtx8721 squareroot 7.2873E-2000 -> 2.699E-1000 Underflow Subnormal Inexact Rounded
+sqtx8722 squareroot 7.7034E-2000 -> 2.775E-1000 Underflow Subnormal Inexact Rounded
+sqtx8723 squareroot 7.8372E-2000 -> 2.799E-1000 Underflow Subnormal Inexact Rounded
+sqtx8724 squareroot 8.2685E-2000 -> 2.875E-1000 Underflow Subnormal Inexact Rounded
+sqtx8725 squareroot 8.4071E-2000 -> 2.899E-1000 Underflow Subnormal Inexact Rounded
+sqtx8726 squareroot 8.8536E-2000 -> 2.975E-1000 Underflow Subnormal Inexact Rounded
+sqtx8727 squareroot 8.9970E-2000 -> 2.999E-1000 Underflow Subnormal Inexact Rounded
+sqtx8728 squareroot 9.4587E-2000 -> 3.075E-1000 Underflow Subnormal Inexact Rounded
+sqtx8729 squareroot 9.6069E-2000 -> 3.099E-1000 Underflow Subnormal Inexact Rounded
+-- (End of Mark Dickinson's testcases.)
+
+
+-- Some additional edge cases
+maxexponent: 9
+minexponent: -9
+precision: 2
+sqtx9000 squareroot 9980.01 -> 1.0E+2 Inexact Rounded
+precision: 3
+sqtx9001 squareroot 9980.01 -> 99.9
+precision: 4
+sqtx9002 squareroot 9980.01 -> 99.9
+
+-- Exact from over-precise
+precision: 4
+sqtx9003 squareroot 11025   -> 105
+precision: 3
+sqtx9004 squareroot 11025   -> 105
+precision: 2
+sqtx9005 squareroot 11025   -> 1.0E+2  Inexact Rounded
+precision: 1
+sqtx9006 squareroot 11025   -> 1E+2    Inexact Rounded
+
+-- Out-of-bounds zeros
+precision: 4
+sqtx9010 squareroot 0E-9  -> 0.00000
+sqtx9011 squareroot 0E-10 -> 0.00000
+sqtx9012 squareroot 0E-11 -> 0.000000
+sqtx9013 squareroot 0E-12 -> 0.000000
+sqtx9014 squareroot 0E-13 -> 0E-7
+sqtx9015 squareroot 0E-14 -> 0E-7
+sqtx9020 squareroot 0E-17 -> 0E-9
+sqtx9021 squareroot 0E-20 -> 0E-10
+sqtx9022 squareroot 0E-22 -> 0E-11
+sqtx9023 squareroot 0E-24 -> 0E-12
+sqtx9024 squareroot 0E-25 -> 0E-12 Clamped
+sqtx9025 squareroot 0E-26 -> 0E-12 Clamped
+sqtx9026 squareroot 0E-27 -> 0E-12 Clamped
+sqtx9027 squareroot 0E-28 -> 0E-12 Clamped
+
+sqtx9030 squareroot 0E+8  -> 0E+4
+sqtx9031 squareroot 0E+10 -> 0E+5
+sqtx9032 squareroot 0E+12 -> 0E+6
+sqtx9033 squareroot 0E+14 -> 0E+7
+sqtx9034 squareroot 0E+15 -> 0E+7
+sqtx9035 squareroot 0E+16 -> 0E+8
+sqtx9036 squareroot 0E+18 -> 0E+9
+sqtx9037 squareroot 0E+19 -> 0E+9
+sqtx9038 squareroot 0E+20 -> 0E+9 Clamped
+sqtx9039 squareroot 0E+21 -> 0E+9 Clamped
+sqtx9040 squareroot 0E+22 -> 0E+9 Clamped
+
+
 -- Null test
-sqtx900 squareroot  # -> NaN Invalid_operation
+sqtx9900 squareroot  # -> NaN Invalid_operation
index bdedc5b8994475b679da34458693e9937b570389..338a09c0e38acce8f2c9025383b181e41ca00604 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- subtract.decTest -- decimal subtraction                            --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 extended:    1
 precision:   9
@@ -805,9 +805,9 @@ subx1014 subtract  0  0.01E-999       ->  -1E-1001   Subnormal
 subx1015 subtract  0  0.999E-999      ->  -1.00E-999 Inexact Rounded Subnormal Underflow
 subx1016 subtract  0  0.099E-999      ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
 subx1017 subtract  0  0.009E-999      ->  -1E-1001   Inexact Rounded Subnormal Underflow
-subx1018 subtract  0  0.001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
-subx1019 subtract  0  0.0009E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow
-subx1020 subtract  0  0.0001E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow
+subx1018 subtract  0  0.001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+subx1019 subtract  0  0.0009E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
+subx1020 subtract  0  0.0001E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 subx1030 subtract  0 -1.00E-999       ->   1.00E-999
 subx1031 subtract  0 -0.1E-999        ->   1E-1000   Subnormal
@@ -818,9 +818,9 @@ subx1034 subtract  0 -0.01E-999       ->   1E-1001   Subnormal
 subx1035 subtract  0 -0.999E-999      ->   1.00E-999 Inexact Rounded Subnormal Underflow
 subx1036 subtract  0 -0.099E-999      ->   1.0E-1000 Inexact Rounded Subnormal Underflow
 subx1037 subtract  0 -0.009E-999      ->   1E-1001   Inexact Rounded Subnormal Underflow
-subx1038 subtract  0 -0.001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
-subx1039 subtract  0 -0.0009E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow
-subx1040 subtract  0 -0.0001E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow
+subx1038 subtract  0 -0.001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+subx1039 subtract  0 -0.0009E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
+subx1040 subtract  0 -0.0001E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow Clamped
 
 -- some non-zero subnormal subtracts
 -- subx1056 is a tricky case
@@ -831,7 +831,7 @@ subx1052 subtract  0.10E-999   0.1E-999  ->   0E-1001
 subx1053 subtract  0.100E-999  0.1E-999  ->   0E-1001    Clamped
 subx1054 subtract  0.01E-999   0.1E-999  ->   -9E-1001   Subnormal
 subx1055 subtract  0.999E-999  0.1E-999  ->   9.0E-1000  Inexact Rounded Subnormal Underflow
-subx1056 subtract  0.099E-999  0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow
+subx1056 subtract  0.099E-999  0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow Clamped
 subx1057 subtract  0.009E-999  0.1E-999  ->   -9E-1001   Inexact Rounded Subnormal Underflow
 subx1058 subtract  0.001E-999  0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
 subx1059 subtract  0.0009E-999 0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
@@ -849,15 +849,25 @@ subx1104 subtract  1.52444E-80 0 ->  1.524E-80 Inexact Rounded Subnormal Underfl
 subx1105 subtract  1.52445E-80 0 ->  1.524E-80 Inexact Rounded Subnormal Underflow
 subx1106 subtract  1.52446E-80 0 ->  1.524E-80 Inexact Rounded Subnormal Underflow
 
-subx1111 subtract  1.2345678E-80  1.2345671E-80 ->  0E-83 Inexact Rounded Subnormal Underflow
-subx1112 subtract  1.2345678E-80  1.2345618E-80 ->  0E-83 Inexact Rounded Subnormal Underflow
-subx1113 subtract  1.2345678E-80  1.2345178E-80 ->  0E-83 Inexact Rounded Subnormal Underflow
-subx1114 subtract  1.2345678E-80  1.2341678E-80 ->  0E-83 Inexact Rounded Subnormal Underflow
+subx1111 subtract  1.2345678E-80  1.2345671E-80 ->  0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1112 subtract  1.2345678E-80  1.2345618E-80 ->  0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1113 subtract  1.2345678E-80  1.2345178E-80 ->  0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1114 subtract  1.2345678E-80  1.2341678E-80 ->  0E-83 Inexact Rounded Subnormal Underflow Clamped
 subx1115 subtract  1.2345678E-80  1.2315678E-80 ->  3E-83         Rounded Subnormal
 subx1116 subtract  1.2345678E-80  1.2145678E-80 ->  2.0E-82       Rounded Subnormal
 subx1117 subtract  1.2345678E-80  1.1345678E-80 ->  1.00E-81      Rounded Subnormal
 subx1118 subtract  1.2345678E-80  0.2345678E-80 ->  1.000E-80     Rounded Subnormal
 
+precision:   34
+rounding:    half_up
+maxExponent: 6144
+minExponent: -6143
+-- Examples from SQL proposal (Krishna Kulkarni)
+subx1125  subtract 130E-2  120E-2 -> 0.10
+subx1126  subtract 130E-2  12E-1  -> 0.10
+subx1127  subtract 130E-2  1E0    -> 0.30
+subx1128  subtract 1E2     1E4    -> -9.9E+3
+
 -- Null tests
 subx9990 subtract 10  # -> NaN Invalid_operation
 subx9991 subtract  # 10 -> NaN Invalid_operation
index 8daa0d9446d5ddfc799b12ed3a7cd98f4bd4a3d8..1cbc20e44f1775795cfba4e39eb875e9c289c84d 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- testall.decTest -- run all general decimal arithmetic testcases    --
--- Copyright (c) IBM Corporation, 1981, 2004.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- core tests (using Extended: 1) --------------------------------------
 dectest: base
+
 dectest: abs
 dectest: add
+dectest: and
 dectest: clamp
+dectest: class
 dectest: compare
+dectest: comparesig
+dectest: comparetotal
+dectest: comparetotmag
+dectest: copy
+dectest: copyabs
+dectest: copynegate
+dectest: copysign
 dectest: divide
 dectest: divideint
+dectest: exp
+dectest: fma
 dectest: inexact
+dectest: invert
+dectest: ln
+dectest: logb
+dectest: log10
 dectest: max
+dectest: maxmag
 dectest: min
+dectest: minmag
 dectest: minus
 dectest: multiply
-dectest: normalize
+dectest: nextminus
+dectest: nextplus
+dectest: nexttoward
+dectest: or
 dectest: plus
 dectest: power
+dectest: powersqrt
 dectest: quantize
 dectest: randoms
+dectest: reduce               -- [was called normalize]
 dectest: remainder
 dectest: remaindernear
 dectest: rescale              -- [obsolete]
+dectest: rotate
 dectest: rounding
 dectest: samequantum
+dectest: scaleb
+dectest: shift
 dectest: squareroot
 dectest: subtract
 dectest: tointegral
+dectest: tointegralx
 dectest: trim
+dectest: xor
 
--- The next are for the Strawman 4d concrete representations
-dectest: decimal32
-dectest: decimal64
-dectest: decimal128
-
+-- The next are for the Strawman 4d concrete representations and
+-- tests at those sizes [including dsEncode, ddEncode, and dqEncode,
+-- which replace decimal32, decimal64, and decimal128]
+dectest: decSingle
+dectest: decDouble
+dectest: decQuad
 
 -- General 31->33-digit boundary tests
 dectest: randombound32
index f7174d4ca665346b2bc750f055328102c7505496..ad25e6be03896e050441597481bf59d08789fb38 100644 (file)
@@ -1,6 +1,6 @@
 ------------------------------------------------------------------------
 -- tointegral.decTest -- round decimal to integral value              --
--- Copyright (c) IBM Corporation, 2001, 2003.  All rights reserved.   --
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --
 ------------------------------------------------------------------------
 -- Please see the document "General Decimal Arithmetic Testcases"     --
 -- at http://www2.hursley.ibm.com/decimal for the description of      --
@@ -17,7 +17,7 @@
 --   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 --   mfc@uk.ibm.com                                                   --
 ------------------------------------------------------------------------
-version: 2.39
+version: 2.56
 
 -- This set of tests tests the extended specification 'round-to-integral
 -- value' operation (from IEEE 854, later modified in 754r).
@@ -174,3 +174,68 @@ intx205 tointegral   10E+5    -> 1.0E+6
 intx206 tointegral  7.89E+77  -> 7.89E+77
 intx207 tointegral   -Inf     -> -Infinity
 
+
+-- all rounding modes
+rounding:    half_even
+
+intx210 tointegral     55.5   ->  56
+intx211 tointegral     56.5   ->  56
+intx212 tointegral     57.5   ->  58
+intx213 tointegral    -55.5   -> -56
+intx214 tointegral    -56.5   -> -56
+intx215 tointegral    -57.5   -> -58
+
+rounding:    half_up
+
+intx220 tointegral     55.5   ->  56
+intx221 tointegral     56.5   ->  57
+intx222 tointegral     57.5   ->  58
+intx223 tointegral    -55.5   -> -56
+intx224 tointegral    -56.5   -> -57
+intx225 tointegral    -57.5   -> -58
+
+rounding:    half_down
+
+intx230 tointegral     55.5   ->  55
+intx231 tointegral     56.5   ->  56
+intx232 tointegral     57.5   ->  57
+intx233 tointegral    -55.5   -> -55
+intx234 tointegral    -56.5   -> -56
+intx235 tointegral    -57.5   -> -57
+
+rounding:    up
+
+intx240 tointegral     55.3   ->  56
+intx241 tointegral     56.3   ->  57
+intx242 tointegral     57.3   ->  58
+intx243 tointegral    -55.3   -> -56
+intx244 tointegral    -56.3   -> -57
+intx245 tointegral    -57.3   -> -58
+
+rounding:    down
+
+intx250 tointegral     55.7   ->  55
+intx251 tointegral     56.7   ->  56
+intx252 tointegral     57.7   ->  57
+intx253 tointegral    -55.7   -> -55
+intx254 tointegral    -56.7   -> -56
+intx255 tointegral    -57.7   -> -57
+
+rounding:    ceiling
+
+intx260 tointegral     55.3   ->  56
+intx261 tointegral     56.3   ->  57
+intx262 tointegral     57.3   ->  58
+intx263 tointegral    -55.3   -> -55
+intx264 tointegral    -56.3   -> -56
+intx265 tointegral    -57.3   -> -57
+
+rounding:    floor
+
+intx270 tointegral     55.7   ->  55
+intx271 tointegral     56.7   ->  56
+intx272 tointegral     57.7   ->  57
+intx273 tointegral    -55.7   -> -56
+intx274 tointegral    -56.7   -> -57
+intx275 tointegral    -57.7   -> -58
+
diff --git a/Lib/test/decimaltestdata/tointegralx.decTest b/Lib/test/decimaltestdata/tointegralx.decTest
new file mode 100644 (file)
index 0000000..d9bc9f3
--- /dev/null
@@ -0,0 +1,255 @@
+------------------------------------------------------------------------\r
+-- tointegralx.decTest -- round decimal to integral value, exact      --\r
+-- Copyright (c) IBM Corporation, 2001, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+-- This set of tests tests the extended specification 'round-to-integral\r
+-- value' operation (from IEEE 854, later modified in 754r).\r
+-- All non-zero results are defined as being those from either copy or\r
+-- quantize, so those are assumed to have been tested.\r
+\r
+-- This tests toIntegraExact, which may set Inexact\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+intxx001 tointegralx      0     ->  0\r
+intxx002 tointegralx      0.0   ->  0\r
+intxx003 tointegralx      0.1   ->  0 Inexact Rounded\r
+intxx004 tointegralx      0.2   ->  0 Inexact Rounded\r
+intxx005 tointegralx      0.3   ->  0 Inexact Rounded\r
+intxx006 tointegralx      0.4   ->  0 Inexact Rounded\r
+intxx007 tointegralx      0.5   ->  1 Inexact Rounded\r
+intxx008 tointegralx      0.6   ->  1 Inexact Rounded\r
+intxx009 tointegralx      0.7   ->  1 Inexact Rounded\r
+intxx010 tointegralx      0.8   ->  1 Inexact Rounded\r
+intxx011 tointegralx      0.9   ->  1 Inexact Rounded\r
+intxx012 tointegralx      1     ->  1\r
+intxx013 tointegralx      1.0   ->  1 Rounded\r
+intxx014 tointegralx      1.1   ->  1 Inexact Rounded\r
+intxx015 tointegralx      1.2   ->  1 Inexact Rounded\r
+intxx016 tointegralx      1.3   ->  1 Inexact Rounded\r
+intxx017 tointegralx      1.4   ->  1 Inexact Rounded\r
+intxx018 tointegralx      1.5   ->  2 Inexact Rounded\r
+intxx019 tointegralx      1.6   ->  2 Inexact Rounded\r
+intxx020 tointegralx      1.7   ->  2 Inexact Rounded\r
+intxx021 tointegralx      1.8   ->  2 Inexact Rounded\r
+intxx022 tointegralx      1.9   ->  2 Inexact Rounded\r
+-- negatives\r
+intxx031 tointegralx     -0     -> -0\r
+intxx032 tointegralx     -0.0   -> -0\r
+intxx033 tointegralx     -0.1   -> -0 Inexact Rounded\r
+intxx034 tointegralx     -0.2   -> -0 Inexact Rounded\r
+intxx035 tointegralx     -0.3   -> -0 Inexact Rounded\r
+intxx036 tointegralx     -0.4   -> -0 Inexact Rounded\r
+intxx037 tointegralx     -0.5   -> -1 Inexact Rounded\r
+intxx038 tointegralx     -0.6   -> -1 Inexact Rounded\r
+intxx039 tointegralx     -0.7   -> -1 Inexact Rounded\r
+intxx040 tointegralx     -0.8   -> -1 Inexact Rounded\r
+intxx041 tointegralx     -0.9   -> -1 Inexact Rounded\r
+intxx042 tointegralx     -1     -> -1\r
+intxx043 tointegralx     -1.0   -> -1 Rounded\r
+intxx044 tointegralx     -1.1   -> -1 Inexact Rounded\r
+intxx045 tointegralx     -1.2   -> -1 Inexact Rounded\r
+intxx046 tointegralx     -1.3   -> -1 Inexact Rounded\r
+intxx047 tointegralx     -1.4   -> -1 Inexact Rounded\r
+intxx048 tointegralx     -1.5   -> -2 Inexact Rounded\r
+intxx049 tointegralx     -1.6   -> -2 Inexact Rounded\r
+intxx050 tointegralx     -1.7   -> -2 Inexact Rounded\r
+intxx051 tointegralx     -1.8   -> -2 Inexact Rounded\r
+intxx052 tointegralx     -1.9   -> -2 Inexact Rounded\r
+-- next two would be NaN using quantize(x, 0)\r
+intxx053 tointegralx    10E+30  -> 1.0E+31\r
+intxx054 tointegralx   -10E+30  -> -1.0E+31\r
+\r
+-- numbers around precision\r
+precision: 9\r
+intxx060 tointegralx '56267E-10'   -> '0'               Inexact Rounded\r
+intxx061 tointegralx '56267E-5'    -> '1'               Inexact Rounded\r
+intxx062 tointegralx '56267E-2'    -> '563'             Inexact Rounded\r
+intxx063 tointegralx '56267E-1'    -> '5627'            Inexact Rounded\r
+intxx065 tointegralx '56267E-0'    -> '56267'\r
+intxx066 tointegralx '56267E+0'    -> '56267'\r
+intxx067 tointegralx '56267E+1'    -> '5.6267E+5'\r
+intxx068 tointegralx '56267E+2'    -> '5.6267E+6'\r
+intxx069 tointegralx '56267E+3'    -> '5.6267E+7'\r
+intxx070 tointegralx '56267E+4'    -> '5.6267E+8'\r
+intxx071 tointegralx '56267E+5'    -> '5.6267E+9'\r
+intxx072 tointegralx '56267E+6'    -> '5.6267E+10'\r
+intxx073 tointegralx '1.23E+96'    -> '1.23E+96'\r
+intxx074 tointegralx '1.23E+384'   -> '1.23E+384'\r
+intxx075 tointegralx '1.23E+999'   -> '1.23E+999'\r
+\r
+intxx080 tointegralx '-56267E-10'  -> '-0'              Inexact Rounded\r
+intxx081 tointegralx '-56267E-5'   -> '-1'              Inexact Rounded\r
+intxx082 tointegralx '-56267E-2'   -> '-563'            Inexact Rounded\r
+intxx083 tointegralx '-56267E-1'   -> '-5627'           Inexact Rounded\r
+intxx085 tointegralx '-56267E-0'   -> '-56267'\r
+intxx086 tointegralx '-56267E+0'   -> '-56267'\r
+intxx087 tointegralx '-56267E+1'   -> '-5.6267E+5'\r
+intxx088 tointegralx '-56267E+2'   -> '-5.6267E+6'\r
+intxx089 tointegralx '-56267E+3'   -> '-5.6267E+7'\r
+intxx090 tointegralx '-56267E+4'   -> '-5.6267E+8'\r
+intxx091 tointegralx '-56267E+5'   -> '-5.6267E+9'\r
+intxx092 tointegralx '-56267E+6'   -> '-5.6267E+10'\r
+intxx093 tointegralx '-1.23E+96'   -> '-1.23E+96'\r
+intxx094 tointegralx '-1.23E+384'  -> '-1.23E+384'\r
+intxx095 tointegralx '-1.23E+999'  -> '-1.23E+999'\r
+\r
+-- subnormal inputs\r
+intxx100 tointegralx        1E-999 -> 0                 Inexact Rounded\r
+intxx101 tointegralx      0.1E-999 -> 0                 Inexact Rounded\r
+intxx102 tointegralx     0.01E-999 -> 0                 Inexact Rounded\r
+intxx103 tointegralx        0E-999 -> 0\r
+\r
+-- specials and zeros\r
+intxx120 tointegralx 'Inf'       ->  Infinity\r
+intxx121 tointegralx '-Inf'      -> -Infinity\r
+intxx122 tointegralx   NaN       ->  NaN\r
+intxx123 tointegralx  sNaN       ->  NaN  Invalid_operation\r
+intxx124 tointegralx     0       ->  0\r
+intxx125 tointegralx    -0       -> -0\r
+intxx126 tointegralx     0.000   ->  0\r
+intxx127 tointegralx     0.00    ->  0\r
+intxx128 tointegralx     0.0     ->  0\r
+intxx129 tointegralx     0       ->  0\r
+intxx130 tointegralx     0E-3    ->  0\r
+intxx131 tointegralx     0E-2    ->  0\r
+intxx132 tointegralx     0E-1    ->  0\r
+intxx133 tointegralx     0E-0    ->  0\r
+intxx134 tointegralx     0E+1    ->  0E+1\r
+intxx135 tointegralx     0E+2    ->  0E+2\r
+intxx136 tointegralx     0E+3    ->  0E+3\r
+intxx137 tointegralx     0E+4    ->  0E+4\r
+intxx138 tointegralx     0E+5    ->  0E+5\r
+intxx139 tointegralx    -0.000   -> -0\r
+intxx140 tointegralx    -0.00    -> -0\r
+intxx141 tointegralx    -0.0     -> -0\r
+intxx142 tointegralx    -0       -> -0\r
+intxx143 tointegralx    -0E-3    -> -0\r
+intxx144 tointegralx    -0E-2    -> -0\r
+intxx145 tointegralx    -0E-1    -> -0\r
+intxx146 tointegralx    -0E-0    -> -0\r
+intxx147 tointegralx    -0E+1    -> -0E+1\r
+intxx148 tointegralx    -0E+2    -> -0E+2\r
+intxx149 tointegralx    -0E+3    -> -0E+3\r
+intxx150 tointegralx    -0E+4    -> -0E+4\r
+intxx151 tointegralx    -0E+5    -> -0E+5\r
+-- propagating NaNs\r
+intxx152 tointegralx   NaN808    ->  NaN808\r
+intxx153 tointegralx  sNaN080    ->  NaN80  Invalid_operation\r
+intxx154 tointegralx  -NaN808    -> -NaN808\r
+intxx155 tointegralx -sNaN080    -> -NaN80  Invalid_operation\r
+intxx156 tointegralx  -NaN       -> -NaN\r
+intxx157 tointegralx -sNaN       -> -NaN    Invalid_operation\r
+\r
+-- examples\r
+rounding:    half_up\r
+precision:   9\r
+intxx200 tointegralx     2.1    -> 2                    Inexact Rounded\r
+intxx201 tointegralx   100      -> 100\r
+intxx202 tointegralx   100.0    -> 100                  Rounded\r
+intxx203 tointegralx   101.5    -> 102                  Inexact Rounded\r
+intxx204 tointegralx  -101.5    -> -102                 Inexact Rounded\r
+intxx205 tointegralx   10E+5    -> 1.0E+6\r
+intxx206 tointegralx  7.89E+77  -> 7.89E+77\r
+intxx207 tointegralx   -Inf     -> -Infinity\r
+\r
+\r
+-- all rounding modes\r
+rounding:    half_even\r
+\r
+intxx210 tointegralx     55.5   ->  56   Inexact Rounded\r
+intxx211 tointegralx     56.5   ->  56   Inexact Rounded\r
+intxx212 tointegralx     57.5   ->  58   Inexact Rounded\r
+intxx213 tointegralx    -55.5   -> -56   Inexact Rounded\r
+intxx214 tointegralx    -56.5   -> -56   Inexact Rounded\r
+intxx215 tointegralx    -57.5   -> -58   Inexact Rounded\r
+\r
+rounding:    half_up\r
+\r
+intxx220 tointegralx     55.5   ->  56   Inexact Rounded\r
+intxx221 tointegralx     56.5   ->  57   Inexact Rounded\r
+intxx222 tointegralx     57.5   ->  58   Inexact Rounded\r
+intxx223 tointegralx    -55.5   -> -56   Inexact Rounded\r
+intxx224 tointegralx    -56.5   -> -57   Inexact Rounded\r
+intxx225 tointegralx    -57.5   -> -58   Inexact Rounded\r
+\r
+rounding:    half_down\r
+\r
+intxx230 tointegralx     55.5   ->  55   Inexact Rounded\r
+intxx231 tointegralx     56.5   ->  56   Inexact Rounded\r
+intxx232 tointegralx     57.5   ->  57   Inexact Rounded\r
+intxx233 tointegralx    -55.5   -> -55   Inexact Rounded\r
+intxx234 tointegralx    -56.5   -> -56   Inexact Rounded\r
+intxx235 tointegralx    -57.5   -> -57   Inexact Rounded\r
+\r
+rounding:    up\r
+\r
+intxx240 tointegralx     55.3   ->  56   Inexact Rounded\r
+intxx241 tointegralx     56.3   ->  57   Inexact Rounded\r
+intxx242 tointegralx     57.3   ->  58   Inexact Rounded\r
+intxx243 tointegralx    -55.3   -> -56   Inexact Rounded\r
+intxx244 tointegralx    -56.3   -> -57   Inexact Rounded\r
+intxx245 tointegralx    -57.3   -> -58   Inexact Rounded\r
+\r
+rounding:    down\r
+\r
+intxx250 tointegralx     55.7   ->  55   Inexact Rounded\r
+intxx251 tointegralx     56.7   ->  56   Inexact Rounded\r
+intxx252 tointegralx     57.7   ->  57   Inexact Rounded\r
+intxx253 tointegralx    -55.7   -> -55   Inexact Rounded\r
+intxx254 tointegralx    -56.7   -> -56   Inexact Rounded\r
+intxx255 tointegralx    -57.7   -> -57   Inexact Rounded\r
+\r
+rounding:    ceiling\r
+\r
+intxx260 tointegralx     55.3   ->  56   Inexact Rounded\r
+intxx261 tointegralx     56.3   ->  57   Inexact Rounded\r
+intxx262 tointegralx     57.3   ->  58   Inexact Rounded\r
+intxx263 tointegralx    -55.3   -> -55   Inexact Rounded\r
+intxx264 tointegralx    -56.3   -> -56   Inexact Rounded\r
+intxx265 tointegralx    -57.3   -> -57   Inexact Rounded\r
+\r
+rounding:    floor\r
+\r
+intxx270 tointegralx     55.7   ->  55   Inexact Rounded\r
+intxx271 tointegralx     56.7   ->  56   Inexact Rounded\r
+intxx272 tointegralx     57.7   ->  57   Inexact Rounded\r
+intxx273 tointegralx    -55.7   -> -56   Inexact Rounded\r
+intxx274 tointegralx    -56.7   -> -57   Inexact Rounded\r
+intxx275 tointegralx    -57.7   -> -58   Inexact Rounded\r
+\r
+-- Int and uInt32 edge values for testing conversions\r
+precision: 16\r
+intxx300 tointegralx -2147483646  -> -2147483646\r
+intxx301 tointegralx -2147483647  -> -2147483647\r
+intxx302 tointegralx -2147483648  -> -2147483648\r
+intxx303 tointegralx -2147483649  -> -2147483649\r
+intxx304 tointegralx  2147483646  ->  2147483646\r
+intxx305 tointegralx  2147483647  ->  2147483647\r
+intxx306 tointegralx  2147483648  ->  2147483648\r
+intxx307 tointegralx  2147483649  ->  2147483649\r
+intxx308 tointegralx  4294967294  ->  4294967294\r
+intxx309 tointegralx  4294967295  ->  4294967295\r
+intxx310 tointegralx  4294967296  ->  4294967296\r
+intxx311 tointegralx  4294967297  ->  4294967297\r
diff --git a/Lib/test/decimaltestdata/xor.decTest b/Lib/test/decimaltestdata/xor.decTest
new file mode 100644 (file)
index 0000000..2ac1b37
--- /dev/null
@@ -0,0 +1,335 @@
+------------------------------------------------------------------------\r
+-- xor.decTest -- digitwise logical XOR                               --\r
+-- Copyright (c) IBM Corporation, 1981, 2007.  All rights reserved.   --\r
+------------------------------------------------------------------------\r
+-- Please see the document "General Decimal Arithmetic Testcases"     --\r
+-- at http://www2.hursley.ibm.com/decimal for the description of      --\r
+-- these testcases.                                                   --\r
+--                                                                    --\r
+-- These testcases are experimental ('beta' versions), and they       --\r
+-- may contain errors.  They are offered on an as-is basis.  In       --\r
+-- particular, achieving the same results as the tests here is not    --\r
+-- a guarantee that an implementation complies with any Standard      --\r
+-- or specification.  The tests are not exhaustive.                   --\r
+--                                                                    --\r
+-- Please send comments, suggestions, and corrections to the author:  --\r
+--   Mike Cowlishaw, IBM Fellow                                       --\r
+--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --\r
+--   mfc@uk.ibm.com                                                   --\r
+------------------------------------------------------------------------\r
+version: 2.56\r
+\r
+extended:    1\r
+precision:   9\r
+rounding:    half_up\r
+maxExponent: 999\r
+minExponent: -999\r
+\r
+-- Sanity check (truth table)\r
+xorx001 xor             0    0 ->    0\r
+xorx002 xor             0    1 ->    1\r
+xorx003 xor             1    0 ->    1\r
+xorx004 xor             1    1 ->    0\r
+xorx005 xor          1100 1010 ->  110\r
+xorx006 xor          1111   10 -> 1101\r
+-- and at msd and msd-1\r
+xorx010 xor 000000000 000000000 ->           0\r
+xorx011 xor 000000000 100000000 ->   100000000\r
+xorx012 xor 100000000 000000000 ->   100000000\r
+xorx013 xor 100000000 100000000 ->           0\r
+xorx014 xor 000000000 000000000 ->           0\r
+xorx015 xor 000000000 010000000 ->    10000000\r
+xorx016 xor 010000000 000000000 ->    10000000\r
+xorx017 xor 010000000 010000000 ->           0\r
+\r
+-- Various lengths\r
+--        123456789     123456789      123456789\r
+xorx021 xor 111111111     111111111  ->  0\r
+xorx022 xor 111111111111  111111111  ->  0\r
+xorx023 xor  11111111      11111111  ->  0\r
+xorx025 xor   1111111       1111111  ->  0\r
+xorx026 xor    111111        111111  ->  0\r
+xorx027 xor     11111         11111  ->  0\r
+xorx028 xor      1111          1111  ->  0\r
+xorx029 xor       111           111  ->  0\r
+xorx031 xor        11            11  ->  0\r
+xorx032 xor         1             1  ->  0\r
+xorx033 xor 111111111111 1111111111  ->  0\r
+xorx034 xor 11111111111 11111111111  ->  0\r
+xorx035 xor 1111111111 111111111111  ->  0\r
+xorx036 xor 111111111 1111111111111  ->  0\r
+\r
+xorx040 xor 111111111  111111111111  ->  0\r
+xorx041 xor  11111111  111111111111  ->  100000000\r
+xorx042 xor  11111111     111111111  ->  100000000\r
+xorx043 xor   1111111     100000010  ->  101111101\r
+xorx044 xor    111111     100000100  ->  100111011\r
+xorx045 xor     11111     100001000  ->  100010111\r
+xorx046 xor      1111     100010000  ->  100011111\r
+xorx047 xor       111     100100000  ->  100100111\r
+xorx048 xor        11     101000000  ->  101000011\r
+xorx049 xor         1     110000000  ->  110000001\r
+\r
+xorx050 xor 1111111111  1  ->  111111110\r
+xorx051 xor  111111111  1  ->  111111110\r
+xorx052 xor   11111111  1  ->  11111110\r
+xorx053 xor    1111111  1  ->  1111110\r
+xorx054 xor     111111  1  ->  111110\r
+xorx055 xor      11111  1  ->  11110\r
+xorx056 xor       1111  1  ->  1110\r
+xorx057 xor        111  1  ->  110\r
+xorx058 xor         11  1  ->  10\r
+xorx059 xor          1  1  ->  0\r
+\r
+xorx060 xor 1111111111  0  ->  111111111\r
+xorx061 xor  111111111  0  ->  111111111\r
+xorx062 xor   11111111  0  ->  11111111\r
+xorx063 xor    1111111  0  ->  1111111\r
+xorx064 xor     111111  0  ->  111111\r
+xorx065 xor      11111  0  ->  11111\r
+xorx066 xor       1111  0  ->  1111\r
+xorx067 xor        111  0  ->  111\r
+xorx068 xor         11  0  ->  11\r
+xorx069 xor          1  0  ->  1\r
+\r
+xorx070 xor 1  1111111111  ->  111111110\r
+xorx071 xor 1   111111111  ->  111111110\r
+xorx072 xor 1    11111111  ->  11111110\r
+xorx073 xor 1     1111111  ->  1111110\r
+xorx074 xor 1      111111  ->  111110\r
+xorx075 xor 1       11111  ->  11110\r
+xorx076 xor 1        1111  ->  1110\r
+xorx077 xor 1         111  ->  110\r
+xorx078 xor 1          11  ->  10\r
+xorx079 xor 1           1  ->  0\r
+\r
+xorx080 xor 0  1111111111  ->  111111111\r
+xorx081 xor 0   111111111  ->  111111111\r
+xorx082 xor 0    11111111  ->  11111111\r
+xorx083 xor 0     1111111  ->  1111111\r
+xorx084 xor 0      111111  ->  111111\r
+xorx085 xor 0       11111  ->  11111\r
+xorx086 xor 0        1111  ->  1111\r
+xorx087 xor 0         111  ->  111\r
+xorx088 xor 0          11  ->  11\r
+xorx089 xor 0           1  ->  1\r
+\r
+xorx090 xor 011111111  111101111  ->  100010000\r
+xorx091 xor 101111111  111101111  ->   10010000\r
+xorx092 xor 110111111  111101111  ->    1010000\r
+xorx093 xor 111011111  111101111  ->     110000\r
+xorx094 xor 111101111  111101111  ->          0\r
+xorx095 xor 111110111  111101111  ->      11000\r
+xorx096 xor 111111011  111101111  ->      10100\r
+xorx097 xor 111111101  111101111  ->      10010\r
+xorx098 xor 111111110  111101111  ->      10001\r
+\r
+xorx100 xor 111101111  011111111  ->  100010000\r
+xorx101 xor 111101111  101111111  ->   10010000\r
+xorx102 xor 111101111  110111111  ->    1010000\r
+xorx103 xor 111101111  111011111  ->     110000\r
+xorx104 xor 111101111  111101111  ->          0\r
+xorx105 xor 111101111  111110111  ->      11000\r
+xorx106 xor 111101111  111111011  ->      10100\r
+xorx107 xor 111101111  111111101  ->      10010\r
+xorx108 xor 111101111  111111110  ->      10001\r
+\r
+-- non-0/1 should not be accepted, nor should signs\r
+xorx220 xor 111111112  111111111  ->  NaN Invalid_operation\r
+xorx221 xor 333333333  333333333  ->  NaN Invalid_operation\r
+xorx222 xor 555555555  555555555  ->  NaN Invalid_operation\r
+xorx223 xor 777777777  777777777  ->  NaN Invalid_operation\r
+xorx224 xor 999999999  999999999  ->  NaN Invalid_operation\r
+xorx225 xor 222222222  999999999  ->  NaN Invalid_operation\r
+xorx226 xor 444444444  999999999  ->  NaN Invalid_operation\r
+xorx227 xor 666666666  999999999  ->  NaN Invalid_operation\r
+xorx228 xor 888888888  999999999  ->  NaN Invalid_operation\r
+xorx229 xor 999999999  222222222  ->  NaN Invalid_operation\r
+xorx230 xor 999999999  444444444  ->  NaN Invalid_operation\r
+xorx231 xor 999999999  666666666  ->  NaN Invalid_operation\r
+xorx232 xor 999999999  888888888  ->  NaN Invalid_operation\r
+-- a few randoms\r
+xorx240 xor  567468689 -934981942 ->  NaN Invalid_operation\r
+xorx241 xor  567367689  934981942 ->  NaN Invalid_operation\r
+xorx242 xor -631917772 -706014634 ->  NaN Invalid_operation\r
+xorx243 xor -756253257  138579234 ->  NaN Invalid_operation\r
+xorx244 xor  835590149  567435400 ->  NaN Invalid_operation\r
+-- test MSD\r
+xorx250 xor  200000000 100000000 ->  NaN Invalid_operation\r
+xorx251 xor  700000000 100000000 ->  NaN Invalid_operation\r
+xorx252 xor  800000000 100000000 ->  NaN Invalid_operation\r
+xorx253 xor  900000000 100000000 ->  NaN Invalid_operation\r
+xorx254 xor  200000000 000000000 ->  NaN Invalid_operation\r
+xorx255 xor  700000000 000000000 ->  NaN Invalid_operation\r
+xorx256 xor  800000000 000000000 ->  NaN Invalid_operation\r
+xorx257 xor  900000000 000000000 ->  NaN Invalid_operation\r
+xorx258 xor  100000000 200000000 ->  NaN Invalid_operation\r
+xorx259 xor  100000000 700000000 ->  NaN Invalid_operation\r
+xorx260 xor  100000000 800000000 ->  NaN Invalid_operation\r
+xorx261 xor  100000000 900000000 ->  NaN Invalid_operation\r
+xorx262 xor  000000000 200000000 ->  NaN Invalid_operation\r
+xorx263 xor  000000000 700000000 ->  NaN Invalid_operation\r
+xorx264 xor  000000000 800000000 ->  NaN Invalid_operation\r
+xorx265 xor  000000000 900000000 ->  NaN Invalid_operation\r
+-- test MSD-1\r
+xorx270 xor  020000000 100000000 ->  NaN Invalid_operation\r
+xorx271 xor  070100000 100000000 ->  NaN Invalid_operation\r
+xorx272 xor  080010000 100000001 ->  NaN Invalid_operation\r
+xorx273 xor  090001000 100000010 ->  NaN Invalid_operation\r
+xorx274 xor  100000100 020010100 ->  NaN Invalid_operation\r
+xorx275 xor  100000000 070001000 ->  NaN Invalid_operation\r
+xorx276 xor  100000010 080010100 ->  NaN Invalid_operation\r
+xorx277 xor  100000000 090000010 ->  NaN Invalid_operation\r
+-- test LSD\r
+xorx280 xor  001000002 100000000 ->  NaN Invalid_operation\r
+xorx281 xor  000000007 100000000 ->  NaN Invalid_operation\r
+xorx282 xor  000000008 100000000 ->  NaN Invalid_operation\r
+xorx283 xor  000000009 100000000 ->  NaN Invalid_operation\r
+xorx284 xor  100000000 000100002 ->  NaN Invalid_operation\r
+xorx285 xor  100100000 001000007 ->  NaN Invalid_operation\r
+xorx286 xor  100010000 010000008 ->  NaN Invalid_operation\r
+xorx287 xor  100001000 100000009 ->  NaN Invalid_operation\r
+-- test Middie\r
+xorx288 xor  001020000 100000000 ->  NaN Invalid_operation\r
+xorx289 xor  000070001 100000000 ->  NaN Invalid_operation\r
+xorx290 xor  000080000 100010000 ->  NaN Invalid_operation\r
+xorx291 xor  000090000 100001000 ->  NaN Invalid_operation\r
+xorx292 xor  100000010 000020100 ->  NaN Invalid_operation\r
+xorx293 xor  100100000 000070010 ->  NaN Invalid_operation\r
+xorx294 xor  100010100 000080001 ->  NaN Invalid_operation\r
+xorx295 xor  100001000 000090000 ->  NaN Invalid_operation\r
+-- signs\r
+xorx296 xor -100001000 -000000000 ->  NaN Invalid_operation\r
+xorx297 xor -100001000  000010000 ->  NaN Invalid_operation\r
+xorx298 xor  100001000 -000000000 ->  NaN Invalid_operation\r
+xorx299 xor  100001000  000011000 ->  100010000\r
+\r
+-- Nmax, Nmin, Ntiny\r
+xorx331 xor  2   9.99999999E+999     -> NaN Invalid_operation\r
+xorx332 xor  3   1E-999              -> NaN Invalid_operation\r
+xorx333 xor  4   1.00000000E-999     -> NaN Invalid_operation\r
+xorx334 xor  5   1E-1007             -> NaN Invalid_operation\r
+xorx335 xor  6   -1E-1007            -> NaN Invalid_operation\r
+xorx336 xor  7   -1.00000000E-999    -> NaN Invalid_operation\r
+xorx337 xor  8   -1E-999             -> NaN Invalid_operation\r
+xorx338 xor  9   -9.99999999E+999    -> NaN Invalid_operation\r
+xorx341 xor  9.99999999E+999     -18 -> NaN Invalid_operation\r
+xorx342 xor  1E-999               01 -> NaN Invalid_operation\r
+xorx343 xor  1.00000000E-999     -18 -> NaN Invalid_operation\r
+xorx344 xor  1E-1007              18 -> NaN Invalid_operation\r
+xorx345 xor  -1E-1007            -10 -> NaN Invalid_operation\r
+xorx346 xor  -1.00000000E-999     18 -> NaN Invalid_operation\r
+xorx347 xor  -1E-999              10 -> NaN Invalid_operation\r
+xorx348 xor  -9.99999999E+999    -18 -> NaN Invalid_operation\r
+\r
+-- A few other non-integers\r
+xorx361 xor  1.0                  1  -> NaN Invalid_operation\r
+xorx362 xor  1E+1                 1  -> NaN Invalid_operation\r
+xorx363 xor  0.0                  1  -> NaN Invalid_operation\r
+xorx364 xor  0E+1                 1  -> NaN Invalid_operation\r
+xorx365 xor  9.9                  1  -> NaN Invalid_operation\r
+xorx366 xor  9E+1                 1  -> NaN Invalid_operation\r
+xorx371 xor  0 1.0                   -> NaN Invalid_operation\r
+xorx372 xor  0 1E+1                  -> NaN Invalid_operation\r
+xorx373 xor  0 0.0                   -> NaN Invalid_operation\r
+xorx374 xor  0 0E+1                  -> NaN Invalid_operation\r
+xorx375 xor  0 9.9                   -> NaN Invalid_operation\r
+xorx376 xor  0 9E+1                  -> NaN Invalid_operation\r
+\r
+-- All Specials are in error\r
+xorx780 xor -Inf  -Inf   -> NaN Invalid_operation\r
+xorx781 xor -Inf  -1000  -> NaN Invalid_operation\r
+xorx782 xor -Inf  -1     -> NaN Invalid_operation\r
+xorx783 xor -Inf  -0     -> NaN Invalid_operation\r
+xorx784 xor -Inf   0     -> NaN Invalid_operation\r
+xorx785 xor -Inf   1     -> NaN Invalid_operation\r
+xorx786 xor -Inf   1000  -> NaN Invalid_operation\r
+xorx787 xor -1000 -Inf   -> NaN Invalid_operation\r
+xorx788 xor -Inf  -Inf   -> NaN Invalid_operation\r
+xorx789 xor -1    -Inf   -> NaN Invalid_operation\r
+xorx790 xor -0    -Inf   -> NaN Invalid_operation\r
+xorx791 xor  0    -Inf   -> NaN Invalid_operation\r
+xorx792 xor  1    -Inf   -> NaN Invalid_operation\r
+xorx793 xor  1000 -Inf   -> NaN Invalid_operation\r
+xorx794 xor  Inf  -Inf   -> NaN Invalid_operation\r
+\r
+xorx800 xor  Inf  -Inf   -> NaN Invalid_operation\r
+xorx801 xor  Inf  -1000  -> NaN Invalid_operation\r
+xorx802 xor  Inf  -1     -> NaN Invalid_operation\r
+xorx803 xor  Inf  -0     -> NaN Invalid_operation\r
+xorx804 xor  Inf   0     -> NaN Invalid_operation\r
+xorx805 xor  Inf   1     -> NaN Invalid_operation\r
+xorx806 xor  Inf   1000  -> NaN Invalid_operation\r
+xorx807 xor  Inf   Inf   -> NaN Invalid_operation\r
+xorx808 xor -1000  Inf   -> NaN Invalid_operation\r
+xorx809 xor -Inf   Inf   -> NaN Invalid_operation\r
+xorx810 xor -1     Inf   -> NaN Invalid_operation\r
+xorx811 xor -0     Inf   -> NaN Invalid_operation\r
+xorx812 xor  0     Inf   -> NaN Invalid_operation\r
+xorx813 xor  1     Inf   -> NaN Invalid_operation\r
+xorx814 xor  1000  Inf   -> NaN Invalid_operation\r
+xorx815 xor  Inf   Inf   -> NaN Invalid_operation\r
+\r
+xorx821 xor  NaN -Inf    -> NaN Invalid_operation\r
+xorx822 xor  NaN -1000   -> NaN Invalid_operation\r
+xorx823 xor  NaN -1      -> NaN Invalid_operation\r
+xorx824 xor  NaN -0      -> NaN Invalid_operation\r
+xorx825 xor  NaN  0      -> NaN Invalid_operation\r
+xorx826 xor  NaN  1      -> NaN Invalid_operation\r
+xorx827 xor  NaN  1000   -> NaN Invalid_operation\r
+xorx828 xor  NaN  Inf    -> NaN Invalid_operation\r
+xorx829 xor  NaN  NaN    -> NaN Invalid_operation\r
+xorx830 xor -Inf  NaN    -> NaN Invalid_operation\r
+xorx831 xor -1000 NaN    -> NaN Invalid_operation\r
+xorx832 xor -1    NaN    -> NaN Invalid_operation\r
+xorx833 xor -0    NaN    -> NaN Invalid_operation\r
+xorx834 xor  0    NaN    -> NaN Invalid_operation\r
+xorx835 xor  1    NaN    -> NaN Invalid_operation\r
+xorx836 xor  1000 NaN    -> NaN Invalid_operation\r
+xorx837 xor  Inf  NaN    -> NaN Invalid_operation\r
+\r
+xorx841 xor  sNaN -Inf   ->  NaN  Invalid_operation\r
+xorx842 xor  sNaN -1000  ->  NaN  Invalid_operation\r
+xorx843 xor  sNaN -1     ->  NaN  Invalid_operation\r
+xorx844 xor  sNaN -0     ->  NaN  Invalid_operation\r
+xorx845 xor  sNaN  0     ->  NaN  Invalid_operation\r
+xorx846 xor  sNaN  1     ->  NaN  Invalid_operation\r
+xorx847 xor  sNaN  1000  ->  NaN  Invalid_operation\r
+xorx848 xor  sNaN  NaN   ->  NaN  Invalid_operation\r
+xorx849 xor  sNaN sNaN   ->  NaN  Invalid_operation\r
+xorx850 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+xorx851 xor -Inf  sNaN   ->  NaN  Invalid_operation\r
+xorx852 xor -1000 sNaN   ->  NaN  Invalid_operation\r
+xorx853 xor -1    sNaN   ->  NaN  Invalid_operation\r
+xorx854 xor -0    sNaN   ->  NaN  Invalid_operation\r
+xorx855 xor  0    sNaN   ->  NaN  Invalid_operation\r
+xorx856 xor  1    sNaN   ->  NaN  Invalid_operation\r
+xorx857 xor  1000 sNaN   ->  NaN  Invalid_operation\r
+xorx858 xor  Inf  sNaN   ->  NaN  Invalid_operation\r
+xorx859 xor  NaN  sNaN   ->  NaN  Invalid_operation\r
+\r
+-- propagating NaNs\r
+xorx861 xor  NaN1   -Inf    -> NaN Invalid_operation\r
+xorx862 xor +NaN2   -1000   -> NaN Invalid_operation\r
+xorx863 xor  NaN3    1000   -> NaN Invalid_operation\r
+xorx864 xor  NaN4    Inf    -> NaN Invalid_operation\r
+xorx865 xor  NaN5   +NaN6   -> NaN Invalid_operation\r
+xorx866 xor -Inf     NaN7   -> NaN Invalid_operation\r
+xorx867 xor -1000    NaN8   -> NaN Invalid_operation\r
+xorx868 xor  1000    NaN9   -> NaN Invalid_operation\r
+xorx869 xor  Inf    +NaN10  -> NaN Invalid_operation\r
+xorx871 xor  sNaN11  -Inf   -> NaN Invalid_operation\r
+xorx872 xor  sNaN12  -1000  -> NaN Invalid_operation\r
+xorx873 xor  sNaN13   1000  -> NaN Invalid_operation\r
+xorx874 xor  sNaN14   NaN17 -> NaN Invalid_operation\r
+xorx875 xor  sNaN15  sNaN18 -> NaN Invalid_operation\r
+xorx876 xor  NaN16   sNaN19 -> NaN Invalid_operation\r
+xorx877 xor -Inf    +sNaN20 -> NaN Invalid_operation\r
+xorx878 xor -1000    sNaN21 -> NaN Invalid_operation\r
+xorx879 xor  1000    sNaN22 -> NaN Invalid_operation\r
+xorx880 xor  Inf     sNaN23 -> NaN Invalid_operation\r
+xorx881 xor +NaN25  +sNaN24 -> NaN Invalid_operation\r
+xorx882 xor -NaN26    NaN28 -> NaN Invalid_operation\r
+xorx883 xor -sNaN27  sNaN29 -> NaN Invalid_operation\r
+xorx884 xor  1000    -NaN30 -> NaN Invalid_operation\r
+xorx885 xor  1000   -sNaN31 -> NaN Invalid_operation\r
index 841ea6fc068e8248fd6677bdcfdb143a5728a876..bc299ec5ecc4ce9af464908c7114508dbb80c094 100644 (file)
@@ -65,9 +65,7 @@ skip_expected = not os.path.isdir(directory)
 # Slower, since it runs some things several times.
 EXTENDEDERRORTEST = False
 
-
 #Map the test cases' error names to the actual errors
-
 ErrorNames = {'clamped' : Clamped,
               'conversion_syntax' : InvalidOperation,
               'division_by_zero' : DivisionByZero,
@@ -92,20 +90,62 @@ RoundingDict = {'ceiling' : ROUND_CEILING, #Maps test-case names to roundings.
                 'half_down' : ROUND_HALF_DOWN,
                 'half_even' : ROUND_HALF_EVEN,
                 'half_up' : ROUND_HALF_UP,
-                'up' : ROUND_UP}
+                'up' : ROUND_UP,
+                '05up' : ROUND_05UP}
 
 # Name adapter to be able to change the Decimal and Context
 # interface without changing the test files from Cowlishaw
 nameAdapter = {'toeng':'to_eng_string',
                'tosci':'to_sci_string',
                'samequantum':'same_quantum',
-               'tointegral':'to_integral',
+               'tointegral':'to_integral_value',
+               'tointegralx':'to_integral_exact',
                'remaindernear':'remainder_near',
                'divideint':'divide_int',
                'squareroot':'sqrt',
                'apply':'_apply',
+               'class':'number_class',
+               'comparesig':'compare_signal',
+               'comparetotal':'compare_total',
+               'comparetotmag':'compare_total_mag',
+               'copyabs':'copy_abs',
+               'copy':'copy_decimal',
+               'copynegate':'copy_negate',
+               'copysign':'copy_sign',
+               'and':'logical_and',
+               'or':'logical_or',
+               'xor':'logical_xor',
+               'invert':'logical_invert',
+               'maxmag':'max_mag',
+               'minmag':'min_mag',
+               'nextminus':'next_minus',
+               'nextplus':'next_plus',
+               'nexttoward':'next_toward',
+               'reduce':'normalize',
               }
 
+# For some operations (currently exp, ln, log10, power), the decNumber
+# reference implementation imposes additional restrictions on the
+# context and operands.  These restrictions are not part of the
+# specification; however, the effect of these restrictions does show
+# up in some of the testcases.  We skip testcases that violate these
+# restrictions, since Decimal behaves differently from decNumber for
+# these testcases so these testcases would otherwise fail.
+
+decNumberRestricted = ('power', 'ln', 'log10', 'exp')
+DEC_MAX_MATH = 999999
+def outside_decNumber_bounds(v, context):
+    if (context.prec > DEC_MAX_MATH or
+        context.Emax > DEC_MAX_MATH or
+        -context.Emin > DEC_MAX_MATH):
+        return True
+    if not v._is_special and v and (
+        len(v._int) > DEC_MAX_MATH or
+        v.adjusted() > DEC_MAX_MATH or
+        v.adjusted() < 1-2*DEC_MAX_MATH):
+        return True
+    return False
+
 class DecimalTest(unittest.TestCase):
     """Class which tests the Decimal class against the test cases.
 
@@ -142,10 +182,6 @@ class DecimalTest(unittest.TestCase):
             #print line
             try:
                 t = self.eval_line(line)
-            except InvalidOperation:
-                print 'Error in test cases:'
-                print line
-                continue
             except DecimalException, exception:
                 #Exception raised where there shoudn't have been one.
                 self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
@@ -194,7 +230,8 @@ class DecimalTest(unittest.TestCase):
             Sides = s.split('->')
             L = Sides[0].strip().split()
             id = L[0]
-#            print id,
+            if DEBUG:
+                print "Test ", id,
             funct = L[1].lower()
             valstemp = L[2:]
             L = Sides[1].strip().split()
@@ -246,11 +283,27 @@ class DecimalTest(unittest.TestCase):
                         self.context.traps[error] = 0
                 v = self.context.create_decimal(v)
             else:
-                v = Decimal(v)
+                v = Decimal(v, self.context)
             vals.append(v)
 
         ans = FixQuotes(ans)
 
+        # skip tests that are related to bounds imposed in the decNumber
+        # reference implementation
+        if fname in decNumberRestricted:
+            if fname == 'power':
+                if not (vals[1]._isinteger() and
+                        -1999999997 <= vals[1] <= 999999999):
+                    if outside_decNumber_bounds(vals[0], self.context) or \
+                            outside_decNumber_bounds(vals[1], self.context):
+                        #print "Skipping test %s" % s
+                        return
+            else:
+                if outside_decNumber_bounds(vals[0], self.context):
+                    #print "Skipping test %s" % s
+                    return
+
+
         if EXTENDEDERRORTEST and fname not in ('to_sci_string', 'to_eng_string'):
             for error in theirexceptions:
                 self.context.traps[error] = 1
@@ -264,6 +317,8 @@ class DecimalTest(unittest.TestCase):
                 else:
                     self.fail("Did not raise %s in %s" % (error, s))
                 self.context.traps[error] = 0
+        if DEBUG:
+            print "--", self.context
         try:
             result = str(funct(*vals))
             if fname == 'same_quantum':
@@ -283,8 +338,7 @@ class DecimalTest(unittest.TestCase):
         self.assertEqual(result, ans,
                          'Incorrect answer for ' + s + ' -- got ' + result)
         self.assertEqual(myexceptions, theirexceptions,
-                         'Incorrect flags set in ' + s + ' -- got ' \
-                         + str(myexceptions))
+              'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions))
         return
 
     def getexceptions(self):
@@ -301,17 +355,6 @@ class DecimalTest(unittest.TestCase):
     def change_clamp(self, clamp):
         self.context._clamp = clamp
 
-# Dynamically build custom test definition for each file in the test
-# directory and add the definitions to the DecimalTest class.  This
-# procedure insures that new files do not get skipped.
-for filename in os.listdir(directory):
-    if '.decTest' not in filename:
-        continue
-    head, tail = filename.split('.')
-    tester = lambda self, f=filename: self.eval_file(directory + f)
-    setattr(DecimalTest, 'test_' + head, tester)
-    del filename, head, tail, tester
-
 
 
 # The following classes test the behaviour of Decimal according to PEP 327
@@ -853,6 +896,10 @@ class DecimalUsabilityTest(unittest.TestCase):
         a.sort()
         self.assertEqual(a, b)
 
+        # with None
+        self.assertFalse(Decimal(1) < None)
+        self.assertTrue(Decimal(1) > None)
+
     def test_copy_and_deepcopy_methods(self):
         d = Decimal('43.24')
         c = copy.copy(d)
@@ -960,8 +1007,8 @@ class DecimalUsabilityTest(unittest.TestCase):
 
         d1 = Decimal('-25e55')
         b1 = Decimal('-25e55')
-        d2 = Decimal('33e-33')
-        b2 = Decimal('33e-33')
+        d2 = Decimal('33e+33')
+        b2 = Decimal('33e+33')
 
         def checkSameDec(operation, useOther=False):
             if useOther:
@@ -1091,7 +1138,59 @@ class WithStatementTest(unittest.TestCase):
         self.assert_(new_ctx is not set_ctx, 'did not copy the context')
         self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
 
-def test_main(arith=False, verbose=None):
+class ContextFlags(unittest.TestCase):
+    def test_flags_irrelevant(self):
+        # check that the result (numeric result + flags raised) of an
+        # arithmetic operation doesn't depend on the current flags
+
+        context = Context(prec=9, Emin = -999999999, Emax = 999999999,
+                    rounding=ROUND_HALF_EVEN, traps=[], flags=[])
+
+        # operations that raise various flags, in the form (function, arglist)
+        operations = [
+            (context._apply, [Decimal("100E-1000000009")]),
+            (context.sqrt, [Decimal(2)]),
+            (context.add, [Decimal("1.23456789"), Decimal("9.87654321")]),
+            (context.multiply, [Decimal("1.23456789"), Decimal("9.87654321")]),
+            (context.subtract, [Decimal("1.23456789"), Decimal("9.87654321")]),
+            ]
+
+        # try various flags individually, then a whole lot at once
+        flagsets = [[Inexact], [Rounded], [Underflow], [Clamped], [Subnormal],
+                    [Inexact, Rounded, Underflow, Clamped, Subnormal]]
+
+        for fn, args in operations:
+            # find answer and flags raised using a clean context
+            context.clear_flags()
+            ans = fn(*args)
+            flags = [k for k, v in context.flags.items() if v]
+
+            for extra_flags in flagsets:
+                # set flags, before calling operation
+                context.clear_flags()
+                for flag in extra_flags:
+                    context._raise_error(flag)
+                new_ans = fn(*args)
+
+                # flags that we expect to be set after the operation
+                expected_flags = list(flags)
+                for flag in extra_flags:
+                    if flag not in expected_flags:
+                        expected_flags.append(flag)
+                expected_flags.sort()
+
+                # flags we actually got
+                new_flags = [k for k,v in context.flags.items() if v]
+                new_flags.sort()
+
+                self.assertEqual(ans, new_ans,
+                                 "operation produces different answers depending on flags set: " +
+                                 "expected %s, got %s." % (ans, new_ans))
+                self.assertEqual(new_flags, expected_flags,
+                                  "operation raises different flags depending on flags set: " +
+                                  "expected %s, got %s" % (expected_flags, new_flags))
+
+def test_main(arith=False, verbose=None, todo_tests=None, debug=None):
     """ Execute the tests.
 
     Runs all arithmetic tests if arith is True or if the "decimal" resource
@@ -1099,35 +1198,58 @@ def test_main(arith=False, verbose=None):
     """
 
     init()
-    global TEST_ALL
+    global TEST_ALL, DEBUG
     TEST_ALL = arith or is_resource_enabled('decimal')
+    DEBUG = debug
+
+    if todo_tests is None:
+        test_classes = [
+            DecimalExplicitConstructionTest,
+            DecimalImplicitConstructionTest,
+            DecimalArithmeticOperatorsTest,
+            DecimalUseOfContextTest,
+            DecimalUsabilityTest,
+            DecimalPythonAPItests,
+            ContextAPItests,
+            DecimalTest,
+            WithStatementTest,
+            ContextFlags
+        ]
+    else:
+        test_classes = [DecimalTest]
+
+    # Dynamically build custom test definition for each file in the test
+    # directory and add the definitions to the DecimalTest class.  This
+    # procedure insures that new files do not get skipped.
+    for filename in os.listdir(directory):
+        if '.decTest' not in filename or filename.startswith("."):
+            continue
+        head, tail = filename.split('.')
+        if todo_tests is not None and head not in todo_tests:
+            continue
+        tester = lambda self, f=filename: self.eval_file(directory + f)
+        setattr(DecimalTest, 'test_' + head, tester)
+        del filename, head, tail, tester
 
-    test_classes = [
-        DecimalExplicitConstructionTest,
-        DecimalImplicitConstructionTest,
-        DecimalArithmeticOperatorsTest,
-        DecimalUseOfContextTest,
-        DecimalUsabilityTest,
-        DecimalPythonAPItests,
-        ContextAPItests,
-        DecimalTest,
-        WithStatementTest,
-    ]
 
     try:
         run_unittest(*test_classes)
-        import decimal as DecimalModule
-        run_doctest(DecimalModule, verbose)
+        if todo_tests is None:
+            import decimal as DecimalModule
+            run_doctest(DecimalModule, verbose)
     finally:
         setcontext(ORIGINAL_CONTEXT)
 
 if __name__ == '__main__':
-    # Calling with no arguments runs all tests.
-    # Calling with "Skip" will skip over 90% of the arithmetic tests.
-    if len(sys.argv) == 1:
-        test_main(arith=True, verbose=True)
-    elif len(sys.argv) == 2:
-        arith = sys.argv[1].lower() != 'skip'
-        test_main(arith=arith, verbose=True)
+    import optparse
+    p = optparse.OptionParser("test_decimal.py [--debug] [{--skip | test1 [test2 [...]]}]")
+    p.add_option('--debug', '-d', action='store_true', help='shows the test number and context before each test')
+    p.add_option('--skip',  '-s', action='store_true', help='skip over 90% of the arithmetic tests')
+    (opt, args) = p.parse_args()
+
+    if opt.skip:
+        test_main(arith=False, verbose=True)
+    elif args:
+        test_main(arith=True, verbose=True, todo_tests=args, debug=opt.debug)
     else:
-        raise ValueError("test called with wrong arguments, use test_Decimal [Skip]")
+        test_main(arith=True, verbose=True)