Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r58096 | brett.cannon | 2007-09-10 23:38:27 +0200 (Mon, 10 Sep 2007) | 4 lines Fix a possible segfault from recursing too deep to get the repr of a list. Closes issue #1096. ........ r58097 | bill.janssen | 2007-09-10 23:51:02 +0200 (Mon, 10 Sep 2007) | 33 lines More work on SSL support. * Much expanded test suite: All protocols tested against all other protocols. All protocols tested with all certificate options. Tests for bad key and bad cert. Test of STARTTLS functionality. Test of RAND_* functions. * Fixes for threading/malloc bug. * Issue 1065 fixed: sslsocket class renamed to SSLSocket. sslerror class renamed to SSLError. Function "wrap_socket" now used to wrap an existing socket. * Issue 1583946 finally fixed: Support for subjectAltName added. Subject name now returned as proper DN list of RDNs. * SSLError exported from socket as "sslerror". * RAND_* functions properly exported from ssl.py. * Documentation improved: Example of how to create a self-signed certificate. Better indexing. ........ r58098 | guido.van.rossum | 2007-09-11 00:02:25 +0200 (Tue, 11 Sep 2007) | 9 lines Patch # 1140 (my code, approved by Effbot). Make sure the type of the return value of re.sub(x, y, z) is the type of y+x (i.e. unicode if either is unicode, str if they are both str) even if there are no substitutions or if x==z (which triggered various special cases in join_list()). Could be backported to 2.5; no need to port to 3.0. ........ r58099 | guido.van.rossum | 2007-09-11 00:36:02 +0200 (Tue, 11 Sep 2007) | 8 lines Patch # 1026 by Benjamin Aranguren (with Alex Martelli): Backport abc.py and isinstance/issubclass overloading to 2.6. I had to backport test_typechecks.py myself, and make one small change to abc.py to avoid duplicate work when x.__class__ and type(x) are the same. ........ r58100 | bill.janssen | 2007-09-11 01:41:24 +0200 (Tue, 11 Sep 2007) | 3 lines A better way of finding an open port to test with. ........ r58101 | bill.janssen | 2007-09-11 03:09:19 +0200 (Tue, 11 Sep 2007) | 4 lines Make sure test_ssl doesn't reference the ssl module in a context where it can't be imported. ........ r58102 | bill.janssen | 2007-09-11 04:42:07 +0200 (Tue, 11 Sep 2007) | 3 lines Fix some documentation bugs. ........ r58103 | nick.coghlan | 2007-09-11 16:01:18 +0200 (Tue, 11 Sep 2007) | 1 line Always use the -E flag when spawning subprocesses in test_cmd_line (Issue 1056) ........ r58106 | thomas.heller | 2007-09-11 21:17:48 +0200 (Tue, 11 Sep 2007) | 3 lines Disable some tests that fail on the 'ppc Debian unstable' buildbot to find out if they cause the segfault on the 'alpha Debian' machine. ........ r58108 | brett.cannon | 2007-09-11 23:02:28 +0200 (Tue, 11 Sep 2007) | 6 lines Generators had their throw() method allowing string exceptions. That's a no-no. Fixes issue #1147. Need to fix 2.5 to raise a proper warning if a string exception is passed in. ........ r58112 | georg.brandl | 2007-09-12 20:03:51 +0200 (Wed, 12 Sep 2007) | 3 lines New documentation page for the bdb module. (This doesn't need to be merged to Py3k.) ........ r58114 | georg.brandl | 2007-09-12 20:05:57 +0200 (Wed, 12 Sep 2007) | 2 lines Bug #1152: use non-deprecated name in example. ........ r58115 | georg.brandl | 2007-09-12 20:08:33 +0200 (Wed, 12 Sep 2007) | 2 lines Fix #1122: wrong return type documented for various _Size() functions. ........ r58117 | georg.brandl | 2007-09-12 20:10:56 +0200 (Wed, 12 Sep 2007) | 2 lines Fix #1139: PyFile_Encoding really is PyFile_SetEncoding. ........ r58119 | georg.brandl | 2007-09-12 20:29:18 +0200 (Wed, 12 Sep 2007) | 2 lines bug #1154: release memory allocated by "es" PyArg_ParseTuple format specifier. ........ r58121 | bill.janssen | 2007-09-12 20:52:05 +0200 (Wed, 12 Sep 2007) | 1 line root certificate for https://svn.python.org/, used in test_ssl ........ r58122 | georg.brandl | 2007-09-12 21:00:07 +0200 (Wed, 12 Sep 2007) | 3 lines Bug #1153: repr.repr() now doesn't require set and dictionary items to be orderable to properly represent them. ........ r58125 | georg.brandl | 2007-09-12 21:29:28 +0200 (Wed, 12 Sep 2007) | 4 lines #1120: put explicit version in the shebang lines of pydoc, idle and smtpd.py scripts that are installed by setup.py. That way, they work when only "make altinstall" is used. ........ r58139 | mark.summerfield | 2007-09-13 16:54:30 +0200 (Thu, 13 Sep 2007) | 9 lines Replaced variable o with obj in operator.rst because o is easy to confuse. Added a note about Python 3's collections.Mapping etc., above section that describes isMappingType() etc. Added xrefs between os, os.path, fileinput, and open(). ........ r58143 | facundo.batista | 2007-09-13 20:13:15 +0200 (Thu, 13 Sep 2007) | 7 lines Merged the decimal-branch (revisions 54886 to 58140). Decimal is now 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. ........ r58145 | facundo.batista | 2007-09-13 20:42:09 +0200 (Thu, 13 Sep 2007) | 7 lines Put the parameter watchexp back in (changed watchexp from an int to a bool). Also second argument to watchexp is now converted to Decimal, just as with all the other two-argument operations. Thanks Mark Dickinson. ........ r58147 | andrew.kuchling | 2007-09-14 00:49:34 +0200 (Fri, 14 Sep 2007) | 1 line Add various items ........ r58148 | andrew.kuchling | 2007-09-14 00:50:10 +0200 (Fri, 14 Sep 2007) | 1 line Make target unique ........ r58154 | facundo.batista | 2007-09-14 20:58:34 +0200 (Fri, 14 Sep 2007) | 3 lines Included the new functions, and new descriptions. ........ r58155 | thomas.heller | 2007-09-14 21:40:35 +0200 (Fri, 14 Sep 2007) | 2 lines ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris. Fixes issue #1777530; will backport to release25-maint. ........ r58159 | facundo.batista | 2007-09-14 23:29:52 +0200 (Fri, 14 Sep 2007) | 3 lines Some additions (examples and a bit on the tutorial). ........ r58160 | georg.brandl | 2007-09-15 18:53:36 +0200 (Sat, 15 Sep 2007) | 2 lines Remove bdb from the "undocumented modules" list. ........ r58164 | bill.janssen | 2007-09-17 00:06:00 +0200 (Mon, 17 Sep 2007) | 15 lines Add support for asyncore server-side SSL support. This requires adding the 'makefile' method to ssl.SSLSocket, and importing the requisite fakefile class from socket.py, and making the appropriate changes to it to make it use the SSL connection. Added sample HTTPS server to test_ssl.py, and test that uses it. Change SSL tests to use https://svn.python.org/, instead of www.sf.net and pop.gmail.com. Added utility function to ssl module, get_server_certificate, to wrap up the several things to be done to pull a certificate from a remote server. ........ r58173 | bill.janssen | 2007-09-17 01:16:46 +0200 (Mon, 17 Sep 2007) | 1 line use binary mode when reading files for testAsyncore to make Windows happy ........ r58175 | raymond.hettinger | 2007-09-17 02:55:00 +0200 (Mon, 17 Sep 2007) | 7 lines Sync-up named tuples with the latest version of the ASPN recipe. Allows optional commas in the field-name spec (help when named tuples are used in conjuction with sql queries). Adds the __fields__ attribute for introspection and to support conversion to dictionary form. Adds a __replace__() method similar to str.replace() but using a named field as a target. Clean-up spelling and presentation in doc-strings. ........ r58176 | brett.cannon | 2007-09-17 05:28:34 +0200 (Mon, 17 Sep 2007) | 5 lines Add a bunch of GIL release/acquire points in tp_print implementations and for PyObject_Print(). Closes issue #1164. ........ r58177 | sean.reifschneider | 2007-09-17 07:45:04 +0200 (Mon, 17 Sep 2007) | 2 lines issue1597011: Fix for bz2 module corner-case error due to error checking bug. ........ r58180 | facundo.batista | 2007-09-17 18:26:50 +0200 (Mon, 17 Sep 2007) | 3 lines Decimal is updated, :) ........ r58181 | facundo.batista | 2007-09-17 19:30:13 +0200 (Mon, 17 Sep 2007) | 5 lines The methods always return Decimal classes, even if they're executed through a subclass (thanks Mark Dickinson). Added a bit of testing for this. ........ r58183 | sean.reifschneider | 2007-09-17 22:53:21 +0200 (Mon, 17 Sep 2007) | 2 lines issue1082: Fixing platform and system for Vista. ........ r58185 | andrew.kuchling | 2007-09-18 03:36:16 +0200 (Tue, 18 Sep 2007) | 1 line Add item; sort properly ........ r58186 | raymond.hettinger | 2007-09-18 05:33:19 +0200 (Tue, 18 Sep 2007) | 1 line Handle corner cased on 0-tuples and 1-tuples. Add verbose option so people can see how it works. ........ r58192 | georg.brandl | 2007-09-18 09:24:40 +0200 (Tue, 18 Sep 2007) | 2 lines A bit of reordering, also show more subheadings in the lang ref index. ........ r58193 | facundo.batista | 2007-09-18 18:53:18 +0200 (Tue, 18 Sep 2007) | 4 lines Speed up of the various division operations (remainder, divide, divideint and divmod). Thanks Mark Dickinson. ........ r58197 | raymond.hettinger | 2007-09-19 00:18:02 +0200 (Wed, 19 Sep 2007) | 1 line Cleanup docs for NamedTuple. ........
This commit is contained in:
parent
782d6b44a1
commit
1b7f891f41
|
@ -1953,12 +1953,12 @@ Tuple Objects
|
|||
``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue("(OO)", a, b)``.
|
||||
|
||||
|
||||
.. cfunction:: int PyTuple_Size(PyObject *p)
|
||||
.. cfunction:: Py_ssize_t PyTuple_Size(PyObject *p)
|
||||
|
||||
Take a pointer to a tuple object, and return the size of that tuple.
|
||||
|
||||
|
||||
.. cfunction:: int PyTuple_GET_SIZE(PyObject *p)
|
||||
.. cfunction:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
|
||||
|
||||
Return the size of the tuple *p*, which must be non-*NULL* and point to a tuple;
|
||||
no error checking is performed.
|
||||
|
@ -2458,7 +2458,7 @@ change in future releases of Python.
|
|||
immediately after file object creation.
|
||||
|
||||
|
||||
.. cfunction:: int PyFile_Encoding(PyFileObject *p, char *enc)
|
||||
.. cfunction:: int PyFile_SetEncoding(PyFileObject *p, const char *enc)
|
||||
|
||||
Set the file's encoding for Unicode output to *enc*. Return 1 on success and 0
|
||||
on failure.
|
||||
|
@ -3371,7 +3371,7 @@ The following functions and macros are available for instances of :class:`set`
|
|||
or :class:`frozenset` or instances of their subtypes.
|
||||
|
||||
|
||||
.. cfunction:: int PySet_Size(PyObject *anyset)
|
||||
.. cfunction:: Py_ssize_t PySet_Size(PyObject *anyset)
|
||||
|
||||
.. index:: builtin: len
|
||||
|
||||
|
@ -3380,7 +3380,7 @@ or :class:`frozenset` or instances of their subtypes.
|
|||
:class:`set`, :class:`frozenset`, or an instance of a subtype.
|
||||
|
||||
|
||||
.. cfunction:: int PySet_GET_SIZE(PyObject *anyset)
|
||||
.. cfunction:: Py_ssize_t PySet_GET_SIZE(PyObject *anyset)
|
||||
|
||||
Macro form of :cfunc:`PySet_Size` without error checking.
|
||||
|
||||
|
|
|
@ -395,11 +395,14 @@ Setting the :attr:`default_factory` to :class:`set` makes the
|
|||
|
||||
.. _named-tuple-factory:
|
||||
|
||||
:func:`NamedTuple` datatype factory function
|
||||
--------------------------------------------
|
||||
:func:`NamedTuple` factory function
|
||||
-----------------------------------
|
||||
|
||||
Named tuples assign meaning to each position in a tuple and allow for more readable,
|
||||
self-documenting code. They can be used wherever regular tuples are used, and
|
||||
they add the ability to access fields by name instead of position index.
|
||||
|
||||
.. function:: NamedTuple(typename, fieldnames)
|
||||
.. function:: NamedTuple(typename, fieldnames, [verbose])
|
||||
|
||||
Returns a new tuple subclass named *typename*. The new subclass is used to
|
||||
create tuple-like objects that have fields accessable by attribute lookup as
|
||||
|
@ -407,43 +410,88 @@ Setting the :attr:`default_factory` to :class:`set` makes the
|
|||
helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__`
|
||||
method which lists the tuple contents in a ``name=value`` format.
|
||||
|
||||
The *fieldnames* are specified in a single string and are separated by spaces.
|
||||
Any valid Python identifier may be used for a field name.
|
||||
The *fieldnames* are specified in a single string with each fieldname separated by
|
||||
a space and/or comma. Any valid Python identifier may be used for a field name.
|
||||
|
||||
Example::
|
||||
If *verbose* is true, the *NamedTuple* call will print the class definition.
|
||||
|
||||
>>> Point = NamedTuple('Point', 'x y')
|
||||
>>> Point.__doc__ # docstring for the new datatype
|
||||
'Point(x, y)'
|
||||
>>> p = Point(11, y=22) # instantiate with positional or keyword arguments
|
||||
>>> p[0] + p[1] # works just like the tuple (11, 22)
|
||||
33
|
||||
>>> x, y = p # unpacks just like a tuple
|
||||
>>> x, y
|
||||
(11, 22)
|
||||
>>> p.x + p.y # fields also accessable by name
|
||||
33
|
||||
>>> p # readable __repr__ with name=value style
|
||||
Point(x=11, y=22)
|
||||
*NamedTuple* instances do not have per-instance dictionaries, so they are
|
||||
lightweight, requiring no more memory than regular tuples.
|
||||
|
||||
The use cases are the same as those for tuples. The named factories assign
|
||||
meaning to each tuple position and allow for more readable, self-documenting
|
||||
code. Named tuples can also be used to assign field names to tuples returned
|
||||
by the :mod:`csv` or :mod:`sqlite3` modules. For example::
|
||||
Example::
|
||||
|
||||
from itertools import starmap
|
||||
import csv
|
||||
EmployeeRecord = NamedTuple('EmployeeRecord', 'name age title department paygrade')
|
||||
for record in starmap(EmployeeRecord, csv.reader(open("employees.csv", "rb"))):
|
||||
print(record)
|
||||
>>> Point = NamedTuple('Point', 'x y', True)
|
||||
class Point(tuple):
|
||||
'Point(x, y)'
|
||||
__slots__ = ()
|
||||
__fields__ = ('x', 'y')
|
||||
def __new__(cls, x, y):
|
||||
return tuple.__new__(cls, (x, y))
|
||||
def __repr__(self):
|
||||
return 'Point(x=%r, y=%r)' % self
|
||||
def __replace__(self, field, value):
|
||||
'Return a new Point object replacing one field with a new value'
|
||||
return Point(**dict(zip(('x', 'y'), self) + [(field, value)]))
|
||||
x = property(itemgetter(0))
|
||||
y = property(itemgetter(1))
|
||||
|
||||
To cast an individual record stored as :class:`list`, :class:`tuple`, or some
|
||||
other iterable type, use the star-operator [#]_ to unpack the values::
|
||||
>>> p = Point(11, y=22) # instantiate with positional or keyword arguments
|
||||
>>> p[0] + p[1] # indexable like the regular tuple (11, 22)
|
||||
33
|
||||
>>> x, y = p # unpack like a regular tuple
|
||||
>>> x, y
|
||||
(11, 22)
|
||||
>>> p.x + p.y # fields also accessable by name
|
||||
33
|
||||
>>> p # readable __repr__ with a name=value style
|
||||
Point(x=11, y=22)
|
||||
|
||||
>>> Color = NamedTuple('Color', 'name code')
|
||||
>>> m = dict(red=1, green=2, blue=3)
|
||||
>>> print(Color(*m.popitem()))
|
||||
Color(name='blue', code=3)
|
||||
Named tuples are especially useful for assigning field names to result tuples returned
|
||||
by the :mod:`csv` or :mod:`sqlite3` modules::
|
||||
|
||||
from itertools import starmap
|
||||
import csv
|
||||
EmployeeRecord = NamedTuple('EmployeeRecord', 'name age title department paygrade')
|
||||
for record in starmap(EmployeeRecord, csv.reader(open("employees.csv", "rb"))):
|
||||
print(emp.name, emp.title)
|
||||
|
||||
When casting a single record to a *NamedTuple*, use the star-operator [#]_ to unpack
|
||||
the values::
|
||||
|
||||
>>> t = [11, 22]
|
||||
>>> Point(*t) # the star-operator unpacks any iterable object
|
||||
Point(x=11, y=22)
|
||||
|
||||
In addition to the methods inherited from tuples, named tuples support
|
||||
an additonal method and an informational read-only attribute.
|
||||
|
||||
.. method:: somenamedtuple.replace(field, value)
|
||||
|
||||
Return a new instance of the named tuple replacing the named *field* with a new *value*::
|
||||
|
||||
>>> p = Point(x=11, y=22)
|
||||
>>> p.__replace__('x', 33)
|
||||
Point(x=33, y=22)
|
||||
|
||||
>>> for recordnum, record in inventory:
|
||||
... inventory[recordnum] = record.replace('total', record.price * record.quantity)
|
||||
|
||||
.. attribute:: somenamedtuple.__fields__
|
||||
|
||||
Return a tuple of strings listing the field names. This is useful for introspection,
|
||||
for converting a named tuple instance to a dictionary, and for combining named tuple
|
||||
types to create new named tuple types::
|
||||
|
||||
>>> p.__fields__ # view the field names
|
||||
('x', 'y')
|
||||
>>> dict(zip(p.__fields__, p)) # convert to a dictionary
|
||||
{'y': 22, 'x': 11}
|
||||
|
||||
>>> Color = NamedTuple('Color', 'red green blue')
|
||||
>>> pixel_fields = ' '.join(Point.__fields__ + Color.__fields__) # combine fields
|
||||
>>> Pixel = NamedTuple('Pixel', pixel_fields)
|
||||
>>> Pixel(11, 22, 128, 255, 0)
|
||||
Pixel(x=11, y=22, red=128, green=255, blue=0)'
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
|
||||
The :mod:`decimal` module provides support for decimal floating point
|
||||
arithmetic. It offers several advantages over the :class:`float()` datatype:
|
||||
arithmetic. It offers several advantages over the :class:`float` datatype:
|
||||
|
||||
* Decimal numbers can be represented exactly. In contrast, numbers like
|
||||
:const:`1.1` do not have an exact representation in binary floating point. End
|
||||
|
@ -22,7 +22,7 @@ arithmetic. It offers several advantages over the :class:`float()` datatype:
|
|||
:const:`1.1000000000000001` as it does with binary floating point.
|
||||
|
||||
* The exactness carries over into arithmetic. In decimal floating point, ``0.1
|
||||
+ 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating point, result
|
||||
+ 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating point, the result
|
||||
is :const:`5.5511151231257827e-017`. While near to zero, the differences
|
||||
prevent reliable equality testing and differences can accumulate. For this
|
||||
reason, decimal would be preferred in accounting applications which have strict
|
||||
|
@ -36,7 +36,7 @@ arithmetic. It offers several advantages over the :class:`float()` datatype:
|
|||
1.20`` gives :const:`1.5600`.
|
||||
|
||||
* Unlike hardware based binary floating point, the decimal module has a user
|
||||
settable precision (defaulting to 28 places) which can be as large as needed for
|
||||
alterable precision (defaulting to 28 places) which can be as large as needed for
|
||||
a given problem::
|
||||
|
||||
>>> getcontext().prec = 6
|
||||
|
@ -56,7 +56,7 @@ context for arithmetic, and signals.
|
|||
|
||||
A decimal number is immutable. It has a sign, coefficient digits, and an
|
||||
exponent. To preserve significance, the coefficient digits do not truncate
|
||||
trailing zeroes. Decimals also include special values such as
|
||||
trailing zeros. Decimals also include special values such as
|
||||
:const:`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also
|
||||
differentiates :const:`-0` from :const:`+0`.
|
||||
|
||||
|
@ -65,7 +65,7 @@ rules, limits on exponents, flags indicating the results of operations, and trap
|
|||
enablers which determine whether signals are treated as exceptions. Rounding
|
||||
options include :const:`ROUND_CEILING`, :const:`ROUND_DOWN`,
|
||||
:const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`,
|
||||
:const:`ROUND_HALF_UP`, and :const:`ROUND_UP`.
|
||||
:const:`ROUND_HALF_UP`, :const:`ROUND_UP`, and :const:`ROUND_05UP`.
|
||||
|
||||
Signals are groups of exceptional conditions arising during the course of
|
||||
computation. Depending on the needs of the application, signals may be ignored,
|
||||
|
@ -82,11 +82,11 @@ reset them before monitoring a calculation.
|
|||
|
||||
.. seealso::
|
||||
|
||||
IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic
|
||||
Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`_.
|
||||
* IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic
|
||||
Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`_.
|
||||
|
||||
IEEE standard 854-1987, `Unofficial IEEE 854 Text
|
||||
<http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html>`_.
|
||||
* IEEE standard 854-1987, `Unofficial IEEE 854 Text
|
||||
<http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html>`_.
|
||||
|
||||
.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
@ -123,6 +123,8 @@ representation error). Decimal numbers include special values such as
|
|||
Decimal("3.14")
|
||||
>>> Decimal(str(2.0 ** 0.5))
|
||||
Decimal("1.41421356237")
|
||||
>>> Decimal(2) ** Decimal("0.5")
|
||||
Decimal("1.414213562373095048801688724")
|
||||
>>> Decimal("NaN")
|
||||
Decimal("NaN")
|
||||
>>> Decimal("-Infinity")
|
||||
|
@ -172,6 +174,17 @@ floating point flying circus::
|
|||
>>> c % a
|
||||
Decimal("0.77")
|
||||
|
||||
And some mathematic functions are also available to Decimal::
|
||||
|
||||
>>> Decimal(2).sqrt()
|
||||
Decimal("1.414213562373095048801688724")
|
||||
>>> Decimal(1).exp()
|
||||
Decimal("2.718281828459045235360287471")
|
||||
>>> Decimal("10").ln()
|
||||
Decimal("2.302585092994045684017991455")
|
||||
>>> Decimal("10").log10()
|
||||
Decimal("1")
|
||||
|
||||
The :meth:`quantize` method rounds a number to a fixed exponent. This method is
|
||||
useful for monetary applications that often round results to a fixed number of
|
||||
places::
|
||||
|
@ -285,7 +298,7 @@ Decimal objects
|
|||
|
||||
The *context* precision does not affect how many digits are stored. That is
|
||||
determined exclusively by the number of digits in *value*. For example,
|
||||
``Decimal("3.00000")`` records all five zeroes even if the context precision is
|
||||
``Decimal("3.00000")`` records all five zeros even if the context precision is
|
||||
only three.
|
||||
|
||||
The purpose of the *context* argument is determining what to do if *value* is a
|
||||
|
@ -295,7 +308,7 @@ Decimal objects
|
|||
|
||||
Once constructed, :class:`Decimal` objects are immutable.
|
||||
|
||||
Decimal floating point objects share many properties with the other builtin
|
||||
Decimal floating point objects share many properties with the other built-in
|
||||
numeric types such as :class:`float` and :class:`int`. All of the usual math
|
||||
operations and special methods apply. Likewise, decimal objects can be copied,
|
||||
pickled, printed, used as dictionary keys, used as set elements, compared,
|
||||
|
@ -315,50 +328,363 @@ also have a number of specialized methods:
|
|||
|
||||
.. method:: Decimal.as_tuple()
|
||||
|
||||
Returns a tuple representation of the number: ``(sign, digittuple, exponent)``.
|
||||
Return a tuple representation of the number: ``(sign, digit_tuple, exponent)``.
|
||||
|
||||
|
||||
.. method:: Decimal.canonical()
|
||||
|
||||
Return the canonical encoding of the argument. Currently, the
|
||||
encoding of a :class:`Decimal` instance is always canonical, so
|
||||
this operation returns its argument unchanged.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.compare(other[, context])
|
||||
|
||||
Compares like :meth:`__cmp__` but returns a decimal instance::
|
||||
Compare the values of two Decimal instances. This operation
|
||||
behaves in the same way as the usual comparison method
|
||||
:meth:`__cmp__`, except that :meth:`compare` returns a Decimal
|
||||
instance rather than an integer, and if either operand is a NaN
|
||||
then the result is a NaN::
|
||||
|
||||
a or b is a NaN ==> Decimal("NaN")
|
||||
a < b ==> Decimal("-1")
|
||||
a == b ==> Decimal("0")
|
||||
a > b ==> Decimal("1")
|
||||
|
||||
.. method:: Decimal.compare_signal(other[, context])
|
||||
|
||||
This operation is identical to the :meth:`compare` method, except
|
||||
that all NaNs signal. That is, if neither operand is a signaling
|
||||
NaN then any quiet NaN operand is treated as though it were a
|
||||
signaling NaN.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.compare_total(other)
|
||||
|
||||
Compare two operands using their abstract representation rather
|
||||
than their numerical value. Similar to the :meth:`compare` method,
|
||||
but the result gives a total ordering on :class:`Decimal`
|
||||
instances. Two :class:`Decimal` instances with the same numeric
|
||||
value but different representations compare unequal in this
|
||||
ordering::
|
||||
|
||||
>>> Decimal("12.0").compare_total(Decimal("12"))
|
||||
Decimal("-1")
|
||||
|
||||
Quiet and signaling NaNs are also included in the total ordering.
|
||||
The result of this function is ``Decimal("0")`` if both operands
|
||||
have the same representation, ``Decimal("-1")`` if the first
|
||||
operand is lower in the total order than the second, and
|
||||
``Decimal("1")`` if the first operand is higher in the total order
|
||||
than the second operand. See the specification for details of the
|
||||
total order.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.compare_total_mag(other)
|
||||
|
||||
Compare two operands using their abstract representation rather
|
||||
than their value as in :meth:`compare_total`, but ignoring the sign
|
||||
of each operand. ``x.compare_total_mag(y)`` is equivalent to
|
||||
``x.copy_abs().compare_total(y.copy_abs())``.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.copy_abs()
|
||||
|
||||
Return the absolute value of the argument. This operation is
|
||||
unaffected by the context and is quiet: no flags are changed and no
|
||||
rounding is performed.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.copy_negate()
|
||||
|
||||
Return the negation of the argument. This operation is unaffected
|
||||
by the context and is quiet: no flags are changed and no rounding
|
||||
is performed.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.copy_sign(other)
|
||||
|
||||
Return a copy of the first operand with the sign set to be the
|
||||
same as the sign of the second operand. For example::
|
||||
|
||||
>>> Decimal("2.3").copy_sign(Decimal("-1.5"))
|
||||
Decimal("-2.3")
|
||||
|
||||
This operation is unaffected by the context and is quiet: no flags
|
||||
are changed and no rounding is performed.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.exp([context])
|
||||
|
||||
Return the value of the (natural) exponential function ``e**x`` at the
|
||||
given number. The result is correctly rounded using the
|
||||
:const:`ROUND_HALF_EVEN` rounding mode.
|
||||
|
||||
>>> Decimal(1).exp()
|
||||
Decimal("2.718281828459045235360287471")
|
||||
>>> Decimal(321).exp()
|
||||
Decimal("2.561702493119680037517373933E+139")
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.fma(other, third[, context])
|
||||
|
||||
Fused multiply-add. Return self*other+third with no rounding of
|
||||
the intermediate product self*other.
|
||||
|
||||
>>> Decimal(2).fma(3, 5)
|
||||
Decimal("11")
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.is_canonical()
|
||||
|
||||
Return :const:`True` if the argument is canonical and
|
||||
:const:`False` otherwise. Currently, a :class:`Decimal` instance
|
||||
is always canonical, so this operation always returns
|
||||
:const:`True`.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_finite()
|
||||
|
||||
Return :const:`True` if the argument is a finite number, and
|
||||
:const:`False` if the argument is an infinity or a NaN.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_infinite()
|
||||
|
||||
Return :const:`True` if the argument is either positive or
|
||||
negative infinity and :const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_nan()
|
||||
|
||||
Return :const:`True` if the argument is a (quiet or signaling)
|
||||
NaN and :const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_normal()
|
||||
|
||||
Return :const:`True` if the argument is a *normal* finite number.
|
||||
Return :const:`False` if the argument is zero, subnormal, infinite
|
||||
or a NaN.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_qnan()
|
||||
|
||||
Return :const:`True` if the argument is a quiet NaN, and
|
||||
:const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_signed()
|
||||
|
||||
Return :const:`True` if the argument has a negative sign and
|
||||
:const:`False` otherwise. Note that zeros and NaNs can both carry
|
||||
signs.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_snan()
|
||||
|
||||
Return :const:`True` if the argument is a signaling NaN and
|
||||
:const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_subnormal()
|
||||
|
||||
Return :const:`True` if the argument is subnormal, and
|
||||
:const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: is_zero()
|
||||
|
||||
Return :const:`True` if the argument is a (positive or negative)
|
||||
zero and :const:`False` otherwise.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.ln([context])
|
||||
|
||||
Return the natural (base e) logarithm of the operand. The result
|
||||
is correctly rounded using the :const:`ROUND_HALF_EVEN` rounding
|
||||
mode.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.log10([context])
|
||||
|
||||
Return the base ten logarithm of the operand. The result is
|
||||
correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method: Decimal.logb([context])
|
||||
|
||||
For a nonzero number, return the adjusted exponent of its operand
|
||||
as a :class:`Decimal` instance. If the operand is a zero then
|
||||
``Decimal("-Infinity")`` is returned and the
|
||||
:const:`DivisionByZero` flag is raised. If the operand is an
|
||||
infinity then ``Decimal("Infinity")`` is returned.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.logical_and(other[, context])
|
||||
|
||||
:meth:`logical_and` is a logical operation which takes two
|
||||
*logical operands* (see :ref:`logical_operands_label`). The result
|
||||
is the digit-wise ``and`` of the two operands.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.logical_invert(other[, context])
|
||||
|
||||
:meth:`logical_invert` is a logical operation. The argument must
|
||||
be a *logical operand* (see :ref:`logical_operands_label`). The
|
||||
result is the digit-wise inversion of the operand.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.logical_or(other[, context])
|
||||
|
||||
:meth:`logical_or` is a logical operation which takes two *logical
|
||||
operands* (see :ref:`logical_operands_label`). The result is the
|
||||
digit-wise ``or`` of the two operands.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.logical_xor(other[, context])
|
||||
|
||||
:meth:`logical_xor` is a logical operation which takes two
|
||||
*logical operands* (see :ref:`logical_operands_label`). The result
|
||||
is the digit-wise exclusive or of the two operands.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.max(other[, context])
|
||||
|
||||
Like ``max(self, other)`` except that the context rounding rule is applied
|
||||
before returning and that :const:`NaN` values are either signalled or ignored
|
||||
before returning and that :const:`NaN` values are either signaled or ignored
|
||||
(depending on the context and whether they are signaling or quiet).
|
||||
|
||||
.. method:: Decimal.max_mag(other[, context])
|
||||
|
||||
Similar to the :meth:`max` method, but the comparison is done using
|
||||
the absolute values of the operands.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.min(other[, context])
|
||||
|
||||
Like ``min(self, other)`` except that the context rounding rule is applied
|
||||
before returning and that :const:`NaN` values are either signalled or ignored
|
||||
before returning and that :const:`NaN` values are either signaled or ignored
|
||||
(depending on the context and whether they are signaling or quiet).
|
||||
|
||||
.. method:: Decimal.min_mag(other[, context])
|
||||
|
||||
Similar to the :meth:`min` method, but the comparison is done using
|
||||
the absolute values of the operands.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.next_minus([context])
|
||||
|
||||
Return the largest number representable in the given context (or
|
||||
in the current thread's context if no context is given) that is smaller
|
||||
than the given operand.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.next_plus([context])
|
||||
|
||||
Return the smallest number representable in the given context (or
|
||||
in the current thread's context if no context is given) that is
|
||||
larger than the given operand.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.next_toward(other[, context])
|
||||
|
||||
If the two operands are unequal, return the number closest to the
|
||||
first operand in the direction of the second operand. If both
|
||||
operands are numerically equal, return a copy of the first operand
|
||||
with the sign set to be the same as the sign of the second operand.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.normalize([context])
|
||||
|
||||
Normalize the number by stripping the rightmost trailing zeroes and converting
|
||||
Normalize the number by stripping the rightmost trailing zeros and converting
|
||||
any result equal to :const:`Decimal("0")` to :const:`Decimal("0e0")`. Used for
|
||||
producing canonical values for members of an equivalence class. For example,
|
||||
``Decimal("32.100")`` and ``Decimal("0.321000e+2")`` both normalize to the
|
||||
equivalent value ``Decimal("32.1")``.
|
||||
|
||||
.. method:: Decimal.number_class([context])
|
||||
|
||||
.. method:: Decimal.quantize(exp [, rounding[, context[, watchexp]]])
|
||||
Return a string describing the *class* of the operand. The
|
||||
returned value is one of the following ten strings.
|
||||
|
||||
Quantize makes the exponent the same as *exp*. Searches for a rounding method
|
||||
in *rounding*, then in *context*, and then in the current context.
|
||||
* ``"-Infinity"``, indicating that the operand is negative infinity.
|
||||
* ``"-Normal"``, indicating that the operand is a negative normal number.
|
||||
* ``"-Subnormal"``, indicating that the operand is negative and subnormal.
|
||||
* ``"-Zero"``, indicating that the operand is a negative zero.
|
||||
* ``"+Zero"``, indicating that the operand is a positive zero.
|
||||
* ``"+Subnormal"``, indicating that the operand is positive and subnormal.
|
||||
* ``"+Normal"``, indicating that the operand is a positive normal number.
|
||||
* ``"+Infinity"``, indicating that the operand is positive infinity.
|
||||
* ``"NaN"``, indicating that the operand is a quiet NaN (Not a Number).
|
||||
* ``"sNaN"``, indicating that the operand is a signaling NaN.
|
||||
|
||||
If *watchexp* is set (default), then an error is returned whenever the resulting
|
||||
exponent is greater than :attr:`Emax` or less than :attr:`Etiny`.
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.quantize(exp[, rounding[, context[, watchexp]]])
|
||||
|
||||
Returns a value equal to the first operand after rounding and
|
||||
having the exponent of the second operand.
|
||||
|
||||
>>> Decimal("1.41421356").quantize(Decimal("1.000"))
|
||||
Decimal("1.414")
|
||||
|
||||
Unlike other operations, if the length of the coefficient after the
|
||||
quantize operation would be greater than precision, then an
|
||||
:const:`InvalidOperation` is signaled. This guarantees that, unless
|
||||
there is an error condition, the quantized exponent is always equal
|
||||
to that of the right-hand operand.
|
||||
|
||||
Also unlike other operations, quantize never signals Underflow,
|
||||
even if the result is subnormal and inexact.
|
||||
|
||||
If the exponent of the second operand is larger than that of the
|
||||
first then rounding may be necessary. In this case, the rounding
|
||||
mode is determined by the ``rounding`` argument if given, else by
|
||||
the given ``context`` argument; if neither argument is given the
|
||||
rounding mode of the current thread's context is used.
|
||||
|
||||
If watchexp is set (default), then an error is returned whenever
|
||||
the resulting exponent is greater than Emax or less than Etiny.
|
||||
|
||||
.. method:: Decimal.radix()
|
||||
|
||||
Return ``Decimal(10)``, the radix (base) in which the
|
||||
:class:`Decimal` class does all its arithmetic. Included for
|
||||
compatibility with the specification.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.remainder_near(other[, context])
|
||||
|
||||
|
@ -368,16 +694,49 @@ also have a number of specialized methods:
|
|||
|
||||
If both are equally close, the one chosen will have the same sign as *self*.
|
||||
|
||||
.. method:: Decimal.rotate(other[, context])
|
||||
|
||||
Return the result of rotating the digits of the first operand by
|
||||
an amount specified by the second operand. The second operand
|
||||
must be an integer in the range -precision through precision. The
|
||||
absolute value of the second operand gives the number of places to
|
||||
rotate. If the second operand is positive then rotation is to the
|
||||
left; otherwise rotation is to the right. The coefficient of the
|
||||
first operand is padded on the left with zeros to length precision
|
||||
if necessary. The sign and exponent of the first operand are
|
||||
unchanged.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.same_quantum(other[, context])
|
||||
|
||||
Test whether self and other have the same exponent or whether both are
|
||||
:const:`NaN`.
|
||||
|
||||
.. method:: Decimal.scaleb(other[, context])
|
||||
|
||||
Return the first operand with exponent adjusted by the second.
|
||||
Equivalently, return the first operand multiplied by ``10**other``.
|
||||
The second operand must be an integer.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.shift(other[, context])
|
||||
|
||||
Return the result of shifting the digits of the first operand by
|
||||
an amount specified by the second operand. The second operand must
|
||||
be an integer in the range -precision through precision. The
|
||||
absolute value of the second operand gives the number of places to
|
||||
shift. If the second operand is positive then the shift is to the
|
||||
left; otherwise the shift is to the right. Digits shifted into the
|
||||
coefficient are zeros. The sign and exponent of the first operand
|
||||
are unchanged.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.sqrt([context])
|
||||
|
||||
Return the square root to full precision.
|
||||
Return the square root of the argument to full precision.
|
||||
|
||||
|
||||
.. method:: Decimal.to_eng_string([context])
|
||||
|
@ -388,13 +747,53 @@ also have a number of specialized methods:
|
|||
to 3 digits left of the decimal place. For example, converts
|
||||
``Decimal('123E+1')`` to ``Decimal("1.23E+3")``
|
||||
|
||||
|
||||
.. method:: Decimal.to_integral([rounding[, context]])
|
||||
|
||||
Identical to the :meth:`to_integral_value` method. The ``to_integral``
|
||||
name has been kept for compatibility with older versions.
|
||||
|
||||
.. method:: Decimal.to_integral_exact([rounding[, context]])
|
||||
|
||||
Round the argument to the nearest integer, signaling
|
||||
:const:`Inexact` or :const:`Rounded` as appropriate if rounding
|
||||
occurs. The rounding mode is determined by the ``rounding``
|
||||
parameter if given, else by the given ``context``. If neither
|
||||
parameter is given then the rounding mode of the current context is
|
||||
used.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. method:: Decimal.to_integral_value([rounding[, context]])
|
||||
|
||||
Rounds to the nearest integer without signaling :const:`Inexact` or
|
||||
:const:`Rounded`. If given, applies *rounding*; otherwise, uses the rounding
|
||||
method in either the supplied *context* or the current context.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
renamed from ``to_integral`` to ``to_integral_value``. The old name
|
||||
remains valid for compatibility.
|
||||
|
||||
.. method:: Decimal.trim()
|
||||
|
||||
Returns its argument with *insignificant* trailing zeros removed.
|
||||
Here, a trailing zero is considered insignificant either if it
|
||||
follows the decimal point, or if the exponent of the argument (that
|
||||
is, the last element of the :meth:`as_tuple` representation) is
|
||||
positive.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. _logical_operands_label:
|
||||
|
||||
Logical operands
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
The :meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`,
|
||||
and :meth:`logical_xor` methods expect their arguments to be *logical
|
||||
operands*. A *logical operand* is a :class:`Decimal` instance whose
|
||||
exponent and sign are both zero, and whose digits are all either
|
||||
:const:`0` or :const:`1`.
|
||||
|
||||
.. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
|
@ -509,6 +908,8 @@ In addition to the three supplied contexts, new contexts can be created with the
|
|||
* :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer),
|
||||
* :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or
|
||||
* :const:`ROUND_UP` (away from zero).
|
||||
* :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero
|
||||
would have been 0 or 5; otherwise towards zero)
|
||||
|
||||
The *traps* and *flags* fields list any signals to be set. Generally, new
|
||||
contexts should only set traps and leave the flags clear.
|
||||
|
@ -520,9 +921,16 @@ In addition to the three supplied contexts, new contexts can be created with the
|
|||
:const:`1`, exponents are printed with a capital :const:`E`; otherwise, a
|
||||
lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`.
|
||||
|
||||
The :class:`Context` class defines several general purpose methods as well as a
|
||||
large number of methods for doing arithmetic directly in a given context.
|
||||
.. versionchanged:: 2.6
|
||||
The :const:`ROUND_05UP` rounding mode was added.
|
||||
|
||||
The :class:`Context` class defines several general purpose methods as
|
||||
well as a large number of methods for doing arithmetic directly in a
|
||||
given context. In addition, for each of the :class:`Decimal` methods
|
||||
described above (with the exception of the :meth:`adjusted` and
|
||||
:meth:`as_tuple` methods) there is a corresponding :class:`Context`
|
||||
method. For example, ``C.exp(x)`` is equivalent to
|
||||
``x.exp(context=C)``.
|
||||
|
||||
.. method:: Context.clear_flags()
|
||||
|
||||
|
@ -533,6 +941,9 @@ large number of methods for doing arithmetic directly in a given context.
|
|||
|
||||
Return a duplicate of the context.
|
||||
|
||||
.. method:: Context.copy_decimal(num)
|
||||
|
||||
Return a copy of the Decimal instance num.
|
||||
|
||||
.. method:: Context.create_decimal(num)
|
||||
|
||||
|
@ -581,44 +992,21 @@ those for the :class:`Decimal` class and are only briefly recounted here.
|
|||
Return the sum of *x* and *y*.
|
||||
|
||||
|
||||
.. method:: Context.compare(x, y)
|
||||
|
||||
Compares values numerically.
|
||||
|
||||
Like :meth:`__cmp__` but returns a decimal instance::
|
||||
|
||||
a or b is a NaN ==> Decimal("NaN")
|
||||
a < b ==> Decimal("-1")
|
||||
a == b ==> Decimal("0")
|
||||
a > b ==> Decimal("1")
|
||||
|
||||
|
||||
.. method:: Context.divide(x, y)
|
||||
|
||||
Return *x* divided by *y*.
|
||||
|
||||
|
||||
.. method:: Context.divide_int(x, y)
|
||||
|
||||
Return *x* divided by *y*, truncated to an integer.
|
||||
|
||||
|
||||
.. method:: Context.divmod(x, y)
|
||||
|
||||
Divides two numbers and returns the integer part of the result.
|
||||
|
||||
|
||||
.. method:: Context.max(x, y)
|
||||
|
||||
Compare two values numerically and return the maximum.
|
||||
|
||||
If they are numerically equal then the left-hand operand is chosen as the
|
||||
result.
|
||||
|
||||
|
||||
.. method:: Context.min(x, y)
|
||||
|
||||
Compare two values numerically and return the minimum.
|
||||
|
||||
If they are numerically equal then the left-hand operand is chosen as the
|
||||
result.
|
||||
|
||||
|
||||
.. method:: Context.minus(x)
|
||||
|
||||
Minus corresponds to the unary prefix minus operator in Python.
|
||||
|
@ -629,14 +1017,6 @@ those for the :class:`Decimal` class and are only briefly recounted here.
|
|||
Return the product of *x* and *y*.
|
||||
|
||||
|
||||
.. method:: Context.normalize(x)
|
||||
|
||||
Normalize reduces an operand to its simplest form.
|
||||
|
||||
Essentially a :meth:`plus` operation with all trailing zeros removed from the
|
||||
result.
|
||||
|
||||
|
||||
.. method:: Context.plus(x)
|
||||
|
||||
Plus corresponds to the unary prefix plus operator in Python. This operation
|
||||
|
@ -646,33 +1026,31 @@ those for the :class:`Decimal` class and are only briefly recounted here.
|
|||
|
||||
.. method:: Context.power(x, y[, modulo])
|
||||
|
||||
Return ``x ** y`` to the *modulo* if given.
|
||||
Return ``x`` to the power of ``y``, reduced modulo ``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.
|
||||
With two arguments, compute ``x**y``. If ``x`` is negative then
|
||||
``y`` must be integral. The result will be inexact unless ``y`` is
|
||||
integral and the result is finite and can be expressed exactly in
|
||||
'precision' digits. The result should always be correctly rounded,
|
||||
using the rounding mode of the current thread's context.
|
||||
|
||||
If the increased precision needed for the intermediate calculations exceeds the
|
||||
capabilities of the implementation then an :const:`InvalidOperation` condition
|
||||
is signaled.
|
||||
With three arguments, compute ``(x**y) % modulo``. For the three
|
||||
argument form, the following restrictions on the arguments hold:
|
||||
|
||||
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.
|
||||
- all three arguments must be integral
|
||||
- ``y`` must be nonnegative
|
||||
- at least one of ``x`` or ``y`` must be nonzero
|
||||
- ``modulo`` must be nonzero and have at most 'precision' digits
|
||||
|
||||
The result of ``Context.power(x, y, modulo)`` is identical to
|
||||
the result that would be obtained by computing ``(x**y) %
|
||||
modulo`` with unbounded precision, but is computed more
|
||||
efficiently. It is always exact.
|
||||
|
||||
.. method:: Context.quantize(x, y)
|
||||
|
||||
Returns a value equal to *x* after rounding and having the exponent of *y*.
|
||||
|
||||
Unlike other operations, if the length of the coefficient after the quantize
|
||||
operation would be greater than precision, then an :const:`InvalidOperation` is
|
||||
signaled. This guarantees that, unless there is an error condition, the
|
||||
quantized exponent is always equal to that of the right-hand operand.
|
||||
|
||||
Also unlike other operations, quantize never signals Underflow, even if the
|
||||
result is subnormal and inexact.
|
||||
.. versionchanged:: 2.6
|
||||
``y`` may now be nonintegral in ``x**y``.
|
||||
Stricter requirements for the three-argument version.
|
||||
|
||||
|
||||
.. method:: Context.remainder(x, y)
|
||||
|
@ -682,47 +1060,10 @@ those for the :class:`Decimal` class and are only briefly recounted here.
|
|||
The sign of the result, if non-zero, is the same as that of the original
|
||||
dividend.
|
||||
|
||||
|
||||
.. method:: Context.remainder_near(x, y)
|
||||
|
||||
Computed the modulo as either a positive or negative value depending on which is
|
||||
closest to zero. For instance, ``Decimal(10).remainder_near(6)`` returns
|
||||
``Decimal("-2")`` which is closer to zero than ``Decimal("4")``.
|
||||
|
||||
If both are equally close, the one chosen will have the same sign as *self*.
|
||||
|
||||
|
||||
.. method:: Context.same_quantum(x, y)
|
||||
|
||||
Test whether *x* and *y* have the same exponent or whether both are
|
||||
:const:`NaN`.
|
||||
|
||||
|
||||
.. method:: Context.sqrt(x)
|
||||
|
||||
Return the square root of *x* to full precision.
|
||||
|
||||
|
||||
.. method:: Context.subtract(x, y)
|
||||
|
||||
Return the difference between *x* and *y*.
|
||||
|
||||
|
||||
.. method:: Context.to_eng_string()
|
||||
|
||||
Convert to engineering-type string.
|
||||
|
||||
Engineering notation has an exponent which is a multiple of 3, so there are up
|
||||
to 3 digits left of the decimal place. For example, converts
|
||||
``Decimal('123E+1')`` to ``Decimal("1.23E+3")``
|
||||
|
||||
|
||||
.. method:: Context.to_integral(x)
|
||||
|
||||
Rounds to the nearest integer without signaling :const:`Inexact` or
|
||||
:const:`Rounded`.
|
||||
|
||||
|
||||
.. method:: Context.to_sci_string(x)
|
||||
|
||||
Converts a number to a string using scientific notation.
|
||||
|
@ -755,7 +1096,7 @@ condition.
|
|||
|
||||
Typically, clamping occurs when an exponent falls outside the context's
|
||||
:attr:`Emin` and :attr:`Emax` limits. If possible, the exponent is reduced to
|
||||
fit by adding zeroes to the coefficient.
|
||||
fit by adding zeros to the coefficient.
|
||||
|
||||
|
||||
.. class:: DecimalException
|
||||
|
@ -908,7 +1249,7 @@ Special values
|
|||
|
||||
The number system for the :mod:`decimal` module provides special values
|
||||
including :const:`NaN`, :const:`sNaN`, :const:`-Infinity`, :const:`Infinity`,
|
||||
and two zeroes, :const:`+0` and :const:`-0`.
|
||||
and two zeros, :const:`+0` and :const:`-0`.
|
||||
|
||||
Infinities can be constructed directly with: ``Decimal('Infinity')``. Also,
|
||||
they can arise from dividing by zero when the :exc:`DivisionByZero` signal is
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
|
||||
|
||||
|
||||
This module implements a helper class and functions to quickly write a loop over
|
||||
standard input or a list of files.
|
||||
This module implements a helper class and functions to quickly write a
|
||||
loop over standard input or a list of files. If you just want to read or
|
||||
write one file see :func:`open`.
|
||||
|
||||
The typical use is::
|
||||
|
||||
|
|
|
@ -746,7 +746,8 @@ available. They are listed here in alphabetical order.
|
|||
Python enforces that the mode, after stripping ``'U'``, begins with ``'r'``,
|
||||
``'w'`` or ``'a'``.
|
||||
|
||||
See also the :mod:`fileinput` module.
|
||||
See also the :mod:`fileinput` module, the :mod:`os` module, and the
|
||||
:mod:`os.path` module.
|
||||
|
||||
|
||||
.. function:: ord(c)
|
||||
|
|
|
@ -36,7 +36,7 @@ concatenation of the data fed to it so far using the :meth:`digest` or
|
|||
Feeding string objects is to :meth:`update` is not supported, as hashes work
|
||||
on bytes, not on characters.
|
||||
|
||||
.. index:: single: OpenSSL
|
||||
.. index:: single: OpenSSL; (use in module hashlib)
|
||||
|
||||
Constructors for hash algorithms that are always present in this module are
|
||||
:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, and
|
||||
|
|
|
@ -47,18 +47,18 @@ The logical operations are also generally applicable to all objects, and support
|
|||
truth tests, identity tests, and boolean operations:
|
||||
|
||||
|
||||
.. function:: not_(o)
|
||||
__not__(o)
|
||||
.. function:: not_(obj)
|
||||
__not__(obj)
|
||||
|
||||
Return the outcome of :keyword:`not` *o*. (Note that there is no
|
||||
Return the outcome of :keyword:`not` *obj*. (Note that there is no
|
||||
:meth:`__not__` method for object instances; only the interpreter core defines
|
||||
this operation. The result is affected by the :meth:`__bool__` and
|
||||
:meth:`__len__` methods.)
|
||||
|
||||
|
||||
.. function:: truth(o)
|
||||
.. function:: truth(obj)
|
||||
|
||||
Return :const:`True` if *o* is true, and :const:`False` otherwise. This is
|
||||
Return :const:`True` if *obj* is true, and :const:`False` otherwise. This is
|
||||
equivalent to using the :class:`bool` constructor.
|
||||
|
||||
|
||||
|
@ -75,10 +75,10 @@ truth tests, identity tests, and boolean operations:
|
|||
The mathematical and bitwise operations are the most numerous:
|
||||
|
||||
|
||||
.. function:: abs(o)
|
||||
__abs__(o)
|
||||
.. function:: abs(obj)
|
||||
__abs__(obj)
|
||||
|
||||
Return the absolute value of *o*.
|
||||
Return the absolute value of *obj*.
|
||||
|
||||
|
||||
.. function:: add(a, b)
|
||||
|
@ -106,12 +106,12 @@ The mathematical and bitwise operations are the most numerous:
|
|||
Return ``a // b``.
|
||||
|
||||
|
||||
.. function:: inv(o)
|
||||
invert(o)
|
||||
__inv__(o)
|
||||
__invert__(o)
|
||||
.. function:: inv(obj)
|
||||
invert(obj)
|
||||
__inv__(obj)
|
||||
__invert__(obj)
|
||||
|
||||
Return the bitwise inverse of the number *o*. This is equivalent to ``~o``.
|
||||
Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
|
||||
|
||||
|
||||
.. function:: lshift(a, b)
|
||||
|
@ -132,10 +132,10 @@ The mathematical and bitwise operations are the most numerous:
|
|||
Return ``a * b``, for *a* and *b* numbers.
|
||||
|
||||
|
||||
.. function:: neg(o)
|
||||
__neg__(o)
|
||||
.. function:: neg(obj)
|
||||
__neg__(obj)
|
||||
|
||||
Return *o* negated.
|
||||
Return *obj* negated.
|
||||
|
||||
|
||||
.. function:: or_(a, b)
|
||||
|
@ -144,10 +144,10 @@ The mathematical and bitwise operations are the most numerous:
|
|||
Return the bitwise or of *a* and *b*.
|
||||
|
||||
|
||||
.. function:: pos(o)
|
||||
__pos__(o)
|
||||
.. function:: pos(obj)
|
||||
__pos__(obj)
|
||||
|
||||
Return *o* positive.
|
||||
Return *obj* positive.
|
||||
|
||||
|
||||
.. function:: pow(a, b)
|
||||
|
@ -373,24 +373,30 @@ objects.
|
|||
... pass
|
||||
...
|
||||
>>> import operator
|
||||
>>> o = C()
|
||||
>>> operator.isMappingType(o)
|
||||
>>> obj = C()
|
||||
>>> operator.isMappingType(obj)
|
||||
True
|
||||
|
||||
.. note::
|
||||
|
||||
.. function:: isCallable(o)
|
||||
Python 3 is expected to introduce abstract base classes for
|
||||
collection types, so it should be possible to write, for example,
|
||||
``isinstance(obj, collections.Mapping)`` and ``isinstance(obj,
|
||||
collections.Sequence)``.
|
||||
|
||||
.. function:: isCallable(obj)
|
||||
|
||||
.. deprecated:: 2.0
|
||||
Use the :func:`callable` built-in function instead.
|
||||
|
||||
Returns true if the object *o* can be called like a function, otherwise it
|
||||
Returns true if the object *obj* can be called like a function, otherwise it
|
||||
returns false. True is returned for functions, bound and unbound methods, class
|
||||
objects, and instance objects which support the :meth:`__call__` method.
|
||||
|
||||
|
||||
.. function:: isMappingType(o)
|
||||
.. function:: isMappingType(obj)
|
||||
|
||||
Returns true if the object *o* supports the mapping interface. This is true for
|
||||
Returns true if the object *obj* supports the mapping interface. This is true for
|
||||
dictionaries and all instance objects defining :meth:`__getitem__`.
|
||||
|
||||
.. warning::
|
||||
|
@ -400,9 +406,9 @@ objects.
|
|||
useful than it otherwise might be.
|
||||
|
||||
|
||||
.. function:: isNumberType(o)
|
||||
.. function:: isNumberType(obj)
|
||||
|
||||
Returns true if the object *o* represents a number. This is true for all
|
||||
Returns true if the object *obj* represents a number. This is true for all
|
||||
numeric types implemented in C.
|
||||
|
||||
.. warning::
|
||||
|
@ -412,9 +418,9 @@ objects.
|
|||
useful than it otherwise might be.
|
||||
|
||||
|
||||
.. function:: isSequenceType(o)
|
||||
.. function:: isSequenceType(obj)
|
||||
|
||||
Returns true if the object *o* supports the sequence protocol. This returns true
|
||||
Returns true if the object *obj* supports the sequence protocol. This returns true
|
||||
for all objects which define sequence methods in C, and for all instance objects
|
||||
defining :meth:`__getitem__`.
|
||||
|
||||
|
@ -484,7 +490,7 @@ Python syntax and the functions in the :mod:`operator` module.
|
|||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Concatenation | ``seq1 + seq2`` | ``concat(seq1, seq2)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Containment Test | ``o in seq`` | ``contains(seq, o)`` |
|
||||
| Containment Test | ``obj in seq`` | ``contains(seq, obj)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Division | ``a / b`` | ``div(a, b)`` (without |
|
||||
| | | ``__future__.division``) |
|
||||
|
@ -508,11 +514,11 @@ Python syntax and the functions in the :mod:`operator` module.
|
|||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Identity | ``a is not b`` | ``is_not(a, b)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Indexed Assignment | ``o[k] = v`` | ``setitem(o, k, v)`` |
|
||||
| Indexed Assignment | ``obj[k] = v`` | ``setitem(obj, k, v)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Indexed Deletion | ``del o[k]`` | ``delitem(o, k)`` |
|
||||
| Indexed Deletion | ``del obj[k]`` | ``delitem(obj, k)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Indexing | ``o[k]`` | ``getitem(o, k)`` |
|
||||
| Indexing | ``obj[k]`` | ``getitem(obj, k)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Left Shift | ``a << b`` | ``lshift(a, b)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
|
@ -534,11 +540,11 @@ Python syntax and the functions in the :mod:`operator` module.
|
|||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Slicing | ``seq[i:j]`` | ``getslice(seq, i, j)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| String Formatting | ``s % o`` | ``mod(s, o)`` |
|
||||
| String Formatting | ``s % obj`` | ``mod(s, obj)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Subtraction | ``a - b`` | ``sub(a, b)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Truth Test | ``o`` | ``truth(o)`` |
|
||||
| Truth Test | ``obj`` | ``truth(obj)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
| Ordering | ``a < b`` | ``lt(a, b)`` |
|
||||
+-----------------------+-------------------------+---------------------------------+
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
|
||||
This module provides a more portable way of using operating system dependent
|
||||
functionality than importing a operating system dependent built-in module like
|
||||
:mod:`posix` or :mod:`nt`. (If you just want to read or write a file see
|
||||
:func:`open`, and if you want to manipulate paths, see the :mod:`os.path`
|
||||
module.)
|
||||
:mod:`posix` or :mod:`nt`. If you just want to read or write a file see
|
||||
:func:`open`, if you want to manipulate paths, see the :mod:`os.path`
|
||||
module, and if you want to read all the lines in all the files on the
|
||||
command line see the :mod:`fileinput` module.
|
||||
|
||||
This module searches for an operating system dependent built-in module like
|
||||
:mod:`mac` or :mod:`posix` and exports the same functions and data as found
|
||||
|
|
|
@ -142,7 +142,7 @@ server::
|
|||
|
||||
import xmlrpclib
|
||||
|
||||
s = xmlrpclib.Server('http://localhost:8000')
|
||||
s = xmlrpclib.ServerProxy('http://localhost:8000')
|
||||
print(s.pow(2,3)) # Returns 2**3 = 8
|
||||
print(s.add(2,3)) # Returns 5
|
||||
print(s.div(5,2)) # Returns 5//2 = 2
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
.. sectionauthor:: Bill Janssen <bill.janssen@gmail.com>
|
||||
|
||||
|
||||
.. index:: single: OpenSSL; (use in module ssl)
|
||||
|
||||
.. index:: TLS, SSL, Transport Layer Security, Secure Sockets Layer
|
||||
|
||||
This module provides access to Transport Layer Security (often known
|
||||
as "Secure Sockets Layer") encryption and peer authentication
|
||||
facilities for network sockets, both client-side and server-side.
|
||||
|
@ -19,18 +23,125 @@ platforms, as long as OpenSSL is installed on that platform.
|
|||
.. note::
|
||||
|
||||
Some behavior may be platform dependent, since calls are made to the operating
|
||||
system socket APIs.
|
||||
system socket APIs. The installed version of OpenSSL may also cause
|
||||
variations in behavior.
|
||||
|
||||
This section documents the objects and functions in the ``ssl`` module;
|
||||
for more general information about TLS, SSL, and certificates, the
|
||||
reader is referred to the documents in the :ref:`ssl-references` section.
|
||||
reader is referred to the documents in the "See Also" section at
|
||||
the bottom.
|
||||
|
||||
This module defines a class, :class:`ssl.sslsocket`, which is
|
||||
derived from the :class:`socket.socket` type, and supports additional
|
||||
This module provides a class, :class:`ssl.SSLSocket`, which is
|
||||
derived from the :class:`socket.socket` type, and provides
|
||||
a socket-like wrapper that also encrypts and decrypts the data
|
||||
going over the socket with SSL. It supports additional
|
||||
:meth:`read` and :meth:`write` methods, along with a method, :meth:`getpeercert`,
|
||||
to retrieve the certificate of the other side of the connection.
|
||||
to retrieve the certificate of the other side of the connection, and
|
||||
a method, :meth:`cipher`, to retrieve the cipher being used for the
|
||||
secure connection.
|
||||
|
||||
This module defines the following functions, exceptions, and constants:
|
||||
Functions, Constants, and Exceptions
|
||||
------------------------------------
|
||||
|
||||
.. exception:: SSLError
|
||||
|
||||
Raised to signal an error from the underlying SSL implementation. This
|
||||
signifies some problem in the higher-level
|
||||
encryption and authentication layer that's superimposed on the underlying
|
||||
network connection. This error is a subtype of :exc:`socket.error`, which
|
||||
in turn is a subtype of :exc:`IOError`.
|
||||
|
||||
.. function:: wrap_socket (sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None)
|
||||
|
||||
Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance of :class:`ssl.SSLSocket`, a subtype
|
||||
of :class:`socket.socket`, which wraps the underlying socket in an SSL context.
|
||||
For client-side sockets, the context construction is lazy; if the underlying socket isn't
|
||||
connected yet, the context construction will be performed after :meth:`connect` is called
|
||||
on the socket. For server-side sockets, if the socket has no remote peer, it is assumed
|
||||
to be a listening socket, and the server-side SSL wrapping is automatically performed
|
||||
on client connections accepted via the :meth:`accept` method. :func:`wrap_socket` may
|
||||
raise :exc:`SSLError`.
|
||||
|
||||
The ``keyfile`` and ``certfile`` parameters specify optional files which contain a certificate
|
||||
to be used to identify the local side of the connection. See the discussion of :ref:`ssl-certificates`
|
||||
for more information on how the certificate is stored in the ``certfile``.
|
||||
|
||||
Often the private key is stored
|
||||
in the same file as the certificate; in this case, only the ``certfile`` parameter need be
|
||||
passed. If the private key is stored in a separate file, both parameters must be used.
|
||||
If the private key is stored in the ``certfile``, it should come before the first certificate
|
||||
in the certificate chain::
|
||||
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
... (private key in base64 encoding) ...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
... (certificate in base64 PEM encoding) ...
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
The parameter ``server_side`` is a boolean which identifies whether server-side or client-side
|
||||
behavior is desired from this socket.
|
||||
|
||||
The parameter ``cert_reqs`` specifies whether a certificate is
|
||||
required from the other side of the connection, and whether it will
|
||||
be validated if provided. It must be one of the three values
|
||||
:const:`CERT_NONE` (certificates ignored), :const:`CERT_OPTIONAL` (not required,
|
||||
but validated if provided), or :const:`CERT_REQUIRED` (required and
|
||||
validated). If the value of this parameter is not :const:`CERT_NONE`, then
|
||||
the ``ca_certs`` parameter must point to a file of CA certificates.
|
||||
|
||||
The ``ca_certs`` file contains a set of concatenated "certification authority" certificates,
|
||||
which are used to validate certificates passed from the other end of the connection.
|
||||
See the discussion of :ref:`ssl-certificates` for more information about how to arrange
|
||||
the certificates in this file.
|
||||
|
||||
The parameter ``ssl_version`` specifies which version of the SSL protocol to use.
|
||||
Typically, the server chooses a particular protocol version, and the client
|
||||
must adapt to the server's choice. Most of the versions are not interoperable
|
||||
with the other versions. If not specified, for client-side operation, the
|
||||
default SSL version is SSLv3; for server-side operation, SSLv23. These
|
||||
version selections provide the most compatibility with other versions.
|
||||
|
||||
Here's a table showing which versions in a client (down the side)
|
||||
can connect to which versions in a server (along the top):
|
||||
|
||||
.. table::
|
||||
|
||||
======================== ========= ========= ========== =========
|
||||
*client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
|
||||
*SSLv2* yes no yes* no
|
||||
*SSLv3* yes yes yes no
|
||||
*SSLv23* yes no yes no
|
||||
*TLSv1* no no yes yes
|
||||
======================== ========= ========= ========== =========
|
||||
|
||||
`*` In some older versions of OpenSSL (for instance, 0.9.7l on OS X 10.4),
|
||||
an SSLv2 client could not connect to an SSLv23 server.
|
||||
|
||||
.. function:: RAND_status()
|
||||
|
||||
Returns True if the SSL pseudo-random number generator has been
|
||||
seeded with 'enough' randomness, and False otherwise. You can use
|
||||
:func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the randomness
|
||||
of the pseudo-random number generator.
|
||||
|
||||
.. function:: RAND_egd(path)
|
||||
|
||||
If you are running an entropy-gathering daemon (EGD) somewhere, and ``path``
|
||||
is the pathname of a socket connection open to it, this will read
|
||||
256 bytes of randomness from the socket, and add it to the SSL pseudo-random number generator
|
||||
to increase the security of generated secret keys. This is typically only
|
||||
necessary on systems without better sources of randomness.
|
||||
|
||||
See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for
|
||||
sources of entropy-gathering daemons.
|
||||
|
||||
.. function:: RAND_add(bytes, entropy)
|
||||
|
||||
Mixes the given ``bytes`` into the SSL pseudo-random number generator.
|
||||
The parameter ``entropy`` (a float) is a lower bound on the entropy
|
||||
contained in string (so you can always use :const:`0.0`).
|
||||
See :rfc:`1750` for more information on sources of entropy.
|
||||
|
||||
.. function:: cert_time_to_seconds(timestring)
|
||||
|
||||
|
@ -48,12 +159,27 @@ This module defines the following functions, exceptions, and constants:
|
|||
'Wed May 9 00:00:00 2007'
|
||||
>>>
|
||||
|
||||
.. exception:: sslerror
|
||||
.. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
|
||||
|
||||
Raised to signal an error from the underlying SSL implementation. This
|
||||
signifies some problem in the higher-level
|
||||
encryption and authentication layer that's superimposed on the underlying
|
||||
network connection.
|
||||
Given the address ``addr`` of an SSL-protected server, as a
|
||||
(*hostname*, *port-number*) pair, fetches the server's certificate,
|
||||
and returns it as a PEM-encoded string. If ``ssl_version`` is
|
||||
specified, uses that version of the SSL protocol to attempt to
|
||||
connect to the server. If ``ca_certs`` is specified, it should be
|
||||
a file containing a list of root certificates, the same format as
|
||||
used for the same parameter in :func:`wrap_socket`. The call will
|
||||
attempt to validate the server certificate against that set of root
|
||||
certificates, and will fail if the validation attempt fails.
|
||||
|
||||
.. function:: DER_cert_to_PEM_cert (DER_cert_bytes)
|
||||
|
||||
Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded
|
||||
string version of the same certificate.
|
||||
|
||||
.. function:: PEM_cert_to_DER_cert (PEM_cert_string)
|
||||
|
||||
Given a certificate as an ASCII PEM string, returns a DER-encoded
|
||||
sequence of bytes for that same certificate.
|
||||
|
||||
.. data:: CERT_NONE
|
||||
|
||||
|
@ -84,13 +210,16 @@ This module defines the following functions, exceptions, and constants:
|
|||
|
||||
.. data:: PROTOCOL_SSLv23
|
||||
|
||||
Selects SSL version 2 or 3 as the channel encryption protocol. This is a setting to use for maximum compatibility
|
||||
with the other end of an SSL connection, but it may cause the specific ciphers chosen for the encryption to be
|
||||
of fairly low quality.
|
||||
Selects SSL version 2 or 3 as the channel encryption protocol.
|
||||
This is a setting to use with servers for maximum compatibility
|
||||
with the other end of an SSL connection, but it may cause the
|
||||
specific ciphers chosen for the encryption to be of fairly low
|
||||
quality.
|
||||
|
||||
.. data:: PROTOCOL_SSLv3
|
||||
|
||||
Selects SSL version 3 as the channel encryption protocol.
|
||||
For clients, this is the maximally compatible SSL variant.
|
||||
|
||||
.. data:: PROTOCOL_TLSv1
|
||||
|
||||
|
@ -99,6 +228,69 @@ This module defines the following functions, exceptions, and constants:
|
|||
protection, if both sides can speak it.
|
||||
|
||||
|
||||
SSLSocket Objects
|
||||
-----------------
|
||||
|
||||
.. method:: SSLSocket.read([nbytes=1024])
|
||||
|
||||
Reads up to ``nbytes`` bytes from the SSL-encrypted channel and returns them.
|
||||
|
||||
.. method:: SSLSocket.write(data)
|
||||
|
||||
Writes the ``data`` to the other side of the connection, using the
|
||||
SSL channel to encrypt. Returns the number of bytes written.
|
||||
|
||||
.. method:: SSLSocket.getpeercert(binary_form=False)
|
||||
|
||||
If there is no certificate for the peer on the other end of the
|
||||
connection, returns ``None``.
|
||||
|
||||
If the the parameter ``binary_form`` is :const:`False`, and a
|
||||
certificate was received from the peer, this method returns a
|
||||
:class:`dict` instance. If the certificate was not validated, the
|
||||
dict is empty. If the certificate was validated, it returns a dict
|
||||
with the keys ``subject`` (the principal for which the certificate
|
||||
was issued), and ``notAfter`` (the time after which the certificate
|
||||
should not be trusted). The certificate was already validated, so
|
||||
the ``notBefore`` and ``issuer`` fields are not returned. If a
|
||||
certificate contains an instance of the *Subject Alternative Name*
|
||||
extension (see :rfc:`3280`), there will also be a
|
||||
``subjectAltName`` key in the dictionary.
|
||||
|
||||
The "subject" field is a tuple containing the sequence of relative
|
||||
distinguished names (RDNs) given in the certificate's data
|
||||
structure for the principal, and each RDN is a sequence of
|
||||
name-value pairs::
|
||||
|
||||
{'notAfter': 'Feb 16 16:54:50 2013 GMT',
|
||||
'subject': ((('countryName', u'US'),),
|
||||
(('stateOrProvinceName', u'Delaware'),),
|
||||
(('localityName', u'Wilmington'),),
|
||||
(('organizationName', u'Python Software Foundation'),),
|
||||
(('organizationalUnitName', u'SSL'),),
|
||||
(('commonName', u'somemachine.python.org'),))}
|
||||
|
||||
If the ``binary_form`` parameter is :const:`True`, and a
|
||||
certificate was provided, this method returns the DER-encoded form
|
||||
of the entire certificate as a sequence of bytes, or :const:`None` if the
|
||||
peer did not provide a certificate. This return
|
||||
value is independent of validation; if validation was required
|
||||
(:const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`), it will have
|
||||
been validated, but if :const:`CERT_NONE` was used to establish the
|
||||
connection, the certificate, if present, will not have been validated.
|
||||
|
||||
.. method:: SSLSocket.cipher()
|
||||
|
||||
Returns a three-value tuple containing the name of the cipher being
|
||||
used, the version of the SSL protocol that defines its use, and the
|
||||
number of secret bits being used. If no connection has been
|
||||
established, returns ``None``.
|
||||
|
||||
|
||||
.. index:: single: certificates
|
||||
|
||||
.. index:: single: X509 certificate
|
||||
|
||||
.. _ssl-certificates:
|
||||
|
||||
Certificates
|
||||
|
@ -127,8 +319,12 @@ can use a certificate to prove who they are. The other
|
|||
side of a network connection can also be required to produce a certificate,
|
||||
and that certificate can be validated to the satisfaction
|
||||
of the client or server that requires such validation.
|
||||
The connection can be set to fail automatically if such
|
||||
validation is not achieved.
|
||||
The connection attempt can be set to raise an exception if
|
||||
the validation fails. Validation is done
|
||||
automatically, by the underlying OpenSSL framework; the
|
||||
application need not concern itself with its mechanics.
|
||||
But the application does usually need to provide
|
||||
sets of certificates to allow this process to take place.
|
||||
|
||||
Python uses files to contain certificates. They should be formatted
|
||||
as "PEM" (see :rfc:`1422`), which is a base-64 encoded form wrapped
|
||||
|
@ -167,108 +363,55 @@ certificate, you need to provide a "CA certs" file, filled with the certificate
|
|||
chains for each issuer you are willing to trust. Again, this file just
|
||||
contains these chains concatenated together. For validation, Python will
|
||||
use the first chain it finds in the file which matches.
|
||||
Some "standard" root certificates are available at
|
||||
http://www.thawte.com/roots/ (for Thawte roots) and
|
||||
http://www.verisign.com/support/roots.html (for Verisign roots).
|
||||
See also :rfc:`4158` for more discussion of the way in which
|
||||
Some "standard" root certificates are available from various certification
|
||||
authorities:
|
||||
`CACert.org <http://www.cacert.org/index.php?id=3>`_,
|
||||
`Thawte <http://www.thawte.com/roots/>`_,
|
||||
`Verisign <http://www.verisign.com/support/roots.html>`_,
|
||||
`Positive SSL <http://www.PositiveSSL.com/ssl-certificate-support/cert_installation/UTN-USERFirst-Hardware.crt>`_ (used by python.org),
|
||||
`Equifax and GeoTrust <http://www.geotrust.com/resources/root_certificates/index.asp>`_.
|
||||
|
||||
In general, if you are using
|
||||
SSL3 or TLS1, you don't need to put the full chain in your "CA certs" file;
|
||||
you only need the root certificates, and the remote peer is supposed to
|
||||
furnish the other certificates necessary to chain from its certificate to
|
||||
a root certificate.
|
||||
See :rfc:`4158` for more discussion of the way in which
|
||||
certification chains can be built.
|
||||
|
||||
If you are going to create a server that provides SSL-encrypted
|
||||
connection services, you will need to acquire a certificate for that
|
||||
service. There are many ways of acquiring appropriate certificates,
|
||||
such as buying one from a certification authority. Another common
|
||||
practice is to generate a self-signed certificate. The simplest
|
||||
way to do this is with the OpenSSL package, using something like
|
||||
the following::
|
||||
|
||||
sslsocket Objects
|
||||
-----------------
|
||||
% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem
|
||||
Generating a 1024 bit RSA private key
|
||||
.......++++++
|
||||
.............................++++++
|
||||
writing new private key to 'cert.pem'
|
||||
-----
|
||||
You are about to be asked to enter information that will be incorporated
|
||||
into your certificate request.
|
||||
What you are about to enter is what is called a Distinguished Name or a DN.
|
||||
There are quite a few fields but you can leave some blank
|
||||
For some fields there will be a default value,
|
||||
If you enter '.', the field will be left blank.
|
||||
-----
|
||||
Country Name (2 letter code) [AU]:US
|
||||
State or Province Name (full name) [Some-State]:MyState
|
||||
Locality Name (eg, city) []:Some City
|
||||
Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc.
|
||||
Organizational Unit Name (eg, section) []:My Group
|
||||
Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com
|
||||
Email Address []:ops@myserver.mygroup.myorganization.com
|
||||
%
|
||||
|
||||
.. class:: sslsocket(sock [, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_SSLv23, ca_certs=None])
|
||||
|
||||
Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance of a subtype
|
||||
of :class:`socket.socket` which wraps the underlying socket in an SSL context.
|
||||
For client-side sockets, the context construction is lazy; if the underlying socket isn't
|
||||
connected yet, the context construction will be performed after :meth:`connect` is called
|
||||
on the socket.
|
||||
|
||||
The ``keyfile`` and ``certfile`` parameters specify optional files which contain a certificate
|
||||
to be used to identify the local side of the connection. See the above discussion of :ref:`ssl-certificates`
|
||||
for more information on how the certificate is stored in the ``certfile``.
|
||||
|
||||
Often the private key is stored
|
||||
in the same file as the certificate; in this case, only the ``certfile`` parameter need be
|
||||
passed. If the private key is stored in a separate file, both parameters must be used.
|
||||
If the private key is stored in the ``certfile``, it should come before the first certificate
|
||||
in the certificate chain::
|
||||
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
... (private key in base64 encoding) ...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
... (certificate in base64 PEM encoding) ...
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
The parameter ``server_side`` is a boolean which identifies whether server-side or client-side
|
||||
behavior is desired from this socket.
|
||||
|
||||
The parameter ``cert_reqs`` specifies whether a certificate is
|
||||
required from the other side of the connection, and whether it will
|
||||
be validated if provided. It must be one of the three values
|
||||
:const:`CERT_NONE` (certificates ignored), :const:`CERT_OPTIONAL` (not required,
|
||||
but validated if provided), or :const:`CERT_REQUIRED` (required and
|
||||
validated). If the value of this parameter is not :const:`CERT_NONE`, then
|
||||
the ``ca_certs`` parameter must point to a file of CA certificates.
|
||||
|
||||
The parameter ``ssl_version`` specifies which version of the SSL protocol to use. Typically,
|
||||
the server specifies this, and a client connecting to it must use the same protocol. An
|
||||
SSL server using :const:`PROTOCOL_SSLv23` can understand a client connecting via SSL2, SSL3, or TLS1,
|
||||
but a client using :const:`PROTOCOL_SSLv23` can only connect to an SSL2 server.
|
||||
|
||||
The ``ca_certs`` file contains a set of concatenated "certification authority" certificates,
|
||||
which are used to validate certificates passed from the other end of the connection.
|
||||
See the above discussion of :ref:`ssl-certificates` for more information about how to arrange
|
||||
the certificates in this file.
|
||||
|
||||
.. method:: sslsocket.read([nbytes])
|
||||
|
||||
Reads up to ``nbytes`` bytes from the SSL-encrypted channel and returns them.
|
||||
|
||||
.. method:: sslsocket.write(data)
|
||||
|
||||
Writes the ``data`` to the other side of the connection, using the SSL channel to encrypt. Returns the number
|
||||
of bytes written.
|
||||
|
||||
.. method:: sslsocket.getpeercert()
|
||||
|
||||
If there is no certificate for the peer on the other end of the connection, returns ``None``.
|
||||
If a certificate was received from the peer, but not validated, returns an empty ``dict`` instance.
|
||||
If a certificate was received and validated, returns a ``dict`` instance with the fields
|
||||
``subject`` (the principal for which the certificate was issued), ``issuer`` (the signer of
|
||||
the certificate), ``notBefore`` (the time before which the certificate should not be trusted),
|
||||
and ``notAfter`` (the time after which the certificate should not be trusted) filled in.
|
||||
|
||||
The "subject" and "issuer" fields are tuples containing the name-value fields
|
||||
given in the certificate's data structure for each principal::
|
||||
|
||||
{'issuer': (('countryName', u'US'),
|
||||
('stateOrProvinceName', u'Delaware'),
|
||||
('localityName', u'Wilmington'),
|
||||
('organizationName', u'Python Software Foundation'),
|
||||
('organizationalUnitName', u'SSL'),
|
||||
('commonName', u'somemachine.python.org')),
|
||||
'notAfter': 'Feb 16 16:54:50 2013 GMT',
|
||||
'notBefore': 'Aug 27 16:54:50 2007 GMT',
|
||||
'subject': (('countryName', u'US'),
|
||||
('stateOrProvinceName', u'Delaware'),
|
||||
('localityName', u'Wilmington'),
|
||||
('organizationName', u'Python Software Foundation'),
|
||||
('organizationalUnitName', u'SSL'),
|
||||
('commonName', u'somemachine.python.org')),
|
||||
'version': 2}
|
||||
|
||||
This certificate is said to be *self-signed*, because the subject
|
||||
and issuer are the same entity. The *version* field refers to the X509 version
|
||||
that's used for the certificate.
|
||||
|
||||
.. method:: sslsocket.ssl_shutdown()
|
||||
|
||||
Closes the SSL context (if any) over the socket, but leaves the socket connection
|
||||
open for further use, if both sides are willing. This is different from :meth:`socket.socket.shutdown`,
|
||||
which will close the connection, but leave the local socket available for further use.
|
||||
The disadvantage of a self-signed certificate is that it is its
|
||||
own root certificate, and no one else will have it in their cache
|
||||
of known (and trusted) root certificates.
|
||||
|
||||
|
||||
Examples
|
||||
|
@ -295,12 +438,17 @@ sends some bytes, and reads part of the response::
|
|||
import socket, ssl, pprint
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
ssl_sock = ssl.sslsocket(s, ca_certs="/etc/ca_certs_file", cert_reqs=ssl.CERT_REQUIRED)
|
||||
|
||||
# require a certificate from the server
|
||||
ssl_sock = ssl.wrap_socket(s,
|
||||
ca_certs="/etc/ca_certs_file",
|
||||
cert_reqs=ssl.CERT_REQUIRED)
|
||||
|
||||
ssl_sock.connect(('www.verisign.com', 443))
|
||||
|
||||
print(repr(ssl_sock.getpeername()))
|
||||
pprint.pprint(ssl_sock.getpeercert())
|
||||
print(pprint.pformat(ssl_sock.getpeercert()))
|
||||
|
||||
# Set a simple HTTP request -- use httplib in actual code.
|
||||
ssl_sock.write("""GET / HTTP/1.0\r
|
||||
|
@ -310,35 +458,29 @@ sends some bytes, and reads part of the response::
|
|||
# read all the data returned by the server.
|
||||
data = ssl_sock.read()
|
||||
|
||||
# note that closing the sslsocket will also close the underlying socket
|
||||
# note that closing the SSLSocket will also close the underlying socket
|
||||
ssl_sock.close()
|
||||
|
||||
As of September 4, 2007, the certificate printed by this program
|
||||
As of September 6, 2007, the certificate printed by this program
|
||||
looked like this::
|
||||
|
||||
{'issuer': (('countryName', u'US'),
|
||||
('organizationName', u'VeriSign, Inc.'),
|
||||
('organizationalUnitName', u'VeriSign Trust Network'),
|
||||
('organizationalUnitName',
|
||||
u'Terms of use at https://www.verisign.com/rpa (c)06'),
|
||||
('commonName',
|
||||
u'VeriSign Class 3 Extended Validation SSL SGC CA')),
|
||||
'notAfter': 'May 8 23:59:59 2009 GMT',
|
||||
'notBefore': 'May 9 00:00:00 2007 GMT',
|
||||
'subject': (('serialNumber', u'2497886'),
|
||||
('1.3.6.1.4.1.311.60.2.1.3', u'US'),
|
||||
('1.3.6.1.4.1.311.60.2.1.2', u'Delaware'),
|
||||
('countryName', u'US'),
|
||||
('postalCode', u'94043'),
|
||||
('stateOrProvinceName', u'California'),
|
||||
('localityName', u'Mountain View'),
|
||||
('streetAddress', u'487 East Middlefield Road'),
|
||||
('organizationName', u'VeriSign, Inc.'),
|
||||
('organizationalUnitName', u'Production Security Services'),
|
||||
('organizationalUnitName',
|
||||
u'Terms of use at www.verisign.com/rpa (c)06'),
|
||||
('commonName', u'www.verisign.com')),
|
||||
'version': 2}
|
||||
{'notAfter': 'May 8 23:59:59 2009 GMT',
|
||||
'subject': ((('serialNumber', u'2497886'),),
|
||||
(('1.3.6.1.4.1.311.60.2.1.3', u'US'),),
|
||||
(('1.3.6.1.4.1.311.60.2.1.2', u'Delaware'),),
|
||||
(('countryName', u'US'),),
|
||||
(('postalCode', u'94043'),),
|
||||
(('stateOrProvinceName', u'California'),),
|
||||
(('localityName', u'Mountain View'),),
|
||||
(('streetAddress', u'487 East Middlefield Road'),),
|
||||
(('organizationName', u'VeriSign, Inc.'),),
|
||||
(('organizationalUnitName',
|
||||
u'Production Security Services'),),
|
||||
(('organizationalUnitName',
|
||||
u'Terms of use at www.verisign.com/rpa (c)06'),),
|
||||
(('commonName', u'www.verisign.com'),))}
|
||||
|
||||
which is a fairly poorly-formed ``subject`` field.
|
||||
|
||||
Server-side operation
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -354,12 +496,15 @@ to connect::
|
|||
bindsocket.listen(5)
|
||||
|
||||
When one did, you'd call :meth:`accept` on the socket to get the new socket from the other
|
||||
end, and use :func:`sslsocket` to create a server-side SSL context for it::
|
||||
end, and use :func:`wrap_socket` to create a server-side SSL context for it::
|
||||
|
||||
while True:
|
||||
newsocket, fromaddr = bindsocket.accept()
|
||||
connstream = ssl.sslsocket(newsocket, server_side=True, certfile="mycertfile",
|
||||
keyfile="mykeyfile", ssl_protocol=ssl.PROTOCOL_TLSv1)
|
||||
connstream = ssl.wrap_socket(newsocket,
|
||||
server_side=True,
|
||||
certfile="mycertfile",
|
||||
keyfile="mykeyfile",
|
||||
ssl_protocol=ssl.PROTOCOL_TLSv1)
|
||||
deal_with_client(connstream)
|
||||
|
||||
Then you'd read data from the ``connstream`` and do something with it till you are finished with the client (or the client is finished with you)::
|
||||
|
@ -370,7 +515,8 @@ Then you'd read data from the ``connstream`` and do something with it till you a
|
|||
# null data means the client is finished with us
|
||||
while data:
|
||||
if not do_something(connstream, data):
|
||||
# we'll assume do_something returns False when we're finished with client
|
||||
# we'll assume do_something returns False
|
||||
# when we're finished with client
|
||||
break
|
||||
data = connstream.read()
|
||||
# finished with client
|
||||
|
@ -379,16 +525,19 @@ Then you'd read data from the ``connstream`` and do something with it till you a
|
|||
And go back to listening for new client connections.
|
||||
|
||||
|
||||
.. _ssl-references:
|
||||
.. seealso::
|
||||
|
||||
References
|
||||
----------
|
||||
Class :class:`socket.socket`
|
||||
Documentation of underlying :mod:`socket` class
|
||||
|
||||
Class :class:`socket.socket`
|
||||
Documentation of underlying :mod:`socket` class
|
||||
`Introducing SSL and Certificates using OpenSSL <http://old.pseudonym.org/ssl/wwwj-index.html>`_
|
||||
Frederick J. Hirsch
|
||||
|
||||
`Introducing SSL and Certificates using OpenSSL <http://old.pseudonym.org/ssl/wwwj-index.html>`_, by Frederick J. Hirsch
|
||||
`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: Certificate-Based Key Management <http://www.ietf.org/rfc/rfc1422>`_
|
||||
Steve Kent
|
||||
|
||||
`Privacy Enhancement for Internet Electronic Mail: Part II: Certificate-Based Key Management`, :rfc:`1422`, by Steve Kent
|
||||
`RFC 1750: Randomness Recommendations for Security <http://www.ietf.org/rfc/rfc1750>`_
|
||||
D. Eastlake et. al.
|
||||
|
||||
`Internet X.509 Public Key Infrastructure Certificate and CRL Profile`, :rfc:`3280`, Housley et. al.
|
||||
`RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile <http://www.ietf.org/rfc/rfc3280>`_
|
||||
Housley et. al.
|
||||
|
|
|
@ -19,9 +19,6 @@ Miscellaneous useful utilities
|
|||
|
||||
Some of these are very old and/or not very robust; marked with "hmm."
|
||||
|
||||
:mod:`bdb`
|
||||
--- A generic Python debugger base class (used by pdb).
|
||||
|
||||
:mod:`ihooks`
|
||||
--- Import hook support (for :mod:`rexec`; may become obsolete).
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ write a Python extension module, and the :ref:`c-api-index` describes the
|
|||
interfaces available to C/C++ programmers in detail.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 3
|
||||
|
||||
introduction.rst
|
||||
lexical_analysis.rst
|
||||
|
|
|
@ -62,47 +62,6 @@ using the built-in :func:`repr` function and the resulting string is written to
|
|||
standard output on a line by itself (except if the result is ``None``, so that
|
||||
procedure calls do not cause any output.)
|
||||
|
||||
|
||||
.. _assert:
|
||||
|
||||
Assert statements
|
||||
=================
|
||||
|
||||
.. index::
|
||||
statement: assert
|
||||
pair: debugging; assertions
|
||||
single: __debug__
|
||||
exception: AssertionError
|
||||
|
||||
Assert statements are a convenient way to insert debugging assertions into a
|
||||
program:
|
||||
|
||||
.. productionlist::
|
||||
assert_stmt: "assert" `expression` ["," `expression`]
|
||||
|
||||
The simple form, ``assert expression``, is equivalent to ::
|
||||
|
||||
if __debug__:
|
||||
if not expression: raise AssertionError
|
||||
|
||||
The extended form, ``assert expression1, expression2``, is equivalent to ::
|
||||
|
||||
if __debug__:
|
||||
if not expression1: raise AssertionError(expression2)
|
||||
|
||||
These equivalences assume that :data:`__debug__` and :exc:`AssertionError` refer
|
||||
to the built-in variables with those names. In the current implementation, the
|
||||
built-in variable :data:`__debug__` is ``True`` under normal circumstances,
|
||||
``False`` when optimization is requested (command line option ``-O``). The
|
||||
current code generator emits no code for an assert statement when optimization
|
||||
is requested at compile time. Note that it is unnecessary to include the source
|
||||
code for the expression that failed in the error message; it will be displayed
|
||||
as part of the stack trace.
|
||||
|
||||
Assignments to :data:`__debug__` are illegal. The value for the built-in
|
||||
variable is determined when the interpreter starts.
|
||||
|
||||
|
||||
.. _assignment:
|
||||
|
||||
Assignment statements
|
||||
|
@ -308,6 +267,48 @@ instance variable. For example::
|
|||
a.x += 1 # writes a.x as 4 leaving A.x as 3
|
||||
|
||||
|
||||
.. _assert:
|
||||
|
||||
The :keyword:`assert` statement
|
||||
===============================
|
||||
|
||||
.. index::
|
||||
statement: assert
|
||||
pair: debugging; assertions
|
||||
|
||||
Assert statements are a convenient way to insert debugging assertions into a
|
||||
program:
|
||||
|
||||
.. productionlist::
|
||||
assert_stmt: "assert" `expression` ["," `expression`]
|
||||
|
||||
The simple form, ``assert expression``, is equivalent to ::
|
||||
|
||||
if __debug__:
|
||||
if not expression: raise AssertionError
|
||||
|
||||
The extended form, ``assert expression1, expression2``, is equivalent to ::
|
||||
|
||||
if __debug__:
|
||||
if not expression1: raise AssertionError, expression2
|
||||
|
||||
.. index::
|
||||
single: __debug__
|
||||
exception: AssertionError
|
||||
|
||||
These equivalences assume that ``__debug__`` and :exc:`AssertionError` refer to
|
||||
the built-in variables with those names. In the current implementation, the
|
||||
built-in variable ``__debug__`` is ``True`` under normal circumstances,
|
||||
``False`` when optimization is requested (command line option -O). The current
|
||||
code generator emits no code for an assert statement when optimization is
|
||||
requested at compile time. Note that it is unnecessary to include the source
|
||||
code for the expression that failed in the error message; it will be displayed
|
||||
as part of the stack trace.
|
||||
|
||||
Assignments to ``__debug__`` are illegal. The value for the built-in variable
|
||||
is determined when the interpreter starts.
|
||||
|
||||
|
||||
.. _pass:
|
||||
|
||||
The :keyword:`pass` statement
|
||||
|
|
|
@ -637,7 +637,7 @@ precision and rounding characteristics for computations::
|
|||
print v.sqrt()
|
||||
|
||||
|
||||
.. _context-managers:
|
||||
.. _new-25-context-managers:
|
||||
|
||||
Writing Context Managers
|
||||
------------------------
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
What's New in Python 2.6
|
||||
****************************
|
||||
|
||||
.. % XXX mention switch to reST for documentation
|
||||
.. % XXX mention switch to Roundup for bug tracking
|
||||
|
||||
:Author: A.M. Kuchling
|
||||
:Release: |release|
|
||||
:Date: |today|
|
||||
|
@ -67,12 +70,367 @@ new feature.
|
|||
.. % sets module deprecated
|
||||
.. % ======================================================================
|
||||
|
||||
Python 3.0
|
||||
================
|
||||
|
||||
.. % XXX add general comment about Python 3.0 features in 2.6
|
||||
|
||||
.. % XXX mention -3 switch
|
||||
|
||||
A new command-line switch, :option:`-3`, enables warnings
|
||||
about features that will be removed in Python 3.0. You can run code
|
||||
with this switch to see how much work will be necessary to port
|
||||
code to 3.0.
|
||||
|
||||
.. seealso::
|
||||
|
||||
The 3xxx series of PEPs, which describes the development process for
|
||||
Python 3.0 and various features that have been accepted, rejected,
|
||||
or are still under consideration.
|
||||
|
||||
PEP 343: The 'with' statement
|
||||
=============================
|
||||
|
||||
The previous version, Python 2.5, added the ':keyword:`with`'
|
||||
statement an optional feature, to be enabled by a ``from __future__
|
||||
import generators`` directive. In 2.6 the statement no longer need to
|
||||
be specially enabled; this means that :keyword:`with` is now always a
|
||||
keyword. The rest of this section is a copy of the corresponding
|
||||
section from "What's New in Python 2.5" document; if you read
|
||||
it back when Python 2.5 came out, you can skip the rest of this
|
||||
section.
|
||||
|
||||
The ':keyword:`with`' statement clarifies code that previously would use
|
||||
``try...finally`` blocks to ensure that clean-up code is executed. In this
|
||||
section, I'll discuss the statement as it will commonly be used. In the next
|
||||
section, I'll examine the implementation details and show how to write objects
|
||||
for use with this statement.
|
||||
|
||||
The ':keyword:`with`' statement is a new control-flow structure whose basic
|
||||
structure is::
|
||||
|
||||
with expression [as variable]:
|
||||
with-block
|
||||
|
||||
The expression is evaluated, and it should result in an object that supports the
|
||||
context management protocol (that is, has :meth:`__enter__` and :meth:`__exit__`
|
||||
methods.
|
||||
|
||||
The object's :meth:`__enter__` is called before *with-block* is executed and
|
||||
therefore can run set-up code. It also may return a value that is bound to the
|
||||
name *variable*, if given. (Note carefully that *variable* is *not* assigned
|
||||
the result of *expression*.)
|
||||
|
||||
After execution of the *with-block* is finished, the object's :meth:`__exit__`
|
||||
method is called, even if the block raised an exception, and can therefore run
|
||||
clean-up code.
|
||||
|
||||
Some standard Python objects now support the context management protocol and can
|
||||
be used with the ':keyword:`with`' statement. File objects are one example::
|
||||
|
||||
with open('/etc/passwd', 'r') as f:
|
||||
for line in f:
|
||||
print line
|
||||
... more processing code ...
|
||||
|
||||
After this statement has executed, the file object in *f* will have been
|
||||
automatically closed, even if the :keyword:`for` loop raised an exception part-
|
||||
way through the block.
|
||||
|
||||
.. note::
|
||||
|
||||
In this case, *f* is the same object created by :func:`open`, because
|
||||
:meth:`file.__enter__` returns *self*.
|
||||
|
||||
The :mod:`threading` module's locks and condition variables also support the
|
||||
':keyword:`with`' statement::
|
||||
|
||||
lock = threading.Lock()
|
||||
with lock:
|
||||
# Critical section of code
|
||||
...
|
||||
|
||||
The lock is acquired before the block is executed and always released once the
|
||||
block is complete.
|
||||
|
||||
The new :func:`localcontext` function in the :mod:`decimal` module makes it easy
|
||||
to save and restore the current decimal context, which encapsulates the desired
|
||||
precision and rounding characteristics for computations::
|
||||
|
||||
from decimal import Decimal, Context, localcontext
|
||||
|
||||
# Displays with default precision of 28 digits
|
||||
v = Decimal('578')
|
||||
print v.sqrt()
|
||||
|
||||
with localcontext(Context(prec=16)):
|
||||
# All code in this block uses a precision of 16 digits.
|
||||
# The original context is restored on exiting the block.
|
||||
print v.sqrt()
|
||||
|
||||
|
||||
.. _new-26-context-managers:
|
||||
|
||||
Writing Context Managers
|
||||
------------------------
|
||||
|
||||
Under the hood, the ':keyword:`with`' statement is fairly complicated. Most
|
||||
people will only use ':keyword:`with`' in company with existing objects and
|
||||
don't need to know these details, so you can skip the rest of this section if
|
||||
you like. Authors of new objects will need to understand the details of the
|
||||
underlying implementation and should keep reading.
|
||||
|
||||
A high-level explanation of the context management protocol is:
|
||||
|
||||
* The expression is evaluated and should result in an object called a "context
|
||||
manager". The context manager must have :meth:`__enter__` and :meth:`__exit__`
|
||||
methods.
|
||||
|
||||
* The context manager's :meth:`__enter__` method is called. The value returned
|
||||
is assigned to *VAR*. If no ``'as VAR'`` clause is present, the value is simply
|
||||
discarded.
|
||||
|
||||
* The code in *BLOCK* is executed.
|
||||
|
||||
* If *BLOCK* raises an exception, the :meth:`__exit__(type, value, traceback)`
|
||||
is called with the exception details, the same values returned by
|
||||
:func:`sys.exc_info`. The method's return value controls whether the exception
|
||||
is re-raised: any false value re-raises the exception, and ``True`` will result
|
||||
in suppressing it. You'll only rarely want to suppress the exception, because
|
||||
if you do the author of the code containing the ':keyword:`with`' statement will
|
||||
never realize anything went wrong.
|
||||
|
||||
* If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still
|
||||
called, but *type*, *value*, and *traceback* are all ``None``.
|
||||
|
||||
Let's think through an example. I won't present detailed code but will only
|
||||
sketch the methods necessary for a database that supports transactions.
|
||||
|
||||
(For people unfamiliar with database terminology: a set of changes to the
|
||||
database are grouped into a transaction. Transactions can be either committed,
|
||||
meaning that all the changes are written into the database, or rolled back,
|
||||
meaning that the changes are all discarded and the database is unchanged. See
|
||||
any database textbook for more information.)
|
||||
|
||||
Let's assume there's an object representing a database connection. Our goal will
|
||||
be to let the user write code like this::
|
||||
|
||||
db_connection = DatabaseConnection()
|
||||
with db_connection as cursor:
|
||||
cursor.execute('insert into ...')
|
||||
cursor.execute('delete from ...')
|
||||
# ... more operations ...
|
||||
|
||||
The transaction should be committed if the code in the block runs flawlessly or
|
||||
rolled back if there's an exception. Here's the basic interface for
|
||||
:class:`DatabaseConnection` that I'll assume::
|
||||
|
||||
class DatabaseConnection:
|
||||
# Database interface
|
||||
def cursor (self):
|
||||
"Returns a cursor object and starts a new transaction"
|
||||
def commit (self):
|
||||
"Commits current transaction"
|
||||
def rollback (self):
|
||||
"Rolls back current transaction"
|
||||
|
||||
The :meth:`__enter__` method is pretty easy, having only to start a new
|
||||
transaction. For this application the resulting cursor object would be a useful
|
||||
result, so the method will return it. The user can then add ``as cursor`` to
|
||||
their ':keyword:`with`' statement to bind the cursor to a variable name. ::
|
||||
|
||||
class DatabaseConnection:
|
||||
...
|
||||
def __enter__ (self):
|
||||
# Code to start a new transaction
|
||||
cursor = self.cursor()
|
||||
return cursor
|
||||
|
||||
The :meth:`__exit__` method is the most complicated because it's where most of
|
||||
the work has to be done. The method has to check if an exception occurred. If
|
||||
there was no exception, the transaction is committed. The transaction is rolled
|
||||
back if there was an exception.
|
||||
|
||||
In the code below, execution will just fall off the end of the function,
|
||||
returning the default value of ``None``. ``None`` is false, so the exception
|
||||
will be re-raised automatically. If you wished, you could be more explicit and
|
||||
add a :keyword:`return` statement at the marked location. ::
|
||||
|
||||
class DatabaseConnection:
|
||||
...
|
||||
def __exit__ (self, type, value, tb):
|
||||
if tb is None:
|
||||
# No exception, so commit
|
||||
self.commit()
|
||||
else:
|
||||
# Exception occurred, so rollback.
|
||||
self.rollback()
|
||||
# return False
|
||||
|
||||
|
||||
.. _module-contextlib:
|
||||
|
||||
The contextlib module
|
||||
---------------------
|
||||
|
||||
The new :mod:`contextlib` module provides some functions and a decorator that
|
||||
are useful for writing objects for use with the ':keyword:`with`' statement.
|
||||
|
||||
The decorator is called :func:`contextmanager`, and lets you write a single
|
||||
generator function instead of defining a new class. The generator should yield
|
||||
exactly one value. The code up to the :keyword:`yield` will be executed as the
|
||||
:meth:`__enter__` method, and the value yielded will be the method's return
|
||||
value that will get bound to the variable in the ':keyword:`with`' statement's
|
||||
:keyword:`as` clause, if any. The code after the :keyword:`yield` will be
|
||||
executed in the :meth:`__exit__` method. Any exception raised in the block will
|
||||
be raised by the :keyword:`yield` statement.
|
||||
|
||||
Our database example from the previous section could be written using this
|
||||
decorator as::
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
@contextmanager
|
||||
def db_transaction (connection):
|
||||
cursor = connection.cursor()
|
||||
try:
|
||||
yield cursor
|
||||
except:
|
||||
connection.rollback()
|
||||
raise
|
||||
else:
|
||||
connection.commit()
|
||||
|
||||
db = DatabaseConnection()
|
||||
with db_transaction(db) as cursor:
|
||||
...
|
||||
|
||||
The :mod:`contextlib` module also has a :func:`nested(mgr1, mgr2, ...)` function
|
||||
that combines a number of context managers so you don't need to write nested
|
||||
':keyword:`with`' statements. In this example, the single ':keyword:`with`'
|
||||
statement both starts a database transaction and acquires a thread lock::
|
||||
|
||||
lock = threading.Lock()
|
||||
with nested (db_transaction(db), lock) as (cursor, locked):
|
||||
...
|
||||
|
||||
Finally, the :func:`closing(object)` function returns *object* so that it can be
|
||||
bound to a variable, and calls ``object.close`` at the end of the block. ::
|
||||
|
||||
import urllib, sys
|
||||
from contextlib import closing
|
||||
|
||||
with closing(urllib.urlopen('http://www.yahoo.com')) as f:
|
||||
for line in f:
|
||||
sys.stdout.write(line)
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
:pep:`343` - The "with" statement
|
||||
PEP written by Guido van Rossum and Nick Coghlan; implemented by Mike Bland,
|
||||
Guido van Rossum, and Neal Norwitz. The PEP shows the code generated for a
|
||||
':keyword:`with`' statement, which can be helpful in learning how the statement
|
||||
works.
|
||||
|
||||
The documentation for the :mod:`contextlib` module.
|
||||
|
||||
.. % ======================================================================
|
||||
|
||||
.. _pep-3110:
|
||||
|
||||
PEP 3110: Exception-Handling Changes
|
||||
=====================================================
|
||||
|
||||
One error that Python programmers occasionally make
|
||||
is the following::
|
||||
|
||||
try:
|
||||
...
|
||||
except TypeError, ValueError:
|
||||
...
|
||||
|
||||
The author is probably trying to catch both
|
||||
:exc:`TypeError` and :exc:`ValueError` exceptions, but this code
|
||||
actually does something different: it will catch
|
||||
:exc:`TypeError` and bind the resulting exception object
|
||||
to the local name ``"ValueError"``. The correct code
|
||||
would have specified a tuple::
|
||||
|
||||
try:
|
||||
...
|
||||
except (TypeError, ValueError):
|
||||
...
|
||||
|
||||
This error is possible because the use of the comma here is ambiguous:
|
||||
does it indicate two different nodes in the parse tree, or a single
|
||||
node that's a tuple.
|
||||
|
||||
Python 3.0 changes the syntax to make this unambiguous by replacing
|
||||
the comma with the word "as". To catch an exception and store the
|
||||
exception object in the variable ``exc``, you must write::
|
||||
|
||||
try:
|
||||
...
|
||||
except TypeError as exc:
|
||||
...
|
||||
|
||||
Python 3.0 will only support the use of "as", and therefore interprets
|
||||
the first example as catching two different exceptions. Python 2.6
|
||||
supports both the comma and "as", so existing code will continue to
|
||||
work.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:pep:`3110` - Catching Exceptions in Python 3000
|
||||
PEP written and implemented by Collin Winter.
|
||||
|
||||
.. % ======================================================================
|
||||
|
||||
.. _pep-3119:
|
||||
|
||||
PEP 3119: Abstract Base Classes
|
||||
=====================================================
|
||||
|
||||
XXX
|
||||
|
||||
.. seealso::
|
||||
|
||||
:pep:`3119` - Introducing Abstract Base Classes
|
||||
PEP written by Guido van Rossum and Talin.
|
||||
Implemented by XXX.
|
||||
Backported to 2.6 by Benjamin Aranguren (with Alex Martelli).
|
||||
|
||||
Other Language Changes
|
||||
======================
|
||||
|
||||
Here are all of the changes that Python 2.6 makes to the core Python language.
|
||||
|
||||
* Changes to the :class:`Exception` interface
|
||||
as dictated by :pep:`352` continue to be made. For 2.6,
|
||||
the :attr:`message` attribute is being deprecated in favor of the
|
||||
:attr:`args` attribute.
|
||||
|
||||
* When calling a function using the ``**`` syntax to provide keyword
|
||||
arguments, you are no longer required to use a Python dictionary;
|
||||
any mapping will now work::
|
||||
|
||||
>>> def f(**kw):
|
||||
... print sorted(kw)
|
||||
...
|
||||
>>> ud=UserDict.UserDict()
|
||||
>>> ud['a'] = 1
|
||||
>>> ud['b'] = 'string'
|
||||
>>> f(**ud)
|
||||
['a', 'b']
|
||||
|
||||
.. % Patch 1686487
|
||||
|
||||
* The :func:`compile` built-in function now accepts keyword arguments
|
||||
as well as positional parameters. (Contributed by XXX.)
|
||||
|
||||
.. % Patch 1444529
|
||||
|
||||
* The :func:`complex` constructor now accepts strings containing
|
||||
parenthesized complex numbers, letting ``complex(repr(cmplx))``
|
||||
will now round-trip values. For example, ``complex('(3+4j)')``
|
||||
|
@ -87,6 +445,15 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
|
|||
|
||||
.. % Patch 1193128
|
||||
|
||||
* The built-in :func:`dir` function now checks for a :meth:`__dir__`
|
||||
method on the objects it receives. This method must return a list
|
||||
of strings containing the names of valid attributes for the object,
|
||||
and lets the object control the value that :func:`dir` produces.
|
||||
Objects that have :meth:`__getattr__` or :meth:`__getattribute__`
|
||||
methods.
|
||||
|
||||
.. % Patch 1591665
|
||||
|
||||
* An obscure change: when you use the the :func:`locals` function inside a
|
||||
:keyword:`class` statement, the resulting dictionary no longer returns free
|
||||
variables. (Free variables, in this case, are variables referred to in the
|
||||
|
@ -160,6 +527,11 @@ complete list of changes, or look through the CVS logs for all the details.
|
|||
|
||||
(Contributed by Raymond Hettinger.)
|
||||
|
||||
* An optional ``timeout`` parameter was added to the
|
||||
:class:`httplib.HTTPConnection` and :class:`HTTPSConnection`
|
||||
class constructors, specifying a timeout measured in seconds.
|
||||
(Added by Facundo Batista.)
|
||||
|
||||
* A new function in the :mod:`itertools` module: ``izip_longest(iter1, iter2,
|
||||
...[, fillvalue])`` makes tuples from each of the elements; if some of the
|
||||
iterables are shorter than others, the missing values are set to *fillvalue*.
|
||||
|
@ -176,6 +548,15 @@ complete list of changes, or look through the CVS logs for all the details.
|
|||
|
||||
.. % Patch #1490190
|
||||
|
||||
* The :func:`os.walk` function now has a "followlinks" parameter. If
|
||||
set to True, it will follow symlinks pointing to directories and
|
||||
visit the directory's contents. For backward compatibility, the
|
||||
parameter's default value is false. Note that the function can fall
|
||||
into an infinite recursion if there's a symlink that points to a
|
||||
parent directory.
|
||||
|
||||
.. % Patch 1273829
|
||||
|
||||
* In the :mod:`os.path` module, the :func:`splitext` function
|
||||
has been changed to not split on leading period characters.
|
||||
This produces better results when operating on Unix's dot-files.
|
||||
|
@ -191,6 +572,12 @@ complete list of changes, or look through the CVS logs for all the details.
|
|||
|
||||
.. % Patch 1339796
|
||||
|
||||
On Windows, :func:`os.path.expandvars` will now expand environment variables
|
||||
in the form "%var%", and "~user" will be expanded into the
|
||||
user's home directory path. (Contributed by XXX.)
|
||||
|
||||
.. % Patch 957650
|
||||
|
||||
* New functions in the :mod:`posix` module: :func:`chflags` and :func:`lchflags`
|
||||
are wrappers for the corresponding system calls (where they're available).
|
||||
Constants for the flag values are defined in the :mod:`stat` module; some
|
||||
|
@ -217,13 +604,78 @@ complete list of changes, or look through the CVS logs for all the details.
|
|||
|
||||
.. % Patch #957003
|
||||
|
||||
* The :mod:`tarfile` module now supports POSIX.1-2001 (pax) and
|
||||
POSIX.1-1988 (ustar) format tarfiles, in addition to the GNU tar
|
||||
format that was already supported. The default format
|
||||
is GNU tar; specify the ``format`` parameter to open a file
|
||||
using a different format::
|
||||
|
||||
tar = tarfile.open("output.tar", "w", format=tarfile.PAX_FORMAT)
|
||||
|
||||
The new ``errors`` parameter lets you specify an error handling
|
||||
scheme for character conversions: the three standard ways Python can
|
||||
handle errors ``'strict'``, ``'ignore'``, ``'replace'`` , or the
|
||||
special value ``'utf-8'``, which replaces bad characters with their
|
||||
UTF-8 representation. Character conversions occur because the PAX
|
||||
format supports Unicode filenames, defaulting to UTF-8 encoding.
|
||||
|
||||
The :meth:`TarFile.add` method now accepts a ``exclude`` argument that's
|
||||
a function that can be used to exclude certain filenames from
|
||||
an archive.
|
||||
The function must take a filename and return true if the file
|
||||
should be excluded or false if it should be archived.
|
||||
The function is applied to both the name initially passed to :meth:`add`
|
||||
and to the names of files in recursively-added directories.
|
||||
|
||||
(All changes contributed by Lars Gustäbel).
|
||||
|
||||
* An optional ``timeout`` parameter was added to the
|
||||
:class:`telnetlib.Telnet` class constructor, specifying a timeout
|
||||
measured in seconds. (Added by Facundo Batista.)
|
||||
|
||||
* The :mod:`test.test_support` module now contains a :func:`EnvironmentVarGuard`
|
||||
* The :class:`tempfile.NamedTemporaryFile` class usually deletes
|
||||
the temporary file it created when the file is closed. This
|
||||
behaviour can now be changed by passing ``delete=False`` to the
|
||||
constructor. (Contributed by Damien Miller.)
|
||||
|
||||
.. % Patch #1537850
|
||||
|
||||
* The :mod:`test.test_support` module now contains a
|
||||
:func:`EnvironmentVarGuard`
|
||||
context manager that supports temporarily changing environment variables and
|
||||
automatically restores them to their old values. (Contributed by Brett Cannon.)
|
||||
automatically restores them to their old values.
|
||||
|
||||
Another context manager, :class:`TransientResource`, can surround calls
|
||||
to resources that may or may not be available; it will catch and
|
||||
ignore a specified list of exceptions. For example,
|
||||
a network test may ignore certain failures when connecting to an
|
||||
external web site::
|
||||
|
||||
with test_support.TransientResource(IOError, errno=errno.ETIMEDOUT):
|
||||
f = urllib.urlopen('https://sf.net')
|
||||
...
|
||||
|
||||
(Contributed by Brett Cannon.)
|
||||
|
||||
* The :mod:`textwrap` module can now preserve existing whitespace
|
||||
at the beginnings and ends of the newly-created lines
|
||||
by specifying ``drop_whitespace=False``
|
||||
as an argument::
|
||||
|
||||
>>> S = """This sentence has a bunch of extra whitespace."""
|
||||
>>> print textwrap.fill(S, width=15)
|
||||
This sentence
|
||||
has a bunch
|
||||
of extra
|
||||
whitespace.
|
||||
>>> print textwrap.fill(S, drop_whitespace=False, width=15)
|
||||
This sentence
|
||||
has a bunch
|
||||
of extra
|
||||
whitespace.
|
||||
>>>
|
||||
|
||||
.. % Patch #1581073
|
||||
|
||||
* The :mod:`timeit` module now accepts callables as well as strings
|
||||
for the statement being timed and for the setup code.
|
||||
|
@ -235,6 +687,20 @@ complete list of changes, or look through the CVS logs for all the details.
|
|||
|
||||
.. % Patch #1533909
|
||||
|
||||
* An optional ``timeout`` parameter was added to the
|
||||
:func:`urllib.urlopen` function and the
|
||||
:class:`urllib.ftpwrapper` class constructor, as well as the
|
||||
:func:`urllib2.urlopen` function. The parameter specifies a timeout
|
||||
measured in seconds. For example::
|
||||
|
||||
>>> u = urllib2.urlopen("http://slow.example.com", timeout=3)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
urllib2.URLError: <urlopen error timed out>
|
||||
>>>
|
||||
|
||||
(Added by Facundo Batista.)
|
||||
|
||||
.. % ======================================================================
|
||||
.. % whole new modules get described in \subsections here
|
||||
|
||||
|
|
|
@ -11,40 +11,50 @@ import _abcoll
|
|||
__all__ += _abcoll.__all__
|
||||
|
||||
|
||||
def NamedTuple(typename, s):
|
||||
def NamedTuple(typename, s, verbose=False):
|
||||
"""Returns a new subclass of tuple with named fields.
|
||||
|
||||
>>> Point = NamedTuple('Point', 'x y')
|
||||
>>> Point.__doc__ # docstring for the new class
|
||||
>>> Point.__doc__ # docstring for the new class
|
||||
'Point(x, y)'
|
||||
>>> p = Point(11, y=22) # instantiate with positional args or keywords
|
||||
>>> p[0] + p[1] # works just like the tuple (11, 22)
|
||||
>>> p = Point(11, y=22) # instantiate with positional args or keywords
|
||||
>>> p[0] + p[1] # works just like the tuple (11, 22)
|
||||
33
|
||||
>>> x, y = p # unpacks just like a tuple
|
||||
>>> x, y = p # unpacks just like a tuple
|
||||
>>> x, y
|
||||
(11, 22)
|
||||
>>> p.x + p.y # fields also accessable by name
|
||||
>>> p.x + p.y # fields also accessable by name
|
||||
33
|
||||
>>> p # readable __repr__ with name=value style
|
||||
>>> p # readable __repr__ with name=value style
|
||||
Point(x=11, y=22)
|
||||
>>> p.__replace__('x', 100) # __replace__() is like str.replace() but targets a named field
|
||||
Point(x=100, y=22)
|
||||
>>> d = dict(zip(p.__fields__, p)) # use __fields__ to make a dictionary
|
||||
>>> d['x']
|
||||
11
|
||||
|
||||
"""
|
||||
|
||||
field_names = s.split()
|
||||
if not ''.join([typename] + field_names).replace('_', '').isalnum():
|
||||
field_names = tuple(s.replace(',', ' ').split()) # names separated by spaces and/or commas
|
||||
if not ''.join((typename,) + field_names).replace('_', '').isalnum():
|
||||
raise ValueError('Type names and field names can only contain alphanumeric characters and underscores')
|
||||
argtxt = ', '.join(field_names)
|
||||
argtxt = repr(field_names).replace("'", "")[1:-1] # tuple repr without parens or quotes
|
||||
reprtxt = ', '.join('%s=%%r' % name for name in field_names)
|
||||
template = '''class %(typename)s(tuple):
|
||||
'%(typename)s(%(argtxt)s)'
|
||||
__slots__ = ()
|
||||
__fields__ = %(field_names)r
|
||||
def __new__(cls, %(argtxt)s):
|
||||
return tuple.__new__(cls, (%(argtxt)s,))
|
||||
return tuple.__new__(cls, (%(argtxt)s))
|
||||
def __repr__(self):
|
||||
return '%(typename)s(%(reprtxt)s)' %% self
|
||||
''' % locals()
|
||||
def __replace__(self, field, value):
|
||||
'Return a new %(typename)s object replacing one field with a new value'
|
||||
return %(typename)s(**dict(list(zip(%(field_names)r, self)) + [(field, value)])) \n''' % locals()
|
||||
for i, name in enumerate(field_names):
|
||||
template += '\n %s = property(itemgetter(%d))\n' % (name, i)
|
||||
template += ' %s = property(itemgetter(%d))\n' % (name, i)
|
||||
if verbose:
|
||||
print(template)
|
||||
m = dict(itemgetter=_itemgetter)
|
||||
exec(template, m)
|
||||
result = m[typename]
|
||||
|
@ -57,9 +67,9 @@ def NamedTuple(typename, s):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# verify that instances are pickable
|
||||
# verify that instances can be pickled
|
||||
from pickle import loads, dumps
|
||||
Point = NamedTuple('Point', 'x y')
|
||||
Point = NamedTuple('Point', 'x, y', True)
|
||||
p = Point(x=10, y=20)
|
||||
assert p == loads(dumps(p))
|
||||
|
||||
|
|
|
@ -158,17 +158,17 @@ class CFunctions(unittest.TestCase):
|
|||
self.failUnlessEqual(self._dll.tf_bd(0, 42.), 14.)
|
||||
self.failUnlessEqual(self.S(), 42)
|
||||
|
||||
def test_longdouble(self):
|
||||
self._dll.tf_D.restype = c_longdouble
|
||||
self._dll.tf_D.argtypes = (c_longdouble,)
|
||||
self.failUnlessEqual(self._dll.tf_D(42.), 14.)
|
||||
self.failUnlessEqual(self.S(), 42)
|
||||
## def test_longdouble(self):
|
||||
## self._dll.tf_D.restype = c_longdouble
|
||||
## self._dll.tf_D.argtypes = (c_longdouble,)
|
||||
## self.failUnlessEqual(self._dll.tf_D(42.), 14.)
|
||||
## self.failUnlessEqual(self.S(), 42)
|
||||
|
||||
def test_longdouble_plus(self):
|
||||
self._dll.tf_bD.restype = c_longdouble
|
||||
self._dll.tf_bD.argtypes = (c_byte, c_longdouble)
|
||||
self.failUnlessEqual(self._dll.tf_bD(0, 42.), 14.)
|
||||
self.failUnlessEqual(self.S(), 42)
|
||||
## def test_longdouble_plus(self):
|
||||
## self._dll.tf_bD.restype = c_longdouble
|
||||
## self._dll.tf_bD.argtypes = (c_byte, c_longdouble)
|
||||
## self.failUnlessEqual(self._dll.tf_bD(0, 42.), 14.)
|
||||
## self.failUnlessEqual(self.S(), 42)
|
||||
|
||||
def test_callwithresult(self):
|
||||
def process_result(result):
|
||||
|
|
|
@ -143,17 +143,17 @@ class FunctionTestCase(unittest.TestCase):
|
|||
self.failUnlessEqual(result, -21)
|
||||
self.failUnlessEqual(type(result), float)
|
||||
|
||||
def test_longdoubleresult(self):
|
||||
f = dll._testfunc_D_bhilfD
|
||||
f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble]
|
||||
f.restype = c_longdouble
|
||||
result = f(1, 2, 3, 4, 5.0, 6.0)
|
||||
self.failUnlessEqual(result, 21)
|
||||
self.failUnlessEqual(type(result), float)
|
||||
## def test_longdoubleresult(self):
|
||||
## f = dll._testfunc_D_bhilfD
|
||||
## f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble]
|
||||
## f.restype = c_longdouble
|
||||
## result = f(1, 2, 3, 4, 5.0, 6.0)
|
||||
## self.failUnlessEqual(result, 21)
|
||||
## self.failUnlessEqual(type(result), float)
|
||||
|
||||
result = f(-1, -2, -3, -4, -5.0, -6.0)
|
||||
self.failUnlessEqual(result, -21)
|
||||
self.failUnlessEqual(type(result), float)
|
||||
## result = f(-1, -2, -3, -4, -5.0, -6.0)
|
||||
## self.failUnlessEqual(result, -21)
|
||||
## self.failUnlessEqual(type(result), float)
|
||||
|
||||
def test_longlongresult(self):
|
||||
try:
|
||||
|
|
|
@ -63,15 +63,27 @@ elif os.name == "posix":
|
|||
return None
|
||||
return res.group(0)
|
||||
|
||||
def _get_soname(f):
|
||||
# assuming GNU binutils / ELF
|
||||
if not f:
|
||||
return None
|
||||
cmd = "objdump -p -j .dynamic 2>/dev/null " + f
|
||||
res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
|
||||
if not res:
|
||||
return None
|
||||
return res.group(1)
|
||||
|
||||
if sys.platform == "sunos5":
|
||||
# use /usr/ccs/bin/dump on solaris
|
||||
def _get_soname(f):
|
||||
if not f:
|
||||
return None
|
||||
cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f
|
||||
res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', os.popen(cmd).read())
|
||||
if not res:
|
||||
return None
|
||||
return res.group(1)
|
||||
else:
|
||||
def _get_soname(f):
|
||||
# assuming GNU binutils / ELF
|
||||
if not f:
|
||||
return None
|
||||
cmd = "objdump -p -j .dynamic 2>/dev/null " + f
|
||||
res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
|
||||
if not res:
|
||||
return None
|
||||
return res.group(1)
|
||||
|
||||
if (sys.platform.startswith("freebsd")
|
||||
or sys.platform.startswith("openbsd")
|
||||
|
|
3852
Lib/decimal.py
3852
Lib/decimal.py
File diff suppressed because it is too large
Load Diff
|
@ -102,7 +102,8 @@ class build_scripts(Command):
|
|||
outf.write("#!%s%s\n" %
|
||||
(os.path.join(
|
||||
sysconfig.get_config_var("BINDIR"),
|
||||
"python" + sysconfig.get_config_var("EXE")),
|
||||
"python" + sysconfig.get_config_var("VERSION")
|
||||
+ sysconfig.get_config_var("EXE")),
|
||||
post_interp))
|
||||
outf.writelines(f.readlines())
|
||||
outf.close()
|
||||
|
|
|
@ -985,12 +985,12 @@ else:
|
|||
"Connect to a host on a given (SSL) port."
|
||||
|
||||
sock = socket.create_connection((self.host, self.port), self.timeout)
|
||||
self.sock = ssl.sslsocket(sock, self.key_file, self.cert_file)
|
||||
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
|
||||
|
||||
|
||||
def FakeSocket (sock, sslobj):
|
||||
warnings.warn("FakeSocket is deprecated, and won't be in 3.x. " +
|
||||
"Use the result of ssl.sslsocket directly instead.",
|
||||
"Use the result of ssl.wrap_socket() directly instead.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
return sslobj
|
||||
|
||||
|
|
|
@ -1147,7 +1147,7 @@ else:
|
|||
self.port = port
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.sock.connect((host, port))
|
||||
self.sslobj = ssl.sslsocket(self.sock, self.keyfile, self.certfile)
|
||||
self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
|
||||
|
||||
|
||||
def read(self, size):
|
||||
|
@ -1199,7 +1199,7 @@ else:
|
|||
def ssl(self):
|
||||
"""Return SSLObject instance used to communicate with the IMAP4 server.
|
||||
|
||||
ssl = ssl.sslsocket(<instance>.socket)
|
||||
ssl = ssl.wrap_socket(<instance>.socket)
|
||||
"""
|
||||
return self.sslobj
|
||||
|
||||
|
|
|
@ -1142,6 +1142,12 @@ def uname():
|
|||
machine = ''
|
||||
if processor == 'unknown':
|
||||
processor = ''
|
||||
|
||||
# normalize name
|
||||
if system == 'Microsoft' and release == 'Windows':
|
||||
system = 'Windows'
|
||||
release = 'Vista'
|
||||
|
||||
_uname_cache = system,node,release,version,machine,processor
|
||||
return _uname_cache
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ else:
|
|||
if not self.sock:
|
||||
raise socket.error(msg)
|
||||
self.file = self.sock.makefile('rb')
|
||||
self.sslobj = ssl.sslsocket(self.sock, self.keyfile, self.certfile)
|
||||
self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
|
||||
self._debugging = 0
|
||||
self.welcome = self._getresp()
|
||||
|
||||
|
|
20
Lib/repr.py
20
Lib/repr.py
|
@ -1,4 +1,4 @@
|
|||
"""Redo the `...` (representation) but with limits on most sizes."""
|
||||
"""Redo the builtin repr() (representation) but with limits on most sizes."""
|
||||
|
||||
__all__ = ["Repr","repr"]
|
||||
|
||||
|
@ -57,11 +57,11 @@ class Repr:
|
|||
return self._repr_iterable(x, level, header, '])', self.maxarray)
|
||||
|
||||
def repr_set(self, x, level):
|
||||
x = sorted(x)
|
||||
x = _possibly_sorted(x)
|
||||
return self._repr_iterable(x, level, 'set([', '])', self.maxset)
|
||||
|
||||
def repr_frozenset(self, x, level):
|
||||
x = sorted(x)
|
||||
x = _possibly_sorted(x)
|
||||
return self._repr_iterable(x, level, 'frozenset([', '])',
|
||||
self.maxfrozenset)
|
||||
|
||||
|
@ -75,7 +75,7 @@ class Repr:
|
|||
newlevel = level - 1
|
||||
repr1 = self.repr1
|
||||
pieces = []
|
||||
for key in islice(sorted(x), self.maxdict):
|
||||
for key in islice(_possibly_sorted(x), self.maxdict):
|
||||
keyrepr = repr1(key, newlevel)
|
||||
valrepr = repr1(x[key], newlevel)
|
||||
pieces.append('%s: %s' % (keyrepr, valrepr))
|
||||
|
@ -105,7 +105,7 @@ class Repr:
|
|||
s = __builtin__.repr(x)
|
||||
# Bugs in x.__repr__() can cause arbitrary
|
||||
# exceptions -- then make up something
|
||||
except:
|
||||
except Exception:
|
||||
return '<%s instance at %x>' % (x.__class__.__name__, id(x))
|
||||
if len(s) > self.maxother:
|
||||
i = max(0, (self.maxother-3)//2)
|
||||
|
@ -113,5 +113,15 @@ class Repr:
|
|||
s = s[:i] + '...' + s[len(s)-j:]
|
||||
return s
|
||||
|
||||
|
||||
def _possibly_sorted(x):
|
||||
# Since not all sequences of items can be sorted and comparison
|
||||
# functions may raise arbitrary exceptions, return an unsorted
|
||||
# sequence in that case.
|
||||
try:
|
||||
return sorted(x)
|
||||
except Exception:
|
||||
return list(x)
|
||||
|
||||
aRepr = Repr()
|
||||
repr = aRepr.repr
|
||||
|
|
|
@ -588,7 +588,7 @@ class SMTP:
|
|||
if resp == 220:
|
||||
if not _have_ssl:
|
||||
raise RuntimeError("No SSL support included in this Python")
|
||||
self.sock = ssl.sslsocket(self.sock, keyfile, certfile)
|
||||
self.sock = ssl.wrap_socket(self.sock, keyfile, certfile)
|
||||
self.file = SSLFakeFile(self.sock)
|
||||
return (resp, reply)
|
||||
|
||||
|
@ -721,7 +721,7 @@ if _have_ssl:
|
|||
def _get_socket(self, host, port, timeout):
|
||||
if self.debuglevel > 0: print('connect:', (host, port), file=stderr)
|
||||
self.sock = socket.create_connection((host, port), timeout)
|
||||
self.sock = ssl.sslsocket(self.sock, self.keyfile, self.certfile)
|
||||
self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
|
||||
self.file = SSLFakeFile(self.sock)
|
||||
|
||||
__all__.append("SMTP_SSL")
|
||||
|
|
|
@ -56,13 +56,13 @@ else:
|
|||
def ssl(sock, keyfile=None, certfile=None):
|
||||
# we do an internal import here because the ssl
|
||||
# module imports the socket module
|
||||
warnings.warn("socket.ssl() is deprecated. Use ssl.sslsocket() instead.",
|
||||
warnings.warn("socket.ssl() is deprecated. Use ssl.wrap_socket() instead.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
return _realssl.sslwrap_simple(sock, keyfile, certfile)
|
||||
|
||||
# we need to import the same constants we used to...
|
||||
from _ssl import SSLError as sslerror
|
||||
from _ssl import \
|
||||
sslerror, \
|
||||
RAND_add, \
|
||||
RAND_egd, \
|
||||
RAND_status, \
|
||||
|
|
361
Lib/ssl.py
361
Lib/ssl.py
|
@ -8,11 +8,11 @@ This module provides some more Pythonic support for SSL.
|
|||
|
||||
Object types:
|
||||
|
||||
sslsocket -- subtype of socket.socket which does SSL over the socket
|
||||
SSLSocket -- subtype of socket.socket which does SSL over the socket
|
||||
|
||||
Exceptions:
|
||||
|
||||
sslerror -- exception raised for I/O errors
|
||||
SSLError -- exception raised for I/O errors
|
||||
|
||||
Functions:
|
||||
|
||||
|
@ -57,12 +57,14 @@ PROTOCOL_SSLv23
|
|||
PROTOCOL_TLSv1
|
||||
"""
|
||||
|
||||
import os, sys
|
||||
import os, sys, textwrap
|
||||
|
||||
import _ssl # if we can't import it, let the error propagate
|
||||
from _ssl import sslerror
|
||||
|
||||
from _ssl import SSLError
|
||||
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||
from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||
from _ssl import RAND_status, RAND_egd, RAND_add
|
||||
from _ssl import \
|
||||
SSL_ERROR_ZERO_RETURN, \
|
||||
SSL_ERROR_WANT_READ, \
|
||||
|
@ -76,9 +78,9 @@ from _ssl import \
|
|||
|
||||
from socket import socket
|
||||
from socket import getnameinfo as _getnameinfo
|
||||
import base64 # for DER-to-PEM translation
|
||||
|
||||
|
||||
class sslsocket (socket):
|
||||
class SSLSocket (socket):
|
||||
|
||||
"""This class implements a subtype of socket.socket that wraps
|
||||
the underlying OS socket in an SSL context when necessary, and
|
||||
|
@ -121,14 +123,21 @@ class sslsocket (socket):
|
|||
|
||||
return self._sslobj.write(data)
|
||||
|
||||
def getpeercert(self):
|
||||
def getpeercert(self, binary_form=False):
|
||||
|
||||
"""Returns a formatted version of the data in the
|
||||
certificate provided by the other end of the SSL channel.
|
||||
Return None if no certificate was provided, {} if a
|
||||
certificate was provided, but not validated."""
|
||||
|
||||
return self._sslobj.peer_certificate()
|
||||
return self._sslobj.peer_certificate(binary_form)
|
||||
|
||||
def cipher (self):
|
||||
|
||||
if not self._sslobj:
|
||||
return None
|
||||
else:
|
||||
return self._sslobj.cipher()
|
||||
|
||||
def send (self, data, flags=0):
|
||||
if self._sslobj:
|
||||
|
@ -174,21 +183,12 @@ class sslsocket (socket):
|
|||
else:
|
||||
return socket.recv_from(self, addr, buflen, flags)
|
||||
|
||||
def ssl_shutdown(self):
|
||||
|
||||
"""Shuts down the SSL channel over this socket (if active),
|
||||
without closing the socket connection."""
|
||||
|
||||
if self._sslobj:
|
||||
self._sslobj.shutdown()
|
||||
self._sslobj = None
|
||||
|
||||
def shutdown(self, how):
|
||||
self.ssl_shutdown()
|
||||
self._sslobj = None
|
||||
socket.shutdown(self, how)
|
||||
|
||||
def close(self):
|
||||
self.ssl_shutdown()
|
||||
self._sslobj = None
|
||||
socket.close(self)
|
||||
|
||||
def connect(self, addr):
|
||||
|
@ -199,7 +199,7 @@ class sslsocket (socket):
|
|||
# Here we assume that the socket is client-side, and not
|
||||
# connected at the time of the call. We connect it, then wrap it.
|
||||
if self._sslobj:
|
||||
raise ValueError("attempt to connect already-connected sslsocket!")
|
||||
raise ValueError("attempt to connect already-connected SSLSocket!")
|
||||
socket.connect(self, addr)
|
||||
self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile,
|
||||
self.cert_reqs, self.ssl_version,
|
||||
|
@ -212,11 +212,261 @@ class sslsocket (socket):
|
|||
SSL channel, and the address of the remote client."""
|
||||
|
||||
newsock, addr = socket.accept(self)
|
||||
return (sslsocket(newsock, True, self.keyfile, self.certfile,
|
||||
self.cert_reqs, self.ssl_version,
|
||||
self.ca_certs), addr)
|
||||
return (SSLSocket(newsock, True, self.keyfile, self.certfile,
|
||||
self.cert_reqs, self.ssl_version,
|
||||
self.ca_certs), addr)
|
||||
|
||||
|
||||
def makefile(self, mode='r', bufsize=-1):
|
||||
|
||||
"""Ouch. Need to make and return a file-like object that
|
||||
works with the SSL connection."""
|
||||
|
||||
if self._sslobj:
|
||||
return SSLFileStream(self._sslobj, mode, bufsize)
|
||||
else:
|
||||
return socket.makefile(self, mode, bufsize)
|
||||
|
||||
|
||||
class SSLFileStream:
|
||||
|
||||
"""A class to simulate a file stream on top of a socket.
|
||||
Most of this is just lifted from the socket module, and
|
||||
adjusted to work with an SSL stream instead of a socket."""
|
||||
|
||||
|
||||
default_bufsize = 8192
|
||||
name = "<SSL stream>"
|
||||
|
||||
__slots__ = ["mode", "bufsize", "softspace",
|
||||
# "closed" is a property, see below
|
||||
"_sslobj", "_rbufsize", "_wbufsize", "_rbuf", "_wbuf",
|
||||
"_close", "_fileno"]
|
||||
|
||||
def __init__(self, sslobj, mode='rb', bufsize=-1, close=False):
|
||||
self._sslobj = sslobj
|
||||
self.mode = mode # Not actually used in this version
|
||||
if bufsize < 0:
|
||||
bufsize = self.default_bufsize
|
||||
self.bufsize = bufsize
|
||||
self.softspace = False
|
||||
if bufsize == 0:
|
||||
self._rbufsize = 1
|
||||
elif bufsize == 1:
|
||||
self._rbufsize = self.default_bufsize
|
||||
else:
|
||||
self._rbufsize = bufsize
|
||||
self._wbufsize = bufsize
|
||||
self._rbuf = "" # A string
|
||||
self._wbuf = [] # A list of strings
|
||||
self._close = close
|
||||
self._fileno = -1
|
||||
|
||||
def _getclosed(self):
|
||||
return self._sslobj is None
|
||||
closed = property(_getclosed, doc="True if the file is closed")
|
||||
|
||||
def fileno(self):
|
||||
return self._fileno
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
if self._sslobj:
|
||||
self.flush()
|
||||
finally:
|
||||
if self._close and self._sslobj:
|
||||
self._sslobj.close()
|
||||
self._sslobj = None
|
||||
|
||||
def __del__(self):
|
||||
try:
|
||||
self.close()
|
||||
except:
|
||||
# close() may fail if __init__ didn't complete
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
if self._wbuf:
|
||||
buffer = "".join(self._wbuf)
|
||||
self._wbuf = []
|
||||
count = 0
|
||||
while (count < len(buffer)):
|
||||
written = self._sslobj.write(buffer)
|
||||
count += written
|
||||
buffer = buffer[written:]
|
||||
|
||||
def write(self, data):
|
||||
data = str(data) # XXX Should really reject non-string non-buffers
|
||||
if not data:
|
||||
return
|
||||
self._wbuf.append(data)
|
||||
if (self._wbufsize == 0 or
|
||||
self._wbufsize == 1 and '\n' in data or
|
||||
self._get_wbuf_len() >= self._wbufsize):
|
||||
self.flush()
|
||||
|
||||
def writelines(self, list):
|
||||
# XXX We could do better here for very long lists
|
||||
# XXX Should really reject non-string non-buffers
|
||||
self._wbuf.extend(filter(None, map(str, list)))
|
||||
if (self._wbufsize <= 1 or
|
||||
self._get_wbuf_len() >= self._wbufsize):
|
||||
self.flush()
|
||||
|
||||
def _get_wbuf_len(self):
|
||||
buf_len = 0
|
||||
for x in self._wbuf:
|
||||
buf_len += len(x)
|
||||
return buf_len
|
||||
|
||||
def read(self, size=-1):
|
||||
data = self._rbuf
|
||||
if size < 0:
|
||||
# Read until EOF
|
||||
buffers = []
|
||||
if data:
|
||||
buffers.append(data)
|
||||
self._rbuf = ""
|
||||
if self._rbufsize <= 1:
|
||||
recv_size = self.default_bufsize
|
||||
else:
|
||||
recv_size = self._rbufsize
|
||||
while True:
|
||||
data = self._sslobj.read(recv_size)
|
||||
if not data:
|
||||
break
|
||||
buffers.append(data)
|
||||
return "".join(buffers)
|
||||
else:
|
||||
# Read until size bytes or EOF seen, whichever comes first
|
||||
buf_len = len(data)
|
||||
if buf_len >= size:
|
||||
self._rbuf = data[size:]
|
||||
return data[:size]
|
||||
buffers = []
|
||||
if data:
|
||||
buffers.append(data)
|
||||
self._rbuf = ""
|
||||
while True:
|
||||
left = size - buf_len
|
||||
recv_size = max(self._rbufsize, left)
|
||||
data = self._sslobj.read(recv_size)
|
||||
if not data:
|
||||
break
|
||||
buffers.append(data)
|
||||
n = len(data)
|
||||
if n >= left:
|
||||
self._rbuf = data[left:]
|
||||
buffers[-1] = data[:left]
|
||||
break
|
||||
buf_len += n
|
||||
return "".join(buffers)
|
||||
|
||||
def readline(self, size=-1):
|
||||
data = self._rbuf
|
||||
if size < 0:
|
||||
# Read until \n or EOF, whichever comes first
|
||||
if self._rbufsize <= 1:
|
||||
# Speed up unbuffered case
|
||||
assert data == ""
|
||||
buffers = []
|
||||
while data != "\n":
|
||||
data = self._sslobj.read(1)
|
||||
if not data:
|
||||
break
|
||||
buffers.append(data)
|
||||
return "".join(buffers)
|
||||
nl = data.find('\n')
|
||||
if nl >= 0:
|
||||
nl += 1
|
||||
self._rbuf = data[nl:]
|
||||
return data[:nl]
|
||||
buffers = []
|
||||
if data:
|
||||
buffers.append(data)
|
||||
self._rbuf = ""
|
||||
while True:
|
||||
data = self._sslobj.read(self._rbufsize)
|
||||
if not data:
|
||||
break
|
||||
buffers.append(data)
|
||||
nl = data.find('\n')
|
||||
if nl >= 0:
|
||||
nl += 1
|
||||
self._rbuf = data[nl:]
|
||||
buffers[-1] = data[:nl]
|
||||
break
|
||||
return "".join(buffers)
|
||||
else:
|
||||
# Read until size bytes or \n or EOF seen, whichever comes first
|
||||
nl = data.find('\n', 0, size)
|
||||
if nl >= 0:
|
||||
nl += 1
|
||||
self._rbuf = data[nl:]
|
||||
return data[:nl]
|
||||
buf_len = len(data)
|
||||
if buf_len >= size:
|
||||
self._rbuf = data[size:]
|
||||
return data[:size]
|
||||
buffers = []
|
||||
if data:
|
||||
buffers.append(data)
|
||||
self._rbuf = ""
|
||||
while True:
|
||||
data = self._sslobj.read(self._rbufsize)
|
||||
if not data:
|
||||
break
|
||||
buffers.append(data)
|
||||
left = size - buf_len
|
||||
nl = data.find('\n', 0, left)
|
||||
if nl >= 0:
|
||||
nl += 1
|
||||
self._rbuf = data[nl:]
|
||||
buffers[-1] = data[:nl]
|
||||
break
|
||||
n = len(data)
|
||||
if n >= left:
|
||||
self._rbuf = data[left:]
|
||||
buffers[-1] = data[:left]
|
||||
break
|
||||
buf_len += n
|
||||
return "".join(buffers)
|
||||
|
||||
def readlines(self, sizehint=0):
|
||||
total = 0
|
||||
list = []
|
||||
while True:
|
||||
line = self.readline()
|
||||
if not line:
|
||||
break
|
||||
list.append(line)
|
||||
total += len(line)
|
||||
if sizehint and total >= sizehint:
|
||||
break
|
||||
return list
|
||||
|
||||
# Iterator protocols
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
line = self.readline()
|
||||
if not line:
|
||||
raise StopIteration
|
||||
return line
|
||||
|
||||
|
||||
|
||||
|
||||
def wrap_socket(sock, keyfile=None, certfile=None,
|
||||
server_side=False, cert_reqs=CERT_NONE,
|
||||
ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||
|
||||
return SSLSocket(sock, keyfile=keyfile, certfile=certfile,
|
||||
server_side=server_side, cert_reqs=cert_reqs,
|
||||
ssl_version=ssl_version, ca_certs=ca_certs)
|
||||
|
||||
# some utility functions
|
||||
|
||||
def cert_time_to_seconds(cert_time):
|
||||
|
@ -228,6 +478,71 @@ def cert_time_to_seconds(cert_time):
|
|||
import time
|
||||
return time.mktime(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT"))
|
||||
|
||||
PEM_HEADER = "-----BEGIN CERTIFICATE-----"
|
||||
PEM_FOOTER = "-----END CERTIFICATE-----"
|
||||
|
||||
def DER_cert_to_PEM_cert(der_cert_bytes):
|
||||
|
||||
"""Takes a certificate in binary DER format and returns the
|
||||
PEM version of it as a string."""
|
||||
|
||||
if hasattr(base64, 'standard_b64encode'):
|
||||
# preferred because older API gets line-length wrong
|
||||
f = base64.standard_b64encode(der_cert_bytes)
|
||||
return (PEM_HEADER + '\n' +
|
||||
textwrap.fill(f, 64) +
|
||||
PEM_FOOTER + '\n')
|
||||
else:
|
||||
return (PEM_HEADER + '\n' +
|
||||
base64.encodestring(der_cert_bytes) +
|
||||
PEM_FOOTER + '\n')
|
||||
|
||||
def PEM_cert_to_DER_cert(pem_cert_string):
|
||||
|
||||
"""Takes a certificate in ASCII PEM format and returns the
|
||||
DER-encoded version of it as a byte sequence"""
|
||||
|
||||
if not pem_cert_string.startswith(PEM_HEADER):
|
||||
raise ValueError("Invalid PEM encoding; must start with %s"
|
||||
% PEM_HEADER)
|
||||
if not pem_cert_string.strip().endswith(PEM_FOOTER):
|
||||
raise ValueError("Invalid PEM encoding; must end with %s"
|
||||
% PEM_FOOTER)
|
||||
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||
return base64.decodestring(d)
|
||||
|
||||
def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||
|
||||
"""Retrieve the certificate from the server at the specified address,
|
||||
and return it as a PEM-encoded string.
|
||||
If 'ca_certs' is specified, validate the server cert against it.
|
||||
If 'ssl_version' is specified, use it in the connection attempt."""
|
||||
|
||||
host, port = addr
|
||||
if (ca_certs is not None):
|
||||
cert_reqs = CERT_REQUIRED
|
||||
else:
|
||||
cert_reqs = CERT_NONE
|
||||
s = wrap_socket(socket(), ssl_version=ssl_version,
|
||||
cert_reqs=cert_reqs, ca_certs=ca_certs)
|
||||
s.connect(addr)
|
||||
dercert = s.getpeercert(True)
|
||||
s.close()
|
||||
return DER_cert_to_PEM_cert(dercert)
|
||||
|
||||
def get_protocol_name (protocol_code):
|
||||
if protocol_code == PROTOCOL_TLSv1:
|
||||
return "TLSv1"
|
||||
elif protocol_code == PROTOCOL_SSLv23:
|
||||
return "SSLv23"
|
||||
elif protocol_code == PROTOCOL_SSLv2:
|
||||
return "SSLv2"
|
||||
elif protocol_code == PROTOCOL_SSLv3:
|
||||
return "SSLv3"
|
||||
else:
|
||||
return "<unknown>"
|
||||
|
||||
|
||||
# a replacement for the old socket.ssl function
|
||||
|
||||
def sslwrap_simple (sock, keyfile=None, certfile=None):
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L
|
||||
opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH
|
||||
fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB
|
||||
AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU
|
||||
D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA
|
||||
IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM
|
||||
oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0
|
||||
ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/
|
||||
loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j
|
||||
oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA
|
||||
z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq
|
||||
ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV
|
||||
q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
Just bad cert data
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L
|
||||
opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH
|
||||
fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB
|
||||
AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU
|
||||
D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA
|
||||
IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM
|
||||
oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0
|
||||
ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/
|
||||
loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j
|
||||
oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA
|
||||
z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq
|
||||
ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV
|
||||
q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
Just bad cert data
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,40 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Bad Key, though the cert should be OK
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD
|
||||
VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x
|
||||
IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT
|
||||
U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1
|
||||
NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl
|
||||
bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m
|
||||
dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj
|
||||
aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh
|
||||
m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8
|
||||
M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn
|
||||
fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC
|
||||
AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb
|
||||
08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx
|
||||
CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/
|
||||
iHkC6gGdBJhogs4=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Bad Key, though the cert should be OK
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD
|
||||
VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x
|
||||
IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT
|
||||
U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1
|
||||
NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl
|
||||
bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m
|
||||
dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj
|
||||
aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh
|
||||
m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8
|
||||
M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn
|
||||
fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC
|
||||
AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb
|
||||
08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx
|
||||
CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/
|
||||
iHkC6gGdBJhogs4=
|
||||
-----END CERTIFICATE-----
|
|
@ -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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,338 @@
|
|||
------------------------------------------------------------------------
|
||||
-- and.decTest -- digitwise logical AND --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
|
||||
-- Sanity check (truth table)
|
||||
andx001 and 0 0 -> 0
|
||||
andx002 and 0 1 -> 0
|
||||
andx003 and 1 0 -> 0
|
||||
andx004 and 1 1 -> 1
|
||||
andx005 and 1100 1010 -> 1000
|
||||
andx006 and 1111 10 -> 10
|
||||
andx007 and 1111 1010 -> 1010
|
||||
|
||||
-- and at msd and msd-1
|
||||
andx010 and 000000000 000000000 -> 0
|
||||
andx011 and 000000000 100000000 -> 0
|
||||
andx012 and 100000000 000000000 -> 0
|
||||
andx013 and 100000000 100000000 -> 100000000
|
||||
andx014 and 000000000 000000000 -> 0
|
||||
andx015 and 000000000 010000000 -> 0
|
||||
andx016 and 010000000 000000000 -> 0
|
||||
andx017 and 010000000 010000000 -> 10000000
|
||||
|
||||
-- Various lengths
|
||||
-- 123456789 123456789 123456789
|
||||
andx021 and 111111111 111111111 -> 111111111
|
||||
andx022 and 111111111111 111111111 -> 111111111
|
||||
andx023 and 111111111111 11111111 -> 11111111
|
||||
andx024 and 111111111 11111111 -> 11111111
|
||||
andx025 and 111111111 1111111 -> 1111111
|
||||
andx026 and 111111111111 111111 -> 111111
|
||||
andx027 and 111111111111 11111 -> 11111
|
||||
andx028 and 111111111111 1111 -> 1111
|
||||
andx029 and 111111111111 111 -> 111
|
||||
andx031 and 111111111111 11 -> 11
|
||||
andx032 and 111111111111 1 -> 1
|
||||
andx033 and 111111111111 1111111111 -> 111111111
|
||||
andx034 and 11111111111 11111111111 -> 111111111
|
||||
andx035 and 1111111111 111111111111 -> 111111111
|
||||
andx036 and 111111111 1111111111111 -> 111111111
|
||||
|
||||
andx040 and 111111111 111111111111 -> 111111111
|
||||
andx041 and 11111111 111111111111 -> 11111111
|
||||
andx042 and 11111111 111111111 -> 11111111
|
||||
andx043 and 1111111 111111111 -> 1111111
|
||||
andx044 and 111111 111111111 -> 111111
|
||||
andx045 and 11111 111111111 -> 11111
|
||||
andx046 and 1111 111111111 -> 1111
|
||||
andx047 and 111 111111111 -> 111
|
||||
andx048 and 11 111111111 -> 11
|
||||
andx049 and 1 111111111 -> 1
|
||||
|
||||
andx050 and 1111111111 1 -> 1
|
||||
andx051 and 111111111 1 -> 1
|
||||
andx052 and 11111111 1 -> 1
|
||||
andx053 and 1111111 1 -> 1
|
||||
andx054 and 111111 1 -> 1
|
||||
andx055 and 11111 1 -> 1
|
||||
andx056 and 1111 1 -> 1
|
||||
andx057 and 111 1 -> 1
|
||||
andx058 and 11 1 -> 1
|
||||
andx059 and 1 1 -> 1
|
||||
|
||||
andx060 and 1111111111 0 -> 0
|
||||
andx061 and 111111111 0 -> 0
|
||||
andx062 and 11111111 0 -> 0
|
||||
andx063 and 1111111 0 -> 0
|
||||
andx064 and 111111 0 -> 0
|
||||
andx065 and 11111 0 -> 0
|
||||
andx066 and 1111 0 -> 0
|
||||
andx067 and 111 0 -> 0
|
||||
andx068 and 11 0 -> 0
|
||||
andx069 and 1 0 -> 0
|
||||
|
||||
andx070 and 1 1111111111 -> 1
|
||||
andx071 and 1 111111111 -> 1
|
||||
andx072 and 1 11111111 -> 1
|
||||
andx073 and 1 1111111 -> 1
|
||||
andx074 and 1 111111 -> 1
|
||||
andx075 and 1 11111 -> 1
|
||||
andx076 and 1 1111 -> 1
|
||||
andx077 and 1 111 -> 1
|
||||
andx078 and 1 11 -> 1
|
||||
andx079 and 1 1 -> 1
|
||||
|
||||
andx080 and 0 1111111111 -> 0
|
||||
andx081 and 0 111111111 -> 0
|
||||
andx082 and 0 11111111 -> 0
|
||||
andx083 and 0 1111111 -> 0
|
||||
andx084 and 0 111111 -> 0
|
||||
andx085 and 0 11111 -> 0
|
||||
andx086 and 0 1111 -> 0
|
||||
andx087 and 0 111 -> 0
|
||||
andx088 and 0 11 -> 0
|
||||
andx089 and 0 1 -> 0
|
||||
|
||||
andx090 and 011111111 111111111 -> 11111111
|
||||
andx091 and 101111111 111111111 -> 101111111
|
||||
andx092 and 110111111 111111111 -> 110111111
|
||||
andx093 and 111011111 111111111 -> 111011111
|
||||
andx094 and 111101111 111111111 -> 111101111
|
||||
andx095 and 111110111 111111111 -> 111110111
|
||||
andx096 and 111111011 111111111 -> 111111011
|
||||
andx097 and 111111101 111111111 -> 111111101
|
||||
andx098 and 111111110 111111111 -> 111111110
|
||||
|
||||
andx100 and 111111111 011111111 -> 11111111
|
||||
andx101 and 111111111 101111111 -> 101111111
|
||||
andx102 and 111111111 110111111 -> 110111111
|
||||
andx103 and 111111111 111011111 -> 111011111
|
||||
andx104 and 111111111 111101111 -> 111101111
|
||||
andx105 and 111111111 111110111 -> 111110111
|
||||
andx106 and 111111111 111111011 -> 111111011
|
||||
andx107 and 111111111 111111101 -> 111111101
|
||||
andx108 and 111111111 111111110 -> 111111110
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
andx220 and 111111112 111111111 -> NaN Invalid_operation
|
||||
andx221 and 333333333 333333333 -> NaN Invalid_operation
|
||||
andx222 and 555555555 555555555 -> NaN Invalid_operation
|
||||
andx223 and 777777777 777777777 -> NaN Invalid_operation
|
||||
andx224 and 999999999 999999999 -> NaN Invalid_operation
|
||||
andx225 and 222222222 999999999 -> NaN Invalid_operation
|
||||
andx226 and 444444444 999999999 -> NaN Invalid_operation
|
||||
andx227 and 666666666 999999999 -> NaN Invalid_operation
|
||||
andx228 and 888888888 999999999 -> NaN Invalid_operation
|
||||
andx229 and 999999999 222222222 -> NaN Invalid_operation
|
||||
andx230 and 999999999 444444444 -> NaN Invalid_operation
|
||||
andx231 and 999999999 666666666 -> NaN Invalid_operation
|
||||
andx232 and 999999999 888888888 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
andx240 and 567468689 -934981942 -> NaN Invalid_operation
|
||||
andx241 and 567367689 934981942 -> NaN Invalid_operation
|
||||
andx242 and -631917772 -706014634 -> NaN Invalid_operation
|
||||
andx243 and -756253257 138579234 -> NaN Invalid_operation
|
||||
andx244 and 835590149 567435400 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
andx250 and 200000000 100000000 -> NaN Invalid_operation
|
||||
andx251 and 700000000 100000000 -> NaN Invalid_operation
|
||||
andx252 and 800000000 100000000 -> NaN Invalid_operation
|
||||
andx253 and 900000000 100000000 -> NaN Invalid_operation
|
||||
andx254 and 200000000 000000000 -> NaN Invalid_operation
|
||||
andx255 and 700000000 000000000 -> NaN Invalid_operation
|
||||
andx256 and 800000000 000000000 -> NaN Invalid_operation
|
||||
andx257 and 900000000 000000000 -> NaN Invalid_operation
|
||||
andx258 and 100000000 200000000 -> NaN Invalid_operation
|
||||
andx259 and 100000000 700000000 -> NaN Invalid_operation
|
||||
andx260 and 100000000 800000000 -> NaN Invalid_operation
|
||||
andx261 and 100000000 900000000 -> NaN Invalid_operation
|
||||
andx262 and 000000000 200000000 -> NaN Invalid_operation
|
||||
andx263 and 000000000 700000000 -> NaN Invalid_operation
|
||||
andx264 and 000000000 800000000 -> NaN Invalid_operation
|
||||
andx265 and 000000000 900000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
andx270 and 020000000 100000000 -> NaN Invalid_operation
|
||||
andx271 and 070100000 100000000 -> NaN Invalid_operation
|
||||
andx272 and 080010000 100000001 -> NaN Invalid_operation
|
||||
andx273 and 090001000 100000010 -> NaN Invalid_operation
|
||||
andx274 and 100000100 020010100 -> NaN Invalid_operation
|
||||
andx275 and 100000000 070001000 -> NaN Invalid_operation
|
||||
andx276 and 100000010 080010100 -> NaN Invalid_operation
|
||||
andx277 and 100000000 090000010 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
andx280 and 001000002 100000000 -> NaN Invalid_operation
|
||||
andx281 and 000000007 100000000 -> NaN Invalid_operation
|
||||
andx282 and 000000008 100000000 -> NaN Invalid_operation
|
||||
andx283 and 000000009 100000000 -> NaN Invalid_operation
|
||||
andx284 and 100000000 000100002 -> NaN Invalid_operation
|
||||
andx285 and 100100000 001000007 -> NaN Invalid_operation
|
||||
andx286 and 100010000 010000008 -> NaN Invalid_operation
|
||||
andx287 and 100001000 100000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
andx288 and 001020000 100000000 -> NaN Invalid_operation
|
||||
andx289 and 000070001 100000000 -> NaN Invalid_operation
|
||||
andx290 and 000080000 100010000 -> NaN Invalid_operation
|
||||
andx291 and 000090000 100001000 -> NaN Invalid_operation
|
||||
andx292 and 100000010 000020100 -> NaN Invalid_operation
|
||||
andx293 and 100100000 000070010 -> NaN Invalid_operation
|
||||
andx294 and 100010100 000080001 -> NaN Invalid_operation
|
||||
andx295 and 100001000 000090000 -> NaN Invalid_operation
|
||||
-- signs
|
||||
andx296 and -100001000 -000000000 -> NaN Invalid_operation
|
||||
andx297 and -100001000 000010000 -> NaN Invalid_operation
|
||||
andx298 and 100001000 -000000000 -> NaN Invalid_operation
|
||||
andx299 and 100001000 000011000 -> 1000
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
andx331 and 2 9.99999999E+999 -> NaN Invalid_operation
|
||||
andx332 and 3 1E-999 -> NaN Invalid_operation
|
||||
andx333 and 4 1.00000000E-999 -> NaN Invalid_operation
|
||||
andx334 and 5 1E-1007 -> NaN Invalid_operation
|
||||
andx335 and 6 -1E-1007 -> NaN Invalid_operation
|
||||
andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation
|
||||
andx337 and 8 -1E-999 -> NaN Invalid_operation
|
||||
andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation
|
||||
andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation
|
||||
andx342 and 1E-999 01 -> NaN Invalid_operation
|
||||
andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation
|
||||
andx344 and 1E-1007 18 -> NaN Invalid_operation
|
||||
andx345 and -1E-1007 -10 -> NaN Invalid_operation
|
||||
andx346 and -1.00000000E-999 18 -> NaN Invalid_operation
|
||||
andx347 and -1E-999 10 -> NaN Invalid_operation
|
||||
andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
andx361 and 1.0 1 -> NaN Invalid_operation
|
||||
andx362 and 1E+1 1 -> NaN Invalid_operation
|
||||
andx363 and 0.0 1 -> NaN Invalid_operation
|
||||
andx364 and 0E+1 1 -> NaN Invalid_operation
|
||||
andx365 and 9.9 1 -> NaN Invalid_operation
|
||||
andx366 and 9E+1 1 -> NaN Invalid_operation
|
||||
andx371 and 0 1.0 -> NaN Invalid_operation
|
||||
andx372 and 0 1E+1 -> NaN Invalid_operation
|
||||
andx373 and 0 0.0 -> NaN Invalid_operation
|
||||
andx374 and 0 0E+1 -> NaN Invalid_operation
|
||||
andx375 and 0 9.9 -> NaN Invalid_operation
|
||||
andx376 and 0 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
andx780 and -Inf -Inf -> NaN Invalid_operation
|
||||
andx781 and -Inf -1000 -> NaN Invalid_operation
|
||||
andx782 and -Inf -1 -> NaN Invalid_operation
|
||||
andx783 and -Inf -0 -> NaN Invalid_operation
|
||||
andx784 and -Inf 0 -> NaN Invalid_operation
|
||||
andx785 and -Inf 1 -> NaN Invalid_operation
|
||||
andx786 and -Inf 1000 -> NaN Invalid_operation
|
||||
andx787 and -1000 -Inf -> NaN Invalid_operation
|
||||
andx788 and -Inf -Inf -> NaN Invalid_operation
|
||||
andx789 and -1 -Inf -> NaN Invalid_operation
|
||||
andx790 and -0 -Inf -> NaN Invalid_operation
|
||||
andx791 and 0 -Inf -> NaN Invalid_operation
|
||||
andx792 and 1 -Inf -> NaN Invalid_operation
|
||||
andx793 and 1000 -Inf -> NaN Invalid_operation
|
||||
andx794 and Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
andx800 and Inf -Inf -> NaN Invalid_operation
|
||||
andx801 and Inf -1000 -> NaN Invalid_operation
|
||||
andx802 and Inf -1 -> NaN Invalid_operation
|
||||
andx803 and Inf -0 -> NaN Invalid_operation
|
||||
andx804 and Inf 0 -> NaN Invalid_operation
|
||||
andx805 and Inf 1 -> NaN Invalid_operation
|
||||
andx806 and Inf 1000 -> NaN Invalid_operation
|
||||
andx807 and Inf Inf -> NaN Invalid_operation
|
||||
andx808 and -1000 Inf -> NaN Invalid_operation
|
||||
andx809 and -Inf Inf -> NaN Invalid_operation
|
||||
andx810 and -1 Inf -> NaN Invalid_operation
|
||||
andx811 and -0 Inf -> NaN Invalid_operation
|
||||
andx812 and 0 Inf -> NaN Invalid_operation
|
||||
andx813 and 1 Inf -> NaN Invalid_operation
|
||||
andx814 and 1000 Inf -> NaN Invalid_operation
|
||||
andx815 and Inf Inf -> NaN Invalid_operation
|
||||
|
||||
andx821 and NaN -Inf -> NaN Invalid_operation
|
||||
andx822 and NaN -1000 -> NaN Invalid_operation
|
||||
andx823 and NaN -1 -> NaN Invalid_operation
|
||||
andx824 and NaN -0 -> NaN Invalid_operation
|
||||
andx825 and NaN 0 -> NaN Invalid_operation
|
||||
andx826 and NaN 1 -> NaN Invalid_operation
|
||||
andx827 and NaN 1000 -> NaN Invalid_operation
|
||||
andx828 and NaN Inf -> NaN Invalid_operation
|
||||
andx829 and NaN NaN -> NaN Invalid_operation
|
||||
andx830 and -Inf NaN -> NaN Invalid_operation
|
||||
andx831 and -1000 NaN -> NaN Invalid_operation
|
||||
andx832 and -1 NaN -> NaN Invalid_operation
|
||||
andx833 and -0 NaN -> NaN Invalid_operation
|
||||
andx834 and 0 NaN -> NaN Invalid_operation
|
||||
andx835 and 1 NaN -> NaN Invalid_operation
|
||||
andx836 and 1000 NaN -> NaN Invalid_operation
|
||||
andx837 and Inf NaN -> NaN Invalid_operation
|
||||
|
||||
andx841 and sNaN -Inf -> NaN Invalid_operation
|
||||
andx842 and sNaN -1000 -> NaN Invalid_operation
|
||||
andx843 and sNaN -1 -> NaN Invalid_operation
|
||||
andx844 and sNaN -0 -> NaN Invalid_operation
|
||||
andx845 and sNaN 0 -> NaN Invalid_operation
|
||||
andx846 and sNaN 1 -> NaN Invalid_operation
|
||||
andx847 and sNaN 1000 -> NaN Invalid_operation
|
||||
andx848 and sNaN NaN -> NaN Invalid_operation
|
||||
andx849 and sNaN sNaN -> NaN Invalid_operation
|
||||
andx850 and NaN sNaN -> NaN Invalid_operation
|
||||
andx851 and -Inf sNaN -> NaN Invalid_operation
|
||||
andx852 and -1000 sNaN -> NaN Invalid_operation
|
||||
andx853 and -1 sNaN -> NaN Invalid_operation
|
||||
andx854 and -0 sNaN -> NaN Invalid_operation
|
||||
andx855 and 0 sNaN -> NaN Invalid_operation
|
||||
andx856 and 1 sNaN -> NaN Invalid_operation
|
||||
andx857 and 1000 sNaN -> NaN Invalid_operation
|
||||
andx858 and Inf sNaN -> NaN Invalid_operation
|
||||
andx859 and NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
andx861 and NaN1 -Inf -> NaN Invalid_operation
|
||||
andx862 and +NaN2 -1000 -> NaN Invalid_operation
|
||||
andx863 and NaN3 1000 -> NaN Invalid_operation
|
||||
andx864 and NaN4 Inf -> NaN Invalid_operation
|
||||
andx865 and NaN5 +NaN6 -> NaN Invalid_operation
|
||||
andx866 and -Inf NaN7 -> NaN Invalid_operation
|
||||
andx867 and -1000 NaN8 -> NaN Invalid_operation
|
||||
andx868 and 1000 NaN9 -> NaN Invalid_operation
|
||||
andx869 and Inf +NaN10 -> NaN Invalid_operation
|
||||
andx871 and sNaN11 -Inf -> NaN Invalid_operation
|
||||
andx872 and sNaN12 -1000 -> NaN Invalid_operation
|
||||
andx873 and sNaN13 1000 -> NaN Invalid_operation
|
||||
andx874 and sNaN14 NaN17 -> NaN Invalid_operation
|
||||
andx875 and sNaN15 sNaN18 -> NaN Invalid_operation
|
||||
andx876 and NaN16 sNaN19 -> NaN Invalid_operation
|
||||
andx877 and -Inf +sNaN20 -> NaN Invalid_operation
|
||||
andx878 and -1000 sNaN21 -> NaN Invalid_operation
|
||||
andx879 and 1000 sNaN22 -> NaN Invalid_operation
|
||||
andx880 and Inf sNaN23 -> NaN Invalid_operation
|
||||
andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation
|
||||
andx882 and -NaN26 NaN28 -> NaN Invalid_operation
|
||||
andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation
|
||||
andx884 and 1000 -NaN30 -> NaN Invalid_operation
|
||||
andx885 and 1000 -sNaN31 -> NaN Invalid_operation
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
------------------------------------------------------------------------
|
||||
-- class.decTest -- Class operations --
|
||||
-- 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
|
||||
|
||||
-- [New 2006.11.27]
|
||||
|
||||
precision: 9
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
clasx001 class 0 -> +Zero
|
||||
clasx002 class 0.00 -> +Zero
|
||||
clasx003 class 0E+5 -> +Zero
|
||||
clasx004 class 1E-1007 -> +Subnormal
|
||||
clasx005 class 0.1E-999 -> +Subnormal
|
||||
clasx006 class 0.99999999E-999 -> +Subnormal
|
||||
clasx007 class 1.00000000E-999 -> +Normal
|
||||
clasx008 class 1E-999 -> +Normal
|
||||
clasx009 class 1E-100 -> +Normal
|
||||
clasx010 class 1E-10 -> +Normal
|
||||
clasx012 class 1E-1 -> +Normal
|
||||
clasx013 class 1 -> +Normal
|
||||
clasx014 class 2.50 -> +Normal
|
||||
clasx015 class 100.100 -> +Normal
|
||||
clasx016 class 1E+30 -> +Normal
|
||||
clasx017 class 1E+999 -> +Normal
|
||||
clasx018 class 9.99999999E+999 -> +Normal
|
||||
clasx019 class Inf -> +Infinity
|
||||
|
||||
clasx021 class -0 -> -Zero
|
||||
clasx022 class -0.00 -> -Zero
|
||||
clasx023 class -0E+5 -> -Zero
|
||||
clasx024 class -1E-1007 -> -Subnormal
|
||||
clasx025 class -0.1E-999 -> -Subnormal
|
||||
clasx026 class -0.99999999E-999 -> -Subnormal
|
||||
clasx027 class -1.00000000E-999 -> -Normal
|
||||
clasx028 class -1E-999 -> -Normal
|
||||
clasx029 class -1E-100 -> -Normal
|
||||
clasx030 class -1E-10 -> -Normal
|
||||
clasx032 class -1E-1 -> -Normal
|
||||
clasx033 class -1 -> -Normal
|
||||
clasx034 class -2.50 -> -Normal
|
||||
clasx035 class -100.100 -> -Normal
|
||||
clasx036 class -1E+30 -> -Normal
|
||||
clasx037 class -1E+999 -> -Normal
|
||||
clasx038 class -9.99999999E+999 -> -Normal
|
||||
clasx039 class -Inf -> -Infinity
|
||||
|
||||
clasx041 class NaN -> NaN
|
||||
clasx042 class -NaN -> NaN
|
||||
clasx043 class +NaN12345 -> NaN
|
||||
clasx044 class sNaN -> sNaN
|
||||
clasx045 class -sNaN -> sNaN
|
||||
clasx046 class +sNaN12345 -> sNaN
|
||||
|
||||
|
||||
-- decimal64 bounds
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
clasx201 class 0 -> +Zero
|
||||
clasx202 class 0.00 -> +Zero
|
||||
clasx203 class 0E+5 -> +Zero
|
||||
clasx204 class 1E-396 -> +Subnormal
|
||||
clasx205 class 0.1E-383 -> +Subnormal
|
||||
clasx206 class 0.999999999999999E-383 -> +Subnormal
|
||||
clasx207 class 1.000000000000000E-383 -> +Normal
|
||||
clasx208 class 1E-383 -> +Normal
|
||||
clasx209 class 1E-100 -> +Normal
|
||||
clasx210 class 1E-10 -> +Normal
|
||||
clasx212 class 1E-1 -> +Normal
|
||||
clasx213 class 1 -> +Normal
|
||||
clasx214 class 2.50 -> +Normal
|
||||
clasx215 class 100.100 -> +Normal
|
||||
clasx216 class 1E+30 -> +Normal
|
||||
clasx217 class 1E+384 -> +Normal
|
||||
clasx218 class 9.999999999999999E+384 -> +Normal
|
||||
clasx219 class Inf -> +Infinity
|
||||
|
||||
clasx221 class -0 -> -Zero
|
||||
clasx222 class -0.00 -> -Zero
|
||||
clasx223 class -0E+5 -> -Zero
|
||||
clasx224 class -1E-396 -> -Subnormal
|
||||
clasx225 class -0.1E-383 -> -Subnormal
|
||||
clasx226 class -0.999999999999999E-383 -> -Subnormal
|
||||
clasx227 class -1.000000000000000E-383 -> -Normal
|
||||
clasx228 class -1E-383 -> -Normal
|
||||
clasx229 class -1E-100 -> -Normal
|
||||
clasx230 class -1E-10 -> -Normal
|
||||
clasx232 class -1E-1 -> -Normal
|
||||
clasx233 class -1 -> -Normal
|
||||
clasx234 class -2.50 -> -Normal
|
||||
clasx235 class -100.100 -> -Normal
|
||||
clasx236 class -1E+30 -> -Normal
|
||||
clasx237 class -1E+384 -> -Normal
|
||||
clasx238 class -9.999999999999999E+384 -> -Normal
|
||||
clasx239 class -Inf -> -Infinity
|
||||
|
||||
clasx241 class NaN -> NaN
|
||||
clasx242 class -NaN -> NaN
|
||||
clasx243 class +NaN12345 -> NaN
|
||||
clasx244 class sNaN -> sNaN
|
||||
clasx245 class -sNaN -> sNaN
|
||||
clasx246 class +sNaN12345 -> sNaN
|
||||
|
||||
|
||||
|
|
@ -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 --
|
||||
|
@ -17,11 +17,11 @@
|
|||
-- 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
|
||||
|
|
|
@ -0,0 +1,798 @@
|
|||
------------------------------------------------------------------------
|
||||
-- comparetotal.decTest -- decimal comparison using total ordering --
|
||||
-- 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
|
||||
|
||||
-- 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 necessary).
|
||||
-- Similarly, comparetotal will have some radically different paths
|
||||
-- than compare.
|
||||
|
||||
extended: 1
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
|
||||
-- sanity checks
|
||||
cotx001 comparetotal -2 -2 -> 0
|
||||
cotx002 comparetotal -2 -1 -> -1
|
||||
cotx003 comparetotal -2 0 -> -1
|
||||
cotx004 comparetotal -2 1 -> -1
|
||||
cotx005 comparetotal -2 2 -> -1
|
||||
cotx006 comparetotal -1 -2 -> 1
|
||||
cotx007 comparetotal -1 -1 -> 0
|
||||
cotx008 comparetotal -1 0 -> -1
|
||||
cotx009 comparetotal -1 1 -> -1
|
||||
cotx010 comparetotal -1 2 -> -1
|
||||
cotx011 comparetotal 0 -2 -> 1
|
||||
cotx012 comparetotal 0 -1 -> 1
|
||||
cotx013 comparetotal 0 0 -> 0
|
||||
cotx014 comparetotal 0 1 -> -1
|
||||
cotx015 comparetotal 0 2 -> -1
|
||||
cotx016 comparetotal 1 -2 -> 1
|
||||
cotx017 comparetotal 1 -1 -> 1
|
||||
cotx018 comparetotal 1 0 -> 1
|
||||
cotx019 comparetotal 1 1 -> 0
|
||||
cotx020 comparetotal 1 2 -> -1
|
||||
cotx021 comparetotal 2 -2 -> 1
|
||||
cotx022 comparetotal 2 -1 -> 1
|
||||
cotx023 comparetotal 2 0 -> 1
|
||||
cotx025 comparetotal 2 1 -> 1
|
||||
cotx026 comparetotal 2 2 -> 0
|
||||
|
||||
cotx031 comparetotal -20 -20 -> 0
|
||||
cotx032 comparetotal -20 -10 -> -1
|
||||
cotx033 comparetotal -20 00 -> -1
|
||||
cotx034 comparetotal -20 10 -> -1
|
||||
cotx035 comparetotal -20 20 -> -1
|
||||
cotx036 comparetotal -10 -20 -> 1
|
||||
cotx037 comparetotal -10 -10 -> 0
|
||||
cotx038 comparetotal -10 00 -> -1
|
||||
cotx039 comparetotal -10 10 -> -1
|
||||
cotx040 comparetotal -10 20 -> -1
|
||||
cotx041 comparetotal 00 -20 -> 1
|
||||
cotx042 comparetotal 00 -10 -> 1
|
||||
cotx043 comparetotal 00 00 -> 0
|
||||
cotx044 comparetotal 00 10 -> -1
|
||||
cotx045 comparetotal 00 20 -> -1
|
||||
cotx046 comparetotal 10 -20 -> 1
|
||||
cotx047 comparetotal 10 -10 -> 1
|
||||
cotx048 comparetotal 10 00 -> 1
|
||||
cotx049 comparetotal 10 10 -> 0
|
||||
cotx050 comparetotal 10 20 -> -1
|
||||
cotx051 comparetotal 20 -20 -> 1
|
||||
cotx052 comparetotal 20 -10 -> 1
|
||||
cotx053 comparetotal 20 00 -> 1
|
||||
cotx055 comparetotal 20 10 -> 1
|
||||
cotx056 comparetotal 20 20 -> 0
|
||||
|
||||
cotx061 comparetotal -2.0 -2.0 -> 0
|
||||
cotx062 comparetotal -2.0 -1.0 -> -1
|
||||
cotx063 comparetotal -2.0 0.0 -> -1
|
||||
cotx064 comparetotal -2.0 1.0 -> -1
|
||||
cotx065 comparetotal -2.0 2.0 -> -1
|
||||
cotx066 comparetotal -1.0 -2.0 -> 1
|
||||
cotx067 comparetotal -1.0 -1.0 -> 0
|
||||
cotx068 comparetotal -1.0 0.0 -> -1
|
||||
cotx069 comparetotal -1.0 1.0 -> -1
|
||||
cotx070 comparetotal -1.0 2.0 -> -1
|
||||
cotx071 comparetotal 0.0 -2.0 -> 1
|
||||
cotx072 comparetotal 0.0 -1.0 -> 1
|
||||
cotx073 comparetotal 0.0 0.0 -> 0
|
||||
cotx074 comparetotal 0.0 1.0 -> -1
|
||||
cotx075 comparetotal 0.0 2.0 -> -1
|
||||
cotx076 comparetotal 1.0 -2.0 -> 1
|
||||
cotx077 comparetotal 1.0 -1.0 -> 1
|
||||
cotx078 comparetotal 1.0 0.0 -> 1
|
||||
cotx079 comparetotal 1.0 1.0 -> 0
|
||||
cotx080 comparetotal 1.0 2.0 -> -1
|
||||
cotx081 comparetotal 2.0 -2.0 -> 1
|
||||
cotx082 comparetotal 2.0 -1.0 -> 1
|
||||
cotx083 comparetotal 2.0 0.0 -> 1
|
||||
cotx085 comparetotal 2.0 1.0 -> 1
|
||||
cotx086 comparetotal 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
|
||||
cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
|
||||
cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
|
||||
-- Examples
|
||||
cotx094 comparetotal 12.73 127.9 -> -1
|
||||
cotx095 comparetotal -127 12 -> -1
|
||||
cotx096 comparetotal 12.30 12.3 -> -1
|
||||
cotx097 comparetotal 12.30 12.30 -> 0
|
||||
cotx098 comparetotal 12.3 12.300 -> 1
|
||||
cotx099 comparetotal 12.3 NaN -> -1
|
||||
|
||||
-- some differing length/exponent cases
|
||||
-- in this first group, compare would compare all equal
|
||||
cotx100 comparetotal 7.0 7.0 -> 0
|
||||
cotx101 comparetotal 7.0 7 -> -1
|
||||
cotx102 comparetotal 7 7.0 -> 1
|
||||
cotx103 comparetotal 7E+0 7.0 -> 1
|
||||
cotx104 comparetotal 70E-1 7.0 -> 0
|
||||
cotx105 comparetotal 0.7E+1 7 -> 0
|
||||
cotx106 comparetotal 70E-1 7 -> -1
|
||||
cotx107 comparetotal 7.0 7E+0 -> -1
|
||||
cotx108 comparetotal 7.0 70E-1 -> 0
|
||||
cotx109 comparetotal 7 0.7E+1 -> 0
|
||||
cotx110 comparetotal 7 70E-1 -> 1
|
||||
|
||||
cotx120 comparetotal 8.0 7.0 -> 1
|
||||
cotx121 comparetotal 8.0 7 -> 1
|
||||
cotx122 comparetotal 8 7.0 -> 1
|
||||
cotx123 comparetotal 8E+0 7.0 -> 1
|
||||
cotx124 comparetotal 80E-1 7.0 -> 1
|
||||
cotx125 comparetotal 0.8E+1 7 -> 1
|
||||
cotx126 comparetotal 80E-1 7 -> 1
|
||||
cotx127 comparetotal 8.0 7E+0 -> 1
|
||||
cotx128 comparetotal 8.0 70E-1 -> 1
|
||||
cotx129 comparetotal 8 0.7E+1 -> 1
|
||||
cotx130 comparetotal 8 70E-1 -> 1
|
||||
|
||||
cotx140 comparetotal 8.0 9.0 -> -1
|
||||
cotx141 comparetotal 8.0 9 -> -1
|
||||
cotx142 comparetotal 8 9.0 -> -1
|
||||
cotx143 comparetotal 8E+0 9.0 -> -1
|
||||
cotx144 comparetotal 80E-1 9.0 -> -1
|
||||
cotx145 comparetotal 0.8E+1 9 -> -1
|
||||
cotx146 comparetotal 80E-1 9 -> -1
|
||||
cotx147 comparetotal 8.0 9E+0 -> -1
|
||||
cotx148 comparetotal 8.0 90E-1 -> -1
|
||||
cotx149 comparetotal 8 0.9E+1 -> -1
|
||||
cotx150 comparetotal 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
cotx200 comparetotal -7.0 7.0 -> -1
|
||||
cotx201 comparetotal -7.0 7 -> -1
|
||||
cotx202 comparetotal -7 7.0 -> -1
|
||||
cotx203 comparetotal -7E+0 7.0 -> -1
|
||||
cotx204 comparetotal -70E-1 7.0 -> -1
|
||||
cotx205 comparetotal -0.7E+1 7 -> -1
|
||||
cotx206 comparetotal -70E-1 7 -> -1
|
||||
cotx207 comparetotal -7.0 7E+0 -> -1
|
||||
cotx208 comparetotal -7.0 70E-1 -> -1
|
||||
cotx209 comparetotal -7 0.7E+1 -> -1
|
||||
cotx210 comparetotal -7 70E-1 -> -1
|
||||
|
||||
cotx220 comparetotal -8.0 7.0 -> -1
|
||||
cotx221 comparetotal -8.0 7 -> -1
|
||||
cotx222 comparetotal -8 7.0 -> -1
|
||||
cotx223 comparetotal -8E+0 7.0 -> -1
|
||||
cotx224 comparetotal -80E-1 7.0 -> -1
|
||||
cotx225 comparetotal -0.8E+1 7 -> -1
|
||||
cotx226 comparetotal -80E-1 7 -> -1
|
||||
cotx227 comparetotal -8.0 7E+0 -> -1
|
||||
cotx228 comparetotal -8.0 70E-1 -> -1
|
||||
cotx229 comparetotal -8 0.7E+1 -> -1
|
||||
cotx230 comparetotal -8 70E-1 -> -1
|
||||
|
||||
cotx240 comparetotal -8.0 9.0 -> -1
|
||||
cotx241 comparetotal -8.0 9 -> -1
|
||||
cotx242 comparetotal -8 9.0 -> -1
|
||||
cotx243 comparetotal -8E+0 9.0 -> -1
|
||||
cotx244 comparetotal -80E-1 9.0 -> -1
|
||||
cotx245 comparetotal -0.8E+1 9 -> -1
|
||||
cotx246 comparetotal -80E-1 9 -> -1
|
||||
cotx247 comparetotal -8.0 9E+0 -> -1
|
||||
cotx248 comparetotal -8.0 90E-1 -> -1
|
||||
cotx249 comparetotal -8 0.9E+1 -> -1
|
||||
cotx250 comparetotal -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
cotx300 comparetotal 7.0 -7.0 -> 1
|
||||
cotx301 comparetotal 7.0 -7 -> 1
|
||||
cotx302 comparetotal 7 -7.0 -> 1
|
||||
cotx303 comparetotal 7E+0 -7.0 -> 1
|
||||
cotx304 comparetotal 70E-1 -7.0 -> 1
|
||||
cotx305 comparetotal .7E+1 -7 -> 1
|
||||
cotx306 comparetotal 70E-1 -7 -> 1
|
||||
cotx307 comparetotal 7.0 -7E+0 -> 1
|
||||
cotx308 comparetotal 7.0 -70E-1 -> 1
|
||||
cotx309 comparetotal 7 -.7E+1 -> 1
|
||||
cotx310 comparetotal 7 -70E-1 -> 1
|
||||
|
||||
cotx320 comparetotal 8.0 -7.0 -> 1
|
||||
cotx321 comparetotal 8.0 -7 -> 1
|
||||
cotx322 comparetotal 8 -7.0 -> 1
|
||||
cotx323 comparetotal 8E+0 -7.0 -> 1
|
||||
cotx324 comparetotal 80E-1 -7.0 -> 1
|
||||
cotx325 comparetotal .8E+1 -7 -> 1
|
||||
cotx326 comparetotal 80E-1 -7 -> 1
|
||||
cotx327 comparetotal 8.0 -7E+0 -> 1
|
||||
cotx328 comparetotal 8.0 -70E-1 -> 1
|
||||
cotx329 comparetotal 8 -.7E+1 -> 1
|
||||
cotx330 comparetotal 8 -70E-1 -> 1
|
||||
|
||||
cotx340 comparetotal 8.0 -9.0 -> 1
|
||||
cotx341 comparetotal 8.0 -9 -> 1
|
||||
cotx342 comparetotal 8 -9.0 -> 1
|
||||
cotx343 comparetotal 8E+0 -9.0 -> 1
|
||||
cotx344 comparetotal 80E-1 -9.0 -> 1
|
||||
cotx345 comparetotal .8E+1 -9 -> 1
|
||||
cotx346 comparetotal 80E-1 -9 -> 1
|
||||
cotx347 comparetotal 8.0 -9E+0 -> 1
|
||||
cotx348 comparetotal 8.0 -90E-1 -> 1
|
||||
cotx349 comparetotal 8 -.9E+1 -> 1
|
||||
cotx350 comparetotal 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
cotx400 comparetotal -7.0 -7.0 -> 0
|
||||
cotx401 comparetotal -7.0 -7 -> 1
|
||||
cotx402 comparetotal -7 -7.0 -> -1
|
||||
cotx403 comparetotal -7E+0 -7.0 -> -1
|
||||
cotx404 comparetotal -70E-1 -7.0 -> 0
|
||||
cotx405 comparetotal -.7E+1 -7 -> 0
|
||||
cotx406 comparetotal -70E-1 -7 -> 1
|
||||
cotx407 comparetotal -7.0 -7E+0 -> 1
|
||||
cotx408 comparetotal -7.0 -70E-1 -> 0
|
||||
cotx409 comparetotal -7 -.7E+1 -> 0
|
||||
cotx410 comparetotal -7 -70E-1 -> -1
|
||||
|
||||
cotx420 comparetotal -8.0 -7.0 -> -1
|
||||
cotx421 comparetotal -8.0 -7 -> -1
|
||||
cotx422 comparetotal -8 -7.0 -> -1
|
||||
cotx423 comparetotal -8E+0 -7.0 -> -1
|
||||
cotx424 comparetotal -80E-1 -7.0 -> -1
|
||||
cotx425 comparetotal -.8E+1 -7 -> -1
|
||||
cotx426 comparetotal -80E-1 -7 -> -1
|
||||
cotx427 comparetotal -8.0 -7E+0 -> -1
|
||||
cotx428 comparetotal -8.0 -70E-1 -> -1
|
||||
cotx429 comparetotal -8 -.7E+1 -> -1
|
||||
cotx430 comparetotal -8 -70E-1 -> -1
|
||||
|
||||
cotx440 comparetotal -8.0 -9.0 -> 1
|
||||
cotx441 comparetotal -8.0 -9 -> 1
|
||||
cotx442 comparetotal -8 -9.0 -> 1
|
||||
cotx443 comparetotal -8E+0 -9.0 -> 1
|
||||
cotx444 comparetotal -80E-1 -9.0 -> 1
|
||||
cotx445 comparetotal -.8E+1 -9 -> 1
|
||||
cotx446 comparetotal -80E-1 -9 -> 1
|
||||
cotx447 comparetotal -8.0 -9E+0 -> 1
|
||||
cotx448 comparetotal -8.0 -90E-1 -> 1
|
||||
cotx449 comparetotal -8 -.9E+1 -> 1
|
||||
cotx450 comparetotal -8 -90E-1 -> 1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
precision: 40
|
||||
cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
|
||||
cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
|
||||
cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1
|
||||
cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
|
||||
cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1
|
||||
cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
|
||||
cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1
|
||||
cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1
|
||||
cotx478 comparetotal 123.45600000E789 123.456E789 -> -1
|
||||
cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1
|
||||
cotx480 comparetotal 123.456000E789 123.456E789 -> -1
|
||||
cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1
|
||||
cotx482 comparetotal 123.4560E789 123.456E789 -> -1
|
||||
cotx483 comparetotal 123.456E-89 123.456E-89 -> 0
|
||||
cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
|
||||
cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1
|
||||
cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
|
||||
cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1
|
||||
cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
|
||||
cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1
|
||||
cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
|
||||
cotx491 comparetotal 123.456E789 123.456000000E789 -> 1
|
||||
cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1
|
||||
cotx493 comparetotal 123.456E789 123.4560000E789 -> 1
|
||||
cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1
|
||||
cotx495 comparetotal 123.456E789 123.45600E789 -> 1
|
||||
cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1
|
||||
cotx497 comparetotal 123.456E789 123.456E789 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
precision: 9
|
||||
cotx500 comparetotal 1 1E-15 -> 1
|
||||
cotx501 comparetotal 1 1E-14 -> 1
|
||||
cotx502 comparetotal 1 1E-13 -> 1
|
||||
cotx503 comparetotal 1 1E-12 -> 1
|
||||
cotx504 comparetotal 1 1E-11 -> 1
|
||||
cotx505 comparetotal 1 1E-10 -> 1
|
||||
cotx506 comparetotal 1 1E-9 -> 1
|
||||
cotx507 comparetotal 1 1E-8 -> 1
|
||||
cotx508 comparetotal 1 1E-7 -> 1
|
||||
cotx509 comparetotal 1 1E-6 -> 1
|
||||
cotx510 comparetotal 1 1E-5 -> 1
|
||||
cotx511 comparetotal 1 1E-4 -> 1
|
||||
cotx512 comparetotal 1 1E-3 -> 1
|
||||
cotx513 comparetotal 1 1E-2 -> 1
|
||||
cotx514 comparetotal 1 1E-1 -> 1
|
||||
cotx515 comparetotal 1 1E-0 -> 0
|
||||
cotx516 comparetotal 1 1E+1 -> -1
|
||||
cotx517 comparetotal 1 1E+2 -> -1
|
||||
cotx518 comparetotal 1 1E+3 -> -1
|
||||
cotx519 comparetotal 1 1E+4 -> -1
|
||||
cotx521 comparetotal 1 1E+5 -> -1
|
||||
cotx522 comparetotal 1 1E+6 -> -1
|
||||
cotx523 comparetotal 1 1E+7 -> -1
|
||||
cotx524 comparetotal 1 1E+8 -> -1
|
||||
cotx525 comparetotal 1 1E+9 -> -1
|
||||
cotx526 comparetotal 1 1E+10 -> -1
|
||||
cotx527 comparetotal 1 1E+11 -> -1
|
||||
cotx528 comparetotal 1 1E+12 -> -1
|
||||
cotx529 comparetotal 1 1E+13 -> -1
|
||||
cotx530 comparetotal 1 1E+14 -> -1
|
||||
cotx531 comparetotal 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
cotx540 comparetotal 1E-15 1 -> -1
|
||||
cotx541 comparetotal 1E-14 1 -> -1
|
||||
cotx542 comparetotal 1E-13 1 -> -1
|
||||
cotx543 comparetotal 1E-12 1 -> -1
|
||||
cotx544 comparetotal 1E-11 1 -> -1
|
||||
cotx545 comparetotal 1E-10 1 -> -1
|
||||
cotx546 comparetotal 1E-9 1 -> -1
|
||||
cotx547 comparetotal 1E-8 1 -> -1
|
||||
cotx548 comparetotal 1E-7 1 -> -1
|
||||
cotx549 comparetotal 1E-6 1 -> -1
|
||||
cotx550 comparetotal 1E-5 1 -> -1
|
||||
cotx551 comparetotal 1E-4 1 -> -1
|
||||
cotx552 comparetotal 1E-3 1 -> -1
|
||||
cotx553 comparetotal 1E-2 1 -> -1
|
||||
cotx554 comparetotal 1E-1 1 -> -1
|
||||
cotx555 comparetotal 1E-0 1 -> 0
|
||||
cotx556 comparetotal 1E+1 1 -> 1
|
||||
cotx557 comparetotal 1E+2 1 -> 1
|
||||
cotx558 comparetotal 1E+3 1 -> 1
|
||||
cotx559 comparetotal 1E+4 1 -> 1
|
||||
cotx561 comparetotal 1E+5 1 -> 1
|
||||
cotx562 comparetotal 1E+6 1 -> 1
|
||||
cotx563 comparetotal 1E+7 1 -> 1
|
||||
cotx564 comparetotal 1E+8 1 -> 1
|
||||
cotx565 comparetotal 1E+9 1 -> 1
|
||||
cotx566 comparetotal 1E+10 1 -> 1
|
||||
cotx567 comparetotal 1E+11 1 -> 1
|
||||
cotx568 comparetotal 1E+12 1 -> 1
|
||||
cotx569 comparetotal 1E+13 1 -> 1
|
||||
cotx570 comparetotal 1E+14 1 -> 1
|
||||
cotx571 comparetotal 1E+15 1 -> 1
|
||||
-- similar with an useful coefficient, one side only
|
||||
cotx580 comparetotal 0.000000987654321 1E-15 -> 1
|
||||
cotx581 comparetotal 0.000000987654321 1E-14 -> 1
|
||||
cotx582 comparetotal 0.000000987654321 1E-13 -> 1
|
||||
cotx583 comparetotal 0.000000987654321 1E-12 -> 1
|
||||
cotx584 comparetotal 0.000000987654321 1E-11 -> 1
|
||||
cotx585 comparetotal 0.000000987654321 1E-10 -> 1
|
||||
cotx586 comparetotal 0.000000987654321 1E-9 -> 1
|
||||
cotx587 comparetotal 0.000000987654321 1E-8 -> 1
|
||||
cotx588 comparetotal 0.000000987654321 1E-7 -> 1
|
||||
cotx589 comparetotal 0.000000987654321 1E-6 -> -1
|
||||
cotx590 comparetotal 0.000000987654321 1E-5 -> -1
|
||||
cotx591 comparetotal 0.000000987654321 1E-4 -> -1
|
||||
cotx592 comparetotal 0.000000987654321 1E-3 -> -1
|
||||
cotx593 comparetotal 0.000000987654321 1E-2 -> -1
|
||||
cotx594 comparetotal 0.000000987654321 1E-1 -> -1
|
||||
cotx595 comparetotal 0.000000987654321 1E-0 -> -1
|
||||
cotx596 comparetotal 0.000000987654321 1E+1 -> -1
|
||||
cotx597 comparetotal 0.000000987654321 1E+2 -> -1
|
||||
cotx598 comparetotal 0.000000987654321 1E+3 -> -1
|
||||
cotx599 comparetotal 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
precision: 20
|
||||
cotx600 comparetotal 12 12.2345 -> -1
|
||||
cotx601 comparetotal 12.0 12.2345 -> -1
|
||||
cotx602 comparetotal 12.00 12.2345 -> -1
|
||||
cotx603 comparetotal 12.000 12.2345 -> -1
|
||||
cotx604 comparetotal 12.0000 12.2345 -> -1
|
||||
cotx605 comparetotal 12.00000 12.2345 -> -1
|
||||
cotx606 comparetotal 12.000000 12.2345 -> -1
|
||||
cotx607 comparetotal 12.0000000 12.2345 -> -1
|
||||
cotx608 comparetotal 12.00000000 12.2345 -> -1
|
||||
cotx609 comparetotal 12.000000000 12.2345 -> -1
|
||||
cotx610 comparetotal 12.1234 12 -> 1
|
||||
cotx611 comparetotal 12.1234 12.0 -> 1
|
||||
cotx612 comparetotal 12.1234 12.00 -> 1
|
||||
cotx613 comparetotal 12.1234 12.000 -> 1
|
||||
cotx614 comparetotal 12.1234 12.0000 -> 1
|
||||
cotx615 comparetotal 12.1234 12.00000 -> 1
|
||||
cotx616 comparetotal 12.1234 12.000000 -> 1
|
||||
cotx617 comparetotal 12.1234 12.0000000 -> 1
|
||||
cotx618 comparetotal 12.1234 12.00000000 -> 1
|
||||
cotx619 comparetotal 12.1234 12.000000000 -> 1
|
||||
cotx620 comparetotal -12 -12.2345 -> 1
|
||||
cotx621 comparetotal -12.0 -12.2345 -> 1
|
||||
cotx622 comparetotal -12.00 -12.2345 -> 1
|
||||
cotx623 comparetotal -12.000 -12.2345 -> 1
|
||||
cotx624 comparetotal -12.0000 -12.2345 -> 1
|
||||
cotx625 comparetotal -12.00000 -12.2345 -> 1
|
||||
cotx626 comparetotal -12.000000 -12.2345 -> 1
|
||||
cotx627 comparetotal -12.0000000 -12.2345 -> 1
|
||||
cotx628 comparetotal -12.00000000 -12.2345 -> 1
|
||||
cotx629 comparetotal -12.000000000 -12.2345 -> 1
|
||||
cotx630 comparetotal -12.1234 -12 -> -1
|
||||
cotx631 comparetotal -12.1234 -12.0 -> -1
|
||||
cotx632 comparetotal -12.1234 -12.00 -> -1
|
||||
cotx633 comparetotal -12.1234 -12.000 -> -1
|
||||
cotx634 comparetotal -12.1234 -12.0000 -> -1
|
||||
cotx635 comparetotal -12.1234 -12.00000 -> -1
|
||||
cotx636 comparetotal -12.1234 -12.000000 -> -1
|
||||
cotx637 comparetotal -12.1234 -12.0000000 -> -1
|
||||
cotx638 comparetotal -12.1234 -12.00000000 -> -1
|
||||
cotx639 comparetotal -12.1234 -12.000000000 -> -1
|
||||
precision: 9
|
||||
|
||||
-- extended zeros
|
||||
cotx640 comparetotal 0 0 -> 0
|
||||
cotx641 comparetotal 0 -0 -> 1
|
||||
cotx642 comparetotal 0 -0.0 -> 1
|
||||
cotx643 comparetotal 0 0.0 -> 1
|
||||
cotx644 comparetotal -0 0 -> -1
|
||||
cotx645 comparetotal -0 -0 -> 0
|
||||
cotx646 comparetotal -0 -0.0 -> -1
|
||||
cotx647 comparetotal -0 0.0 -> -1
|
||||
cotx648 comparetotal 0.0 0 -> -1
|
||||
cotx649 comparetotal 0.0 -0 -> 1
|
||||
cotx650 comparetotal 0.0 -0.0 -> 1
|
||||
cotx651 comparetotal 0.0 0.0 -> 0
|
||||
cotx652 comparetotal -0.0 0 -> -1
|
||||
cotx653 comparetotal -0.0 -0 -> 1
|
||||
cotx654 comparetotal -0.0 -0.0 -> 0
|
||||
cotx655 comparetotal -0.0 0.0 -> -1
|
||||
|
||||
cotx656 comparetotal -0E1 0.0 -> -1
|
||||
cotx657 comparetotal -0E2 0.0 -> -1
|
||||
cotx658 comparetotal 0E1 0.0 -> 1
|
||||
cotx659 comparetotal 0E2 0.0 -> 1
|
||||
cotx660 comparetotal -0E1 0 -> -1
|
||||
cotx661 comparetotal -0E2 0 -> -1
|
||||
cotx662 comparetotal 0E1 0 -> 1
|
||||
cotx663 comparetotal 0E2 0 -> 1
|
||||
cotx664 comparetotal -0E1 -0E1 -> 0
|
||||
cotx665 comparetotal -0E2 -0E1 -> -1
|
||||
cotx666 comparetotal 0E1 -0E1 -> 1
|
||||
cotx667 comparetotal 0E2 -0E1 -> 1
|
||||
cotx668 comparetotal -0E1 -0E2 -> 1
|
||||
cotx669 comparetotal -0E2 -0E2 -> 0
|
||||
cotx670 comparetotal 0E1 -0E2 -> 1
|
||||
cotx671 comparetotal 0E2 -0E2 -> 1
|
||||
cotx672 comparetotal -0E1 0E1 -> -1
|
||||
cotx673 comparetotal -0E2 0E1 -> -1
|
||||
cotx674 comparetotal 0E1 0E1 -> 0
|
||||
cotx675 comparetotal 0E2 0E1 -> 1
|
||||
cotx676 comparetotal -0E1 0E2 -> -1
|
||||
cotx677 comparetotal -0E2 0E2 -> -1
|
||||
cotx678 comparetotal 0E1 0E2 -> -1
|
||||
cotx679 comparetotal 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
precision: 20
|
||||
cotx680 comparetotal 12 12 -> 0
|
||||
cotx681 comparetotal 12 12.0 -> 1
|
||||
cotx682 comparetotal 12 12.00 -> 1
|
||||
cotx683 comparetotal 12 12.000 -> 1
|
||||
cotx684 comparetotal 12 12.0000 -> 1
|
||||
cotx685 comparetotal 12 12.00000 -> 1
|
||||
cotx686 comparetotal 12 12.000000 -> 1
|
||||
cotx687 comparetotal 12 12.0000000 -> 1
|
||||
cotx688 comparetotal 12 12.00000000 -> 1
|
||||
cotx689 comparetotal 12 12.000000000 -> 1
|
||||
cotx690 comparetotal 12 12 -> 0
|
||||
cotx691 comparetotal 12.0 12 -> -1
|
||||
cotx692 comparetotal 12.00 12 -> -1
|
||||
cotx693 comparetotal 12.000 12 -> -1
|
||||
cotx694 comparetotal 12.0000 12 -> -1
|
||||
cotx695 comparetotal 12.00000 12 -> -1
|
||||
cotx696 comparetotal 12.000000 12 -> -1
|
||||
cotx697 comparetotal 12.0000000 12 -> -1
|
||||
cotx698 comparetotal 12.00000000 12 -> -1
|
||||
cotx699 comparetotal 12.000000000 12 -> -1
|
||||
|
||||
-- long operand checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
cotx701 comparetotal 12345678000 1 -> 1
|
||||
cotx702 comparetotal 1 12345678000 -> -1
|
||||
cotx703 comparetotal 1234567800 1 -> 1
|
||||
cotx704 comparetotal 1 1234567800 -> -1
|
||||
cotx705 comparetotal 1234567890 1 -> 1
|
||||
cotx706 comparetotal 1 1234567890 -> -1
|
||||
cotx707 comparetotal 1234567891 1 -> 1
|
||||
cotx708 comparetotal 1 1234567891 -> -1
|
||||
cotx709 comparetotal 12345678901 1 -> 1
|
||||
cotx710 comparetotal 1 12345678901 -> -1
|
||||
cotx711 comparetotal 1234567896 1 -> 1
|
||||
cotx712 comparetotal 1 1234567896 -> -1
|
||||
cotx713 comparetotal -1234567891 1 -> -1
|
||||
cotx714 comparetotal 1 -1234567891 -> 1
|
||||
cotx715 comparetotal -12345678901 1 -> -1
|
||||
cotx716 comparetotal 1 -12345678901 -> 1
|
||||
cotx717 comparetotal -1234567896 1 -> -1
|
||||
cotx718 comparetotal 1 -1234567896 -> 1
|
||||
|
||||
precision: 15
|
||||
-- same with plenty of precision
|
||||
cotx721 comparetotal 12345678000 1 -> 1
|
||||
cotx722 comparetotal 1 12345678000 -> -1
|
||||
cotx723 comparetotal 1234567800 1 -> 1
|
||||
cotx724 comparetotal 1 1234567800 -> -1
|
||||
cotx725 comparetotal 1234567890 1 -> 1
|
||||
cotx726 comparetotal 1 1234567890 -> -1
|
||||
cotx727 comparetotal 1234567891 1 -> 1
|
||||
cotx728 comparetotal 1 1234567891 -> -1
|
||||
cotx729 comparetotal 12345678901 1 -> 1
|
||||
cotx730 comparetotal 1 12345678901 -> -1
|
||||
cotx731 comparetotal 1234567896 1 -> 1
|
||||
cotx732 comparetotal 1 1234567896 -> -1
|
||||
|
||||
-- residue cases
|
||||
precision: 5
|
||||
cotx740 comparetotal 1 0.9999999 -> 1
|
||||
cotx741 comparetotal 1 0.999999 -> 1
|
||||
cotx742 comparetotal 1 0.99999 -> 1
|
||||
cotx743 comparetotal 1 1.0000 -> 1
|
||||
cotx744 comparetotal 1 1.00001 -> -1
|
||||
cotx745 comparetotal 1 1.000001 -> -1
|
||||
cotx746 comparetotal 1 1.0000001 -> -1
|
||||
cotx750 comparetotal 0.9999999 1 -> -1
|
||||
cotx751 comparetotal 0.999999 1 -> -1
|
||||
cotx752 comparetotal 0.99999 1 -> -1
|
||||
cotx753 comparetotal 1.0000 1 -> -1
|
||||
cotx754 comparetotal 1.00001 1 -> 1
|
||||
cotx755 comparetotal 1.000001 1 -> 1
|
||||
cotx756 comparetotal 1.0000001 1 -> 1
|
||||
|
||||
-- a selection of longies
|
||||
cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
|
||||
cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
|
||||
cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
|
||||
cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
-- precisions above or below the difference should have no effect
|
||||
precision: 11
|
||||
cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 10
|
||||
cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 9
|
||||
cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 8
|
||||
cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 7
|
||||
cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 6
|
||||
cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 5
|
||||
cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 4
|
||||
cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 3
|
||||
cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 2
|
||||
cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 1
|
||||
cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
|
||||
-- Specials
|
||||
precision: 9
|
||||
cotx780 comparetotal Inf -Inf -> 1
|
||||
cotx781 comparetotal Inf -1000 -> 1
|
||||
cotx782 comparetotal Inf -1 -> 1
|
||||
cotx783 comparetotal Inf -0 -> 1
|
||||
cotx784 comparetotal Inf 0 -> 1
|
||||
cotx785 comparetotal Inf 1 -> 1
|
||||
cotx786 comparetotal Inf 1000 -> 1
|
||||
cotx787 comparetotal Inf Inf -> 0
|
||||
cotx788 comparetotal -1000 Inf -> -1
|
||||
cotx789 comparetotal -Inf Inf -> -1
|
||||
cotx790 comparetotal -1 Inf -> -1
|
||||
cotx791 comparetotal -0 Inf -> -1
|
||||
cotx792 comparetotal 0 Inf -> -1
|
||||
cotx793 comparetotal 1 Inf -> -1
|
||||
cotx794 comparetotal 1000 Inf -> -1
|
||||
cotx795 comparetotal Inf Inf -> 0
|
||||
|
||||
cotx800 comparetotal -Inf -Inf -> 0
|
||||
cotx801 comparetotal -Inf -1000 -> -1
|
||||
cotx802 comparetotal -Inf -1 -> -1
|
||||
cotx803 comparetotal -Inf -0 -> -1
|
||||
cotx804 comparetotal -Inf 0 -> -1
|
||||
cotx805 comparetotal -Inf 1 -> -1
|
||||
cotx806 comparetotal -Inf 1000 -> -1
|
||||
cotx807 comparetotal -Inf Inf -> -1
|
||||
cotx808 comparetotal -Inf -Inf -> 0
|
||||
cotx809 comparetotal -1000 -Inf -> 1
|
||||
cotx810 comparetotal -1 -Inf -> 1
|
||||
cotx811 comparetotal -0 -Inf -> 1
|
||||
cotx812 comparetotal 0 -Inf -> 1
|
||||
cotx813 comparetotal 1 -Inf -> 1
|
||||
cotx814 comparetotal 1000 -Inf -> 1
|
||||
cotx815 comparetotal Inf -Inf -> 1
|
||||
|
||||
cotx821 comparetotal NaN -Inf -> 1
|
||||
cotx822 comparetotal NaN -1000 -> 1
|
||||
cotx823 comparetotal NaN -1 -> 1
|
||||
cotx824 comparetotal NaN -0 -> 1
|
||||
cotx825 comparetotal NaN 0 -> 1
|
||||
cotx826 comparetotal NaN 1 -> 1
|
||||
cotx827 comparetotal NaN 1000 -> 1
|
||||
cotx828 comparetotal NaN Inf -> 1
|
||||
cotx829 comparetotal NaN NaN -> 0
|
||||
cotx830 comparetotal -Inf NaN -> -1
|
||||
cotx831 comparetotal -1000 NaN -> -1
|
||||
cotx832 comparetotal -1 NaN -> -1
|
||||
cotx833 comparetotal -0 NaN -> -1
|
||||
cotx834 comparetotal 0 NaN -> -1
|
||||
cotx835 comparetotal 1 NaN -> -1
|
||||
cotx836 comparetotal 1000 NaN -> -1
|
||||
cotx837 comparetotal Inf NaN -> -1
|
||||
cotx838 comparetotal -NaN -NaN -> 0
|
||||
cotx839 comparetotal +NaN -NaN -> 1
|
||||
cotx840 comparetotal -NaN +NaN -> -1
|
||||
|
||||
cotx841 comparetotal sNaN -sNaN -> 1
|
||||
cotx842 comparetotal sNaN -NaN -> 1
|
||||
cotx843 comparetotal sNaN -Inf -> 1
|
||||
cotx844 comparetotal sNaN -1000 -> 1
|
||||
cotx845 comparetotal sNaN -1 -> 1
|
||||
cotx846 comparetotal sNaN -0 -> 1
|
||||
cotx847 comparetotal sNaN 0 -> 1
|
||||
cotx848 comparetotal sNaN 1 -> 1
|
||||
cotx849 comparetotal sNaN 1000 -> 1
|
||||
cotx850 comparetotal sNaN NaN -> -1
|
||||
cotx851 comparetotal sNaN sNaN -> 0
|
||||
|
||||
cotx852 comparetotal -sNaN sNaN -> -1
|
||||
cotx853 comparetotal -NaN sNaN -> -1
|
||||
cotx854 comparetotal -Inf sNaN -> -1
|
||||
cotx855 comparetotal -1000 sNaN -> -1
|
||||
cotx856 comparetotal -1 sNaN -> -1
|
||||
cotx857 comparetotal -0 sNaN -> -1
|
||||
cotx858 comparetotal 0 sNaN -> -1
|
||||
cotx859 comparetotal 1 sNaN -> -1
|
||||
cotx860 comparetotal 1000 sNaN -> -1
|
||||
cotx861 comparetotal Inf sNaN -> -1
|
||||
cotx862 comparetotal NaN sNaN -> 1
|
||||
cotx863 comparetotal sNaN sNaN -> 0
|
||||
|
||||
cotx871 comparetotal -sNaN -sNaN -> 0
|
||||
cotx872 comparetotal -sNaN -NaN -> 1
|
||||
cotx873 comparetotal -sNaN -Inf -> -1
|
||||
cotx874 comparetotal -sNaN -1000 -> -1
|
||||
cotx875 comparetotal -sNaN -1 -> -1
|
||||
cotx876 comparetotal -sNaN -0 -> -1
|
||||
cotx877 comparetotal -sNaN 0 -> -1
|
||||
cotx878 comparetotal -sNaN 1 -> -1
|
||||
cotx879 comparetotal -sNaN 1000 -> -1
|
||||
cotx880 comparetotal -sNaN NaN -> -1
|
||||
cotx881 comparetotal -sNaN sNaN -> -1
|
||||
|
||||
cotx882 comparetotal -sNaN -sNaN -> 0
|
||||
cotx883 comparetotal -NaN -sNaN -> -1
|
||||
cotx884 comparetotal -Inf -sNaN -> 1
|
||||
cotx885 comparetotal -1000 -sNaN -> 1
|
||||
cotx886 comparetotal -1 -sNaN -> 1
|
||||
cotx887 comparetotal -0 -sNaN -> 1
|
||||
cotx888 comparetotal 0 -sNaN -> 1
|
||||
cotx889 comparetotal 1 -sNaN -> 1
|
||||
cotx890 comparetotal 1000 -sNaN -> 1
|
||||
cotx891 comparetotal Inf -sNaN -> 1
|
||||
cotx892 comparetotal NaN -sNaN -> 1
|
||||
cotx893 comparetotal sNaN -sNaN -> 1
|
||||
|
||||
-- NaNs with payload
|
||||
cotx960 comparetotal NaN9 -Inf -> 1
|
||||
cotx961 comparetotal NaN8 999 -> 1
|
||||
cotx962 comparetotal NaN77 Inf -> 1
|
||||
cotx963 comparetotal -NaN67 NaN5 -> -1
|
||||
cotx964 comparetotal -Inf -NaN4 -> 1
|
||||
cotx965 comparetotal -999 -NaN33 -> 1
|
||||
cotx966 comparetotal Inf NaN2 -> -1
|
||||
|
||||
cotx970 comparetotal -NaN41 -NaN42 -> 1
|
||||
cotx971 comparetotal +NaN41 -NaN42 -> 1
|
||||
cotx972 comparetotal -NaN41 +NaN42 -> -1
|
||||
cotx973 comparetotal +NaN41 +NaN42 -> -1
|
||||
cotx974 comparetotal -NaN42 -NaN01 -> -1
|
||||
cotx975 comparetotal +NaN42 -NaN01 -> 1
|
||||
cotx976 comparetotal -NaN42 +NaN01 -> -1
|
||||
cotx977 comparetotal +NaN42 +NaN01 -> 1
|
||||
|
||||
cotx980 comparetotal -sNaN771 -sNaN772 -> 1
|
||||
cotx981 comparetotal +sNaN771 -sNaN772 -> 1
|
||||
cotx982 comparetotal -sNaN771 +sNaN772 -> -1
|
||||
cotx983 comparetotal +sNaN771 +sNaN772 -> -1
|
||||
cotx984 comparetotal -sNaN772 -sNaN771 -> -1
|
||||
cotx985 comparetotal +sNaN772 -sNaN771 -> 1
|
||||
cotx986 comparetotal -sNaN772 +sNaN771 -> -1
|
||||
cotx987 comparetotal +sNaN772 +sNaN771 -> 1
|
||||
|
||||
cotx991 comparetotal -sNaN99 -Inf -> -1
|
||||
cotx992 comparetotal sNaN98 -11 -> 1
|
||||
cotx993 comparetotal sNaN97 NaN -> -1
|
||||
cotx994 comparetotal sNaN16 sNaN94 -> -1
|
||||
cotx995 comparetotal NaN85 sNaN83 -> 1
|
||||
cotx996 comparetotal -Inf sNaN92 -> -1
|
||||
cotx997 comparetotal 088 sNaN81 -> -1
|
||||
cotx998 comparetotal Inf sNaN90 -> -1
|
||||
cotx999 comparetotal NaN -sNaN89 -> 1
|
||||
|
||||
-- overflow and underflow tests .. subnormal results now allowed
|
||||
maxExponent: 999999999
|
||||
minexponent: -999999999
|
||||
cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1
|
||||
cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1
|
||||
cotx1082 comparetotal +0.100 9E-999999999 -> 1
|
||||
cotx1083 comparetotal 9E-999999999 +0.100 -> -1
|
||||
cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1
|
||||
cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1
|
||||
cotx1087 comparetotal -0.100 9E-999999999 -> -1
|
||||
cotx1088 comparetotal 9E-999999999 -0.100 -> 1
|
||||
|
||||
cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1
|
||||
cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1
|
||||
cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1
|
||||
cotx1092 comparetotal 9e-999999998 0.01 -> -1
|
||||
cotx1093 comparetotal 9e-999999998 0.1 -> -1
|
||||
cotx1094 comparetotal 0.01 9e-999999998 -> 1
|
||||
cotx1095 comparetotal 1e599999999 1e400000001 -> 1
|
||||
cotx1096 comparetotal 1e599999999 1e400000000 -> 1
|
||||
cotx1097 comparetotal 1e600000000 1e400000000 -> 1
|
||||
cotx1098 comparetotal 9e999999998 100 -> 1
|
||||
cotx1099 comparetotal 9e999999998 10 -> 1
|
||||
cotx1100 comparetotal 100 9e999999998 -> -1
|
||||
-- signs
|
||||
cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1
|
||||
cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1
|
||||
cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1
|
||||
cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1
|
||||
cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1
|
||||
cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1
|
||||
cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1
|
||||
cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1
|
||||
|
||||
-- spread zeros
|
||||
cotx1110 comparetotal 0E-383 0 -> -1
|
||||
cotx1111 comparetotal 0E-383 -0 -> 1
|
||||
cotx1112 comparetotal -0E-383 0 -> -1
|
||||
cotx1113 comparetotal -0E-383 -0 -> 1
|
||||
cotx1114 comparetotal 0E-383 0E+384 -> -1
|
||||
cotx1115 comparetotal 0E-383 -0E+384 -> 1
|
||||
cotx1116 comparetotal -0E-383 0E+384 -> -1
|
||||
cotx1117 comparetotal -0E-383 -0E+384 -> 1
|
||||
cotx1118 comparetotal 0 0E+384 -> -1
|
||||
cotx1119 comparetotal 0 -0E+384 -> 1
|
||||
cotx1120 comparetotal -0 0E+384 -> -1
|
||||
cotx1121 comparetotal -0 -0E+384 -> 1
|
||||
|
||||
cotx1130 comparetotal 0E+384 0 -> 1
|
||||
cotx1131 comparetotal 0E+384 -0 -> 1
|
||||
cotx1132 comparetotal -0E+384 0 -> -1
|
||||
cotx1133 comparetotal -0E+384 -0 -> -1
|
||||
cotx1134 comparetotal 0E+384 0E-383 -> 1
|
||||
cotx1135 comparetotal 0E+384 -0E-383 -> 1
|
||||
cotx1136 comparetotal -0E+384 0E-383 -> -1
|
||||
cotx1137 comparetotal -0E+384 -0E-383 -> -1
|
||||
cotx1138 comparetotal 0 0E-383 -> 1
|
||||
cotx1139 comparetotal 0 -0E-383 -> 1
|
||||
cotx1140 comparetotal -0 0E-383 -> -1
|
||||
cotx1141 comparetotal -0 -0E-383 -> -1
|
||||
|
||||
-- Null tests
|
||||
cotx9990 comparetotal 10 # -> NaN Invalid_operation
|
||||
cotx9991 comparetotal # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,790 @@
|
|||
------------------------------------------------------------------------
|
||||
-- comparetotmag.decTest -- decimal comparison, abs. total ordering --
|
||||
-- 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
|
||||
|
||||
-- Note that it cannot be assumed that add/subtract tests cover paths
|
||||
-- for this operation adequately, here, because the code might be
|
||||
-- quite different (comparison cannot overflow or underflow, so
|
||||
-- actual subtractions are not necessary). Similarly, comparetotal
|
||||
-- will have some radically different paths than compare.
|
||||
|
||||
extended: 1
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
|
||||
-- sanity checks
|
||||
ctmx001 comparetotmag -2 -2 -> 0
|
||||
ctmx002 comparetotmag -2 -1 -> 1
|
||||
ctmx003 comparetotmag -2 0 -> 1
|
||||
ctmx004 comparetotmag -2 1 -> 1
|
||||
ctmx005 comparetotmag -2 2 -> 0
|
||||
ctmx006 comparetotmag -1 -2 -> -1
|
||||
ctmx007 comparetotmag -1 -1 -> 0
|
||||
ctmx008 comparetotmag -1 0 -> 1
|
||||
ctmx009 comparetotmag -1 1 -> 0
|
||||
ctmx010 comparetotmag -1 2 -> -1
|
||||
ctmx011 comparetotmag 0 -2 -> -1
|
||||
ctmx012 comparetotmag 0 -1 -> -1
|
||||
ctmx013 comparetotmag 0 0 -> 0
|
||||
ctmx014 comparetotmag 0 1 -> -1
|
||||
ctmx015 comparetotmag 0 2 -> -1
|
||||
ctmx016 comparetotmag 1 -2 -> -1
|
||||
ctmx017 comparetotmag 1 -1 -> 0
|
||||
ctmx018 comparetotmag 1 0 -> 1
|
||||
ctmx019 comparetotmag 1 1 -> 0
|
||||
ctmx020 comparetotmag 1 2 -> -1
|
||||
ctmx021 comparetotmag 2 -2 -> 0
|
||||
ctmx022 comparetotmag 2 -1 -> 1
|
||||
ctmx023 comparetotmag 2 0 -> 1
|
||||
ctmx025 comparetotmag 2 1 -> 1
|
||||
ctmx026 comparetotmag 2 2 -> 0
|
||||
|
||||
ctmx031 comparetotmag -20 -20 -> 0
|
||||
ctmx032 comparetotmag -20 -10 -> 1
|
||||
ctmx033 comparetotmag -20 00 -> 1
|
||||
ctmx034 comparetotmag -20 10 -> 1
|
||||
ctmx035 comparetotmag -20 20 -> 0
|
||||
ctmx036 comparetotmag -10 -20 -> -1
|
||||
ctmx037 comparetotmag -10 -10 -> 0
|
||||
ctmx038 comparetotmag -10 00 -> 1
|
||||
ctmx039 comparetotmag -10 10 -> 0
|
||||
ctmx040 comparetotmag -10 20 -> -1
|
||||
ctmx041 comparetotmag 00 -20 -> -1
|
||||
ctmx042 comparetotmag 00 -10 -> -1
|
||||
ctmx043 comparetotmag 00 00 -> 0
|
||||
ctmx044 comparetotmag 00 10 -> -1
|
||||
ctmx045 comparetotmag 00 20 -> -1
|
||||
ctmx046 comparetotmag 10 -20 -> -1
|
||||
ctmx047 comparetotmag 10 -10 -> 0
|
||||
ctmx048 comparetotmag 10 00 -> 1
|
||||
ctmx049 comparetotmag 10 10 -> 0
|
||||
ctmx050 comparetotmag 10 20 -> -1
|
||||
ctmx051 comparetotmag 20 -20 -> 0
|
||||
ctmx052 comparetotmag 20 -10 -> 1
|
||||
ctmx053 comparetotmag 20 00 -> 1
|
||||
ctmx055 comparetotmag 20 10 -> 1
|
||||
ctmx056 comparetotmag 20 20 -> 0
|
||||
|
||||
ctmx061 comparetotmag -2.0 -2.0 -> 0
|
||||
ctmx062 comparetotmag -2.0 -1.0 -> 1
|
||||
ctmx063 comparetotmag -2.0 0.0 -> 1
|
||||
ctmx064 comparetotmag -2.0 1.0 -> 1
|
||||
ctmx065 comparetotmag -2.0 2.0 -> 0
|
||||
ctmx066 comparetotmag -1.0 -2.0 -> -1
|
||||
ctmx067 comparetotmag -1.0 -1.0 -> 0
|
||||
ctmx068 comparetotmag -1.0 0.0 -> 1
|
||||
ctmx069 comparetotmag -1.0 1.0 -> 0
|
||||
ctmx070 comparetotmag -1.0 2.0 -> -1
|
||||
ctmx071 comparetotmag 0.0 -2.0 -> -1
|
||||
ctmx072 comparetotmag 0.0 -1.0 -> -1
|
||||
ctmx073 comparetotmag 0.0 0.0 -> 0
|
||||
ctmx074 comparetotmag 0.0 1.0 -> -1
|
||||
ctmx075 comparetotmag 0.0 2.0 -> -1
|
||||
ctmx076 comparetotmag 1.0 -2.0 -> -1
|
||||
ctmx077 comparetotmag 1.0 -1.0 -> 0
|
||||
ctmx078 comparetotmag 1.0 0.0 -> 1
|
||||
ctmx079 comparetotmag 1.0 1.0 -> 0
|
||||
ctmx080 comparetotmag 1.0 2.0 -> -1
|
||||
ctmx081 comparetotmag 2.0 -2.0 -> 0
|
||||
ctmx082 comparetotmag 2.0 -1.0 -> 1
|
||||
ctmx083 comparetotmag 2.0 0.0 -> 1
|
||||
ctmx085 comparetotmag 2.0 1.0 -> 1
|
||||
ctmx086 comparetotmag 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
-- in this first group, compare would compare all equal
|
||||
ctmx100 comparetotmag 7.0 7.0 -> 0
|
||||
ctmx101 comparetotmag 7.0 7 -> -1
|
||||
ctmx102 comparetotmag 7 7.0 -> 1
|
||||
ctmx103 comparetotmag 7E+0 7.0 -> 1
|
||||
ctmx104 comparetotmag 70E-1 7.0 -> 0
|
||||
ctmx105 comparetotmag 0.7E+1 7 -> 0
|
||||
ctmx106 comparetotmag 70E-1 7 -> -1
|
||||
ctmx107 comparetotmag 7.0 7E+0 -> -1
|
||||
ctmx108 comparetotmag 7.0 70E-1 -> 0
|
||||
ctmx109 comparetotmag 7 0.7E+1 -> 0
|
||||
ctmx110 comparetotmag 7 70E-1 -> 1
|
||||
|
||||
ctmx120 comparetotmag 8.0 7.0 -> 1
|
||||
ctmx121 comparetotmag 8.0 7 -> 1
|
||||
ctmx122 comparetotmag 8 7.0 -> 1
|
||||
ctmx123 comparetotmag 8E+0 7.0 -> 1
|
||||
ctmx124 comparetotmag 80E-1 7.0 -> 1
|
||||
ctmx125 comparetotmag 0.8E+1 7 -> 1
|
||||
ctmx126 comparetotmag 80E-1 7 -> 1
|
||||
ctmx127 comparetotmag 8.0 7E+0 -> 1
|
||||
ctmx128 comparetotmag 8.0 70E-1 -> 1
|
||||
ctmx129 comparetotmag 8 0.7E+1 -> 1
|
||||
ctmx130 comparetotmag 8 70E-1 -> 1
|
||||
|
||||
ctmx140 comparetotmag 8.0 9.0 -> -1
|
||||
ctmx141 comparetotmag 8.0 9 -> -1
|
||||
ctmx142 comparetotmag 8 9.0 -> -1
|
||||
ctmx143 comparetotmag 8E+0 9.0 -> -1
|
||||
ctmx144 comparetotmag 80E-1 9.0 -> -1
|
||||
ctmx145 comparetotmag 0.8E+1 9 -> -1
|
||||
ctmx146 comparetotmag 80E-1 9 -> -1
|
||||
ctmx147 comparetotmag 8.0 9E+0 -> -1
|
||||
ctmx148 comparetotmag 8.0 90E-1 -> -1
|
||||
ctmx149 comparetotmag 8 0.9E+1 -> -1
|
||||
ctmx150 comparetotmag 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
ctmx200 comparetotmag -7.0 7.0 -> 0
|
||||
ctmx201 comparetotmag -7.0 7 -> -1
|
||||
ctmx202 comparetotmag -7 7.0 -> 1
|
||||
ctmx203 comparetotmag -7E+0 7.0 -> 1
|
||||
ctmx204 comparetotmag -70E-1 7.0 -> 0
|
||||
ctmx205 comparetotmag -0.7E+1 7 -> 0
|
||||
ctmx206 comparetotmag -70E-1 7 -> -1
|
||||
ctmx207 comparetotmag -7.0 7E+0 -> -1
|
||||
ctmx208 comparetotmag -7.0 70E-1 -> 0
|
||||
ctmx209 comparetotmag -7 0.7E+1 -> 0
|
||||
ctmx210 comparetotmag -7 70E-1 -> 1
|
||||
|
||||
ctmx220 comparetotmag -8.0 7.0 -> 1
|
||||
ctmx221 comparetotmag -8.0 7 -> 1
|
||||
ctmx222 comparetotmag -8 7.0 -> 1
|
||||
ctmx223 comparetotmag -8E+0 7.0 -> 1
|
||||
ctmx224 comparetotmag -80E-1 7.0 -> 1
|
||||
ctmx225 comparetotmag -0.8E+1 7 -> 1
|
||||
ctmx226 comparetotmag -80E-1 7 -> 1
|
||||
ctmx227 comparetotmag -8.0 7E+0 -> 1
|
||||
ctmx228 comparetotmag -8.0 70E-1 -> 1
|
||||
ctmx229 comparetotmag -8 0.7E+1 -> 1
|
||||
ctmx230 comparetotmag -8 70E-1 -> 1
|
||||
|
||||
ctmx240 comparetotmag -8.0 9.0 -> -1
|
||||
ctmx241 comparetotmag -8.0 9 -> -1
|
||||
ctmx242 comparetotmag -8 9.0 -> -1
|
||||
ctmx243 comparetotmag -8E+0 9.0 -> -1
|
||||
ctmx244 comparetotmag -80E-1 9.0 -> -1
|
||||
ctmx245 comparetotmag -0.8E+1 9 -> -1
|
||||
ctmx246 comparetotmag -80E-1 9 -> -1
|
||||
ctmx247 comparetotmag -8.0 9E+0 -> -1
|
||||
ctmx248 comparetotmag -8.0 90E-1 -> -1
|
||||
ctmx249 comparetotmag -8 0.9E+1 -> -1
|
||||
ctmx250 comparetotmag -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
ctmx300 comparetotmag 7.0 -7.0 -> 0
|
||||
ctmx301 comparetotmag 7.0 -7 -> -1
|
||||
ctmx302 comparetotmag 7 -7.0 -> 1
|
||||
ctmx303 comparetotmag 7E+0 -7.0 -> 1
|
||||
ctmx304 comparetotmag 70E-1 -7.0 -> 0
|
||||
ctmx305 comparetotmag .7E+1 -7 -> 0
|
||||
ctmx306 comparetotmag 70E-1 -7 -> -1
|
||||
ctmx307 comparetotmag 7.0 -7E+0 -> -1
|
||||
ctmx308 comparetotmag 7.0 -70E-1 -> 0
|
||||
ctmx309 comparetotmag 7 -.7E+1 -> 0
|
||||
ctmx310 comparetotmag 7 -70E-1 -> 1
|
||||
|
||||
ctmx320 comparetotmag 8.0 -7.0 -> 1
|
||||
ctmx321 comparetotmag 8.0 -7 -> 1
|
||||
ctmx322 comparetotmag 8 -7.0 -> 1
|
||||
ctmx323 comparetotmag 8E+0 -7.0 -> 1
|
||||
ctmx324 comparetotmag 80E-1 -7.0 -> 1
|
||||
ctmx325 comparetotmag .8E+1 -7 -> 1
|
||||
ctmx326 comparetotmag 80E-1 -7 -> 1
|
||||
ctmx327 comparetotmag 8.0 -7E+0 -> 1
|
||||
ctmx328 comparetotmag 8.0 -70E-1 -> 1
|
||||
ctmx329 comparetotmag 8 -.7E+1 -> 1
|
||||
ctmx330 comparetotmag 8 -70E-1 -> 1
|
||||
|
||||
ctmx340 comparetotmag 8.0 -9.0 -> -1
|
||||
ctmx341 comparetotmag 8.0 -9 -> -1
|
||||
ctmx342 comparetotmag 8 -9.0 -> -1
|
||||
ctmx343 comparetotmag 8E+0 -9.0 -> -1
|
||||
ctmx344 comparetotmag 80E-1 -9.0 -> -1
|
||||
ctmx345 comparetotmag .8E+1 -9 -> -1
|
||||
ctmx346 comparetotmag 80E-1 -9 -> -1
|
||||
ctmx347 comparetotmag 8.0 -9E+0 -> -1
|
||||
ctmx348 comparetotmag 8.0 -90E-1 -> -1
|
||||
ctmx349 comparetotmag 8 -.9E+1 -> -1
|
||||
ctmx350 comparetotmag 8 -90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
ctmx400 comparetotmag -7.0 -7.0 -> 0
|
||||
ctmx401 comparetotmag -7.0 -7 -> -1
|
||||
ctmx402 comparetotmag -7 -7.0 -> 1
|
||||
ctmx403 comparetotmag -7E+0 -7.0 -> 1
|
||||
ctmx404 comparetotmag -70E-1 -7.0 -> 0
|
||||
ctmx405 comparetotmag -.7E+1 -7 -> 0
|
||||
ctmx406 comparetotmag -70E-1 -7 -> -1
|
||||
ctmx407 comparetotmag -7.0 -7E+0 -> -1
|
||||
ctmx408 comparetotmag -7.0 -70E-1 -> 0
|
||||
ctmx409 comparetotmag -7 -.7E+1 -> 0
|
||||
ctmx410 comparetotmag -7 -70E-1 -> 1
|
||||
|
||||
ctmx420 comparetotmag -8.0 -7.0 -> 1
|
||||
ctmx421 comparetotmag -8.0 -7 -> 1
|
||||
ctmx422 comparetotmag -8 -7.0 -> 1
|
||||
ctmx423 comparetotmag -8E+0 -7.0 -> 1
|
||||
ctmx424 comparetotmag -80E-1 -7.0 -> 1
|
||||
ctmx425 comparetotmag -.8E+1 -7 -> 1
|
||||
ctmx426 comparetotmag -80E-1 -7 -> 1
|
||||
ctmx427 comparetotmag -8.0 -7E+0 -> 1
|
||||
ctmx428 comparetotmag -8.0 -70E-1 -> 1
|
||||
ctmx429 comparetotmag -8 -.7E+1 -> 1
|
||||
ctmx430 comparetotmag -8 -70E-1 -> 1
|
||||
|
||||
ctmx440 comparetotmag -8.0 -9.0 -> -1
|
||||
ctmx441 comparetotmag -8.0 -9 -> -1
|
||||
ctmx442 comparetotmag -8 -9.0 -> -1
|
||||
ctmx443 comparetotmag -8E+0 -9.0 -> -1
|
||||
ctmx444 comparetotmag -80E-1 -9.0 -> -1
|
||||
ctmx445 comparetotmag -.8E+1 -9 -> -1
|
||||
ctmx446 comparetotmag -80E-1 -9 -> -1
|
||||
ctmx447 comparetotmag -8.0 -9E+0 -> -1
|
||||
ctmx448 comparetotmag -8.0 -90E-1 -> -1
|
||||
ctmx449 comparetotmag -8 -.9E+1 -> -1
|
||||
ctmx450 comparetotmag -8 -90E-1 -> -1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
precision: 40
|
||||
ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1
|
||||
ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1
|
||||
ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1
|
||||
ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
|
||||
ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1
|
||||
ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
|
||||
ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1
|
||||
ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
|
||||
ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1
|
||||
ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
|
||||
ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1
|
||||
ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1
|
||||
ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1
|
||||
ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0
|
||||
ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1
|
||||
ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1
|
||||
ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1
|
||||
ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1
|
||||
ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
|
||||
ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1
|
||||
ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
|
||||
ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1
|
||||
ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
|
||||
ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1
|
||||
ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1
|
||||
ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1
|
||||
ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1
|
||||
ctmx497 comparetotmag 123.456E789 123.456E789 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
precision: 9
|
||||
ctmx500 comparetotmag 1 1E-15 -> 1
|
||||
ctmx501 comparetotmag 1 1E-14 -> 1
|
||||
ctmx502 comparetotmag 1 1E-13 -> 1
|
||||
ctmx503 comparetotmag 1 1E-12 -> 1
|
||||
ctmx504 comparetotmag 1 1E-11 -> 1
|
||||
ctmx505 comparetotmag 1 1E-10 -> 1
|
||||
ctmx506 comparetotmag 1 1E-9 -> 1
|
||||
ctmx507 comparetotmag 1 1E-8 -> 1
|
||||
ctmx508 comparetotmag 1 1E-7 -> 1
|
||||
ctmx509 comparetotmag 1 1E-6 -> 1
|
||||
ctmx510 comparetotmag 1 1E-5 -> 1
|
||||
ctmx511 comparetotmag 1 1E-4 -> 1
|
||||
ctmx512 comparetotmag 1 1E-3 -> 1
|
||||
ctmx513 comparetotmag 1 1E-2 -> 1
|
||||
ctmx514 comparetotmag 1 1E-1 -> 1
|
||||
ctmx515 comparetotmag 1 1E-0 -> 0
|
||||
ctmx516 comparetotmag 1 1E+1 -> -1
|
||||
ctmx517 comparetotmag 1 1E+2 -> -1
|
||||
ctmx518 comparetotmag 1 1E+3 -> -1
|
||||
ctmx519 comparetotmag 1 1E+4 -> -1
|
||||
ctmx521 comparetotmag 1 1E+5 -> -1
|
||||
ctmx522 comparetotmag 1 1E+6 -> -1
|
||||
ctmx523 comparetotmag 1 1E+7 -> -1
|
||||
ctmx524 comparetotmag 1 1E+8 -> -1
|
||||
ctmx525 comparetotmag 1 1E+9 -> -1
|
||||
ctmx526 comparetotmag 1 1E+10 -> -1
|
||||
ctmx527 comparetotmag 1 1E+11 -> -1
|
||||
ctmx528 comparetotmag 1 1E+12 -> -1
|
||||
ctmx529 comparetotmag 1 1E+13 -> -1
|
||||
ctmx530 comparetotmag 1 1E+14 -> -1
|
||||
ctmx531 comparetotmag 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
ctmx540 comparetotmag 1E-15 1 -> -1
|
||||
ctmx541 comparetotmag 1E-14 1 -> -1
|
||||
ctmx542 comparetotmag 1E-13 1 -> -1
|
||||
ctmx543 comparetotmag 1E-12 1 -> -1
|
||||
ctmx544 comparetotmag 1E-11 1 -> -1
|
||||
ctmx545 comparetotmag 1E-10 1 -> -1
|
||||
ctmx546 comparetotmag 1E-9 1 -> -1
|
||||
ctmx547 comparetotmag 1E-8 1 -> -1
|
||||
ctmx548 comparetotmag 1E-7 1 -> -1
|
||||
ctmx549 comparetotmag 1E-6 1 -> -1
|
||||
ctmx550 comparetotmag 1E-5 1 -> -1
|
||||
ctmx551 comparetotmag 1E-4 1 -> -1
|
||||
ctmx552 comparetotmag 1E-3 1 -> -1
|
||||
ctmx553 comparetotmag 1E-2 1 -> -1
|
||||
ctmx554 comparetotmag 1E-1 1 -> -1
|
||||
ctmx555 comparetotmag 1E-0 1 -> 0
|
||||
ctmx556 comparetotmag 1E+1 1 -> 1
|
||||
ctmx557 comparetotmag 1E+2 1 -> 1
|
||||
ctmx558 comparetotmag 1E+3 1 -> 1
|
||||
ctmx559 comparetotmag 1E+4 1 -> 1
|
||||
ctmx561 comparetotmag 1E+5 1 -> 1
|
||||
ctmx562 comparetotmag 1E+6 1 -> 1
|
||||
ctmx563 comparetotmag 1E+7 1 -> 1
|
||||
ctmx564 comparetotmag 1E+8 1 -> 1
|
||||
ctmx565 comparetotmag 1E+9 1 -> 1
|
||||
ctmx566 comparetotmag 1E+10 1 -> 1
|
||||
ctmx567 comparetotmag 1E+11 1 -> 1
|
||||
ctmx568 comparetotmag 1E+12 1 -> 1
|
||||
ctmx569 comparetotmag 1E+13 1 -> 1
|
||||
ctmx570 comparetotmag 1E+14 1 -> 1
|
||||
ctmx571 comparetotmag 1E+15 1 -> 1
|
||||
-- similar with an useful coefficient, one side only
|
||||
ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1
|
||||
ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1
|
||||
ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1
|
||||
ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1
|
||||
ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1
|
||||
ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1
|
||||
ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1
|
||||
ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1
|
||||
ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1
|
||||
ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1
|
||||
ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1
|
||||
ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1
|
||||
ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1
|
||||
ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1
|
||||
ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1
|
||||
ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1
|
||||
ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1
|
||||
ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1
|
||||
ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1
|
||||
ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
precision: 20
|
||||
ctmx600 comparetotmag 12 12.2345 -> -1
|
||||
ctmx601 comparetotmag 12.0 12.2345 -> -1
|
||||
ctmx602 comparetotmag 12.00 12.2345 -> -1
|
||||
ctmx603 comparetotmag 12.000 12.2345 -> -1
|
||||
ctmx604 comparetotmag 12.0000 12.2345 -> -1
|
||||
ctmx605 comparetotmag 12.00000 12.2345 -> -1
|
||||
ctmx606 comparetotmag 12.000000 12.2345 -> -1
|
||||
ctmx607 comparetotmag 12.0000000 12.2345 -> -1
|
||||
ctmx608 comparetotmag 12.00000000 12.2345 -> -1
|
||||
ctmx609 comparetotmag 12.000000000 12.2345 -> -1
|
||||
ctmx610 comparetotmag 12.1234 12 -> 1
|
||||
ctmx611 comparetotmag 12.1234 12.0 -> 1
|
||||
ctmx612 comparetotmag 12.1234 12.00 -> 1
|
||||
ctmx613 comparetotmag 12.1234 12.000 -> 1
|
||||
ctmx614 comparetotmag 12.1234 12.0000 -> 1
|
||||
ctmx615 comparetotmag 12.1234 12.00000 -> 1
|
||||
ctmx616 comparetotmag 12.1234 12.000000 -> 1
|
||||
ctmx617 comparetotmag 12.1234 12.0000000 -> 1
|
||||
ctmx618 comparetotmag 12.1234 12.00000000 -> 1
|
||||
ctmx619 comparetotmag 12.1234 12.000000000 -> 1
|
||||
ctmx620 comparetotmag -12 -12.2345 -> -1
|
||||
ctmx621 comparetotmag -12.0 -12.2345 -> -1
|
||||
ctmx622 comparetotmag -12.00 -12.2345 -> -1
|
||||
ctmx623 comparetotmag -12.000 -12.2345 -> -1
|
||||
ctmx624 comparetotmag -12.0000 -12.2345 -> -1
|
||||
ctmx625 comparetotmag -12.00000 -12.2345 -> -1
|
||||
ctmx626 comparetotmag -12.000000 -12.2345 -> -1
|
||||
ctmx627 comparetotmag -12.0000000 -12.2345 -> -1
|
||||
ctmx628 comparetotmag -12.00000000 -12.2345 -> -1
|
||||
ctmx629 comparetotmag -12.000000000 -12.2345 -> -1
|
||||
ctmx630 comparetotmag -12.1234 -12 -> 1
|
||||
ctmx631 comparetotmag -12.1234 -12.0 -> 1
|
||||
ctmx632 comparetotmag -12.1234 -12.00 -> 1
|
||||
ctmx633 comparetotmag -12.1234 -12.000 -> 1
|
||||
ctmx634 comparetotmag -12.1234 -12.0000 -> 1
|
||||
ctmx635 comparetotmag -12.1234 -12.00000 -> 1
|
||||
ctmx636 comparetotmag -12.1234 -12.000000 -> 1
|
||||
ctmx637 comparetotmag -12.1234 -12.0000000 -> 1
|
||||
ctmx638 comparetotmag -12.1234 -12.00000000 -> 1
|
||||
ctmx639 comparetotmag -12.1234 -12.000000000 -> 1
|
||||
precision: 9
|
||||
|
||||
-- extended zeros
|
||||
ctmx640 comparetotmag 0 0 -> 0
|
||||
ctmx641 comparetotmag 0 -0 -> 0
|
||||
ctmx642 comparetotmag 0 -0.0 -> 1
|
||||
ctmx643 comparetotmag 0 0.0 -> 1
|
||||
ctmx644 comparetotmag -0 0 -> 0
|
||||
ctmx645 comparetotmag -0 -0 -> 0
|
||||
ctmx646 comparetotmag -0 -0.0 -> 1
|
||||
ctmx647 comparetotmag -0 0.0 -> 1
|
||||
ctmx648 comparetotmag 0.0 0 -> -1
|
||||
ctmx649 comparetotmag 0.0 -0 -> -1
|
||||
ctmx650 comparetotmag 0.0 -0.0 -> 0
|
||||
ctmx651 comparetotmag 0.0 0.0 -> 0
|
||||
ctmx652 comparetotmag -0.0 0 -> -1
|
||||
ctmx653 comparetotmag -0.0 -0 -> -1
|
||||
ctmx654 comparetotmag -0.0 -0.0 -> 0
|
||||
ctmx655 comparetotmag -0.0 0.0 -> 0
|
||||
|
||||
ctmx656 comparetotmag -0E1 0.0 -> 1
|
||||
ctmx657 comparetotmag -0E2 0.0 -> 1
|
||||
ctmx658 comparetotmag 0E1 0.0 -> 1
|
||||
ctmx659 comparetotmag 0E2 0.0 -> 1
|
||||
ctmx660 comparetotmag -0E1 0 -> 1
|
||||
ctmx661 comparetotmag -0E2 0 -> 1
|
||||
ctmx662 comparetotmag 0E1 0 -> 1
|
||||
ctmx663 comparetotmag 0E2 0 -> 1
|
||||
ctmx664 comparetotmag -0E1 -0E1 -> 0
|
||||
ctmx665 comparetotmag -0E2 -0E1 -> 1
|
||||
ctmx666 comparetotmag 0E1 -0E1 -> 0
|
||||
ctmx667 comparetotmag 0E2 -0E1 -> 1
|
||||
ctmx668 comparetotmag -0E1 -0E2 -> -1
|
||||
ctmx669 comparetotmag -0E2 -0E2 -> 0
|
||||
ctmx670 comparetotmag 0E1 -0E2 -> -1
|
||||
ctmx671 comparetotmag 0E2 -0E2 -> 0
|
||||
ctmx672 comparetotmag -0E1 0E1 -> 0
|
||||
ctmx673 comparetotmag -0E2 0E1 -> 1
|
||||
ctmx674 comparetotmag 0E1 0E1 -> 0
|
||||
ctmx675 comparetotmag 0E2 0E1 -> 1
|
||||
ctmx676 comparetotmag -0E1 0E2 -> -1
|
||||
ctmx677 comparetotmag -0E2 0E2 -> 0
|
||||
ctmx678 comparetotmag 0E1 0E2 -> -1
|
||||
ctmx679 comparetotmag 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
precision: 20
|
||||
ctmx680 comparetotmag 12 12 -> 0
|
||||
ctmx681 comparetotmag 12 12.0 -> 1
|
||||
ctmx682 comparetotmag 12 12.00 -> 1
|
||||
ctmx683 comparetotmag 12 12.000 -> 1
|
||||
ctmx684 comparetotmag 12 12.0000 -> 1
|
||||
ctmx685 comparetotmag 12 12.00000 -> 1
|
||||
ctmx686 comparetotmag 12 12.000000 -> 1
|
||||
ctmx687 comparetotmag 12 12.0000000 -> 1
|
||||
ctmx688 comparetotmag 12 12.00000000 -> 1
|
||||
ctmx689 comparetotmag 12 12.000000000 -> 1
|
||||
ctmx690 comparetotmag 12 12 -> 0
|
||||
ctmx691 comparetotmag 12.0 12 -> -1
|
||||
ctmx692 comparetotmag 12.00 12 -> -1
|
||||
ctmx693 comparetotmag 12.000 12 -> -1
|
||||
ctmx694 comparetotmag 12.0000 12 -> -1
|
||||
ctmx695 comparetotmag 12.00000 12 -> -1
|
||||
ctmx696 comparetotmag 12.000000 12 -> -1
|
||||
ctmx697 comparetotmag 12.0000000 12 -> -1
|
||||
ctmx698 comparetotmag 12.00000000 12 -> -1
|
||||
ctmx699 comparetotmag 12.000000000 12 -> -1
|
||||
|
||||
-- long operand checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
ctmx701 comparetotmag 12345678000 1 -> 1
|
||||
ctmx702 comparetotmag 1 12345678000 -> -1
|
||||
ctmx703 comparetotmag 1234567800 1 -> 1
|
||||
ctmx704 comparetotmag 1 1234567800 -> -1
|
||||
ctmx705 comparetotmag 1234567890 1 -> 1
|
||||
ctmx706 comparetotmag 1 1234567890 -> -1
|
||||
ctmx707 comparetotmag 1234567891 1 -> 1
|
||||
ctmx708 comparetotmag 1 1234567891 -> -1
|
||||
ctmx709 comparetotmag 12345678901 1 -> 1
|
||||
ctmx710 comparetotmag 1 12345678901 -> -1
|
||||
ctmx711 comparetotmag 1234567896 1 -> 1
|
||||
ctmx712 comparetotmag 1 1234567896 -> -1
|
||||
ctmx713 comparetotmag -1234567891 1 -> 1
|
||||
ctmx714 comparetotmag 1 -1234567891 -> -1
|
||||
ctmx715 comparetotmag -12345678901 1 -> 1
|
||||
ctmx716 comparetotmag 1 -12345678901 -> -1
|
||||
ctmx717 comparetotmag -1234567896 1 -> 1
|
||||
ctmx718 comparetotmag 1 -1234567896 -> -1
|
||||
|
||||
precision: 15
|
||||
-- same with plenty of precision
|
||||
ctmx721 comparetotmag 12345678000 1 -> 1
|
||||
ctmx722 comparetotmag 1 12345678000 -> -1
|
||||
ctmx723 comparetotmag 1234567800 1 -> 1
|
||||
ctmx724 comparetotmag 1 1234567800 -> -1
|
||||
ctmx725 comparetotmag 1234567890 1 -> 1
|
||||
ctmx726 comparetotmag 1 1234567890 -> -1
|
||||
ctmx727 comparetotmag 1234567891 1 -> 1
|
||||
ctmx728 comparetotmag 1 1234567891 -> -1
|
||||
ctmx729 comparetotmag 12345678901 1 -> 1
|
||||
ctmx730 comparetotmag 1 12345678901 -> -1
|
||||
ctmx731 comparetotmag 1234567896 1 -> 1
|
||||
ctmx732 comparetotmag 1 1234567896 -> -1
|
||||
|
||||
-- residue cases
|
||||
precision: 5
|
||||
ctmx740 comparetotmag 1 0.9999999 -> 1
|
||||
ctmx741 comparetotmag 1 0.999999 -> 1
|
||||
ctmx742 comparetotmag 1 0.99999 -> 1
|
||||
ctmx743 comparetotmag 1 1.0000 -> 1
|
||||
ctmx744 comparetotmag 1 1.00001 -> -1
|
||||
ctmx745 comparetotmag 1 1.000001 -> -1
|
||||
ctmx746 comparetotmag 1 1.0000001 -> -1
|
||||
ctmx750 comparetotmag 0.9999999 1 -> -1
|
||||
ctmx751 comparetotmag 0.999999 1 -> -1
|
||||
ctmx752 comparetotmag 0.99999 1 -> -1
|
||||
ctmx753 comparetotmag 1.0000 1 -> -1
|
||||
ctmx754 comparetotmag 1.00001 1 -> 1
|
||||
ctmx755 comparetotmag 1.000001 1 -> 1
|
||||
ctmx756 comparetotmag 1.0000001 1 -> 1
|
||||
|
||||
-- a selection of longies
|
||||
ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1
|
||||
ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
|
||||
ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1
|
||||
ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
-- precisions above or below the difference should have no effect
|
||||
precision: 11
|
||||
ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 10
|
||||
ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 9
|
||||
ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 8
|
||||
ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 7
|
||||
ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 6
|
||||
ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 5
|
||||
ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 4
|
||||
ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 3
|
||||
ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 2
|
||||
ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
precision: 1
|
||||
ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
|
||||
|
||||
-- Specials
|
||||
precision: 9
|
||||
ctmx780 comparetotmag Inf -Inf -> 0
|
||||
ctmx781 comparetotmag Inf -1000 -> 1
|
||||
ctmx782 comparetotmag Inf -1 -> 1
|
||||
ctmx783 comparetotmag Inf -0 -> 1
|
||||
ctmx784 comparetotmag Inf 0 -> 1
|
||||
ctmx785 comparetotmag Inf 1 -> 1
|
||||
ctmx786 comparetotmag Inf 1000 -> 1
|
||||
ctmx787 comparetotmag Inf Inf -> 0
|
||||
ctmx788 comparetotmag -1000 Inf -> -1
|
||||
ctmx789 comparetotmag -Inf Inf -> 0
|
||||
ctmx790 comparetotmag -1 Inf -> -1
|
||||
ctmx791 comparetotmag -0 Inf -> -1
|
||||
ctmx792 comparetotmag 0 Inf -> -1
|
||||
ctmx793 comparetotmag 1 Inf -> -1
|
||||
ctmx794 comparetotmag 1000 Inf -> -1
|
||||
ctmx795 comparetotmag Inf Inf -> 0
|
||||
|
||||
ctmx800 comparetotmag -Inf -Inf -> 0
|
||||
ctmx801 comparetotmag -Inf -1000 -> 1
|
||||
ctmx802 comparetotmag -Inf -1 -> 1
|
||||
ctmx803 comparetotmag -Inf -0 -> 1
|
||||
ctmx804 comparetotmag -Inf 0 -> 1
|
||||
ctmx805 comparetotmag -Inf 1 -> 1
|
||||
ctmx806 comparetotmag -Inf 1000 -> 1
|
||||
ctmx807 comparetotmag -Inf Inf -> 0
|
||||
ctmx808 comparetotmag -Inf -Inf -> 0
|
||||
ctmx809 comparetotmag -1000 -Inf -> -1
|
||||
ctmx810 comparetotmag -1 -Inf -> -1
|
||||
ctmx811 comparetotmag -0 -Inf -> -1
|
||||
ctmx812 comparetotmag 0 -Inf -> -1
|
||||
ctmx813 comparetotmag 1 -Inf -> -1
|
||||
ctmx814 comparetotmag 1000 -Inf -> -1
|
||||
ctmx815 comparetotmag Inf -Inf -> 0
|
||||
|
||||
ctmx821 comparetotmag NaN -Inf -> 1
|
||||
ctmx822 comparetotmag NaN -1000 -> 1
|
||||
ctmx823 comparetotmag NaN -1 -> 1
|
||||
ctmx824 comparetotmag NaN -0 -> 1
|
||||
ctmx825 comparetotmag NaN 0 -> 1
|
||||
ctmx826 comparetotmag NaN 1 -> 1
|
||||
ctmx827 comparetotmag NaN 1000 -> 1
|
||||
ctmx828 comparetotmag NaN Inf -> 1
|
||||
ctmx829 comparetotmag NaN NaN -> 0
|
||||
ctmx830 comparetotmag -Inf NaN -> -1
|
||||
ctmx831 comparetotmag -1000 NaN -> -1
|
||||
ctmx832 comparetotmag -1 NaN -> -1
|
||||
ctmx833 comparetotmag -0 NaN -> -1
|
||||
ctmx834 comparetotmag 0 NaN -> -1
|
||||
ctmx835 comparetotmag 1 NaN -> -1
|
||||
ctmx836 comparetotmag 1000 NaN -> -1
|
||||
ctmx837 comparetotmag Inf NaN -> -1
|
||||
ctmx838 comparetotmag -NaN -NaN -> 0
|
||||
ctmx839 comparetotmag +NaN -NaN -> 0
|
||||
ctmx840 comparetotmag -NaN +NaN -> 0
|
||||
|
||||
ctmx841 comparetotmag sNaN -sNaN -> 0
|
||||
ctmx842 comparetotmag sNaN -NaN -> -1
|
||||
ctmx843 comparetotmag sNaN -Inf -> 1
|
||||
ctmx844 comparetotmag sNaN -1000 -> 1
|
||||
ctmx845 comparetotmag sNaN -1 -> 1
|
||||
ctmx846 comparetotmag sNaN -0 -> 1
|
||||
ctmx847 comparetotmag sNaN 0 -> 1
|
||||
ctmx848 comparetotmag sNaN 1 -> 1
|
||||
ctmx849 comparetotmag sNaN 1000 -> 1
|
||||
ctmx850 comparetotmag sNaN NaN -> -1
|
||||
ctmx851 comparetotmag sNaN sNaN -> 0
|
||||
|
||||
ctmx852 comparetotmag -sNaN sNaN -> 0
|
||||
ctmx853 comparetotmag -NaN sNaN -> 1
|
||||
ctmx854 comparetotmag -Inf sNaN -> -1
|
||||
ctmx855 comparetotmag -1000 sNaN -> -1
|
||||
ctmx856 comparetotmag -1 sNaN -> -1
|
||||
ctmx857 comparetotmag -0 sNaN -> -1
|
||||
ctmx858 comparetotmag 0 sNaN -> -1
|
||||
ctmx859 comparetotmag 1 sNaN -> -1
|
||||
ctmx860 comparetotmag 1000 sNaN -> -1
|
||||
ctmx861 comparetotmag Inf sNaN -> -1
|
||||
ctmx862 comparetotmag NaN sNaN -> 1
|
||||
ctmx863 comparetotmag sNaN sNaN -> 0
|
||||
|
||||
ctmx871 comparetotmag -sNaN -sNaN -> 0
|
||||
ctmx872 comparetotmag -sNaN -NaN -> -1
|
||||
ctmx873 comparetotmag -sNaN -Inf -> 1
|
||||
ctmx874 comparetotmag -sNaN -1000 -> 1
|
||||
ctmx875 comparetotmag -sNaN -1 -> 1
|
||||
ctmx876 comparetotmag -sNaN -0 -> 1
|
||||
ctmx877 comparetotmag -sNaN 0 -> 1
|
||||
ctmx878 comparetotmag -sNaN 1 -> 1
|
||||
ctmx879 comparetotmag -sNaN 1000 -> 1
|
||||
ctmx880 comparetotmag -sNaN NaN -> -1
|
||||
ctmx881 comparetotmag -sNaN sNaN -> 0
|
||||
|
||||
ctmx882 comparetotmag -sNaN -sNaN -> 0
|
||||
ctmx883 comparetotmag -NaN -sNaN -> 1
|
||||
ctmx884 comparetotmag -Inf -sNaN -> -1
|
||||
ctmx885 comparetotmag -1000 -sNaN -> -1
|
||||
ctmx886 comparetotmag -1 -sNaN -> -1
|
||||
ctmx887 comparetotmag -0 -sNaN -> -1
|
||||
ctmx888 comparetotmag 0 -sNaN -> -1
|
||||
ctmx889 comparetotmag 1 -sNaN -> -1
|
||||
ctmx890 comparetotmag 1000 -sNaN -> -1
|
||||
ctmx891 comparetotmag Inf -sNaN -> -1
|
||||
ctmx892 comparetotmag NaN -sNaN -> 1
|
||||
ctmx893 comparetotmag sNaN -sNaN -> 0
|
||||
|
||||
-- NaNs with payload
|
||||
ctmx960 comparetotmag NaN9 -Inf -> 1
|
||||
ctmx961 comparetotmag NaN8 999 -> 1
|
||||
ctmx962 comparetotmag NaN77 Inf -> 1
|
||||
ctmx963 comparetotmag -NaN67 NaN5 -> 1
|
||||
ctmx964 comparetotmag -Inf -NaN4 -> -1
|
||||
ctmx965 comparetotmag -999 -NaN33 -> -1
|
||||
ctmx966 comparetotmag Inf NaN2 -> -1
|
||||
|
||||
ctmx970 comparetotmag -NaN41 -NaN42 -> -1
|
||||
ctmx971 comparetotmag +NaN41 -NaN42 -> -1
|
||||
ctmx972 comparetotmag -NaN41 +NaN42 -> -1
|
||||
ctmx973 comparetotmag +NaN41 +NaN42 -> -1
|
||||
ctmx974 comparetotmag -NaN42 -NaN01 -> 1
|
||||
ctmx975 comparetotmag +NaN42 -NaN01 -> 1
|
||||
ctmx976 comparetotmag -NaN42 +NaN01 -> 1
|
||||
ctmx977 comparetotmag +NaN42 +NaN01 -> 1
|
||||
|
||||
ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1
|
||||
ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1
|
||||
ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1
|
||||
ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1
|
||||
ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1
|
||||
ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1
|
||||
ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1
|
||||
ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1
|
||||
|
||||
ctmx991 comparetotmag -sNaN99 -Inf -> 1
|
||||
ctmx992 comparetotmag sNaN98 -11 -> 1
|
||||
ctmx993 comparetotmag sNaN97 NaN -> -1
|
||||
ctmx994 comparetotmag sNaN16 sNaN94 -> -1
|
||||
ctmx995 comparetotmag NaN85 sNaN83 -> 1
|
||||
ctmx996 comparetotmag -Inf sNaN92 -> -1
|
||||
ctmx997 comparetotmag 088 sNaN81 -> -1
|
||||
ctmx998 comparetotmag Inf sNaN90 -> -1
|
||||
ctmx999 comparetotmag NaN -sNaN89 -> 1
|
||||
|
||||
-- overflow and underflow tests .. subnormal results now allowed
|
||||
maxExponent: 999999999
|
||||
minexponent: -999999999
|
||||
ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1
|
||||
ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1
|
||||
ctmx1082 comparetotmag +0.100 9E-999999999 -> 1
|
||||
ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1
|
||||
ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1
|
||||
ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1
|
||||
ctmx1087 comparetotmag -0.100 9E-999999999 -> 1
|
||||
ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1
|
||||
|
||||
ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1
|
||||
ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1
|
||||
ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1
|
||||
ctmx1092 comparetotmag 9e-999999998 0.01 -> -1
|
||||
ctmx1093 comparetotmag 9e-999999998 0.1 -> -1
|
||||
ctmx1094 comparetotmag 0.01 9e-999999998 -> 1
|
||||
ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1
|
||||
ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1
|
||||
ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1
|
||||
ctmx1098 comparetotmag 9e999999998 100 -> 1
|
||||
ctmx1099 comparetotmag 9e999999998 10 -> 1
|
||||
ctmx1100 comparetotmag 100 9e999999998 -> -1
|
||||
-- signs
|
||||
ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1
|
||||
ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1
|
||||
ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1
|
||||
ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1
|
||||
ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1
|
||||
ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1
|
||||
ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1
|
||||
ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1
|
||||
|
||||
-- spread zeros
|
||||
ctmx1110 comparetotmag 0E-383 0 -> -1
|
||||
ctmx1111 comparetotmag 0E-383 -0 -> -1
|
||||
ctmx1112 comparetotmag -0E-383 0 -> -1
|
||||
ctmx1113 comparetotmag -0E-383 -0 -> -1
|
||||
ctmx1114 comparetotmag 0E-383 0E+384 -> -1
|
||||
ctmx1115 comparetotmag 0E-383 -0E+384 -> -1
|
||||
ctmx1116 comparetotmag -0E-383 0E+384 -> -1
|
||||
ctmx1117 comparetotmag -0E-383 -0E+384 -> -1
|
||||
ctmx1118 comparetotmag 0 0E+384 -> -1
|
||||
ctmx1119 comparetotmag 0 -0E+384 -> -1
|
||||
ctmx1120 comparetotmag -0 0E+384 -> -1
|
||||
ctmx1121 comparetotmag -0 -0E+384 -> -1
|
||||
|
||||
ctmx1130 comparetotmag 0E+384 0 -> 1
|
||||
ctmx1131 comparetotmag 0E+384 -0 -> 1
|
||||
ctmx1132 comparetotmag -0E+384 0 -> 1
|
||||
ctmx1133 comparetotmag -0E+384 -0 -> 1
|
||||
ctmx1134 comparetotmag 0E+384 0E-383 -> 1
|
||||
ctmx1135 comparetotmag 0E+384 -0E-383 -> 1
|
||||
ctmx1136 comparetotmag -0E+384 0E-383 -> 1
|
||||
ctmx1137 comparetotmag -0E+384 -0E-383 -> 1
|
||||
ctmx1138 comparetotmag 0 0E-383 -> 1
|
||||
ctmx1139 comparetotmag 0 -0E-383 -> 1
|
||||
ctmx1140 comparetotmag -0 0E-383 -> 1
|
||||
ctmx1141 comparetotmag -0 -0E-383 -> 1
|
||||
|
||||
-- Null tests
|
||||
ctmx9990 comparetotmag 10 # -> NaN Invalid_operation
|
||||
ctmx9991 comparetotmag # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,86 @@
|
|||
------------------------------------------------------------------------
|
||||
-- copy.decTest -- quiet copy --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
|
||||
-- Sanity check
|
||||
cpyx001 copy +7.50 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
cpyx011 copy Infinity -> Infinity
|
||||
cpyx012 copy -Infinity -> -Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
cpyx021 copy NaN -> NaN
|
||||
cpyx022 copy -NaN -> -NaN
|
||||
cpyx023 copy sNaN -> sNaN
|
||||
cpyx024 copy -sNaN -> -sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
cpyx031 copy NaN10 -> NaN10
|
||||
cpyx032 copy -NaN10 -> -NaN10
|
||||
cpyx033 copy sNaN10 -> sNaN10
|
||||
cpyx034 copy -sNaN10 -> -sNaN10
|
||||
cpyx035 copy NaN7 -> NaN7
|
||||
cpyx036 copy -NaN7 -> -NaN7
|
||||
cpyx037 copy sNaN101 -> sNaN101
|
||||
cpyx038 copy -sNaN101 -> -sNaN101
|
||||
|
||||
-- finites
|
||||
cpyx101 copy 7 -> 7
|
||||
cpyx102 copy -7 -> -7
|
||||
cpyx103 copy 75 -> 75
|
||||
cpyx104 copy -75 -> -75
|
||||
cpyx105 copy 7.50 -> 7.50
|
||||
cpyx106 copy -7.50 -> -7.50
|
||||
cpyx107 copy 7.500 -> 7.500
|
||||
cpyx108 copy -7.500 -> -7.500
|
||||
|
||||
-- zeros
|
||||
cpyx111 copy 0 -> 0
|
||||
cpyx112 copy -0 -> -0
|
||||
cpyx113 copy 0E+4 -> 0E+4
|
||||
cpyx114 copy -0E+4 -> -0E+4
|
||||
cpyx115 copy 0.0000 -> 0.0000
|
||||
cpyx116 copy -0.0000 -> -0.0000
|
||||
cpyx117 copy 0E-141 -> 0E-141
|
||||
cpyx118 copy -0E-141 -> -0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
cpyx121 copy 268268268 -> 268268268
|
||||
cpyx122 copy -268268268 -> -268268268
|
||||
cpyx123 copy 134134134 -> 134134134
|
||||
cpyx124 copy -134134134 -> -134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
cpyx131 copy 9.99999999E+999 -> 9.99999999E+999
|
||||
cpyx132 copy 1E-999 -> 1E-999
|
||||
cpyx133 copy 1.00000000E-999 -> 1.00000000E-999
|
||||
cpyx134 copy 1E-1007 -> 1E-1007
|
||||
|
||||
cpyx135 copy -1E-1007 -> -1E-1007
|
||||
cpyx136 copy -1.00000000E-999 -> -1.00000000E-999
|
||||
cpyx137 copy -1E-999 -> -1E-999
|
||||
cpyx138 copy -9.99999999E+999 -> -9.99999999E+999
|
|
@ -0,0 +1,86 @@
|
|||
------------------------------------------------------------------------
|
||||
-- copyAbs.decTest -- quiet copy and set sign to zero --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
|
||||
-- Sanity check
|
||||
cpax001 copyabs +7.50 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
cpax011 copyabs Infinity -> Infinity
|
||||
cpax012 copyabs -Infinity -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
cpax021 copyabs NaN -> NaN
|
||||
cpax022 copyabs -NaN -> NaN
|
||||
cpax023 copyabs sNaN -> sNaN
|
||||
cpax024 copyabs -sNaN -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
cpax031 copyabs NaN10 -> NaN10
|
||||
cpax032 copyabs -NaN15 -> NaN15
|
||||
cpax033 copyabs sNaN15 -> sNaN15
|
||||
cpax034 copyabs -sNaN10 -> sNaN10
|
||||
cpax035 copyabs NaN7 -> NaN7
|
||||
cpax036 copyabs -NaN7 -> NaN7
|
||||
cpax037 copyabs sNaN101 -> sNaN101
|
||||
cpax038 copyabs -sNaN101 -> sNaN101
|
||||
|
||||
-- finites
|
||||
cpax101 copyabs 7 -> 7
|
||||
cpax102 copyabs -7 -> 7
|
||||
cpax103 copyabs 75 -> 75
|
||||
cpax104 copyabs -75 -> 75
|
||||
cpax105 copyabs 7.10 -> 7.10
|
||||
cpax106 copyabs -7.10 -> 7.10
|
||||
cpax107 copyabs 7.500 -> 7.500
|
||||
cpax108 copyabs -7.500 -> 7.500
|
||||
|
||||
-- zeros
|
||||
cpax111 copyabs 0 -> 0
|
||||
cpax112 copyabs -0 -> 0
|
||||
cpax113 copyabs 0E+6 -> 0E+6
|
||||
cpax114 copyabs -0E+6 -> 0E+6
|
||||
cpax115 copyabs 0.0000 -> 0.0000
|
||||
cpax116 copyabs -0.0000 -> 0.0000
|
||||
cpax117 copyabs 0E-141 -> 0E-141
|
||||
cpax118 copyabs -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
cpax121 copyabs 268268268 -> 268268268
|
||||
cpax122 copyabs -268268268 -> 268268268
|
||||
cpax123 copyabs 134134134 -> 134134134
|
||||
cpax124 copyabs -134134134 -> 134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999
|
||||
cpax132 copyabs 1E-999 -> 1E-999
|
||||
cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999
|
||||
cpax134 copyabs 1E-1007 -> 1E-1007
|
||||
|
||||
cpax135 copyabs -1E-1007 -> 1E-1007
|
||||
cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999
|
||||
cpax137 copyabs -1E-999 -> 1E-999
|
||||
cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999
|
|
@ -0,0 +1,86 @@
|
|||
------------------------------------------------------------------------
|
||||
-- copyNegate.decTest -- quiet copy and negate --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
|
||||
-- Sanity check
|
||||
cpnx001 copynegate +7.50 -> -7.50
|
||||
|
||||
-- Infinities
|
||||
cpnx011 copynegate Infinity -> -Infinity
|
||||
cpnx012 copynegate -Infinity -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
cpnx021 copynegate NaN -> -NaN
|
||||
cpnx022 copynegate -NaN -> NaN
|
||||
cpnx023 copynegate sNaN -> -sNaN
|
||||
cpnx024 copynegate -sNaN -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
cpnx031 copynegate NaN13 -> -NaN13
|
||||
cpnx032 copynegate -NaN13 -> NaN13
|
||||
cpnx033 copynegate sNaN13 -> -sNaN13
|
||||
cpnx034 copynegate -sNaN13 -> sNaN13
|
||||
cpnx035 copynegate NaN70 -> -NaN70
|
||||
cpnx036 copynegate -NaN70 -> NaN70
|
||||
cpnx037 copynegate sNaN101 -> -sNaN101
|
||||
cpnx038 copynegate -sNaN101 -> sNaN101
|
||||
|
||||
-- finites
|
||||
cpnx101 copynegate 7 -> -7
|
||||
cpnx102 copynegate -7 -> 7
|
||||
cpnx103 copynegate 75 -> -75
|
||||
cpnx104 copynegate -75 -> 75
|
||||
cpnx105 copynegate 7.50 -> -7.50
|
||||
cpnx106 copynegate -7.50 -> 7.50
|
||||
cpnx107 copynegate 7.500 -> -7.500
|
||||
cpnx108 copynegate -7.500 -> 7.500
|
||||
|
||||
-- zeros
|
||||
cpnx111 copynegate 0 -> -0
|
||||
cpnx112 copynegate -0 -> 0
|
||||
cpnx113 copynegate 0E+4 -> -0E+4
|
||||
cpnx114 copynegate -0E+4 -> 0E+4
|
||||
cpnx115 copynegate 0.0000 -> -0.0000
|
||||
cpnx116 copynegate -0.0000 -> 0.0000
|
||||
cpnx117 copynegate 0E-141 -> -0E-141
|
||||
cpnx118 copynegate -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
cpnx121 copynegate 268268268 -> -268268268
|
||||
cpnx122 copynegate -268268268 -> 268268268
|
||||
cpnx123 copynegate 134134134 -> -134134134
|
||||
cpnx124 copynegate -134134134 -> 134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999
|
||||
cpnx132 copynegate 1E-999 -> -1E-999
|
||||
cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999
|
||||
cpnx134 copynegate 1E-1007 -> -1E-1007
|
||||
|
||||
cpnx135 copynegate -1E-1007 -> 1E-1007
|
||||
cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999
|
||||
cpnx137 copynegate -1E-999 -> 1E-999
|
||||
cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999
|
|
@ -0,0 +1,177 @@
|
|||
------------------------------------------------------------------------
|
||||
-- copysign.decTest -- quiet copy with sign from rhs --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minExponent: -999
|
||||
|
||||
-- Sanity check, and examples from decArith
|
||||
cpsx001 copysign +7.50 11 -> 7.50
|
||||
cpsx002 copysign '1.50' '7.33' -> 1.50
|
||||
cpsx003 copysign '-1.50' '7.33' -> 1.50
|
||||
cpsx004 copysign '1.50' '-7.33' -> -1.50
|
||||
cpsx005 copysign '-1.50' '-7.33' -> -1.50
|
||||
|
||||
-- Infinities
|
||||
cpsx011 copysign Infinity 11 -> Infinity
|
||||
cpsx012 copysign -Infinity 11 -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
cpsx021 copysign NaN 11 -> NaN
|
||||
cpsx022 copysign -NaN 11 -> NaN
|
||||
cpsx023 copysign sNaN 11 -> sNaN
|
||||
cpsx024 copysign -sNaN 11 -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
cpsx031 copysign NaN10 11 -> NaN10
|
||||
cpsx032 copysign -NaN10 11 -> NaN10
|
||||
cpsx033 copysign sNaN10 11 -> sNaN10
|
||||
cpsx034 copysign -sNaN10 11 -> sNaN10
|
||||
cpsx035 copysign NaN7 11 -> NaN7
|
||||
cpsx036 copysign -NaN7 11 -> NaN7
|
||||
cpsx037 copysign sNaN101 11 -> sNaN101
|
||||
cpsx038 copysign -sNaN101 11 -> sNaN101
|
||||
|
||||
-- finites
|
||||
cpsx101 copysign 7 11 -> 7
|
||||
cpsx102 copysign -7 11 -> 7
|
||||
cpsx103 copysign 75 11 -> 75
|
||||
cpsx104 copysign -75 11 -> 75
|
||||
cpsx105 copysign 7.50 11 -> 7.50
|
||||
cpsx106 copysign -7.50 11 -> 7.50
|
||||
cpsx107 copysign 7.500 11 -> 7.500
|
||||
cpsx108 copysign -7.500 11 -> 7.500
|
||||
|
||||
-- zeros
|
||||
cpsx111 copysign 0 11 -> 0
|
||||
cpsx112 copysign -0 11 -> 0
|
||||
cpsx113 copysign 0E+4 11 -> 0E+4
|
||||
cpsx114 copysign -0E+4 11 -> 0E+4
|
||||
cpsx115 copysign 0.0000 11 -> 0.0000
|
||||
cpsx116 copysign -0.0000 11 -> 0.0000
|
||||
cpsx117 copysign 0E-141 11 -> 0E-141
|
||||
cpsx118 copysign -0E-141 11 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
cpsx121 copysign 268268268 11 -> 268268268
|
||||
cpsx122 copysign -268268268 11 -> 268268268
|
||||
cpsx123 copysign 134134134 11 -> 134134134
|
||||
cpsx124 copysign -134134134 11 -> 134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999
|
||||
cpsx132 copysign 1E-999 11 -> 1E-999
|
||||
cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999
|
||||
cpsx134 copysign 1E-1007 11 -> 1E-1007
|
||||
|
||||
cpsx135 copysign -1E-1007 11 -> 1E-1007
|
||||
cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999
|
||||
cpsx137 copysign -1E-999 11 -> 1E-999
|
||||
cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999
|
||||
|
||||
-- repeat with negative RHS
|
||||
|
||||
-- Infinities
|
||||
cpsx211 copysign Infinity -34 -> -Infinity
|
||||
cpsx212 copysign -Infinity -34 -> -Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
cpsx221 copysign NaN -34 -> -NaN
|
||||
cpsx222 copysign -NaN -34 -> -NaN
|
||||
cpsx223 copysign sNaN -34 -> -sNaN
|
||||
cpsx224 copysign -sNaN -34 -> -sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
cpsx231 copysign NaN10 -34 -> -NaN10
|
||||
cpsx232 copysign -NaN10 -34 -> -NaN10
|
||||
cpsx233 copysign sNaN10 -34 -> -sNaN10
|
||||
cpsx234 copysign -sNaN10 -34 -> -sNaN10
|
||||
cpsx235 copysign NaN7 -34 -> -NaN7
|
||||
cpsx236 copysign -NaN7 -34 -> -NaN7
|
||||
cpsx237 copysign sNaN101 -34 -> -sNaN101
|
||||
cpsx238 copysign -sNaN101 -34 -> -sNaN101
|
||||
|
||||
-- finites
|
||||
cpsx301 copysign 7 -34 -> -7
|
||||
cpsx302 copysign -7 -34 -> -7
|
||||
cpsx303 copysign 75 -34 -> -75
|
||||
cpsx304 copysign -75 -34 -> -75
|
||||
cpsx305 copysign 7.50 -34 -> -7.50
|
||||
cpsx306 copysign -7.50 -34 -> -7.50
|
||||
cpsx307 copysign 7.500 -34 -> -7.500
|
||||
cpsx308 copysign -7.500 -34 -> -7.500
|
||||
|
||||
-- zeros
|
||||
cpsx311 copysign 0 -34 -> -0
|
||||
cpsx312 copysign -0 -34 -> -0
|
||||
cpsx313 copysign 0E+4 -34 -> -0E+4
|
||||
cpsx314 copysign -0E+4 -34 -> -0E+4
|
||||
cpsx315 copysign 0.0000 -34 -> -0.0000
|
||||
cpsx316 copysign -0.0000 -34 -> -0.0000
|
||||
cpsx317 copysign 0E-141 -34 -> -0E-141
|
||||
cpsx318 copysign -0E-141 -34 -> -0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
cpsx321 copysign 268268268 -18 -> -268268268
|
||||
cpsx322 copysign -268268268 -18 -> -268268268
|
||||
cpsx323 copysign 134134134 -18 -> -134134134
|
||||
cpsx324 copysign -134134134 -18 -> -134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999
|
||||
cpsx332 copysign 1E-999 -18 -> -1E-999
|
||||
cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999
|
||||
cpsx334 copysign 1E-1007 -18 -> -1E-1007
|
||||
|
||||
cpsx335 copysign -1E-1007 -18 -> -1E-1007
|
||||
cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999
|
||||
cpsx337 copysign -1E-999 -18 -> -1E-999
|
||||
cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999
|
||||
|
||||
-- Other kinds of RHS
|
||||
cpsx401 copysign 701 -34 -> -701
|
||||
cpsx402 copysign -720 -34 -> -720
|
||||
cpsx403 copysign 701 -0 -> -701
|
||||
cpsx404 copysign -720 -0 -> -720
|
||||
cpsx405 copysign 701 +0 -> 701
|
||||
cpsx406 copysign -720 +0 -> 720
|
||||
cpsx407 copysign 701 +34 -> 701
|
||||
cpsx408 copysign -720 +34 -> 720
|
||||
|
||||
cpsx413 copysign 701 -Inf -> -701
|
||||
cpsx414 copysign -720 -Inf -> -720
|
||||
cpsx415 copysign 701 +Inf -> 701
|
||||
cpsx416 copysign -720 +Inf -> 720
|
||||
|
||||
cpsx420 copysign 701 -NaN -> -701
|
||||
cpsx421 copysign -720 -NaN -> -720
|
||||
cpsx422 copysign 701 +NaN -> 701
|
||||
cpsx423 copysign -720 +NaN -> 720
|
||||
cpsx425 copysign -720 +NaN8 -> 720
|
||||
|
||||
cpsx426 copysign 701 -sNaN -> -701
|
||||
cpsx427 copysign -720 -sNaN -> -720
|
||||
cpsx428 copysign 701 +sNaN -> 701
|
||||
cpsx429 copysign -720 +sNaN -> 720
|
||||
cpsx430 copysign -720 +sNaN3 -> 720
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddAbs.decTest -- decDouble absolute value, heeding sNaN --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddabs001 abs '1' -> '1'
|
||||
ddabs002 abs '-1' -> '1'
|
||||
ddabs003 abs '1.00' -> '1.00'
|
||||
ddabs004 abs '-1.00' -> '1.00'
|
||||
ddabs005 abs '0' -> '0'
|
||||
ddabs006 abs '0.00' -> '0.00'
|
||||
ddabs007 abs '00.0' -> '0.0'
|
||||
ddabs008 abs '00.00' -> '0.00'
|
||||
ddabs009 abs '00' -> '0'
|
||||
|
||||
ddabs010 abs '-2' -> '2'
|
||||
ddabs011 abs '2' -> '2'
|
||||
ddabs012 abs '-2.00' -> '2.00'
|
||||
ddabs013 abs '2.00' -> '2.00'
|
||||
ddabs014 abs '-0' -> '0'
|
||||
ddabs015 abs '-0.00' -> '0.00'
|
||||
ddabs016 abs '-00.0' -> '0.0'
|
||||
ddabs017 abs '-00.00' -> '0.00'
|
||||
ddabs018 abs '-00' -> '0'
|
||||
|
||||
ddabs020 abs '-2000000' -> '2000000'
|
||||
ddabs021 abs '2000000' -> '2000000'
|
||||
|
||||
ddabs030 abs '+0.1' -> '0.1'
|
||||
ddabs031 abs '-0.1' -> '0.1'
|
||||
ddabs032 abs '+0.01' -> '0.01'
|
||||
ddabs033 abs '-0.01' -> '0.01'
|
||||
ddabs034 abs '+0.001' -> '0.001'
|
||||
ddabs035 abs '-0.001' -> '0.001'
|
||||
ddabs036 abs '+0.000001' -> '0.000001'
|
||||
ddabs037 abs '-0.000001' -> '0.000001'
|
||||
ddabs038 abs '+0.000000000001' -> '1E-12'
|
||||
ddabs039 abs '-0.000000000001' -> '1E-12'
|
||||
|
||||
-- examples from decArith
|
||||
ddabs040 abs '2.1' -> '2.1'
|
||||
ddabs041 abs '-100' -> '100'
|
||||
ddabs042 abs '101.5' -> '101.5'
|
||||
ddabs043 abs '-101.5' -> '101.5'
|
||||
|
||||
-- more fixed, potential LHS swaps/overlays if done by subtract 0
|
||||
ddabs060 abs '-56267E-10' -> '0.0000056267'
|
||||
ddabs061 abs '-56267E-5' -> '0.56267'
|
||||
ddabs062 abs '-56267E-2' -> '562.67'
|
||||
ddabs063 abs '-56267E-1' -> '5626.7'
|
||||
ddabs065 abs '-56267E-0' -> '56267'
|
||||
|
||||
-- subnormals and underflow
|
||||
|
||||
-- long operand tests
|
||||
ddabs321 abs 1234567890123456 -> 1234567890123456
|
||||
ddabs322 abs 12345678000 -> 12345678000
|
||||
ddabs323 abs 1234567800 -> 1234567800
|
||||
ddabs324 abs 1234567890 -> 1234567890
|
||||
ddabs325 abs 1234567891 -> 1234567891
|
||||
ddabs326 abs 12345678901 -> 12345678901
|
||||
ddabs327 abs 1234567896 -> 1234567896
|
||||
|
||||
-- zeros
|
||||
ddabs111 abs 0 -> 0
|
||||
ddabs112 abs -0 -> 0
|
||||
ddabs113 abs 0E+6 -> 0E+6
|
||||
ddabs114 abs -0E+6 -> 0E+6
|
||||
ddabs115 abs 0.0000 -> 0.0000
|
||||
ddabs116 abs -0.0000 -> 0.0000
|
||||
ddabs117 abs 0E-141 -> 0E-141
|
||||
ddabs118 abs -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddabs121 abs 2682682682682682 -> 2682682682682682
|
||||
ddabs122 abs -2682682682682682 -> 2682682682682682
|
||||
ddabs123 abs 1341341341341341 -> 1341341341341341
|
||||
ddabs124 abs -1341341341341341 -> 1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddabs132 abs 1E-383 -> 1E-383
|
||||
ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddabs134 abs 1E-398 -> 1E-398 Subnormal
|
||||
|
||||
ddabs135 abs -1E-398 -> 1E-398 Subnormal
|
||||
ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddabs137 abs -1E-383 -> 1E-383
|
||||
ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
|
||||
-- specials
|
||||
ddabs520 abs 'Inf' -> 'Infinity'
|
||||
ddabs521 abs '-Inf' -> 'Infinity'
|
||||
ddabs522 abs NaN -> NaN
|
||||
ddabs523 abs sNaN -> NaN Invalid_operation
|
||||
ddabs524 abs NaN22 -> NaN22
|
||||
ddabs525 abs sNaN33 -> NaN33 Invalid_operation
|
||||
ddabs526 abs -NaN22 -> -NaN22
|
||||
ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
ddabs900 abs # -> NaN Invalid_operation
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,347 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddAnd.decTest -- digitwise logical AND for decDoubles --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check (truth table)
|
||||
ddand001 and 0 0 -> 0
|
||||
ddand002 and 0 1 -> 0
|
||||
ddand003 and 1 0 -> 0
|
||||
ddand004 and 1 1 -> 1
|
||||
ddand005 and 1100 1010 -> 1000
|
||||
-- and at msd and msd-1
|
||||
-- 1234567890123456 1234567890123456 1234567890123456
|
||||
ddand006 and 0000000000000000 0000000000000000 -> 0
|
||||
ddand007 and 0000000000000000 1000000000000000 -> 0
|
||||
ddand008 and 1000000000000000 0000000000000000 -> 0
|
||||
ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000
|
||||
ddand010 and 0000000000000000 0000000000000000 -> 0
|
||||
ddand011 and 0000000000000000 0100000000000000 -> 0
|
||||
ddand012 and 0100000000000000 0000000000000000 -> 0
|
||||
ddand013 and 0100000000000000 0100000000000000 -> 100000000000000
|
||||
|
||||
-- Various lengths
|
||||
-- 1234567890123456 1234567890123456 1234567890123456
|
||||
ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111
|
||||
ddand024 and 1111111111111111 111111111111111 -> 111111111111111
|
||||
ddand025 and 1111111111111111 11111111111111 -> 11111111111111
|
||||
ddand026 and 1111111111111111 1111111111111 -> 1111111111111
|
||||
ddand027 and 1111111111111111 111111111111 -> 111111111111
|
||||
ddand028 and 1111111111111111 11111111111 -> 11111111111
|
||||
ddand029 and 1111111111111111 1111111111 -> 1111111111
|
||||
ddand030 and 1111111111111111 111111111 -> 111111111
|
||||
ddand031 and 1111111111111111 11111111 -> 11111111
|
||||
ddand032 and 1111111111111111 1111111 -> 1111111
|
||||
ddand033 and 1111111111111111 111111 -> 111111
|
||||
ddand034 and 1111111111111111 11111 -> 11111
|
||||
ddand035 and 1111111111111111 1111 -> 1111
|
||||
ddand036 and 1111111111111111 111 -> 111
|
||||
ddand037 and 1111111111111111 11 -> 11
|
||||
ddand038 and 1111111111111111 1 -> 1
|
||||
ddand039 and 1111111111111111 0 -> 0
|
||||
|
||||
ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111
|
||||
ddand041 and 111111111111111 1111111111111111 -> 111111111111111
|
||||
ddand042 and 111111111111111 1111111111111111 -> 111111111111111
|
||||
ddand043 and 11111111111111 1111111111111111 -> 11111111111111
|
||||
ddand044 and 1111111111111 1111111111111111 -> 1111111111111
|
||||
ddand045 and 111111111111 1111111111111111 -> 111111111111
|
||||
ddand046 and 11111111111 1111111111111111 -> 11111111111
|
||||
ddand047 and 1111111111 1111111111111111 -> 1111111111
|
||||
ddand048 and 111111111 1111111111111111 -> 111111111
|
||||
ddand049 and 11111111 1111111111111111 -> 11111111
|
||||
ddand050 and 1111111 1111111111111111 -> 1111111
|
||||
ddand051 and 111111 1111111111111111 -> 111111
|
||||
ddand052 and 11111 1111111111111111 -> 11111
|
||||
ddand053 and 1111 1111111111111111 -> 1111
|
||||
ddand054 and 111 1111111111111111 -> 111
|
||||
ddand055 and 11 1111111111111111 -> 11
|
||||
ddand056 and 1 1111111111111111 -> 1
|
||||
ddand057 and 0 1111111111111111 -> 0
|
||||
|
||||
ddand150 and 1111111111 1 -> 1
|
||||
ddand151 and 111111111 1 -> 1
|
||||
ddand152 and 11111111 1 -> 1
|
||||
ddand153 and 1111111 1 -> 1
|
||||
ddand154 and 111111 1 -> 1
|
||||
ddand155 and 11111 1 -> 1
|
||||
ddand156 and 1111 1 -> 1
|
||||
ddand157 and 111 1 -> 1
|
||||
ddand158 and 11 1 -> 1
|
||||
ddand159 and 1 1 -> 1
|
||||
|
||||
ddand160 and 1111111111 0 -> 0
|
||||
ddand161 and 111111111 0 -> 0
|
||||
ddand162 and 11111111 0 -> 0
|
||||
ddand163 and 1111111 0 -> 0
|
||||
ddand164 and 111111 0 -> 0
|
||||
ddand165 and 11111 0 -> 0
|
||||
ddand166 and 1111 0 -> 0
|
||||
ddand167 and 111 0 -> 0
|
||||
ddand168 and 11 0 -> 0
|
||||
ddand169 and 1 0 -> 0
|
||||
|
||||
ddand170 and 1 1111111111 -> 1
|
||||
ddand171 and 1 111111111 -> 1
|
||||
ddand172 and 1 11111111 -> 1
|
||||
ddand173 and 1 1111111 -> 1
|
||||
ddand174 and 1 111111 -> 1
|
||||
ddand175 and 1 11111 -> 1
|
||||
ddand176 and 1 1111 -> 1
|
||||
ddand177 and 1 111 -> 1
|
||||
ddand178 and 1 11 -> 1
|
||||
ddand179 and 1 1 -> 1
|
||||
|
||||
ddand180 and 0 1111111111 -> 0
|
||||
ddand181 and 0 111111111 -> 0
|
||||
ddand182 and 0 11111111 -> 0
|
||||
ddand183 and 0 1111111 -> 0
|
||||
ddand184 and 0 111111 -> 0
|
||||
ddand185 and 0 11111 -> 0
|
||||
ddand186 and 0 1111 -> 0
|
||||
ddand187 and 0 111 -> 0
|
||||
ddand188 and 0 11 -> 0
|
||||
ddand189 and 0 1 -> 0
|
||||
|
||||
ddand090 and 011111111 111111111 -> 11111111
|
||||
ddand091 and 101111111 111111111 -> 101111111
|
||||
ddand092 and 110111111 111111111 -> 110111111
|
||||
ddand093 and 111011111 111111111 -> 111011111
|
||||
ddand094 and 111101111 111111111 -> 111101111
|
||||
ddand095 and 111110111 111111111 -> 111110111
|
||||
ddand096 and 111111011 111111111 -> 111111011
|
||||
ddand097 and 111111101 111111111 -> 111111101
|
||||
ddand098 and 111111110 111111111 -> 111111110
|
||||
|
||||
ddand100 and 111111111 011111111 -> 11111111
|
||||
ddand101 and 111111111 101111111 -> 101111111
|
||||
ddand102 and 111111111 110111111 -> 110111111
|
||||
ddand103 and 111111111 111011111 -> 111011111
|
||||
ddand104 and 111111111 111101111 -> 111101111
|
||||
ddand105 and 111111111 111110111 -> 111110111
|
||||
ddand106 and 111111111 111111011 -> 111111011
|
||||
ddand107 and 111111111 111111101 -> 111111101
|
||||
ddand108 and 111111111 111111110 -> 111111110
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
ddand220 and 111111112 111111111 -> NaN Invalid_operation
|
||||
ddand221 and 333333333 333333333 -> NaN Invalid_operation
|
||||
ddand222 and 555555555 555555555 -> NaN Invalid_operation
|
||||
ddand223 and 777777777 777777777 -> NaN Invalid_operation
|
||||
ddand224 and 999999999 999999999 -> NaN Invalid_operation
|
||||
ddand225 and 222222222 999999999 -> NaN Invalid_operation
|
||||
ddand226 and 444444444 999999999 -> NaN Invalid_operation
|
||||
ddand227 and 666666666 999999999 -> NaN Invalid_operation
|
||||
ddand228 and 888888888 999999999 -> NaN Invalid_operation
|
||||
ddand229 and 999999999 222222222 -> NaN Invalid_operation
|
||||
ddand230 and 999999999 444444444 -> NaN Invalid_operation
|
||||
ddand231 and 999999999 666666666 -> NaN Invalid_operation
|
||||
ddand232 and 999999999 888888888 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
ddand240 and 567468689 -934981942 -> NaN Invalid_operation
|
||||
ddand241 and 567367689 934981942 -> NaN Invalid_operation
|
||||
ddand242 and -631917772 -706014634 -> NaN Invalid_operation
|
||||
ddand243 and -756253257 138579234 -> NaN Invalid_operation
|
||||
ddand244 and 835590149 567435400 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation
|
||||
ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation
|
||||
ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation
|
||||
ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation
|
||||
ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation
|
||||
ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation
|
||||
ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation
|
||||
ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation
|
||||
ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation
|
||||
ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation
|
||||
ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation
|
||||
ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation
|
||||
ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation
|
||||
ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation
|
||||
ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation
|
||||
ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation
|
||||
ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation
|
||||
ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation
|
||||
ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation
|
||||
ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation
|
||||
ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation
|
||||
ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation
|
||||
-- signs
|
||||
ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation
|
||||
ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation
|
||||
ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation
|
||||
ddand299 and 1000000001000000 0000000011000100 -> 1000000
|
||||
|
||||
-- Nmax, Nmin, Ntiny-like
|
||||
ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation
|
||||
ddand332 and 3 1E-199 -> NaN Invalid_operation
|
||||
ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation
|
||||
ddand334 and 5 1E-100 -> NaN Invalid_operation
|
||||
ddand335 and 6 -1E-100 -> NaN Invalid_operation
|
||||
ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation
|
||||
ddand337 and 8 -1E-199 -> NaN Invalid_operation
|
||||
ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation
|
||||
ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation
|
||||
ddand342 and 1E-199 01 -> NaN Invalid_operation
|
||||
ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation
|
||||
ddand344 and 1E-100 18 -> NaN Invalid_operation
|
||||
ddand345 and -1E-100 -10 -> NaN Invalid_operation
|
||||
ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation
|
||||
ddand347 and -1E-199 10 -> NaN Invalid_operation
|
||||
ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
ddand361 and 1.0 1 -> NaN Invalid_operation
|
||||
ddand362 and 1E+1 1 -> NaN Invalid_operation
|
||||
ddand363 and 0.0 1 -> NaN Invalid_operation
|
||||
ddand364 and 0E+1 1 -> NaN Invalid_operation
|
||||
ddand365 and 9.9 1 -> NaN Invalid_operation
|
||||
ddand366 and 9E+1 1 -> NaN Invalid_operation
|
||||
ddand371 and 0 1.0 -> NaN Invalid_operation
|
||||
ddand372 and 0 1E+1 -> NaN Invalid_operation
|
||||
ddand373 and 0 0.0 -> NaN Invalid_operation
|
||||
ddand374 and 0 0E+1 -> NaN Invalid_operation
|
||||
ddand375 and 0 9.9 -> NaN Invalid_operation
|
||||
ddand376 and 0 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
ddand780 and -Inf -Inf -> NaN Invalid_operation
|
||||
ddand781 and -Inf -1000 -> NaN Invalid_operation
|
||||
ddand782 and -Inf -1 -> NaN Invalid_operation
|
||||
ddand783 and -Inf -0 -> NaN Invalid_operation
|
||||
ddand784 and -Inf 0 -> NaN Invalid_operation
|
||||
ddand785 and -Inf 1 -> NaN Invalid_operation
|
||||
ddand786 and -Inf 1000 -> NaN Invalid_operation
|
||||
ddand787 and -1000 -Inf -> NaN Invalid_operation
|
||||
ddand788 and -Inf -Inf -> NaN Invalid_operation
|
||||
ddand789 and -1 -Inf -> NaN Invalid_operation
|
||||
ddand790 and -0 -Inf -> NaN Invalid_operation
|
||||
ddand791 and 0 -Inf -> NaN Invalid_operation
|
||||
ddand792 and 1 -Inf -> NaN Invalid_operation
|
||||
ddand793 and 1000 -Inf -> NaN Invalid_operation
|
||||
ddand794 and Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddand800 and Inf -Inf -> NaN Invalid_operation
|
||||
ddand801 and Inf -1000 -> NaN Invalid_operation
|
||||
ddand802 and Inf -1 -> NaN Invalid_operation
|
||||
ddand803 and Inf -0 -> NaN Invalid_operation
|
||||
ddand804 and Inf 0 -> NaN Invalid_operation
|
||||
ddand805 and Inf 1 -> NaN Invalid_operation
|
||||
ddand806 and Inf 1000 -> NaN Invalid_operation
|
||||
ddand807 and Inf Inf -> NaN Invalid_operation
|
||||
ddand808 and -1000 Inf -> NaN Invalid_operation
|
||||
ddand809 and -Inf Inf -> NaN Invalid_operation
|
||||
ddand810 and -1 Inf -> NaN Invalid_operation
|
||||
ddand811 and -0 Inf -> NaN Invalid_operation
|
||||
ddand812 and 0 Inf -> NaN Invalid_operation
|
||||
ddand813 and 1 Inf -> NaN Invalid_operation
|
||||
ddand814 and 1000 Inf -> NaN Invalid_operation
|
||||
ddand815 and Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddand821 and NaN -Inf -> NaN Invalid_operation
|
||||
ddand822 and NaN -1000 -> NaN Invalid_operation
|
||||
ddand823 and NaN -1 -> NaN Invalid_operation
|
||||
ddand824 and NaN -0 -> NaN Invalid_operation
|
||||
ddand825 and NaN 0 -> NaN Invalid_operation
|
||||
ddand826 and NaN 1 -> NaN Invalid_operation
|
||||
ddand827 and NaN 1000 -> NaN Invalid_operation
|
||||
ddand828 and NaN Inf -> NaN Invalid_operation
|
||||
ddand829 and NaN NaN -> NaN Invalid_operation
|
||||
ddand830 and -Inf NaN -> NaN Invalid_operation
|
||||
ddand831 and -1000 NaN -> NaN Invalid_operation
|
||||
ddand832 and -1 NaN -> NaN Invalid_operation
|
||||
ddand833 and -0 NaN -> NaN Invalid_operation
|
||||
ddand834 and 0 NaN -> NaN Invalid_operation
|
||||
ddand835 and 1 NaN -> NaN Invalid_operation
|
||||
ddand836 and 1000 NaN -> NaN Invalid_operation
|
||||
ddand837 and Inf NaN -> NaN Invalid_operation
|
||||
|
||||
ddand841 and sNaN -Inf -> NaN Invalid_operation
|
||||
ddand842 and sNaN -1000 -> NaN Invalid_operation
|
||||
ddand843 and sNaN -1 -> NaN Invalid_operation
|
||||
ddand844 and sNaN -0 -> NaN Invalid_operation
|
||||
ddand845 and sNaN 0 -> NaN Invalid_operation
|
||||
ddand846 and sNaN 1 -> NaN Invalid_operation
|
||||
ddand847 and sNaN 1000 -> NaN Invalid_operation
|
||||
ddand848 and sNaN NaN -> NaN Invalid_operation
|
||||
ddand849 and sNaN sNaN -> NaN Invalid_operation
|
||||
ddand850 and NaN sNaN -> NaN Invalid_operation
|
||||
ddand851 and -Inf sNaN -> NaN Invalid_operation
|
||||
ddand852 and -1000 sNaN -> NaN Invalid_operation
|
||||
ddand853 and -1 sNaN -> NaN Invalid_operation
|
||||
ddand854 and -0 sNaN -> NaN Invalid_operation
|
||||
ddand855 and 0 sNaN -> NaN Invalid_operation
|
||||
ddand856 and 1 sNaN -> NaN Invalid_operation
|
||||
ddand857 and 1000 sNaN -> NaN Invalid_operation
|
||||
ddand858 and Inf sNaN -> NaN Invalid_operation
|
||||
ddand859 and NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddand861 and NaN1 -Inf -> NaN Invalid_operation
|
||||
ddand862 and +NaN2 -1000 -> NaN Invalid_operation
|
||||
ddand863 and NaN3 1000 -> NaN Invalid_operation
|
||||
ddand864 and NaN4 Inf -> NaN Invalid_operation
|
||||
ddand865 and NaN5 +NaN6 -> NaN Invalid_operation
|
||||
ddand866 and -Inf NaN7 -> NaN Invalid_operation
|
||||
ddand867 and -1000 NaN8 -> NaN Invalid_operation
|
||||
ddand868 and 1000 NaN9 -> NaN Invalid_operation
|
||||
ddand869 and Inf +NaN10 -> NaN Invalid_operation
|
||||
ddand871 and sNaN11 -Inf -> NaN Invalid_operation
|
||||
ddand872 and sNaN12 -1000 -> NaN Invalid_operation
|
||||
ddand873 and sNaN13 1000 -> NaN Invalid_operation
|
||||
ddand874 and sNaN14 NaN17 -> NaN Invalid_operation
|
||||
ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation
|
||||
ddand876 and NaN16 sNaN19 -> NaN Invalid_operation
|
||||
ddand877 and -Inf +sNaN20 -> NaN Invalid_operation
|
||||
ddand878 and -1000 sNaN21 -> NaN Invalid_operation
|
||||
ddand879 and 1000 sNaN22 -> NaN Invalid_operation
|
||||
ddand880 and Inf sNaN23 -> NaN Invalid_operation
|
||||
ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
|
||||
ddand882 and -NaN26 NaN28 -> NaN Invalid_operation
|
||||
ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
|
||||
ddand884 and 1000 -NaN30 -> NaN Invalid_operation
|
||||
ddand885 and 1000 -sNaN31 -> NaN Invalid_operation
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,357 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCanonical.decTest -- test decDouble canonical results --
|
||||
-- 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
|
||||
|
||||
-- This file tests that copy operations leave uncanonical operands
|
||||
-- unchanged, and vice versa
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Uncanonical declets are: abc, where:
|
||||
-- a=1,2,3
|
||||
-- b=6,7,e,f
|
||||
-- c=e,f
|
||||
|
||||
-- assert some standard (canonical) values; this tests that FromString
|
||||
-- produces canonical results (many more in decimalNN)
|
||||
ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
|
||||
ddcan002 apply 0 -> #2238000000000000
|
||||
ddcan003 apply 1 -> #2238000000000001
|
||||
ddcan004 apply -1 -> #a238000000000001
|
||||
ddcan005 apply Infinity -> #7800000000000000
|
||||
ddcan006 apply -Infinity -> #f800000000000000
|
||||
ddcan007 apply -NaN -> #fc00000000000000
|
||||
ddcan008 apply -sNaN -> #fe00000000000000
|
||||
ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff
|
||||
ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff
|
||||
decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff
|
||||
ddcan012 apply 7.50 -> #22300000000003d0
|
||||
ddcan013 apply 9.99 -> #22300000000000ff
|
||||
|
||||
-- Base tests for canonical encodings (individual operator
|
||||
-- propagation is tested later)
|
||||
|
||||
-- Finites: declets in coefficient
|
||||
ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
|
||||
ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
|
||||
ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
|
||||
ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
|
||||
ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff
|
||||
|
||||
-- NaN: declets in payload
|
||||
ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff
|
||||
ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff
|
||||
ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
|
||||
ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
|
||||
-- sNaN: declets in payload
|
||||
ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff
|
||||
ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff
|
||||
ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
|
||||
ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff
|
||||
|
||||
-- Inf: exponent continuation bits
|
||||
ddcan140 canonical #7800000000000000 -> #7800000000000000
|
||||
ddcan141 canonical #7900000000000000 -> #7800000000000000
|
||||
ddcan142 canonical #7a00000000000000 -> #7800000000000000
|
||||
ddcan143 canonical #7880000000000000 -> #7800000000000000
|
||||
ddcan144 canonical #7840000000000000 -> #7800000000000000
|
||||
ddcan145 canonical #7820000000000000 -> #7800000000000000
|
||||
ddcan146 canonical #7810000000000000 -> #7800000000000000
|
||||
ddcan147 canonical #7808000000000000 -> #7800000000000000
|
||||
ddcan148 canonical #7804000000000000 -> #7800000000000000
|
||||
|
||||
-- Inf: coefficient continuation bits (first, last, and a few others)
|
||||
ddcan150 canonical #7800000000000000 -> #7800000000000000
|
||||
ddcan151 canonical #7802000000000000 -> #7800000000000000
|
||||
ddcan152 canonical #7800000000000001 -> #7800000000000000
|
||||
ddcan153 canonical #7801000000000000 -> #7800000000000000
|
||||
ddcan154 canonical #7800200000000000 -> #7800000000000000
|
||||
ddcan155 canonical #7800080000000000 -> #7800000000000000
|
||||
ddcan156 canonical #7800002000000000 -> #7800000000000000
|
||||
ddcan157 canonical #7800000400000000 -> #7800000000000000
|
||||
ddcan158 canonical #7800000040000000 -> #7800000000000000
|
||||
ddcan159 canonical #7800000008000000 -> #7800000000000000
|
||||
ddcan160 canonical #7800000000400000 -> #7800000000000000
|
||||
ddcan161 canonical #7800000000020000 -> #7800000000000000
|
||||
ddcan162 canonical #7800000000008000 -> #7800000000000000
|
||||
ddcan163 canonical #7800000000000200 -> #7800000000000000
|
||||
ddcan164 canonical #7800000000000040 -> #7800000000000000
|
||||
ddcan165 canonical #7800000000000008 -> #7800000000000000
|
||||
|
||||
|
||||
-- Now the operators -- trying to check paths that might fail to
|
||||
-- canonicalize propagated operands
|
||||
|
||||
----- Add:
|
||||
-- Finites: neutral 0
|
||||
ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
|
||||
-- tiny zero
|
||||
ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded
|
||||
ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
|
||||
-- tiny non zero
|
||||
ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded
|
||||
ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
|
||||
-- NaN: declets in payload
|
||||
ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
|
||||
-- sNaN: declets in payload
|
||||
ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
ddcan220 add 0 #7880000000000000 -> #7800000000000000
|
||||
ddcan221 add #7880000000000000 0 -> #7800000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
ddcan222 add 0 #7802000000000000 -> #7800000000000000
|
||||
ddcan223 add #7802000000000000 0 -> #7800000000000000
|
||||
ddcan224 add 0 #7800000000000001 -> #7800000000000000
|
||||
ddcan225 add #7800000000000001 0 -> #7800000000000000
|
||||
ddcan226 add 0 #7800002000000000 -> #7800000000000000
|
||||
ddcan227 add #7800002000000000 0 -> #7800000000000000
|
||||
|
||||
----- Class: [does not return encoded]
|
||||
|
||||
----- Compare:
|
||||
ddcan231 compare -Inf 1 -> #a238000000000001
|
||||
ddcan232 compare -Inf -Inf -> #2238000000000000
|
||||
ddcan233 compare 1 -Inf -> #2238000000000001
|
||||
ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff
|
||||
ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
|
||||
----- CompareSig:
|
||||
ddcan241 comparesig -Inf 1 -> #a238000000000001
|
||||
ddcan242 comparesig -Inf -Inf -> #2238000000000000
|
||||
ddcan243 comparesig 1 -Inf -> #2238000000000001
|
||||
ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
|
||||
----- Copy: [does not usually canonicalize]
|
||||
-- finites
|
||||
ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff
|
||||
ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff
|
||||
-- NaNs
|
||||
ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff
|
||||
ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff
|
||||
ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff
|
||||
ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff
|
||||
-- sNaN
|
||||
ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff
|
||||
ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff
|
||||
-- Inf
|
||||
ddcan258 copy #7a00000000000000 -> #7a00000000000000
|
||||
ddcan259 copy #7800200000000000 -> #7800200000000000
|
||||
|
||||
----- CopyAbs: [does not usually canonicalize]
|
||||
-- finites
|
||||
ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff
|
||||
ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff
|
||||
-- NaNs
|
||||
ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff
|
||||
ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff
|
||||
ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff
|
||||
ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff
|
||||
-- sNaN
|
||||
ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff
|
||||
ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff
|
||||
-- Inf
|
||||
ddcan268 copyabs #fa00000000000000 -> #7a00000000000000
|
||||
ddcan269 copyabs #f800200000000000 -> #7800200000000000
|
||||
|
||||
----- CopyNegate: [does not usually canonicalize]
|
||||
-- finites
|
||||
ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff
|
||||
ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff
|
||||
-- NaNs
|
||||
ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff
|
||||
ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff
|
||||
ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff
|
||||
ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff
|
||||
-- sNaN
|
||||
ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff
|
||||
ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff
|
||||
-- Inf
|
||||
ddcan278 copynegate #7a00000000000000 -> #fa00000000000000
|
||||
ddcan279 copynegate #7800200000000000 -> #f800200000000000
|
||||
|
||||
----- CopySign: [does not usually canonicalize]
|
||||
-- finites
|
||||
ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff
|
||||
ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff
|
||||
-- NaNs
|
||||
ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff
|
||||
ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff
|
||||
ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff
|
||||
ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff
|
||||
-- sNaN
|
||||
ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff
|
||||
ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff
|
||||
-- Inf
|
||||
ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000
|
||||
ddcan289 copysign #7800200000000000 1 -> #7800200000000000
|
||||
|
||||
----- Multiply:
|
||||
-- Finites: neutral 0
|
||||
ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
|
||||
ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff
|
||||
-- negative
|
||||
ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
|
||||
ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff
|
||||
-- NaN: declets in payload
|
||||
ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
-- sNaN: declets in payload
|
||||
ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
ddcan320 multiply 1 #7880000000000000 -> #7800000000000000
|
||||
ddcan321 multiply #7880000000000000 1 -> #7800000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
ddcan322 multiply 1 #7802000000000000 -> #7800000000000000
|
||||
ddcan323 multiply #7802000000000000 1 -> #7800000000000000
|
||||
ddcan324 multiply 1 #7800000000000001 -> #7800000000000000
|
||||
ddcan325 multiply #7800000000000001 1 -> #7800000000000000
|
||||
ddcan326 multiply 1 #7800002000000000 -> #7800000000000000
|
||||
ddcan327 multiply #7800002000000000 1 -> #7800000000000000
|
||||
|
||||
----- Quantize:
|
||||
ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff
|
||||
ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff
|
||||
ddcan403 quantize #7880000000000000 Inf -> #7800000000000000
|
||||
ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000
|
||||
ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
|
||||
ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
|
||||
----- Subtract:
|
||||
-- Finites: neutral 0
|
||||
ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
|
||||
ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
|
||||
-- tiny zero
|
||||
ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded
|
||||
ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
|
||||
-- tiny non zero
|
||||
ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded
|
||||
ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
|
||||
-- NaN: declets in payload
|
||||
ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
|
||||
-- sNaN: declets in payload
|
||||
ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
ddcan520 subtract 0 #7880000000000000 -> #f800000000000000
|
||||
ddcan521 subtract #7880000000000000 0 -> #7800000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
ddcan522 subtract 0 #7802000000000000 -> #f800000000000000
|
||||
ddcan523 subtract #7802000000000000 0 -> #7800000000000000
|
||||
ddcan524 subtract 0 #7800000000000001 -> #f800000000000000
|
||||
ddcan525 subtract #7800000000000001 0 -> #7800000000000000
|
||||
ddcan526 subtract 0 #7800002000000000 -> #f800000000000000
|
||||
ddcan527 subtract #7800002000000000 0 -> #7800000000000000
|
||||
|
||||
----- ToIntegral:
|
||||
ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff
|
||||
ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff
|
||||
ddcan603 tointegralx #7880000000000000 -> #7800000000000000
|
||||
ddcan604 tointegralx #7802000000000000 -> #7800000000000000
|
||||
ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
|
||||
ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
|
||||
-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
|
||||
ddcan618 tointegralx #2238000000000fff -> #2238000000000cff
|
||||
ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded
|
||||
ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded
|
||||
ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded
|
||||
ddcan622 tointegralx #a238000000000fff -> #a238000000000cff
|
||||
ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded
|
||||
ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded
|
||||
ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddClass.decTest -- decDouble Class operations --
|
||||
-- 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
|
||||
|
||||
-- [New 2006.11.27]
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddcla001 class 0 -> +Zero
|
||||
ddcla002 class 0.00 -> +Zero
|
||||
ddcla003 class 0E+5 -> +Zero
|
||||
ddcla004 class 1E-396 -> +Subnormal
|
||||
ddcla005 class 0.1E-383 -> +Subnormal
|
||||
ddcla006 class 0.999999999999999E-383 -> +Subnormal
|
||||
ddcla007 class 1.000000000000000E-383 -> +Normal
|
||||
ddcla008 class 1E-383 -> +Normal
|
||||
ddcla009 class 1E-100 -> +Normal
|
||||
ddcla010 class 1E-10 -> +Normal
|
||||
ddcla012 class 1E-1 -> +Normal
|
||||
ddcla013 class 1 -> +Normal
|
||||
ddcla014 class 2.50 -> +Normal
|
||||
ddcla015 class 100.100 -> +Normal
|
||||
ddcla016 class 1E+30 -> +Normal
|
||||
ddcla017 class 1E+384 -> +Normal
|
||||
ddcla018 class 9.999999999999999E+384 -> +Normal
|
||||
ddcla019 class Inf -> +Infinity
|
||||
|
||||
ddcla021 class -0 -> -Zero
|
||||
ddcla022 class -0.00 -> -Zero
|
||||
ddcla023 class -0E+5 -> -Zero
|
||||
ddcla024 class -1E-396 -> -Subnormal
|
||||
ddcla025 class -0.1E-383 -> -Subnormal
|
||||
ddcla026 class -0.999999999999999E-383 -> -Subnormal
|
||||
ddcla027 class -1.000000000000000E-383 -> -Normal
|
||||
ddcla028 class -1E-383 -> -Normal
|
||||
ddcla029 class -1E-100 -> -Normal
|
||||
ddcla030 class -1E-10 -> -Normal
|
||||
ddcla032 class -1E-1 -> -Normal
|
||||
ddcla033 class -1 -> -Normal
|
||||
ddcla034 class -2.50 -> -Normal
|
||||
ddcla035 class -100.100 -> -Normal
|
||||
ddcla036 class -1E+30 -> -Normal
|
||||
ddcla037 class -1E+384 -> -Normal
|
||||
ddcla038 class -9.999999999999999E+384 -> -Normal
|
||||
ddcla039 class -Inf -> -Infinity
|
||||
|
||||
ddcla041 class NaN -> NaN
|
||||
ddcla042 class -NaN -> NaN
|
||||
ddcla043 class +NaN12345 -> NaN
|
||||
ddcla044 class sNaN -> sNaN
|
||||
ddcla045 class -sNaN -> sNaN
|
||||
ddcla046 class +sNaN12345 -> sNaN
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,744 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCompare.decTest -- decDouble 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 --
|
||||
-- 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
|
||||
|
||||
-- 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 necessary).
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddcom001 compare -2 -2 -> 0
|
||||
ddcom002 compare -2 -1 -> -1
|
||||
ddcom003 compare -2 0 -> -1
|
||||
ddcom004 compare -2 1 -> -1
|
||||
ddcom005 compare -2 2 -> -1
|
||||
ddcom006 compare -1 -2 -> 1
|
||||
ddcom007 compare -1 -1 -> 0
|
||||
ddcom008 compare -1 0 -> -1
|
||||
ddcom009 compare -1 1 -> -1
|
||||
ddcom010 compare -1 2 -> -1
|
||||
ddcom011 compare 0 -2 -> 1
|
||||
ddcom012 compare 0 -1 -> 1
|
||||
ddcom013 compare 0 0 -> 0
|
||||
ddcom014 compare 0 1 -> -1
|
||||
ddcom015 compare 0 2 -> -1
|
||||
ddcom016 compare 1 -2 -> 1
|
||||
ddcom017 compare 1 -1 -> 1
|
||||
ddcom018 compare 1 0 -> 1
|
||||
ddcom019 compare 1 1 -> 0
|
||||
ddcom020 compare 1 2 -> -1
|
||||
ddcom021 compare 2 -2 -> 1
|
||||
ddcom022 compare 2 -1 -> 1
|
||||
ddcom023 compare 2 0 -> 1
|
||||
ddcom025 compare 2 1 -> 1
|
||||
ddcom026 compare 2 2 -> 0
|
||||
|
||||
ddcom031 compare -20 -20 -> 0
|
||||
ddcom032 compare -20 -10 -> -1
|
||||
ddcom033 compare -20 00 -> -1
|
||||
ddcom034 compare -20 10 -> -1
|
||||
ddcom035 compare -20 20 -> -1
|
||||
ddcom036 compare -10 -20 -> 1
|
||||
ddcom037 compare -10 -10 -> 0
|
||||
ddcom038 compare -10 00 -> -1
|
||||
ddcom039 compare -10 10 -> -1
|
||||
ddcom040 compare -10 20 -> -1
|
||||
ddcom041 compare 00 -20 -> 1
|
||||
ddcom042 compare 00 -10 -> 1
|
||||
ddcom043 compare 00 00 -> 0
|
||||
ddcom044 compare 00 10 -> -1
|
||||
ddcom045 compare 00 20 -> -1
|
||||
ddcom046 compare 10 -20 -> 1
|
||||
ddcom047 compare 10 -10 -> 1
|
||||
ddcom048 compare 10 00 -> 1
|
||||
ddcom049 compare 10 10 -> 0
|
||||
ddcom050 compare 10 20 -> -1
|
||||
ddcom051 compare 20 -20 -> 1
|
||||
ddcom052 compare 20 -10 -> 1
|
||||
ddcom053 compare 20 00 -> 1
|
||||
ddcom055 compare 20 10 -> 1
|
||||
ddcom056 compare 20 20 -> 0
|
||||
|
||||
ddcom061 compare -2.0 -2.0 -> 0
|
||||
ddcom062 compare -2.0 -1.0 -> -1
|
||||
ddcom063 compare -2.0 0.0 -> -1
|
||||
ddcom064 compare -2.0 1.0 -> -1
|
||||
ddcom065 compare -2.0 2.0 -> -1
|
||||
ddcom066 compare -1.0 -2.0 -> 1
|
||||
ddcom067 compare -1.0 -1.0 -> 0
|
||||
ddcom068 compare -1.0 0.0 -> -1
|
||||
ddcom069 compare -1.0 1.0 -> -1
|
||||
ddcom070 compare -1.0 2.0 -> -1
|
||||
ddcom071 compare 0.0 -2.0 -> 1
|
||||
ddcom072 compare 0.0 -1.0 -> 1
|
||||
ddcom073 compare 0.0 0.0 -> 0
|
||||
ddcom074 compare 0.0 1.0 -> -1
|
||||
ddcom075 compare 0.0 2.0 -> -1
|
||||
ddcom076 compare 1.0 -2.0 -> 1
|
||||
ddcom077 compare 1.0 -1.0 -> 1
|
||||
ddcom078 compare 1.0 0.0 -> 1
|
||||
ddcom079 compare 1.0 1.0 -> 0
|
||||
ddcom080 compare 1.0 2.0 -> -1
|
||||
ddcom081 compare 2.0 -2.0 -> 1
|
||||
ddcom082 compare 2.0 -1.0 -> 1
|
||||
ddcom083 compare 2.0 0.0 -> 1
|
||||
ddcom085 compare 2.0 1.0 -> 1
|
||||
ddcom086 compare 2.0 2.0 -> 0
|
||||
ddcom087 compare 1.0 0.1 -> 1
|
||||
ddcom088 compare 0.1 1.0 -> -1
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
|
||||
ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
|
||||
ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
|
||||
ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
ddcom100 compare 7.0 7.0 -> 0
|
||||
ddcom101 compare 7.0 7 -> 0
|
||||
ddcom102 compare 7 7.0 -> 0
|
||||
ddcom103 compare 7E+0 7.0 -> 0
|
||||
ddcom104 compare 70E-1 7.0 -> 0
|
||||
ddcom105 compare 0.7E+1 7 -> 0
|
||||
ddcom106 compare 70E-1 7 -> 0
|
||||
ddcom107 compare 7.0 7E+0 -> 0
|
||||
ddcom108 compare 7.0 70E-1 -> 0
|
||||
ddcom109 compare 7 0.7E+1 -> 0
|
||||
ddcom110 compare 7 70E-1 -> 0
|
||||
|
||||
ddcom120 compare 8.0 7.0 -> 1
|
||||
ddcom121 compare 8.0 7 -> 1
|
||||
ddcom122 compare 8 7.0 -> 1
|
||||
ddcom123 compare 8E+0 7.0 -> 1
|
||||
ddcom124 compare 80E-1 7.0 -> 1
|
||||
ddcom125 compare 0.8E+1 7 -> 1
|
||||
ddcom126 compare 80E-1 7 -> 1
|
||||
ddcom127 compare 8.0 7E+0 -> 1
|
||||
ddcom128 compare 8.0 70E-1 -> 1
|
||||
ddcom129 compare 8 0.7E+1 -> 1
|
||||
ddcom130 compare 8 70E-1 -> 1
|
||||
|
||||
ddcom140 compare 8.0 9.0 -> -1
|
||||
ddcom141 compare 8.0 9 -> -1
|
||||
ddcom142 compare 8 9.0 -> -1
|
||||
ddcom143 compare 8E+0 9.0 -> -1
|
||||
ddcom144 compare 80E-1 9.0 -> -1
|
||||
ddcom145 compare 0.8E+1 9 -> -1
|
||||
ddcom146 compare 80E-1 9 -> -1
|
||||
ddcom147 compare 8.0 9E+0 -> -1
|
||||
ddcom148 compare 8.0 90E-1 -> -1
|
||||
ddcom149 compare 8 0.9E+1 -> -1
|
||||
ddcom150 compare 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
ddcom200 compare -7.0 7.0 -> -1
|
||||
ddcom201 compare -7.0 7 -> -1
|
||||
ddcom202 compare -7 7.0 -> -1
|
||||
ddcom203 compare -7E+0 7.0 -> -1
|
||||
ddcom204 compare -70E-1 7.0 -> -1
|
||||
ddcom205 compare -0.7E+1 7 -> -1
|
||||
ddcom206 compare -70E-1 7 -> -1
|
||||
ddcom207 compare -7.0 7E+0 -> -1
|
||||
ddcom208 compare -7.0 70E-1 -> -1
|
||||
ddcom209 compare -7 0.7E+1 -> -1
|
||||
ddcom210 compare -7 70E-1 -> -1
|
||||
|
||||
ddcom220 compare -8.0 7.0 -> -1
|
||||
ddcom221 compare -8.0 7 -> -1
|
||||
ddcom222 compare -8 7.0 -> -1
|
||||
ddcom223 compare -8E+0 7.0 -> -1
|
||||
ddcom224 compare -80E-1 7.0 -> -1
|
||||
ddcom225 compare -0.8E+1 7 -> -1
|
||||
ddcom226 compare -80E-1 7 -> -1
|
||||
ddcom227 compare -8.0 7E+0 -> -1
|
||||
ddcom228 compare -8.0 70E-1 -> -1
|
||||
ddcom229 compare -8 0.7E+1 -> -1
|
||||
ddcom230 compare -8 70E-1 -> -1
|
||||
|
||||
ddcom240 compare -8.0 9.0 -> -1
|
||||
ddcom241 compare -8.0 9 -> -1
|
||||
ddcom242 compare -8 9.0 -> -1
|
||||
ddcom243 compare -8E+0 9.0 -> -1
|
||||
ddcom244 compare -80E-1 9.0 -> -1
|
||||
ddcom245 compare -0.8E+1 9 -> -1
|
||||
ddcom246 compare -80E-1 9 -> -1
|
||||
ddcom247 compare -8.0 9E+0 -> -1
|
||||
ddcom248 compare -8.0 90E-1 -> -1
|
||||
ddcom249 compare -8 0.9E+1 -> -1
|
||||
ddcom250 compare -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
ddcom300 compare 7.0 -7.0 -> 1
|
||||
ddcom301 compare 7.0 -7 -> 1
|
||||
ddcom302 compare 7 -7.0 -> 1
|
||||
ddcom303 compare 7E+0 -7.0 -> 1
|
||||
ddcom304 compare 70E-1 -7.0 -> 1
|
||||
ddcom305 compare .7E+1 -7 -> 1
|
||||
ddcom306 compare 70E-1 -7 -> 1
|
||||
ddcom307 compare 7.0 -7E+0 -> 1
|
||||
ddcom308 compare 7.0 -70E-1 -> 1
|
||||
ddcom309 compare 7 -.7E+1 -> 1
|
||||
ddcom310 compare 7 -70E-1 -> 1
|
||||
|
||||
ddcom320 compare 8.0 -7.0 -> 1
|
||||
ddcom321 compare 8.0 -7 -> 1
|
||||
ddcom322 compare 8 -7.0 -> 1
|
||||
ddcom323 compare 8E+0 -7.0 -> 1
|
||||
ddcom324 compare 80E-1 -7.0 -> 1
|
||||
ddcom325 compare .8E+1 -7 -> 1
|
||||
ddcom326 compare 80E-1 -7 -> 1
|
||||
ddcom327 compare 8.0 -7E+0 -> 1
|
||||
ddcom328 compare 8.0 -70E-1 -> 1
|
||||
ddcom329 compare 8 -.7E+1 -> 1
|
||||
ddcom330 compare 8 -70E-1 -> 1
|
||||
|
||||
ddcom340 compare 8.0 -9.0 -> 1
|
||||
ddcom341 compare 8.0 -9 -> 1
|
||||
ddcom342 compare 8 -9.0 -> 1
|
||||
ddcom343 compare 8E+0 -9.0 -> 1
|
||||
ddcom344 compare 80E-1 -9.0 -> 1
|
||||
ddcom345 compare .8E+1 -9 -> 1
|
||||
ddcom346 compare 80E-1 -9 -> 1
|
||||
ddcom347 compare 8.0 -9E+0 -> 1
|
||||
ddcom348 compare 8.0 -90E-1 -> 1
|
||||
ddcom349 compare 8 -.9E+1 -> 1
|
||||
ddcom350 compare 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
ddcom400 compare -7.0 -7.0 -> 0
|
||||
ddcom401 compare -7.0 -7 -> 0
|
||||
ddcom402 compare -7 -7.0 -> 0
|
||||
ddcom403 compare -7E+0 -7.0 -> 0
|
||||
ddcom404 compare -70E-1 -7.0 -> 0
|
||||
ddcom405 compare -.7E+1 -7 -> 0
|
||||
ddcom406 compare -70E-1 -7 -> 0
|
||||
ddcom407 compare -7.0 -7E+0 -> 0
|
||||
ddcom408 compare -7.0 -70E-1 -> 0
|
||||
ddcom409 compare -7 -.7E+1 -> 0
|
||||
ddcom410 compare -7 -70E-1 -> 0
|
||||
|
||||
ddcom420 compare -8.0 -7.0 -> -1
|
||||
ddcom421 compare -8.0 -7 -> -1
|
||||
ddcom422 compare -8 -7.0 -> -1
|
||||
ddcom423 compare -8E+0 -7.0 -> -1
|
||||
ddcom424 compare -80E-1 -7.0 -> -1
|
||||
ddcom425 compare -.8E+1 -7 -> -1
|
||||
ddcom426 compare -80E-1 -7 -> -1
|
||||
ddcom427 compare -8.0 -7E+0 -> -1
|
||||
ddcom428 compare -8.0 -70E-1 -> -1
|
||||
ddcom429 compare -8 -.7E+1 -> -1
|
||||
ddcom430 compare -8 -70E-1 -> -1
|
||||
|
||||
ddcom440 compare -8.0 -9.0 -> 1
|
||||
ddcom441 compare -8.0 -9 -> 1
|
||||
ddcom442 compare -8 -9.0 -> 1
|
||||
ddcom443 compare -8E+0 -9.0 -> 1
|
||||
ddcom444 compare -80E-1 -9.0 -> 1
|
||||
ddcom445 compare -.8E+1 -9 -> 1
|
||||
ddcom446 compare -80E-1 -9 -> 1
|
||||
ddcom447 compare -8.0 -9E+0 -> 1
|
||||
ddcom448 compare -8.0 -90E-1 -> 1
|
||||
ddcom449 compare -8 -.9E+1 -> 1
|
||||
ddcom450 compare -8 -90E-1 -> 1
|
||||
|
||||
-- misalignment traps for little-endian
|
||||
ddcom451 compare 1.0 0.1 -> 1
|
||||
ddcom452 compare 0.1 1.0 -> -1
|
||||
ddcom453 compare 10.0 0.1 -> 1
|
||||
ddcom454 compare 0.1 10.0 -> -1
|
||||
ddcom455 compare 100 1.0 -> 1
|
||||
ddcom456 compare 1.0 100 -> -1
|
||||
ddcom457 compare 1000 10.0 -> 1
|
||||
ddcom458 compare 10.0 1000 -> -1
|
||||
ddcom459 compare 10000 100.0 -> 1
|
||||
ddcom460 compare 100.0 10000 -> -1
|
||||
ddcom461 compare 100000 1000.0 -> 1
|
||||
ddcom462 compare 1000.0 100000 -> -1
|
||||
ddcom463 compare 1000000 10000.0 -> 1
|
||||
ddcom464 compare 10000.0 1000000 -> -1
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
|
||||
ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
|
||||
ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
|
||||
ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
|
||||
ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
|
||||
ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
|
||||
ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
|
||||
ddcom480 compare 123.456000E+89 123.456E+89 -> 0
|
||||
ddcom481 compare 123.45600E-89 123.456E-89 -> 0
|
||||
ddcom482 compare 123.4560E+89 123.456E+89 -> 0
|
||||
ddcom483 compare 123.456E-89 123.456E-89 -> 0
|
||||
ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
|
||||
ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
|
||||
ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
|
||||
ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
|
||||
ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
|
||||
ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
|
||||
ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
|
||||
ddcom494 compare 123.456E-89 123.456000E-89 -> 0
|
||||
ddcom495 compare 123.456E+89 123.45600E+89 -> 0
|
||||
ddcom496 compare 123.456E-89 123.4560E-89 -> 0
|
||||
ddcom497 compare 123.456E+89 123.456E+89 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
ddcom500 compare 1 1E-15 -> 1
|
||||
ddcom501 compare 1 1E-14 -> 1
|
||||
ddcom502 compare 1 1E-13 -> 1
|
||||
ddcom503 compare 1 1E-12 -> 1
|
||||
ddcom504 compare 1 1E-11 -> 1
|
||||
ddcom505 compare 1 1E-10 -> 1
|
||||
ddcom506 compare 1 1E-9 -> 1
|
||||
ddcom507 compare 1 1E-8 -> 1
|
||||
ddcom508 compare 1 1E-7 -> 1
|
||||
ddcom509 compare 1 1E-6 -> 1
|
||||
ddcom510 compare 1 1E-5 -> 1
|
||||
ddcom511 compare 1 1E-4 -> 1
|
||||
ddcom512 compare 1 1E-3 -> 1
|
||||
ddcom513 compare 1 1E-2 -> 1
|
||||
ddcom514 compare 1 1E-1 -> 1
|
||||
ddcom515 compare 1 1E-0 -> 0
|
||||
ddcom516 compare 1 1E+1 -> -1
|
||||
ddcom517 compare 1 1E+2 -> -1
|
||||
ddcom518 compare 1 1E+3 -> -1
|
||||
ddcom519 compare 1 1E+4 -> -1
|
||||
ddcom521 compare 1 1E+5 -> -1
|
||||
ddcom522 compare 1 1E+6 -> -1
|
||||
ddcom523 compare 1 1E+7 -> -1
|
||||
ddcom524 compare 1 1E+8 -> -1
|
||||
ddcom525 compare 1 1E+9 -> -1
|
||||
ddcom526 compare 1 1E+10 -> -1
|
||||
ddcom527 compare 1 1E+11 -> -1
|
||||
ddcom528 compare 1 1E+12 -> -1
|
||||
ddcom529 compare 1 1E+13 -> -1
|
||||
ddcom530 compare 1 1E+14 -> -1
|
||||
ddcom531 compare 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
ddcom540 compare 1E-15 1 -> -1
|
||||
ddcom541 compare 1E-14 1 -> -1
|
||||
ddcom542 compare 1E-13 1 -> -1
|
||||
ddcom543 compare 1E-12 1 -> -1
|
||||
ddcom544 compare 1E-11 1 -> -1
|
||||
ddcom545 compare 1E-10 1 -> -1
|
||||
ddcom546 compare 1E-9 1 -> -1
|
||||
ddcom547 compare 1E-8 1 -> -1
|
||||
ddcom548 compare 1E-7 1 -> -1
|
||||
ddcom549 compare 1E-6 1 -> -1
|
||||
ddcom550 compare 1E-5 1 -> -1
|
||||
ddcom551 compare 1E-4 1 -> -1
|
||||
ddcom552 compare 1E-3 1 -> -1
|
||||
ddcom553 compare 1E-2 1 -> -1
|
||||
ddcom554 compare 1E-1 1 -> -1
|
||||
ddcom555 compare 1E-0 1 -> 0
|
||||
ddcom556 compare 1E+1 1 -> 1
|
||||
ddcom557 compare 1E+2 1 -> 1
|
||||
ddcom558 compare 1E+3 1 -> 1
|
||||
ddcom559 compare 1E+4 1 -> 1
|
||||
ddcom561 compare 1E+5 1 -> 1
|
||||
ddcom562 compare 1E+6 1 -> 1
|
||||
ddcom563 compare 1E+7 1 -> 1
|
||||
ddcom564 compare 1E+8 1 -> 1
|
||||
ddcom565 compare 1E+9 1 -> 1
|
||||
ddcom566 compare 1E+10 1 -> 1
|
||||
ddcom567 compare 1E+11 1 -> 1
|
||||
ddcom568 compare 1E+12 1 -> 1
|
||||
ddcom569 compare 1E+13 1 -> 1
|
||||
ddcom570 compare 1E+14 1 -> 1
|
||||
ddcom571 compare 1E+15 1 -> 1
|
||||
-- similar with a useful coefficient, one side only
|
||||
ddcom580 compare 0.000000987654321 1E-15 -> 1
|
||||
ddcom581 compare 0.000000987654321 1E-14 -> 1
|
||||
ddcom582 compare 0.000000987654321 1E-13 -> 1
|
||||
ddcom583 compare 0.000000987654321 1E-12 -> 1
|
||||
ddcom584 compare 0.000000987654321 1E-11 -> 1
|
||||
ddcom585 compare 0.000000987654321 1E-10 -> 1
|
||||
ddcom586 compare 0.000000987654321 1E-9 -> 1
|
||||
ddcom587 compare 0.000000987654321 1E-8 -> 1
|
||||
ddcom588 compare 0.000000987654321 1E-7 -> 1
|
||||
ddcom589 compare 0.000000987654321 1E-6 -> -1
|
||||
ddcom590 compare 0.000000987654321 1E-5 -> -1
|
||||
ddcom591 compare 0.000000987654321 1E-4 -> -1
|
||||
ddcom592 compare 0.000000987654321 1E-3 -> -1
|
||||
ddcom593 compare 0.000000987654321 1E-2 -> -1
|
||||
ddcom594 compare 0.000000987654321 1E-1 -> -1
|
||||
ddcom595 compare 0.000000987654321 1E-0 -> -1
|
||||
ddcom596 compare 0.000000987654321 1E+1 -> -1
|
||||
ddcom597 compare 0.000000987654321 1E+2 -> -1
|
||||
ddcom598 compare 0.000000987654321 1E+3 -> -1
|
||||
ddcom599 compare 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
ddcom600 compare 12 12.2345 -> -1
|
||||
ddcom601 compare 12.0 12.2345 -> -1
|
||||
ddcom602 compare 12.00 12.2345 -> -1
|
||||
ddcom603 compare 12.000 12.2345 -> -1
|
||||
ddcom604 compare 12.0000 12.2345 -> -1
|
||||
ddcom605 compare 12.00000 12.2345 -> -1
|
||||
ddcom606 compare 12.000000 12.2345 -> -1
|
||||
ddcom607 compare 12.0000000 12.2345 -> -1
|
||||
ddcom608 compare 12.00000000 12.2345 -> -1
|
||||
ddcom609 compare 12.000000000 12.2345 -> -1
|
||||
ddcom610 compare 12.1234 12 -> 1
|
||||
ddcom611 compare 12.1234 12.0 -> 1
|
||||
ddcom612 compare 12.1234 12.00 -> 1
|
||||
ddcom613 compare 12.1234 12.000 -> 1
|
||||
ddcom614 compare 12.1234 12.0000 -> 1
|
||||
ddcom615 compare 12.1234 12.00000 -> 1
|
||||
ddcom616 compare 12.1234 12.000000 -> 1
|
||||
ddcom617 compare 12.1234 12.0000000 -> 1
|
||||
ddcom618 compare 12.1234 12.00000000 -> 1
|
||||
ddcom619 compare 12.1234 12.000000000 -> 1
|
||||
ddcom620 compare -12 -12.2345 -> 1
|
||||
ddcom621 compare -12.0 -12.2345 -> 1
|
||||
ddcom622 compare -12.00 -12.2345 -> 1
|
||||
ddcom623 compare -12.000 -12.2345 -> 1
|
||||
ddcom624 compare -12.0000 -12.2345 -> 1
|
||||
ddcom625 compare -12.00000 -12.2345 -> 1
|
||||
ddcom626 compare -12.000000 -12.2345 -> 1
|
||||
ddcom627 compare -12.0000000 -12.2345 -> 1
|
||||
ddcom628 compare -12.00000000 -12.2345 -> 1
|
||||
ddcom629 compare -12.000000000 -12.2345 -> 1
|
||||
ddcom630 compare -12.1234 -12 -> -1
|
||||
ddcom631 compare -12.1234 -12.0 -> -1
|
||||
ddcom632 compare -12.1234 -12.00 -> -1
|
||||
ddcom633 compare -12.1234 -12.000 -> -1
|
||||
ddcom634 compare -12.1234 -12.0000 -> -1
|
||||
ddcom635 compare -12.1234 -12.00000 -> -1
|
||||
ddcom636 compare -12.1234 -12.000000 -> -1
|
||||
ddcom637 compare -12.1234 -12.0000000 -> -1
|
||||
ddcom638 compare -12.1234 -12.00000000 -> -1
|
||||
ddcom639 compare -12.1234 -12.000000000 -> -1
|
||||
|
||||
-- extended zeros
|
||||
ddcom640 compare 0 0 -> 0
|
||||
ddcom641 compare 0 -0 -> 0
|
||||
ddcom642 compare 0 -0.0 -> 0
|
||||
ddcom643 compare 0 0.0 -> 0
|
||||
ddcom644 compare -0 0 -> 0
|
||||
ddcom645 compare -0 -0 -> 0
|
||||
ddcom646 compare -0 -0.0 -> 0
|
||||
ddcom647 compare -0 0.0 -> 0
|
||||
ddcom648 compare 0.0 0 -> 0
|
||||
ddcom649 compare 0.0 -0 -> 0
|
||||
ddcom650 compare 0.0 -0.0 -> 0
|
||||
ddcom651 compare 0.0 0.0 -> 0
|
||||
ddcom652 compare -0.0 0 -> 0
|
||||
ddcom653 compare -0.0 -0 -> 0
|
||||
ddcom654 compare -0.0 -0.0 -> 0
|
||||
ddcom655 compare -0.0 0.0 -> 0
|
||||
|
||||
ddcom656 compare -0E1 0.0 -> 0
|
||||
ddcom657 compare -0E2 0.0 -> 0
|
||||
ddcom658 compare 0E1 0.0 -> 0
|
||||
ddcom659 compare 0E2 0.0 -> 0
|
||||
ddcom660 compare -0E1 0 -> 0
|
||||
ddcom661 compare -0E2 0 -> 0
|
||||
ddcom662 compare 0E1 0 -> 0
|
||||
ddcom663 compare 0E2 0 -> 0
|
||||
ddcom664 compare -0E1 -0E1 -> 0
|
||||
ddcom665 compare -0E2 -0E1 -> 0
|
||||
ddcom666 compare 0E1 -0E1 -> 0
|
||||
ddcom667 compare 0E2 -0E1 -> 0
|
||||
ddcom668 compare -0E1 -0E2 -> 0
|
||||
ddcom669 compare -0E2 -0E2 -> 0
|
||||
ddcom670 compare 0E1 -0E2 -> 0
|
||||
ddcom671 compare 0E2 -0E2 -> 0
|
||||
ddcom672 compare -0E1 0E1 -> 0
|
||||
ddcom673 compare -0E2 0E1 -> 0
|
||||
ddcom674 compare 0E1 0E1 -> 0
|
||||
ddcom675 compare 0E2 0E1 -> 0
|
||||
ddcom676 compare -0E1 0E2 -> 0
|
||||
ddcom677 compare -0E2 0E2 -> 0
|
||||
ddcom678 compare 0E1 0E2 -> 0
|
||||
ddcom679 compare 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
ddcom680 compare 12 12 -> 0
|
||||
ddcom681 compare 12 12.0 -> 0
|
||||
ddcom682 compare 12 12.00 -> 0
|
||||
ddcom683 compare 12 12.000 -> 0
|
||||
ddcom684 compare 12 12.0000 -> 0
|
||||
ddcom685 compare 12 12.00000 -> 0
|
||||
ddcom686 compare 12 12.000000 -> 0
|
||||
ddcom687 compare 12 12.0000000 -> 0
|
||||
ddcom688 compare 12 12.00000000 -> 0
|
||||
ddcom689 compare 12 12.000000000 -> 0
|
||||
ddcom690 compare 12 12 -> 0
|
||||
ddcom691 compare 12.0 12 -> 0
|
||||
ddcom692 compare 12.00 12 -> 0
|
||||
ddcom693 compare 12.000 12 -> 0
|
||||
ddcom694 compare 12.0000 12 -> 0
|
||||
ddcom695 compare 12.00000 12 -> 0
|
||||
ddcom696 compare 12.000000 12 -> 0
|
||||
ddcom697 compare 12.0000000 12 -> 0
|
||||
ddcom698 compare 12.00000000 12 -> 0
|
||||
ddcom699 compare 12.000000000 12 -> 0
|
||||
|
||||
-- first, second, & last digit
|
||||
ddcom700 compare 1234567890123456 1234567890123455 -> 1
|
||||
ddcom701 compare 1234567890123456 1234567890123456 -> 0
|
||||
ddcom702 compare 1234567890123456 1234567890123457 -> -1
|
||||
ddcom703 compare 1234567890123456 0234567890123456 -> 1
|
||||
ddcom704 compare 1234567890123456 1234567890123456 -> 0
|
||||
ddcom705 compare 1234567890123456 2234567890123456 -> -1
|
||||
ddcom706 compare 1134567890123456 1034567890123456 -> 1
|
||||
ddcom707 compare 1134567890123456 1134567890123456 -> 0
|
||||
ddcom708 compare 1134567890123456 1234567890123456 -> -1
|
||||
|
||||
-- miscellaneous
|
||||
ddcom721 compare 12345678000 1 -> 1
|
||||
ddcom722 compare 1 12345678000 -> -1
|
||||
ddcom723 compare 1234567800 1 -> 1
|
||||
ddcom724 compare 1 1234567800 -> -1
|
||||
ddcom725 compare 1234567890 1 -> 1
|
||||
ddcom726 compare 1 1234567890 -> -1
|
||||
ddcom727 compare 1234567891 1 -> 1
|
||||
ddcom728 compare 1 1234567891 -> -1
|
||||
ddcom729 compare 12345678901 1 -> 1
|
||||
ddcom730 compare 1 12345678901 -> -1
|
||||
ddcom731 compare 1234567896 1 -> 1
|
||||
ddcom732 compare 1 1234567896 -> -1
|
||||
|
||||
-- residue cases at lower precision
|
||||
ddcom740 compare 1 0.9999999 -> 1
|
||||
ddcom741 compare 1 0.999999 -> 1
|
||||
ddcom742 compare 1 0.99999 -> 1
|
||||
ddcom743 compare 1 1.0000 -> 0
|
||||
ddcom744 compare 1 1.00001 -> -1
|
||||
ddcom745 compare 1 1.000001 -> -1
|
||||
ddcom746 compare 1 1.0000001 -> -1
|
||||
ddcom750 compare 0.9999999 1 -> -1
|
||||
ddcom751 compare 0.999999 1 -> -1
|
||||
ddcom752 compare 0.99999 1 -> -1
|
||||
ddcom753 compare 1.0000 1 -> 0
|
||||
ddcom754 compare 1.00001 1 -> 1
|
||||
ddcom755 compare 1.000001 1 -> 1
|
||||
ddcom756 compare 1.0000001 1 -> 1
|
||||
|
||||
-- Specials
|
||||
ddcom780 compare Inf -Inf -> 1
|
||||
ddcom781 compare Inf -1000 -> 1
|
||||
ddcom782 compare Inf -1 -> 1
|
||||
ddcom783 compare Inf -0 -> 1
|
||||
ddcom784 compare Inf 0 -> 1
|
||||
ddcom785 compare Inf 1 -> 1
|
||||
ddcom786 compare Inf 1000 -> 1
|
||||
ddcom787 compare Inf Inf -> 0
|
||||
ddcom788 compare -1000 Inf -> -1
|
||||
ddcom789 compare -Inf Inf -> -1
|
||||
ddcom790 compare -1 Inf -> -1
|
||||
ddcom791 compare -0 Inf -> -1
|
||||
ddcom792 compare 0 Inf -> -1
|
||||
ddcom793 compare 1 Inf -> -1
|
||||
ddcom794 compare 1000 Inf -> -1
|
||||
ddcom795 compare Inf Inf -> 0
|
||||
|
||||
ddcom800 compare -Inf -Inf -> 0
|
||||
ddcom801 compare -Inf -1000 -> -1
|
||||
ddcom802 compare -Inf -1 -> -1
|
||||
ddcom803 compare -Inf -0 -> -1
|
||||
ddcom804 compare -Inf 0 -> -1
|
||||
ddcom805 compare -Inf 1 -> -1
|
||||
ddcom806 compare -Inf 1000 -> -1
|
||||
ddcom807 compare -Inf Inf -> -1
|
||||
ddcom808 compare -Inf -Inf -> 0
|
||||
ddcom809 compare -1000 -Inf -> 1
|
||||
ddcom810 compare -1 -Inf -> 1
|
||||
ddcom811 compare -0 -Inf -> 1
|
||||
ddcom812 compare 0 -Inf -> 1
|
||||
ddcom813 compare 1 -Inf -> 1
|
||||
ddcom814 compare 1000 -Inf -> 1
|
||||
ddcom815 compare Inf -Inf -> 1
|
||||
|
||||
ddcom821 compare NaN -Inf -> NaN
|
||||
ddcom822 compare NaN -1000 -> NaN
|
||||
ddcom823 compare NaN -1 -> NaN
|
||||
ddcom824 compare NaN -0 -> NaN
|
||||
ddcom825 compare NaN 0 -> NaN
|
||||
ddcom826 compare NaN 1 -> NaN
|
||||
ddcom827 compare NaN 1000 -> NaN
|
||||
ddcom828 compare NaN Inf -> NaN
|
||||
ddcom829 compare NaN NaN -> NaN
|
||||
ddcom830 compare -Inf NaN -> NaN
|
||||
ddcom831 compare -1000 NaN -> NaN
|
||||
ddcom832 compare -1 NaN -> NaN
|
||||
ddcom833 compare -0 NaN -> NaN
|
||||
ddcom834 compare 0 NaN -> NaN
|
||||
ddcom835 compare 1 NaN -> NaN
|
||||
ddcom836 compare 1000 NaN -> NaN
|
||||
ddcom837 compare Inf NaN -> NaN
|
||||
ddcom838 compare -NaN -NaN -> -NaN
|
||||
ddcom839 compare +NaN -NaN -> NaN
|
||||
ddcom840 compare -NaN +NaN -> -NaN
|
||||
|
||||
ddcom841 compare sNaN -Inf -> NaN Invalid_operation
|
||||
ddcom842 compare sNaN -1000 -> NaN Invalid_operation
|
||||
ddcom843 compare sNaN -1 -> NaN Invalid_operation
|
||||
ddcom844 compare sNaN -0 -> NaN Invalid_operation
|
||||
ddcom845 compare sNaN 0 -> NaN Invalid_operation
|
||||
ddcom846 compare sNaN 1 -> NaN Invalid_operation
|
||||
ddcom847 compare sNaN 1000 -> NaN Invalid_operation
|
||||
ddcom848 compare sNaN NaN -> NaN Invalid_operation
|
||||
ddcom849 compare sNaN sNaN -> NaN Invalid_operation
|
||||
ddcom850 compare NaN sNaN -> NaN Invalid_operation
|
||||
ddcom851 compare -Inf sNaN -> NaN Invalid_operation
|
||||
ddcom852 compare -1000 sNaN -> NaN Invalid_operation
|
||||
ddcom853 compare -1 sNaN -> NaN Invalid_operation
|
||||
ddcom854 compare -0 sNaN -> NaN Invalid_operation
|
||||
ddcom855 compare 0 sNaN -> NaN Invalid_operation
|
||||
ddcom856 compare 1 sNaN -> NaN Invalid_operation
|
||||
ddcom857 compare 1000 sNaN -> NaN Invalid_operation
|
||||
ddcom858 compare Inf sNaN -> NaN Invalid_operation
|
||||
ddcom859 compare NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddcom860 compare NaN9 -Inf -> NaN9
|
||||
ddcom861 compare NaN8 999 -> NaN8
|
||||
ddcom862 compare NaN77 Inf -> NaN77
|
||||
ddcom863 compare -NaN67 NaN5 -> -NaN67
|
||||
ddcom864 compare -Inf -NaN4 -> -NaN4
|
||||
ddcom865 compare -999 -NaN33 -> -NaN33
|
||||
ddcom866 compare Inf NaN2 -> NaN2
|
||||
ddcom867 compare -NaN41 -NaN42 -> -NaN41
|
||||
ddcom868 compare +NaN41 -NaN42 -> NaN41
|
||||
ddcom869 compare -NaN41 +NaN42 -> -NaN41
|
||||
ddcom870 compare +NaN41 +NaN42 -> NaN41
|
||||
|
||||
ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
|
||||
ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
|
||||
ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
|
||||
ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
|
||||
ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
|
||||
ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
|
||||
|
||||
-- wide range
|
||||
ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
|
||||
ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
|
||||
ddcom882 compare +0.100 9E-383 -> 1
|
||||
ddcom883 compare 9E-383 +0.100 -> -1
|
||||
ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
|
||||
ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
|
||||
ddcom887 compare -0.100 9E-383 -> -1
|
||||
ddcom888 compare 9E-383 -0.100 -> 1
|
||||
|
||||
-- spread zeros
|
||||
ddcom900 compare 0E-383 0 -> 0
|
||||
ddcom901 compare 0E-383 -0 -> 0
|
||||
ddcom902 compare -0E-383 0 -> 0
|
||||
ddcom903 compare -0E-383 -0 -> 0
|
||||
ddcom904 compare 0E-383 0E+384 -> 0
|
||||
ddcom905 compare 0E-383 -0E+384 -> 0
|
||||
ddcom906 compare -0E-383 0E+384 -> 0
|
||||
ddcom907 compare -0E-383 -0E+384 -> 0
|
||||
ddcom908 compare 0 0E+384 -> 0
|
||||
ddcom909 compare 0 -0E+384 -> 0
|
||||
ddcom910 compare -0 0E+384 -> 0
|
||||
ddcom911 compare -0 -0E+384 -> 0
|
||||
ddcom930 compare 0E+384 0 -> 0
|
||||
ddcom931 compare 0E+384 -0 -> 0
|
||||
ddcom932 compare -0E+384 0 -> 0
|
||||
ddcom933 compare -0E+384 -0 -> 0
|
||||
ddcom934 compare 0E+384 0E-383 -> 0
|
||||
ddcom935 compare 0E+384 -0E-383 -> 0
|
||||
ddcom936 compare -0E+384 0E-383 -> 0
|
||||
ddcom937 compare -0E+384 -0E-383 -> 0
|
||||
ddcom938 compare 0 0E-383 -> 0
|
||||
ddcom939 compare 0 -0E-383 -> 0
|
||||
ddcom940 compare -0 0E-383 -> 0
|
||||
ddcom941 compare -0 -0E-383 -> 0
|
||||
|
||||
-- signs
|
||||
ddcom961 compare 1e+77 1e+11 -> 1
|
||||
ddcom962 compare 1e+77 -1e+11 -> 1
|
||||
ddcom963 compare -1e+77 1e+11 -> -1
|
||||
ddcom964 compare -1e+77 -1e+11 -> -1
|
||||
ddcom965 compare 1e-77 1e-11 -> -1
|
||||
ddcom966 compare 1e-77 -1e-11 -> 1
|
||||
ddcom967 compare -1e-77 1e-11 -> -1
|
||||
ddcom968 compare -1e-77 -1e-11 -> 1
|
||||
|
||||
-- full alignment range, both ways
|
||||
ddcomp1001 compare 1 1.000000000000000 -> 0
|
||||
ddcomp1002 compare 1 1.00000000000000 -> 0
|
||||
ddcomp1003 compare 1 1.0000000000000 -> 0
|
||||
ddcomp1004 compare 1 1.000000000000 -> 0
|
||||
ddcomp1005 compare 1 1.00000000000 -> 0
|
||||
ddcomp1006 compare 1 1.0000000000 -> 0
|
||||
ddcomp1007 compare 1 1.000000000 -> 0
|
||||
ddcomp1008 compare 1 1.00000000 -> 0
|
||||
ddcomp1009 compare 1 1.0000000 -> 0
|
||||
ddcomp1010 compare 1 1.000000 -> 0
|
||||
ddcomp1011 compare 1 1.00000 -> 0
|
||||
ddcomp1012 compare 1 1.0000 -> 0
|
||||
ddcomp1013 compare 1 1.000 -> 0
|
||||
ddcomp1014 compare 1 1.00 -> 0
|
||||
ddcomp1015 compare 1 1.0 -> 0
|
||||
ddcomp1021 compare 1.000000000000000 1 -> 0
|
||||
ddcomp1022 compare 1.00000000000000 1 -> 0
|
||||
ddcomp1023 compare 1.0000000000000 1 -> 0
|
||||
ddcomp1024 compare 1.000000000000 1 -> 0
|
||||
ddcomp1025 compare 1.00000000000 1 -> 0
|
||||
ddcomp1026 compare 1.0000000000 1 -> 0
|
||||
ddcomp1027 compare 1.000000000 1 -> 0
|
||||
ddcomp1028 compare 1.00000000 1 -> 0
|
||||
ddcomp1029 compare 1.0000000 1 -> 0
|
||||
ddcomp1030 compare 1.000000 1 -> 0
|
||||
ddcomp1031 compare 1.00000 1 -> 0
|
||||
ddcomp1032 compare 1.0000 1 -> 0
|
||||
ddcomp1033 compare 1.000 1 -> 0
|
||||
ddcomp1034 compare 1.00 1 -> 0
|
||||
ddcomp1035 compare 1.0 1 -> 0
|
||||
|
||||
-- check MSD always detected non-zero
|
||||
ddcomp1040 compare 0 0.000000000000000 -> 0
|
||||
ddcomp1041 compare 0 1.000000000000000 -> -1
|
||||
ddcomp1042 compare 0 2.000000000000000 -> -1
|
||||
ddcomp1043 compare 0 3.000000000000000 -> -1
|
||||
ddcomp1044 compare 0 4.000000000000000 -> -1
|
||||
ddcomp1045 compare 0 5.000000000000000 -> -1
|
||||
ddcomp1046 compare 0 6.000000000000000 -> -1
|
||||
ddcomp1047 compare 0 7.000000000000000 -> -1
|
||||
ddcomp1048 compare 0 8.000000000000000 -> -1
|
||||
ddcomp1049 compare 0 9.000000000000000 -> -1
|
||||
ddcomp1050 compare 0.000000000000000 0 -> 0
|
||||
ddcomp1051 compare 1.000000000000000 0 -> 1
|
||||
ddcomp1052 compare 2.000000000000000 0 -> 1
|
||||
ddcomp1053 compare 3.000000000000000 0 -> 1
|
||||
ddcomp1054 compare 4.000000000000000 0 -> 1
|
||||
ddcomp1055 compare 5.000000000000000 0 -> 1
|
||||
ddcomp1056 compare 6.000000000000000 0 -> 1
|
||||
ddcomp1057 compare 7.000000000000000 0 -> 1
|
||||
ddcomp1058 compare 8.000000000000000 0 -> 1
|
||||
ddcomp1059 compare 9.000000000000000 0 -> 1
|
||||
|
||||
-- Null tests
|
||||
ddcom9990 compare 10 # -> NaN Invalid_operation
|
||||
ddcom9991 compare # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,647 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCompareSig.decTest -- decDouble comparison; all NaNs signal --
|
||||
-- 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
|
||||
|
||||
-- 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 necessary).
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddcms001 comparesig -2 -2 -> 0
|
||||
ddcms002 comparesig -2 -1 -> -1
|
||||
ddcms003 comparesig -2 0 -> -1
|
||||
ddcms004 comparesig -2 1 -> -1
|
||||
ddcms005 comparesig -2 2 -> -1
|
||||
ddcms006 comparesig -1 -2 -> 1
|
||||
ddcms007 comparesig -1 -1 -> 0
|
||||
ddcms008 comparesig -1 0 -> -1
|
||||
ddcms009 comparesig -1 1 -> -1
|
||||
ddcms010 comparesig -1 2 -> -1
|
||||
ddcms011 comparesig 0 -2 -> 1
|
||||
ddcms012 comparesig 0 -1 -> 1
|
||||
ddcms013 comparesig 0 0 -> 0
|
||||
ddcms014 comparesig 0 1 -> -1
|
||||
ddcms015 comparesig 0 2 -> -1
|
||||
ddcms016 comparesig 1 -2 -> 1
|
||||
ddcms017 comparesig 1 -1 -> 1
|
||||
ddcms018 comparesig 1 0 -> 1
|
||||
ddcms019 comparesig 1 1 -> 0
|
||||
ddcms020 comparesig 1 2 -> -1
|
||||
ddcms021 comparesig 2 -2 -> 1
|
||||
ddcms022 comparesig 2 -1 -> 1
|
||||
ddcms023 comparesig 2 0 -> 1
|
||||
ddcms025 comparesig 2 1 -> 1
|
||||
ddcms026 comparesig 2 2 -> 0
|
||||
|
||||
ddcms031 comparesig -20 -20 -> 0
|
||||
ddcms032 comparesig -20 -10 -> -1
|
||||
ddcms033 comparesig -20 00 -> -1
|
||||
ddcms034 comparesig -20 10 -> -1
|
||||
ddcms035 comparesig -20 20 -> -1
|
||||
ddcms036 comparesig -10 -20 -> 1
|
||||
ddcms037 comparesig -10 -10 -> 0
|
||||
ddcms038 comparesig -10 00 -> -1
|
||||
ddcms039 comparesig -10 10 -> -1
|
||||
ddcms040 comparesig -10 20 -> -1
|
||||
ddcms041 comparesig 00 -20 -> 1
|
||||
ddcms042 comparesig 00 -10 -> 1
|
||||
ddcms043 comparesig 00 00 -> 0
|
||||
ddcms044 comparesig 00 10 -> -1
|
||||
ddcms045 comparesig 00 20 -> -1
|
||||
ddcms046 comparesig 10 -20 -> 1
|
||||
ddcms047 comparesig 10 -10 -> 1
|
||||
ddcms048 comparesig 10 00 -> 1
|
||||
ddcms049 comparesig 10 10 -> 0
|
||||
ddcms050 comparesig 10 20 -> -1
|
||||
ddcms051 comparesig 20 -20 -> 1
|
||||
ddcms052 comparesig 20 -10 -> 1
|
||||
ddcms053 comparesig 20 00 -> 1
|
||||
ddcms055 comparesig 20 10 -> 1
|
||||
ddcms056 comparesig 20 20 -> 0
|
||||
|
||||
ddcms061 comparesig -2.0 -2.0 -> 0
|
||||
ddcms062 comparesig -2.0 -1.0 -> -1
|
||||
ddcms063 comparesig -2.0 0.0 -> -1
|
||||
ddcms064 comparesig -2.0 1.0 -> -1
|
||||
ddcms065 comparesig -2.0 2.0 -> -1
|
||||
ddcms066 comparesig -1.0 -2.0 -> 1
|
||||
ddcms067 comparesig -1.0 -1.0 -> 0
|
||||
ddcms068 comparesig -1.0 0.0 -> -1
|
||||
ddcms069 comparesig -1.0 1.0 -> -1
|
||||
ddcms070 comparesig -1.0 2.0 -> -1
|
||||
ddcms071 comparesig 0.0 -2.0 -> 1
|
||||
ddcms072 comparesig 0.0 -1.0 -> 1
|
||||
ddcms073 comparesig 0.0 0.0 -> 0
|
||||
ddcms074 comparesig 0.0 1.0 -> -1
|
||||
ddcms075 comparesig 0.0 2.0 -> -1
|
||||
ddcms076 comparesig 1.0 -2.0 -> 1
|
||||
ddcms077 comparesig 1.0 -1.0 -> 1
|
||||
ddcms078 comparesig 1.0 0.0 -> 1
|
||||
ddcms079 comparesig 1.0 1.0 -> 0
|
||||
ddcms080 comparesig 1.0 2.0 -> -1
|
||||
ddcms081 comparesig 2.0 -2.0 -> 1
|
||||
ddcms082 comparesig 2.0 -1.0 -> 1
|
||||
ddcms083 comparesig 2.0 0.0 -> 1
|
||||
ddcms085 comparesig 2.0 1.0 -> 1
|
||||
ddcms086 comparesig 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0
|
||||
ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1
|
||||
ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1
|
||||
ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
ddcms100 comparesig 7.0 7.0 -> 0
|
||||
ddcms101 comparesig 7.0 7 -> 0
|
||||
ddcms102 comparesig 7 7.0 -> 0
|
||||
ddcms103 comparesig 7E+0 7.0 -> 0
|
||||
ddcms104 comparesig 70E-1 7.0 -> 0
|
||||
ddcms105 comparesig 0.7E+1 7 -> 0
|
||||
ddcms106 comparesig 70E-1 7 -> 0
|
||||
ddcms107 comparesig 7.0 7E+0 -> 0
|
||||
ddcms108 comparesig 7.0 70E-1 -> 0
|
||||
ddcms109 comparesig 7 0.7E+1 -> 0
|
||||
ddcms110 comparesig 7 70E-1 -> 0
|
||||
|
||||
ddcms120 comparesig 8.0 7.0 -> 1
|
||||
ddcms121 comparesig 8.0 7 -> 1
|
||||
ddcms122 comparesig 8 7.0 -> 1
|
||||
ddcms123 comparesig 8E+0 7.0 -> 1
|
||||
ddcms124 comparesig 80E-1 7.0 -> 1
|
||||
ddcms125 comparesig 0.8E+1 7 -> 1
|
||||
ddcms126 comparesig 80E-1 7 -> 1
|
||||
ddcms127 comparesig 8.0 7E+0 -> 1
|
||||
ddcms128 comparesig 8.0 70E-1 -> 1
|
||||
ddcms129 comparesig 8 0.7E+1 -> 1
|
||||
ddcms130 comparesig 8 70E-1 -> 1
|
||||
|
||||
ddcms140 comparesig 8.0 9.0 -> -1
|
||||
ddcms141 comparesig 8.0 9 -> -1
|
||||
ddcms142 comparesig 8 9.0 -> -1
|
||||
ddcms143 comparesig 8E+0 9.0 -> -1
|
||||
ddcms144 comparesig 80E-1 9.0 -> -1
|
||||
ddcms145 comparesig 0.8E+1 9 -> -1
|
||||
ddcms146 comparesig 80E-1 9 -> -1
|
||||
ddcms147 comparesig 8.0 9E+0 -> -1
|
||||
ddcms148 comparesig 8.0 90E-1 -> -1
|
||||
ddcms149 comparesig 8 0.9E+1 -> -1
|
||||
ddcms150 comparesig 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
ddcms200 comparesig -7.0 7.0 -> -1
|
||||
ddcms201 comparesig -7.0 7 -> -1
|
||||
ddcms202 comparesig -7 7.0 -> -1
|
||||
ddcms203 comparesig -7E+0 7.0 -> -1
|
||||
ddcms204 comparesig -70E-1 7.0 -> -1
|
||||
ddcms205 comparesig -0.7E+1 7 -> -1
|
||||
ddcms206 comparesig -70E-1 7 -> -1
|
||||
ddcms207 comparesig -7.0 7E+0 -> -1
|
||||
ddcms208 comparesig -7.0 70E-1 -> -1
|
||||
ddcms209 comparesig -7 0.7E+1 -> -1
|
||||
ddcms210 comparesig -7 70E-1 -> -1
|
||||
|
||||
ddcms220 comparesig -8.0 7.0 -> -1
|
||||
ddcms221 comparesig -8.0 7 -> -1
|
||||
ddcms222 comparesig -8 7.0 -> -1
|
||||
ddcms223 comparesig -8E+0 7.0 -> -1
|
||||
ddcms224 comparesig -80E-1 7.0 -> -1
|
||||
ddcms225 comparesig -0.8E+1 7 -> -1
|
||||
ddcms226 comparesig -80E-1 7 -> -1
|
||||
ddcms227 comparesig -8.0 7E+0 -> -1
|
||||
ddcms228 comparesig -8.0 70E-1 -> -1
|
||||
ddcms229 comparesig -8 0.7E+1 -> -1
|
||||
ddcms230 comparesig -8 70E-1 -> -1
|
||||
|
||||
ddcms240 comparesig -8.0 9.0 -> -1
|
||||
ddcms241 comparesig -8.0 9 -> -1
|
||||
ddcms242 comparesig -8 9.0 -> -1
|
||||
ddcms243 comparesig -8E+0 9.0 -> -1
|
||||
ddcms244 comparesig -80E-1 9.0 -> -1
|
||||
ddcms245 comparesig -0.8E+1 9 -> -1
|
||||
ddcms246 comparesig -80E-1 9 -> -1
|
||||
ddcms247 comparesig -8.0 9E+0 -> -1
|
||||
ddcms248 comparesig -8.0 90E-1 -> -1
|
||||
ddcms249 comparesig -8 0.9E+1 -> -1
|
||||
ddcms250 comparesig -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
ddcms300 comparesig 7.0 -7.0 -> 1
|
||||
ddcms301 comparesig 7.0 -7 -> 1
|
||||
ddcms302 comparesig 7 -7.0 -> 1
|
||||
ddcms303 comparesig 7E+0 -7.0 -> 1
|
||||
ddcms304 comparesig 70E-1 -7.0 -> 1
|
||||
ddcms305 comparesig .7E+1 -7 -> 1
|
||||
ddcms306 comparesig 70E-1 -7 -> 1
|
||||
ddcms307 comparesig 7.0 -7E+0 -> 1
|
||||
ddcms308 comparesig 7.0 -70E-1 -> 1
|
||||
ddcms309 comparesig 7 -.7E+1 -> 1
|
||||
ddcms310 comparesig 7 -70E-1 -> 1
|
||||
|
||||
ddcms320 comparesig 8.0 -7.0 -> 1
|
||||
ddcms321 comparesig 8.0 -7 -> 1
|
||||
ddcms322 comparesig 8 -7.0 -> 1
|
||||
ddcms323 comparesig 8E+0 -7.0 -> 1
|
||||
ddcms324 comparesig 80E-1 -7.0 -> 1
|
||||
ddcms325 comparesig .8E+1 -7 -> 1
|
||||
ddcms326 comparesig 80E-1 -7 -> 1
|
||||
ddcms327 comparesig 8.0 -7E+0 -> 1
|
||||
ddcms328 comparesig 8.0 -70E-1 -> 1
|
||||
ddcms329 comparesig 8 -.7E+1 -> 1
|
||||
ddcms330 comparesig 8 -70E-1 -> 1
|
||||
|
||||
ddcms340 comparesig 8.0 -9.0 -> 1
|
||||
ddcms341 comparesig 8.0 -9 -> 1
|
||||
ddcms342 comparesig 8 -9.0 -> 1
|
||||
ddcms343 comparesig 8E+0 -9.0 -> 1
|
||||
ddcms344 comparesig 80E-1 -9.0 -> 1
|
||||
ddcms345 comparesig .8E+1 -9 -> 1
|
||||
ddcms346 comparesig 80E-1 -9 -> 1
|
||||
ddcms347 comparesig 8.0 -9E+0 -> 1
|
||||
ddcms348 comparesig 8.0 -90E-1 -> 1
|
||||
ddcms349 comparesig 8 -.9E+1 -> 1
|
||||
ddcms350 comparesig 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
ddcms400 comparesig -7.0 -7.0 -> 0
|
||||
ddcms401 comparesig -7.0 -7 -> 0
|
||||
ddcms402 comparesig -7 -7.0 -> 0
|
||||
ddcms403 comparesig -7E+0 -7.0 -> 0
|
||||
ddcms404 comparesig -70E-1 -7.0 -> 0
|
||||
ddcms405 comparesig -.7E+1 -7 -> 0
|
||||
ddcms406 comparesig -70E-1 -7 -> 0
|
||||
ddcms407 comparesig -7.0 -7E+0 -> 0
|
||||
ddcms408 comparesig -7.0 -70E-1 -> 0
|
||||
ddcms409 comparesig -7 -.7E+1 -> 0
|
||||
ddcms410 comparesig -7 -70E-1 -> 0
|
||||
|
||||
ddcms420 comparesig -8.0 -7.0 -> -1
|
||||
ddcms421 comparesig -8.0 -7 -> -1
|
||||
ddcms422 comparesig -8 -7.0 -> -1
|
||||
ddcms423 comparesig -8E+0 -7.0 -> -1
|
||||
ddcms424 comparesig -80E-1 -7.0 -> -1
|
||||
ddcms425 comparesig -.8E+1 -7 -> -1
|
||||
ddcms426 comparesig -80E-1 -7 -> -1
|
||||
ddcms427 comparesig -8.0 -7E+0 -> -1
|
||||
ddcms428 comparesig -8.0 -70E-1 -> -1
|
||||
ddcms429 comparesig -8 -.7E+1 -> -1
|
||||
ddcms430 comparesig -8 -70E-1 -> -1
|
||||
|
||||
ddcms440 comparesig -8.0 -9.0 -> 1
|
||||
ddcms441 comparesig -8.0 -9 -> 1
|
||||
ddcms442 comparesig -8 -9.0 -> 1
|
||||
ddcms443 comparesig -8E+0 -9.0 -> 1
|
||||
ddcms444 comparesig -80E-1 -9.0 -> 1
|
||||
ddcms445 comparesig -.8E+1 -9 -> 1
|
||||
ddcms446 comparesig -80E-1 -9 -> 1
|
||||
ddcms447 comparesig -8.0 -9E+0 -> 1
|
||||
ddcms448 comparesig -8.0 -90E-1 -> 1
|
||||
ddcms449 comparesig -8 -.9E+1 -> 1
|
||||
ddcms450 comparesig -8 -90E-1 -> 1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0
|
||||
ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0
|
||||
ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0
|
||||
ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0
|
||||
ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0
|
||||
ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0
|
||||
ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0
|
||||
ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0
|
||||
ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0
|
||||
ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0
|
||||
ddcms483 comparesig 123.456E-89 123.456E-89 -> 0
|
||||
ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0
|
||||
ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0
|
||||
ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0
|
||||
ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0
|
||||
ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0
|
||||
ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0
|
||||
ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0
|
||||
ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0
|
||||
ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0
|
||||
ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0
|
||||
ddcms497 comparesig 123.456E+89 123.456E+89 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
ddcms500 comparesig 1 1E-15 -> 1
|
||||
ddcms501 comparesig 1 1E-14 -> 1
|
||||
ddcms502 comparesig 1 1E-13 -> 1
|
||||
ddcms503 comparesig 1 1E-12 -> 1
|
||||
ddcms504 comparesig 1 1E-11 -> 1
|
||||
ddcms505 comparesig 1 1E-10 -> 1
|
||||
ddcms506 comparesig 1 1E-9 -> 1
|
||||
ddcms507 comparesig 1 1E-8 -> 1
|
||||
ddcms508 comparesig 1 1E-7 -> 1
|
||||
ddcms509 comparesig 1 1E-6 -> 1
|
||||
ddcms510 comparesig 1 1E-5 -> 1
|
||||
ddcms511 comparesig 1 1E-4 -> 1
|
||||
ddcms512 comparesig 1 1E-3 -> 1
|
||||
ddcms513 comparesig 1 1E-2 -> 1
|
||||
ddcms514 comparesig 1 1E-1 -> 1
|
||||
ddcms515 comparesig 1 1E-0 -> 0
|
||||
ddcms516 comparesig 1 1E+1 -> -1
|
||||
ddcms517 comparesig 1 1E+2 -> -1
|
||||
ddcms518 comparesig 1 1E+3 -> -1
|
||||
ddcms519 comparesig 1 1E+4 -> -1
|
||||
ddcms521 comparesig 1 1E+5 -> -1
|
||||
ddcms522 comparesig 1 1E+6 -> -1
|
||||
ddcms523 comparesig 1 1E+7 -> -1
|
||||
ddcms524 comparesig 1 1E+8 -> -1
|
||||
ddcms525 comparesig 1 1E+9 -> -1
|
||||
ddcms526 comparesig 1 1E+10 -> -1
|
||||
ddcms527 comparesig 1 1E+11 -> -1
|
||||
ddcms528 comparesig 1 1E+12 -> -1
|
||||
ddcms529 comparesig 1 1E+13 -> -1
|
||||
ddcms530 comparesig 1 1E+14 -> -1
|
||||
ddcms531 comparesig 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
ddcms540 comparesig 1E-15 1 -> -1
|
||||
ddcms541 comparesig 1E-14 1 -> -1
|
||||
ddcms542 comparesig 1E-13 1 -> -1
|
||||
ddcms543 comparesig 1E-12 1 -> -1
|
||||
ddcms544 comparesig 1E-11 1 -> -1
|
||||
ddcms545 comparesig 1E-10 1 -> -1
|
||||
ddcms546 comparesig 1E-9 1 -> -1
|
||||
ddcms547 comparesig 1E-8 1 -> -1
|
||||
ddcms548 comparesig 1E-7 1 -> -1
|
||||
ddcms549 comparesig 1E-6 1 -> -1
|
||||
ddcms550 comparesig 1E-5 1 -> -1
|
||||
ddcms551 comparesig 1E-4 1 -> -1
|
||||
ddcms552 comparesig 1E-3 1 -> -1
|
||||
ddcms553 comparesig 1E-2 1 -> -1
|
||||
ddcms554 comparesig 1E-1 1 -> -1
|
||||
ddcms555 comparesig 1E-0 1 -> 0
|
||||
ddcms556 comparesig 1E+1 1 -> 1
|
||||
ddcms557 comparesig 1E+2 1 -> 1
|
||||
ddcms558 comparesig 1E+3 1 -> 1
|
||||
ddcms559 comparesig 1E+4 1 -> 1
|
||||
ddcms561 comparesig 1E+5 1 -> 1
|
||||
ddcms562 comparesig 1E+6 1 -> 1
|
||||
ddcms563 comparesig 1E+7 1 -> 1
|
||||
ddcms564 comparesig 1E+8 1 -> 1
|
||||
ddcms565 comparesig 1E+9 1 -> 1
|
||||
ddcms566 comparesig 1E+10 1 -> 1
|
||||
ddcms567 comparesig 1E+11 1 -> 1
|
||||
ddcms568 comparesig 1E+12 1 -> 1
|
||||
ddcms569 comparesig 1E+13 1 -> 1
|
||||
ddcms570 comparesig 1E+14 1 -> 1
|
||||
ddcms571 comparesig 1E+15 1 -> 1
|
||||
-- similar with a useful coefficient, one side only
|
||||
ddcms580 comparesig 0.000000987654321 1E-15 -> 1
|
||||
ddcms581 comparesig 0.000000987654321 1E-14 -> 1
|
||||
ddcms582 comparesig 0.000000987654321 1E-13 -> 1
|
||||
ddcms583 comparesig 0.000000987654321 1E-12 -> 1
|
||||
ddcms584 comparesig 0.000000987654321 1E-11 -> 1
|
||||
ddcms585 comparesig 0.000000987654321 1E-10 -> 1
|
||||
ddcms586 comparesig 0.000000987654321 1E-9 -> 1
|
||||
ddcms587 comparesig 0.000000987654321 1E-8 -> 1
|
||||
ddcms588 comparesig 0.000000987654321 1E-7 -> 1
|
||||
ddcms589 comparesig 0.000000987654321 1E-6 -> -1
|
||||
ddcms590 comparesig 0.000000987654321 1E-5 -> -1
|
||||
ddcms591 comparesig 0.000000987654321 1E-4 -> -1
|
||||
ddcms592 comparesig 0.000000987654321 1E-3 -> -1
|
||||
ddcms593 comparesig 0.000000987654321 1E-2 -> -1
|
||||
ddcms594 comparesig 0.000000987654321 1E-1 -> -1
|
||||
ddcms595 comparesig 0.000000987654321 1E-0 -> -1
|
||||
ddcms596 comparesig 0.000000987654321 1E+1 -> -1
|
||||
ddcms597 comparesig 0.000000987654321 1E+2 -> -1
|
||||
ddcms598 comparesig 0.000000987654321 1E+3 -> -1
|
||||
ddcms599 comparesig 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
ddcms600 comparesig 12 12.2345 -> -1
|
||||
ddcms601 comparesig 12.0 12.2345 -> -1
|
||||
ddcms602 comparesig 12.00 12.2345 -> -1
|
||||
ddcms603 comparesig 12.000 12.2345 -> -1
|
||||
ddcms604 comparesig 12.0000 12.2345 -> -1
|
||||
ddcms605 comparesig 12.00000 12.2345 -> -1
|
||||
ddcms606 comparesig 12.000000 12.2345 -> -1
|
||||
ddcms607 comparesig 12.0000000 12.2345 -> -1
|
||||
ddcms608 comparesig 12.00000000 12.2345 -> -1
|
||||
ddcms609 comparesig 12.000000000 12.2345 -> -1
|
||||
ddcms610 comparesig 12.1234 12 -> 1
|
||||
ddcms611 comparesig 12.1234 12.0 -> 1
|
||||
ddcms612 comparesig 12.1234 12.00 -> 1
|
||||
ddcms613 comparesig 12.1234 12.000 -> 1
|
||||
ddcms614 comparesig 12.1234 12.0000 -> 1
|
||||
ddcms615 comparesig 12.1234 12.00000 -> 1
|
||||
ddcms616 comparesig 12.1234 12.000000 -> 1
|
||||
ddcms617 comparesig 12.1234 12.0000000 -> 1
|
||||
ddcms618 comparesig 12.1234 12.00000000 -> 1
|
||||
ddcms619 comparesig 12.1234 12.000000000 -> 1
|
||||
ddcms620 comparesig -12 -12.2345 -> 1
|
||||
ddcms621 comparesig -12.0 -12.2345 -> 1
|
||||
ddcms622 comparesig -12.00 -12.2345 -> 1
|
||||
ddcms623 comparesig -12.000 -12.2345 -> 1
|
||||
ddcms624 comparesig -12.0000 -12.2345 -> 1
|
||||
ddcms625 comparesig -12.00000 -12.2345 -> 1
|
||||
ddcms626 comparesig -12.000000 -12.2345 -> 1
|
||||
ddcms627 comparesig -12.0000000 -12.2345 -> 1
|
||||
ddcms628 comparesig -12.00000000 -12.2345 -> 1
|
||||
ddcms629 comparesig -12.000000000 -12.2345 -> 1
|
||||
ddcms630 comparesig -12.1234 -12 -> -1
|
||||
ddcms631 comparesig -12.1234 -12.0 -> -1
|
||||
ddcms632 comparesig -12.1234 -12.00 -> -1
|
||||
ddcms633 comparesig -12.1234 -12.000 -> -1
|
||||
ddcms634 comparesig -12.1234 -12.0000 -> -1
|
||||
ddcms635 comparesig -12.1234 -12.00000 -> -1
|
||||
ddcms636 comparesig -12.1234 -12.000000 -> -1
|
||||
ddcms637 comparesig -12.1234 -12.0000000 -> -1
|
||||
ddcms638 comparesig -12.1234 -12.00000000 -> -1
|
||||
ddcms639 comparesig -12.1234 -12.000000000 -> -1
|
||||
|
||||
-- extended zeros
|
||||
ddcms640 comparesig 0 0 -> 0
|
||||
ddcms641 comparesig 0 -0 -> 0
|
||||
ddcms642 comparesig 0 -0.0 -> 0
|
||||
ddcms643 comparesig 0 0.0 -> 0
|
||||
ddcms644 comparesig -0 0 -> 0
|
||||
ddcms645 comparesig -0 -0 -> 0
|
||||
ddcms646 comparesig -0 -0.0 -> 0
|
||||
ddcms647 comparesig -0 0.0 -> 0
|
||||
ddcms648 comparesig 0.0 0 -> 0
|
||||
ddcms649 comparesig 0.0 -0 -> 0
|
||||
ddcms650 comparesig 0.0 -0.0 -> 0
|
||||
ddcms651 comparesig 0.0 0.0 -> 0
|
||||
ddcms652 comparesig -0.0 0 -> 0
|
||||
ddcms653 comparesig -0.0 -0 -> 0
|
||||
ddcms654 comparesig -0.0 -0.0 -> 0
|
||||
ddcms655 comparesig -0.0 0.0 -> 0
|
||||
|
||||
ddcms656 comparesig -0E1 0.0 -> 0
|
||||
ddcms657 comparesig -0E2 0.0 -> 0
|
||||
ddcms658 comparesig 0E1 0.0 -> 0
|
||||
ddcms659 comparesig 0E2 0.0 -> 0
|
||||
ddcms660 comparesig -0E1 0 -> 0
|
||||
ddcms661 comparesig -0E2 0 -> 0
|
||||
ddcms662 comparesig 0E1 0 -> 0
|
||||
ddcms663 comparesig 0E2 0 -> 0
|
||||
ddcms664 comparesig -0E1 -0E1 -> 0
|
||||
ddcms665 comparesig -0E2 -0E1 -> 0
|
||||
ddcms666 comparesig 0E1 -0E1 -> 0
|
||||
ddcms667 comparesig 0E2 -0E1 -> 0
|
||||
ddcms668 comparesig -0E1 -0E2 -> 0
|
||||
ddcms669 comparesig -0E2 -0E2 -> 0
|
||||
ddcms670 comparesig 0E1 -0E2 -> 0
|
||||
ddcms671 comparesig 0E2 -0E2 -> 0
|
||||
ddcms672 comparesig -0E1 0E1 -> 0
|
||||
ddcms673 comparesig -0E2 0E1 -> 0
|
||||
ddcms674 comparesig 0E1 0E1 -> 0
|
||||
ddcms675 comparesig 0E2 0E1 -> 0
|
||||
ddcms676 comparesig -0E1 0E2 -> 0
|
||||
ddcms677 comparesig -0E2 0E2 -> 0
|
||||
ddcms678 comparesig 0E1 0E2 -> 0
|
||||
ddcms679 comparesig 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
ddcms680 comparesig 12 12 -> 0
|
||||
ddcms681 comparesig 12 12.0 -> 0
|
||||
ddcms682 comparesig 12 12.00 -> 0
|
||||
ddcms683 comparesig 12 12.000 -> 0
|
||||
ddcms684 comparesig 12 12.0000 -> 0
|
||||
ddcms685 comparesig 12 12.00000 -> 0
|
||||
ddcms686 comparesig 12 12.000000 -> 0
|
||||
ddcms687 comparesig 12 12.0000000 -> 0
|
||||
ddcms688 comparesig 12 12.00000000 -> 0
|
||||
ddcms689 comparesig 12 12.000000000 -> 0
|
||||
ddcms690 comparesig 12 12 -> 0
|
||||
ddcms691 comparesig 12.0 12 -> 0
|
||||
ddcms692 comparesig 12.00 12 -> 0
|
||||
ddcms693 comparesig 12.000 12 -> 0
|
||||
ddcms694 comparesig 12.0000 12 -> 0
|
||||
ddcms695 comparesig 12.00000 12 -> 0
|
||||
ddcms696 comparesig 12.000000 12 -> 0
|
||||
ddcms697 comparesig 12.0000000 12 -> 0
|
||||
ddcms698 comparesig 12.00000000 12 -> 0
|
||||
ddcms699 comparesig 12.000000000 12 -> 0
|
||||
|
||||
-- first, second, & last digit
|
||||
ddcms700 comparesig 1234567890123456 1234567890123455 -> 1
|
||||
ddcms701 comparesig 1234567890123456 1234567890123456 -> 0
|
||||
ddcms702 comparesig 1234567890123456 1234567890123457 -> -1
|
||||
ddcms703 comparesig 1234567890123456 0234567890123456 -> 1
|
||||
ddcms704 comparesig 1234567890123456 1234567890123456 -> 0
|
||||
ddcms705 comparesig 1234567890123456 2234567890123456 -> -1
|
||||
ddcms706 comparesig 1134567890123456 1034567890123456 -> 1
|
||||
ddcms707 comparesig 1134567890123456 1134567890123456 -> 0
|
||||
ddcms708 comparesig 1134567890123456 1234567890123456 -> -1
|
||||
|
||||
-- miscellaneous
|
||||
ddcms721 comparesig 12345678000 1 -> 1
|
||||
ddcms722 comparesig 1 12345678000 -> -1
|
||||
ddcms723 comparesig 1234567800 1 -> 1
|
||||
ddcms724 comparesig 1 1234567800 -> -1
|
||||
ddcms725 comparesig 1234567890 1 -> 1
|
||||
ddcms726 comparesig 1 1234567890 -> -1
|
||||
ddcms727 comparesig 1234567891 1 -> 1
|
||||
ddcms728 comparesig 1 1234567891 -> -1
|
||||
ddcms729 comparesig 12345678901 1 -> 1
|
||||
ddcms730 comparesig 1 12345678901 -> -1
|
||||
ddcms731 comparesig 1234567896 1 -> 1
|
||||
ddcms732 comparesig 1 1234567896 -> -1
|
||||
|
||||
-- residue cases at lower precision
|
||||
ddcms740 comparesig 1 0.9999999 -> 1
|
||||
ddcms741 comparesig 1 0.999999 -> 1
|
||||
ddcms742 comparesig 1 0.99999 -> 1
|
||||
ddcms743 comparesig 1 1.0000 -> 0
|
||||
ddcms744 comparesig 1 1.00001 -> -1
|
||||
ddcms745 comparesig 1 1.000001 -> -1
|
||||
ddcms746 comparesig 1 1.0000001 -> -1
|
||||
ddcms750 comparesig 0.9999999 1 -> -1
|
||||
ddcms751 comparesig 0.999999 1 -> -1
|
||||
ddcms752 comparesig 0.99999 1 -> -1
|
||||
ddcms753 comparesig 1.0000 1 -> 0
|
||||
ddcms754 comparesig 1.00001 1 -> 1
|
||||
ddcms755 comparesig 1.000001 1 -> 1
|
||||
ddcms756 comparesig 1.0000001 1 -> 1
|
||||
|
||||
-- Specials
|
||||
ddcms780 comparesig Inf -Inf -> 1
|
||||
ddcms781 comparesig Inf -1000 -> 1
|
||||
ddcms782 comparesig Inf -1 -> 1
|
||||
ddcms783 comparesig Inf -0 -> 1
|
||||
ddcms784 comparesig Inf 0 -> 1
|
||||
ddcms785 comparesig Inf 1 -> 1
|
||||
ddcms786 comparesig Inf 1000 -> 1
|
||||
ddcms787 comparesig Inf Inf -> 0
|
||||
ddcms788 comparesig -1000 Inf -> -1
|
||||
ddcms789 comparesig -Inf Inf -> -1
|
||||
ddcms790 comparesig -1 Inf -> -1
|
||||
ddcms791 comparesig -0 Inf -> -1
|
||||
ddcms792 comparesig 0 Inf -> -1
|
||||
ddcms793 comparesig 1 Inf -> -1
|
||||
ddcms794 comparesig 1000 Inf -> -1
|
||||
ddcms795 comparesig Inf Inf -> 0
|
||||
|
||||
ddcms800 comparesig -Inf -Inf -> 0
|
||||
ddcms801 comparesig -Inf -1000 -> -1
|
||||
ddcms802 comparesig -Inf -1 -> -1
|
||||
ddcms803 comparesig -Inf -0 -> -1
|
||||
ddcms804 comparesig -Inf 0 -> -1
|
||||
ddcms805 comparesig -Inf 1 -> -1
|
||||
ddcms806 comparesig -Inf 1000 -> -1
|
||||
ddcms807 comparesig -Inf Inf -> -1
|
||||
ddcms808 comparesig -Inf -Inf -> 0
|
||||
ddcms809 comparesig -1000 -Inf -> 1
|
||||
ddcms810 comparesig -1 -Inf -> 1
|
||||
ddcms811 comparesig -0 -Inf -> 1
|
||||
ddcms812 comparesig 0 -Inf -> 1
|
||||
ddcms813 comparesig 1 -Inf -> 1
|
||||
ddcms814 comparesig 1000 -Inf -> 1
|
||||
ddcms815 comparesig Inf -Inf -> 1
|
||||
|
||||
ddcms821 comparesig NaN -Inf -> NaN Invalid_operation
|
||||
ddcms822 comparesig NaN -1000 -> NaN Invalid_operation
|
||||
ddcms823 comparesig NaN -1 -> NaN Invalid_operation
|
||||
ddcms824 comparesig NaN -0 -> NaN Invalid_operation
|
||||
ddcms825 comparesig NaN 0 -> NaN Invalid_operation
|
||||
ddcms826 comparesig NaN 1 -> NaN Invalid_operation
|
||||
ddcms827 comparesig NaN 1000 -> NaN Invalid_operation
|
||||
ddcms828 comparesig NaN Inf -> NaN Invalid_operation
|
||||
ddcms829 comparesig NaN NaN -> NaN Invalid_operation
|
||||
ddcms830 comparesig -Inf NaN -> NaN Invalid_operation
|
||||
ddcms831 comparesig -1000 NaN -> NaN Invalid_operation
|
||||
ddcms832 comparesig -1 NaN -> NaN Invalid_operation
|
||||
ddcms833 comparesig -0 NaN -> NaN Invalid_operation
|
||||
ddcms834 comparesig 0 NaN -> NaN Invalid_operation
|
||||
ddcms835 comparesig 1 NaN -> NaN Invalid_operation
|
||||
ddcms836 comparesig 1000 NaN -> NaN Invalid_operation
|
||||
ddcms837 comparesig Inf NaN -> NaN Invalid_operation
|
||||
ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
|
||||
ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation
|
||||
ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
|
||||
|
||||
ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation
|
||||
ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation
|
||||
ddcms843 comparesig sNaN -1 -> NaN Invalid_operation
|
||||
ddcms844 comparesig sNaN -0 -> NaN Invalid_operation
|
||||
ddcms845 comparesig sNaN 0 -> NaN Invalid_operation
|
||||
ddcms846 comparesig sNaN 1 -> NaN Invalid_operation
|
||||
ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation
|
||||
ddcms848 comparesig sNaN NaN -> NaN Invalid_operation
|
||||
ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation
|
||||
ddcms850 comparesig NaN sNaN -> NaN Invalid_operation
|
||||
ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation
|
||||
ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation
|
||||
ddcms853 comparesig -1 sNaN -> NaN Invalid_operation
|
||||
ddcms854 comparesig -0 sNaN -> NaN Invalid_operation
|
||||
ddcms855 comparesig 0 sNaN -> NaN Invalid_operation
|
||||
ddcms856 comparesig 1 sNaN -> NaN Invalid_operation
|
||||
ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation
|
||||
ddcms858 comparesig Inf sNaN -> NaN Invalid_operation
|
||||
ddcms859 comparesig NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
|
||||
ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
|
||||
ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
|
||||
ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
|
||||
ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
|
||||
ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
|
||||
ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
|
||||
ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
|
||||
ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
|
||||
ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
|
||||
ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
|
||||
|
||||
ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
|
||||
ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
|
||||
ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
|
||||
ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
|
||||
ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
|
||||
ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
|
||||
|
||||
-- wide range
|
||||
ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1
|
||||
ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1
|
||||
ddcms882 comparesig +0.100 9E-383 -> 1
|
||||
ddcms883 comparesig 9E-383 +0.100 -> -1
|
||||
ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1
|
||||
ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1
|
||||
ddcms887 comparesig -0.100 9E-383 -> -1
|
||||
ddcms888 comparesig 9E-383 -0.100 -> 1
|
||||
|
||||
-- signs
|
||||
ddcms901 comparesig 1e+77 1e+11 -> 1
|
||||
ddcms902 comparesig 1e+77 -1e+11 -> 1
|
||||
ddcms903 comparesig -1e+77 1e+11 -> -1
|
||||
ddcms904 comparesig -1e+77 -1e+11 -> -1
|
||||
ddcms905 comparesig 1e-77 1e-11 -> -1
|
||||
ddcms906 comparesig 1e-77 -1e-11 -> 1
|
||||
ddcms907 comparesig -1e-77 1e-11 -> -1
|
||||
ddcms908 comparesig -1e-77 -1e-11 -> 1
|
||||
|
||||
-- Null tests
|
||||
ddcms990 comparesig 10 # -> NaN Invalid_operation
|
||||
ddcms991 comparesig # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,706 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCompareTotal.decTest -- decDouble comparison using total ordering--
|
||||
-- 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
|
||||
|
||||
-- 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 necessary).
|
||||
-- Similarly, comparetotal will have some radically different paths
|
||||
-- than compare.
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddcot001 comparetotal -2 -2 -> 0
|
||||
ddcot002 comparetotal -2 -1 -> -1
|
||||
ddcot003 comparetotal -2 0 -> -1
|
||||
ddcot004 comparetotal -2 1 -> -1
|
||||
ddcot005 comparetotal -2 2 -> -1
|
||||
ddcot006 comparetotal -1 -2 -> 1
|
||||
ddcot007 comparetotal -1 -1 -> 0
|
||||
ddcot008 comparetotal -1 0 -> -1
|
||||
ddcot009 comparetotal -1 1 -> -1
|
||||
ddcot010 comparetotal -1 2 -> -1
|
||||
ddcot011 comparetotal 0 -2 -> 1
|
||||
ddcot012 comparetotal 0 -1 -> 1
|
||||
ddcot013 comparetotal 0 0 -> 0
|
||||
ddcot014 comparetotal 0 1 -> -1
|
||||
ddcot015 comparetotal 0 2 -> -1
|
||||
ddcot016 comparetotal 1 -2 -> 1
|
||||
ddcot017 comparetotal 1 -1 -> 1
|
||||
ddcot018 comparetotal 1 0 -> 1
|
||||
ddcot019 comparetotal 1 1 -> 0
|
||||
ddcot020 comparetotal 1 2 -> -1
|
||||
ddcot021 comparetotal 2 -2 -> 1
|
||||
ddcot022 comparetotal 2 -1 -> 1
|
||||
ddcot023 comparetotal 2 0 -> 1
|
||||
ddcot025 comparetotal 2 1 -> 1
|
||||
ddcot026 comparetotal 2 2 -> 0
|
||||
|
||||
ddcot031 comparetotal -20 -20 -> 0
|
||||
ddcot032 comparetotal -20 -10 -> -1
|
||||
ddcot033 comparetotal -20 00 -> -1
|
||||
ddcot034 comparetotal -20 10 -> -1
|
||||
ddcot035 comparetotal -20 20 -> -1
|
||||
ddcot036 comparetotal -10 -20 -> 1
|
||||
ddcot037 comparetotal -10 -10 -> 0
|
||||
ddcot038 comparetotal -10 00 -> -1
|
||||
ddcot039 comparetotal -10 10 -> -1
|
||||
ddcot040 comparetotal -10 20 -> -1
|
||||
ddcot041 comparetotal 00 -20 -> 1
|
||||
ddcot042 comparetotal 00 -10 -> 1
|
||||
ddcot043 comparetotal 00 00 -> 0
|
||||
ddcot044 comparetotal 00 10 -> -1
|
||||
ddcot045 comparetotal 00 20 -> -1
|
||||
ddcot046 comparetotal 10 -20 -> 1
|
||||
ddcot047 comparetotal 10 -10 -> 1
|
||||
ddcot048 comparetotal 10 00 -> 1
|
||||
ddcot049 comparetotal 10 10 -> 0
|
||||
ddcot050 comparetotal 10 20 -> -1
|
||||
ddcot051 comparetotal 20 -20 -> 1
|
||||
ddcot052 comparetotal 20 -10 -> 1
|
||||
ddcot053 comparetotal 20 00 -> 1
|
||||
ddcot055 comparetotal 20 10 -> 1
|
||||
ddcot056 comparetotal 20 20 -> 0
|
||||
|
||||
ddcot061 comparetotal -2.0 -2.0 -> 0
|
||||
ddcot062 comparetotal -2.0 -1.0 -> -1
|
||||
ddcot063 comparetotal -2.0 0.0 -> -1
|
||||
ddcot064 comparetotal -2.0 1.0 -> -1
|
||||
ddcot065 comparetotal -2.0 2.0 -> -1
|
||||
ddcot066 comparetotal -1.0 -2.0 -> 1
|
||||
ddcot067 comparetotal -1.0 -1.0 -> 0
|
||||
ddcot068 comparetotal -1.0 0.0 -> -1
|
||||
ddcot069 comparetotal -1.0 1.0 -> -1
|
||||
ddcot070 comparetotal -1.0 2.0 -> -1
|
||||
ddcot071 comparetotal 0.0 -2.0 -> 1
|
||||
ddcot072 comparetotal 0.0 -1.0 -> 1
|
||||
ddcot073 comparetotal 0.0 0.0 -> 0
|
||||
ddcot074 comparetotal 0.0 1.0 -> -1
|
||||
ddcot075 comparetotal 0.0 2.0 -> -1
|
||||
ddcot076 comparetotal 1.0 -2.0 -> 1
|
||||
ddcot077 comparetotal 1.0 -1.0 -> 1
|
||||
ddcot078 comparetotal 1.0 0.0 -> 1
|
||||
ddcot079 comparetotal 1.0 1.0 -> 0
|
||||
ddcot080 comparetotal 1.0 2.0 -> -1
|
||||
ddcot081 comparetotal 2.0 -2.0 -> 1
|
||||
ddcot082 comparetotal 2.0 -1.0 -> 1
|
||||
ddcot083 comparetotal 2.0 0.0 -> 1
|
||||
ddcot085 comparetotal 2.0 1.0 -> 1
|
||||
ddcot086 comparetotal 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0
|
||||
ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1
|
||||
ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1
|
||||
ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
-- in this first group, compare would compare all equal
|
||||
ddcot100 comparetotal 7.0 7.0 -> 0
|
||||
ddcot101 comparetotal 7.0 7 -> -1
|
||||
ddcot102 comparetotal 7 7.0 -> 1
|
||||
ddcot103 comparetotal 7E+0 7.0 -> 1
|
||||
ddcot104 comparetotal 70E-1 7.0 -> 0
|
||||
ddcot105 comparetotal 0.7E+1 7 -> 0
|
||||
ddcot106 comparetotal 70E-1 7 -> -1
|
||||
ddcot107 comparetotal 7.0 7E+0 -> -1
|
||||
ddcot108 comparetotal 7.0 70E-1 -> 0
|
||||
ddcot109 comparetotal 7 0.7E+1 -> 0
|
||||
ddcot110 comparetotal 7 70E-1 -> 1
|
||||
|
||||
ddcot120 comparetotal 8.0 7.0 -> 1
|
||||
ddcot121 comparetotal 8.0 7 -> 1
|
||||
ddcot122 comparetotal 8 7.0 -> 1
|
||||
ddcot123 comparetotal 8E+0 7.0 -> 1
|
||||
ddcot124 comparetotal 80E-1 7.0 -> 1
|
||||
ddcot125 comparetotal 0.8E+1 7 -> 1
|
||||
ddcot126 comparetotal 80E-1 7 -> 1
|
||||
ddcot127 comparetotal 8.0 7E+0 -> 1
|
||||
ddcot128 comparetotal 8.0 70E-1 -> 1
|
||||
ddcot129 comparetotal 8 0.7E+1 -> 1
|
||||
ddcot130 comparetotal 8 70E-1 -> 1
|
||||
|
||||
ddcot140 comparetotal 8.0 9.0 -> -1
|
||||
ddcot141 comparetotal 8.0 9 -> -1
|
||||
ddcot142 comparetotal 8 9.0 -> -1
|
||||
ddcot143 comparetotal 8E+0 9.0 -> -1
|
||||
ddcot144 comparetotal 80E-1 9.0 -> -1
|
||||
ddcot145 comparetotal 0.8E+1 9 -> -1
|
||||
ddcot146 comparetotal 80E-1 9 -> -1
|
||||
ddcot147 comparetotal 8.0 9E+0 -> -1
|
||||
ddcot148 comparetotal 8.0 90E-1 -> -1
|
||||
ddcot149 comparetotal 8 0.9E+1 -> -1
|
||||
ddcot150 comparetotal 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
ddcot200 comparetotal -7.0 7.0 -> -1
|
||||
ddcot201 comparetotal -7.0 7 -> -1
|
||||
ddcot202 comparetotal -7 7.0 -> -1
|
||||
ddcot203 comparetotal -7E+0 7.0 -> -1
|
||||
ddcot204 comparetotal -70E-1 7.0 -> -1
|
||||
ddcot205 comparetotal -0.7E+1 7 -> -1
|
||||
ddcot206 comparetotal -70E-1 7 -> -1
|
||||
ddcot207 comparetotal -7.0 7E+0 -> -1
|
||||
ddcot208 comparetotal -7.0 70E-1 -> -1
|
||||
ddcot209 comparetotal -7 0.7E+1 -> -1
|
||||
ddcot210 comparetotal -7 70E-1 -> -1
|
||||
|
||||
ddcot220 comparetotal -8.0 7.0 -> -1
|
||||
ddcot221 comparetotal -8.0 7 -> -1
|
||||
ddcot222 comparetotal -8 7.0 -> -1
|
||||
ddcot223 comparetotal -8E+0 7.0 -> -1
|
||||
ddcot224 comparetotal -80E-1 7.0 -> -1
|
||||
ddcot225 comparetotal -0.8E+1 7 -> -1
|
||||
ddcot226 comparetotal -80E-1 7 -> -1
|
||||
ddcot227 comparetotal -8.0 7E+0 -> -1
|
||||
ddcot228 comparetotal -8.0 70E-1 -> -1
|
||||
ddcot229 comparetotal -8 0.7E+1 -> -1
|
||||
ddcot230 comparetotal -8 70E-1 -> -1
|
||||
|
||||
ddcot240 comparetotal -8.0 9.0 -> -1
|
||||
ddcot241 comparetotal -8.0 9 -> -1
|
||||
ddcot242 comparetotal -8 9.0 -> -1
|
||||
ddcot243 comparetotal -8E+0 9.0 -> -1
|
||||
ddcot244 comparetotal -80E-1 9.0 -> -1
|
||||
ddcot245 comparetotal -0.8E+1 9 -> -1
|
||||
ddcot246 comparetotal -80E-1 9 -> -1
|
||||
ddcot247 comparetotal -8.0 9E+0 -> -1
|
||||
ddcot248 comparetotal -8.0 90E-1 -> -1
|
||||
ddcot249 comparetotal -8 0.9E+1 -> -1
|
||||
ddcot250 comparetotal -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
ddcot300 comparetotal 7.0 -7.0 -> 1
|
||||
ddcot301 comparetotal 7.0 -7 -> 1
|
||||
ddcot302 comparetotal 7 -7.0 -> 1
|
||||
ddcot303 comparetotal 7E+0 -7.0 -> 1
|
||||
ddcot304 comparetotal 70E-1 -7.0 -> 1
|
||||
ddcot305 comparetotal .7E+1 -7 -> 1
|
||||
ddcot306 comparetotal 70E-1 -7 -> 1
|
||||
ddcot307 comparetotal 7.0 -7E+0 -> 1
|
||||
ddcot308 comparetotal 7.0 -70E-1 -> 1
|
||||
ddcot309 comparetotal 7 -.7E+1 -> 1
|
||||
ddcot310 comparetotal 7 -70E-1 -> 1
|
||||
|
||||
ddcot320 comparetotal 8.0 -7.0 -> 1
|
||||
ddcot321 comparetotal 8.0 -7 -> 1
|
||||
ddcot322 comparetotal 8 -7.0 -> 1
|
||||
ddcot323 comparetotal 8E+0 -7.0 -> 1
|
||||
ddcot324 comparetotal 80E-1 -7.0 -> 1
|
||||
ddcot325 comparetotal .8E+1 -7 -> 1
|
||||
ddcot326 comparetotal 80E-1 -7 -> 1
|
||||
ddcot327 comparetotal 8.0 -7E+0 -> 1
|
||||
ddcot328 comparetotal 8.0 -70E-1 -> 1
|
||||
ddcot329 comparetotal 8 -.7E+1 -> 1
|
||||
ddcot330 comparetotal 8 -70E-1 -> 1
|
||||
|
||||
ddcot340 comparetotal 8.0 -9.0 -> 1
|
||||
ddcot341 comparetotal 8.0 -9 -> 1
|
||||
ddcot342 comparetotal 8 -9.0 -> 1
|
||||
ddcot343 comparetotal 8E+0 -9.0 -> 1
|
||||
ddcot344 comparetotal 80E-1 -9.0 -> 1
|
||||
ddcot345 comparetotal .8E+1 -9 -> 1
|
||||
ddcot346 comparetotal 80E-1 -9 -> 1
|
||||
ddcot347 comparetotal 8.0 -9E+0 -> 1
|
||||
ddcot348 comparetotal 8.0 -90E-1 -> 1
|
||||
ddcot349 comparetotal 8 -.9E+1 -> 1
|
||||
ddcot350 comparetotal 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
ddcot400 comparetotal -7.0 -7.0 -> 0
|
||||
ddcot401 comparetotal -7.0 -7 -> 1
|
||||
ddcot402 comparetotal -7 -7.0 -> -1
|
||||
ddcot403 comparetotal -7E+0 -7.0 -> -1
|
||||
ddcot404 comparetotal -70E-1 -7.0 -> 0
|
||||
ddcot405 comparetotal -.7E+1 -7 -> 0
|
||||
ddcot406 comparetotal -70E-1 -7 -> 1
|
||||
ddcot407 comparetotal -7.0 -7E+0 -> 1
|
||||
ddcot408 comparetotal -7.0 -70E-1 -> 0
|
||||
ddcot409 comparetotal -7 -.7E+1 -> 0
|
||||
ddcot410 comparetotal -7 -70E-1 -> -1
|
||||
|
||||
ddcot420 comparetotal -8.0 -7.0 -> -1
|
||||
ddcot421 comparetotal -8.0 -7 -> -1
|
||||
ddcot422 comparetotal -8 -7.0 -> -1
|
||||
ddcot423 comparetotal -8E+0 -7.0 -> -1
|
||||
ddcot424 comparetotal -80E-1 -7.0 -> -1
|
||||
ddcot425 comparetotal -.8E+1 -7 -> -1
|
||||
ddcot426 comparetotal -80E-1 -7 -> -1
|
||||
ddcot427 comparetotal -8.0 -7E+0 -> -1
|
||||
ddcot428 comparetotal -8.0 -70E-1 -> -1
|
||||
ddcot429 comparetotal -8 -.7E+1 -> -1
|
||||
ddcot430 comparetotal -8 -70E-1 -> -1
|
||||
|
||||
ddcot440 comparetotal -8.0 -9.0 -> 1
|
||||
ddcot441 comparetotal -8.0 -9 -> 1
|
||||
ddcot442 comparetotal -8 -9.0 -> 1
|
||||
ddcot443 comparetotal -8E+0 -9.0 -> 1
|
||||
ddcot444 comparetotal -80E-1 -9.0 -> 1
|
||||
ddcot445 comparetotal -.8E+1 -9 -> 1
|
||||
ddcot446 comparetotal -80E-1 -9 -> 1
|
||||
ddcot447 comparetotal -8.0 -9E+0 -> 1
|
||||
ddcot448 comparetotal -8.0 -90E-1 -> 1
|
||||
ddcot449 comparetotal -8 -.9E+1 -> 1
|
||||
ddcot450 comparetotal -8 -90E-1 -> 1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
|
||||
ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
|
||||
ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
|
||||
ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
|
||||
ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
|
||||
ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
|
||||
ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
|
||||
ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
|
||||
ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
|
||||
ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
|
||||
ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0
|
||||
ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
|
||||
ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
|
||||
ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
|
||||
ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
|
||||
ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
|
||||
ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
|
||||
ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
|
||||
ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
|
||||
ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
|
||||
ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
|
||||
ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
ddcot498 comparetotal 1 1E-17 -> 1
|
||||
ddcot499 comparetotal 1 1E-16 -> 1
|
||||
ddcot500 comparetotal 1 1E-15 -> 1
|
||||
ddcot501 comparetotal 1 1E-14 -> 1
|
||||
ddcot502 comparetotal 1 1E-13 -> 1
|
||||
ddcot503 comparetotal 1 1E-12 -> 1
|
||||
ddcot504 comparetotal 1 1E-11 -> 1
|
||||
ddcot505 comparetotal 1 1E-10 -> 1
|
||||
ddcot506 comparetotal 1 1E-9 -> 1
|
||||
ddcot507 comparetotal 1 1E-8 -> 1
|
||||
ddcot508 comparetotal 1 1E-7 -> 1
|
||||
ddcot509 comparetotal 1 1E-6 -> 1
|
||||
ddcot510 comparetotal 1 1E-5 -> 1
|
||||
ddcot511 comparetotal 1 1E-4 -> 1
|
||||
ddcot512 comparetotal 1 1E-3 -> 1
|
||||
ddcot513 comparetotal 1 1E-2 -> 1
|
||||
ddcot514 comparetotal 1 1E-1 -> 1
|
||||
ddcot515 comparetotal 1 1E-0 -> 0
|
||||
ddcot516 comparetotal 1 1E+1 -> -1
|
||||
ddcot517 comparetotal 1 1E+2 -> -1
|
||||
ddcot518 comparetotal 1 1E+3 -> -1
|
||||
ddcot519 comparetotal 1 1E+4 -> -1
|
||||
ddcot521 comparetotal 1 1E+5 -> -1
|
||||
ddcot522 comparetotal 1 1E+6 -> -1
|
||||
ddcot523 comparetotal 1 1E+7 -> -1
|
||||
ddcot524 comparetotal 1 1E+8 -> -1
|
||||
ddcot525 comparetotal 1 1E+9 -> -1
|
||||
ddcot526 comparetotal 1 1E+10 -> -1
|
||||
ddcot527 comparetotal 1 1E+11 -> -1
|
||||
ddcot528 comparetotal 1 1E+12 -> -1
|
||||
ddcot529 comparetotal 1 1E+13 -> -1
|
||||
ddcot530 comparetotal 1 1E+14 -> -1
|
||||
ddcot531 comparetotal 1 1E+15 -> -1
|
||||
ddcot532 comparetotal 1 1E+16 -> -1
|
||||
ddcot533 comparetotal 1 1E+17 -> -1
|
||||
-- LR swap
|
||||
ddcot538 comparetotal 1E-17 1 -> -1
|
||||
ddcot539 comparetotal 1E-16 1 -> -1
|
||||
ddcot540 comparetotal 1E-15 1 -> -1
|
||||
ddcot541 comparetotal 1E-14 1 -> -1
|
||||
ddcot542 comparetotal 1E-13 1 -> -1
|
||||
ddcot543 comparetotal 1E-12 1 -> -1
|
||||
ddcot544 comparetotal 1E-11 1 -> -1
|
||||
ddcot545 comparetotal 1E-10 1 -> -1
|
||||
ddcot546 comparetotal 1E-9 1 -> -1
|
||||
ddcot547 comparetotal 1E-8 1 -> -1
|
||||
ddcot548 comparetotal 1E-7 1 -> -1
|
||||
ddcot549 comparetotal 1E-6 1 -> -1
|
||||
ddcot550 comparetotal 1E-5 1 -> -1
|
||||
ddcot551 comparetotal 1E-4 1 -> -1
|
||||
ddcot552 comparetotal 1E-3 1 -> -1
|
||||
ddcot553 comparetotal 1E-2 1 -> -1
|
||||
ddcot554 comparetotal 1E-1 1 -> -1
|
||||
ddcot555 comparetotal 1E-0 1 -> 0
|
||||
ddcot556 comparetotal 1E+1 1 -> 1
|
||||
ddcot557 comparetotal 1E+2 1 -> 1
|
||||
ddcot558 comparetotal 1E+3 1 -> 1
|
||||
ddcot559 comparetotal 1E+4 1 -> 1
|
||||
ddcot561 comparetotal 1E+5 1 -> 1
|
||||
ddcot562 comparetotal 1E+6 1 -> 1
|
||||
ddcot563 comparetotal 1E+7 1 -> 1
|
||||
ddcot564 comparetotal 1E+8 1 -> 1
|
||||
ddcot565 comparetotal 1E+9 1 -> 1
|
||||
ddcot566 comparetotal 1E+10 1 -> 1
|
||||
ddcot567 comparetotal 1E+11 1 -> 1
|
||||
ddcot568 comparetotal 1E+12 1 -> 1
|
||||
ddcot569 comparetotal 1E+13 1 -> 1
|
||||
ddcot570 comparetotal 1E+14 1 -> 1
|
||||
ddcot571 comparetotal 1E+15 1 -> 1
|
||||
ddcot572 comparetotal 1E+16 1 -> 1
|
||||
ddcot573 comparetotal 1E+17 1 -> 1
|
||||
-- similar with a useful coefficient, one side only
|
||||
ddcot578 comparetotal 0.000000987654321 1E-17 -> 1
|
||||
ddcot579 comparetotal 0.000000987654321 1E-16 -> 1
|
||||
ddcot580 comparetotal 0.000000987654321 1E-15 -> 1
|
||||
ddcot581 comparetotal 0.000000987654321 1E-14 -> 1
|
||||
ddcot582 comparetotal 0.000000987654321 1E-13 -> 1
|
||||
ddcot583 comparetotal 0.000000987654321 1E-12 -> 1
|
||||
ddcot584 comparetotal 0.000000987654321 1E-11 -> 1
|
||||
ddcot585 comparetotal 0.000000987654321 1E-10 -> 1
|
||||
ddcot586 comparetotal 0.000000987654321 1E-9 -> 1
|
||||
ddcot587 comparetotal 0.000000987654321 1E-8 -> 1
|
||||
ddcot588 comparetotal 0.000000987654321 1E-7 -> 1
|
||||
ddcot589 comparetotal 0.000000987654321 1E-6 -> -1
|
||||
ddcot590 comparetotal 0.000000987654321 1E-5 -> -1
|
||||
ddcot591 comparetotal 0.000000987654321 1E-4 -> -1
|
||||
ddcot592 comparetotal 0.000000987654321 1E-3 -> -1
|
||||
ddcot593 comparetotal 0.000000987654321 1E-2 -> -1
|
||||
ddcot594 comparetotal 0.000000987654321 1E-1 -> -1
|
||||
ddcot595 comparetotal 0.000000987654321 1E-0 -> -1
|
||||
ddcot596 comparetotal 0.000000987654321 1E+1 -> -1
|
||||
ddcot597 comparetotal 0.000000987654321 1E+2 -> -1
|
||||
ddcot598 comparetotal 0.000000987654321 1E+3 -> -1
|
||||
ddcot599 comparetotal 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
ddcot600 comparetotal 12 12.2345 -> -1
|
||||
ddcot601 comparetotal 12.0 12.2345 -> -1
|
||||
ddcot602 comparetotal 12.00 12.2345 -> -1
|
||||
ddcot603 comparetotal 12.000 12.2345 -> -1
|
||||
ddcot604 comparetotal 12.0000 12.2345 -> -1
|
||||
ddcot605 comparetotal 12.00000 12.2345 -> -1
|
||||
ddcot606 comparetotal 12.000000 12.2345 -> -1
|
||||
ddcot607 comparetotal 12.0000000 12.2345 -> -1
|
||||
ddcot608 comparetotal 12.00000000 12.2345 -> -1
|
||||
ddcot609 comparetotal 12.000000000 12.2345 -> -1
|
||||
ddcot610 comparetotal 12.1234 12 -> 1
|
||||
ddcot611 comparetotal 12.1234 12.0 -> 1
|
||||
ddcot612 comparetotal 12.1234 12.00 -> 1
|
||||
ddcot613 comparetotal 12.1234 12.000 -> 1
|
||||
ddcot614 comparetotal 12.1234 12.0000 -> 1
|
||||
ddcot615 comparetotal 12.1234 12.00000 -> 1
|
||||
ddcot616 comparetotal 12.1234 12.000000 -> 1
|
||||
ddcot617 comparetotal 12.1234 12.0000000 -> 1
|
||||
ddcot618 comparetotal 12.1234 12.00000000 -> 1
|
||||
ddcot619 comparetotal 12.1234 12.000000000 -> 1
|
||||
ddcot620 comparetotal -12 -12.2345 -> 1
|
||||
ddcot621 comparetotal -12.0 -12.2345 -> 1
|
||||
ddcot622 comparetotal -12.00 -12.2345 -> 1
|
||||
ddcot623 comparetotal -12.000 -12.2345 -> 1
|
||||
ddcot624 comparetotal -12.0000 -12.2345 -> 1
|
||||
ddcot625 comparetotal -12.00000 -12.2345 -> 1
|
||||
ddcot626 comparetotal -12.000000 -12.2345 -> 1
|
||||
ddcot627 comparetotal -12.0000000 -12.2345 -> 1
|
||||
ddcot628 comparetotal -12.00000000 -12.2345 -> 1
|
||||
ddcot629 comparetotal -12.000000000 -12.2345 -> 1
|
||||
ddcot630 comparetotal -12.1234 -12 -> -1
|
||||
ddcot631 comparetotal -12.1234 -12.0 -> -1
|
||||
ddcot632 comparetotal -12.1234 -12.00 -> -1
|
||||
ddcot633 comparetotal -12.1234 -12.000 -> -1
|
||||
ddcot634 comparetotal -12.1234 -12.0000 -> -1
|
||||
ddcot635 comparetotal -12.1234 -12.00000 -> -1
|
||||
ddcot636 comparetotal -12.1234 -12.000000 -> -1
|
||||
ddcot637 comparetotal -12.1234 -12.0000000 -> -1
|
||||
ddcot638 comparetotal -12.1234 -12.00000000 -> -1
|
||||
ddcot639 comparetotal -12.1234 -12.000000000 -> -1
|
||||
|
||||
-- extended zeros
|
||||
ddcot640 comparetotal 0 0 -> 0
|
||||
ddcot641 comparetotal 0 -0 -> 1
|
||||
ddcot642 comparetotal 0 -0.0 -> 1
|
||||
ddcot643 comparetotal 0 0.0 -> 1
|
||||
ddcot644 comparetotal -0 0 -> -1
|
||||
ddcot645 comparetotal -0 -0 -> 0
|
||||
ddcot646 comparetotal -0 -0.0 -> -1
|
||||
ddcot647 comparetotal -0 0.0 -> -1
|
||||
ddcot648 comparetotal 0.0 0 -> -1
|
||||
ddcot649 comparetotal 0.0 -0 -> 1
|
||||
ddcot650 comparetotal 0.0 -0.0 -> 1
|
||||
ddcot651 comparetotal 0.0 0.0 -> 0
|
||||
ddcot652 comparetotal -0.0 0 -> -1
|
||||
ddcot653 comparetotal -0.0 -0 -> 1
|
||||
ddcot654 comparetotal -0.0 -0.0 -> 0
|
||||
ddcot655 comparetotal -0.0 0.0 -> -1
|
||||
|
||||
ddcot656 comparetotal -0E1 0.0 -> -1
|
||||
ddcot657 comparetotal -0E2 0.0 -> -1
|
||||
ddcot658 comparetotal 0E1 0.0 -> 1
|
||||
ddcot659 comparetotal 0E2 0.0 -> 1
|
||||
ddcot660 comparetotal -0E1 0 -> -1
|
||||
ddcot661 comparetotal -0E2 0 -> -1
|
||||
ddcot662 comparetotal 0E1 0 -> 1
|
||||
ddcot663 comparetotal 0E2 0 -> 1
|
||||
ddcot664 comparetotal -0E1 -0E1 -> 0
|
||||
ddcot665 comparetotal -0E2 -0E1 -> -1
|
||||
ddcot666 comparetotal 0E1 -0E1 -> 1
|
||||
ddcot667 comparetotal 0E2 -0E1 -> 1
|
||||
ddcot668 comparetotal -0E1 -0E2 -> 1
|
||||
ddcot669 comparetotal -0E2 -0E2 -> 0
|
||||
ddcot670 comparetotal 0E1 -0E2 -> 1
|
||||
ddcot671 comparetotal 0E2 -0E2 -> 1
|
||||
ddcot672 comparetotal -0E1 0E1 -> -1
|
||||
ddcot673 comparetotal -0E2 0E1 -> -1
|
||||
ddcot674 comparetotal 0E1 0E1 -> 0
|
||||
ddcot675 comparetotal 0E2 0E1 -> 1
|
||||
ddcot676 comparetotal -0E1 0E2 -> -1
|
||||
ddcot677 comparetotal -0E2 0E2 -> -1
|
||||
ddcot678 comparetotal 0E1 0E2 -> -1
|
||||
ddcot679 comparetotal 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
ddcot680 comparetotal 12 12 -> 0
|
||||
ddcot681 comparetotal 12 12.0 -> 1
|
||||
ddcot682 comparetotal 12 12.00 -> 1
|
||||
ddcot683 comparetotal 12 12.000 -> 1
|
||||
ddcot684 comparetotal 12 12.0000 -> 1
|
||||
ddcot685 comparetotal 12 12.00000 -> 1
|
||||
ddcot686 comparetotal 12 12.000000 -> 1
|
||||
ddcot687 comparetotal 12 12.0000000 -> 1
|
||||
ddcot688 comparetotal 12 12.00000000 -> 1
|
||||
ddcot689 comparetotal 12 12.000000000 -> 1
|
||||
ddcot690 comparetotal 12 12 -> 0
|
||||
ddcot691 comparetotal 12.0 12 -> -1
|
||||
ddcot692 comparetotal 12.00 12 -> -1
|
||||
ddcot693 comparetotal 12.000 12 -> -1
|
||||
ddcot694 comparetotal 12.0000 12 -> -1
|
||||
ddcot695 comparetotal 12.00000 12 -> -1
|
||||
ddcot696 comparetotal 12.000000 12 -> -1
|
||||
ddcot697 comparetotal 12.0000000 12 -> -1
|
||||
ddcot698 comparetotal 12.00000000 12 -> -1
|
||||
ddcot699 comparetotal 12.000000000 12 -> -1
|
||||
|
||||
-- old long operand checks
|
||||
ddcot701 comparetotal 12345678000 1 -> 1
|
||||
ddcot702 comparetotal 1 12345678000 -> -1
|
||||
ddcot703 comparetotal 1234567800 1 -> 1
|
||||
ddcot704 comparetotal 1 1234567800 -> -1
|
||||
ddcot705 comparetotal 1234567890 1 -> 1
|
||||
ddcot706 comparetotal 1 1234567890 -> -1
|
||||
ddcot707 comparetotal 1234567891 1 -> 1
|
||||
ddcot708 comparetotal 1 1234567891 -> -1
|
||||
ddcot709 comparetotal 12345678901 1 -> 1
|
||||
ddcot710 comparetotal 1 12345678901 -> -1
|
||||
ddcot711 comparetotal 1234567896 1 -> 1
|
||||
ddcot712 comparetotal 1 1234567896 -> -1
|
||||
ddcot713 comparetotal -1234567891 1 -> -1
|
||||
ddcot714 comparetotal 1 -1234567891 -> 1
|
||||
ddcot715 comparetotal -12345678901 1 -> -1
|
||||
ddcot716 comparetotal 1 -12345678901 -> 1
|
||||
ddcot717 comparetotal -1234567896 1 -> -1
|
||||
ddcot718 comparetotal 1 -1234567896 -> 1
|
||||
|
||||
-- old residue cases
|
||||
ddcot740 comparetotal 1 0.9999999 -> 1
|
||||
ddcot741 comparetotal 1 0.999999 -> 1
|
||||
ddcot742 comparetotal 1 0.99999 -> 1
|
||||
ddcot743 comparetotal 1 1.0000 -> 1
|
||||
ddcot744 comparetotal 1 1.00001 -> -1
|
||||
ddcot745 comparetotal 1 1.000001 -> -1
|
||||
ddcot746 comparetotal 1 1.0000001 -> -1
|
||||
ddcot750 comparetotal 0.9999999 1 -> -1
|
||||
ddcot751 comparetotal 0.999999 1 -> -1
|
||||
ddcot752 comparetotal 0.99999 1 -> -1
|
||||
ddcot753 comparetotal 1.0000 1 -> -1
|
||||
ddcot754 comparetotal 1.00001 1 -> 1
|
||||
ddcot755 comparetotal 1.000001 1 -> 1
|
||||
ddcot756 comparetotal 1.0000001 1 -> 1
|
||||
|
||||
-- Specials
|
||||
ddcot780 comparetotal Inf -Inf -> 1
|
||||
ddcot781 comparetotal Inf -1000 -> 1
|
||||
ddcot782 comparetotal Inf -1 -> 1
|
||||
ddcot783 comparetotal Inf -0 -> 1
|
||||
ddcot784 comparetotal Inf 0 -> 1
|
||||
ddcot785 comparetotal Inf 1 -> 1
|
||||
ddcot786 comparetotal Inf 1000 -> 1
|
||||
ddcot787 comparetotal Inf Inf -> 0
|
||||
ddcot788 comparetotal -1000 Inf -> -1
|
||||
ddcot789 comparetotal -Inf Inf -> -1
|
||||
ddcot790 comparetotal -1 Inf -> -1
|
||||
ddcot791 comparetotal -0 Inf -> -1
|
||||
ddcot792 comparetotal 0 Inf -> -1
|
||||
ddcot793 comparetotal 1 Inf -> -1
|
||||
ddcot794 comparetotal 1000 Inf -> -1
|
||||
ddcot795 comparetotal Inf Inf -> 0
|
||||
|
||||
ddcot800 comparetotal -Inf -Inf -> 0
|
||||
ddcot801 comparetotal -Inf -1000 -> -1
|
||||
ddcot802 comparetotal -Inf -1 -> -1
|
||||
ddcot803 comparetotal -Inf -0 -> -1
|
||||
ddcot804 comparetotal -Inf 0 -> -1
|
||||
ddcot805 comparetotal -Inf 1 -> -1
|
||||
ddcot806 comparetotal -Inf 1000 -> -1
|
||||
ddcot807 comparetotal -Inf Inf -> -1
|
||||
ddcot808 comparetotal -Inf -Inf -> 0
|
||||
ddcot809 comparetotal -1000 -Inf -> 1
|
||||
ddcot810 comparetotal -1 -Inf -> 1
|
||||
ddcot811 comparetotal -0 -Inf -> 1
|
||||
ddcot812 comparetotal 0 -Inf -> 1
|
||||
ddcot813 comparetotal 1 -Inf -> 1
|
||||
ddcot814 comparetotal 1000 -Inf -> 1
|
||||
ddcot815 comparetotal Inf -Inf -> 1
|
||||
|
||||
ddcot821 comparetotal NaN -Inf -> 1
|
||||
ddcot822 comparetotal NaN -1000 -> 1
|
||||
ddcot823 comparetotal NaN -1 -> 1
|
||||
ddcot824 comparetotal NaN -0 -> 1
|
||||
ddcot825 comparetotal NaN 0 -> 1
|
||||
ddcot826 comparetotal NaN 1 -> 1
|
||||
ddcot827 comparetotal NaN 1000 -> 1
|
||||
ddcot828 comparetotal NaN Inf -> 1
|
||||
ddcot829 comparetotal NaN NaN -> 0
|
||||
ddcot830 comparetotal -Inf NaN -> -1
|
||||
ddcot831 comparetotal -1000 NaN -> -1
|
||||
ddcot832 comparetotal -1 NaN -> -1
|
||||
ddcot833 comparetotal -0 NaN -> -1
|
||||
ddcot834 comparetotal 0 NaN -> -1
|
||||
ddcot835 comparetotal 1 NaN -> -1
|
||||
ddcot836 comparetotal 1000 NaN -> -1
|
||||
ddcot837 comparetotal Inf NaN -> -1
|
||||
ddcot838 comparetotal -NaN -NaN -> 0
|
||||
ddcot839 comparetotal +NaN -NaN -> 1
|
||||
ddcot840 comparetotal -NaN +NaN -> -1
|
||||
|
||||
ddcot841 comparetotal sNaN -sNaN -> 1
|
||||
ddcot842 comparetotal sNaN -NaN -> 1
|
||||
ddcot843 comparetotal sNaN -Inf -> 1
|
||||
ddcot844 comparetotal sNaN -1000 -> 1
|
||||
ddcot845 comparetotal sNaN -1 -> 1
|
||||
ddcot846 comparetotal sNaN -0 -> 1
|
||||
ddcot847 comparetotal sNaN 0 -> 1
|
||||
ddcot848 comparetotal sNaN 1 -> 1
|
||||
ddcot849 comparetotal sNaN 1000 -> 1
|
||||
ddcot850 comparetotal sNaN NaN -> -1
|
||||
ddcot851 comparetotal sNaN sNaN -> 0
|
||||
|
||||
ddcot852 comparetotal -sNaN sNaN -> -1
|
||||
ddcot853 comparetotal -NaN sNaN -> -1
|
||||
ddcot854 comparetotal -Inf sNaN -> -1
|
||||
ddcot855 comparetotal -1000 sNaN -> -1
|
||||
ddcot856 comparetotal -1 sNaN -> -1
|
||||
ddcot857 comparetotal -0 sNaN -> -1
|
||||
ddcot858 comparetotal 0 sNaN -> -1
|
||||
ddcot859 comparetotal 1 sNaN -> -1
|
||||
ddcot860 comparetotal 1000 sNaN -> -1
|
||||
ddcot861 comparetotal Inf sNaN -> -1
|
||||
ddcot862 comparetotal NaN sNaN -> 1
|
||||
ddcot863 comparetotal sNaN sNaN -> 0
|
||||
|
||||
ddcot871 comparetotal -sNaN -sNaN -> 0
|
||||
ddcot872 comparetotal -sNaN -NaN -> 1
|
||||
ddcot873 comparetotal -sNaN -Inf -> -1
|
||||
ddcot874 comparetotal -sNaN -1000 -> -1
|
||||
ddcot875 comparetotal -sNaN -1 -> -1
|
||||
ddcot876 comparetotal -sNaN -0 -> -1
|
||||
ddcot877 comparetotal -sNaN 0 -> -1
|
||||
ddcot878 comparetotal -sNaN 1 -> -1
|
||||
ddcot879 comparetotal -sNaN 1000 -> -1
|
||||
ddcot880 comparetotal -sNaN NaN -> -1
|
||||
ddcot881 comparetotal -sNaN sNaN -> -1
|
||||
|
||||
ddcot882 comparetotal -sNaN -sNaN -> 0
|
||||
ddcot883 comparetotal -NaN -sNaN -> -1
|
||||
ddcot884 comparetotal -Inf -sNaN -> 1
|
||||
ddcot885 comparetotal -1000 -sNaN -> 1
|
||||
ddcot886 comparetotal -1 -sNaN -> 1
|
||||
ddcot887 comparetotal -0 -sNaN -> 1
|
||||
ddcot888 comparetotal 0 -sNaN -> 1
|
||||
ddcot889 comparetotal 1 -sNaN -> 1
|
||||
ddcot890 comparetotal 1000 -sNaN -> 1
|
||||
ddcot891 comparetotal Inf -sNaN -> 1
|
||||
ddcot892 comparetotal NaN -sNaN -> 1
|
||||
ddcot893 comparetotal sNaN -sNaN -> 1
|
||||
|
||||
-- NaNs with payload
|
||||
ddcot960 comparetotal NaN9 -Inf -> 1
|
||||
ddcot961 comparetotal NaN8 999 -> 1
|
||||
ddcot962 comparetotal NaN77 Inf -> 1
|
||||
ddcot963 comparetotal -NaN67 NaN5 -> -1
|
||||
ddcot964 comparetotal -Inf -NaN4 -> 1
|
||||
ddcot965 comparetotal -999 -NaN33 -> 1
|
||||
ddcot966 comparetotal Inf NaN2 -> -1
|
||||
|
||||
ddcot970 comparetotal -NaN41 -NaN42 -> 1
|
||||
ddcot971 comparetotal +NaN41 -NaN42 -> 1
|
||||
ddcot972 comparetotal -NaN41 +NaN42 -> -1
|
||||
ddcot973 comparetotal +NaN41 +NaN42 -> -1
|
||||
ddcot974 comparetotal -NaN42 -NaN01 -> -1
|
||||
ddcot975 comparetotal +NaN42 -NaN01 -> 1
|
||||
ddcot976 comparetotal -NaN42 +NaN01 -> -1
|
||||
ddcot977 comparetotal +NaN42 +NaN01 -> 1
|
||||
|
||||
ddcot980 comparetotal -sNaN771 -sNaN772 -> 1
|
||||
ddcot981 comparetotal +sNaN771 -sNaN772 -> 1
|
||||
ddcot982 comparetotal -sNaN771 +sNaN772 -> -1
|
||||
ddcot983 comparetotal +sNaN771 +sNaN772 -> -1
|
||||
ddcot984 comparetotal -sNaN772 -sNaN771 -> -1
|
||||
ddcot985 comparetotal +sNaN772 -sNaN771 -> 1
|
||||
ddcot986 comparetotal -sNaN772 +sNaN771 -> -1
|
||||
ddcot987 comparetotal +sNaN772 +sNaN771 -> 1
|
||||
|
||||
ddcot991 comparetotal -sNaN99 -Inf -> -1
|
||||
ddcot992 comparetotal sNaN98 -11 -> 1
|
||||
ddcot993 comparetotal sNaN97 NaN -> -1
|
||||
ddcot994 comparetotal sNaN16 sNaN94 -> -1
|
||||
ddcot995 comparetotal NaN85 sNaN83 -> 1
|
||||
ddcot996 comparetotal -Inf sNaN92 -> -1
|
||||
ddcot997 comparetotal 088 sNaN81 -> -1
|
||||
ddcot998 comparetotal Inf sNaN90 -> -1
|
||||
ddcot999 comparetotal NaN -sNaN89 -> 1
|
||||
|
||||
-- spread zeros
|
||||
ddcot1110 comparetotal 0E-383 0 -> -1
|
||||
ddcot1111 comparetotal 0E-383 -0 -> 1
|
||||
ddcot1112 comparetotal -0E-383 0 -> -1
|
||||
ddcot1113 comparetotal -0E-383 -0 -> 1
|
||||
ddcot1114 comparetotal 0E-383 0E+384 -> -1
|
||||
ddcot1115 comparetotal 0E-383 -0E+384 -> 1
|
||||
ddcot1116 comparetotal -0E-383 0E+384 -> -1
|
||||
ddcot1117 comparetotal -0E-383 -0E+384 -> 1
|
||||
ddcot1118 comparetotal 0 0E+384 -> -1
|
||||
ddcot1119 comparetotal 0 -0E+384 -> 1
|
||||
ddcot1120 comparetotal -0 0E+384 -> -1
|
||||
ddcot1121 comparetotal -0 -0E+384 -> 1
|
||||
|
||||
ddcot1130 comparetotal 0E+384 0 -> 1
|
||||
ddcot1131 comparetotal 0E+384 -0 -> 1
|
||||
ddcot1132 comparetotal -0E+384 0 -> -1
|
||||
ddcot1133 comparetotal -0E+384 -0 -> -1
|
||||
ddcot1134 comparetotal 0E+384 0E-383 -> 1
|
||||
ddcot1135 comparetotal 0E+384 -0E-383 -> 1
|
||||
ddcot1136 comparetotal -0E+384 0E-383 -> -1
|
||||
ddcot1137 comparetotal -0E+384 -0E-383 -> -1
|
||||
ddcot1138 comparetotal 0 0E-383 -> 1
|
||||
ddcot1139 comparetotal 0 -0E-383 -> 1
|
||||
ddcot1140 comparetotal -0 0E-383 -> -1
|
||||
ddcot1141 comparetotal -0 -0E-383 -> -1
|
||||
|
||||
-- Null tests
|
||||
ddcot9990 comparetotal 10 # -> NaN Invalid_operation
|
||||
ddcot9991 comparetotal # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,706 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--
|
||||
-- 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
|
||||
|
||||
-- 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 necessary).
|
||||
-- Similarly, comparetotal will have some radically different paths
|
||||
-- than compare.
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddctm001 comparetotmag -2 -2 -> 0
|
||||
ddctm002 comparetotmag -2 -1 -> 1
|
||||
ddctm003 comparetotmag -2 0 -> 1
|
||||
ddctm004 comparetotmag -2 1 -> 1
|
||||
ddctm005 comparetotmag -2 2 -> 0
|
||||
ddctm006 comparetotmag -1 -2 -> -1
|
||||
ddctm007 comparetotmag -1 -1 -> 0
|
||||
ddctm008 comparetotmag -1 0 -> 1
|
||||
ddctm009 comparetotmag -1 1 -> 0
|
||||
ddctm010 comparetotmag -1 2 -> -1
|
||||
ddctm011 comparetotmag 0 -2 -> -1
|
||||
ddctm012 comparetotmag 0 -1 -> -1
|
||||
ddctm013 comparetotmag 0 0 -> 0
|
||||
ddctm014 comparetotmag 0 1 -> -1
|
||||
ddctm015 comparetotmag 0 2 -> -1
|
||||
ddctm016 comparetotmag 1 -2 -> -1
|
||||
ddctm017 comparetotmag 1 -1 -> 0
|
||||
ddctm018 comparetotmag 1 0 -> 1
|
||||
ddctm019 comparetotmag 1 1 -> 0
|
||||
ddctm020 comparetotmag 1 2 -> -1
|
||||
ddctm021 comparetotmag 2 -2 -> 0
|
||||
ddctm022 comparetotmag 2 -1 -> 1
|
||||
ddctm023 comparetotmag 2 0 -> 1
|
||||
ddctm025 comparetotmag 2 1 -> 1
|
||||
ddctm026 comparetotmag 2 2 -> 0
|
||||
|
||||
ddctm031 comparetotmag -20 -20 -> 0
|
||||
ddctm032 comparetotmag -20 -10 -> 1
|
||||
ddctm033 comparetotmag -20 00 -> 1
|
||||
ddctm034 comparetotmag -20 10 -> 1
|
||||
ddctm035 comparetotmag -20 20 -> 0
|
||||
ddctm036 comparetotmag -10 -20 -> -1
|
||||
ddctm037 comparetotmag -10 -10 -> 0
|
||||
ddctm038 comparetotmag -10 00 -> 1
|
||||
ddctm039 comparetotmag -10 10 -> 0
|
||||
ddctm040 comparetotmag -10 20 -> -1
|
||||
ddctm041 comparetotmag 00 -20 -> -1
|
||||
ddctm042 comparetotmag 00 -10 -> -1
|
||||
ddctm043 comparetotmag 00 00 -> 0
|
||||
ddctm044 comparetotmag 00 10 -> -1
|
||||
ddctm045 comparetotmag 00 20 -> -1
|
||||
ddctm046 comparetotmag 10 -20 -> -1
|
||||
ddctm047 comparetotmag 10 -10 -> 0
|
||||
ddctm048 comparetotmag 10 00 -> 1
|
||||
ddctm049 comparetotmag 10 10 -> 0
|
||||
ddctm050 comparetotmag 10 20 -> -1
|
||||
ddctm051 comparetotmag 20 -20 -> 0
|
||||
ddctm052 comparetotmag 20 -10 -> 1
|
||||
ddctm053 comparetotmag 20 00 -> 1
|
||||
ddctm055 comparetotmag 20 10 -> 1
|
||||
ddctm056 comparetotmag 20 20 -> 0
|
||||
|
||||
ddctm061 comparetotmag -2.0 -2.0 -> 0
|
||||
ddctm062 comparetotmag -2.0 -1.0 -> 1
|
||||
ddctm063 comparetotmag -2.0 0.0 -> 1
|
||||
ddctm064 comparetotmag -2.0 1.0 -> 1
|
||||
ddctm065 comparetotmag -2.0 2.0 -> 0
|
||||
ddctm066 comparetotmag -1.0 -2.0 -> -1
|
||||
ddctm067 comparetotmag -1.0 -1.0 -> 0
|
||||
ddctm068 comparetotmag -1.0 0.0 -> 1
|
||||
ddctm069 comparetotmag -1.0 1.0 -> 0
|
||||
ddctm070 comparetotmag -1.0 2.0 -> -1
|
||||
ddctm071 comparetotmag 0.0 -2.0 -> -1
|
||||
ddctm072 comparetotmag 0.0 -1.0 -> -1
|
||||
ddctm073 comparetotmag 0.0 0.0 -> 0
|
||||
ddctm074 comparetotmag 0.0 1.0 -> -1
|
||||
ddctm075 comparetotmag 0.0 2.0 -> -1
|
||||
ddctm076 comparetotmag 1.0 -2.0 -> -1
|
||||
ddctm077 comparetotmag 1.0 -1.0 -> 0
|
||||
ddctm078 comparetotmag 1.0 0.0 -> 1
|
||||
ddctm079 comparetotmag 1.0 1.0 -> 0
|
||||
ddctm080 comparetotmag 1.0 2.0 -> -1
|
||||
ddctm081 comparetotmag 2.0 -2.0 -> 0
|
||||
ddctm082 comparetotmag 2.0 -1.0 -> 1
|
||||
ddctm083 comparetotmag 2.0 0.0 -> 1
|
||||
ddctm085 comparetotmag 2.0 1.0 -> 1
|
||||
ddctm086 comparetotmag 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0
|
||||
ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0
|
||||
ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0
|
||||
ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
-- in this first group, compare would compare all equal
|
||||
ddctm100 comparetotmag 7.0 7.0 -> 0
|
||||
ddctm101 comparetotmag 7.0 7 -> -1
|
||||
ddctm102 comparetotmag 7 7.0 -> 1
|
||||
ddctm103 comparetotmag 7E+0 7.0 -> 1
|
||||
ddctm104 comparetotmag 70E-1 7.0 -> 0
|
||||
ddctm105 comparetotmag 0.7E+1 7 -> 0
|
||||
ddctm106 comparetotmag 70E-1 7 -> -1
|
||||
ddctm107 comparetotmag 7.0 7E+0 -> -1
|
||||
ddctm108 comparetotmag 7.0 70E-1 -> 0
|
||||
ddctm109 comparetotmag 7 0.7E+1 -> 0
|
||||
ddctm110 comparetotmag 7 70E-1 -> 1
|
||||
|
||||
ddctm120 comparetotmag 8.0 7.0 -> 1
|
||||
ddctm121 comparetotmag 8.0 7 -> 1
|
||||
ddctm122 comparetotmag 8 7.0 -> 1
|
||||
ddctm123 comparetotmag 8E+0 7.0 -> 1
|
||||
ddctm124 comparetotmag 80E-1 7.0 -> 1
|
||||
ddctm125 comparetotmag 0.8E+1 7 -> 1
|
||||
ddctm126 comparetotmag 80E-1 7 -> 1
|
||||
ddctm127 comparetotmag 8.0 7E+0 -> 1
|
||||
ddctm128 comparetotmag 8.0 70E-1 -> 1
|
||||
ddctm129 comparetotmag 8 0.7E+1 -> 1
|
||||
ddctm130 comparetotmag 8 70E-1 -> 1
|
||||
|
||||
ddctm140 comparetotmag 8.0 9.0 -> -1
|
||||
ddctm141 comparetotmag 8.0 9 -> -1
|
||||
ddctm142 comparetotmag 8 9.0 -> -1
|
||||
ddctm143 comparetotmag 8E+0 9.0 -> -1
|
||||
ddctm144 comparetotmag 80E-1 9.0 -> -1
|
||||
ddctm145 comparetotmag 0.8E+1 9 -> -1
|
||||
ddctm146 comparetotmag 80E-1 9 -> -1
|
||||
ddctm147 comparetotmag 8.0 9E+0 -> -1
|
||||
ddctm148 comparetotmag 8.0 90E-1 -> -1
|
||||
ddctm149 comparetotmag 8 0.9E+1 -> -1
|
||||
ddctm150 comparetotmag 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
ddctm200 comparetotmag -7.0 7.0 -> 0
|
||||
ddctm201 comparetotmag -7.0 7 -> -1
|
||||
ddctm202 comparetotmag -7 7.0 -> 1
|
||||
ddctm203 comparetotmag -7E+0 7.0 -> 1
|
||||
ddctm204 comparetotmag -70E-1 7.0 -> 0
|
||||
ddctm205 comparetotmag -0.7E+1 7 -> 0
|
||||
ddctm206 comparetotmag -70E-1 7 -> -1
|
||||
ddctm207 comparetotmag -7.0 7E+0 -> -1
|
||||
ddctm208 comparetotmag -7.0 70E-1 -> 0
|
||||
ddctm209 comparetotmag -7 0.7E+1 -> 0
|
||||
ddctm210 comparetotmag -7 70E-1 -> 1
|
||||
|
||||
ddctm220 comparetotmag -8.0 7.0 -> 1
|
||||
ddctm221 comparetotmag -8.0 7 -> 1
|
||||
ddctm222 comparetotmag -8 7.0 -> 1
|
||||
ddctm223 comparetotmag -8E+0 7.0 -> 1
|
||||
ddctm224 comparetotmag -80E-1 7.0 -> 1
|
||||
ddctm225 comparetotmag -0.8E+1 7 -> 1
|
||||
ddctm226 comparetotmag -80E-1 7 -> 1
|
||||
ddctm227 comparetotmag -8.0 7E+0 -> 1
|
||||
ddctm228 comparetotmag -8.0 70E-1 -> 1
|
||||
ddctm229 comparetotmag -8 0.7E+1 -> 1
|
||||
ddctm230 comparetotmag -8 70E-1 -> 1
|
||||
|
||||
ddctm240 comparetotmag -8.0 9.0 -> -1
|
||||
ddctm241 comparetotmag -8.0 9 -> -1
|
||||
ddctm242 comparetotmag -8 9.0 -> -1
|
||||
ddctm243 comparetotmag -8E+0 9.0 -> -1
|
||||
ddctm244 comparetotmag -80E-1 9.0 -> -1
|
||||
ddctm245 comparetotmag -0.8E+1 9 -> -1
|
||||
ddctm246 comparetotmag -80E-1 9 -> -1
|
||||
ddctm247 comparetotmag -8.0 9E+0 -> -1
|
||||
ddctm248 comparetotmag -8.0 90E-1 -> -1
|
||||
ddctm249 comparetotmag -8 0.9E+1 -> -1
|
||||
ddctm250 comparetotmag -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
ddctm300 comparetotmag 7.0 -7.0 -> 0
|
||||
ddctm301 comparetotmag 7.0 -7 -> -1
|
||||
ddctm302 comparetotmag 7 -7.0 -> 1
|
||||
ddctm303 comparetotmag 7E+0 -7.0 -> 1
|
||||
ddctm304 comparetotmag 70E-1 -7.0 -> 0
|
||||
ddctm305 comparetotmag .7E+1 -7 -> 0
|
||||
ddctm306 comparetotmag 70E-1 -7 -> -1
|
||||
ddctm307 comparetotmag 7.0 -7E+0 -> -1
|
||||
ddctm308 comparetotmag 7.0 -70E-1 -> 0
|
||||
ddctm309 comparetotmag 7 -.7E+1 -> 0
|
||||
ddctm310 comparetotmag 7 -70E-1 -> 1
|
||||
|
||||
ddctm320 comparetotmag 8.0 -7.0 -> 1
|
||||
ddctm321 comparetotmag 8.0 -7 -> 1
|
||||
ddctm322 comparetotmag 8 -7.0 -> 1
|
||||
ddctm323 comparetotmag 8E+0 -7.0 -> 1
|
||||
ddctm324 comparetotmag 80E-1 -7.0 -> 1
|
||||
ddctm325 comparetotmag .8E+1 -7 -> 1
|
||||
ddctm326 comparetotmag 80E-1 -7 -> 1
|
||||
ddctm327 comparetotmag 8.0 -7E+0 -> 1
|
||||
ddctm328 comparetotmag 8.0 -70E-1 -> 1
|
||||
ddctm329 comparetotmag 8 -.7E+1 -> 1
|
||||
ddctm330 comparetotmag 8 -70E-1 -> 1
|
||||
|
||||
ddctm340 comparetotmag 8.0 -9.0 -> -1
|
||||
ddctm341 comparetotmag 8.0 -9 -> -1
|
||||
ddctm342 comparetotmag 8 -9.0 -> -1
|
||||
ddctm343 comparetotmag 8E+0 -9.0 -> -1
|
||||
ddctm344 comparetotmag 80E-1 -9.0 -> -1
|
||||
ddctm345 comparetotmag .8E+1 -9 -> -1
|
||||
ddctm346 comparetotmag 80E-1 -9 -> -1
|
||||
ddctm347 comparetotmag 8.0 -9E+0 -> -1
|
||||
ddctm348 comparetotmag 8.0 -90E-1 -> -1
|
||||
ddctm349 comparetotmag 8 -.9E+1 -> -1
|
||||
ddctm350 comparetotmag 8 -90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
ddctm400 comparetotmag -7.0 -7.0 -> 0
|
||||
ddctm401 comparetotmag -7.0 -7 -> -1
|
||||
ddctm402 comparetotmag -7 -7.0 -> 1
|
||||
ddctm403 comparetotmag -7E+0 -7.0 -> 1
|
||||
ddctm404 comparetotmag -70E-1 -7.0 -> 0
|
||||
ddctm405 comparetotmag -.7E+1 -7 -> 0
|
||||
ddctm406 comparetotmag -70E-1 -7 -> -1
|
||||
ddctm407 comparetotmag -7.0 -7E+0 -> -1
|
||||
ddctm408 comparetotmag -7.0 -70E-1 -> 0
|
||||
ddctm409 comparetotmag -7 -.7E+1 -> 0
|
||||
ddctm410 comparetotmag -7 -70E-1 -> 1
|
||||
|
||||
ddctm420 comparetotmag -8.0 -7.0 -> 1
|
||||
ddctm421 comparetotmag -8.0 -7 -> 1
|
||||
ddctm422 comparetotmag -8 -7.0 -> 1
|
||||
ddctm423 comparetotmag -8E+0 -7.0 -> 1
|
||||
ddctm424 comparetotmag -80E-1 -7.0 -> 1
|
||||
ddctm425 comparetotmag -.8E+1 -7 -> 1
|
||||
ddctm426 comparetotmag -80E-1 -7 -> 1
|
||||
ddctm427 comparetotmag -8.0 -7E+0 -> 1
|
||||
ddctm428 comparetotmag -8.0 -70E-1 -> 1
|
||||
ddctm429 comparetotmag -8 -.7E+1 -> 1
|
||||
ddctm430 comparetotmag -8 -70E-1 -> 1
|
||||
|
||||
ddctm440 comparetotmag -8.0 -9.0 -> -1
|
||||
ddctm441 comparetotmag -8.0 -9 -> -1
|
||||
ddctm442 comparetotmag -8 -9.0 -> -1
|
||||
ddctm443 comparetotmag -8E+0 -9.0 -> -1
|
||||
ddctm444 comparetotmag -80E-1 -9.0 -> -1
|
||||
ddctm445 comparetotmag -.8E+1 -9 -> -1
|
||||
ddctm446 comparetotmag -80E-1 -9 -> -1
|
||||
ddctm447 comparetotmag -8.0 -9E+0 -> -1
|
||||
ddctm448 comparetotmag -8.0 -90E-1 -> -1
|
||||
ddctm449 comparetotmag -8 -.9E+1 -> -1
|
||||
ddctm450 comparetotmag -8 -90E-1 -> -1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
|
||||
ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
|
||||
ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
|
||||
ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
|
||||
ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
|
||||
ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
|
||||
ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
|
||||
ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
|
||||
ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
|
||||
ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
|
||||
ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
|
||||
ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
|
||||
ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
|
||||
ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
|
||||
ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
|
||||
ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
|
||||
ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
|
||||
ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
|
||||
ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
|
||||
ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
|
||||
ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
|
||||
ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
ddctm498 comparetotmag 1 1E-17 -> 1
|
||||
ddctm499 comparetotmag 1 1E-16 -> 1
|
||||
ddctm500 comparetotmag 1 1E-15 -> 1
|
||||
ddctm501 comparetotmag 1 1E-14 -> 1
|
||||
ddctm502 comparetotmag 1 1E-13 -> 1
|
||||
ddctm503 comparetotmag 1 1E-12 -> 1
|
||||
ddctm504 comparetotmag 1 1E-11 -> 1
|
||||
ddctm505 comparetotmag 1 1E-10 -> 1
|
||||
ddctm506 comparetotmag 1 1E-9 -> 1
|
||||
ddctm507 comparetotmag 1 1E-8 -> 1
|
||||
ddctm508 comparetotmag 1 1E-7 -> 1
|
||||
ddctm509 comparetotmag 1 1E-6 -> 1
|
||||
ddctm510 comparetotmag 1 1E-5 -> 1
|
||||
ddctm511 comparetotmag 1 1E-4 -> 1
|
||||
ddctm512 comparetotmag 1 1E-3 -> 1
|
||||
ddctm513 comparetotmag 1 1E-2 -> 1
|
||||
ddctm514 comparetotmag 1 1E-1 -> 1
|
||||
ddctm515 comparetotmag 1 1E-0 -> 0
|
||||
ddctm516 comparetotmag 1 1E+1 -> -1
|
||||
ddctm517 comparetotmag 1 1E+2 -> -1
|
||||
ddctm518 comparetotmag 1 1E+3 -> -1
|
||||
ddctm519 comparetotmag 1 1E+4 -> -1
|
||||
ddctm521 comparetotmag 1 1E+5 -> -1
|
||||
ddctm522 comparetotmag 1 1E+6 -> -1
|
||||
ddctm523 comparetotmag 1 1E+7 -> -1
|
||||
ddctm524 comparetotmag 1 1E+8 -> -1
|
||||
ddctm525 comparetotmag 1 1E+9 -> -1
|
||||
ddctm526 comparetotmag 1 1E+10 -> -1
|
||||
ddctm527 comparetotmag 1 1E+11 -> -1
|
||||
ddctm528 comparetotmag 1 1E+12 -> -1
|
||||
ddctm529 comparetotmag 1 1E+13 -> -1
|
||||
ddctm530 comparetotmag 1 1E+14 -> -1
|
||||
ddctm531 comparetotmag 1 1E+15 -> -1
|
||||
ddctm532 comparetotmag 1 1E+16 -> -1
|
||||
ddctm533 comparetotmag 1 1E+17 -> -1
|
||||
-- LR swap
|
||||
ddctm538 comparetotmag 1E-17 1 -> -1
|
||||
ddctm539 comparetotmag 1E-16 1 -> -1
|
||||
ddctm540 comparetotmag 1E-15 1 -> -1
|
||||
ddctm541 comparetotmag 1E-14 1 -> -1
|
||||
ddctm542 comparetotmag 1E-13 1 -> -1
|
||||
ddctm543 comparetotmag 1E-12 1 -> -1
|
||||
ddctm544 comparetotmag 1E-11 1 -> -1
|
||||
ddctm545 comparetotmag 1E-10 1 -> -1
|
||||
ddctm546 comparetotmag 1E-9 1 -> -1
|
||||
ddctm547 comparetotmag 1E-8 1 -> -1
|
||||
ddctm548 comparetotmag 1E-7 1 -> -1
|
||||
ddctm549 comparetotmag 1E-6 1 -> -1
|
||||
ddctm550 comparetotmag 1E-5 1 -> -1
|
||||
ddctm551 comparetotmag 1E-4 1 -> -1
|
||||
ddctm552 comparetotmag 1E-3 1 -> -1
|
||||
ddctm553 comparetotmag 1E-2 1 -> -1
|
||||
ddctm554 comparetotmag 1E-1 1 -> -1
|
||||
ddctm555 comparetotmag 1E-0 1 -> 0
|
||||
ddctm556 comparetotmag 1E+1 1 -> 1
|
||||
ddctm557 comparetotmag 1E+2 1 -> 1
|
||||
ddctm558 comparetotmag 1E+3 1 -> 1
|
||||
ddctm559 comparetotmag 1E+4 1 -> 1
|
||||
ddctm561 comparetotmag 1E+5 1 -> 1
|
||||
ddctm562 comparetotmag 1E+6 1 -> 1
|
||||
ddctm563 comparetotmag 1E+7 1 -> 1
|
||||
ddctm564 comparetotmag 1E+8 1 -> 1
|
||||
ddctm565 comparetotmag 1E+9 1 -> 1
|
||||
ddctm566 comparetotmag 1E+10 1 -> 1
|
||||
ddctm567 comparetotmag 1E+11 1 -> 1
|
||||
ddctm568 comparetotmag 1E+12 1 -> 1
|
||||
ddctm569 comparetotmag 1E+13 1 -> 1
|
||||
ddctm570 comparetotmag 1E+14 1 -> 1
|
||||
ddctm571 comparetotmag 1E+15 1 -> 1
|
||||
ddctm572 comparetotmag 1E+16 1 -> 1
|
||||
ddctm573 comparetotmag 1E+17 1 -> 1
|
||||
-- similar with a useful coefficient, one side only
|
||||
ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1
|
||||
ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1
|
||||
ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1
|
||||
ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1
|
||||
ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1
|
||||
ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1
|
||||
ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1
|
||||
ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1
|
||||
ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1
|
||||
ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1
|
||||
ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1
|
||||
ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1
|
||||
ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1
|
||||
ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1
|
||||
ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1
|
||||
ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1
|
||||
ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1
|
||||
ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1
|
||||
ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1
|
||||
ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1
|
||||
ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1
|
||||
ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
ddctm600 comparetotmag 12 12.2345 -> -1
|
||||
ddctm601 comparetotmag 12.0 12.2345 -> -1
|
||||
ddctm602 comparetotmag 12.00 12.2345 -> -1
|
||||
ddctm603 comparetotmag 12.000 12.2345 -> -1
|
||||
ddctm604 comparetotmag 12.0000 12.2345 -> -1
|
||||
ddctm605 comparetotmag 12.00000 12.2345 -> -1
|
||||
ddctm606 comparetotmag 12.000000 12.2345 -> -1
|
||||
ddctm607 comparetotmag 12.0000000 12.2345 -> -1
|
||||
ddctm608 comparetotmag 12.00000000 12.2345 -> -1
|
||||
ddctm609 comparetotmag 12.000000000 12.2345 -> -1
|
||||
ddctm610 comparetotmag 12.1234 12 -> 1
|
||||
ddctm611 comparetotmag 12.1234 12.0 -> 1
|
||||
ddctm612 comparetotmag 12.1234 12.00 -> 1
|
||||
ddctm613 comparetotmag 12.1234 12.000 -> 1
|
||||
ddctm614 comparetotmag 12.1234 12.0000 -> 1
|
||||
ddctm615 comparetotmag 12.1234 12.00000 -> 1
|
||||
ddctm616 comparetotmag 12.1234 12.000000 -> 1
|
||||
ddctm617 comparetotmag 12.1234 12.0000000 -> 1
|
||||
ddctm618 comparetotmag 12.1234 12.00000000 -> 1
|
||||
ddctm619 comparetotmag 12.1234 12.000000000 -> 1
|
||||
ddctm620 comparetotmag -12 -12.2345 -> -1
|
||||
ddctm621 comparetotmag -12.0 -12.2345 -> -1
|
||||
ddctm622 comparetotmag -12.00 -12.2345 -> -1
|
||||
ddctm623 comparetotmag -12.000 -12.2345 -> -1
|
||||
ddctm624 comparetotmag -12.0000 -12.2345 -> -1
|
||||
ddctm625 comparetotmag -12.00000 -12.2345 -> -1
|
||||
ddctm626 comparetotmag -12.000000 -12.2345 -> -1
|
||||
ddctm627 comparetotmag -12.0000000 -12.2345 -> -1
|
||||
ddctm628 comparetotmag -12.00000000 -12.2345 -> -1
|
||||
ddctm629 comparetotmag -12.000000000 -12.2345 -> -1
|
||||
ddctm630 comparetotmag -12.1234 -12 -> 1
|
||||
ddctm631 comparetotmag -12.1234 -12.0 -> 1
|
||||
ddctm632 comparetotmag -12.1234 -12.00 -> 1
|
||||
ddctm633 comparetotmag -12.1234 -12.000 -> 1
|
||||
ddctm634 comparetotmag -12.1234 -12.0000 -> 1
|
||||
ddctm635 comparetotmag -12.1234 -12.00000 -> 1
|
||||
ddctm636 comparetotmag -12.1234 -12.000000 -> 1
|
||||
ddctm637 comparetotmag -12.1234 -12.0000000 -> 1
|
||||
ddctm638 comparetotmag -12.1234 -12.00000000 -> 1
|
||||
ddctm639 comparetotmag -12.1234 -12.000000000 -> 1
|
||||
|
||||
-- extended zeros
|
||||
ddctm640 comparetotmag 0 0 -> 0
|
||||
ddctm641 comparetotmag 0 -0 -> 0
|
||||
ddctm642 comparetotmag 0 -0.0 -> 1
|
||||
ddctm643 comparetotmag 0 0.0 -> 1
|
||||
ddctm644 comparetotmag -0 0 -> 0
|
||||
ddctm645 comparetotmag -0 -0 -> 0
|
||||
ddctm646 comparetotmag -0 -0.0 -> 1
|
||||
ddctm647 comparetotmag -0 0.0 -> 1
|
||||
ddctm648 comparetotmag 0.0 0 -> -1
|
||||
ddctm649 comparetotmag 0.0 -0 -> -1
|
||||
ddctm650 comparetotmag 0.0 -0.0 -> 0
|
||||
ddctm651 comparetotmag 0.0 0.0 -> 0
|
||||
ddctm652 comparetotmag -0.0 0 -> -1
|
||||
ddctm653 comparetotmag -0.0 -0 -> -1
|
||||
ddctm654 comparetotmag -0.0 -0.0 -> 0
|
||||
ddctm655 comparetotmag -0.0 0.0 -> 0
|
||||
|
||||
ddctm656 comparetotmag -0E1 0.0 -> 1
|
||||
ddctm657 comparetotmag -0E2 0.0 -> 1
|
||||
ddctm658 comparetotmag 0E1 0.0 -> 1
|
||||
ddctm659 comparetotmag 0E2 0.0 -> 1
|
||||
ddctm660 comparetotmag -0E1 0 -> 1
|
||||
ddctm661 comparetotmag -0E2 0 -> 1
|
||||
ddctm662 comparetotmag 0E1 0 -> 1
|
||||
ddctm663 comparetotmag 0E2 0 -> 1
|
||||
ddctm664 comparetotmag -0E1 -0E1 -> 0
|
||||
ddctm665 comparetotmag -0E2 -0E1 -> 1
|
||||
ddctm666 comparetotmag 0E1 -0E1 -> 0
|
||||
ddctm667 comparetotmag 0E2 -0E1 -> 1
|
||||
ddctm668 comparetotmag -0E1 -0E2 -> -1
|
||||
ddctm669 comparetotmag -0E2 -0E2 -> 0
|
||||
ddctm670 comparetotmag 0E1 -0E2 -> -1
|
||||
ddctm671 comparetotmag 0E2 -0E2 -> 0
|
||||
ddctm672 comparetotmag -0E1 0E1 -> 0
|
||||
ddctm673 comparetotmag -0E2 0E1 -> 1
|
||||
ddctm674 comparetotmag 0E1 0E1 -> 0
|
||||
ddctm675 comparetotmag 0E2 0E1 -> 1
|
||||
ddctm676 comparetotmag -0E1 0E2 -> -1
|
||||
ddctm677 comparetotmag -0E2 0E2 -> 0
|
||||
ddctm678 comparetotmag 0E1 0E2 -> -1
|
||||
ddctm679 comparetotmag 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
ddctm680 comparetotmag 12 12 -> 0
|
||||
ddctm681 comparetotmag 12 12.0 -> 1
|
||||
ddctm682 comparetotmag 12 12.00 -> 1
|
||||
ddctm683 comparetotmag 12 12.000 -> 1
|
||||
ddctm684 comparetotmag 12 12.0000 -> 1
|
||||
ddctm685 comparetotmag 12 12.00000 -> 1
|
||||
ddctm686 comparetotmag 12 12.000000 -> 1
|
||||
ddctm687 comparetotmag 12 12.0000000 -> 1
|
||||
ddctm688 comparetotmag 12 12.00000000 -> 1
|
||||
ddctm689 comparetotmag 12 12.000000000 -> 1
|
||||
ddctm690 comparetotmag 12 12 -> 0
|
||||
ddctm691 comparetotmag 12.0 12 -> -1
|
||||
ddctm692 comparetotmag 12.00 12 -> -1
|
||||
ddctm693 comparetotmag 12.000 12 -> -1
|
||||
ddctm694 comparetotmag 12.0000 12 -> -1
|
||||
ddctm695 comparetotmag 12.00000 12 -> -1
|
||||
ddctm696 comparetotmag 12.000000 12 -> -1
|
||||
ddctm697 comparetotmag 12.0000000 12 -> -1
|
||||
ddctm698 comparetotmag 12.00000000 12 -> -1
|
||||
ddctm699 comparetotmag 12.000000000 12 -> -1
|
||||
|
||||
-- old long operand checks
|
||||
ddctm701 comparetotmag 12345678000 1 -> 1
|
||||
ddctm702 comparetotmag 1 12345678000 -> -1
|
||||
ddctm703 comparetotmag 1234567800 1 -> 1
|
||||
ddctm704 comparetotmag 1 1234567800 -> -1
|
||||
ddctm705 comparetotmag 1234567890 1 -> 1
|
||||
ddctm706 comparetotmag 1 1234567890 -> -1
|
||||
ddctm707 comparetotmag 1234567891 1 -> 1
|
||||
ddctm708 comparetotmag 1 1234567891 -> -1
|
||||
ddctm709 comparetotmag 12345678901 1 -> 1
|
||||
ddctm710 comparetotmag 1 12345678901 -> -1
|
||||
ddctm711 comparetotmag 1234567896 1 -> 1
|
||||
ddctm712 comparetotmag 1 1234567896 -> -1
|
||||
ddctm713 comparetotmag -1234567891 1 -> 1
|
||||
ddctm714 comparetotmag 1 -1234567891 -> -1
|
||||
ddctm715 comparetotmag -12345678901 1 -> 1
|
||||
ddctm716 comparetotmag 1 -12345678901 -> -1
|
||||
ddctm717 comparetotmag -1234567896 1 -> 1
|
||||
ddctm718 comparetotmag 1 -1234567896 -> -1
|
||||
|
||||
-- old residue cases
|
||||
ddctm740 comparetotmag 1 0.9999999 -> 1
|
||||
ddctm741 comparetotmag 1 0.999999 -> 1
|
||||
ddctm742 comparetotmag 1 0.99999 -> 1
|
||||
ddctm743 comparetotmag 1 1.0000 -> 1
|
||||
ddctm744 comparetotmag 1 1.00001 -> -1
|
||||
ddctm745 comparetotmag 1 1.000001 -> -1
|
||||
ddctm746 comparetotmag 1 1.0000001 -> -1
|
||||
ddctm750 comparetotmag 0.9999999 1 -> -1
|
||||
ddctm751 comparetotmag 0.999999 1 -> -1
|
||||
ddctm752 comparetotmag 0.99999 1 -> -1
|
||||
ddctm753 comparetotmag 1.0000 1 -> -1
|
||||
ddctm754 comparetotmag 1.00001 1 -> 1
|
||||
ddctm755 comparetotmag 1.000001 1 -> 1
|
||||
ddctm756 comparetotmag 1.0000001 1 -> 1
|
||||
|
||||
-- Specials
|
||||
ddctm780 comparetotmag Inf -Inf -> 0
|
||||
ddctm781 comparetotmag Inf -1000 -> 1
|
||||
ddctm782 comparetotmag Inf -1 -> 1
|
||||
ddctm783 comparetotmag Inf -0 -> 1
|
||||
ddctm784 comparetotmag Inf 0 -> 1
|
||||
ddctm785 comparetotmag Inf 1 -> 1
|
||||
ddctm786 comparetotmag Inf 1000 -> 1
|
||||
ddctm787 comparetotmag Inf Inf -> 0
|
||||
ddctm788 comparetotmag -1000 Inf -> -1
|
||||
ddctm789 comparetotmag -Inf Inf -> 0
|
||||
ddctm790 comparetotmag -1 Inf -> -1
|
||||
ddctm791 comparetotmag -0 Inf -> -1
|
||||
ddctm792 comparetotmag 0 Inf -> -1
|
||||
ddctm793 comparetotmag 1 Inf -> -1
|
||||
ddctm794 comparetotmag 1000 Inf -> -1
|
||||
ddctm795 comparetotmag Inf Inf -> 0
|
||||
|
||||
ddctm800 comparetotmag -Inf -Inf -> 0
|
||||
ddctm801 comparetotmag -Inf -1000 -> 1
|
||||
ddctm802 comparetotmag -Inf -1 -> 1
|
||||
ddctm803 comparetotmag -Inf -0 -> 1
|
||||
ddctm804 comparetotmag -Inf 0 -> 1
|
||||
ddctm805 comparetotmag -Inf 1 -> 1
|
||||
ddctm806 comparetotmag -Inf 1000 -> 1
|
||||
ddctm807 comparetotmag -Inf Inf -> 0
|
||||
ddctm808 comparetotmag -Inf -Inf -> 0
|
||||
ddctm809 comparetotmag -1000 -Inf -> -1
|
||||
ddctm810 comparetotmag -1 -Inf -> -1
|
||||
ddctm811 comparetotmag -0 -Inf -> -1
|
||||
ddctm812 comparetotmag 0 -Inf -> -1
|
||||
ddctm813 comparetotmag 1 -Inf -> -1
|
||||
ddctm814 comparetotmag 1000 -Inf -> -1
|
||||
ddctm815 comparetotmag Inf -Inf -> 0
|
||||
|
||||
ddctm821 comparetotmag NaN -Inf -> 1
|
||||
ddctm822 comparetotmag NaN -1000 -> 1
|
||||
ddctm823 comparetotmag NaN -1 -> 1
|
||||
ddctm824 comparetotmag NaN -0 -> 1
|
||||
ddctm825 comparetotmag NaN 0 -> 1
|
||||
ddctm826 comparetotmag NaN 1 -> 1
|
||||
ddctm827 comparetotmag NaN 1000 -> 1
|
||||
ddctm828 comparetotmag NaN Inf -> 1
|
||||
ddctm829 comparetotmag NaN NaN -> 0
|
||||
ddctm830 comparetotmag -Inf NaN -> -1
|
||||
ddctm831 comparetotmag -1000 NaN -> -1
|
||||
ddctm832 comparetotmag -1 NaN -> -1
|
||||
ddctm833 comparetotmag -0 NaN -> -1
|
||||
ddctm834 comparetotmag 0 NaN -> -1
|
||||
ddctm835 comparetotmag 1 NaN -> -1
|
||||
ddctm836 comparetotmag 1000 NaN -> -1
|
||||
ddctm837 comparetotmag Inf NaN -> -1
|
||||
ddctm838 comparetotmag -NaN -NaN -> 0
|
||||
ddctm839 comparetotmag +NaN -NaN -> 0
|
||||
ddctm840 comparetotmag -NaN +NaN -> 0
|
||||
|
||||
ddctm841 comparetotmag sNaN -sNaN -> 0
|
||||
ddctm842 comparetotmag sNaN -NaN -> -1
|
||||
ddctm843 comparetotmag sNaN -Inf -> 1
|
||||
ddctm844 comparetotmag sNaN -1000 -> 1
|
||||
ddctm845 comparetotmag sNaN -1 -> 1
|
||||
ddctm846 comparetotmag sNaN -0 -> 1
|
||||
ddctm847 comparetotmag sNaN 0 -> 1
|
||||
ddctm848 comparetotmag sNaN 1 -> 1
|
||||
ddctm849 comparetotmag sNaN 1000 -> 1
|
||||
ddctm850 comparetotmag sNaN NaN -> -1
|
||||
ddctm851 comparetotmag sNaN sNaN -> 0
|
||||
|
||||
ddctm852 comparetotmag -sNaN sNaN -> 0
|
||||
ddctm853 comparetotmag -NaN sNaN -> 1
|
||||
ddctm854 comparetotmag -Inf sNaN -> -1
|
||||
ddctm855 comparetotmag -1000 sNaN -> -1
|
||||
ddctm856 comparetotmag -1 sNaN -> -1
|
||||
ddctm857 comparetotmag -0 sNaN -> -1
|
||||
ddctm858 comparetotmag 0 sNaN -> -1
|
||||
ddctm859 comparetotmag 1 sNaN -> -1
|
||||
ddctm860 comparetotmag 1000 sNaN -> -1
|
||||
ddctm861 comparetotmag Inf sNaN -> -1
|
||||
ddctm862 comparetotmag NaN sNaN -> 1
|
||||
ddctm863 comparetotmag sNaN sNaN -> 0
|
||||
|
||||
ddctm871 comparetotmag -sNaN -sNaN -> 0
|
||||
ddctm872 comparetotmag -sNaN -NaN -> -1
|
||||
ddctm873 comparetotmag -sNaN -Inf -> 1
|
||||
ddctm874 comparetotmag -sNaN -1000 -> 1
|
||||
ddctm875 comparetotmag -sNaN -1 -> 1
|
||||
ddctm876 comparetotmag -sNaN -0 -> 1
|
||||
ddctm877 comparetotmag -sNaN 0 -> 1
|
||||
ddctm878 comparetotmag -sNaN 1 -> 1
|
||||
ddctm879 comparetotmag -sNaN 1000 -> 1
|
||||
ddctm880 comparetotmag -sNaN NaN -> -1
|
||||
ddctm881 comparetotmag -sNaN sNaN -> 0
|
||||
|
||||
ddctm882 comparetotmag -sNaN -sNaN -> 0
|
||||
ddctm883 comparetotmag -NaN -sNaN -> 1
|
||||
ddctm884 comparetotmag -Inf -sNaN -> -1
|
||||
ddctm885 comparetotmag -1000 -sNaN -> -1
|
||||
ddctm886 comparetotmag -1 -sNaN -> -1
|
||||
ddctm887 comparetotmag -0 -sNaN -> -1
|
||||
ddctm888 comparetotmag 0 -sNaN -> -1
|
||||
ddctm889 comparetotmag 1 -sNaN -> -1
|
||||
ddctm890 comparetotmag 1000 -sNaN -> -1
|
||||
ddctm891 comparetotmag Inf -sNaN -> -1
|
||||
ddctm892 comparetotmag NaN -sNaN -> 1
|
||||
ddctm893 comparetotmag sNaN -sNaN -> 0
|
||||
|
||||
-- NaNs with payload
|
||||
ddctm960 comparetotmag NaN9 -Inf -> 1
|
||||
ddctm961 comparetotmag NaN8 999 -> 1
|
||||
ddctm962 comparetotmag NaN77 Inf -> 1
|
||||
ddctm963 comparetotmag -NaN67 NaN5 -> 1
|
||||
ddctm964 comparetotmag -Inf -NaN4 -> -1
|
||||
ddctm965 comparetotmag -999 -NaN33 -> -1
|
||||
ddctm966 comparetotmag Inf NaN2 -> -1
|
||||
|
||||
ddctm970 comparetotmag -NaN41 -NaN42 -> -1
|
||||
ddctm971 comparetotmag +NaN41 -NaN42 -> -1
|
||||
ddctm972 comparetotmag -NaN41 +NaN42 -> -1
|
||||
ddctm973 comparetotmag +NaN41 +NaN42 -> -1
|
||||
ddctm974 comparetotmag -NaN42 -NaN01 -> 1
|
||||
ddctm975 comparetotmag +NaN42 -NaN01 -> 1
|
||||
ddctm976 comparetotmag -NaN42 +NaN01 -> 1
|
||||
ddctm977 comparetotmag +NaN42 +NaN01 -> 1
|
||||
|
||||
ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1
|
||||
ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1
|
||||
ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1
|
||||
ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1
|
||||
ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1
|
||||
ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1
|
||||
ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1
|
||||
ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1
|
||||
|
||||
ddctm991 comparetotmag -sNaN99 -Inf -> 1
|
||||
ddctm992 comparetotmag sNaN98 -11 -> 1
|
||||
ddctm993 comparetotmag sNaN97 NaN -> -1
|
||||
ddctm994 comparetotmag sNaN16 sNaN94 -> -1
|
||||
ddctm995 comparetotmag NaN85 sNaN83 -> 1
|
||||
ddctm996 comparetotmag -Inf sNaN92 -> -1
|
||||
ddctm997 comparetotmag 088 sNaN81 -> -1
|
||||
ddctm998 comparetotmag Inf sNaN90 -> -1
|
||||
ddctm999 comparetotmag NaN -sNaN89 -> 1
|
||||
|
||||
-- spread zeros
|
||||
ddctm1110 comparetotmag 0E-383 0 -> -1
|
||||
ddctm1111 comparetotmag 0E-383 -0 -> -1
|
||||
ddctm1112 comparetotmag -0E-383 0 -> -1
|
||||
ddctm1113 comparetotmag -0E-383 -0 -> -1
|
||||
ddctm1114 comparetotmag 0E-383 0E+384 -> -1
|
||||
ddctm1115 comparetotmag 0E-383 -0E+384 -> -1
|
||||
ddctm1116 comparetotmag -0E-383 0E+384 -> -1
|
||||
ddctm1117 comparetotmag -0E-383 -0E+384 -> -1
|
||||
ddctm1118 comparetotmag 0 0E+384 -> -1
|
||||
ddctm1119 comparetotmag 0 -0E+384 -> -1
|
||||
ddctm1120 comparetotmag -0 0E+384 -> -1
|
||||
ddctm1121 comparetotmag -0 -0E+384 -> -1
|
||||
|
||||
ddctm1130 comparetotmag 0E+384 0 -> 1
|
||||
ddctm1131 comparetotmag 0E+384 -0 -> 1
|
||||
ddctm1132 comparetotmag -0E+384 0 -> 1
|
||||
ddctm1133 comparetotmag -0E+384 -0 -> 1
|
||||
ddctm1134 comparetotmag 0E+384 0E-383 -> 1
|
||||
ddctm1135 comparetotmag 0E+384 -0E-383 -> 1
|
||||
ddctm1136 comparetotmag -0E+384 0E-383 -> 1
|
||||
ddctm1137 comparetotmag -0E+384 -0E-383 -> 1
|
||||
ddctm1138 comparetotmag 0 0E-383 -> 1
|
||||
ddctm1139 comparetotmag 0 -0E-383 -> 1
|
||||
ddctm1140 comparetotmag -0 0E-383 -> 1
|
||||
ddctm1141 comparetotmag -0 -0E-383 -> 1
|
||||
|
||||
-- Null tests
|
||||
ddctm9990 comparetotmag 10 # -> NaN Invalid_operation
|
||||
ddctm9991 comparetotmag # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,88 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCopy.decTest -- quiet decDouble copy --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddcpy001 copy +7.50 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
ddcpy011 copy Infinity -> Infinity
|
||||
ddcpy012 copy -Infinity -> -Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddcpy021 copy NaN -> NaN
|
||||
ddcpy022 copy -NaN -> -NaN
|
||||
ddcpy023 copy sNaN -> sNaN
|
||||
ddcpy024 copy -sNaN -> -sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddcpy031 copy NaN10 -> NaN10
|
||||
ddcpy032 copy -NaN10 -> -NaN10
|
||||
ddcpy033 copy sNaN10 -> sNaN10
|
||||
ddcpy034 copy -sNaN10 -> -sNaN10
|
||||
ddcpy035 copy NaN7 -> NaN7
|
||||
ddcpy036 copy -NaN7 -> -NaN7
|
||||
ddcpy037 copy sNaN101 -> sNaN101
|
||||
ddcpy038 copy -sNaN101 -> -sNaN101
|
||||
|
||||
-- finites
|
||||
ddcpy101 copy 7 -> 7
|
||||
ddcpy102 copy -7 -> -7
|
||||
ddcpy103 copy 75 -> 75
|
||||
ddcpy104 copy -75 -> -75
|
||||
ddcpy105 copy 7.50 -> 7.50
|
||||
ddcpy106 copy -7.50 -> -7.50
|
||||
ddcpy107 copy 7.500 -> 7.500
|
||||
ddcpy108 copy -7.500 -> -7.500
|
||||
|
||||
-- zeros
|
||||
ddcpy111 copy 0 -> 0
|
||||
ddcpy112 copy -0 -> -0
|
||||
ddcpy113 copy 0E+4 -> 0E+4
|
||||
ddcpy114 copy -0E+4 -> -0E+4
|
||||
ddcpy115 copy 0.0000 -> 0.0000
|
||||
ddcpy116 copy -0.0000 -> -0.0000
|
||||
ddcpy117 copy 0E-141 -> 0E-141
|
||||
ddcpy118 copy -0E-141 -> -0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddcpy121 copy 2682682682682682 -> 2682682682682682
|
||||
ddcpy122 copy -2682682682682682 -> -2682682682682682
|
||||
ddcpy123 copy 1341341341341341 -> 1341341341341341
|
||||
ddcpy124 copy -1341341341341341 -> -1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddcpy132 copy 1E-383 -> 1E-383
|
||||
ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddcpy134 copy 1E-398 -> 1E-398
|
||||
|
||||
ddcpy135 copy -1E-398 -> -1E-398
|
||||
ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
ddcpy137 copy -1E-383 -> -1E-383
|
||||
ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384
|
|
@ -0,0 +1,88 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddcpa001 copyabs +7.50 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
ddcpa011 copyabs Infinity -> Infinity
|
||||
ddcpa012 copyabs -Infinity -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddcpa021 copyabs NaN -> NaN
|
||||
ddcpa022 copyabs -NaN -> NaN
|
||||
ddcpa023 copyabs sNaN -> sNaN
|
||||
ddcpa024 copyabs -sNaN -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddcpa031 copyabs NaN10 -> NaN10
|
||||
ddcpa032 copyabs -NaN15 -> NaN15
|
||||
ddcpa033 copyabs sNaN15 -> sNaN15
|
||||
ddcpa034 copyabs -sNaN10 -> sNaN10
|
||||
ddcpa035 copyabs NaN7 -> NaN7
|
||||
ddcpa036 copyabs -NaN7 -> NaN7
|
||||
ddcpa037 copyabs sNaN101 -> sNaN101
|
||||
ddcpa038 copyabs -sNaN101 -> sNaN101
|
||||
|
||||
-- finites
|
||||
ddcpa101 copyabs 7 -> 7
|
||||
ddcpa102 copyabs -7 -> 7
|
||||
ddcpa103 copyabs 75 -> 75
|
||||
ddcpa104 copyabs -75 -> 75
|
||||
ddcpa105 copyabs 7.10 -> 7.10
|
||||
ddcpa106 copyabs -7.10 -> 7.10
|
||||
ddcpa107 copyabs 7.500 -> 7.500
|
||||
ddcpa108 copyabs -7.500 -> 7.500
|
||||
|
||||
-- zeros
|
||||
ddcpa111 copyabs 0 -> 0
|
||||
ddcpa112 copyabs -0 -> 0
|
||||
ddcpa113 copyabs 0E+6 -> 0E+6
|
||||
ddcpa114 copyabs -0E+6 -> 0E+6
|
||||
ddcpa115 copyabs 0.0000 -> 0.0000
|
||||
ddcpa116 copyabs -0.0000 -> 0.0000
|
||||
ddcpa117 copyabs 0E-141 -> 0E-141
|
||||
ddcpa118 copyabs -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddcpa121 copyabs 2682682682682682 -> 2682682682682682
|
||||
ddcpa122 copyabs -2682682682682682 -> 2682682682682682
|
||||
ddcpa123 copyabs 1341341341341341 -> 1341341341341341
|
||||
ddcpa124 copyabs -1341341341341341 -> 1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddcpa132 copyabs 1E-383 -> 1E-383
|
||||
ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddcpa134 copyabs 1E-398 -> 1E-398
|
||||
|
||||
ddcpa135 copyabs -1E-398 -> 1E-398
|
||||
ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddcpa137 copyabs -1E-383 -> 1E-383
|
||||
ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384
|
|
@ -0,0 +1,88 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCopyNegate.decTest -- quiet decDouble copy and negate --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddcpn001 copynegate +7.50 -> -7.50
|
||||
|
||||
-- Infinities
|
||||
ddcpn011 copynegate Infinity -> -Infinity
|
||||
ddcpn012 copynegate -Infinity -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddcpn021 copynegate NaN -> -NaN
|
||||
ddcpn022 copynegate -NaN -> NaN
|
||||
ddcpn023 copynegate sNaN -> -sNaN
|
||||
ddcpn024 copynegate -sNaN -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddcpn031 copynegate NaN13 -> -NaN13
|
||||
ddcpn032 copynegate -NaN13 -> NaN13
|
||||
ddcpn033 copynegate sNaN13 -> -sNaN13
|
||||
ddcpn034 copynegate -sNaN13 -> sNaN13
|
||||
ddcpn035 copynegate NaN70 -> -NaN70
|
||||
ddcpn036 copynegate -NaN70 -> NaN70
|
||||
ddcpn037 copynegate sNaN101 -> -sNaN101
|
||||
ddcpn038 copynegate -sNaN101 -> sNaN101
|
||||
|
||||
-- finites
|
||||
ddcpn101 copynegate 7 -> -7
|
||||
ddcpn102 copynegate -7 -> 7
|
||||
ddcpn103 copynegate 75 -> -75
|
||||
ddcpn104 copynegate -75 -> 75
|
||||
ddcpn105 copynegate 7.50 -> -7.50
|
||||
ddcpn106 copynegate -7.50 -> 7.50
|
||||
ddcpn107 copynegate 7.500 -> -7.500
|
||||
ddcpn108 copynegate -7.500 -> 7.500
|
||||
|
||||
-- zeros
|
||||
ddcpn111 copynegate 0 -> -0
|
||||
ddcpn112 copynegate -0 -> 0
|
||||
ddcpn113 copynegate 0E+4 -> -0E+4
|
||||
ddcpn114 copynegate -0E+4 -> 0E+4
|
||||
ddcpn115 copynegate 0.0000 -> -0.0000
|
||||
ddcpn116 copynegate -0.0000 -> 0.0000
|
||||
ddcpn117 copynegate 0E-141 -> -0E-141
|
||||
ddcpn118 copynegate -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddcpn121 copynegate 2682682682682682 -> -2682682682682682
|
||||
ddcpn122 copynegate -2682682682682682 -> 2682682682682682
|
||||
ddcpn123 copynegate 1341341341341341 -> -1341341341341341
|
||||
ddcpn124 copynegate -1341341341341341 -> 1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384
|
||||
ddcpn132 copynegate 1E-383 -> -1E-383
|
||||
ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
ddcpn134 copynegate 1E-398 -> -1E-398
|
||||
|
||||
ddcpn135 copynegate -1E-398 -> 1E-398
|
||||
ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddcpn137 copynegate -1E-383 -> 1E-383
|
||||
ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384
|
|
@ -0,0 +1,175 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddcps001 copysign +7.50 11 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
ddcps011 copysign Infinity 11 -> Infinity
|
||||
ddcps012 copysign -Infinity 11 -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddcps021 copysign NaN 11 -> NaN
|
||||
ddcps022 copysign -NaN 11 -> NaN
|
||||
ddcps023 copysign sNaN 11 -> sNaN
|
||||
ddcps024 copysign -sNaN 11 -> sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddcps031 copysign NaN10 11 -> NaN10
|
||||
ddcps032 copysign -NaN10 11 -> NaN10
|
||||
ddcps033 copysign sNaN10 11 -> sNaN10
|
||||
ddcps034 copysign -sNaN10 11 -> sNaN10
|
||||
ddcps035 copysign NaN7 11 -> NaN7
|
||||
ddcps036 copysign -NaN7 11 -> NaN7
|
||||
ddcps037 copysign sNaN101 11 -> sNaN101
|
||||
ddcps038 copysign -sNaN101 11 -> sNaN101
|
||||
|
||||
-- finites
|
||||
ddcps101 copysign 7 11 -> 7
|
||||
ddcps102 copysign -7 11 -> 7
|
||||
ddcps103 copysign 75 11 -> 75
|
||||
ddcps104 copysign -75 11 -> 75
|
||||
ddcps105 copysign 7.50 11 -> 7.50
|
||||
ddcps106 copysign -7.50 11 -> 7.50
|
||||
ddcps107 copysign 7.500 11 -> 7.500
|
||||
ddcps108 copysign -7.500 11 -> 7.500
|
||||
|
||||
-- zeros
|
||||
ddcps111 copysign 0 11 -> 0
|
||||
ddcps112 copysign -0 11 -> 0
|
||||
ddcps113 copysign 0E+4 11 -> 0E+4
|
||||
ddcps114 copysign -0E+4 11 -> 0E+4
|
||||
ddcps115 copysign 0.0000 11 -> 0.0000
|
||||
ddcps116 copysign -0.0000 11 -> 0.0000
|
||||
ddcps117 copysign 0E-141 11 -> 0E-141
|
||||
ddcps118 copysign -0E-141 11 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddcps121 copysign 2682682682682682 11 -> 2682682682682682
|
||||
ddcps122 copysign -2682682682682682 11 -> 2682682682682682
|
||||
ddcps123 copysign 1341341341341341 11 -> 1341341341341341
|
||||
ddcps124 copysign -1341341341341341 11 -> 1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384
|
||||
ddcps132 copysign 1E-383 11 -> 1E-383
|
||||
ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383
|
||||
ddcps134 copysign 1E-398 11 -> 1E-398
|
||||
|
||||
ddcps135 copysign -1E-398 11 -> 1E-398
|
||||
ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383
|
||||
ddcps137 copysign -1E-383 11 -> 1E-383
|
||||
ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384
|
||||
|
||||
-- repeat with negative RHS
|
||||
|
||||
-- Infinities
|
||||
ddcps211 copysign Infinity -34 -> -Infinity
|
||||
ddcps212 copysign -Infinity -34 -> -Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddcps221 copysign NaN -34 -> -NaN
|
||||
ddcps222 copysign -NaN -34 -> -NaN
|
||||
ddcps223 copysign sNaN -34 -> -sNaN
|
||||
ddcps224 copysign -sNaN -34 -> -sNaN
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddcps231 copysign NaN10 -34 -> -NaN10
|
||||
ddcps232 copysign -NaN10 -34 -> -NaN10
|
||||
ddcps233 copysign sNaN10 -34 -> -sNaN10
|
||||
ddcps234 copysign -sNaN10 -34 -> -sNaN10
|
||||
ddcps235 copysign NaN7 -34 -> -NaN7
|
||||
ddcps236 copysign -NaN7 -34 -> -NaN7
|
||||
ddcps237 copysign sNaN101 -34 -> -sNaN101
|
||||
ddcps238 copysign -sNaN101 -34 -> -sNaN101
|
||||
|
||||
-- finites
|
||||
ddcps301 copysign 7 -34 -> -7
|
||||
ddcps302 copysign -7 -34 -> -7
|
||||
ddcps303 copysign 75 -34 -> -75
|
||||
ddcps304 copysign -75 -34 -> -75
|
||||
ddcps305 copysign 7.50 -34 -> -7.50
|
||||
ddcps306 copysign -7.50 -34 -> -7.50
|
||||
ddcps307 copysign 7.500 -34 -> -7.500
|
||||
ddcps308 copysign -7.500 -34 -> -7.500
|
||||
|
||||
-- zeros
|
||||
ddcps311 copysign 0 -34 -> -0
|
||||
ddcps312 copysign -0 -34 -> -0
|
||||
ddcps313 copysign 0E+4 -34 -> -0E+4
|
||||
ddcps314 copysign -0E+4 -34 -> -0E+4
|
||||
ddcps315 copysign 0.0000 -34 -> -0.0000
|
||||
ddcps316 copysign -0.0000 -34 -> -0.0000
|
||||
ddcps317 copysign 0E-141 -34 -> -0E-141
|
||||
ddcps318 copysign -0E-141 -34 -> -0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddcps321 copysign 2682682682682682 -34 -> -2682682682682682
|
||||
ddcps322 copysign -2682682682682682 -34 -> -2682682682682682
|
||||
ddcps323 copysign 1341341341341341 -34 -> -1341341341341341
|
||||
ddcps324 copysign -1341341341341341 -34 -> -1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384
|
||||
ddcps332 copysign 1E-383 -34 -> -1E-383
|
||||
ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383
|
||||
ddcps334 copysign 1E-398 -34 -> -1E-398
|
||||
|
||||
ddcps335 copysign -1E-398 -34 -> -1E-398
|
||||
ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383
|
||||
ddcps337 copysign -1E-383 -34 -> -1E-383
|
||||
ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384
|
||||
|
||||
-- Other kinds of RHS
|
||||
ddcps401 copysign 701 -34 -> -701
|
||||
ddcps402 copysign -720 -34 -> -720
|
||||
ddcps403 copysign 701 -0 -> -701
|
||||
ddcps404 copysign -720 -0 -> -720
|
||||
ddcps405 copysign 701 +0 -> 701
|
||||
ddcps406 copysign -720 +0 -> 720
|
||||
ddcps407 copysign 701 +34 -> 701
|
||||
ddcps408 copysign -720 +34 -> 720
|
||||
|
||||
ddcps413 copysign 701 -Inf -> -701
|
||||
ddcps414 copysign -720 -Inf -> -720
|
||||
ddcps415 copysign 701 +Inf -> 701
|
||||
ddcps416 copysign -720 +Inf -> 720
|
||||
|
||||
ddcps420 copysign 701 -NaN -> -701
|
||||
ddcps421 copysign -720 -NaN -> -720
|
||||
ddcps422 copysign 701 +NaN -> 701
|
||||
ddcps423 copysign -720 +NaN -> 720
|
||||
ddcps425 copysign -720 +NaN8 -> 720
|
||||
|
||||
ddcps426 copysign 701 -sNaN -> -701
|
||||
ddcps427 copysign -720 -sNaN -> -720
|
||||
ddcps428 copysign 701 +sNaN -> 701
|
||||
ddcps429 copysign -720 +sNaN -> 720
|
||||
ddcps430 copysign -720 +sNaN3 -> 720
|
||||
|
|
@ -0,0 +1,854 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddDivide.decTest -- decDouble division --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
dddiv001 divide 1 1 -> 1
|
||||
dddiv002 divide 2 1 -> 2
|
||||
dddiv003 divide 1 2 -> 0.5
|
||||
dddiv004 divide 2 2 -> 1
|
||||
dddiv005 divide 0 1 -> 0
|
||||
dddiv006 divide 0 2 -> 0
|
||||
dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv009 divide 3 3 -> 1
|
||||
|
||||
dddiv010 divide 2.4 1 -> 2.4
|
||||
dddiv011 divide 2.4 -1 -> -2.4
|
||||
dddiv012 divide -2.4 1 -> -2.4
|
||||
dddiv013 divide -2.4 -1 -> 2.4
|
||||
dddiv014 divide 2.40 1 -> 2.40
|
||||
dddiv015 divide 2.400 1 -> 2.400
|
||||
dddiv016 divide 2.4 2 -> 1.2
|
||||
dddiv017 divide 2.400 2 -> 1.200
|
||||
dddiv018 divide 2. 2 -> 1
|
||||
dddiv019 divide 20 20 -> 1
|
||||
|
||||
dddiv020 divide 187 187 -> 1
|
||||
dddiv021 divide 5 2 -> 2.5
|
||||
dddiv022 divide 50 20 -> 2.5
|
||||
dddiv023 divide 500 200 -> 2.5
|
||||
dddiv024 divide 50.0 20.0 -> 2.5
|
||||
dddiv025 divide 5.00 2.00 -> 2.5
|
||||
dddiv026 divide 5 2.0 -> 2.5
|
||||
dddiv027 divide 5 2.000 -> 2.5
|
||||
dddiv028 divide 5 0.20 -> 25
|
||||
dddiv029 divide 5 0.200 -> 25
|
||||
dddiv030 divide 10 1 -> 10
|
||||
dddiv031 divide 100 1 -> 100
|
||||
dddiv032 divide 1000 1 -> 1000
|
||||
dddiv033 divide 1000 100 -> 10
|
||||
|
||||
dddiv035 divide 1 2 -> 0.5
|
||||
dddiv036 divide 1 4 -> 0.25
|
||||
dddiv037 divide 1 8 -> 0.125
|
||||
dddiv038 divide 1 16 -> 0.0625
|
||||
dddiv039 divide 1 32 -> 0.03125
|
||||
dddiv040 divide 1 64 -> 0.015625
|
||||
dddiv041 divide 1 -2 -> -0.5
|
||||
dddiv042 divide 1 -4 -> -0.25
|
||||
dddiv043 divide 1 -8 -> -0.125
|
||||
dddiv044 divide 1 -16 -> -0.0625
|
||||
dddiv045 divide 1 -32 -> -0.03125
|
||||
dddiv046 divide 1 -64 -> -0.015625
|
||||
dddiv047 divide -1 2 -> -0.5
|
||||
dddiv048 divide -1 4 -> -0.25
|
||||
dddiv049 divide -1 8 -> -0.125
|
||||
dddiv050 divide -1 16 -> -0.0625
|
||||
dddiv051 divide -1 32 -> -0.03125
|
||||
dddiv052 divide -1 64 -> -0.015625
|
||||
dddiv053 divide -1 -2 -> 0.5
|
||||
dddiv054 divide -1 -4 -> 0.25
|
||||
dddiv055 divide -1 -8 -> 0.125
|
||||
dddiv056 divide -1 -16 -> 0.0625
|
||||
dddiv057 divide -1 -32 -> 0.03125
|
||||
dddiv058 divide -1 -64 -> 0.015625
|
||||
|
||||
-- bcdTime
|
||||
dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded
|
||||
dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded
|
||||
|
||||
-- 1234567890123456
|
||||
dddiv071 divide 9999999999999999 1 -> 9999999999999999
|
||||
dddiv072 divide 999999999999999 1 -> 999999999999999
|
||||
dddiv073 divide 99999999999999 1 -> 99999999999999
|
||||
dddiv074 divide 9999999999999 1 -> 9999999999999
|
||||
dddiv075 divide 999999999999 1 -> 999999999999
|
||||
dddiv076 divide 99999999999 1 -> 99999999999
|
||||
dddiv077 divide 9999999999 1 -> 9999999999
|
||||
dddiv078 divide 999999999 1 -> 999999999
|
||||
dddiv079 divide 99999999 1 -> 99999999
|
||||
dddiv080 divide 9999999 1 -> 9999999
|
||||
dddiv081 divide 999999 1 -> 999999
|
||||
dddiv082 divide 99999 1 -> 99999
|
||||
dddiv083 divide 9999 1 -> 9999
|
||||
dddiv084 divide 999 1 -> 999
|
||||
dddiv085 divide 99 1 -> 99
|
||||
dddiv086 divide 9 1 -> 9
|
||||
|
||||
dddiv090 divide 0. 1 -> 0
|
||||
dddiv091 divide .0 1 -> 0.0
|
||||
dddiv092 divide 0.00 1 -> 0.00
|
||||
dddiv093 divide 0.00E+9 1 -> 0E+7
|
||||
dddiv094 divide 0.0000E-50 1 -> 0E-54
|
||||
|
||||
dddiv095 divide 1 1E-8 -> 1E+8
|
||||
dddiv096 divide 1 1E-9 -> 1E+9
|
||||
dddiv097 divide 1 1E-10 -> 1E+10
|
||||
dddiv098 divide 1 1E-11 -> 1E+11
|
||||
dddiv099 divide 1 1E-12 -> 1E+12
|
||||
|
||||
dddiv100 divide 1 1 -> 1
|
||||
dddiv101 divide 1 2 -> 0.5
|
||||
dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv103 divide 1 4 -> 0.25
|
||||
dddiv104 divide 1 5 -> 0.2
|
||||
dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded
|
||||
dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded
|
||||
dddiv107 divide 1 8 -> 0.125
|
||||
dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded
|
||||
dddiv109 divide 1 10 -> 0.1
|
||||
dddiv110 divide 1 1 -> 1
|
||||
dddiv111 divide 2 1 -> 2
|
||||
dddiv112 divide 3 1 -> 3
|
||||
dddiv113 divide 4 1 -> 4
|
||||
dddiv114 divide 5 1 -> 5
|
||||
dddiv115 divide 6 1 -> 6
|
||||
dddiv116 divide 7 1 -> 7
|
||||
dddiv117 divide 8 1 -> 8
|
||||
dddiv118 divide 9 1 -> 9
|
||||
dddiv119 divide 10 1 -> 10
|
||||
|
||||
dddiv120 divide 3E+1 0.001 -> 3E+4
|
||||
dddiv121 divide 2.200 2 -> 1.100
|
||||
|
||||
dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded
|
||||
dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded
|
||||
dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded
|
||||
dddiv133 divide 12345 5 -> 2469
|
||||
dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded
|
||||
dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded
|
||||
dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded
|
||||
|
||||
-- test possibly imprecise results
|
||||
dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded
|
||||
dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded
|
||||
dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded
|
||||
dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded
|
||||
|
||||
-- test some cases that are close to exponent overflow
|
||||
dddiv270 divide 1 1e384 -> 1E-384 Subnormal
|
||||
dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow
|
||||
dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow
|
||||
dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow
|
||||
dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped
|
||||
dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped
|
||||
dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped
|
||||
dddiv277 divide 9.999999999999999e384 1 -> 9.999999999999999E+384
|
||||
|
||||
-- Divide into 0 tests
|
||||
dddiv301 divide 0 7 -> 0
|
||||
dddiv302 divide 0 7E-5 -> 0E+5
|
||||
dddiv303 divide 0 7E-1 -> 0E+1
|
||||
dddiv304 divide 0 7E+1 -> 0.0
|
||||
dddiv305 divide 0 7E+5 -> 0.00000
|
||||
dddiv306 divide 0 7E+6 -> 0.000000
|
||||
dddiv307 divide 0 7E+7 -> 0E-7
|
||||
dddiv308 divide 0 70E-5 -> 0E+5
|
||||
dddiv309 divide 0 70E-1 -> 0E+1
|
||||
dddiv310 divide 0 70E+0 -> 0
|
||||
dddiv311 divide 0 70E+1 -> 0.0
|
||||
dddiv312 divide 0 70E+5 -> 0.00000
|
||||
dddiv313 divide 0 70E+6 -> 0.000000
|
||||
dddiv314 divide 0 70E+7 -> 0E-7
|
||||
dddiv315 divide 0 700E-5 -> 0E+5
|
||||
dddiv316 divide 0 700E-1 -> 0E+1
|
||||
dddiv317 divide 0 700E+0 -> 0
|
||||
dddiv318 divide 0 700E+1 -> 0.0
|
||||
dddiv319 divide 0 700E+5 -> 0.00000
|
||||
dddiv320 divide 0 700E+6 -> 0.000000
|
||||
dddiv321 divide 0 700E+7 -> 0E-7
|
||||
dddiv322 divide 0 700E+77 -> 0E-77
|
||||
|
||||
dddiv331 divide 0E-3 7E-5 -> 0E+2
|
||||
dddiv332 divide 0E-3 7E-1 -> 0.00
|
||||
dddiv333 divide 0E-3 7E+1 -> 0.0000
|
||||
dddiv334 divide 0E-3 7E+5 -> 0E-8
|
||||
dddiv335 divide 0E-1 7E-5 -> 0E+4
|
||||
dddiv336 divide 0E-1 7E-1 -> 0
|
||||
dddiv337 divide 0E-1 7E+1 -> 0.00
|
||||
dddiv338 divide 0E-1 7E+5 -> 0.000000
|
||||
dddiv339 divide 0E+1 7E-5 -> 0E+6
|
||||
dddiv340 divide 0E+1 7E-1 -> 0E+2
|
||||
dddiv341 divide 0E+1 7E+1 -> 0
|
||||
dddiv342 divide 0E+1 7E+5 -> 0.0000
|
||||
dddiv343 divide 0E+3 7E-5 -> 0E+8
|
||||
dddiv344 divide 0E+3 7E-1 -> 0E+4
|
||||
dddiv345 divide 0E+3 7E+1 -> 0E+2
|
||||
dddiv346 divide 0E+3 7E+5 -> 0.00
|
||||
|
||||
-- These were 'input rounding'
|
||||
dddiv441 divide 12345678000 1 -> 12345678000
|
||||
dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded
|
||||
dddiv443 divide 1234567800 1 -> 1234567800
|
||||
dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded
|
||||
dddiv445 divide 1234567890 1 -> 1234567890
|
||||
dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded
|
||||
dddiv447 divide 1234567891 1 -> 1234567891
|
||||
dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded
|
||||
dddiv449 divide 12345678901 1 -> 12345678901
|
||||
dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded
|
||||
dddiv451 divide 1234567896 1 -> 1234567896
|
||||
dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded
|
||||
|
||||
-- high-lows
|
||||
dddiv453 divide 1e+1 1 -> 1E+1
|
||||
dddiv454 divide 1e+1 1.0 -> 1E+1
|
||||
dddiv455 divide 1e+1 1.00 -> 1E+1
|
||||
dddiv456 divide 1e+2 2 -> 5E+1
|
||||
dddiv457 divide 1e+2 2.0 -> 5E+1
|
||||
dddiv458 divide 1e+2 2.00 -> 5E+1
|
||||
|
||||
-- some from IEEE discussions
|
||||
dddiv460 divide 3e0 2e0 -> 1.5
|
||||
dddiv461 divide 30e-1 2e0 -> 1.5
|
||||
dddiv462 divide 300e-2 2e0 -> 1.50
|
||||
dddiv464 divide 3000e-3 2e0 -> 1.500
|
||||
dddiv465 divide 3e0 20e-1 -> 1.5
|
||||
dddiv466 divide 30e-1 20e-1 -> 1.5
|
||||
dddiv467 divide 300e-2 20e-1 -> 1.5
|
||||
dddiv468 divide 3000e-3 20e-1 -> 1.50
|
||||
dddiv469 divide 3e0 200e-2 -> 1.5
|
||||
dddiv470 divide 30e-1 200e-2 -> 1.5
|
||||
dddiv471 divide 300e-2 200e-2 -> 1.5
|
||||
dddiv472 divide 3000e-3 200e-2 -> 1.5
|
||||
dddiv473 divide 3e0 2000e-3 -> 1.5
|
||||
dddiv474 divide 30e-1 2000e-3 -> 1.5
|
||||
dddiv475 divide 300e-2 2000e-3 -> 1.5
|
||||
dddiv476 divide 3000e-3 2000e-3 -> 1.5
|
||||
|
||||
-- some reciprocals
|
||||
dddiv480 divide 1 1.0E+33 -> 1E-33
|
||||
dddiv481 divide 1 10E+33 -> 1E-34
|
||||
dddiv482 divide 1 1.0E-33 -> 1E+33
|
||||
dddiv483 divide 1 10E-33 -> 1E+32
|
||||
|
||||
-- RMS discussion table
|
||||
dddiv484 divide 0e5 1e3 -> 0E+2
|
||||
dddiv485 divide 0e5 2e3 -> 0E+2
|
||||
dddiv486 divide 0e5 10e2 -> 0E+3
|
||||
dddiv487 divide 0e5 20e2 -> 0E+3
|
||||
dddiv488 divide 0e5 100e1 -> 0E+4
|
||||
dddiv489 divide 0e5 200e1 -> 0E+4
|
||||
|
||||
dddiv491 divide 1e5 1e3 -> 1E+2
|
||||
dddiv492 divide 1e5 2e3 -> 5E+1
|
||||
dddiv493 divide 1e5 10e2 -> 1E+2
|
||||
dddiv494 divide 1e5 20e2 -> 5E+1
|
||||
dddiv495 divide 1e5 100e1 -> 1E+2
|
||||
dddiv496 divide 1e5 200e1 -> 5E+1
|
||||
|
||||
-- tryzeros cases
|
||||
rounding: half_up
|
||||
dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped
|
||||
dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped
|
||||
|
||||
rounding: half_up
|
||||
|
||||
-- focus on trailing zeros issues
|
||||
dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded
|
||||
dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded
|
||||
dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded
|
||||
|
||||
dddiv511 divide 1 2 -> 0.5
|
||||
dddiv512 divide 1.0 2 -> 0.5
|
||||
dddiv513 divide 1.00 2 -> 0.50
|
||||
dddiv514 divide 1.000 2 -> 0.500
|
||||
dddiv515 divide 1.0000 2 -> 0.5000
|
||||
dddiv516 divide 1.00000 2 -> 0.50000
|
||||
dddiv517 divide 1.000000 2 -> 0.500000
|
||||
dddiv518 divide 1.0000000 2 -> 0.5000000
|
||||
dddiv519 divide 1.00 2.00 -> 0.5
|
||||
|
||||
dddiv521 divide 2 1 -> 2
|
||||
dddiv522 divide 2 1.0 -> 2
|
||||
dddiv523 divide 2 1.00 -> 2
|
||||
dddiv524 divide 2 1.000 -> 2
|
||||
dddiv525 divide 2 1.0000 -> 2
|
||||
dddiv526 divide 2 1.00000 -> 2
|
||||
dddiv527 divide 2 1.000000 -> 2
|
||||
dddiv528 divide 2 1.0000000 -> 2
|
||||
dddiv529 divide 2.00 1.00 -> 2
|
||||
|
||||
dddiv530 divide 2.40 2 -> 1.20
|
||||
dddiv531 divide 2.40 4 -> 0.60
|
||||
dddiv532 divide 2.40 10 -> 0.24
|
||||
dddiv533 divide 2.40 2.0 -> 1.2
|
||||
dddiv534 divide 2.40 4.0 -> 0.6
|
||||
dddiv535 divide 2.40 10.0 -> 0.24
|
||||
dddiv536 divide 2.40 2.00 -> 1.2
|
||||
dddiv537 divide 2.40 4.00 -> 0.6
|
||||
dddiv538 divide 2.40 10.00 -> 0.24
|
||||
dddiv539 divide 0.9 0.1 -> 9
|
||||
dddiv540 divide 0.9 0.01 -> 9E+1
|
||||
dddiv541 divide 0.9 0.001 -> 9E+2
|
||||
dddiv542 divide 5 2 -> 2.5
|
||||
dddiv543 divide 5 2.0 -> 2.5
|
||||
dddiv544 divide 5 2.00 -> 2.5
|
||||
dddiv545 divide 5 20 -> 0.25
|
||||
dddiv546 divide 5 20.0 -> 0.25
|
||||
dddiv547 divide 2.400 2 -> 1.200
|
||||
dddiv548 divide 2.400 2.0 -> 1.20
|
||||
dddiv549 divide 2.400 2.400 -> 1
|
||||
|
||||
dddiv550 divide 240 1 -> 240
|
||||
dddiv551 divide 240 10 -> 24
|
||||
dddiv552 divide 240 100 -> 2.4
|
||||
dddiv553 divide 240 1000 -> 0.24
|
||||
dddiv554 divide 2400 1 -> 2400
|
||||
dddiv555 divide 2400 10 -> 240
|
||||
dddiv556 divide 2400 100 -> 24
|
||||
dddiv557 divide 2400 1000 -> 2.4
|
||||
|
||||
-- +ve exponent
|
||||
dddiv600 divide 2.4E+9 2 -> 1.2E+9
|
||||
dddiv601 divide 2.40E+9 2 -> 1.20E+9
|
||||
dddiv602 divide 2.400E+9 2 -> 1.200E+9
|
||||
dddiv603 divide 2.4000E+9 2 -> 1.2000E+9
|
||||
dddiv604 divide 24E+8 2 -> 1.2E+9
|
||||
dddiv605 divide 240E+7 2 -> 1.20E+9
|
||||
dddiv606 divide 2400E+6 2 -> 1.200E+9
|
||||
dddiv607 divide 24000E+5 2 -> 1.2000E+9
|
||||
|
||||
-- more zeros, etc.
|
||||
dddiv731 divide 5.00 1E-3 -> 5.00E+3
|
||||
dddiv732 divide 00.00 0.000 -> NaN Division_undefined
|
||||
dddiv733 divide 00.00 0E-3 -> NaN Division_undefined
|
||||
dddiv734 divide 0 -0 -> NaN Division_undefined
|
||||
dddiv735 divide -0 0 -> NaN Division_undefined
|
||||
dddiv736 divide -0 -0 -> NaN Division_undefined
|
||||
|
||||
dddiv741 divide 0 -1 -> -0
|
||||
dddiv742 divide -0 -1 -> 0
|
||||
dddiv743 divide 0 1 -> 0
|
||||
dddiv744 divide -0 1 -> -0
|
||||
dddiv745 divide -1 0 -> -Infinity Division_by_zero
|
||||
dddiv746 divide -1 -0 -> Infinity Division_by_zero
|
||||
dddiv747 divide 1 0 -> Infinity Division_by_zero
|
||||
dddiv748 divide 1 -0 -> -Infinity Division_by_zero
|
||||
|
||||
dddiv751 divide 0.0 -1 -> -0.0
|
||||
dddiv752 divide -0.0 -1 -> 0.0
|
||||
dddiv753 divide 0.0 1 -> 0.0
|
||||
dddiv754 divide -0.0 1 -> -0.0
|
||||
dddiv755 divide -1.0 0 -> -Infinity Division_by_zero
|
||||
dddiv756 divide -1.0 -0 -> Infinity Division_by_zero
|
||||
dddiv757 divide 1.0 0 -> Infinity Division_by_zero
|
||||
dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero
|
||||
|
||||
dddiv761 divide 0 -1.0 -> -0E+1
|
||||
dddiv762 divide -0 -1.0 -> 0E+1
|
||||
dddiv763 divide 0 1.0 -> 0E+1
|
||||
dddiv764 divide -0 1.0 -> -0E+1
|
||||
dddiv765 divide -1 0.0 -> -Infinity Division_by_zero
|
||||
dddiv766 divide -1 -0.0 -> Infinity Division_by_zero
|
||||
dddiv767 divide 1 0.0 -> Infinity Division_by_zero
|
||||
dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero
|
||||
|
||||
dddiv771 divide 0.0 -1.0 -> -0
|
||||
dddiv772 divide -0.0 -1.0 -> 0
|
||||
dddiv773 divide 0.0 1.0 -> 0
|
||||
dddiv774 divide -0.0 1.0 -> -0
|
||||
dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
|
||||
dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
|
||||
dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero
|
||||
dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
|
||||
|
||||
-- Specials
|
||||
dddiv780 divide Inf -Inf -> NaN Invalid_operation
|
||||
dddiv781 divide Inf -1000 -> -Infinity
|
||||
dddiv782 divide Inf -1 -> -Infinity
|
||||
dddiv783 divide Inf -0 -> -Infinity
|
||||
dddiv784 divide Inf 0 -> Infinity
|
||||
dddiv785 divide Inf 1 -> Infinity
|
||||
dddiv786 divide Inf 1000 -> Infinity
|
||||
dddiv787 divide Inf Inf -> NaN Invalid_operation
|
||||
dddiv788 divide -1000 Inf -> -0E-398 Clamped
|
||||
dddiv789 divide -Inf Inf -> NaN Invalid_operation
|
||||
dddiv790 divide -1 Inf -> -0E-398 Clamped
|
||||
dddiv791 divide -0 Inf -> -0E-398 Clamped
|
||||
dddiv792 divide 0 Inf -> 0E-398 Clamped
|
||||
dddiv793 divide 1 Inf -> 0E-398 Clamped
|
||||
dddiv794 divide 1000 Inf -> 0E-398 Clamped
|
||||
dddiv795 divide Inf Inf -> NaN Invalid_operation
|
||||
|
||||
dddiv800 divide -Inf -Inf -> NaN Invalid_operation
|
||||
dddiv801 divide -Inf -1000 -> Infinity
|
||||
dddiv802 divide -Inf -1 -> Infinity
|
||||
dddiv803 divide -Inf -0 -> Infinity
|
||||
dddiv804 divide -Inf 0 -> -Infinity
|
||||
dddiv805 divide -Inf 1 -> -Infinity
|
||||
dddiv806 divide -Inf 1000 -> -Infinity
|
||||
dddiv807 divide -Inf Inf -> NaN Invalid_operation
|
||||
dddiv808 divide -1000 Inf -> -0E-398 Clamped
|
||||
dddiv809 divide -Inf -Inf -> NaN Invalid_operation
|
||||
dddiv810 divide -1 -Inf -> 0E-398 Clamped
|
||||
dddiv811 divide -0 -Inf -> 0E-398 Clamped
|
||||
dddiv812 divide 0 -Inf -> -0E-398 Clamped
|
||||
dddiv813 divide 1 -Inf -> -0E-398 Clamped
|
||||
dddiv814 divide 1000 -Inf -> -0E-398 Clamped
|
||||
dddiv815 divide Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
dddiv821 divide NaN -Inf -> NaN
|
||||
dddiv822 divide NaN -1000 -> NaN
|
||||
dddiv823 divide NaN -1 -> NaN
|
||||
dddiv824 divide NaN -0 -> NaN
|
||||
dddiv825 divide NaN 0 -> NaN
|
||||
dddiv826 divide NaN 1 -> NaN
|
||||
dddiv827 divide NaN 1000 -> NaN
|
||||
dddiv828 divide NaN Inf -> NaN
|
||||
dddiv829 divide NaN NaN -> NaN
|
||||
dddiv830 divide -Inf NaN -> NaN
|
||||
dddiv831 divide -1000 NaN -> NaN
|
||||
dddiv832 divide -1 NaN -> NaN
|
||||
dddiv833 divide -0 NaN -> NaN
|
||||
dddiv834 divide 0 NaN -> NaN
|
||||
dddiv835 divide 1 NaN -> NaN
|
||||
dddiv836 divide 1000 NaN -> NaN
|
||||
dddiv837 divide Inf NaN -> NaN
|
||||
|
||||
dddiv841 divide sNaN -Inf -> NaN Invalid_operation
|
||||
dddiv842 divide sNaN -1000 -> NaN Invalid_operation
|
||||
dddiv843 divide sNaN -1 -> NaN Invalid_operation
|
||||
dddiv844 divide sNaN -0 -> NaN Invalid_operation
|
||||
dddiv845 divide sNaN 0 -> NaN Invalid_operation
|
||||
dddiv846 divide sNaN 1 -> NaN Invalid_operation
|
||||
dddiv847 divide sNaN 1000 -> NaN Invalid_operation
|
||||
dddiv848 divide sNaN NaN -> NaN Invalid_operation
|
||||
dddiv849 divide sNaN sNaN -> NaN Invalid_operation
|
||||
dddiv850 divide NaN sNaN -> NaN Invalid_operation
|
||||
dddiv851 divide -Inf sNaN -> NaN Invalid_operation
|
||||
dddiv852 divide -1000 sNaN -> NaN Invalid_operation
|
||||
dddiv853 divide -1 sNaN -> NaN Invalid_operation
|
||||
dddiv854 divide -0 sNaN -> NaN Invalid_operation
|
||||
dddiv855 divide 0 sNaN -> NaN Invalid_operation
|
||||
dddiv856 divide 1 sNaN -> NaN Invalid_operation
|
||||
dddiv857 divide 1000 sNaN -> NaN Invalid_operation
|
||||
dddiv858 divide Inf sNaN -> NaN Invalid_operation
|
||||
dddiv859 divide NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
dddiv861 divide NaN9 -Inf -> NaN9
|
||||
dddiv862 divide NaN8 1000 -> NaN8
|
||||
dddiv863 divide NaN7 Inf -> NaN7
|
||||
dddiv864 divide NaN6 NaN5 -> NaN6
|
||||
dddiv865 divide -Inf NaN4 -> NaN4
|
||||
dddiv866 divide -1000 NaN3 -> NaN3
|
||||
dddiv867 divide Inf NaN2 -> NaN2
|
||||
|
||||
dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
|
||||
dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
|
||||
dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
|
||||
dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
|
||||
dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
|
||||
dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
|
||||
|
||||
dddiv881 divide -NaN9 -Inf -> -NaN9
|
||||
dddiv882 divide -NaN8 1000 -> -NaN8
|
||||
dddiv883 divide -NaN7 Inf -> -NaN7
|
||||
dddiv884 divide -NaN6 -NaN5 -> -NaN6
|
||||
dddiv885 divide -Inf -NaN4 -> -NaN4
|
||||
dddiv886 divide -1000 -NaN3 -> -NaN3
|
||||
dddiv887 divide Inf -NaN2 -> -NaN2
|
||||
|
||||
dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
|
||||
dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
|
||||
dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
|
||||
dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
|
||||
dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
|
||||
dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
|
||||
dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
|
||||
|
||||
-- Various flavours of divide by 0
|
||||
dddiv901 divide 0 0 -> NaN Division_undefined
|
||||
dddiv902 divide 0.0E5 0 -> NaN Division_undefined
|
||||
dddiv903 divide 0.000 0 -> NaN Division_undefined
|
||||
dddiv904 divide 0.0001 0 -> Infinity Division_by_zero
|
||||
dddiv905 divide 0.01 0 -> Infinity Division_by_zero
|
||||
dddiv906 divide 0.1 0 -> Infinity Division_by_zero
|
||||
dddiv907 divide 1 0 -> Infinity Division_by_zero
|
||||
dddiv908 divide 1 0.0 -> Infinity Division_by_zero
|
||||
dddiv909 divide 10 0.0 -> Infinity Division_by_zero
|
||||
dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
|
||||
dddiv911 divide 1E+100 0 -> Infinity Division_by_zero
|
||||
|
||||
dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero
|
||||
dddiv922 divide -0.01 0 -> -Infinity Division_by_zero
|
||||
dddiv923 divide -0.1 0 -> -Infinity Division_by_zero
|
||||
dddiv924 divide -1 0 -> -Infinity Division_by_zero
|
||||
dddiv925 divide -1 0.0 -> -Infinity Division_by_zero
|
||||
dddiv926 divide -10 0.0 -> -Infinity Division_by_zero
|
||||
dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
|
||||
dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero
|
||||
|
||||
dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
|
||||
dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero
|
||||
dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero
|
||||
dddiv934 divide 1 -0 -> -Infinity Division_by_zero
|
||||
dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero
|
||||
dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero
|
||||
dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
|
||||
dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
|
||||
|
||||
dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero
|
||||
dddiv942 divide -0.01 -0 -> Infinity Division_by_zero
|
||||
dddiv943 divide -0.1 -0 -> Infinity Division_by_zero
|
||||
dddiv944 divide -1 -0 -> Infinity Division_by_zero
|
||||
dddiv945 divide -1 -0.0 -> Infinity Division_by_zero
|
||||
dddiv946 divide -10 -0.0 -> Infinity Division_by_zero
|
||||
dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
|
||||
dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero
|
||||
|
||||
-- Examples from SQL proposal (Krishna Kulkarni)
|
||||
dddiv1021 divide 1E0 1E0 -> 1
|
||||
dddiv1022 divide 1E0 2E0 -> 0.5
|
||||
dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv1024 divide 100E-2 1000E-3 -> 1
|
||||
dddiv1025 divide 24E-1 2E0 -> 1.2
|
||||
dddiv1026 divide 2400E-3 2E0 -> 1.200
|
||||
dddiv1027 divide 5E0 2E0 -> 2.5
|
||||
dddiv1028 divide 5E0 20E-1 -> 2.5
|
||||
dddiv1029 divide 5E0 2000E-3 -> 2.5
|
||||
dddiv1030 divide 5E0 2E-1 -> 25
|
||||
dddiv1031 divide 5E0 20E-2 -> 25
|
||||
dddiv1032 divide 480E-2 3E0 -> 1.60
|
||||
dddiv1033 divide 47E-1 2E0 -> 2.35
|
||||
|
||||
-- ECMAScript bad examples
|
||||
rounding: half_down
|
||||
dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded
|
||||
rounding: half_even
|
||||
dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded
|
||||
|
||||
-- overflow and underflow tests .. note subnormal results
|
||||
-- signs
|
||||
dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded
|
||||
dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded
|
||||
dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
||||
-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
|
||||
dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal
|
||||
dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal
|
||||
dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal
|
||||
dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal
|
||||
dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal
|
||||
dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal
|
||||
dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal
|
||||
dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
-- [no equivalent of 'subnormal' for overflow]
|
||||
dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped
|
||||
dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped
|
||||
dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped
|
||||
dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped
|
||||
dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded
|
||||
dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded
|
||||
|
||||
dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal
|
||||
dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal
|
||||
dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal
|
||||
dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal
|
||||
dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded
|
||||
dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal
|
||||
dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal
|
||||
dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
||||
dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded
|
||||
dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal
|
||||
dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal
|
||||
dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal
|
||||
dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal
|
||||
dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal
|
||||
|
||||
-- randoms
|
||||
dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded
|
||||
dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded
|
||||
dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded
|
||||
dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded
|
||||
dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded
|
||||
dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded
|
||||
dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded
|
||||
dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded
|
||||
dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded
|
||||
dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded
|
||||
dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded
|
||||
dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded
|
||||
dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded
|
||||
dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded
|
||||
dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded
|
||||
dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded
|
||||
dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded
|
||||
dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded
|
||||
dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded
|
||||
dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded
|
||||
dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded
|
||||
dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded
|
||||
dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded
|
||||
dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded
|
||||
dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded
|
||||
dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded
|
||||
dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded
|
||||
dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded
|
||||
dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded
|
||||
dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded
|
||||
dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded
|
||||
dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded
|
||||
dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded
|
||||
dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded
|
||||
dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded
|
||||
dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded
|
||||
dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded
|
||||
dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded
|
||||
dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded
|
||||
dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded
|
||||
dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded
|
||||
dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded
|
||||
dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded
|
||||
dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded
|
||||
dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded
|
||||
dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded
|
||||
dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded
|
||||
dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded
|
||||
dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded
|
||||
dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded
|
||||
dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded
|
||||
|
||||
-- Division probably has pre-rounding, so need to test rounding
|
||||
-- explicitly rather than assume included through other tests;
|
||||
-- tests include simple rounding and also the tricky cases of sticky
|
||||
-- bits following two zeros
|
||||
--
|
||||
-- 1/99999 gives 0.0000100001000010000100001000010000100001
|
||||
-- 1234567890123456
|
||||
--
|
||||
-- 1/999999 gives 0.000001000001000001000001000001000001000001
|
||||
-- 1234567890123456
|
||||
|
||||
rounding: ceiling
|
||||
dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded
|
||||
dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
|
||||
dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded
|
||||
dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded
|
||||
dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
|
||||
dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded
|
||||
dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded
|
||||
dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
|
||||
|
||||
rounding: 05up
|
||||
dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded
|
||||
dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded
|
||||
dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
|
||||
dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
|
||||
|
||||
-- random divide tests with result near 1
|
||||
rounding: half_even
|
||||
dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded
|
||||
dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded
|
||||
dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded
|
||||
dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded
|
||||
dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded
|
||||
dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded
|
||||
dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded
|
||||
dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded
|
||||
dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded
|
||||
dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded
|
||||
dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded
|
||||
dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded
|
||||
dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded
|
||||
dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded
|
||||
dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded
|
||||
dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded
|
||||
dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded
|
||||
dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded
|
||||
dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded
|
||||
dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded
|
||||
dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded
|
||||
dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded
|
||||
dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded
|
||||
dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded
|
||||
dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded
|
||||
dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded
|
||||
dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded
|
||||
dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded
|
||||
dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded
|
||||
dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded
|
||||
dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded
|
||||
dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded
|
||||
dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded
|
||||
dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded
|
||||
dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded
|
||||
dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded
|
||||
dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded
|
||||
dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded
|
||||
dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded
|
||||
dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded
|
||||
dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded
|
||||
dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded
|
||||
dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded
|
||||
dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded
|
||||
dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded
|
||||
dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded
|
||||
dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded
|
||||
dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded
|
||||
dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded
|
||||
dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded
|
||||
dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded
|
||||
dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded
|
||||
dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded
|
||||
dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded
|
||||
dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded
|
||||
dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded
|
||||
dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded
|
||||
dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded
|
||||
dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded
|
||||
dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded
|
||||
dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded
|
||||
dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded
|
||||
dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded
|
||||
dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded
|
||||
dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded
|
||||
dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded
|
||||
dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded
|
||||
dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded
|
||||
dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded
|
||||
dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded
|
||||
dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded
|
||||
dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded
|
||||
dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded
|
||||
dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded
|
||||
dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded
|
||||
dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded
|
||||
dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded
|
||||
dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded
|
||||
dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded
|
||||
dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded
|
||||
dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded
|
||||
dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded
|
||||
dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded
|
||||
dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded
|
||||
dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded
|
||||
dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded
|
||||
dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded
|
||||
dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded
|
||||
dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded
|
||||
dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded
|
||||
dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded
|
||||
dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded
|
||||
dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded
|
||||
dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded
|
||||
dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded
|
||||
dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded
|
||||
dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded
|
||||
dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded
|
||||
dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded
|
||||
|
||||
-- Null tests
|
||||
dddiv9998 divide 10 # -> NaN Invalid_operation
|
||||
dddiv9999 divide # 10 -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,449 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddDivideInt.decTest -- decDouble integer division --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
dddvi001 divideint 1 1 -> 1
|
||||
dddvi002 divideint 2 1 -> 2
|
||||
dddvi003 divideint 1 2 -> 0
|
||||
dddvi004 divideint 2 2 -> 1
|
||||
dddvi005 divideint 0 1 -> 0
|
||||
dddvi006 divideint 0 2 -> 0
|
||||
dddvi007 divideint 1 3 -> 0
|
||||
dddvi008 divideint 2 3 -> 0
|
||||
dddvi009 divideint 3 3 -> 1
|
||||
|
||||
dddvi010 divideint 2.4 1 -> 2
|
||||
dddvi011 divideint 2.4 -1 -> -2
|
||||
dddvi012 divideint -2.4 1 -> -2
|
||||
dddvi013 divideint -2.4 -1 -> 2
|
||||
dddvi014 divideint 2.40 1 -> 2
|
||||
dddvi015 divideint 2.400 1 -> 2
|
||||
dddvi016 divideint 2.4 2 -> 1
|
||||
dddvi017 divideint 2.400 2 -> 1
|
||||
dddvi018 divideint 2. 2 -> 1
|
||||
dddvi019 divideint 20 20 -> 1
|
||||
|
||||
dddvi020 divideint 187 187 -> 1
|
||||
dddvi021 divideint 5 2 -> 2
|
||||
dddvi022 divideint 5 2.0 -> 2
|
||||
dddvi023 divideint 5 2.000 -> 2
|
||||
dddvi024 divideint 5 0.200 -> 25
|
||||
dddvi025 divideint 5 0.200 -> 25
|
||||
|
||||
dddvi030 divideint 1 2 -> 0
|
||||
dddvi031 divideint 1 4 -> 0
|
||||
dddvi032 divideint 1 8 -> 0
|
||||
dddvi033 divideint 1 16 -> 0
|
||||
dddvi034 divideint 1 32 -> 0
|
||||
dddvi035 divideint 1 64 -> 0
|
||||
dddvi040 divideint 1 -2 -> -0
|
||||
dddvi041 divideint 1 -4 -> -0
|
||||
dddvi042 divideint 1 -8 -> -0
|
||||
dddvi043 divideint 1 -16 -> -0
|
||||
dddvi044 divideint 1 -32 -> -0
|
||||
dddvi045 divideint 1 -64 -> -0
|
||||
dddvi050 divideint -1 2 -> -0
|
||||
dddvi051 divideint -1 4 -> -0
|
||||
dddvi052 divideint -1 8 -> -0
|
||||
dddvi053 divideint -1 16 -> -0
|
||||
dddvi054 divideint -1 32 -> -0
|
||||
dddvi055 divideint -1 64 -> -0
|
||||
dddvi060 divideint -1 -2 -> 0
|
||||
dddvi061 divideint -1 -4 -> 0
|
||||
dddvi062 divideint -1 -8 -> 0
|
||||
dddvi063 divideint -1 -16 -> 0
|
||||
dddvi064 divideint -1 -32 -> 0
|
||||
dddvi065 divideint -1 -64 -> 0
|
||||
|
||||
-- similar with powers of ten
|
||||
dddvi160 divideint 1 1 -> 1
|
||||
dddvi161 divideint 1 10 -> 0
|
||||
dddvi162 divideint 1 100 -> 0
|
||||
dddvi163 divideint 1 1000 -> 0
|
||||
dddvi164 divideint 1 10000 -> 0
|
||||
dddvi165 divideint 1 100000 -> 0
|
||||
dddvi166 divideint 1 1000000 -> 0
|
||||
dddvi167 divideint 1 10000000 -> 0
|
||||
dddvi168 divideint 1 100000000 -> 0
|
||||
dddvi170 divideint 1 -1 -> -1
|
||||
dddvi171 divideint 1 -10 -> -0
|
||||
dddvi172 divideint 1 -100 -> -0
|
||||
dddvi173 divideint 1 -1000 -> -0
|
||||
dddvi174 divideint 1 -10000 -> -0
|
||||
dddvi175 divideint 1 -100000 -> -0
|
||||
dddvi176 divideint 1 -1000000 -> -0
|
||||
dddvi177 divideint 1 -10000000 -> -0
|
||||
dddvi178 divideint 1 -100000000 -> -0
|
||||
dddvi180 divideint -1 1 -> -1
|
||||
dddvi181 divideint -1 10 -> -0
|
||||
dddvi182 divideint -1 100 -> -0
|
||||
dddvi183 divideint -1 1000 -> -0
|
||||
dddvi184 divideint -1 10000 -> -0
|
||||
dddvi185 divideint -1 100000 -> -0
|
||||
dddvi186 divideint -1 1000000 -> -0
|
||||
dddvi187 divideint -1 10000000 -> -0
|
||||
dddvi188 divideint -1 100000000 -> -0
|
||||
dddvi190 divideint -1 -1 -> 1
|
||||
dddvi191 divideint -1 -10 -> 0
|
||||
dddvi192 divideint -1 -100 -> 0
|
||||
dddvi193 divideint -1 -1000 -> 0
|
||||
dddvi194 divideint -1 -10000 -> 0
|
||||
dddvi195 divideint -1 -100000 -> 0
|
||||
dddvi196 divideint -1 -1000000 -> 0
|
||||
dddvi197 divideint -1 -10000000 -> 0
|
||||
dddvi198 divideint -1 -100000000 -> 0
|
||||
|
||||
-- some long operand (at p=9) cases
|
||||
dddvi070 divideint 999999999 1 -> 999999999
|
||||
dddvi071 divideint 999999999.4 1 -> 999999999
|
||||
dddvi072 divideint 999999999.5 1 -> 999999999
|
||||
dddvi073 divideint 999999999.9 1 -> 999999999
|
||||
dddvi074 divideint 999999999.999 1 -> 999999999
|
||||
|
||||
dddvi090 divideint 0. 1 -> 0
|
||||
dddvi091 divideint .0 1 -> 0
|
||||
dddvi092 divideint 0.00 1 -> 0
|
||||
dddvi093 divideint 0.00E+9 1 -> 0
|
||||
dddvi094 divideint 0.0000E-50 1 -> 0
|
||||
|
||||
dddvi100 divideint 1 1 -> 1
|
||||
dddvi101 divideint 1 2 -> 0
|
||||
dddvi102 divideint 1 3 -> 0
|
||||
dddvi103 divideint 1 4 -> 0
|
||||
dddvi104 divideint 1 5 -> 0
|
||||
dddvi105 divideint 1 6 -> 0
|
||||
dddvi106 divideint 1 7 -> 0
|
||||
dddvi107 divideint 1 8 -> 0
|
||||
dddvi108 divideint 1 9 -> 0
|
||||
dddvi109 divideint 1 10 -> 0
|
||||
dddvi110 divideint 1 1 -> 1
|
||||
dddvi111 divideint 2 1 -> 2
|
||||
dddvi112 divideint 3 1 -> 3
|
||||
dddvi113 divideint 4 1 -> 4
|
||||
dddvi114 divideint 5 1 -> 5
|
||||
dddvi115 divideint 6 1 -> 6
|
||||
dddvi116 divideint 7 1 -> 7
|
||||
dddvi117 divideint 8 1 -> 8
|
||||
dddvi118 divideint 9 1 -> 9
|
||||
dddvi119 divideint 10 1 -> 10
|
||||
|
||||
-- from DiagBigDecimal
|
||||
dddvi131 divideint 101.3 1 -> 101
|
||||
dddvi132 divideint 101.0 1 -> 101
|
||||
dddvi133 divideint 101.3 3 -> 33
|
||||
dddvi134 divideint 101.0 3 -> 33
|
||||
dddvi135 divideint 2.4 1 -> 2
|
||||
dddvi136 divideint 2.400 1 -> 2
|
||||
dddvi137 divideint 18 18 -> 1
|
||||
dddvi138 divideint 1120 1000 -> 1
|
||||
dddvi139 divideint 2.4 2 -> 1
|
||||
dddvi140 divideint 2.400 2 -> 1
|
||||
dddvi141 divideint 0.5 2.000 -> 0
|
||||
dddvi142 divideint 8.005 7 -> 1
|
||||
dddvi143 divideint 5 2 -> 2
|
||||
dddvi144 divideint 0 2 -> 0
|
||||
dddvi145 divideint 0.00 2 -> 0
|
||||
|
||||
-- Others
|
||||
dddvi150 divideint 12345 4.999 -> 2469
|
||||
dddvi151 divideint 12345 4.99 -> 2473
|
||||
dddvi152 divideint 12345 4.9 -> 2519
|
||||
dddvi153 divideint 12345 5 -> 2469
|
||||
dddvi154 divideint 12345 5.1 -> 2420
|
||||
dddvi155 divideint 12345 5.01 -> 2464
|
||||
dddvi156 divideint 12345 5.001 -> 2468
|
||||
dddvi157 divideint 101 7.6 -> 13
|
||||
|
||||
-- Various flavours of divideint by 0
|
||||
dddvi201 divideint 0 0 -> NaN Division_undefined
|
||||
dddvi202 divideint 0.0E5 0 -> NaN Division_undefined
|
||||
dddvi203 divideint 0.000 0 -> NaN Division_undefined
|
||||
dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero
|
||||
dddvi205 divideint 0.01 0 -> Infinity Division_by_zero
|
||||
dddvi206 divideint 0.1 0 -> Infinity Division_by_zero
|
||||
dddvi207 divideint 1 0 -> Infinity Division_by_zero
|
||||
dddvi208 divideint 1 0.0 -> Infinity Division_by_zero
|
||||
dddvi209 divideint 10 0.0 -> Infinity Division_by_zero
|
||||
dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
|
||||
dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero
|
||||
dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
|
||||
dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero
|
||||
dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero
|
||||
dddvi217 divideint -1 0 -> -Infinity Division_by_zero
|
||||
dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero
|
||||
dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero
|
||||
dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
|
||||
dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
|
||||
|
||||
-- test some cases that are close to exponent overflow
|
||||
dddvi270 divideint 1 1e384 -> 0
|
||||
dddvi271 divideint 1 0.9e384 -> 0
|
||||
dddvi272 divideint 1 0.99e384 -> 0
|
||||
dddvi273 divideint 1 0.9999999999999999e384 -> 0
|
||||
dddvi274 divideint 9e384 1 -> NaN Division_impossible
|
||||
dddvi275 divideint 9.9e384 1 -> NaN Division_impossible
|
||||
dddvi276 divideint 9.99e384 1 -> NaN Division_impossible
|
||||
dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
|
||||
|
||||
dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible
|
||||
dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible
|
||||
dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible
|
||||
dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible
|
||||
dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible
|
||||
|
||||
-- GD edge cases: lhs smaller than rhs but more digits
|
||||
dddvi301 divideint 0.9 2 -> 0
|
||||
dddvi302 divideint 0.9 2.0 -> 0
|
||||
dddvi303 divideint 0.9 2.1 -> 0
|
||||
dddvi304 divideint 0.9 2.00 -> 0
|
||||
dddvi305 divideint 0.9 2.01 -> 0
|
||||
dddvi306 divideint 0.12 1 -> 0
|
||||
dddvi307 divideint 0.12 1.0 -> 0
|
||||
dddvi308 divideint 0.12 1.00 -> 0
|
||||
dddvi309 divideint 0.12 1.0 -> 0
|
||||
dddvi310 divideint 0.12 1.00 -> 0
|
||||
dddvi311 divideint 0.12 2 -> 0
|
||||
dddvi312 divideint 0.12 2.0 -> 0
|
||||
dddvi313 divideint 0.12 2.1 -> 0
|
||||
dddvi314 divideint 0.12 2.00 -> 0
|
||||
dddvi315 divideint 0.12 2.01 -> 0
|
||||
|
||||
-- edge cases of impossible
|
||||
dddvi330 divideint 1234567890123456 10 -> 123456789012345
|
||||
dddvi331 divideint 1234567890123456 1 -> 1234567890123456
|
||||
dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible
|
||||
dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible
|
||||
|
||||
-- overflow and underflow tests [from divide]
|
||||
dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
|
||||
dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
|
||||
dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
|
||||
dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
|
||||
dddvi1055 divideint 1e-277 1e+311 -> 0
|
||||
dddvi1056 divideint 1e-277 -1e+311 -> -0
|
||||
dddvi1057 divideint -1e-277 1e+311 -> -0
|
||||
dddvi1058 divideint -1e-277 -1e+311 -> 0
|
||||
|
||||
-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
|
||||
dddvi1060 divideint 1e-291 1e+101 -> 0
|
||||
dddvi1061 divideint 1e-291 1e+102 -> 0
|
||||
dddvi1062 divideint 1e-291 1e+103 -> 0
|
||||
dddvi1063 divideint 1e-291 1e+104 -> 0
|
||||
dddvi1064 divideint 1e-291 1e+105 -> 0
|
||||
dddvi1065 divideint 1e-291 1e+106 -> 0
|
||||
dddvi1066 divideint 1e-291 1e+107 -> 0
|
||||
dddvi1067 divideint 1e-291 1e+108 -> 0
|
||||
dddvi1068 divideint 1e-291 1e+109 -> 0
|
||||
dddvi1069 divideint 1e-291 1e+110 -> 0
|
||||
|
||||
dddvi1101 divideint 1.0000E-394 1 -> 0
|
||||
dddvi1102 divideint 1.000E-394 1e+1 -> 0
|
||||
dddvi1103 divideint 1.00E-394 1e+2 -> 0
|
||||
|
||||
dddvi1118 divideint 1E-394 1e+4 -> 0
|
||||
dddvi1119 divideint 3E-394 -1e+5 -> -0
|
||||
dddvi1120 divideint 5E-394 1e+5 -> 0
|
||||
|
||||
dddvi1124 divideint 1E-394 -1e+4 -> -0
|
||||
dddvi1130 divideint 3.0E-394 -1e+5 -> -0
|
||||
|
||||
dddvi1131 divideint 1.0E-199 1e+200 -> 0
|
||||
dddvi1132 divideint 1.0E-199 1e+199 -> 0
|
||||
dddvi1133 divideint 1.0E-199 1e+198 -> 0
|
||||
dddvi1134 divideint 2.0E-199 2e+198 -> 0
|
||||
dddvi1135 divideint 4.0E-199 4e+198 -> 0
|
||||
|
||||
-- long operand checks
|
||||
dddvi401 divideint 12345678000 100 -> 123456780
|
||||
dddvi402 divideint 1 12345678000 -> 0
|
||||
dddvi403 divideint 1234567800 10 -> 123456780
|
||||
dddvi404 divideint 1 1234567800 -> 0
|
||||
dddvi405 divideint 1234567890 10 -> 123456789
|
||||
dddvi406 divideint 1 1234567890 -> 0
|
||||
dddvi407 divideint 1234567891 10 -> 123456789
|
||||
dddvi408 divideint 1 1234567891 -> 0
|
||||
dddvi409 divideint 12345678901 100 -> 123456789
|
||||
dddvi410 divideint 1 12345678901 -> 0
|
||||
dddvi411 divideint 1234567896 10 -> 123456789
|
||||
dddvi412 divideint 1 1234567896 -> 0
|
||||
dddvi413 divideint 12345678948 100 -> 123456789
|
||||
dddvi414 divideint 12345678949 100 -> 123456789
|
||||
dddvi415 divideint 12345678950 100 -> 123456789
|
||||
dddvi416 divideint 12345678951 100 -> 123456789
|
||||
dddvi417 divideint 12345678999 100 -> 123456789
|
||||
dddvi441 divideint 12345678000 1 -> 12345678000
|
||||
dddvi442 divideint 1 12345678000 -> 0
|
||||
dddvi443 divideint 1234567800 1 -> 1234567800
|
||||
dddvi444 divideint 1 1234567800 -> 0
|
||||
dddvi445 divideint 1234567890 1 -> 1234567890
|
||||
dddvi446 divideint 1 1234567890 -> 0
|
||||
dddvi447 divideint 1234567891 1 -> 1234567891
|
||||
dddvi448 divideint 1 1234567891 -> 0
|
||||
dddvi449 divideint 12345678901 1 -> 12345678901
|
||||
dddvi450 divideint 1 12345678901 -> 0
|
||||
dddvi451 divideint 1234567896 1 -> 1234567896
|
||||
dddvi452 divideint 1 1234567896 -> 0
|
||||
|
||||
-- more zeros, etc.
|
||||
dddvi531 divideint 5.00 1E-3 -> 5000
|
||||
dddvi532 divideint 00.00 0.000 -> NaN Division_undefined
|
||||
dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined
|
||||
dddvi534 divideint 0 -0 -> NaN Division_undefined
|
||||
dddvi535 divideint -0 0 -> NaN Division_undefined
|
||||
dddvi536 divideint -0 -0 -> NaN Division_undefined
|
||||
|
||||
dddvi541 divideint 0 -1 -> -0
|
||||
dddvi542 divideint -0 -1 -> 0
|
||||
dddvi543 divideint 0 1 -> 0
|
||||
dddvi544 divideint -0 1 -> -0
|
||||
dddvi545 divideint -1 0 -> -Infinity Division_by_zero
|
||||
dddvi546 divideint -1 -0 -> Infinity Division_by_zero
|
||||
dddvi547 divideint 1 0 -> Infinity Division_by_zero
|
||||
dddvi548 divideint 1 -0 -> -Infinity Division_by_zero
|
||||
|
||||
dddvi551 divideint 0.0 -1 -> -0
|
||||
dddvi552 divideint -0.0 -1 -> 0
|
||||
dddvi553 divideint 0.0 1 -> 0
|
||||
dddvi554 divideint -0.0 1 -> -0
|
||||
dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero
|
||||
dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero
|
||||
dddvi557 divideint 1.0 0 -> Infinity Division_by_zero
|
||||
dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
|
||||
|
||||
dddvi561 divideint 0 -1.0 -> -0
|
||||
dddvi562 divideint -0 -1.0 -> 0
|
||||
dddvi563 divideint 0 1.0 -> 0
|
||||
dddvi564 divideint -0 1.0 -> -0
|
||||
dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero
|
||||
dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero
|
||||
dddvi567 divideint 1 0.0 -> Infinity Division_by_zero
|
||||
dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
|
||||
|
||||
dddvi571 divideint 0.0 -1.0 -> -0
|
||||
dddvi572 divideint -0.0 -1.0 -> 0
|
||||
dddvi573 divideint 0.0 1.0 -> 0
|
||||
dddvi574 divideint -0.0 1.0 -> -0
|
||||
dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
|
||||
dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
|
||||
dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
|
||||
dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
|
||||
|
||||
-- Specials
|
||||
dddvi580 divideint Inf -Inf -> NaN Invalid_operation
|
||||
dddvi581 divideint Inf -1000 -> -Infinity
|
||||
dddvi582 divideint Inf -1 -> -Infinity
|
||||
dddvi583 divideint Inf -0 -> -Infinity
|
||||
dddvi584 divideint Inf 0 -> Infinity
|
||||
dddvi585 divideint Inf 1 -> Infinity
|
||||
dddvi586 divideint Inf 1000 -> Infinity
|
||||
dddvi587 divideint Inf Inf -> NaN Invalid_operation
|
||||
dddvi588 divideint -1000 Inf -> -0
|
||||
dddvi589 divideint -Inf Inf -> NaN Invalid_operation
|
||||
dddvi590 divideint -1 Inf -> -0
|
||||
dddvi591 divideint -0 Inf -> -0
|
||||
dddvi592 divideint 0 Inf -> 0
|
||||
dddvi593 divideint 1 Inf -> 0
|
||||
dddvi594 divideint 1000 Inf -> 0
|
||||
dddvi595 divideint Inf Inf -> NaN Invalid_operation
|
||||
|
||||
dddvi600 divideint -Inf -Inf -> NaN Invalid_operation
|
||||
dddvi601 divideint -Inf -1000 -> Infinity
|
||||
dddvi602 divideint -Inf -1 -> Infinity
|
||||
dddvi603 divideint -Inf -0 -> Infinity
|
||||
dddvi604 divideint -Inf 0 -> -Infinity
|
||||
dddvi605 divideint -Inf 1 -> -Infinity
|
||||
dddvi606 divideint -Inf 1000 -> -Infinity
|
||||
dddvi607 divideint -Inf Inf -> NaN Invalid_operation
|
||||
dddvi608 divideint -1000 Inf -> -0
|
||||
dddvi609 divideint -Inf -Inf -> NaN Invalid_operation
|
||||
dddvi610 divideint -1 -Inf -> 0
|
||||
dddvi611 divideint -0 -Inf -> 0
|
||||
dddvi612 divideint 0 -Inf -> -0
|
||||
dddvi613 divideint 1 -Inf -> -0
|
||||
dddvi614 divideint 1000 -Inf -> -0
|
||||
dddvi615 divideint Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
dddvi621 divideint NaN -Inf -> NaN
|
||||
dddvi622 divideint NaN -1000 -> NaN
|
||||
dddvi623 divideint NaN -1 -> NaN
|
||||
dddvi624 divideint NaN -0 -> NaN
|
||||
dddvi625 divideint NaN 0 -> NaN
|
||||
dddvi626 divideint NaN 1 -> NaN
|
||||
dddvi627 divideint NaN 1000 -> NaN
|
||||
dddvi628 divideint NaN Inf -> NaN
|
||||
dddvi629 divideint NaN NaN -> NaN
|
||||
dddvi630 divideint -Inf NaN -> NaN
|
||||
dddvi631 divideint -1000 NaN -> NaN
|
||||
dddvi632 divideint -1 NaN -> NaN
|
||||
dddvi633 divideint -0 NaN -> NaN
|
||||
dddvi634 divideint 0 NaN -> NaN
|
||||
dddvi635 divideint 1 NaN -> NaN
|
||||
dddvi636 divideint 1000 NaN -> NaN
|
||||
dddvi637 divideint Inf NaN -> NaN
|
||||
|
||||
dddvi641 divideint sNaN -Inf -> NaN Invalid_operation
|
||||
dddvi642 divideint sNaN -1000 -> NaN Invalid_operation
|
||||
dddvi643 divideint sNaN -1 -> NaN Invalid_operation
|
||||
dddvi644 divideint sNaN -0 -> NaN Invalid_operation
|
||||
dddvi645 divideint sNaN 0 -> NaN Invalid_operation
|
||||
dddvi646 divideint sNaN 1 -> NaN Invalid_operation
|
||||
dddvi647 divideint sNaN 1000 -> NaN Invalid_operation
|
||||
dddvi648 divideint sNaN NaN -> NaN Invalid_operation
|
||||
dddvi649 divideint sNaN sNaN -> NaN Invalid_operation
|
||||
dddvi650 divideint NaN sNaN -> NaN Invalid_operation
|
||||
dddvi651 divideint -Inf sNaN -> NaN Invalid_operation
|
||||
dddvi652 divideint -1000 sNaN -> NaN Invalid_operation
|
||||
dddvi653 divideint -1 sNaN -> NaN Invalid_operation
|
||||
dddvi654 divideint -0 sNaN -> NaN Invalid_operation
|
||||
dddvi655 divideint 0 sNaN -> NaN Invalid_operation
|
||||
dddvi656 divideint 1 sNaN -> NaN Invalid_operation
|
||||
dddvi657 divideint 1000 sNaN -> NaN Invalid_operation
|
||||
dddvi658 divideint Inf sNaN -> NaN Invalid_operation
|
||||
dddvi659 divideint NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
dddvi661 divideint NaN9 -Inf -> NaN9
|
||||
dddvi662 divideint NaN8 1000 -> NaN8
|
||||
dddvi663 divideint NaN7 Inf -> NaN7
|
||||
dddvi664 divideint -NaN6 NaN5 -> -NaN6
|
||||
dddvi665 divideint -Inf NaN4 -> NaN4
|
||||
dddvi666 divideint -1000 NaN3 -> NaN3
|
||||
dddvi667 divideint Inf -NaN2 -> -NaN2
|
||||
|
||||
dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
|
||||
dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
|
||||
dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
|
||||
dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
|
||||
dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
dddvi900 divideint 10 # -> NaN Invalid_operation
|
||||
dddvi901 divideint # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,487 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddEncode.decTest -- decimal eight-byte format testcases --
|
||||
-- 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 --
|
||||
-- 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 --
|
||||
------------------------------------------------------------------------
|
||||
-- [Previously called decimal64.decTest]
|
||||
version: 2.56
|
||||
|
||||
-- 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
|
||||
|
||||
-- The testcases here have only exactly representable data on the
|
||||
-- 'left-hand-side'; rounding from strings is tested in 'base'
|
||||
-- testcase groups.
|
||||
|
||||
extended: 1
|
||||
clamp: 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
|
||||
-- derivative canonical plain strings
|
||||
dece003 apply #A23c0000000003D0 -> -7.50E+3
|
||||
dece004 apply -7.50E+3 -> #A23c0000000003D0
|
||||
dece005 apply #A2380000000003D0 -> -750
|
||||
dece006 apply -750 -> #A2380000000003D0
|
||||
dece007 apply #A2340000000003D0 -> -75.0
|
||||
dece008 apply -75.0 -> #A2340000000003D0
|
||||
dece009 apply #A22c0000000003D0 -> -0.750
|
||||
dece010 apply -0.750 -> #A22c0000000003D0
|
||||
dece011 apply #A2280000000003D0 -> -0.0750
|
||||
dece012 apply -0.0750 -> #A2280000000003D0
|
||||
dece013 apply #A2200000000003D0 -> -0.000750
|
||||
dece014 apply -0.000750 -> #A2200000000003D0
|
||||
dece015 apply #A2180000000003D0 -> -0.00000750
|
||||
dece016 apply -0.00000750 -> #A2180000000003D0
|
||||
dece017 apply #A2140000000003D0 -> -7.50E-7
|
||||
dece018 apply -7.50E-7 -> #A2140000000003D0
|
||||
|
||||
-- Normality
|
||||
dece020 apply 1234567890123456 -> #263934b9c1e28e56
|
||||
dece021 apply -1234567890123456 -> #a63934b9c1e28e56
|
||||
dece022 apply 1234.567890123456 -> #260934b9c1e28e56
|
||||
dece023 apply #260934b9c1e28e56 -> 1234.567890123456
|
||||
dece024 apply 1111111111111111 -> #2638912449124491
|
||||
dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff
|
||||
|
||||
-- Nmax and similar
|
||||
dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff
|
||||
dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
|
||||
dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384
|
||||
dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56
|
||||
dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384
|
||||
-- fold-downs (more below)
|
||||
dece036 apply 1.23E+384 -> #47fd300000000000 Clamped
|
||||
dece037 apply #47fd300000000000 -> 1.230000000000000E+384
|
||||
decd038 apply 1E+384 -> #47fc000000000000 Clamped
|
||||
decd039 apply #47fc000000000000 -> 1.000000000000000E+384
|
||||
|
||||
decd051 apply 12345 -> #22380000000049c5
|
||||
decd052 apply #22380000000049c5 -> 12345
|
||||
decd053 apply 1234 -> #2238000000000534
|
||||
decd054 apply #2238000000000534 -> 1234
|
||||
decd055 apply 123 -> #22380000000000a3
|
||||
decd056 apply #22380000000000a3 -> 123
|
||||
decd057 apply 12 -> #2238000000000012
|
||||
decd058 apply #2238000000000012 -> 12
|
||||
decd059 apply 1 -> #2238000000000001
|
||||
decd060 apply #2238000000000001 -> 1
|
||||
decd061 apply 1.23 -> #22300000000000a3
|
||||
decd062 apply #22300000000000a3 -> 1.23
|
||||
decd063 apply 123.45 -> #22300000000049c5
|
||||
decd064 apply #22300000000049c5 -> 123.45
|
||||
|
||||
-- Nmin and below
|
||||
decd071 apply 1E-383 -> #003c000000000001
|
||||
decd072 apply #003c000000000001 -> 1E-383
|
||||
decd073 apply 1.000000000000000E-383 -> #0400000000000000
|
||||
decd074 apply #0400000000000000 -> 1.000000000000000E-383
|
||||
decd075 apply 1.000000000000001E-383 -> #0400000000000001
|
||||
decd076 apply #0400000000000001 -> 1.000000000000001E-383
|
||||
|
||||
decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal
|
||||
decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal
|
||||
decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal
|
||||
decd080 apply #0000000000000010 -> 1.0E-397 Subnormal
|
||||
decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal
|
||||
decd082 apply #0004000000000001 -> 1E-397 Subnormal
|
||||
decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal
|
||||
decd084 apply #0000000000000001 -> 1E-398 Subnormal
|
||||
-- next is smallest all-nines
|
||||
decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff
|
||||
decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383
|
||||
-- and a problematic divide result
|
||||
decd088 apply 1.111111111111111E-383 -> #0400912449124491
|
||||
decd089 apply #0400912449124491 -> 1.111111111111111E-383
|
||||
|
||||
-- forties
|
||||
decd090 apply 40 -> #2238000000000040
|
||||
decd091 apply 39.99 -> #2230000000000cff
|
||||
|
||||
-- underflows cannot be tested as all LHS exact
|
||||
|
||||
-- Same again, negatives
|
||||
-- Nmax and similar
|
||||
decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff
|
||||
decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384
|
||||
decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56
|
||||
decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384
|
||||
-- fold-downs (more below)
|
||||
decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped
|
||||
decd131 apply #c7fd300000000000 -> -1.230000000000000E+384
|
||||
decd132 apply -1E+384 -> #c7fc000000000000 Clamped
|
||||
decd133 apply #c7fc000000000000 -> -1.000000000000000E+384
|
||||
|
||||
-- overflows
|
||||
decd151 apply -12345 -> #a2380000000049c5
|
||||
decd152 apply #a2380000000049c5 -> -12345
|
||||
decd153 apply -1234 -> #a238000000000534
|
||||
decd154 apply #a238000000000534 -> -1234
|
||||
decd155 apply -123 -> #a2380000000000a3
|
||||
decd156 apply #a2380000000000a3 -> -123
|
||||
decd157 apply -12 -> #a238000000000012
|
||||
decd158 apply #a238000000000012 -> -12
|
||||
decd159 apply -1 -> #a238000000000001
|
||||
decd160 apply #a238000000000001 -> -1
|
||||
decd161 apply -1.23 -> #a2300000000000a3
|
||||
decd162 apply #a2300000000000a3 -> -1.23
|
||||
decd163 apply -123.45 -> #a2300000000049c5
|
||||
decd164 apply #a2300000000049c5 -> -123.45
|
||||
|
||||
-- Nmin and below
|
||||
decd171 apply -1E-383 -> #803c000000000001
|
||||
decd172 apply #803c000000000001 -> -1E-383
|
||||
decd173 apply -1.000000000000000E-383 -> #8400000000000000
|
||||
decd174 apply #8400000000000000 -> -1.000000000000000E-383
|
||||
decd175 apply -1.000000000000001E-383 -> #8400000000000001
|
||||
decd176 apply #8400000000000001 -> -1.000000000000001E-383
|
||||
|
||||
decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal
|
||||
decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal
|
||||
decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal
|
||||
decd180 apply #8000000000000010 -> -1.0E-397 Subnormal
|
||||
decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal
|
||||
decd182 apply #8004000000000001 -> -1E-397 Subnormal
|
||||
decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal
|
||||
decd184 apply #8000000000000001 -> -1E-398 Subnormal
|
||||
-- next is smallest all-nines
|
||||
decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff
|
||||
decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383
|
||||
-- and a tricky subnormal
|
||||
decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal
|
||||
decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal
|
||||
|
||||
-- near-underflows
|
||||
decd189 apply -1e-398 -> #8000000000000001 Subnormal
|
||||
decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
|
||||
|
||||
-- zeros
|
||||
decd401 apply 0E-500 -> #0000000000000000 Clamped
|
||||
decd402 apply 0E-400 -> #0000000000000000 Clamped
|
||||
decd403 apply 0E-398 -> #0000000000000000
|
||||
decd404 apply #0000000000000000 -> 0E-398
|
||||
decd405 apply 0.000000000000000E-383 -> #0000000000000000
|
||||
decd406 apply #0000000000000000 -> 0E-398
|
||||
decd407 apply 0E-2 -> #2230000000000000
|
||||
decd408 apply #2230000000000000 -> 0.00
|
||||
decd409 apply 0 -> #2238000000000000
|
||||
decd410 apply #2238000000000000 -> 0
|
||||
decd411 apply 0E+3 -> #2244000000000000
|
||||
decd412 apply #2244000000000000 -> 0E+3
|
||||
decd413 apply 0E+369 -> #43fc000000000000
|
||||
decd414 apply #43fc000000000000 -> 0E+369
|
||||
-- clamped zeros...
|
||||
decd415 apply 0E+370 -> #43fc000000000000 Clamped
|
||||
decd416 apply #43fc000000000000 -> 0E+369
|
||||
decd417 apply 0E+384 -> #43fc000000000000 Clamped
|
||||
decd418 apply #43fc000000000000 -> 0E+369
|
||||
decd419 apply 0E+400 -> #43fc000000000000 Clamped
|
||||
decd420 apply #43fc000000000000 -> 0E+369
|
||||
decd421 apply 0E+500 -> #43fc000000000000 Clamped
|
||||
decd422 apply #43fc000000000000 -> 0E+369
|
||||
|
||||
-- negative zeros
|
||||
decd431 apply -0E-400 -> #8000000000000000 Clamped
|
||||
decd432 apply -0E-400 -> #8000000000000000 Clamped
|
||||
decd433 apply -0E-398 -> #8000000000000000
|
||||
decd434 apply #8000000000000000 -> -0E-398
|
||||
decd435 apply -0.000000000000000E-383 -> #8000000000000000
|
||||
decd436 apply #8000000000000000 -> -0E-398
|
||||
decd437 apply -0E-2 -> #a230000000000000
|
||||
decd438 apply #a230000000000000 -> -0.00
|
||||
decd439 apply -0 -> #a238000000000000
|
||||
decd440 apply #a238000000000000 -> -0
|
||||
decd441 apply -0E+3 -> #a244000000000000
|
||||
decd442 apply #a244000000000000 -> -0E+3
|
||||
decd443 apply -0E+369 -> #c3fc000000000000
|
||||
decd444 apply #c3fc000000000000 -> -0E+369
|
||||
-- clamped zeros...
|
||||
decd445 apply -0E+370 -> #c3fc000000000000 Clamped
|
||||
decd446 apply #c3fc000000000000 -> -0E+369
|
||||
decd447 apply -0E+384 -> #c3fc000000000000 Clamped
|
||||
decd448 apply #c3fc000000000000 -> -0E+369
|
||||
decd449 apply -0E+400 -> #c3fc000000000000 Clamped
|
||||
decd450 apply #c3fc000000000000 -> -0E+369
|
||||
decd451 apply -0E+500 -> #c3fc000000000000 Clamped
|
||||
decd452 apply #c3fc000000000000 -> -0E+369
|
||||
|
||||
-- exponents
|
||||
decd460 apply #225c000000000007 -> 7E+9
|
||||
decd461 apply 7E+9 -> #225c000000000007
|
||||
decd462 apply #23c4000000000007 -> 7E+99
|
||||
decd463 apply 7E+99 -> #23c4000000000007
|
||||
|
||||
-- Specials
|
||||
decd500 apply Infinity -> #7800000000000000
|
||||
decd501 apply #7878787878787878 -> #7800000000000000
|
||||
decd502 apply #7800000000000000 -> Infinity
|
||||
decd503 apply #7979797979797979 -> #7800000000000000
|
||||
decd504 apply #7900000000000000 -> Infinity
|
||||
decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000
|
||||
decd506 apply #7a00000000000000 -> Infinity
|
||||
decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000
|
||||
decd508 apply #7b00000000000000 -> Infinity
|
||||
|
||||
decd509 apply NaN -> #7c00000000000000
|
||||
decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
|
||||
decd511 apply #7c00000000000000 -> NaN
|
||||
decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
|
||||
decd513 apply #7d00000000000000 -> NaN
|
||||
decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
|
||||
decd515 apply #7e00000000000000 -> sNaN
|
||||
decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
|
||||
decd517 apply #7f00000000000000 -> sNaN
|
||||
decd518 apply #7fffffffffffffff -> sNaN999999999999999
|
||||
decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff
|
||||
|
||||
decd520 apply -Infinity -> #f800000000000000
|
||||
decd521 apply #f878787878787878 -> #f800000000000000
|
||||
decd522 apply #f800000000000000 -> -Infinity
|
||||
decd523 apply #f979797979797979 -> #f800000000000000
|
||||
decd524 apply #f900000000000000 -> -Infinity
|
||||
decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000
|
||||
decd526 apply #fa00000000000000 -> -Infinity
|
||||
decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000
|
||||
decd528 apply #fb00000000000000 -> -Infinity
|
||||
|
||||
decd529 apply -NaN -> #fc00000000000000
|
||||
decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
|
||||
decd531 apply #fc00000000000000 -> -NaN
|
||||
decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
|
||||
decd533 apply #fd00000000000000 -> -NaN
|
||||
decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
|
||||
decd535 apply #fe00000000000000 -> -sNaN
|
||||
decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
|
||||
decd537 apply #ff00000000000000 -> -sNaN
|
||||
decd538 apply #ffffffffffffffff -> -sNaN999999999999999
|
||||
decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff
|
||||
|
||||
-- diagnostic NaNs
|
||||
decd540 apply NaN -> #7c00000000000000
|
||||
decd541 apply NaN0 -> #7c00000000000000
|
||||
decd542 apply NaN1 -> #7c00000000000001
|
||||
decd543 apply NaN12 -> #7c00000000000012
|
||||
decd544 apply NaN79 -> #7c00000000000079
|
||||
decd545 apply NaN12345 -> #7c000000000049c5
|
||||
decd546 apply NaN123456 -> #7c00000000028e56
|
||||
decd547 apply NaN799799 -> #7c000000000f7fdf
|
||||
decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf
|
||||
decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff
|
||||
-- too many digits
|
||||
|
||||
-- fold-down full sequence
|
||||
decd601 apply 1E+384 -> #47fc000000000000 Clamped
|
||||
decd602 apply #47fc000000000000 -> 1.000000000000000E+384
|
||||
decd603 apply 1E+383 -> #43fc800000000000 Clamped
|
||||
decd604 apply #43fc800000000000 -> 1.00000000000000E+383
|
||||
decd605 apply 1E+382 -> #43fc100000000000 Clamped
|
||||
decd606 apply #43fc100000000000 -> 1.0000000000000E+382
|
||||
decd607 apply 1E+381 -> #43fc010000000000 Clamped
|
||||
decd608 apply #43fc010000000000 -> 1.000000000000E+381
|
||||
decd609 apply 1E+380 -> #43fc002000000000 Clamped
|
||||
decd610 apply #43fc002000000000 -> 1.00000000000E+380
|
||||
decd611 apply 1E+379 -> #43fc000400000000 Clamped
|
||||
decd612 apply #43fc000400000000 -> 1.0000000000E+379
|
||||
decd613 apply 1E+378 -> #43fc000040000000 Clamped
|
||||
decd614 apply #43fc000040000000 -> 1.000000000E+378
|
||||
decd615 apply 1E+377 -> #43fc000008000000 Clamped
|
||||
decd616 apply #43fc000008000000 -> 1.00000000E+377
|
||||
decd617 apply 1E+376 -> #43fc000001000000 Clamped
|
||||
decd618 apply #43fc000001000000 -> 1.0000000E+376
|
||||
decd619 apply 1E+375 -> #43fc000000100000 Clamped
|
||||
decd620 apply #43fc000000100000 -> 1.000000E+375
|
||||
decd621 apply 1E+374 -> #43fc000000020000 Clamped
|
||||
decd622 apply #43fc000000020000 -> 1.00000E+374
|
||||
decd623 apply 1E+373 -> #43fc000000004000 Clamped
|
||||
decd624 apply #43fc000000004000 -> 1.0000E+373
|
||||
decd625 apply 1E+372 -> #43fc000000000400 Clamped
|
||||
decd626 apply #43fc000000000400 -> 1.000E+372
|
||||
decd627 apply 1E+371 -> #43fc000000000080 Clamped
|
||||
decd628 apply #43fc000000000080 -> 1.00E+371
|
||||
decd629 apply 1E+370 -> #43fc000000000010 Clamped
|
||||
decd630 apply #43fc000000000010 -> 1.0E+370
|
||||
decd631 apply 1E+369 -> #43fc000000000001
|
||||
decd632 apply #43fc000000000001 -> 1E+369
|
||||
decd633 apply 1E+368 -> #43f8000000000001
|
||||
decd634 apply #43f8000000000001 -> 1E+368
|
||||
-- same with 9s
|
||||
decd641 apply 9E+384 -> #77fc000000000000 Clamped
|
||||
decd642 apply #77fc000000000000 -> 9.000000000000000E+384
|
||||
decd643 apply 9E+383 -> #43fc8c0000000000 Clamped
|
||||
decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383
|
||||
decd645 apply 9E+382 -> #43fc1a0000000000 Clamped
|
||||
decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382
|
||||
decd647 apply 9E+381 -> #43fc090000000000 Clamped
|
||||
decd648 apply #43fc090000000000 -> 9.000000000000E+381
|
||||
decd649 apply 9E+380 -> #43fc002300000000 Clamped
|
||||
decd650 apply #43fc002300000000 -> 9.00000000000E+380
|
||||
decd651 apply 9E+379 -> #43fc000680000000 Clamped
|
||||
decd652 apply #43fc000680000000 -> 9.0000000000E+379
|
||||
decd653 apply 9E+378 -> #43fc000240000000 Clamped
|
||||
decd654 apply #43fc000240000000 -> 9.000000000E+378
|
||||
decd655 apply 9E+377 -> #43fc000008c00000 Clamped
|
||||
decd656 apply #43fc000008c00000 -> 9.00000000E+377
|
||||
decd657 apply 9E+376 -> #43fc000001a00000 Clamped
|
||||
decd658 apply #43fc000001a00000 -> 9.0000000E+376
|
||||
decd659 apply 9E+375 -> #43fc000000900000 Clamped
|
||||
decd660 apply #43fc000000900000 -> 9.000000E+375
|
||||
decd661 apply 9E+374 -> #43fc000000023000 Clamped
|
||||
decd662 apply #43fc000000023000 -> 9.00000E+374
|
||||
decd663 apply 9E+373 -> #43fc000000006800 Clamped
|
||||
decd664 apply #43fc000000006800 -> 9.0000E+373
|
||||
decd665 apply 9E+372 -> #43fc000000002400 Clamped
|
||||
decd666 apply #43fc000000002400 -> 9.000E+372
|
||||
decd667 apply 9E+371 -> #43fc00000000008c Clamped
|
||||
decd668 apply #43fc00000000008c -> 9.00E+371
|
||||
decd669 apply 9E+370 -> #43fc00000000001a Clamped
|
||||
decd670 apply #43fc00000000001a -> 9.0E+370
|
||||
decd671 apply 9E+369 -> #43fc000000000009
|
||||
decd672 apply #43fc000000000009 -> 9E+369
|
||||
decd673 apply 9E+368 -> #43f8000000000009
|
||||
decd674 apply #43f8000000000009 -> 9E+368
|
||||
|
||||
|
||||
-- Selected DPD codes
|
||||
decd700 apply #2238000000000000 -> 0
|
||||
decd701 apply #2238000000000009 -> 9
|
||||
decd702 apply #2238000000000010 -> 10
|
||||
decd703 apply #2238000000000019 -> 19
|
||||
decd704 apply #2238000000000020 -> 20
|
||||
decd705 apply #2238000000000029 -> 29
|
||||
decd706 apply #2238000000000030 -> 30
|
||||
decd707 apply #2238000000000039 -> 39
|
||||
decd708 apply #2238000000000040 -> 40
|
||||
decd709 apply #2238000000000049 -> 49
|
||||
decd710 apply #2238000000000050 -> 50
|
||||
decd711 apply #2238000000000059 -> 59
|
||||
decd712 apply #2238000000000060 -> 60
|
||||
decd713 apply #2238000000000069 -> 69
|
||||
decd714 apply #2238000000000070 -> 70
|
||||
decd715 apply #2238000000000071 -> 71
|
||||
decd716 apply #2238000000000072 -> 72
|
||||
decd717 apply #2238000000000073 -> 73
|
||||
decd718 apply #2238000000000074 -> 74
|
||||
decd719 apply #2238000000000075 -> 75
|
||||
decd720 apply #2238000000000076 -> 76
|
||||
decd721 apply #2238000000000077 -> 77
|
||||
decd722 apply #2238000000000078 -> 78
|
||||
decd723 apply #2238000000000079 -> 79
|
||||
|
||||
decd725 apply #223800000000029e -> 994
|
||||
decd726 apply #223800000000029f -> 995
|
||||
decd727 apply #22380000000002a0 -> 520
|
||||
decd728 apply #22380000000002a1 -> 521
|
||||
-- from telco test data
|
||||
decd730 apply #2238000000000188 -> 308
|
||||
decd731 apply #22380000000001a3 -> 323
|
||||
decd732 apply #223800000000002a -> 82
|
||||
decd733 apply #22380000000001a9 -> 329
|
||||
decd734 apply #2238000000000081 -> 101
|
||||
decd735 apply #22380000000002a2 -> 522
|
||||
|
||||
-- DPD: one of each of the huffman groups
|
||||
decd740 apply #22380000000003f7 -> 777
|
||||
decd741 apply #22380000000003f8 -> 778
|
||||
decd742 apply #22380000000003eb -> 787
|
||||
decd743 apply #223800000000037d -> 877
|
||||
decd744 apply #223800000000039f -> 997
|
||||
decd745 apply #22380000000003bf -> 979
|
||||
decd746 apply #22380000000003df -> 799
|
||||
decd747 apply #223800000000006e -> 888
|
||||
|
||||
-- DPD all-highs cases (includes the 24 redundant codes)
|
||||
decd750 apply #223800000000006e -> 888
|
||||
decd751 apply #223800000000016e -> 888
|
||||
decd752 apply #223800000000026e -> 888
|
||||
decd753 apply #223800000000036e -> 888
|
||||
decd754 apply #223800000000006f -> 889
|
||||
decd755 apply #223800000000016f -> 889
|
||||
decd756 apply #223800000000026f -> 889
|
||||
decd757 apply #223800000000036f -> 889
|
||||
|
||||
decd760 apply #223800000000007e -> 898
|
||||
decd761 apply #223800000000017e -> 898
|
||||
decd762 apply #223800000000027e -> 898
|
||||
decd763 apply #223800000000037e -> 898
|
||||
decd764 apply #223800000000007f -> 899
|
||||
decd765 apply #223800000000017f -> 899
|
||||
decd766 apply #223800000000027f -> 899
|
||||
decd767 apply #223800000000037f -> 899
|
||||
|
||||
decd770 apply #22380000000000ee -> 988
|
||||
decd771 apply #22380000000001ee -> 988
|
||||
decd772 apply #22380000000002ee -> 988
|
||||
decd773 apply #22380000000003ee -> 988
|
||||
decd774 apply #22380000000000ef -> 989
|
||||
decd775 apply #22380000000001ef -> 989
|
||||
decd776 apply #22380000000002ef -> 989
|
||||
decd777 apply #22380000000003ef -> 989
|
||||
|
||||
decd780 apply #22380000000000fe -> 998
|
||||
decd781 apply #22380000000001fe -> 998
|
||||
decd782 apply #22380000000002fe -> 998
|
||||
decd783 apply #22380000000003fe -> 998
|
||||
decd784 apply #22380000000000ff -> 999
|
||||
decd785 apply #22380000000001ff -> 999
|
||||
decd786 apply #22380000000002ff -> 999
|
||||
decd787 apply #22380000000003ff -> 999
|
||||
|
||||
-- values around [u]int32 edges (zeros done earlier)
|
||||
decd800 apply -2147483646 -> #a23800008c78af46
|
||||
decd801 apply -2147483647 -> #a23800008c78af47
|
||||
decd802 apply -2147483648 -> #a23800008c78af48
|
||||
decd803 apply -2147483649 -> #a23800008c78af49
|
||||
decd804 apply 2147483646 -> #223800008c78af46
|
||||
decd805 apply 2147483647 -> #223800008c78af47
|
||||
decd806 apply 2147483648 -> #223800008c78af48
|
||||
decd807 apply 2147483649 -> #223800008c78af49
|
||||
decd808 apply 4294967294 -> #2238000115afb55a
|
||||
decd809 apply 4294967295 -> #2238000115afb55b
|
||||
decd810 apply 4294967296 -> #2238000115afb57a
|
||||
decd811 apply 4294967297 -> #2238000115afb57b
|
||||
|
||||
decd820 apply #a23800008c78af46 -> -2147483646
|
||||
decd821 apply #a23800008c78af47 -> -2147483647
|
||||
decd822 apply #a23800008c78af48 -> -2147483648
|
||||
decd823 apply #a23800008c78af49 -> -2147483649
|
||||
decd824 apply #223800008c78af46 -> 2147483646
|
||||
decd825 apply #223800008c78af47 -> 2147483647
|
||||
decd826 apply #223800008c78af48 -> 2147483648
|
||||
decd827 apply #223800008c78af49 -> 2147483649
|
||||
decd828 apply #2238000115afb55a -> 4294967294
|
||||
decd829 apply #2238000115afb55b -> 4294967295
|
||||
decd830 apply #2238000115afb57a -> 4294967296
|
||||
decd831 apply #2238000115afb57b -> 4294967297
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,202 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddInvert.decTest -- digitwise logical INVERT for decDoubles --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check (truth table)
|
||||
ddinv001 invert 0 -> 1111111111111111
|
||||
ddinv002 invert 1 -> 1111111111111110
|
||||
ddinv003 invert 10 -> 1111111111111101
|
||||
ddinv004 invert 111111111 -> 1111111000000000
|
||||
ddinv005 invert 000000000 -> 1111111111111111
|
||||
-- and at msd and msd-1
|
||||
ddinv007 invert 0000000000000000 -> 1111111111111111
|
||||
ddinv008 invert 1000000000000000 -> 111111111111111
|
||||
ddinv009 invert 0000000000000000 -> 1111111111111111
|
||||
ddinv010 invert 0100000000000000 -> 1011111111111111
|
||||
ddinv011 invert 0111111111111111 -> 1000000000000000
|
||||
ddinv012 invert 1111111111111111 -> 0
|
||||
ddinv013 invert 0011111111111111 -> 1100000000000000
|
||||
ddinv014 invert 0111111111111111 -> 1000000000000000
|
||||
|
||||
-- Various lengths
|
||||
-- 123456789 1234567890123456
|
||||
ddinv021 invert 111111111 -> 1111111000000000
|
||||
ddinv022 invert 111111111111 -> 1111000000000000
|
||||
ddinv023 invert 11111111 -> 1111111100000000
|
||||
ddinv025 invert 1111111 -> 1111111110000000
|
||||
ddinv026 invert 111111 -> 1111111111000000
|
||||
ddinv027 invert 11111 -> 1111111111100000
|
||||
ddinv028 invert 1111 -> 1111111111110000
|
||||
ddinv029 invert 111 -> 1111111111111000
|
||||
ddinv031 invert 11 -> 1111111111111100
|
||||
ddinv032 invert 1 -> 1111111111111110
|
||||
ddinv033 invert 111111111111 -> 1111000000000000
|
||||
ddinv034 invert 11111111111 -> 1111100000000000
|
||||
ddinv035 invert 1111111111 -> 1111110000000000
|
||||
ddinv036 invert 111111111 -> 1111111000000000
|
||||
|
||||
ddinv040 invert 011111111 -> 1111111100000000
|
||||
ddinv041 invert 101111111 -> 1111111010000000
|
||||
ddinv042 invert 110111111 -> 1111111001000000
|
||||
ddinv043 invert 111011111 -> 1111111000100000
|
||||
ddinv044 invert 111101111 -> 1111111000010000
|
||||
ddinv045 invert 111110111 -> 1111111000001000
|
||||
ddinv046 invert 111111011 -> 1111111000000100
|
||||
ddinv047 invert 111111101 -> 1111111000000010
|
||||
ddinv048 invert 111111110 -> 1111111000000001
|
||||
ddinv049 invert 011111011 -> 1111111100000100
|
||||
ddinv050 invert 101111101 -> 1111111010000010
|
||||
ddinv051 invert 110111110 -> 1111111001000001
|
||||
ddinv052 invert 111011101 -> 1111111000100010
|
||||
ddinv053 invert 111101011 -> 1111111000010100
|
||||
ddinv054 invert 111110111 -> 1111111000001000
|
||||
ddinv055 invert 111101011 -> 1111111000010100
|
||||
ddinv056 invert 111011101 -> 1111111000100010
|
||||
ddinv057 invert 110111110 -> 1111111001000001
|
||||
ddinv058 invert 101111101 -> 1111111010000010
|
||||
ddinv059 invert 011111011 -> 1111111100000100
|
||||
|
||||
ddinv080 invert 1000000011111111 -> 111111100000000
|
||||
ddinv081 invert 0100000101111111 -> 1011111010000000
|
||||
ddinv082 invert 0010000110111111 -> 1101111001000000
|
||||
ddinv083 invert 0001000111011111 -> 1110111000100000
|
||||
ddinv084 invert 0000100111101111 -> 1111011000010000
|
||||
ddinv085 invert 0000010111110111 -> 1111101000001000
|
||||
ddinv086 invert 0000001111111011 -> 1111110000000100
|
||||
ddinv087 invert 0000010111111101 -> 1111101000000010
|
||||
ddinv088 invert 0000100111111110 -> 1111011000000001
|
||||
ddinv089 invert 0001000011111011 -> 1110111100000100
|
||||
ddinv090 invert 0010000101111101 -> 1101111010000010
|
||||
ddinv091 invert 0100000110111110 -> 1011111001000001
|
||||
ddinv092 invert 1000000111011101 -> 111111000100010
|
||||
ddinv093 invert 0100000111101011 -> 1011111000010100
|
||||
ddinv094 invert 0010000111110111 -> 1101111000001000
|
||||
ddinv095 invert 0001000111101011 -> 1110111000010100
|
||||
ddinv096 invert 0000100111011101 -> 1111011000100010
|
||||
ddinv097 invert 0000010110111110 -> 1111101001000001
|
||||
ddinv098 invert 0000001101111101 -> 1111110010000010
|
||||
ddinv099 invert 0000010011111011 -> 1111101100000100
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
ddinv220 invert 111111112 -> NaN Invalid_operation
|
||||
ddinv221 invert 333333333 -> NaN Invalid_operation
|
||||
ddinv222 invert 555555555 -> NaN Invalid_operation
|
||||
ddinv223 invert 777777777 -> NaN Invalid_operation
|
||||
ddinv224 invert 999999999 -> NaN Invalid_operation
|
||||
ddinv225 invert 222222222 -> NaN Invalid_operation
|
||||
ddinv226 invert 444444444 -> NaN Invalid_operation
|
||||
ddinv227 invert 666666666 -> NaN Invalid_operation
|
||||
ddinv228 invert 888888888 -> NaN Invalid_operation
|
||||
ddinv229 invert 999999999 -> NaN Invalid_operation
|
||||
ddinv230 invert 999999999 -> NaN Invalid_operation
|
||||
ddinv231 invert 999999999 -> NaN Invalid_operation
|
||||
ddinv232 invert 999999999 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
ddinv240 invert 567468689 -> NaN Invalid_operation
|
||||
ddinv241 invert 567367689 -> NaN Invalid_operation
|
||||
ddinv242 invert -631917772 -> NaN Invalid_operation
|
||||
ddinv243 invert -756253257 -> NaN Invalid_operation
|
||||
ddinv244 invert 835590149 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
ddinv250 invert 2000000000000000 -> NaN Invalid_operation
|
||||
ddinv251 invert 3000000000000000 -> NaN Invalid_operation
|
||||
ddinv252 invert 4000000000000000 -> NaN Invalid_operation
|
||||
ddinv253 invert 5000000000000000 -> NaN Invalid_operation
|
||||
ddinv254 invert 6000000000000000 -> NaN Invalid_operation
|
||||
ddinv255 invert 7000000000000000 -> NaN Invalid_operation
|
||||
ddinv256 invert 8000000000000000 -> NaN Invalid_operation
|
||||
ddinv257 invert 9000000000000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
ddinv270 invert 0200001000000000 -> NaN Invalid_operation
|
||||
ddinv271 invert 0300000100000000 -> NaN Invalid_operation
|
||||
ddinv272 invert 0400000010000000 -> NaN Invalid_operation
|
||||
ddinv273 invert 0500000001000000 -> NaN Invalid_operation
|
||||
ddinv274 invert 1600000000100000 -> NaN Invalid_operation
|
||||
ddinv275 invert 1700000000010000 -> NaN Invalid_operation
|
||||
ddinv276 invert 1800000000001000 -> NaN Invalid_operation
|
||||
ddinv277 invert 1900000000000100 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
ddinv280 invert 0010000000000002 -> NaN Invalid_operation
|
||||
ddinv281 invert 0001000000000003 -> NaN Invalid_operation
|
||||
ddinv282 invert 0000100000000004 -> NaN Invalid_operation
|
||||
ddinv283 invert 0000010000000005 -> NaN Invalid_operation
|
||||
ddinv284 invert 1000001000000006 -> NaN Invalid_operation
|
||||
ddinv285 invert 1000000100000007 -> NaN Invalid_operation
|
||||
ddinv286 invert 1000000010000008 -> NaN Invalid_operation
|
||||
ddinv287 invert 1000000001000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
ddinv288 invert 0010000020000000 -> NaN Invalid_operation
|
||||
ddinv289 invert 0001000030000001 -> NaN Invalid_operation
|
||||
ddinv290 invert 0000100040000010 -> NaN Invalid_operation
|
||||
ddinv291 invert 0000010050000100 -> NaN Invalid_operation
|
||||
ddinv292 invert 1000001060001000 -> NaN Invalid_operation
|
||||
ddinv293 invert 1000000170010000 -> NaN Invalid_operation
|
||||
ddinv294 invert 1000000080100000 -> NaN Invalid_operation
|
||||
ddinv295 invert 1000000091000000 -> NaN Invalid_operation
|
||||
-- sign
|
||||
ddinv296 invert -1000000001000000 -> NaN Invalid_operation
|
||||
ddinv299 invert 1000000001000000 -> 111111110111111
|
||||
|
||||
|
||||
-- Nmax, Nmin, Ntiny-like
|
||||
ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation
|
||||
ddinv342 invert 1E-299 -> NaN Invalid_operation
|
||||
ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation
|
||||
ddinv344 invert 1E-207 -> NaN Invalid_operation
|
||||
ddinv345 invert -1E-207 -> NaN Invalid_operation
|
||||
ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation
|
||||
ddinv347 invert -1E-299 -> NaN Invalid_operation
|
||||
ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
ddinv361 invert 1.0 -> NaN Invalid_operation
|
||||
ddinv362 invert 1E+1 -> NaN Invalid_operation
|
||||
ddinv363 invert 0.0 -> NaN Invalid_operation
|
||||
ddinv364 invert 0E+1 -> NaN Invalid_operation
|
||||
ddinv365 invert 9.9 -> NaN Invalid_operation
|
||||
ddinv366 invert 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
ddinv788 invert -Inf -> NaN Invalid_operation
|
||||
ddinv794 invert Inf -> NaN Invalid_operation
|
||||
ddinv821 invert NaN -> NaN Invalid_operation
|
||||
ddinv841 invert sNaN -> NaN Invalid_operation
|
||||
-- propagating NaNs
|
||||
ddinv861 invert NaN1 -> NaN Invalid_operation
|
||||
ddinv862 invert +NaN2 -> NaN Invalid_operation
|
||||
ddinv863 invert NaN3 -> NaN Invalid_operation
|
||||
ddinv864 invert NaN4 -> NaN Invalid_operation
|
||||
ddinv865 invert NaN5 -> NaN Invalid_operation
|
||||
ddinv871 invert sNaN11 -> NaN Invalid_operation
|
||||
ddinv872 invert sNaN12 -> NaN Invalid_operation
|
||||
ddinv873 invert sNaN13 -> NaN Invalid_operation
|
||||
ddinv874 invert sNaN14 -> NaN Invalid_operation
|
||||
ddinv875 invert sNaN15 -> NaN Invalid_operation
|
||||
ddinv876 invert NaN16 -> NaN Invalid_operation
|
||||
ddinv881 invert +NaN25 -> NaN Invalid_operation
|
||||
ddinv882 invert -NaN26 -> NaN Invalid_operation
|
||||
ddinv883 invert -sNaN27 -> NaN Invalid_operation
|
|
@ -0,0 +1,159 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
|
||||
-- Copyright (c) IBM Corporation, 2005, 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- basics
|
||||
ddlogb000 logb 0 -> -Infinity Division_by_zero
|
||||
ddlogb001 logb 1E-398 -> -398
|
||||
ddlogb002 logb 1E-383 -> -383
|
||||
ddlogb003 logb 0.001 -> -3
|
||||
ddlogb004 logb 0.03 -> -2
|
||||
ddlogb005 logb 1 -> 0
|
||||
ddlogb006 logb 2 -> 0
|
||||
ddlogb007 logb 2.5 -> 0
|
||||
ddlogb008 logb 2.500 -> 0
|
||||
ddlogb009 logb 10 -> 1
|
||||
ddlogb010 logb 70 -> 1
|
||||
ddlogb011 logb 100 -> 2
|
||||
ddlogb012 logb 333 -> 2
|
||||
ddlogb013 logb 9E+384 -> 384
|
||||
ddlogb014 logb +Infinity -> Infinity
|
||||
|
||||
-- negatives appear to be treated as positives
|
||||
ddlogb021 logb -0 -> -Infinity Division_by_zero
|
||||
ddlogb022 logb -1E-398 -> -398
|
||||
ddlogb023 logb -9E-383 -> -383
|
||||
ddlogb024 logb -0.001 -> -3
|
||||
ddlogb025 logb -1 -> 0
|
||||
ddlogb026 logb -2 -> 0
|
||||
ddlogb027 logb -10 -> 1
|
||||
ddlogb028 logb -70 -> 1
|
||||
ddlogb029 logb -100 -> 2
|
||||
ddlogb030 logb -9E+384 -> 384
|
||||
ddlogb031 logb -Infinity -> Infinity
|
||||
|
||||
-- zeros
|
||||
ddlogb111 logb 0 -> -Infinity Division_by_zero
|
||||
ddlogb112 logb -0 -> -Infinity Division_by_zero
|
||||
ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
|
||||
ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
|
||||
ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
|
||||
ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
|
||||
ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
|
||||
ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddlogb121 logb 268268268 -> 8
|
||||
ddlogb122 logb -268268268 -> 8
|
||||
ddlogb123 logb 134134134 -> 8
|
||||
ddlogb124 logb -134134134 -> 8
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddlogb131 logb 9.999999999999999E+384 -> 384
|
||||
ddlogb132 logb 1E-383 -> -383
|
||||
ddlogb133 logb 1.000000000000000E-383 -> -383
|
||||
ddlogb134 logb 1E-398 -> -398
|
||||
|
||||
ddlogb135 logb -1E-398 -> -398
|
||||
ddlogb136 logb -1.000000000000000E-383 -> -383
|
||||
ddlogb137 logb -1E-383 -> -383
|
||||
ddlogb138 logb -9.999999999999999E+384 -> 384
|
||||
|
||||
-- ones
|
||||
ddlogb0061 logb 1 -> 0
|
||||
ddlogb0062 logb 1.0 -> 0
|
||||
ddlogb0063 logb 1.000000000000000 -> 0
|
||||
|
||||
-- notable cases -- exact powers of 10
|
||||
ddlogb1100 logb 1 -> 0
|
||||
ddlogb1101 logb 10 -> 1
|
||||
ddlogb1102 logb 100 -> 2
|
||||
ddlogb1103 logb 1000 -> 3
|
||||
ddlogb1104 logb 10000 -> 4
|
||||
ddlogb1105 logb 100000 -> 5
|
||||
ddlogb1106 logb 1000000 -> 6
|
||||
ddlogb1107 logb 10000000 -> 7
|
||||
ddlogb1108 logb 100000000 -> 8
|
||||
ddlogb1109 logb 1000000000 -> 9
|
||||
ddlogb1110 logb 10000000000 -> 10
|
||||
ddlogb1111 logb 100000000000 -> 11
|
||||
ddlogb1112 logb 1000000000000 -> 12
|
||||
ddlogb1113 logb 0.00000000001 -> -11
|
||||
ddlogb1114 logb 0.0000000001 -> -10
|
||||
ddlogb1115 logb 0.000000001 -> -9
|
||||
ddlogb1116 logb 0.00000001 -> -8
|
||||
ddlogb1117 logb 0.0000001 -> -7
|
||||
ddlogb1118 logb 0.000001 -> -6
|
||||
ddlogb1119 logb 0.00001 -> -5
|
||||
ddlogb1120 logb 0.0001 -> -4
|
||||
ddlogb1121 logb 0.001 -> -3
|
||||
ddlogb1122 logb 0.01 -> -2
|
||||
ddlogb1123 logb 0.1 -> -1
|
||||
ddlogb1124 logb 1E-99 -> -99
|
||||
ddlogb1125 logb 1E-100 -> -100
|
||||
ddlogb1127 logb 1E-299 -> -299
|
||||
ddlogb1126 logb 1E-383 -> -383
|
||||
|
||||
-- suggestions from Ilan Nehama
|
||||
ddlogb1400 logb 10E-3 -> -2
|
||||
ddlogb1401 logb 10E-2 -> -1
|
||||
ddlogb1402 logb 100E-2 -> 0
|
||||
ddlogb1403 logb 1000E-2 -> 1
|
||||
ddlogb1404 logb 10000E-2 -> 2
|
||||
ddlogb1405 logb 10E-1 -> 0
|
||||
ddlogb1406 logb 100E-1 -> 1
|
||||
ddlogb1407 logb 1000E-1 -> 2
|
||||
ddlogb1408 logb 10000E-1 -> 3
|
||||
ddlogb1409 logb 10E0 -> 1
|
||||
ddlogb1410 logb 100E0 -> 2
|
||||
ddlogb1411 logb 1000E0 -> 3
|
||||
ddlogb1412 logb 10000E0 -> 4
|
||||
ddlogb1413 logb 10E1 -> 2
|
||||
ddlogb1414 logb 100E1 -> 3
|
||||
ddlogb1415 logb 1000E1 -> 4
|
||||
ddlogb1416 logb 10000E1 -> 5
|
||||
ddlogb1417 logb 10E2 -> 3
|
||||
ddlogb1418 logb 100E2 -> 4
|
||||
ddlogb1419 logb 1000E2 -> 5
|
||||
ddlogb1420 logb 10000E2 -> 6
|
||||
|
||||
-- special values
|
||||
ddlogb820 logb Infinity -> Infinity
|
||||
ddlogb821 logb 0 -> -Infinity Division_by_zero
|
||||
ddlogb822 logb NaN -> NaN
|
||||
ddlogb823 logb sNaN -> NaN Invalid_operation
|
||||
-- propagating NaNs
|
||||
ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
|
||||
ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
|
||||
ddlogb826 logb NaN456 -> NaN456
|
||||
ddlogb827 logb -NaN654 -> -NaN654
|
||||
ddlogb828 logb NaN1 -> NaN1
|
||||
|
||||
-- Null test
|
||||
ddlogb900 logb # -> NaN Invalid_operation
|
||||
|
||||
|
|
@ -0,0 +1,322 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMax.decTest -- decDouble maxnum --
|
||||
-- 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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases and rounding
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddmax001 max -2 -2 -> -2
|
||||
ddmax002 max -2 -1 -> -1
|
||||
ddmax003 max -2 0 -> 0
|
||||
ddmax004 max -2 1 -> 1
|
||||
ddmax005 max -2 2 -> 2
|
||||
ddmax006 max -1 -2 -> -1
|
||||
ddmax007 max -1 -1 -> -1
|
||||
ddmax008 max -1 0 -> 0
|
||||
ddmax009 max -1 1 -> 1
|
||||
ddmax010 max -1 2 -> 2
|
||||
ddmax011 max 0 -2 -> 0
|
||||
ddmax012 max 0 -1 -> 0
|
||||
ddmax013 max 0 0 -> 0
|
||||
ddmax014 max 0 1 -> 1
|
||||
ddmax015 max 0 2 -> 2
|
||||
ddmax016 max 1 -2 -> 1
|
||||
ddmax017 max 1 -1 -> 1
|
||||
ddmax018 max 1 0 -> 1
|
||||
ddmax019 max 1 1 -> 1
|
||||
ddmax020 max 1 2 -> 2
|
||||
ddmax021 max 2 -2 -> 2
|
||||
ddmax022 max 2 -1 -> 2
|
||||
ddmax023 max 2 0 -> 2
|
||||
ddmax025 max 2 1 -> 2
|
||||
ddmax026 max 2 2 -> 2
|
||||
|
||||
-- extended zeros
|
||||
ddmax030 max 0 0 -> 0
|
||||
ddmax031 max 0 -0 -> 0
|
||||
ddmax032 max 0 -0.0 -> 0
|
||||
ddmax033 max 0 0.0 -> 0
|
||||
ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
|
||||
ddmax035 max -0 -0 -> -0
|
||||
ddmax036 max -0 -0.0 -> -0.0
|
||||
ddmax037 max -0 0.0 -> 0.0
|
||||
ddmax038 max 0.0 0 -> 0
|
||||
ddmax039 max 0.0 -0 -> 0.0
|
||||
ddmax040 max 0.0 -0.0 -> 0.0
|
||||
ddmax041 max 0.0 0.0 -> 0.0
|
||||
ddmax042 max -0.0 0 -> 0
|
||||
ddmax043 max -0.0 -0 -> -0.0
|
||||
ddmax044 max -0.0 -0.0 -> -0.0
|
||||
ddmax045 max -0.0 0.0 -> 0.0
|
||||
|
||||
ddmax050 max -0E1 0E1 -> 0E+1
|
||||
ddmax051 max -0E2 0E2 -> 0E+2
|
||||
ddmax052 max -0E2 0E1 -> 0E+1
|
||||
ddmax053 max -0E1 0E2 -> 0E+2
|
||||
ddmax054 max 0E1 -0E1 -> 0E+1
|
||||
ddmax055 max 0E2 -0E2 -> 0E+2
|
||||
ddmax056 max 0E2 -0E1 -> 0E+2
|
||||
ddmax057 max 0E1 -0E2 -> 0E+1
|
||||
|
||||
ddmax058 max 0E1 0E1 -> 0E+1
|
||||
ddmax059 max 0E2 0E2 -> 0E+2
|
||||
ddmax060 max 0E2 0E1 -> 0E+2
|
||||
ddmax061 max 0E1 0E2 -> 0E+2
|
||||
ddmax062 max -0E1 -0E1 -> -0E+1
|
||||
ddmax063 max -0E2 -0E2 -> -0E+2
|
||||
ddmax064 max -0E2 -0E1 -> -0E+1
|
||||
ddmax065 max -0E1 -0E2 -> -0E+1
|
||||
|
||||
-- Specials
|
||||
ddmax090 max Inf -Inf -> Infinity
|
||||
ddmax091 max Inf -1000 -> Infinity
|
||||
ddmax092 max Inf -1 -> Infinity
|
||||
ddmax093 max Inf -0 -> Infinity
|
||||
ddmax094 max Inf 0 -> Infinity
|
||||
ddmax095 max Inf 1 -> Infinity
|
||||
ddmax096 max Inf 1000 -> Infinity
|
||||
ddmax097 max Inf Inf -> Infinity
|
||||
ddmax098 max -1000 Inf -> Infinity
|
||||
ddmax099 max -Inf Inf -> Infinity
|
||||
ddmax100 max -1 Inf -> Infinity
|
||||
ddmax101 max -0 Inf -> Infinity
|
||||
ddmax102 max 0 Inf -> Infinity
|
||||
ddmax103 max 1 Inf -> Infinity
|
||||
ddmax104 max 1000 Inf -> Infinity
|
||||
ddmax105 max Inf Inf -> Infinity
|
||||
|
||||
ddmax120 max -Inf -Inf -> -Infinity
|
||||
ddmax121 max -Inf -1000 -> -1000
|
||||
ddmax122 max -Inf -1 -> -1
|
||||
ddmax123 max -Inf -0 -> -0
|
||||
ddmax124 max -Inf 0 -> 0
|
||||
ddmax125 max -Inf 1 -> 1
|
||||
ddmax126 max -Inf 1000 -> 1000
|
||||
ddmax127 max -Inf Inf -> Infinity
|
||||
ddmax128 max -Inf -Inf -> -Infinity
|
||||
ddmax129 max -1000 -Inf -> -1000
|
||||
ddmax130 max -1 -Inf -> -1
|
||||
ddmax131 max -0 -Inf -> -0
|
||||
ddmax132 max 0 -Inf -> 0
|
||||
ddmax133 max 1 -Inf -> 1
|
||||
ddmax134 max 1000 -Inf -> 1000
|
||||
ddmax135 max Inf -Inf -> Infinity
|
||||
|
||||
-- 2004.08.02 754r chooses number over NaN in mixed cases
|
||||
ddmax141 max NaN -Inf -> -Infinity
|
||||
ddmax142 max NaN -1000 -> -1000
|
||||
ddmax143 max NaN -1 -> -1
|
||||
ddmax144 max NaN -0 -> -0
|
||||
ddmax145 max NaN 0 -> 0
|
||||
ddmax146 max NaN 1 -> 1
|
||||
ddmax147 max NaN 1000 -> 1000
|
||||
ddmax148 max NaN Inf -> Infinity
|
||||
ddmax149 max NaN NaN -> NaN
|
||||
ddmax150 max -Inf NaN -> -Infinity
|
||||
ddmax151 max -1000 NaN -> -1000
|
||||
ddmax152 max -1 NaN -> -1
|
||||
ddmax153 max -0 NaN -> -0
|
||||
ddmax154 max 0 NaN -> 0
|
||||
ddmax155 max 1 NaN -> 1
|
||||
ddmax156 max 1000 NaN -> 1000
|
||||
ddmax157 max Inf NaN -> Infinity
|
||||
|
||||
ddmax161 max sNaN -Inf -> NaN Invalid_operation
|
||||
ddmax162 max sNaN -1000 -> NaN Invalid_operation
|
||||
ddmax163 max sNaN -1 -> NaN Invalid_operation
|
||||
ddmax164 max sNaN -0 -> NaN Invalid_operation
|
||||
ddmax165 max sNaN 0 -> NaN Invalid_operation
|
||||
ddmax166 max sNaN 1 -> NaN Invalid_operation
|
||||
ddmax167 max sNaN 1000 -> NaN Invalid_operation
|
||||
ddmax168 max sNaN NaN -> NaN Invalid_operation
|
||||
ddmax169 max sNaN sNaN -> NaN Invalid_operation
|
||||
ddmax170 max NaN sNaN -> NaN Invalid_operation
|
||||
ddmax171 max -Inf sNaN -> NaN Invalid_operation
|
||||
ddmax172 max -1000 sNaN -> NaN Invalid_operation
|
||||
ddmax173 max -1 sNaN -> NaN Invalid_operation
|
||||
ddmax174 max -0 sNaN -> NaN Invalid_operation
|
||||
ddmax175 max 0 sNaN -> NaN Invalid_operation
|
||||
ddmax176 max 1 sNaN -> NaN Invalid_operation
|
||||
ddmax177 max 1000 sNaN -> NaN Invalid_operation
|
||||
ddmax178 max Inf sNaN -> NaN Invalid_operation
|
||||
ddmax179 max NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddmax181 max NaN9 -Inf -> -Infinity
|
||||
ddmax182 max NaN8 9 -> 9
|
||||
ddmax183 max -NaN7 Inf -> Infinity
|
||||
|
||||
ddmax184 max -NaN1 NaN11 -> -NaN1
|
||||
ddmax185 max NaN2 NaN12 -> NaN2
|
||||
ddmax186 max -NaN13 -NaN7 -> -NaN13
|
||||
ddmax187 max NaN14 -NaN5 -> NaN14
|
||||
|
||||
ddmax188 max -Inf NaN4 -> -Infinity
|
||||
ddmax189 max -9 -NaN3 -> -9
|
||||
ddmax190 max Inf NaN2 -> Infinity
|
||||
|
||||
ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation
|
||||
ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
|
||||
ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
|
||||
ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation
|
||||
ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation
|
||||
|
||||
-- old rounding checks
|
||||
ddmax221 max 12345678000 1 -> 12345678000
|
||||
ddmax222 max 1 12345678000 -> 12345678000
|
||||
ddmax223 max 1234567800 1 -> 1234567800
|
||||
ddmax224 max 1 1234567800 -> 1234567800
|
||||
ddmax225 max 1234567890 1 -> 1234567890
|
||||
ddmax226 max 1 1234567890 -> 1234567890
|
||||
ddmax227 max 1234567891 1 -> 1234567891
|
||||
ddmax228 max 1 1234567891 -> 1234567891
|
||||
ddmax229 max 12345678901 1 -> 12345678901
|
||||
ddmax230 max 1 12345678901 -> 12345678901
|
||||
ddmax231 max 1234567896 1 -> 1234567896
|
||||
ddmax232 max 1 1234567896 -> 1234567896
|
||||
ddmax233 max -1234567891 1 -> 1
|
||||
ddmax234 max 1 -1234567891 -> 1
|
||||
ddmax235 max -12345678901 1 -> 1
|
||||
ddmax236 max 1 -12345678901 -> 1
|
||||
ddmax237 max -1234567896 1 -> 1
|
||||
ddmax238 max 1 -1234567896 -> 1
|
||||
|
||||
-- from examples
|
||||
ddmax280 max '3' '2' -> '3'
|
||||
ddmax281 max '-10' '3' -> '3'
|
||||
ddmax282 max '1.0' '1' -> '1'
|
||||
ddmax283 max '1' '1.0' -> '1'
|
||||
ddmax284 max '7' 'NaN' -> '7'
|
||||
|
||||
-- expanded list from min/max 754r purple prose
|
||||
-- [explicit tests for exponent ordering]
|
||||
ddmax401 max Inf 1.1 -> Infinity
|
||||
ddmax402 max 1.1 1 -> 1.1
|
||||
ddmax403 max 1 1.0 -> 1
|
||||
ddmax404 max 1.0 0.1 -> 1.0
|
||||
ddmax405 max 0.1 0.10 -> 0.1
|
||||
ddmax406 max 0.10 0.100 -> 0.10
|
||||
ddmax407 max 0.10 0 -> 0.10
|
||||
ddmax408 max 0 0.0 -> 0
|
||||
ddmax409 max 0.0 -0 -> 0.0
|
||||
ddmax410 max 0.0 -0.0 -> 0.0
|
||||
ddmax411 max 0.00 -0.0 -> 0.00
|
||||
ddmax412 max 0.0 -0.00 -> 0.0
|
||||
ddmax413 max 0 -0.0 -> 0
|
||||
ddmax414 max 0 -0 -> 0
|
||||
ddmax415 max -0.0 -0 -> -0.0
|
||||
ddmax416 max -0 -0.100 -> -0
|
||||
ddmax417 max -0.100 -0.10 -> -0.100
|
||||
ddmax418 max -0.10 -0.1 -> -0.10
|
||||
ddmax419 max -0.1 -1.0 -> -0.1
|
||||
ddmax420 max -1.0 -1 -> -1.0
|
||||
ddmax421 max -1 -1.1 -> -1
|
||||
ddmax423 max -1.1 -Inf -> -1.1
|
||||
-- same with operands reversed
|
||||
ddmax431 max 1.1 Inf -> Infinity
|
||||
ddmax432 max 1 1.1 -> 1.1
|
||||
ddmax433 max 1.0 1 -> 1
|
||||
ddmax434 max 0.1 1.0 -> 1.0
|
||||
ddmax435 max 0.10 0.1 -> 0.1
|
||||
ddmax436 max 0.100 0.10 -> 0.10
|
||||
ddmax437 max 0 0.10 -> 0.10
|
||||
ddmax438 max 0.0 0 -> 0
|
||||
ddmax439 max -0 0.0 -> 0.0
|
||||
ddmax440 max -0.0 0.0 -> 0.0
|
||||
ddmax441 max -0.0 0.00 -> 0.00
|
||||
ddmax442 max -0.00 0.0 -> 0.0
|
||||
ddmax443 max -0.0 0 -> 0
|
||||
ddmax444 max -0 0 -> 0
|
||||
ddmax445 max -0 -0.0 -> -0.0
|
||||
ddmax446 max -0.100 -0 -> -0
|
||||
ddmax447 max -0.10 -0.100 -> -0.100
|
||||
ddmax448 max -0.1 -0.10 -> -0.10
|
||||
ddmax449 max -1.0 -0.1 -> -0.1
|
||||
ddmax450 max -1 -1.0 -> -1.0
|
||||
ddmax451 max -1.1 -1 -> -1
|
||||
ddmax453 max -Inf -1.1 -> -1.1
|
||||
-- largies
|
||||
ddmax460 max 1000 1E+3 -> 1E+3
|
||||
ddmax461 max 1E+3 1000 -> 1E+3
|
||||
ddmax462 max 1000 -1E+3 -> 1000
|
||||
ddmax463 max 1E+3 -1000 -> 1E+3
|
||||
ddmax464 max -1000 1E+3 -> 1E+3
|
||||
ddmax465 max -1E+3 1000 -> 1000
|
||||
ddmax466 max -1000 -1E+3 -> -1000
|
||||
ddmax467 max -1E+3 -1000 -> -1000
|
||||
|
||||
-- misalignment traps for little-endian
|
||||
ddmax471 max 1.0 0.1 -> 1.0
|
||||
ddmax472 max 0.1 1.0 -> 1.0
|
||||
ddmax473 max 10.0 0.1 -> 10.0
|
||||
ddmax474 max 0.1 10.0 -> 10.0
|
||||
ddmax475 max 100 1.0 -> 100
|
||||
ddmax476 max 1.0 100 -> 100
|
||||
ddmax477 max 1000 10.0 -> 1000
|
||||
ddmax478 max 10.0 1000 -> 1000
|
||||
ddmax479 max 10000 100.0 -> 10000
|
||||
ddmax480 max 100.0 10000 -> 10000
|
||||
ddmax481 max 100000 1000.0 -> 100000
|
||||
ddmax482 max 1000.0 100000 -> 100000
|
||||
ddmax483 max 1000000 10000.0 -> 1000000
|
||||
ddmax484 max 10000.0 1000000 -> 1000000
|
||||
|
||||
-- subnormals
|
||||
ddmax510 max 1.00E-383 0 -> 1.00E-383
|
||||
ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal
|
||||
ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal
|
||||
ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal
|
||||
ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal
|
||||
ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal
|
||||
ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal
|
||||
ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal
|
||||
ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal
|
||||
ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal
|
||||
ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal
|
||||
|
||||
ddmax530 max -1.00E-383 0 -> 0
|
||||
ddmax531 max -0.1E-383 0 -> 0
|
||||
ddmax532 max -0.10E-383 0 -> 0
|
||||
ddmax533 max -0.100E-383 0 -> 0
|
||||
ddmax534 max -0.01E-383 0 -> 0
|
||||
ddmax535 max -0.999E-383 0 -> 0
|
||||
ddmax536 max -0.099E-383 0 -> 0
|
||||
ddmax537 max -0.009E-383 0 -> 0
|
||||
ddmax538 max -0.001E-383 0 -> 0
|
||||
ddmax539 max -0.0009E-383 0 -> 0
|
||||
ddmax540 max -0.0001E-383 0 -> 0
|
||||
|
||||
-- Null tests
|
||||
ddmax900 max 10 # -> NaN Invalid_operation
|
||||
ddmax901 max # 10 -> NaN Invalid_operation
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,304 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMaxMag.decTest -- decDouble maxnummag --
|
||||
-- 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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases and rounding
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddmxg001 maxmag -2 -2 -> -2
|
||||
ddmxg002 maxmag -2 -1 -> -2
|
||||
ddmxg003 maxmag -2 0 -> -2
|
||||
ddmxg004 maxmag -2 1 -> -2
|
||||
ddmxg005 maxmag -2 2 -> 2
|
||||
ddmxg006 maxmag -1 -2 -> -2
|
||||
ddmxg007 maxmag -1 -1 -> -1
|
||||
ddmxg008 maxmag -1 0 -> -1
|
||||
ddmxg009 maxmag -1 1 -> 1
|
||||
ddmxg010 maxmag -1 2 -> 2
|
||||
ddmxg011 maxmag 0 -2 -> -2
|
||||
ddmxg012 maxmag 0 -1 -> -1
|
||||
ddmxg013 maxmag 0 0 -> 0
|
||||
ddmxg014 maxmag 0 1 -> 1
|
||||
ddmxg015 maxmag 0 2 -> 2
|
||||
ddmxg016 maxmag 1 -2 -> -2
|
||||
ddmxg017 maxmag 1 -1 -> 1
|
||||
ddmxg018 maxmag 1 0 -> 1
|
||||
ddmxg019 maxmag 1 1 -> 1
|
||||
ddmxg020 maxmag 1 2 -> 2
|
||||
ddmxg021 maxmag 2 -2 -> 2
|
||||
ddmxg022 maxmag 2 -1 -> 2
|
||||
ddmxg023 maxmag 2 0 -> 2
|
||||
ddmxg025 maxmag 2 1 -> 2
|
||||
ddmxg026 maxmag 2 2 -> 2
|
||||
|
||||
-- extended zeros
|
||||
ddmxg030 maxmag 0 0 -> 0
|
||||
ddmxg031 maxmag 0 -0 -> 0
|
||||
ddmxg032 maxmag 0 -0.0 -> 0
|
||||
ddmxg033 maxmag 0 0.0 -> 0
|
||||
ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
|
||||
ddmxg035 maxmag -0 -0 -> -0
|
||||
ddmxg036 maxmag -0 -0.0 -> -0.0
|
||||
ddmxg037 maxmag -0 0.0 -> 0.0
|
||||
ddmxg038 maxmag 0.0 0 -> 0
|
||||
ddmxg039 maxmag 0.0 -0 -> 0.0
|
||||
ddmxg040 maxmag 0.0 -0.0 -> 0.0
|
||||
ddmxg041 maxmag 0.0 0.0 -> 0.0
|
||||
ddmxg042 maxmag -0.0 0 -> 0
|
||||
ddmxg043 maxmag -0.0 -0 -> -0.0
|
||||
ddmxg044 maxmag -0.0 -0.0 -> -0.0
|
||||
ddmxg045 maxmag -0.0 0.0 -> 0.0
|
||||
|
||||
ddmxg050 maxmag -0E1 0E1 -> 0E+1
|
||||
ddmxg051 maxmag -0E2 0E2 -> 0E+2
|
||||
ddmxg052 maxmag -0E2 0E1 -> 0E+1
|
||||
ddmxg053 maxmag -0E1 0E2 -> 0E+2
|
||||
ddmxg054 maxmag 0E1 -0E1 -> 0E+1
|
||||
ddmxg055 maxmag 0E2 -0E2 -> 0E+2
|
||||
ddmxg056 maxmag 0E2 -0E1 -> 0E+2
|
||||
ddmxg057 maxmag 0E1 -0E2 -> 0E+1
|
||||
|
||||
ddmxg058 maxmag 0E1 0E1 -> 0E+1
|
||||
ddmxg059 maxmag 0E2 0E2 -> 0E+2
|
||||
ddmxg060 maxmag 0E2 0E1 -> 0E+2
|
||||
ddmxg061 maxmag 0E1 0E2 -> 0E+2
|
||||
ddmxg062 maxmag -0E1 -0E1 -> -0E+1
|
||||
ddmxg063 maxmag -0E2 -0E2 -> -0E+2
|
||||
ddmxg064 maxmag -0E2 -0E1 -> -0E+1
|
||||
ddmxg065 maxmag -0E1 -0E2 -> -0E+1
|
||||
|
||||
-- Specials
|
||||
ddmxg090 maxmag Inf -Inf -> Infinity
|
||||
ddmxg091 maxmag Inf -1000 -> Infinity
|
||||
ddmxg092 maxmag Inf -1 -> Infinity
|
||||
ddmxg093 maxmag Inf -0 -> Infinity
|
||||
ddmxg094 maxmag Inf 0 -> Infinity
|
||||
ddmxg095 maxmag Inf 1 -> Infinity
|
||||
ddmxg096 maxmag Inf 1000 -> Infinity
|
||||
ddmxg097 maxmag Inf Inf -> Infinity
|
||||
ddmxg098 maxmag -1000 Inf -> Infinity
|
||||
ddmxg099 maxmag -Inf Inf -> Infinity
|
||||
ddmxg100 maxmag -1 Inf -> Infinity
|
||||
ddmxg101 maxmag -0 Inf -> Infinity
|
||||
ddmxg102 maxmag 0 Inf -> Infinity
|
||||
ddmxg103 maxmag 1 Inf -> Infinity
|
||||
ddmxg104 maxmag 1000 Inf -> Infinity
|
||||
ddmxg105 maxmag Inf Inf -> Infinity
|
||||
|
||||
ddmxg120 maxmag -Inf -Inf -> -Infinity
|
||||
ddmxg121 maxmag -Inf -1000 -> -Infinity
|
||||
ddmxg122 maxmag -Inf -1 -> -Infinity
|
||||
ddmxg123 maxmag -Inf -0 -> -Infinity
|
||||
ddmxg124 maxmag -Inf 0 -> -Infinity
|
||||
ddmxg125 maxmag -Inf 1 -> -Infinity
|
||||
ddmxg126 maxmag -Inf 1000 -> -Infinity
|
||||
ddmxg127 maxmag -Inf Inf -> Infinity
|
||||
ddmxg128 maxmag -Inf -Inf -> -Infinity
|
||||
ddmxg129 maxmag -1000 -Inf -> -Infinity
|
||||
ddmxg130 maxmag -1 -Inf -> -Infinity
|
||||
ddmxg131 maxmag -0 -Inf -> -Infinity
|
||||
ddmxg132 maxmag 0 -Inf -> -Infinity
|
||||
ddmxg133 maxmag 1 -Inf -> -Infinity
|
||||
ddmxg134 maxmag 1000 -Inf -> -Infinity
|
||||
ddmxg135 maxmag Inf -Inf -> Infinity
|
||||
|
||||
-- 2004.08.02 754r chooses number over NaN in mixed cases
|
||||
ddmxg141 maxmag NaN -Inf -> -Infinity
|
||||
ddmxg142 maxmag NaN -1000 -> -1000
|
||||
ddmxg143 maxmag NaN -1 -> -1
|
||||
ddmxg144 maxmag NaN -0 -> -0
|
||||
ddmxg145 maxmag NaN 0 -> 0
|
||||
ddmxg146 maxmag NaN 1 -> 1
|
||||
ddmxg147 maxmag NaN 1000 -> 1000
|
||||
ddmxg148 maxmag NaN Inf -> Infinity
|
||||
ddmxg149 maxmag NaN NaN -> NaN
|
||||
ddmxg150 maxmag -Inf NaN -> -Infinity
|
||||
ddmxg151 maxmag -1000 NaN -> -1000
|
||||
ddmxg152 maxmag -1 NaN -> -1
|
||||
ddmxg153 maxmag -0 NaN -> -0
|
||||
ddmxg154 maxmag 0 NaN -> 0
|
||||
ddmxg155 maxmag 1 NaN -> 1
|
||||
ddmxg156 maxmag 1000 NaN -> 1000
|
||||
ddmxg157 maxmag Inf NaN -> Infinity
|
||||
|
||||
ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
|
||||
ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
|
||||
ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation
|
||||
ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation
|
||||
ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation
|
||||
ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation
|
||||
ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
|
||||
ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation
|
||||
ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
|
||||
ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation
|
||||
ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
|
||||
ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
|
||||
ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation
|
||||
ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation
|
||||
ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation
|
||||
ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation
|
||||
ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
|
||||
ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation
|
||||
ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddmxg181 maxmag NaN9 -Inf -> -Infinity
|
||||
ddmxg182 maxmag NaN8 9 -> 9
|
||||
ddmxg183 maxmag -NaN7 Inf -> Infinity
|
||||
|
||||
ddmxg184 maxmag -NaN1 NaN11 -> -NaN1
|
||||
ddmxg185 maxmag NaN2 NaN12 -> NaN2
|
||||
ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13
|
||||
ddmxg187 maxmag NaN14 -NaN5 -> NaN14
|
||||
|
||||
ddmxg188 maxmag -Inf NaN4 -> -Infinity
|
||||
ddmxg189 maxmag -9 -NaN3 -> -9
|
||||
ddmxg190 maxmag Inf NaN2 -> Infinity
|
||||
|
||||
ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
|
||||
ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
|
||||
ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
|
||||
ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
|
||||
ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
|
||||
|
||||
-- old rounding checks
|
||||
ddmxg221 maxmag 12345678000 1 -> 12345678000
|
||||
ddmxg222 maxmag 1 12345678000 -> 12345678000
|
||||
ddmxg223 maxmag 1234567800 1 -> 1234567800
|
||||
ddmxg224 maxmag 1 1234567800 -> 1234567800
|
||||
ddmxg225 maxmag 1234567890 1 -> 1234567890
|
||||
ddmxg226 maxmag 1 1234567890 -> 1234567890
|
||||
ddmxg227 maxmag 1234567891 1 -> 1234567891
|
||||
ddmxg228 maxmag 1 1234567891 -> 1234567891
|
||||
ddmxg229 maxmag 12345678901 1 -> 12345678901
|
||||
ddmxg230 maxmag 1 12345678901 -> 12345678901
|
||||
ddmxg231 maxmag 1234567896 1 -> 1234567896
|
||||
ddmxg232 maxmag 1 1234567896 -> 1234567896
|
||||
ddmxg233 maxmag -1234567891 1 -> -1234567891
|
||||
ddmxg234 maxmag 1 -1234567891 -> -1234567891
|
||||
ddmxg235 maxmag -12345678901 1 -> -12345678901
|
||||
ddmxg236 maxmag 1 -12345678901 -> -12345678901
|
||||
ddmxg237 maxmag -1234567896 1 -> -1234567896
|
||||
ddmxg238 maxmag 1 -1234567896 -> -1234567896
|
||||
|
||||
-- from examples
|
||||
ddmxg280 maxmag '3' '2' -> '3'
|
||||
ddmxg281 maxmag '-10' '3' -> '-10'
|
||||
ddmxg282 maxmag '1.0' '1' -> '1'
|
||||
ddmxg283 maxmag '1' '1.0' -> '1'
|
||||
ddmxg284 maxmag '7' 'NaN' -> '7'
|
||||
|
||||
-- expanded list from min/max 754r purple prose
|
||||
-- [explicit tests for exponent ordering]
|
||||
ddmxg401 maxmag Inf 1.1 -> Infinity
|
||||
ddmxg402 maxmag 1.1 1 -> 1.1
|
||||
ddmxg403 maxmag 1 1.0 -> 1
|
||||
ddmxg404 maxmag 1.0 0.1 -> 1.0
|
||||
ddmxg405 maxmag 0.1 0.10 -> 0.1
|
||||
ddmxg406 maxmag 0.10 0.100 -> 0.10
|
||||
ddmxg407 maxmag 0.10 0 -> 0.10
|
||||
ddmxg408 maxmag 0 0.0 -> 0
|
||||
ddmxg409 maxmag 0.0 -0 -> 0.0
|
||||
ddmxg410 maxmag 0.0 -0.0 -> 0.0
|
||||
ddmxg411 maxmag 0.00 -0.0 -> 0.00
|
||||
ddmxg412 maxmag 0.0 -0.00 -> 0.0
|
||||
ddmxg413 maxmag 0 -0.0 -> 0
|
||||
ddmxg414 maxmag 0 -0 -> 0
|
||||
ddmxg415 maxmag -0.0 -0 -> -0.0
|
||||
ddmxg416 maxmag -0 -0.100 -> -0.100
|
||||
ddmxg417 maxmag -0.100 -0.10 -> -0.100
|
||||
ddmxg418 maxmag -0.10 -0.1 -> -0.10
|
||||
ddmxg419 maxmag -0.1 -1.0 -> -1.0
|
||||
ddmxg420 maxmag -1.0 -1 -> -1.0
|
||||
ddmxg421 maxmag -1 -1.1 -> -1.1
|
||||
ddmxg423 maxmag -1.1 -Inf -> -Infinity
|
||||
-- same with operands reversed
|
||||
ddmxg431 maxmag 1.1 Inf -> Infinity
|
||||
ddmxg432 maxmag 1 1.1 -> 1.1
|
||||
ddmxg433 maxmag 1.0 1 -> 1
|
||||
ddmxg434 maxmag 0.1 1.0 -> 1.0
|
||||
ddmxg435 maxmag 0.10 0.1 -> 0.1
|
||||
ddmxg436 maxmag 0.100 0.10 -> 0.10
|
||||
ddmxg437 maxmag 0 0.10 -> 0.10
|
||||
ddmxg438 maxmag 0.0 0 -> 0
|
||||
ddmxg439 maxmag -0 0.0 -> 0.0
|
||||
ddmxg440 maxmag -0.0 0.0 -> 0.0
|
||||
ddmxg441 maxmag -0.0 0.00 -> 0.00
|
||||
ddmxg442 maxmag -0.00 0.0 -> 0.0
|
||||
ddmxg443 maxmag -0.0 0 -> 0
|
||||
ddmxg444 maxmag -0 0 -> 0
|
||||
ddmxg445 maxmag -0 -0.0 -> -0.0
|
||||
ddmxg446 maxmag -0.100 -0 -> -0.100
|
||||
ddmxg447 maxmag -0.10 -0.100 -> -0.100
|
||||
ddmxg448 maxmag -0.1 -0.10 -> -0.10
|
||||
ddmxg449 maxmag -1.0 -0.1 -> -1.0
|
||||
ddmxg450 maxmag -1 -1.0 -> -1.0
|
||||
ddmxg451 maxmag -1.1 -1 -> -1.1
|
||||
ddmxg453 maxmag -Inf -1.1 -> -Infinity
|
||||
-- largies
|
||||
ddmxg460 maxmag 1000 1E+3 -> 1E+3
|
||||
ddmxg461 maxmag 1E+3 1000 -> 1E+3
|
||||
ddmxg462 maxmag 1000 -1E+3 -> 1000
|
||||
ddmxg463 maxmag 1E+3 -1000 -> 1E+3
|
||||
ddmxg464 maxmag -1000 1E+3 -> 1E+3
|
||||
ddmxg465 maxmag -1E+3 1000 -> 1000
|
||||
ddmxg466 maxmag -1000 -1E+3 -> -1000
|
||||
ddmxg467 maxmag -1E+3 -1000 -> -1000
|
||||
|
||||
-- subnormals
|
||||
ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383
|
||||
ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal
|
||||
ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal
|
||||
ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal
|
||||
ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal
|
||||
ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal
|
||||
ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal
|
||||
ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal
|
||||
ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal
|
||||
ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal
|
||||
ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal
|
||||
|
||||
ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383
|
||||
ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal
|
||||
ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal
|
||||
ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal
|
||||
ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal
|
||||
ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal
|
||||
ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal
|
||||
ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal
|
||||
ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal
|
||||
ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal
|
||||
ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal
|
||||
|
||||
-- Null tests
|
||||
ddmxg900 maxmag 10 # -> NaN Invalid_operation
|
||||
ddmxg901 maxmag # 10 -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,309 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMin.decTest -- decDouble minnum --
|
||||
-- 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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases and rounding
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddmin001 min -2 -2 -> -2
|
||||
ddmin002 min -2 -1 -> -2
|
||||
ddmin003 min -2 0 -> -2
|
||||
ddmin004 min -2 1 -> -2
|
||||
ddmin005 min -2 2 -> -2
|
||||
ddmin006 min -1 -2 -> -2
|
||||
ddmin007 min -1 -1 -> -1
|
||||
ddmin008 min -1 0 -> -1
|
||||
ddmin009 min -1 1 -> -1
|
||||
ddmin010 min -1 2 -> -1
|
||||
ddmin011 min 0 -2 -> -2
|
||||
ddmin012 min 0 -1 -> -1
|
||||
ddmin013 min 0 0 -> 0
|
||||
ddmin014 min 0 1 -> 0
|
||||
ddmin015 min 0 2 -> 0
|
||||
ddmin016 min 1 -2 -> -2
|
||||
ddmin017 min 1 -1 -> -1
|
||||
ddmin018 min 1 0 -> 0
|
||||
ddmin019 min 1 1 -> 1
|
||||
ddmin020 min 1 2 -> 1
|
||||
ddmin021 min 2 -2 -> -2
|
||||
ddmin022 min 2 -1 -> -1
|
||||
ddmin023 min 2 0 -> 0
|
||||
ddmin025 min 2 1 -> 1
|
||||
ddmin026 min 2 2 -> 2
|
||||
|
||||
-- extended zeros
|
||||
ddmin030 min 0 0 -> 0
|
||||
ddmin031 min 0 -0 -> -0
|
||||
ddmin032 min 0 -0.0 -> -0.0
|
||||
ddmin033 min 0 0.0 -> 0.0
|
||||
ddmin034 min -0 0 -> -0
|
||||
ddmin035 min -0 -0 -> -0
|
||||
ddmin036 min -0 -0.0 -> -0
|
||||
ddmin037 min -0 0.0 -> -0
|
||||
ddmin038 min 0.0 0 -> 0.0
|
||||
ddmin039 min 0.0 -0 -> -0
|
||||
ddmin040 min 0.0 -0.0 -> -0.0
|
||||
ddmin041 min 0.0 0.0 -> 0.0
|
||||
ddmin042 min -0.0 0 -> -0.0
|
||||
ddmin043 min -0.0 -0 -> -0
|
||||
ddmin044 min -0.0 -0.0 -> -0.0
|
||||
ddmin045 min -0.0 0.0 -> -0.0
|
||||
|
||||
ddmin046 min 0E1 -0E1 -> -0E+1
|
||||
ddmin047 min -0E1 0E2 -> -0E+1
|
||||
ddmin048 min 0E2 0E1 -> 0E+1
|
||||
ddmin049 min 0E1 0E2 -> 0E+1
|
||||
ddmin050 min -0E3 -0E2 -> -0E+3
|
||||
ddmin051 min -0E2 -0E3 -> -0E+3
|
||||
|
||||
-- Specials
|
||||
ddmin090 min Inf -Inf -> -Infinity
|
||||
ddmin091 min Inf -1000 -> -1000
|
||||
ddmin092 min Inf -1 -> -1
|
||||
ddmin093 min Inf -0 -> -0
|
||||
ddmin094 min Inf 0 -> 0
|
||||
ddmin095 min Inf 1 -> 1
|
||||
ddmin096 min Inf 1000 -> 1000
|
||||
ddmin097 min Inf Inf -> Infinity
|
||||
ddmin098 min -1000 Inf -> -1000
|
||||
ddmin099 min -Inf Inf -> -Infinity
|
||||
ddmin100 min -1 Inf -> -1
|
||||
ddmin101 min -0 Inf -> -0
|
||||
ddmin102 min 0 Inf -> 0
|
||||
ddmin103 min 1 Inf -> 1
|
||||
ddmin104 min 1000 Inf -> 1000
|
||||
ddmin105 min Inf Inf -> Infinity
|
||||
|
||||
ddmin120 min -Inf -Inf -> -Infinity
|
||||
ddmin121 min -Inf -1000 -> -Infinity
|
||||
ddmin122 min -Inf -1 -> -Infinity
|
||||
ddmin123 min -Inf -0 -> -Infinity
|
||||
ddmin124 min -Inf 0 -> -Infinity
|
||||
ddmin125 min -Inf 1 -> -Infinity
|
||||
ddmin126 min -Inf 1000 -> -Infinity
|
||||
ddmin127 min -Inf Inf -> -Infinity
|
||||
ddmin128 min -Inf -Inf -> -Infinity
|
||||
ddmin129 min -1000 -Inf -> -Infinity
|
||||
ddmin130 min -1 -Inf -> -Infinity
|
||||
ddmin131 min -0 -Inf -> -Infinity
|
||||
ddmin132 min 0 -Inf -> -Infinity
|
||||
ddmin133 min 1 -Inf -> -Infinity
|
||||
ddmin134 min 1000 -Inf -> -Infinity
|
||||
ddmin135 min Inf -Inf -> -Infinity
|
||||
|
||||
-- 2004.08.02 754r chooses number over NaN in mixed cases
|
||||
ddmin141 min NaN -Inf -> -Infinity
|
||||
ddmin142 min NaN -1000 -> -1000
|
||||
ddmin143 min NaN -1 -> -1
|
||||
ddmin144 min NaN -0 -> -0
|
||||
ddmin145 min NaN 0 -> 0
|
||||
ddmin146 min NaN 1 -> 1
|
||||
ddmin147 min NaN 1000 -> 1000
|
||||
ddmin148 min NaN Inf -> Infinity
|
||||
ddmin149 min NaN NaN -> NaN
|
||||
ddmin150 min -Inf NaN -> -Infinity
|
||||
ddmin151 min -1000 NaN -> -1000
|
||||
ddmin152 min -1 -NaN -> -1
|
||||
ddmin153 min -0 NaN -> -0
|
||||
ddmin154 min 0 -NaN -> 0
|
||||
ddmin155 min 1 NaN -> 1
|
||||
ddmin156 min 1000 NaN -> 1000
|
||||
ddmin157 min Inf NaN -> Infinity
|
||||
|
||||
ddmin161 min sNaN -Inf -> NaN Invalid_operation
|
||||
ddmin162 min sNaN -1000 -> NaN Invalid_operation
|
||||
ddmin163 min sNaN -1 -> NaN Invalid_operation
|
||||
ddmin164 min sNaN -0 -> NaN Invalid_operation
|
||||
ddmin165 min -sNaN 0 -> -NaN Invalid_operation
|
||||
ddmin166 min -sNaN 1 -> -NaN Invalid_operation
|
||||
ddmin167 min sNaN 1000 -> NaN Invalid_operation
|
||||
ddmin168 min sNaN NaN -> NaN Invalid_operation
|
||||
ddmin169 min sNaN sNaN -> NaN Invalid_operation
|
||||
ddmin170 min NaN sNaN -> NaN Invalid_operation
|
||||
ddmin171 min -Inf sNaN -> NaN Invalid_operation
|
||||
ddmin172 min -1000 sNaN -> NaN Invalid_operation
|
||||
ddmin173 min -1 sNaN -> NaN Invalid_operation
|
||||
ddmin174 min -0 sNaN -> NaN Invalid_operation
|
||||
ddmin175 min 0 sNaN -> NaN Invalid_operation
|
||||
ddmin176 min 1 sNaN -> NaN Invalid_operation
|
||||
ddmin177 min 1000 sNaN -> NaN Invalid_operation
|
||||
ddmin178 min Inf sNaN -> NaN Invalid_operation
|
||||
ddmin179 min NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddmin181 min NaN9 -Inf -> -Infinity
|
||||
ddmin182 min -NaN8 9990 -> 9990
|
||||
ddmin183 min NaN71 Inf -> Infinity
|
||||
|
||||
ddmin184 min NaN1 NaN54 -> NaN1
|
||||
ddmin185 min NaN22 -NaN53 -> NaN22
|
||||
ddmin186 min -NaN3 NaN6 -> -NaN3
|
||||
ddmin187 min -NaN44 NaN7 -> -NaN44
|
||||
|
||||
ddmin188 min -Inf NaN41 -> -Infinity
|
||||
ddmin189 min -9999 -NaN33 -> -9999
|
||||
ddmin190 min Inf NaN2 -> Infinity
|
||||
|
||||
ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
|
||||
ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
|
||||
ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation
|
||||
ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation
|
||||
|
||||
-- old rounding checks
|
||||
ddmin221 min -12345678000 1 -> -12345678000
|
||||
ddmin222 min 1 -12345678000 -> -12345678000
|
||||
ddmin223 min -1234567800 1 -> -1234567800
|
||||
ddmin224 min 1 -1234567800 -> -1234567800
|
||||
ddmin225 min -1234567890 1 -> -1234567890
|
||||
ddmin226 min 1 -1234567890 -> -1234567890
|
||||
ddmin227 min -1234567891 1 -> -1234567891
|
||||
ddmin228 min 1 -1234567891 -> -1234567891
|
||||
ddmin229 min -12345678901 1 -> -12345678901
|
||||
ddmin230 min 1 -12345678901 -> -12345678901
|
||||
ddmin231 min -1234567896 1 -> -1234567896
|
||||
ddmin232 min 1 -1234567896 -> -1234567896
|
||||
ddmin233 min 1234567891 1 -> 1
|
||||
ddmin234 min 1 1234567891 -> 1
|
||||
ddmin235 min 12345678901 1 -> 1
|
||||
ddmin236 min 1 12345678901 -> 1
|
||||
ddmin237 min 1234567896 1 -> 1
|
||||
ddmin238 min 1 1234567896 -> 1
|
||||
|
||||
-- from examples
|
||||
ddmin280 min '3' '2' -> '2'
|
||||
ddmin281 min '-10' '3' -> '-10'
|
||||
ddmin282 min '1.0' '1' -> '1.0'
|
||||
ddmin283 min '1' '1.0' -> '1.0'
|
||||
ddmin284 min '7' 'NaN' -> '7'
|
||||
|
||||
-- expanded list from min/max 754r purple prose
|
||||
-- [explicit tests for exponent ordering]
|
||||
ddmin401 min Inf 1.1 -> 1.1
|
||||
ddmin402 min 1.1 1 -> 1
|
||||
ddmin403 min 1 1.0 -> 1.0
|
||||
ddmin404 min 1.0 0.1 -> 0.1
|
||||
ddmin405 min 0.1 0.10 -> 0.10
|
||||
ddmin406 min 0.10 0.100 -> 0.100
|
||||
ddmin407 min 0.10 0 -> 0
|
||||
ddmin408 min 0 0.0 -> 0.0
|
||||
ddmin409 min 0.0 -0 -> -0
|
||||
ddmin410 min 0.0 -0.0 -> -0.0
|
||||
ddmin411 min 0.00 -0.0 -> -0.0
|
||||
ddmin412 min 0.0 -0.00 -> -0.00
|
||||
ddmin413 min 0 -0.0 -> -0.0
|
||||
ddmin414 min 0 -0 -> -0
|
||||
ddmin415 min -0.0 -0 -> -0
|
||||
ddmin416 min -0 -0.100 -> -0.100
|
||||
ddmin417 min -0.100 -0.10 -> -0.10
|
||||
ddmin418 min -0.10 -0.1 -> -0.1
|
||||
ddmin419 min -0.1 -1.0 -> -1.0
|
||||
ddmin420 min -1.0 -1 -> -1
|
||||
ddmin421 min -1 -1.1 -> -1.1
|
||||
ddmin423 min -1.1 -Inf -> -Infinity
|
||||
-- same with operands reversed
|
||||
ddmin431 min 1.1 Inf -> 1.1
|
||||
ddmin432 min 1 1.1 -> 1
|
||||
ddmin433 min 1.0 1 -> 1.0
|
||||
ddmin434 min 0.1 1.0 -> 0.1
|
||||
ddmin435 min 0.10 0.1 -> 0.10
|
||||
ddmin436 min 0.100 0.10 -> 0.100
|
||||
ddmin437 min 0 0.10 -> 0
|
||||
ddmin438 min 0.0 0 -> 0.0
|
||||
ddmin439 min -0 0.0 -> -0
|
||||
ddmin440 min -0.0 0.0 -> -0.0
|
||||
ddmin441 min -0.0 0.00 -> -0.0
|
||||
ddmin442 min -0.00 0.0 -> -0.00
|
||||
ddmin443 min -0.0 0 -> -0.0
|
||||
ddmin444 min -0 0 -> -0
|
||||
ddmin445 min -0 -0.0 -> -0
|
||||
ddmin446 min -0.100 -0 -> -0.100
|
||||
ddmin447 min -0.10 -0.100 -> -0.10
|
||||
ddmin448 min -0.1 -0.10 -> -0.1
|
||||
ddmin449 min -1.0 -0.1 -> -1.0
|
||||
ddmin450 min -1 -1.0 -> -1
|
||||
ddmin451 min -1.1 -1 -> -1.1
|
||||
ddmin453 min -Inf -1.1 -> -Infinity
|
||||
-- largies
|
||||
ddmin460 min 1000 1E+3 -> 1000
|
||||
ddmin461 min 1E+3 1000 -> 1000
|
||||
ddmin462 min 1000 -1E+3 -> -1E+3
|
||||
ddmin463 min 1E+3 -384 -> -384
|
||||
ddmin464 min -384 1E+3 -> -384
|
||||
ddmin465 min -1E+3 1000 -> -1E+3
|
||||
ddmin466 min -384 -1E+3 -> -1E+3
|
||||
ddmin467 min -1E+3 -384 -> -1E+3
|
||||
|
||||
-- misalignment traps for little-endian
|
||||
ddmin471 min 1.0 0.1 -> 0.1
|
||||
ddmin472 min 0.1 1.0 -> 0.1
|
||||
ddmin473 min 10.0 0.1 -> 0.1
|
||||
ddmin474 min 0.1 10.0 -> 0.1
|
||||
ddmin475 min 100 1.0 -> 1.0
|
||||
ddmin476 min 1.0 100 -> 1.0
|
||||
ddmin477 min 1000 10.0 -> 10.0
|
||||
ddmin478 min 10.0 1000 -> 10.0
|
||||
ddmin479 min 10000 100.0 -> 100.0
|
||||
ddmin480 min 100.0 10000 -> 100.0
|
||||
ddmin481 min 100000 1000.0 -> 1000.0
|
||||
ddmin482 min 1000.0 100000 -> 1000.0
|
||||
ddmin483 min 1000000 10000.0 -> 10000.0
|
||||
ddmin484 min 10000.0 1000000 -> 10000.0
|
||||
|
||||
-- subnormals
|
||||
ddmin510 min 1.00E-383 0 -> 0
|
||||
ddmin511 min 0.1E-383 0 -> 0
|
||||
ddmin512 min 0.10E-383 0 -> 0
|
||||
ddmin513 min 0.100E-383 0 -> 0
|
||||
ddmin514 min 0.01E-383 0 -> 0
|
||||
ddmin515 min 0.999E-383 0 -> 0
|
||||
ddmin516 min 0.099E-383 0 -> 0
|
||||
ddmin517 min 0.009E-383 0 -> 0
|
||||
ddmin518 min 0.001E-383 0 -> 0
|
||||
ddmin519 min 0.0009E-383 0 -> 0
|
||||
ddmin520 min 0.0001E-383 0 -> 0
|
||||
|
||||
ddmin530 min -1.00E-383 0 -> -1.00E-383
|
||||
ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal
|
||||
ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal
|
||||
ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal
|
||||
ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal
|
||||
ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal
|
||||
ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal
|
||||
ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal
|
||||
ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal
|
||||
ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal
|
||||
ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal
|
||||
|
||||
|
||||
-- Null tests
|
||||
ddmin900 min 10 # -> NaN Invalid_operation
|
||||
ddmin901 min # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,293 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMinMag.decTest -- decDouble minnummag --
|
||||
-- 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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases and rounding
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddmng001 minmag -2 -2 -> -2
|
||||
ddmng002 minmag -2 -1 -> -1
|
||||
ddmng003 minmag -2 0 -> 0
|
||||
ddmng004 minmag -2 1 -> 1
|
||||
ddmng005 minmag -2 2 -> -2
|
||||
ddmng006 minmag -1 -2 -> -1
|
||||
ddmng007 minmag -1 -1 -> -1
|
||||
ddmng008 minmag -1 0 -> 0
|
||||
ddmng009 minmag -1 1 -> -1
|
||||
ddmng010 minmag -1 2 -> -1
|
||||
ddmng011 minmag 0 -2 -> 0
|
||||
ddmng012 minmag 0 -1 -> 0
|
||||
ddmng013 minmag 0 0 -> 0
|
||||
ddmng014 minmag 0 1 -> 0
|
||||
ddmng015 minmag 0 2 -> 0
|
||||
ddmng016 minmag 1 -2 -> 1
|
||||
ddmng017 minmag 1 -1 -> -1
|
||||
ddmng018 minmag 1 0 -> 0
|
||||
ddmng019 minmag 1 1 -> 1
|
||||
ddmng020 minmag 1 2 -> 1
|
||||
ddmng021 minmag 2 -2 -> -2
|
||||
ddmng022 minmag 2 -1 -> -1
|
||||
ddmng023 minmag 2 0 -> 0
|
||||
ddmng025 minmag 2 1 -> 1
|
||||
ddmng026 minmag 2 2 -> 2
|
||||
|
||||
-- extended zeros
|
||||
ddmng030 minmag 0 0 -> 0
|
||||
ddmng031 minmag 0 -0 -> -0
|
||||
ddmng032 minmag 0 -0.0 -> -0.0
|
||||
ddmng033 minmag 0 0.0 -> 0.0
|
||||
ddmng034 minmag -0 0 -> -0
|
||||
ddmng035 minmag -0 -0 -> -0
|
||||
ddmng036 minmag -0 -0.0 -> -0
|
||||
ddmng037 minmag -0 0.0 -> -0
|
||||
ddmng038 minmag 0.0 0 -> 0.0
|
||||
ddmng039 minmag 0.0 -0 -> -0
|
||||
ddmng040 minmag 0.0 -0.0 -> -0.0
|
||||
ddmng041 minmag 0.0 0.0 -> 0.0
|
||||
ddmng042 minmag -0.0 0 -> -0.0
|
||||
ddmng043 minmag -0.0 -0 -> -0
|
||||
ddmng044 minmag -0.0 -0.0 -> -0.0
|
||||
ddmng045 minmag -0.0 0.0 -> -0.0
|
||||
|
||||
ddmng046 minmag 0E1 -0E1 -> -0E+1
|
||||
ddmng047 minmag -0E1 0E2 -> -0E+1
|
||||
ddmng048 minmag 0E2 0E1 -> 0E+1
|
||||
ddmng049 minmag 0E1 0E2 -> 0E+1
|
||||
ddmng050 minmag -0E3 -0E2 -> -0E+3
|
||||
ddmng051 minmag -0E2 -0E3 -> -0E+3
|
||||
|
||||
-- Specials
|
||||
ddmng090 minmag Inf -Inf -> -Infinity
|
||||
ddmng091 minmag Inf -1000 -> -1000
|
||||
ddmng092 minmag Inf -1 -> -1
|
||||
ddmng093 minmag Inf -0 -> -0
|
||||
ddmng094 minmag Inf 0 -> 0
|
||||
ddmng095 minmag Inf 1 -> 1
|
||||
ddmng096 minmag Inf 1000 -> 1000
|
||||
ddmng097 minmag Inf Inf -> Infinity
|
||||
ddmng098 minmag -1000 Inf -> -1000
|
||||
ddmng099 minmag -Inf Inf -> -Infinity
|
||||
ddmng100 minmag -1 Inf -> -1
|
||||
ddmng101 minmag -0 Inf -> -0
|
||||
ddmng102 minmag 0 Inf -> 0
|
||||
ddmng103 minmag 1 Inf -> 1
|
||||
ddmng104 minmag 1000 Inf -> 1000
|
||||
ddmng105 minmag Inf Inf -> Infinity
|
||||
|
||||
ddmng120 minmag -Inf -Inf -> -Infinity
|
||||
ddmng121 minmag -Inf -1000 -> -1000
|
||||
ddmng122 minmag -Inf -1 -> -1
|
||||
ddmng123 minmag -Inf -0 -> -0
|
||||
ddmng124 minmag -Inf 0 -> 0
|
||||
ddmng125 minmag -Inf 1 -> 1
|
||||
ddmng126 minmag -Inf 1000 -> 1000
|
||||
ddmng127 minmag -Inf Inf -> -Infinity
|
||||
ddmng128 minmag -Inf -Inf -> -Infinity
|
||||
ddmng129 minmag -1000 -Inf -> -1000
|
||||
ddmng130 minmag -1 -Inf -> -1
|
||||
ddmng131 minmag -0 -Inf -> -0
|
||||
ddmng132 minmag 0 -Inf -> 0
|
||||
ddmng133 minmag 1 -Inf -> 1
|
||||
ddmng134 minmag 1000 -Inf -> 1000
|
||||
ddmng135 minmag Inf -Inf -> -Infinity
|
||||
|
||||
-- 2004.08.02 754r chooses number over NaN in mixed cases
|
||||
ddmng141 minmag NaN -Inf -> -Infinity
|
||||
ddmng142 minmag NaN -1000 -> -1000
|
||||
ddmng143 minmag NaN -1 -> -1
|
||||
ddmng144 minmag NaN -0 -> -0
|
||||
ddmng145 minmag NaN 0 -> 0
|
||||
ddmng146 minmag NaN 1 -> 1
|
||||
ddmng147 minmag NaN 1000 -> 1000
|
||||
ddmng148 minmag NaN Inf -> Infinity
|
||||
ddmng149 minmag NaN NaN -> NaN
|
||||
ddmng150 minmag -Inf NaN -> -Infinity
|
||||
ddmng151 minmag -1000 NaN -> -1000
|
||||
ddmng152 minmag -1 -NaN -> -1
|
||||
ddmng153 minmag -0 NaN -> -0
|
||||
ddmng154 minmag 0 -NaN -> 0
|
||||
ddmng155 minmag 1 NaN -> 1
|
||||
ddmng156 minmag 1000 NaN -> 1000
|
||||
ddmng157 minmag Inf NaN -> Infinity
|
||||
|
||||
ddmng161 minmag sNaN -Inf -> NaN Invalid_operation
|
||||
ddmng162 minmag sNaN -1000 -> NaN Invalid_operation
|
||||
ddmng163 minmag sNaN -1 -> NaN Invalid_operation
|
||||
ddmng164 minmag sNaN -0 -> NaN Invalid_operation
|
||||
ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation
|
||||
ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation
|
||||
ddmng167 minmag sNaN 1000 -> NaN Invalid_operation
|
||||
ddmng168 minmag sNaN NaN -> NaN Invalid_operation
|
||||
ddmng169 minmag sNaN sNaN -> NaN Invalid_operation
|
||||
ddmng170 minmag NaN sNaN -> NaN Invalid_operation
|
||||
ddmng171 minmag -Inf sNaN -> NaN Invalid_operation
|
||||
ddmng172 minmag -1000 sNaN -> NaN Invalid_operation
|
||||
ddmng173 minmag -1 sNaN -> NaN Invalid_operation
|
||||
ddmng174 minmag -0 sNaN -> NaN Invalid_operation
|
||||
ddmng175 minmag 0 sNaN -> NaN Invalid_operation
|
||||
ddmng176 minmag 1 sNaN -> NaN Invalid_operation
|
||||
ddmng177 minmag 1000 sNaN -> NaN Invalid_operation
|
||||
ddmng178 minmag Inf sNaN -> NaN Invalid_operation
|
||||
ddmng179 minmag NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddmng181 minmag NaN9 -Inf -> -Infinity
|
||||
ddmng182 minmag -NaN8 9990 -> 9990
|
||||
ddmng183 minmag NaN71 Inf -> Infinity
|
||||
|
||||
ddmng184 minmag NaN1 NaN54 -> NaN1
|
||||
ddmng185 minmag NaN22 -NaN53 -> NaN22
|
||||
ddmng186 minmag -NaN3 NaN6 -> -NaN3
|
||||
ddmng187 minmag -NaN44 NaN7 -> -NaN44
|
||||
|
||||
ddmng188 minmag -Inf NaN41 -> -Infinity
|
||||
ddmng189 minmag -9999 -NaN33 -> -9999
|
||||
ddmng190 minmag Inf NaN2 -> Infinity
|
||||
|
||||
ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
|
||||
ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
|
||||
ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
|
||||
ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
|
||||
|
||||
-- old rounding checks
|
||||
ddmng221 minmag -12345678000 1 -> 1
|
||||
ddmng222 minmag 1 -12345678000 -> 1
|
||||
ddmng223 minmag -1234567800 1 -> 1
|
||||
ddmng224 minmag 1 -1234567800 -> 1
|
||||
ddmng225 minmag -1234567890 1 -> 1
|
||||
ddmng226 minmag 1 -1234567890 -> 1
|
||||
ddmng227 minmag -1234567891 1 -> 1
|
||||
ddmng228 minmag 1 -1234567891 -> 1
|
||||
ddmng229 minmag -12345678901 1 -> 1
|
||||
ddmng230 minmag 1 -12345678901 -> 1
|
||||
ddmng231 minmag -1234567896 1 -> 1
|
||||
ddmng232 minmag 1 -1234567896 -> 1
|
||||
ddmng233 minmag 1234567891 1 -> 1
|
||||
ddmng234 minmag 1 1234567891 -> 1
|
||||
ddmng235 minmag 12345678901 1 -> 1
|
||||
ddmng236 minmag 1 12345678901 -> 1
|
||||
ddmng237 minmag 1234567896 1 -> 1
|
||||
ddmng238 minmag 1 1234567896 -> 1
|
||||
|
||||
-- from examples
|
||||
ddmng280 minmag '3' '2' -> '2'
|
||||
ddmng281 minmag '-10' '3' -> '3'
|
||||
ddmng282 minmag '1.0' '1' -> '1.0'
|
||||
ddmng283 minmag '1' '1.0' -> '1.0'
|
||||
ddmng284 minmag '7' 'NaN' -> '7'
|
||||
|
||||
-- expanded list from min/max 754r purple prose
|
||||
-- [explicit tests for exponent ordering]
|
||||
ddmng401 minmag Inf 1.1 -> 1.1
|
||||
ddmng402 minmag 1.1 1 -> 1
|
||||
ddmng403 minmag 1 1.0 -> 1.0
|
||||
ddmng404 minmag 1.0 0.1 -> 0.1
|
||||
ddmng405 minmag 0.1 0.10 -> 0.10
|
||||
ddmng406 minmag 0.10 0.100 -> 0.100
|
||||
ddmng407 minmag 0.10 0 -> 0
|
||||
ddmng408 minmag 0 0.0 -> 0.0
|
||||
ddmng409 minmag 0.0 -0 -> -0
|
||||
ddmng410 minmag 0.0 -0.0 -> -0.0
|
||||
ddmng411 minmag 0.00 -0.0 -> -0.0
|
||||
ddmng412 minmag 0.0 -0.00 -> -0.00
|
||||
ddmng413 minmag 0 -0.0 -> -0.0
|
||||
ddmng414 minmag 0 -0 -> -0
|
||||
ddmng415 minmag -0.0 -0 -> -0
|
||||
ddmng416 minmag -0 -0.100 -> -0
|
||||
ddmng417 minmag -0.100 -0.10 -> -0.10
|
||||
ddmng418 minmag -0.10 -0.1 -> -0.1
|
||||
ddmng419 minmag -0.1 -1.0 -> -0.1
|
||||
ddmng420 minmag -1.0 -1 -> -1
|
||||
ddmng421 minmag -1 -1.1 -> -1
|
||||
ddmng423 minmag -1.1 -Inf -> -1.1
|
||||
-- same with operands reversed
|
||||
ddmng431 minmag 1.1 Inf -> 1.1
|
||||
ddmng432 minmag 1 1.1 -> 1
|
||||
ddmng433 minmag 1.0 1 -> 1.0
|
||||
ddmng434 minmag 0.1 1.0 -> 0.1
|
||||
ddmng435 minmag 0.10 0.1 -> 0.10
|
||||
ddmng436 minmag 0.100 0.10 -> 0.100
|
||||
ddmng437 minmag 0 0.10 -> 0
|
||||
ddmng438 minmag 0.0 0 -> 0.0
|
||||
ddmng439 minmag -0 0.0 -> -0
|
||||
ddmng440 minmag -0.0 0.0 -> -0.0
|
||||
ddmng441 minmag -0.0 0.00 -> -0.0
|
||||
ddmng442 minmag -0.00 0.0 -> -0.00
|
||||
ddmng443 minmag -0.0 0 -> -0.0
|
||||
ddmng444 minmag -0 0 -> -0
|
||||
ddmng445 minmag -0 -0.0 -> -0
|
||||
ddmng446 minmag -0.100 -0 -> -0
|
||||
ddmng447 minmag -0.10 -0.100 -> -0.10
|
||||
ddmng448 minmag -0.1 -0.10 -> -0.1
|
||||
ddmng449 minmag -1.0 -0.1 -> -0.1
|
||||
ddmng450 minmag -1 -1.0 -> -1
|
||||
ddmng451 minmag -1.1 -1 -> -1
|
||||
ddmng453 minmag -Inf -1.1 -> -1.1
|
||||
-- largies
|
||||
ddmng460 minmag 1000 1E+3 -> 1000
|
||||
ddmng461 minmag 1E+3 1000 -> 1000
|
||||
ddmng462 minmag 1000 -1E+3 -> -1E+3
|
||||
ddmng463 minmag 1E+3 -384 -> -384
|
||||
ddmng464 minmag -384 1E+3 -> -384
|
||||
ddmng465 minmag -1E+3 1000 -> -1E+3
|
||||
ddmng466 minmag -384 -1E+3 -> -384
|
||||
ddmng467 minmag -1E+3 -384 -> -384
|
||||
|
||||
-- subnormals
|
||||
ddmng510 minmag 1.00E-383 0 -> 0
|
||||
ddmng511 minmag 0.1E-383 0 -> 0
|
||||
ddmng512 minmag 0.10E-383 0 -> 0
|
||||
ddmng513 minmag 0.100E-383 0 -> 0
|
||||
ddmng514 minmag 0.01E-383 0 -> 0
|
||||
ddmng515 minmag 0.999E-383 0 -> 0
|
||||
ddmng516 minmag 0.099E-383 0 -> 0
|
||||
ddmng517 minmag 0.009E-383 0 -> 0
|
||||
ddmng518 minmag 0.001E-383 0 -> 0
|
||||
ddmng519 minmag 0.0009E-383 0 -> 0
|
||||
ddmng520 minmag 0.0001E-383 0 -> 0
|
||||
|
||||
ddmng530 minmag -1.00E-383 0 -> 0
|
||||
ddmng531 minmag -0.1E-383 0 -> 0
|
||||
ddmng532 minmag -0.10E-383 0 -> 0
|
||||
ddmng533 minmag -0.100E-383 0 -> 0
|
||||
ddmng534 minmag -0.01E-383 0 -> 0
|
||||
ddmng535 minmag -0.999E-383 0 -> 0
|
||||
ddmng536 minmag -0.099E-383 0 -> 0
|
||||
ddmng537 minmag -0.009E-383 0 -> 0
|
||||
ddmng538 minmag -0.001E-383 0 -> 0
|
||||
ddmng539 minmag -0.0009E-383 0 -> 0
|
||||
ddmng540 minmag -0.0001E-383 0 -> 0
|
||||
|
||||
|
||||
-- Null tests
|
||||
ddmng900 minmag 10 # -> NaN Invalid_operation
|
||||
ddmng901 minmag # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,88 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMinus.decTest -- decDouble 0-x --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddmns001 minus +7.50 -> -7.50
|
||||
|
||||
-- Infinities
|
||||
ddmns011 minus Infinity -> -Infinity
|
||||
ddmns012 minus -Infinity -> Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddmns021 minus NaN -> NaN
|
||||
ddmns022 minus -NaN -> -NaN
|
||||
ddmns023 minus sNaN -> NaN Invalid_operation
|
||||
ddmns024 minus -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddmns031 minus NaN13 -> NaN13
|
||||
ddmns032 minus -NaN13 -> -NaN13
|
||||
ddmns033 minus sNaN13 -> NaN13 Invalid_operation
|
||||
ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation
|
||||
ddmns035 minus NaN70 -> NaN70
|
||||
ddmns036 minus -NaN70 -> -NaN70
|
||||
ddmns037 minus sNaN101 -> NaN101 Invalid_operation
|
||||
ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation
|
||||
|
||||
-- finites
|
||||
ddmns101 minus 7 -> -7
|
||||
ddmns102 minus -7 -> 7
|
||||
ddmns103 minus 75 -> -75
|
||||
ddmns104 minus -75 -> 75
|
||||
ddmns105 minus 7.50 -> -7.50
|
||||
ddmns106 minus -7.50 -> 7.50
|
||||
ddmns107 minus 7.500 -> -7.500
|
||||
ddmns108 minus -7.500 -> 7.500
|
||||
|
||||
-- zeros
|
||||
ddmns111 minus 0 -> 0
|
||||
ddmns112 minus -0 -> 0
|
||||
ddmns113 minus 0E+4 -> 0E+4
|
||||
ddmns114 minus -0E+4 -> 0E+4
|
||||
ddmns115 minus 0.0000 -> 0.0000
|
||||
ddmns116 minus -0.0000 -> 0.0000
|
||||
ddmns117 minus 0E-141 -> 0E-141
|
||||
ddmns118 minus -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddmns121 minus 2682682682682682 -> -2682682682682682
|
||||
ddmns122 minus -2682682682682682 -> 2682682682682682
|
||||
ddmns123 minus 1341341341341341 -> -1341341341341341
|
||||
ddmns124 minus -1341341341341341 -> 1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384
|
||||
ddmns132 minus 1E-383 -> -1E-383
|
||||
ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
ddmns134 minus 1E-398 -> -1E-398 Subnormal
|
||||
|
||||
ddmns135 minus -1E-398 -> 1E-398 Subnormal
|
||||
ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddmns137 minus -1E-383 -> 1E-383
|
||||
ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384
|
|
@ -0,0 +1,463 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddMultiply.decTest -- decDouble multiplication --
|
||||
-- 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
|
||||
|
||||
-- This set of tests are for decDoubles only; all arguments are
|
||||
-- representable in a decDouble
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddmul000 multiply 2 2 -> 4
|
||||
ddmul001 multiply 2 3 -> 6
|
||||
ddmul002 multiply 5 1 -> 5
|
||||
ddmul003 multiply 5 2 -> 10
|
||||
ddmul004 multiply 1.20 2 -> 2.40
|
||||
ddmul005 multiply 1.20 0 -> 0.00
|
||||
ddmul006 multiply 1.20 -2 -> -2.40
|
||||
ddmul007 multiply -1.20 2 -> -2.40
|
||||
ddmul008 multiply -1.20 0 -> -0.00
|
||||
ddmul009 multiply -1.20 -2 -> 2.40
|
||||
ddmul010 multiply 5.09 7.1 -> 36.139
|
||||
ddmul011 multiply 2.5 4 -> 10.0
|
||||
ddmul012 multiply 2.50 4 -> 10.00
|
||||
ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
|
||||
ddmul015 multiply 2.50 4 -> 10.00
|
||||
ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded
|
||||
ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
|
||||
ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded
|
||||
ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded
|
||||
|
||||
-- zeros, etc.
|
||||
ddmul021 multiply 0 0 -> 0
|
||||
ddmul022 multiply 0 -0 -> -0
|
||||
ddmul023 multiply -0 0 -> -0
|
||||
ddmul024 multiply -0 -0 -> 0
|
||||
ddmul025 multiply -0.0 -0.0 -> 0.00
|
||||
ddmul026 multiply -0.0 -0.0 -> 0.00
|
||||
ddmul027 multiply -0.0 -0.0 -> 0.00
|
||||
ddmul028 multiply -0.0 -0.0 -> 0.00
|
||||
ddmul030 multiply 5.00 1E-3 -> 0.00500
|
||||
ddmul031 multiply 00.00 0.000 -> 0.00000
|
||||
ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
|
||||
ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
|
||||
ddmul034 multiply -5.00 1E-3 -> -0.00500
|
||||
ddmul035 multiply -00.00 0.000 -> -0.00000
|
||||
ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
|
||||
ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
|
||||
ddmul038 multiply 5.00 -1E-3 -> -0.00500
|
||||
ddmul039 multiply 00.00 -0.000 -> -0.00000
|
||||
ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
|
||||
ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
|
||||
ddmul042 multiply -5.00 -1E-3 -> 0.00500
|
||||
ddmul043 multiply -00.00 -0.000 -> 0.00000
|
||||
ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
|
||||
ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
|
||||
|
||||
-- examples from decarith
|
||||
ddmul050 multiply 1.20 3 -> 3.60
|
||||
ddmul051 multiply 7 3 -> 21
|
||||
ddmul052 multiply 0.9 0.8 -> 0.72
|
||||
ddmul053 multiply 0.9 -0 -> -0.0
|
||||
ddmul054 multiply 654321 654321 -> 428135971041
|
||||
|
||||
ddmul060 multiply 123.45 1e7 -> 1.2345E+9
|
||||
ddmul061 multiply 123.45 1e8 -> 1.2345E+10
|
||||
ddmul062 multiply 123.45 1e+9 -> 1.2345E+11
|
||||
ddmul063 multiply 123.45 1e10 -> 1.2345E+12
|
||||
ddmul064 multiply 123.45 1e11 -> 1.2345E+13
|
||||
ddmul065 multiply 123.45 1e12 -> 1.2345E+14
|
||||
ddmul066 multiply 123.45 1e13 -> 1.2345E+15
|
||||
|
||||
|
||||
-- test some intermediate lengths
|
||||
-- 1234567890123456
|
||||
ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
|
||||
ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
|
||||
ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
|
||||
ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
|
||||
|
||||
-- test some more edge cases and carries
|
||||
ddmul101 multiply 9 9 -> 81
|
||||
ddmul102 multiply 9 90 -> 810
|
||||
ddmul103 multiply 9 900 -> 8100
|
||||
ddmul104 multiply 9 9000 -> 81000
|
||||
ddmul105 multiply 9 90000 -> 810000
|
||||
ddmul106 multiply 9 900000 -> 8100000
|
||||
ddmul107 multiply 9 9000000 -> 81000000
|
||||
ddmul108 multiply 9 90000000 -> 810000000
|
||||
ddmul109 multiply 9 900000000 -> 8100000000
|
||||
ddmul110 multiply 9 9000000000 -> 81000000000
|
||||
ddmul111 multiply 9 90000000000 -> 810000000000
|
||||
ddmul112 multiply 9 900000000000 -> 8100000000000
|
||||
ddmul113 multiply 9 9000000000000 -> 81000000000000
|
||||
ddmul114 multiply 9 90000000000000 -> 810000000000000
|
||||
ddmul115 multiply 9 900000000000000 -> 8100000000000000
|
||||
--ddmul116 multiply 9 9000000000000000 -> 81000000000000000
|
||||
--ddmul117 multiply 9 90000000000000000 -> 810000000000000000
|
||||
--ddmul118 multiply 9 900000000000000000 -> 8100000000000000000
|
||||
--ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000
|
||||
--ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000
|
||||
--ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
|
||||
--ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
|
||||
--ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
|
||||
-- test some more edge cases without carries
|
||||
ddmul131 multiply 3 3 -> 9
|
||||
ddmul132 multiply 3 30 -> 90
|
||||
ddmul133 multiply 3 300 -> 900
|
||||
ddmul134 multiply 3 3000 -> 9000
|
||||
ddmul135 multiply 3 30000 -> 90000
|
||||
ddmul136 multiply 3 300000 -> 900000
|
||||
ddmul137 multiply 3 3000000 -> 9000000
|
||||
ddmul138 multiply 3 30000000 -> 90000000
|
||||
ddmul139 multiply 3 300000000 -> 900000000
|
||||
ddmul140 multiply 3 3000000000 -> 9000000000
|
||||
ddmul141 multiply 3 30000000000 -> 90000000000
|
||||
ddmul142 multiply 3 300000000000 -> 900000000000
|
||||
ddmul143 multiply 3 3000000000000 -> 9000000000000
|
||||
ddmul144 multiply 3 30000000000000 -> 90000000000000
|
||||
ddmul145 multiply 3 300000000000000 -> 900000000000000
|
||||
|
||||
-- test some edge cases with exact rounding
|
||||
ddmul301 multiply 9 9 -> 81
|
||||
ddmul302 multiply 9 90 -> 810
|
||||
ddmul303 multiply 9 900 -> 8100
|
||||
ddmul304 multiply 9 9000 -> 81000
|
||||
ddmul305 multiply 9 90000 -> 810000
|
||||
ddmul306 multiply 9 900000 -> 8100000
|
||||
ddmul307 multiply 9 9000000 -> 81000000
|
||||
ddmul308 multiply 9 90000000 -> 810000000
|
||||
ddmul309 multiply 9 900000000 -> 8100000000
|
||||
ddmul310 multiply 9 9000000000 -> 81000000000
|
||||
ddmul311 multiply 9 90000000000 -> 810000000000
|
||||
ddmul312 multiply 9 900000000000 -> 8100000000000
|
||||
ddmul313 multiply 9 9000000000000 -> 81000000000000
|
||||
ddmul314 multiply 9 90000000000000 -> 810000000000000
|
||||
ddmul315 multiply 9 900000000000000 -> 8100000000000000
|
||||
ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded
|
||||
ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded
|
||||
ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded
|
||||
ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded
|
||||
ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded
|
||||
ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded
|
||||
ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded
|
||||
ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded
|
||||
|
||||
-- tryzeros cases
|
||||
ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped
|
||||
ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped
|
||||
|
||||
-- mixed with zeros
|
||||
ddmul541 multiply 0 -1 -> -0
|
||||
ddmul542 multiply -0 -1 -> 0
|
||||
ddmul543 multiply 0 1 -> 0
|
||||
ddmul544 multiply -0 1 -> -0
|
||||
ddmul545 multiply -1 0 -> -0
|
||||
ddmul546 multiply -1 -0 -> 0
|
||||
ddmul547 multiply 1 0 -> 0
|
||||
ddmul548 multiply 1 -0 -> -0
|
||||
|
||||
ddmul551 multiply 0.0 -1 -> -0.0
|
||||
ddmul552 multiply -0.0 -1 -> 0.0
|
||||
ddmul553 multiply 0.0 1 -> 0.0
|
||||
ddmul554 multiply -0.0 1 -> -0.0
|
||||
ddmul555 multiply -1.0 0 -> -0.0
|
||||
ddmul556 multiply -1.0 -0 -> 0.0
|
||||
ddmul557 multiply 1.0 0 -> 0.0
|
||||
ddmul558 multiply 1.0 -0 -> -0.0
|
||||
|
||||
ddmul561 multiply 0 -1.0 -> -0.0
|
||||
ddmul562 multiply -0 -1.0 -> 0.0
|
||||
ddmul563 multiply 0 1.0 -> 0.0
|
||||
ddmul564 multiply -0 1.0 -> -0.0
|
||||
ddmul565 multiply -1 0.0 -> -0.0
|
||||
ddmul566 multiply -1 -0.0 -> 0.0
|
||||
ddmul567 multiply 1 0.0 -> 0.0
|
||||
ddmul568 multiply 1 -0.0 -> -0.0
|
||||
|
||||
ddmul571 multiply 0.0 -1.0 -> -0.00
|
||||
ddmul572 multiply -0.0 -1.0 -> 0.00
|
||||
ddmul573 multiply 0.0 1.0 -> 0.00
|
||||
ddmul574 multiply -0.0 1.0 -> -0.00
|
||||
ddmul575 multiply -1.0 0.0 -> -0.00
|
||||
ddmul576 multiply -1.0 -0.0 -> 0.00
|
||||
ddmul577 multiply 1.0 0.0 -> 0.00
|
||||
ddmul578 multiply 1.0 -0.0 -> -0.00
|
||||
|
||||
|
||||
-- Specials
|
||||
ddmul580 multiply Inf -Inf -> -Infinity
|
||||
ddmul581 multiply Inf -1000 -> -Infinity
|
||||
ddmul582 multiply Inf -1 -> -Infinity
|
||||
ddmul583 multiply Inf -0 -> NaN Invalid_operation
|
||||
ddmul584 multiply Inf 0 -> NaN Invalid_operation
|
||||
ddmul585 multiply Inf 1 -> Infinity
|
||||
ddmul586 multiply Inf 1000 -> Infinity
|
||||
ddmul587 multiply Inf Inf -> Infinity
|
||||
ddmul588 multiply -1000 Inf -> -Infinity
|
||||
ddmul589 multiply -Inf Inf -> -Infinity
|
||||
ddmul590 multiply -1 Inf -> -Infinity
|
||||
ddmul591 multiply -0 Inf -> NaN Invalid_operation
|
||||
ddmul592 multiply 0 Inf -> NaN Invalid_operation
|
||||
ddmul593 multiply 1 Inf -> Infinity
|
||||
ddmul594 multiply 1000 Inf -> Infinity
|
||||
ddmul595 multiply Inf Inf -> Infinity
|
||||
|
||||
ddmul600 multiply -Inf -Inf -> Infinity
|
||||
ddmul601 multiply -Inf -1000 -> Infinity
|
||||
ddmul602 multiply -Inf -1 -> Infinity
|
||||
ddmul603 multiply -Inf -0 -> NaN Invalid_operation
|
||||
ddmul604 multiply -Inf 0 -> NaN Invalid_operation
|
||||
ddmul605 multiply -Inf 1 -> -Infinity
|
||||
ddmul606 multiply -Inf 1000 -> -Infinity
|
||||
ddmul607 multiply -Inf Inf -> -Infinity
|
||||
ddmul608 multiply -1000 Inf -> -Infinity
|
||||
ddmul609 multiply -Inf -Inf -> Infinity
|
||||
ddmul610 multiply -1 -Inf -> Infinity
|
||||
ddmul611 multiply -0 -Inf -> NaN Invalid_operation
|
||||
ddmul612 multiply 0 -Inf -> NaN Invalid_operation
|
||||
ddmul613 multiply 1 -Inf -> -Infinity
|
||||
ddmul614 multiply 1000 -Inf -> -Infinity
|
||||
ddmul615 multiply Inf -Inf -> -Infinity
|
||||
|
||||
ddmul621 multiply NaN -Inf -> NaN
|
||||
ddmul622 multiply NaN -1000 -> NaN
|
||||
ddmul623 multiply NaN -1 -> NaN
|
||||
ddmul624 multiply NaN -0 -> NaN
|
||||
ddmul625 multiply NaN 0 -> NaN
|
||||
ddmul626 multiply NaN 1 -> NaN
|
||||
ddmul627 multiply NaN 1000 -> NaN
|
||||
ddmul628 multiply NaN Inf -> NaN
|
||||
ddmul629 multiply NaN NaN -> NaN
|
||||
ddmul630 multiply -Inf NaN -> NaN
|
||||
ddmul631 multiply -1000 NaN -> NaN
|
||||
ddmul632 multiply -1 NaN -> NaN
|
||||
ddmul633 multiply -0 NaN -> NaN
|
||||
ddmul634 multiply 0 NaN -> NaN
|
||||
ddmul635 multiply 1 NaN -> NaN
|
||||
ddmul636 multiply 1000 NaN -> NaN
|
||||
ddmul637 multiply Inf NaN -> NaN
|
||||
|
||||
ddmul641 multiply sNaN -Inf -> NaN Invalid_operation
|
||||
ddmul642 multiply sNaN -1000 -> NaN Invalid_operation
|
||||
ddmul643 multiply sNaN -1 -> NaN Invalid_operation
|
||||
ddmul644 multiply sNaN -0 -> NaN Invalid_operation
|
||||
ddmul645 multiply sNaN 0 -> NaN Invalid_operation
|
||||
ddmul646 multiply sNaN 1 -> NaN Invalid_operation
|
||||
ddmul647 multiply sNaN 1000 -> NaN Invalid_operation
|
||||
ddmul648 multiply sNaN NaN -> NaN Invalid_operation
|
||||
ddmul649 multiply sNaN sNaN -> NaN Invalid_operation
|
||||
ddmul650 multiply NaN sNaN -> NaN Invalid_operation
|
||||
ddmul651 multiply -Inf sNaN -> NaN Invalid_operation
|
||||
ddmul652 multiply -1000 sNaN -> NaN Invalid_operation
|
||||
ddmul653 multiply -1 sNaN -> NaN Invalid_operation
|
||||
ddmul654 multiply -0 sNaN -> NaN Invalid_operation
|
||||
ddmul655 multiply 0 sNaN -> NaN Invalid_operation
|
||||
ddmul656 multiply 1 sNaN -> NaN Invalid_operation
|
||||
ddmul657 multiply 1000 sNaN -> NaN Invalid_operation
|
||||
ddmul658 multiply Inf sNaN -> NaN Invalid_operation
|
||||
ddmul659 multiply NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddmul661 multiply NaN9 -Inf -> NaN9
|
||||
ddmul662 multiply NaN8 999 -> NaN8
|
||||
ddmul663 multiply NaN71 Inf -> NaN71
|
||||
ddmul664 multiply NaN6 NaN5 -> NaN6
|
||||
ddmul665 multiply -Inf NaN4 -> NaN4
|
||||
ddmul666 multiply -999 NaN33 -> NaN33
|
||||
ddmul667 multiply Inf NaN2 -> NaN2
|
||||
|
||||
ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
|
||||
ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
|
||||
ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
|
||||
ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
|
||||
ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
|
||||
|
||||
ddmul681 multiply -NaN9 -Inf -> -NaN9
|
||||
ddmul682 multiply -NaN8 999 -> -NaN8
|
||||
ddmul683 multiply -NaN71 Inf -> -NaN71
|
||||
ddmul684 multiply -NaN6 -NaN5 -> -NaN6
|
||||
ddmul685 multiply -Inf -NaN4 -> -NaN4
|
||||
ddmul686 multiply -999 -NaN33 -> -NaN33
|
||||
ddmul687 multiply Inf -NaN2 -> -NaN2
|
||||
|
||||
ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
|
||||
ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
|
||||
ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
|
||||
ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
|
||||
ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
|
||||
ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
|
||||
ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
|
||||
|
||||
ddmul701 multiply -NaN -Inf -> -NaN
|
||||
ddmul702 multiply -NaN 999 -> -NaN
|
||||
ddmul703 multiply -NaN Inf -> -NaN
|
||||
ddmul704 multiply -NaN -NaN -> -NaN
|
||||
ddmul705 multiply -Inf -NaN0 -> -NaN
|
||||
ddmul706 multiply -999 -NaN -> -NaN
|
||||
ddmul707 multiply Inf -NaN -> -NaN
|
||||
|
||||
ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
|
||||
ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation
|
||||
ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
|
||||
ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
|
||||
ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
|
||||
ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
|
||||
ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation
|
||||
ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation
|
||||
ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- overflow and underflow tests .. note subnormal results
|
||||
-- signs
|
||||
ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded
|
||||
ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
|
||||
ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded
|
||||
ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded
|
||||
ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
||||
-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
|
||||
ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal
|
||||
ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal
|
||||
ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal
|
||||
ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal
|
||||
ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal
|
||||
ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal
|
||||
ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal
|
||||
ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
-- [no equivalent of 'subnormal' for overflow]
|
||||
ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped
|
||||
ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped
|
||||
ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped
|
||||
ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped
|
||||
ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded
|
||||
ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded
|
||||
ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded
|
||||
ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded
|
||||
ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded
|
||||
ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded
|
||||
|
||||
ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal
|
||||
ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal
|
||||
ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal
|
||||
ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal
|
||||
ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded
|
||||
ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal
|
||||
ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal
|
||||
ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
||||
ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded
|
||||
ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal
|
||||
ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal
|
||||
ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal
|
||||
ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal
|
||||
ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal
|
||||
ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal
|
||||
ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383
|
||||
ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382
|
||||
|
||||
-- Long operand overflow may be a different path
|
||||
ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded
|
||||
ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded
|
||||
ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded
|
||||
ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded
|
||||
|
||||
-- check for double-rounded subnormals
|
||||
ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow
|
||||
ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow
|
||||
ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow
|
||||
ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal
|
||||
ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal
|
||||
ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow
|
||||
ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow
|
||||
ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow
|
||||
ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow
|
||||
ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
|
||||
|
||||
ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
|
||||
ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
|
||||
ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
|
||||
ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
|
||||
ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
|
||||
ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
|
||||
|
||||
-- Now explore the case where we get a normal result with Underflow
|
||||
-- 1 234567890123456
|
||||
ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
|
||||
ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
|
||||
ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
|
||||
ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
|
||||
ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
|
||||
ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
|
||||
-- prove operands are exact
|
||||
ddmul906 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383
|
||||
ddmul907 multiply 1 0.09999999999999999 -> 0.09999999999999999
|
||||
-- the next rounds to Nmin
|
||||
ddmul908 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
|
||||
|
||||
-- hugest
|
||||
ddmul909 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded
|
||||
|
||||
-- Null tests
|
||||
ddmul990 multiply 10 # -> NaN Invalid_operation
|
||||
ddmul991 multiply # 10 -> NaN Invalid_operation
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994
|
||||
ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995
|
||||
ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996
|
||||
ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997
|
||||
ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998
|
||||
ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999
|
||||
ddnextm007 nextminus 1.0 -> 0.9999999999999999
|
||||
ddnextm008 nextminus 1 -> 0.9999999999999999
|
||||
ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000
|
||||
ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001
|
||||
ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002
|
||||
ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003
|
||||
ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004
|
||||
ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005
|
||||
ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006
|
||||
ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007
|
||||
ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008
|
||||
ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009
|
||||
ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010
|
||||
ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011
|
||||
|
||||
ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996
|
||||
ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997
|
||||
ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998
|
||||
ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999
|
||||
ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000
|
||||
ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001
|
||||
ddnextm027 nextminus -1.0 -> -1.000000000000001
|
||||
ddnextm028 nextminus -1 -> -1.000000000000001
|
||||
ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002
|
||||
ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003
|
||||
ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004
|
||||
ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005
|
||||
ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006
|
||||
ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007
|
||||
ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008
|
||||
ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009
|
||||
ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010
|
||||
ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011
|
||||
ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012
|
||||
|
||||
-- ultra-tiny inputs
|
||||
ddnextm062 nextminus 1E-398 -> 0E-398
|
||||
ddnextm065 nextminus -1E-398 -> -2E-398
|
||||
|
||||
-- Zeros
|
||||
ddnextm100 nextminus -0 -> -1E-398
|
||||
ddnextm101 nextminus 0 -> -1E-398
|
||||
ddnextm102 nextminus 0.00 -> -1E-398
|
||||
ddnextm103 nextminus -0.00 -> -1E-398
|
||||
ddnextm104 nextminus 0E-300 -> -1E-398
|
||||
ddnextm105 nextminus 0E+300 -> -1E-398
|
||||
ddnextm106 nextminus 0E+30000 -> -1E-398
|
||||
ddnextm107 nextminus -0E+30000 -> -1E-398
|
||||
|
||||
-- specials
|
||||
ddnextm150 nextminus Inf -> 9.999999999999999E+384
|
||||
ddnextm151 nextminus -Inf -> -Infinity
|
||||
ddnextm152 nextminus NaN -> NaN
|
||||
ddnextm153 nextminus sNaN -> NaN Invalid_operation
|
||||
ddnextm154 nextminus NaN77 -> NaN77
|
||||
ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
|
||||
ddnextm156 nextminus -NaN -> -NaN
|
||||
ddnextm157 nextminus -sNaN -> -NaN Invalid_operation
|
||||
ddnextm158 nextminus -NaN77 -> -NaN77
|
||||
ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
|
||||
|
||||
-- Nmax, Nmin, Ntiny, subnormals
|
||||
ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384
|
||||
ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384
|
||||
ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384
|
||||
ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384
|
||||
ddnextm174 nextminus 9E-398 -> 8E-398
|
||||
ddnextm175 nextminus 9.9E-397 -> 9.8E-397
|
||||
ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387
|
||||
ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384
|
||||
ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384
|
||||
ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384
|
||||
ddnextm180 nextminus 0E-398 -> -1E-398
|
||||
ddnextm181 nextminus 1E-398 -> 0E-398
|
||||
ddnextm182 nextminus 2E-398 -> 1E-398
|
||||
|
||||
ddnextm183 nextminus -0E-398 -> -1E-398
|
||||
ddnextm184 nextminus -1E-398 -> -2E-398
|
||||
ddnextm185 nextminus -2E-398 -> -3E-398
|
||||
ddnextm186 nextminus -10E-398 -> -1.1E-397
|
||||
ddnextm187 nextminus -100E-398 -> -1.01E-396
|
||||
ddnextm188 nextminus -100000E-398 -> -1.00001E-393
|
||||
ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383
|
||||
ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383
|
||||
ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383
|
||||
ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384
|
||||
ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity
|
||||
|
||||
-- Null tests
|
||||
ddnextm900 nextminus # -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996
|
||||
ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997
|
||||
ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998
|
||||
ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999
|
||||
ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000
|
||||
ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001
|
||||
ddnextp007 nextplus 1.0 -> 1.000000000000001
|
||||
ddnextp008 nextplus 1 -> 1.000000000000001
|
||||
ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002
|
||||
ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003
|
||||
ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004
|
||||
ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005
|
||||
ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006
|
||||
ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007
|
||||
ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008
|
||||
ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009
|
||||
ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010
|
||||
ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011
|
||||
ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012
|
||||
|
||||
ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994
|
||||
ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995
|
||||
ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996
|
||||
ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997
|
||||
ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998
|
||||
ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999
|
||||
ddnextp027 nextplus -1.0 -> -0.9999999999999999
|
||||
ddnextp028 nextplus -1 -> -0.9999999999999999
|
||||
ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000
|
||||
ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001
|
||||
ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002
|
||||
ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003
|
||||
ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004
|
||||
ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005
|
||||
ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006
|
||||
ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007
|
||||
ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008
|
||||
ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009
|
||||
ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010
|
||||
ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011
|
||||
|
||||
-- Zeros
|
||||
ddnextp100 nextplus 0 -> 1E-398
|
||||
ddnextp101 nextplus 0.00 -> 1E-398
|
||||
ddnextp102 nextplus 0E-300 -> 1E-398
|
||||
ddnextp103 nextplus 0E+300 -> 1E-398
|
||||
ddnextp104 nextplus 0E+30000 -> 1E-398
|
||||
ddnextp105 nextplus -0 -> 1E-398
|
||||
ddnextp106 nextplus -0.00 -> 1E-398
|
||||
ddnextp107 nextplus -0E-300 -> 1E-398
|
||||
ddnextp108 nextplus -0E+300 -> 1E-398
|
||||
ddnextp109 nextplus -0E+30000 -> 1E-398
|
||||
|
||||
-- specials
|
||||
ddnextp150 nextplus Inf -> Infinity
|
||||
ddnextp151 nextplus -Inf -> -9.999999999999999E+384
|
||||
ddnextp152 nextplus NaN -> NaN
|
||||
ddnextp153 nextplus sNaN -> NaN Invalid_operation
|
||||
ddnextp154 nextplus NaN77 -> NaN77
|
||||
ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
|
||||
ddnextp156 nextplus -NaN -> -NaN
|
||||
ddnextp157 nextplus -sNaN -> -NaN Invalid_operation
|
||||
ddnextp158 nextplus -NaN77 -> -NaN77
|
||||
ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
|
||||
|
||||
-- Nmax, Nmin, Ntiny, subnormals
|
||||
ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384
|
||||
ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384
|
||||
ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384
|
||||
ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384
|
||||
ddnextp174 nextplus -9E-398 -> -8E-398
|
||||
ddnextp175 nextplus -9.9E-397 -> -9.8E-397
|
||||
ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387
|
||||
ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384
|
||||
ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384
|
||||
ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384
|
||||
ddnextp180 nextplus -0E-398 -> 1E-398
|
||||
ddnextp181 nextplus -1E-398 -> -0E-398
|
||||
ddnextp182 nextplus -2E-398 -> -1E-398
|
||||
|
||||
ddnextp183 nextplus 0E-398 -> 1E-398
|
||||
ddnextp184 nextplus 1E-398 -> 2E-398
|
||||
ddnextp185 nextplus 2E-398 -> 3E-398
|
||||
ddnextp186 nextplus 10E-398 -> 1.1E-397
|
||||
ddnextp187 nextplus 100E-398 -> 1.01E-396
|
||||
ddnextp188 nextplus 100000E-398 -> 1.00001E-393
|
||||
ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383
|
||||
ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383
|
||||
ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383
|
||||
ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384
|
||||
ddnextp193 nextplus 9.999999999999999E+384 -> Infinity
|
||||
|
||||
-- Null tests
|
||||
ddnextp900 nextplus # -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,374 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check with a scattering of numerics
|
||||
ddnextt001 nexttoward 10 10 -> 10
|
||||
ddnextt002 nexttoward -10 -10 -> -10
|
||||
ddnextt003 nexttoward 1 10 -> 1.000000000000001
|
||||
ddnextt004 nexttoward 1 -10 -> 0.9999999999999999
|
||||
ddnextt005 nexttoward -1 10 -> -0.9999999999999999
|
||||
ddnextt006 nexttoward -1 -10 -> -1.000000000000001
|
||||
ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
|
||||
ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
|
||||
ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000
|
||||
ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999
|
||||
ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000
|
||||
ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999
|
||||
ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999
|
||||
ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999
|
||||
ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999
|
||||
ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999
|
||||
|
||||
------- lhs=rhs
|
||||
-- finites
|
||||
ddnextt101 nexttoward 7 7 -> 7
|
||||
ddnextt102 nexttoward -7 -7 -> -7
|
||||
ddnextt103 nexttoward 75 75 -> 75
|
||||
ddnextt104 nexttoward -75 -75 -> -75
|
||||
ddnextt105 nexttoward 7.50 7.5 -> 7.50
|
||||
ddnextt106 nexttoward -7.50 -7.50 -> -7.50
|
||||
ddnextt107 nexttoward 7.500 7.5000 -> 7.500
|
||||
ddnextt108 nexttoward -7.500 -7.5 -> -7.500
|
||||
|
||||
-- zeros
|
||||
ddnextt111 nexttoward 0 0 -> 0
|
||||
ddnextt112 nexttoward -0 -0 -> -0
|
||||
ddnextt113 nexttoward 0E+4 0 -> 0E+4
|
||||
ddnextt114 nexttoward -0E+4 -0 -> -0E+4
|
||||
ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
|
||||
ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
|
||||
ddnextt117 nexttoward 0E-141 0 -> 0E-141
|
||||
ddnextt118 nexttoward -0E-141 -000 -> -0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddnextt121 nexttoward 268268268 268268268 -> 268268268
|
||||
ddnextt122 nexttoward -268268268 -268268268 -> -268268268
|
||||
ddnextt123 nexttoward 134134134 134134134 -> 134134134
|
||||
ddnextt124 nexttoward -134134134 -134134134 -> -134134134
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383
|
||||
ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398
|
||||
|
||||
ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398
|
||||
ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383
|
||||
ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384
|
||||
|
||||
------- lhs<rhs
|
||||
ddnextt201 nexttoward 0.9999999999999995 Infinity -> 0.9999999999999996
|
||||
ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997
|
||||
ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998
|
||||
ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999
|
||||
ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000
|
||||
ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001
|
||||
ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001
|
||||
ddnextt208 nexttoward 1 Infinity -> 1.000000000000001
|
||||
ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002
|
||||
ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003
|
||||
ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004
|
||||
ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005
|
||||
ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006
|
||||
ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007
|
||||
ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008
|
||||
ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009
|
||||
ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010
|
||||
ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011
|
||||
ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012
|
||||
|
||||
ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994
|
||||
ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995
|
||||
ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996
|
||||
ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997
|
||||
ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998
|
||||
ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999
|
||||
ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999
|
||||
ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999
|
||||
ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000
|
||||
ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001
|
||||
ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002
|
||||
ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003
|
||||
ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004
|
||||
ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005
|
||||
ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006
|
||||
ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007
|
||||
ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008
|
||||
ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009
|
||||
ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010
|
||||
ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011
|
||||
|
||||
-- Zeros
|
||||
ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
-- specials
|
||||
ddnextt350 nexttoward Inf Infinity -> Infinity
|
||||
ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384
|
||||
ddnextt352 nexttoward NaN Infinity -> NaN
|
||||
ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
|
||||
ddnextt354 nexttoward NaN77 Infinity -> NaN77
|
||||
ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
|
||||
ddnextt356 nexttoward -NaN Infinity -> -NaN
|
||||
ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
|
||||
ddnextt358 nexttoward -NaN77 Infinity -> -NaN77
|
||||
ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
|
||||
|
||||
-- Nmax, Nmin, Ntiny, subnormals
|
||||
ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384
|
||||
ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384
|
||||
ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded
|
||||
ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded
|
||||
ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded
|
||||
ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded
|
||||
ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded
|
||||
ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383
|
||||
ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383
|
||||
ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383
|
||||
ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384
|
||||
ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384
|
||||
ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded
|
||||
|
||||
------- lhs>rhs
|
||||
ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994
|
||||
ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995
|
||||
ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996
|
||||
ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997
|
||||
ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998
|
||||
ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999
|
||||
ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999
|
||||
ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999
|
||||
ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000
|
||||
ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001
|
||||
ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002
|
||||
ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003
|
||||
ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004
|
||||
ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005
|
||||
ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006
|
||||
ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007
|
||||
ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008
|
||||
ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009
|
||||
ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010
|
||||
ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011
|
||||
|
||||
ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996
|
||||
ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997
|
||||
ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998
|
||||
ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999
|
||||
ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000
|
||||
ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001
|
||||
ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001
|
||||
ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001
|
||||
ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002
|
||||
ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003
|
||||
ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004
|
||||
ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005
|
||||
ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006
|
||||
ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007
|
||||
ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008
|
||||
ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009
|
||||
ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010
|
||||
ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011
|
||||
ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012
|
||||
|
||||
-- Zeros
|
||||
ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
-- specials
|
||||
ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384
|
||||
ddnextt551 nexttoward -Inf -Infinity -> -Infinity
|
||||
ddnextt552 nexttoward NaN -Infinity -> NaN
|
||||
ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
|
||||
ddnextt554 nexttoward NaN77 -Infinity -> NaN77
|
||||
ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
|
||||
ddnextt556 nexttoward -NaN -Infinity -> -NaN
|
||||
ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
|
||||
ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77
|
||||
ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
|
||||
|
||||
-- Nmax, Nmin, Ntiny, subnormals
|
||||
ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384
|
||||
ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384
|
||||
ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded
|
||||
ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded
|
||||
ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded
|
||||
ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
|
||||
ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded
|
||||
ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded
|
||||
ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded
|
||||
ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383
|
||||
ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383
|
||||
ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383
|
||||
ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384
|
||||
ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
|
||||
|
||||
------- Specials
|
||||
ddnextt780 nexttoward -Inf -Inf -> -Infinity
|
||||
ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384
|
||||
ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384
|
||||
ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384
|
||||
ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384
|
||||
ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384
|
||||
ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384
|
||||
ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001
|
||||
ddnextt788 nexttoward -Inf -Inf -> -Infinity
|
||||
ddnextt789 nexttoward -1 -Inf -> -1.000000000000001
|
||||
ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999
|
||||
ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999
|
||||
ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384
|
||||
|
||||
ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384
|
||||
ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384
|
||||
ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384
|
||||
ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384
|
||||
ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384
|
||||
ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384
|
||||
ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384
|
||||
ddnextt807 nexttoward Inf Inf -> Infinity
|
||||
ddnextt808 nexttoward -1000 Inf -> -999.9999999999999
|
||||
ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384
|
||||
ddnextt810 nexttoward -1 Inf -> -0.9999999999999999
|
||||
ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
|
||||
ddnextt813 nexttoward 1 Inf -> 1.000000000000001
|
||||
ddnextt814 nexttoward 1000 Inf -> 1000.000000000001
|
||||
ddnextt815 nexttoward Inf Inf -> Infinity
|
||||
|
||||
ddnextt821 nexttoward NaN -Inf -> NaN
|
||||
ddnextt822 nexttoward NaN -1000 -> NaN
|
||||
ddnextt823 nexttoward NaN -1 -> NaN
|
||||
ddnextt824 nexttoward NaN -0 -> NaN
|
||||
ddnextt825 nexttoward NaN 0 -> NaN
|
||||
ddnextt826 nexttoward NaN 1 -> NaN
|
||||
ddnextt827 nexttoward NaN 1000 -> NaN
|
||||
ddnextt828 nexttoward NaN Inf -> NaN
|
||||
ddnextt829 nexttoward NaN NaN -> NaN
|
||||
ddnextt830 nexttoward -Inf NaN -> NaN
|
||||
ddnextt831 nexttoward -1000 NaN -> NaN
|
||||
ddnextt832 nexttoward -1 NaN -> NaN
|
||||
ddnextt833 nexttoward -0 NaN -> NaN
|
||||
ddnextt834 nexttoward 0 NaN -> NaN
|
||||
ddnextt835 nexttoward 1 NaN -> NaN
|
||||
ddnextt836 nexttoward 1000 NaN -> NaN
|
||||
ddnextt837 nexttoward Inf NaN -> NaN
|
||||
|
||||
ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
|
||||
ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
|
||||
ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
|
||||
ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
|
||||
ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
|
||||
ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
|
||||
ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
|
||||
ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
|
||||
ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
|
||||
ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
|
||||
ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
|
||||
ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
|
||||
ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
|
||||
ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
|
||||
ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
|
||||
ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
|
||||
ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
|
||||
ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
|
||||
ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddnextt861 nexttoward NaN1 -Inf -> NaN1
|
||||
ddnextt862 nexttoward +NaN2 -1000 -> NaN2
|
||||
ddnextt863 nexttoward NaN3 1000 -> NaN3
|
||||
ddnextt864 nexttoward NaN4 Inf -> NaN4
|
||||
ddnextt865 nexttoward NaN5 +NaN6 -> NaN5
|
||||
ddnextt866 nexttoward -Inf NaN7 -> NaN7
|
||||
ddnextt867 nexttoward -1000 NaN8 -> NaN8
|
||||
ddnextt868 nexttoward 1000 NaN9 -> NaN9
|
||||
ddnextt869 nexttoward Inf +NaN10 -> NaN10
|
||||
ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
|
||||
ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
|
||||
ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
|
||||
ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
|
||||
ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
|
||||
ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
|
||||
ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
|
||||
ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
|
||||
ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
|
||||
ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
|
||||
ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
|
||||
ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26
|
||||
ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
|
||||
ddnextt884 nexttoward 1000 -NaN30 -> -NaN30
|
||||
ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
ddnextt900 nexttoward 1 # -> NaN Invalid_operation
|
||||
ddnextt901 nexttoward # 1 -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,292 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddOr.decTest -- digitwise logical OR for decDoubles --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check (truth table)
|
||||
ddor001 or 0 0 -> 0
|
||||
ddor002 or 0 1 -> 1
|
||||
ddor003 or 1 0 -> 1
|
||||
ddor004 or 1 1 -> 1
|
||||
ddor005 or 1100 1010 -> 1110
|
||||
-- and at msd and msd-1
|
||||
ddor006 or 0000000000000000 0000000000000000 -> 0
|
||||
ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000
|
||||
ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000
|
||||
ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000
|
||||
ddor010 or 0000000000000000 0000000000000000 -> 0
|
||||
ddor011 or 0000000000000000 0100000000000000 -> 100000000000000
|
||||
ddor012 or 0100000000000000 0000000000000000 -> 100000000000000
|
||||
ddor013 or 0100000000000000 0100000000000000 -> 100000000000000
|
||||
|
||||
-- Various lengths
|
||||
-- 1234567890123456 1234567890123456 1234567890123456
|
||||
ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111
|
||||
ddor021 or 111111111111111 111111111111111 -> 111111111111111
|
||||
ddor022 or 11111111111111 11111111111111 -> 11111111111111
|
||||
ddor023 or 1111111111111 1111111111111 -> 1111111111111
|
||||
ddor024 or 111111111111 111111111111 -> 111111111111
|
||||
ddor025 or 11111111111 11111111111 -> 11111111111
|
||||
ddor026 or 1111111111 1111111111 -> 1111111111
|
||||
ddor027 or 111111111 111111111 -> 111111111
|
||||
ddor028 or 11111111 11111111 -> 11111111
|
||||
ddor029 or 1111111 1111111 -> 1111111
|
||||
ddor030 or 111111 111111 -> 111111
|
||||
ddor031 or 11111 11111 -> 11111
|
||||
ddor032 or 1111 1111 -> 1111
|
||||
ddor033 or 111 111 -> 111
|
||||
ddor034 or 11 11 -> 11
|
||||
ddor035 or 1 1 -> 1
|
||||
ddor036 or 0 0 -> 0
|
||||
|
||||
ddor042 or 111111110000000 1111111110000000 -> 1111111110000000
|
||||
ddor043 or 11111110000000 1000000100000000 -> 1011111110000000
|
||||
ddor044 or 1111110000000 1000001000000000 -> 1001111110000000
|
||||
ddor045 or 111110000000 1000010000000000 -> 1000111110000000
|
||||
ddor046 or 11110000000 1000100000000000 -> 1000111110000000
|
||||
ddor047 or 1110000000 1001000000000000 -> 1001001110000000
|
||||
ddor048 or 110000000 1010000000000000 -> 1010000110000000
|
||||
ddor049 or 10000000 1100000000000000 -> 1100000010000000
|
||||
|
||||
ddor090 or 011111111 111101111 -> 111111111
|
||||
ddor091 or 101111111 111101111 -> 111111111
|
||||
ddor092 or 110111111 111101111 -> 111111111
|
||||
ddor093 or 111011111 111101111 -> 111111111
|
||||
ddor094 or 111101111 111101111 -> 111101111
|
||||
ddor095 or 111110111 111101111 -> 111111111
|
||||
ddor096 or 111111011 111101111 -> 111111111
|
||||
ddor097 or 111111101 111101111 -> 111111111
|
||||
ddor098 or 111111110 111101111 -> 111111111
|
||||
|
||||
ddor100 or 111101111 011111111 -> 111111111
|
||||
ddor101 or 111101111 101111111 -> 111111111
|
||||
ddor102 or 111101111 110111111 -> 111111111
|
||||
ddor103 or 111101111 111011111 -> 111111111
|
||||
ddor104 or 111101111 111101111 -> 111101111
|
||||
ddor105 or 111101111 111110111 -> 111111111
|
||||
ddor106 or 111101111 111111011 -> 111111111
|
||||
ddor107 or 111101111 111111101 -> 111111111
|
||||
ddor108 or 111101111 111111110 -> 111111111
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
ddor220 or 111111112 111111111 -> NaN Invalid_operation
|
||||
ddor221 or 333333333 333333333 -> NaN Invalid_operation
|
||||
ddor222 or 555555555 555555555 -> NaN Invalid_operation
|
||||
ddor223 or 777777777 777777777 -> NaN Invalid_operation
|
||||
ddor224 or 999999999 999999999 -> NaN Invalid_operation
|
||||
ddor225 or 222222222 999999999 -> NaN Invalid_operation
|
||||
ddor226 or 444444444 999999999 -> NaN Invalid_operation
|
||||
ddor227 or 666666666 999999999 -> NaN Invalid_operation
|
||||
ddor228 or 888888888 999999999 -> NaN Invalid_operation
|
||||
ddor229 or 999999999 222222222 -> NaN Invalid_operation
|
||||
ddor230 or 999999999 444444444 -> NaN Invalid_operation
|
||||
ddor231 or 999999999 666666666 -> NaN Invalid_operation
|
||||
ddor232 or 999999999 888888888 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
ddor240 or 567468689 -934981942 -> NaN Invalid_operation
|
||||
ddor241 or 567367689 934981942 -> NaN Invalid_operation
|
||||
ddor242 or -631917772 -706014634 -> NaN Invalid_operation
|
||||
ddor243 or -756253257 138579234 -> NaN Invalid_operation
|
||||
ddor244 or 835590149 567435400 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation
|
||||
ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation
|
||||
ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation
|
||||
ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation
|
||||
ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation
|
||||
ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation
|
||||
ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation
|
||||
ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation
|
||||
ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation
|
||||
ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation
|
||||
ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation
|
||||
ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation
|
||||
ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation
|
||||
ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation
|
||||
ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation
|
||||
ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation
|
||||
ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation
|
||||
ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation
|
||||
ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation
|
||||
ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation
|
||||
ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation
|
||||
ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation
|
||||
-- signs
|
||||
ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation
|
||||
ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation
|
||||
ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation
|
||||
ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100
|
||||
|
||||
-- Nmax, Nmin, Ntiny-like
|
||||
ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation
|
||||
ddor332 or 3 1E-199 -> NaN Invalid_operation
|
||||
ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation
|
||||
ddor334 or 5 1E-100 -> NaN Invalid_operation
|
||||
ddor335 or 6 -1E-100 -> NaN Invalid_operation
|
||||
ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation
|
||||
ddor337 or 8 -1E-199 -> NaN Invalid_operation
|
||||
ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation
|
||||
ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation
|
||||
ddor342 or 1E-299 01 -> NaN Invalid_operation
|
||||
ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation
|
||||
ddor344 or 1E-100 18 -> NaN Invalid_operation
|
||||
ddor345 or -1E-100 -10 -> NaN Invalid_operation
|
||||
ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation
|
||||
ddor347 or -1E-299 10 -> NaN Invalid_operation
|
||||
ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
ddor361 or 1.0 1 -> NaN Invalid_operation
|
||||
ddor362 or 1E+1 1 -> NaN Invalid_operation
|
||||
ddor363 or 0.0 1 -> NaN Invalid_operation
|
||||
ddor364 or 0E+1 1 -> NaN Invalid_operation
|
||||
ddor365 or 9.9 1 -> NaN Invalid_operation
|
||||
ddor366 or 9E+1 1 -> NaN Invalid_operation
|
||||
ddor371 or 0 1.0 -> NaN Invalid_operation
|
||||
ddor372 or 0 1E+1 -> NaN Invalid_operation
|
||||
ddor373 or 0 0.0 -> NaN Invalid_operation
|
||||
ddor374 or 0 0E+1 -> NaN Invalid_operation
|
||||
ddor375 or 0 9.9 -> NaN Invalid_operation
|
||||
ddor376 or 0 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
ddor780 or -Inf -Inf -> NaN Invalid_operation
|
||||
ddor781 or -Inf -1000 -> NaN Invalid_operation
|
||||
ddor782 or -Inf -1 -> NaN Invalid_operation
|
||||
ddor783 or -Inf -0 -> NaN Invalid_operation
|
||||
ddor784 or -Inf 0 -> NaN Invalid_operation
|
||||
ddor785 or -Inf 1 -> NaN Invalid_operation
|
||||
ddor786 or -Inf 1000 -> NaN Invalid_operation
|
||||
ddor787 or -1000 -Inf -> NaN Invalid_operation
|
||||
ddor788 or -Inf -Inf -> NaN Invalid_operation
|
||||
ddor789 or -1 -Inf -> NaN Invalid_operation
|
||||
ddor790 or -0 -Inf -> NaN Invalid_operation
|
||||
ddor791 or 0 -Inf -> NaN Invalid_operation
|
||||
ddor792 or 1 -Inf -> NaN Invalid_operation
|
||||
ddor793 or 1000 -Inf -> NaN Invalid_operation
|
||||
ddor794 or Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddor800 or Inf -Inf -> NaN Invalid_operation
|
||||
ddor801 or Inf -1000 -> NaN Invalid_operation
|
||||
ddor802 or Inf -1 -> NaN Invalid_operation
|
||||
ddor803 or Inf -0 -> NaN Invalid_operation
|
||||
ddor804 or Inf 0 -> NaN Invalid_operation
|
||||
ddor805 or Inf 1 -> NaN Invalid_operation
|
||||
ddor806 or Inf 1000 -> NaN Invalid_operation
|
||||
ddor807 or Inf Inf -> NaN Invalid_operation
|
||||
ddor808 or -1000 Inf -> NaN Invalid_operation
|
||||
ddor809 or -Inf Inf -> NaN Invalid_operation
|
||||
ddor810 or -1 Inf -> NaN Invalid_operation
|
||||
ddor811 or -0 Inf -> NaN Invalid_operation
|
||||
ddor812 or 0 Inf -> NaN Invalid_operation
|
||||
ddor813 or 1 Inf -> NaN Invalid_operation
|
||||
ddor814 or 1000 Inf -> NaN Invalid_operation
|
||||
ddor815 or Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddor821 or NaN -Inf -> NaN Invalid_operation
|
||||
ddor822 or NaN -1000 -> NaN Invalid_operation
|
||||
ddor823 or NaN -1 -> NaN Invalid_operation
|
||||
ddor824 or NaN -0 -> NaN Invalid_operation
|
||||
ddor825 or NaN 0 -> NaN Invalid_operation
|
||||
ddor826 or NaN 1 -> NaN Invalid_operation
|
||||
ddor827 or NaN 1000 -> NaN Invalid_operation
|
||||
ddor828 or NaN Inf -> NaN Invalid_operation
|
||||
ddor829 or NaN NaN -> NaN Invalid_operation
|
||||
ddor830 or -Inf NaN -> NaN Invalid_operation
|
||||
ddor831 or -1000 NaN -> NaN Invalid_operation
|
||||
ddor832 or -1 NaN -> NaN Invalid_operation
|
||||
ddor833 or -0 NaN -> NaN Invalid_operation
|
||||
ddor834 or 0 NaN -> NaN Invalid_operation
|
||||
ddor835 or 1 NaN -> NaN Invalid_operation
|
||||
ddor836 or 1000 NaN -> NaN Invalid_operation
|
||||
ddor837 or Inf NaN -> NaN Invalid_operation
|
||||
|
||||
ddor841 or sNaN -Inf -> NaN Invalid_operation
|
||||
ddor842 or sNaN -1000 -> NaN Invalid_operation
|
||||
ddor843 or sNaN -1 -> NaN Invalid_operation
|
||||
ddor844 or sNaN -0 -> NaN Invalid_operation
|
||||
ddor845 or sNaN 0 -> NaN Invalid_operation
|
||||
ddor846 or sNaN 1 -> NaN Invalid_operation
|
||||
ddor847 or sNaN 1000 -> NaN Invalid_operation
|
||||
ddor848 or sNaN NaN -> NaN Invalid_operation
|
||||
ddor849 or sNaN sNaN -> NaN Invalid_operation
|
||||
ddor850 or NaN sNaN -> NaN Invalid_operation
|
||||
ddor851 or -Inf sNaN -> NaN Invalid_operation
|
||||
ddor852 or -1000 sNaN -> NaN Invalid_operation
|
||||
ddor853 or -1 sNaN -> NaN Invalid_operation
|
||||
ddor854 or -0 sNaN -> NaN Invalid_operation
|
||||
ddor855 or 0 sNaN -> NaN Invalid_operation
|
||||
ddor856 or 1 sNaN -> NaN Invalid_operation
|
||||
ddor857 or 1000 sNaN -> NaN Invalid_operation
|
||||
ddor858 or Inf sNaN -> NaN Invalid_operation
|
||||
ddor859 or NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddor861 or NaN1 -Inf -> NaN Invalid_operation
|
||||
ddor862 or +NaN2 -1000 -> NaN Invalid_operation
|
||||
ddor863 or NaN3 1000 -> NaN Invalid_operation
|
||||
ddor864 or NaN4 Inf -> NaN Invalid_operation
|
||||
ddor865 or NaN5 +NaN6 -> NaN Invalid_operation
|
||||
ddor866 or -Inf NaN7 -> NaN Invalid_operation
|
||||
ddor867 or -1000 NaN8 -> NaN Invalid_operation
|
||||
ddor868 or 1000 NaN9 -> NaN Invalid_operation
|
||||
ddor869 or Inf +NaN10 -> NaN Invalid_operation
|
||||
ddor871 or sNaN11 -Inf -> NaN Invalid_operation
|
||||
ddor872 or sNaN12 -1000 -> NaN Invalid_operation
|
||||
ddor873 or sNaN13 1000 -> NaN Invalid_operation
|
||||
ddor874 or sNaN14 NaN17 -> NaN Invalid_operation
|
||||
ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation
|
||||
ddor876 or NaN16 sNaN19 -> NaN Invalid_operation
|
||||
ddor877 or -Inf +sNaN20 -> NaN Invalid_operation
|
||||
ddor878 or -1000 sNaN21 -> NaN Invalid_operation
|
||||
ddor879 or 1000 sNaN22 -> NaN Invalid_operation
|
||||
ddor880 or Inf sNaN23 -> NaN Invalid_operation
|
||||
ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
|
||||
ddor882 or -NaN26 NaN28 -> NaN Invalid_operation
|
||||
ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
|
||||
ddor884 or 1000 -NaN30 -> NaN Invalid_operation
|
||||
ddor885 or 1000 -sNaN31 -> NaN Invalid_operation
|
|
@ -0,0 +1,88 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddPlus.decTest -- decDouble 0+x --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddpls001 plus +7.50 -> 7.50
|
||||
|
||||
-- Infinities
|
||||
ddpls011 plus Infinity -> Infinity
|
||||
ddpls012 plus -Infinity -> -Infinity
|
||||
|
||||
-- NaNs, 0 payload
|
||||
ddpls021 plus NaN -> NaN
|
||||
ddpls022 plus -NaN -> -NaN
|
||||
ddpls023 plus sNaN -> NaN Invalid_operation
|
||||
ddpls024 plus -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
ddpls031 plus NaN13 -> NaN13
|
||||
ddpls032 plus -NaN13 -> -NaN13
|
||||
ddpls033 plus sNaN13 -> NaN13 Invalid_operation
|
||||
ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation
|
||||
ddpls035 plus NaN70 -> NaN70
|
||||
ddpls036 plus -NaN70 -> -NaN70
|
||||
ddpls037 plus sNaN101 -> NaN101 Invalid_operation
|
||||
ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation
|
||||
|
||||
-- finites
|
||||
ddpls101 plus 7 -> 7
|
||||
ddpls102 plus -7 -> -7
|
||||
ddpls103 plus 75 -> 75
|
||||
ddpls104 plus -75 -> -75
|
||||
ddpls105 plus 7.50 -> 7.50
|
||||
ddpls106 plus -7.50 -> -7.50
|
||||
ddpls107 plus 7.500 -> 7.500
|
||||
ddpls108 plus -7.500 -> -7.500
|
||||
|
||||
-- zeros
|
||||
ddpls111 plus 0 -> 0
|
||||
ddpls112 plus -0 -> 0
|
||||
ddpls113 plus 0E+4 -> 0E+4
|
||||
ddpls114 plus -0E+4 -> 0E+4
|
||||
ddpls115 plus 0.0000 -> 0.0000
|
||||
ddpls116 plus -0.0000 -> 0.0000
|
||||
ddpls117 plus 0E-141 -> 0E-141
|
||||
ddpls118 plus -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
ddpls121 plus 2682682682682682 -> 2682682682682682
|
||||
ddpls122 plus -2682682682682682 -> -2682682682682682
|
||||
ddpls123 plus 1341341341341341 -> 1341341341341341
|
||||
ddpls124 plus -1341341341341341 -> -1341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddpls132 plus 1E-383 -> 1E-383
|
||||
ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
ddpls134 plus 1E-398 -> 1E-398 Subnormal
|
||||
|
||||
ddpls135 plus -1E-398 -> -1E-398 Subnormal
|
||||
ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
ddpls137 plus -1E-383 -> -1E-383
|
||||
ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384
|
|
@ -0,0 +1,825 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddQuantize.decTest -- decDouble quantize operation --
|
||||
-- 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
|
||||
|
||||
-- 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'
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks
|
||||
ddqua001 quantize 0 1e0 -> 0
|
||||
ddqua002 quantize 1 1e0 -> 1
|
||||
ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
|
||||
ddqua007 quantize 0.1 1e-1 -> 0.1
|
||||
ddqua008 quantize 0.1 1e-2 -> 0.10
|
||||
ddqua009 quantize 0.1 1e-3 -> 0.100
|
||||
ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
|
||||
ddqua013 quantize 0.9 1e-1 -> 0.9
|
||||
ddqua014 quantize 0.9 1e-2 -> 0.90
|
||||
ddqua015 quantize 0.9 1e-3 -> 0.900
|
||||
-- negatives
|
||||
ddqua021 quantize -0 1e0 -> -0
|
||||
ddqua022 quantize -1 1e0 -> -1
|
||||
ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
|
||||
ddqua027 quantize -0.1 1e-1 -> -0.1
|
||||
ddqua028 quantize -0.1 1e-2 -> -0.10
|
||||
ddqua029 quantize -0.1 1e-3 -> -0.100
|
||||
ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
|
||||
ddqua033 quantize -0.9 1e-1 -> -0.9
|
||||
ddqua034 quantize -0.9 1e-2 -> -0.90
|
||||
ddqua035 quantize -0.9 1e-3 -> -0.900
|
||||
ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
|
||||
ddqua039 quantize -0.5 1e-1 -> -0.5
|
||||
ddqua040 quantize -0.5 1e-2 -> -0.50
|
||||
ddqua041 quantize -0.5 1e-3 -> -0.500
|
||||
ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
|
||||
ddqua045 quantize -0.9 1e-1 -> -0.9
|
||||
ddqua046 quantize -0.9 1e-2 -> -0.90
|
||||
ddqua047 quantize -0.9 1e-3 -> -0.900
|
||||
|
||||
-- examples from Specification
|
||||
ddqua060 quantize 2.17 0.001 -> 2.170
|
||||
ddqua061 quantize 2.17 0.01 -> 2.17
|
||||
ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
|
||||
ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
|
||||
ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua065 quantize -Inf Inf -> -Infinity
|
||||
ddqua066 quantize 2 Inf -> NaN Invalid_operation
|
||||
ddqua067 quantize -0.1 1 -> -0 Inexact Rounded
|
||||
ddqua068 quantize -0 1e+5 -> -0E+5
|
||||
ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
|
||||
ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
|
||||
ddqua071 quantize 217 1e-1 -> 217.0
|
||||
ddqua072 quantize 217 1e+0 -> 217
|
||||
ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
|
||||
ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
|
||||
|
||||
-- general tests ..
|
||||
ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
|
||||
ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
|
||||
ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
|
||||
ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
|
||||
ddqua095 quantize 1.2345 1e-6 -> 1.234500
|
||||
ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
|
||||
ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
|
||||
ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
|
||||
ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
|
||||
ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
|
||||
|
||||
ddqua101 quantize -1 1e0 -> -1
|
||||
ddqua102 quantize -1 1e-1 -> -1.0
|
||||
ddqua103 quantize -1 1e-2 -> -1.00
|
||||
ddqua104 quantize 0 1e0 -> 0
|
||||
ddqua105 quantize 0 1e-1 -> 0.0
|
||||
ddqua106 quantize 0 1e-2 -> 0.00
|
||||
ddqua107 quantize 0.00 1e0 -> 0
|
||||
ddqua108 quantize 0 1e+1 -> 0E+1
|
||||
ddqua109 quantize 0 1e+2 -> 0E+2
|
||||
ddqua110 quantize +1 1e0 -> 1
|
||||
ddqua111 quantize +1 1e-1 -> 1.0
|
||||
ddqua112 quantize +1 1e-2 -> 1.00
|
||||
|
||||
ddqua120 quantize 1.04 1e-3 -> 1.040
|
||||
ddqua121 quantize 1.04 1e-2 -> 1.04
|
||||
ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
|
||||
ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
|
||||
ddqua124 quantize 1.05 1e-3 -> 1.050
|
||||
ddqua125 quantize 1.05 1e-2 -> 1.05
|
||||
ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
|
||||
ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
|
||||
ddqua132 quantize 1.06 1e-3 -> 1.060
|
||||
ddqua133 quantize 1.06 1e-2 -> 1.06
|
||||
ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
|
||||
ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
|
||||
|
||||
ddqua140 quantize -10 1e-2 -> -10.00
|
||||
ddqua141 quantize +1 1e-2 -> 1.00
|
||||
ddqua142 quantize +10 1e-2 -> 10.00
|
||||
ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation
|
||||
ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded
|
||||
ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
|
||||
ddqua146 quantize 1E-2 1e-2 -> 0.01
|
||||
ddqua147 quantize 1E-1 1e-2 -> 0.10
|
||||
ddqua148 quantize 0E-17 1e-2 -> 0.00
|
||||
|
||||
ddqua150 quantize 1.0600 1e-5 -> 1.06000
|
||||
ddqua151 quantize 1.0600 1e-4 -> 1.0600
|
||||
ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
|
||||
ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
|
||||
ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
|
||||
ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
|
||||
|
||||
-- a couple where rounding was different in base tests
|
||||
rounding: half_up
|
||||
ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
|
||||
ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
|
||||
ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
|
||||
rounding: half_even
|
||||
|
||||
-- base tests with non-1 coefficients
|
||||
ddqua161 quantize 0 -9e0 -> 0
|
||||
ddqua162 quantize 1 -7e0 -> 1
|
||||
ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
|
||||
ddqua167 quantize 0.1 3e-1 -> 0.1
|
||||
ddqua168 quantize 0.1 44e-2 -> 0.10
|
||||
ddqua169 quantize 0.1 555e-3 -> 0.100
|
||||
ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
|
||||
ddqua173 quantize 0.9 -9e-1 -> 0.9
|
||||
ddqua174 quantize 0.9 0e-2 -> 0.90
|
||||
ddqua175 quantize 0.9 1.1e-3 -> 0.9000
|
||||
-- negatives
|
||||
ddqua181 quantize -0 1.1e0 -> -0.0
|
||||
ddqua182 quantize -1 -1e0 -> -1
|
||||
ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
|
||||
ddqua187 quantize -0.1 -91e-1 -> -0.1
|
||||
ddqua188 quantize -0.1 -.1e-2 -> -0.100
|
||||
ddqua189 quantize -0.1 -1e-3 -> -0.100
|
||||
ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
|
||||
ddqua193 quantize -0.9 100e-1 -> -0.9
|
||||
ddqua194 quantize -0.9 999e-2 -> -0.90
|
||||
|
||||
-- +ve exponents ..
|
||||
ddqua201 quantize -1 1e+0 -> -1
|
||||
ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua204 quantize 0 1e+0 -> 0
|
||||
ddqua205 quantize 0 1e+1 -> 0E+1
|
||||
ddqua206 quantize 0 1e+2 -> 0E+2
|
||||
ddqua207 quantize +1 1e+0 -> 1
|
||||
ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
|
||||
ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
|
||||
ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
|
||||
ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
|
||||
|
||||
ddqua240 quantize -10 1e+1 -> -1E+1 Rounded
|
||||
ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua242 quantize +10 1e+1 -> 1E+1 Rounded
|
||||
ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
|
||||
ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
|
||||
ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
|
||||
ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
|
||||
ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
|
||||
ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
|
||||
ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
|
||||
ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
|
||||
ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
|
||||
-- next one tries to add 9 zeros
|
||||
ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation
|
||||
ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua255 quantize 0E-17 1e+1 -> 0E+1
|
||||
ddqua256 quantize -0E-17 1e+1 -> -0E+1
|
||||
ddqua257 quantize -0E-1 1e+1 -> -0E+1
|
||||
ddqua258 quantize -0 1e+1 -> -0E+1
|
||||
ddqua259 quantize -0E+1 1e+1 -> -0E+1
|
||||
|
||||
ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua264 quantize 1E+2 1e+2 -> 1E+2
|
||||
ddqua265 quantize 1E+3 1e+2 -> 1.0E+3
|
||||
ddqua266 quantize 1E+4 1e+2 -> 1.00E+4
|
||||
ddqua267 quantize 1E+5 1e+2 -> 1.000E+5
|
||||
ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6
|
||||
ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7
|
||||
ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8
|
||||
ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
|
||||
ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
|
||||
ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua275 quantize 0E-10 1e+2 -> 0E+2
|
||||
|
||||
ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
|
||||
ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua285 quantize 1E+3 1e+3 -> 1E+3
|
||||
ddqua286 quantize 1E+4 1e+3 -> 1.0E+4
|
||||
ddqua287 quantize 1E+5 1e+3 -> 1.00E+5
|
||||
ddqua288 quantize 1E+6 1e+3 -> 1.000E+6
|
||||
ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7
|
||||
ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8
|
||||
ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9
|
||||
ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
|
||||
ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
|
||||
ddqua295 quantize 0E-10 1e+3 -> 0E+3
|
||||
|
||||
-- round up from below [sign wrong in JIT compiler once]
|
||||
ddqua300 quantize 0.0078 1e-5 -> 0.00780
|
||||
ddqua301 quantize 0.0078 1e-4 -> 0.0078
|
||||
ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
|
||||
ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
|
||||
ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
|
||||
ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
|
||||
ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
ddqua310 quantize -0.0078 1e-5 -> -0.00780
|
||||
ddqua311 quantize -0.0078 1e-4 -> -0.0078
|
||||
ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
|
||||
ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
|
||||
ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
|
||||
ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
|
||||
ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
|
||||
|
||||
ddqua320 quantize 0.078 1e-5 -> 0.07800
|
||||
ddqua321 quantize 0.078 1e-4 -> 0.0780
|
||||
ddqua322 quantize 0.078 1e-3 -> 0.078
|
||||
ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
|
||||
ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
|
||||
ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
|
||||
ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
ddqua330 quantize -0.078 1e-5 -> -0.07800
|
||||
ddqua331 quantize -0.078 1e-4 -> -0.0780
|
||||
ddqua332 quantize -0.078 1e-3 -> -0.078
|
||||
ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
|
||||
ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
|
||||
ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
|
||||
ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
|
||||
|
||||
ddqua340 quantize 0.78 1e-5 -> 0.78000
|
||||
ddqua341 quantize 0.78 1e-4 -> 0.7800
|
||||
ddqua342 quantize 0.78 1e-3 -> 0.780
|
||||
ddqua343 quantize 0.78 1e-2 -> 0.78
|
||||
ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
|
||||
ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
|
||||
ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
|
||||
ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
ddqua350 quantize -0.78 1e-5 -> -0.78000
|
||||
ddqua351 quantize -0.78 1e-4 -> -0.7800
|
||||
ddqua352 quantize -0.78 1e-3 -> -0.780
|
||||
ddqua353 quantize -0.78 1e-2 -> -0.78
|
||||
ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
|
||||
ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
|
||||
ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
|
||||
ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
|
||||
|
||||
ddqua360 quantize 7.8 1e-5 -> 7.80000
|
||||
ddqua361 quantize 7.8 1e-4 -> 7.8000
|
||||
ddqua362 quantize 7.8 1e-3 -> 7.800
|
||||
ddqua363 quantize 7.8 1e-2 -> 7.80
|
||||
ddqua364 quantize 7.8 1e-1 -> 7.8
|
||||
ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
|
||||
ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
|
||||
ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
|
||||
ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
|
||||
|
||||
ddqua370 quantize -7.8 1e-5 -> -7.80000
|
||||
ddqua371 quantize -7.8 1e-4 -> -7.8000
|
||||
ddqua372 quantize -7.8 1e-3 -> -7.800
|
||||
ddqua373 quantize -7.8 1e-2 -> -7.80
|
||||
ddqua374 quantize -7.8 1e-1 -> -7.8
|
||||
ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
|
||||
ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
|
||||
ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
|
||||
ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
|
||||
|
||||
-- some individuals
|
||||
ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
|
||||
ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06
|
||||
ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
|
||||
ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation
|
||||
ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
|
||||
ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06
|
||||
ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation
|
||||
ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation
|
||||
|
||||
rounding: down
|
||||
ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
|
||||
-- ? should that one instead have been:
|
||||
-- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
|
||||
rounding: half_up
|
||||
|
||||
-- and a few more from e-mail discussions
|
||||
ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded
|
||||
ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded
|
||||
ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567
|
||||
ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation
|
||||
ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation
|
||||
ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation
|
||||
|
||||
-- some 9999 round-up cases
|
||||
ddqua400 quantize 9.999 1e-5 -> 9.99900
|
||||
ddqua401 quantize 9.999 1e-4 -> 9.9990
|
||||
ddqua402 quantize 9.999 1e-3 -> 9.999
|
||||
ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
|
||||
ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
|
||||
ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
|
||||
ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
|
||||
ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
|
||||
|
||||
ddqua410 quantize 0.999 1e-5 -> 0.99900
|
||||
ddqua411 quantize 0.999 1e-4 -> 0.9990
|
||||
ddqua412 quantize 0.999 1e-3 -> 0.999
|
||||
ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
|
||||
ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
|
||||
ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
|
||||
ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
ddqua420 quantize 0.0999 1e-5 -> 0.09990
|
||||
ddqua421 quantize 0.0999 1e-4 -> 0.0999
|
||||
ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
|
||||
ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
|
||||
ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
|
||||
ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
|
||||
ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
ddqua430 quantize 0.00999 1e-5 -> 0.00999
|
||||
ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
|
||||
ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
|
||||
ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
|
||||
ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
|
||||
ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
|
||||
ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
|
||||
ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
|
||||
ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
|
||||
ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
|
||||
ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
|
||||
ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
|
||||
ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
ddqua1001 quantize 0.000 0.001 -> 0.000
|
||||
ddqua1002 quantize 0.001 0.001 -> 0.001
|
||||
ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
|
||||
ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
|
||||
ddqua1005 quantize 0.501 0.001 -> 0.501
|
||||
ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
|
||||
ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
|
||||
ddqua1008 quantize 0.999 0.001 -> 0.999
|
||||
|
||||
ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
|
||||
ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
|
||||
ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
|
||||
ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
|
||||
ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
|
||||
ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
|
||||
-- a potential double-round
|
||||
ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
|
||||
ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
|
||||
|
||||
ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
|
||||
ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
|
||||
ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
|
||||
ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
|
||||
ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
|
||||
ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
|
||||
ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
|
||||
ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
|
||||
|
||||
-- Zeros
|
||||
ddqua500 quantize 0 1e1 -> 0E+1
|
||||
ddqua501 quantize 0 1e0 -> 0
|
||||
ddqua502 quantize 0 1e-1 -> 0.0
|
||||
ddqua503 quantize 0.0 1e-1 -> 0.0
|
||||
ddqua504 quantize 0.0 1e0 -> 0
|
||||
ddqua505 quantize 0.0 1e+1 -> 0E+1
|
||||
ddqua506 quantize 0E+1 1e-1 -> 0.0
|
||||
ddqua507 quantize 0E+1 1e0 -> 0
|
||||
ddqua508 quantize 0E+1 1e+1 -> 0E+1
|
||||
ddqua509 quantize -0 1e1 -> -0E+1
|
||||
ddqua510 quantize -0 1e0 -> -0
|
||||
ddqua511 quantize -0 1e-1 -> -0.0
|
||||
ddqua512 quantize -0.0 1e-1 -> -0.0
|
||||
ddqua513 quantize -0.0 1e0 -> -0
|
||||
ddqua514 quantize -0.0 1e+1 -> -0E+1
|
||||
ddqua515 quantize -0E+1 1e-1 -> -0.0
|
||||
ddqua516 quantize -0E+1 1e0 -> -0
|
||||
ddqua517 quantize -0E+1 1e+1 -> -0E+1
|
||||
|
||||
-- Suspicious RHS values
|
||||
ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
|
||||
ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
|
||||
ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
|
||||
ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
|
||||
-- next four are "won't fit" overfl
|
||||
ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
|
||||
ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
|
||||
ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
|
||||
ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation
|
||||
|
||||
ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
|
||||
ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
|
||||
ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
|
||||
ddqua537 quantize 0 1e-299 -> 0E-299
|
||||
-- next two are "won't fit" overflows
|
||||
ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
|
||||
ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation
|
||||
-- [more below]
|
||||
|
||||
-- Specials
|
||||
ddqua580 quantize Inf -Inf -> Infinity
|
||||
ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation
|
||||
ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation
|
||||
ddqua583 quantize Inf 1e0 -> NaN Invalid_operation
|
||||
ddqua584 quantize Inf 1e1 -> NaN Invalid_operation
|
||||
ddqua585 quantize Inf 1e299 -> NaN Invalid_operation
|
||||
ddqua586 quantize Inf Inf -> Infinity
|
||||
ddqua587 quantize -1000 Inf -> NaN Invalid_operation
|
||||
ddqua588 quantize -Inf Inf -> -Infinity
|
||||
ddqua589 quantize -1 Inf -> NaN Invalid_operation
|
||||
ddqua590 quantize 0 Inf -> NaN Invalid_operation
|
||||
ddqua591 quantize 1 Inf -> NaN Invalid_operation
|
||||
ddqua592 quantize 1000 Inf -> NaN Invalid_operation
|
||||
ddqua593 quantize Inf Inf -> Infinity
|
||||
ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation
|
||||
ddqua595 quantize -0 Inf -> NaN Invalid_operation
|
||||
|
||||
ddqua600 quantize -Inf -Inf -> -Infinity
|
||||
ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
|
||||
ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
|
||||
ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation
|
||||
ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation
|
||||
ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation
|
||||
ddqua606 quantize -Inf Inf -> -Infinity
|
||||
ddqua607 quantize -1000 Inf -> NaN Invalid_operation
|
||||
ddqua608 quantize -Inf -Inf -> -Infinity
|
||||
ddqua609 quantize -1 -Inf -> NaN Invalid_operation
|
||||
ddqua610 quantize 0 -Inf -> NaN Invalid_operation
|
||||
ddqua611 quantize 1 -Inf -> NaN Invalid_operation
|
||||
ddqua612 quantize 1000 -Inf -> NaN Invalid_operation
|
||||
ddqua613 quantize Inf -Inf -> Infinity
|
||||
ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
|
||||
ddqua615 quantize -0 -Inf -> NaN Invalid_operation
|
||||
|
||||
ddqua621 quantize NaN -Inf -> NaN
|
||||
ddqua622 quantize NaN 1e-299 -> NaN
|
||||
ddqua623 quantize NaN 1e-1 -> NaN
|
||||
ddqua624 quantize NaN 1e0 -> NaN
|
||||
ddqua625 quantize NaN 1e1 -> NaN
|
||||
ddqua626 quantize NaN 1e299 -> NaN
|
||||
ddqua627 quantize NaN Inf -> NaN
|
||||
ddqua628 quantize NaN NaN -> NaN
|
||||
ddqua629 quantize -Inf NaN -> NaN
|
||||
ddqua630 quantize -1000 NaN -> NaN
|
||||
ddqua631 quantize -1 NaN -> NaN
|
||||
ddqua632 quantize 0 NaN -> NaN
|
||||
ddqua633 quantize 1 NaN -> NaN
|
||||
ddqua634 quantize 1000 NaN -> NaN
|
||||
ddqua635 quantize Inf NaN -> NaN
|
||||
ddqua636 quantize NaN 1e-0 -> NaN
|
||||
ddqua637 quantize -0 NaN -> NaN
|
||||
|
||||
ddqua641 quantize sNaN -Inf -> NaN Invalid_operation
|
||||
ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
|
||||
ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
|
||||
ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation
|
||||
ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation
|
||||
ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation
|
||||
ddqua647 quantize sNaN NaN -> NaN Invalid_operation
|
||||
ddqua648 quantize sNaN sNaN -> NaN Invalid_operation
|
||||
ddqua649 quantize NaN sNaN -> NaN Invalid_operation
|
||||
ddqua650 quantize -Inf sNaN -> NaN Invalid_operation
|
||||
ddqua651 quantize -1000 sNaN -> NaN Invalid_operation
|
||||
ddqua652 quantize -1 sNaN -> NaN Invalid_operation
|
||||
ddqua653 quantize 0 sNaN -> NaN Invalid_operation
|
||||
ddqua654 quantize 1 sNaN -> NaN Invalid_operation
|
||||
ddqua655 quantize 1000 sNaN -> NaN Invalid_operation
|
||||
ddqua656 quantize Inf sNaN -> NaN Invalid_operation
|
||||
ddqua657 quantize NaN sNaN -> NaN Invalid_operation
|
||||
ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
|
||||
ddqua659 quantize -0 sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddqua661 quantize NaN9 -Inf -> NaN9
|
||||
ddqua662 quantize NaN8 919 -> NaN8
|
||||
ddqua663 quantize NaN71 Inf -> NaN71
|
||||
ddqua664 quantize NaN6 NaN5 -> NaN6
|
||||
ddqua665 quantize -Inf NaN4 -> NaN4
|
||||
ddqua666 quantize -919 NaN31 -> NaN31
|
||||
ddqua667 quantize Inf NaN2 -> NaN2
|
||||
|
||||
ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
|
||||
ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
|
||||
ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
|
||||
ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
|
||||
ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
|
||||
ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
|
||||
ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
|
||||
ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
|
||||
|
||||
ddqua681 quantize -NaN9 -Inf -> -NaN9
|
||||
ddqua682 quantize -NaN8 919 -> -NaN8
|
||||
ddqua683 quantize -NaN71 Inf -> -NaN71
|
||||
ddqua684 quantize -NaN6 -NaN5 -> -NaN6
|
||||
ddqua685 quantize -Inf -NaN4 -> -NaN4
|
||||
ddqua686 quantize -919 -NaN31 -> -NaN31
|
||||
ddqua687 quantize Inf -NaN2 -> -NaN2
|
||||
|
||||
ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
|
||||
ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
|
||||
ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
|
||||
ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
|
||||
ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
|
||||
ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
|
||||
ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
|
||||
ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
|
||||
|
||||
-- subnormals and underflow
|
||||
ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded
|
||||
ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal
|
||||
ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded
|
||||
ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded
|
||||
ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal
|
||||
-- next is rounded to Emin
|
||||
ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded
|
||||
ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal
|
||||
|
||||
ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal
|
||||
ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded
|
||||
ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded
|
||||
ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded
|
||||
|
||||
ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded
|
||||
ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact
|
||||
ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact
|
||||
ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact
|
||||
ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded
|
||||
-- next is rounded to Emin
|
||||
ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded
|
||||
ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded
|
||||
ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded
|
||||
ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded
|
||||
ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded
|
||||
|
||||
ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded
|
||||
ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal
|
||||
ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded
|
||||
ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded
|
||||
ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded
|
||||
-- next is rounded to Emin
|
||||
ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded
|
||||
ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal
|
||||
ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded
|
||||
ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded
|
||||
ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded
|
||||
|
||||
ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383
|
||||
ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal
|
||||
ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal
|
||||
ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded
|
||||
ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal
|
||||
-- next is rounded to Emin
|
||||
ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded
|
||||
ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal
|
||||
ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal
|
||||
ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded
|
||||
ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded
|
||||
|
||||
ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383
|
||||
ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal
|
||||
ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal
|
||||
ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal
|
||||
ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal
|
||||
ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal
|
||||
ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal
|
||||
ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal
|
||||
ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal
|
||||
ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded
|
||||
|
||||
-- More from Fung Lee
|
||||
ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
|
||||
ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384
|
||||
ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
|
||||
ddqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
|
||||
|
||||
-- Int and uInt32 edge values for testing conversions
|
||||
ddqua1040 quantize -2147483646 0 -> -2147483646
|
||||
ddqua1041 quantize -2147483647 0 -> -2147483647
|
||||
ddqua1042 quantize -2147483648 0 -> -2147483648
|
||||
ddqua1043 quantize -2147483649 0 -> -2147483649
|
||||
ddqua1044 quantize 2147483646 0 -> 2147483646
|
||||
ddqua1045 quantize 2147483647 0 -> 2147483647
|
||||
ddqua1046 quantize 2147483648 0 -> 2147483648
|
||||
ddqua1047 quantize 2147483649 0 -> 2147483649
|
||||
ddqua1048 quantize 4294967294 0 -> 4294967294
|
||||
ddqua1049 quantize 4294967295 0 -> 4294967295
|
||||
ddqua1050 quantize 4294967296 0 -> 4294967296
|
||||
ddqua1051 quantize 4294967297 0 -> 4294967297
|
||||
|
||||
-- Rounding swathe
|
||||
rounding: half_even
|
||||
ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
|
||||
ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
|
||||
ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
|
||||
ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
|
||||
|
||||
rounding: 05up
|
||||
ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
|
||||
ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
|
||||
|
||||
ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
|
||||
ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
|
||||
ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
|
||||
|
||||
ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
|
||||
ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
|
||||
ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
|
||||
|
||||
ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
|
||||
ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
|
||||
|
||||
ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
|
||||
ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
|
||||
ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
|
||||
|
||||
ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
|
||||
ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
|
||||
ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
|
||||
|
||||
-- Null tests
|
||||
rounding: half_even
|
||||
ddqua998 quantize 10 # -> NaN Invalid_operation
|
||||
ddqua999 quantize # 1e10 -> NaN Invalid_operation
|
|
@ -0,0 +1,182 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddReduce.decTest -- remove trailing zeros from a decDouble --
|
||||
-- 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 --
|
||||
------------------------------------------------------------------------
|
||||
version: 2.56
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddred001 reduce '1' -> '1'
|
||||
ddred002 reduce '-1' -> '-1'
|
||||
ddred003 reduce '1.00' -> '1'
|
||||
ddred004 reduce '-1.00' -> '-1'
|
||||
ddred005 reduce '0' -> '0'
|
||||
ddred006 reduce '0.00' -> '0'
|
||||
ddred007 reduce '00.0' -> '0'
|
||||
ddred008 reduce '00.00' -> '0'
|
||||
ddred009 reduce '00' -> '0'
|
||||
ddred010 reduce '0E+1' -> '0'
|
||||
ddred011 reduce '0E+5' -> '0'
|
||||
|
||||
ddred012 reduce '-2' -> '-2'
|
||||
ddred013 reduce '2' -> '2'
|
||||
ddred014 reduce '-2.00' -> '-2'
|
||||
ddred015 reduce '2.00' -> '2'
|
||||
ddred016 reduce '-0' -> '-0'
|
||||
ddred017 reduce '-0.00' -> '-0'
|
||||
ddred018 reduce '-00.0' -> '-0'
|
||||
ddred019 reduce '-00.00' -> '-0'
|
||||
ddred020 reduce '-00' -> '-0'
|
||||
ddred021 reduce '-0E+5' -> '-0'
|
||||
ddred022 reduce '-0E+1' -> '-0'
|
||||
|
||||
ddred030 reduce '+0.1' -> '0.1'
|
||||
ddred031 reduce '-0.1' -> '-0.1'
|
||||
ddred032 reduce '+0.01' -> '0.01'
|
||||
ddred033 reduce '-0.01' -> '-0.01'
|
||||
ddred034 reduce '+0.001' -> '0.001'
|
||||
ddred035 reduce '-0.001' -> '-0.001'
|
||||
ddred036 reduce '+0.000001' -> '0.000001'
|
||||
ddred037 reduce '-0.000001' -> '-0.000001'
|
||||
ddred038 reduce '+0.000000000001' -> '1E-12'
|
||||
ddred039 reduce '-0.000000000001' -> '-1E-12'
|
||||
|
||||
ddred041 reduce 1.1 -> 1.1
|
||||
ddred042 reduce 1.10 -> 1.1
|
||||
ddred043 reduce 1.100 -> 1.1
|
||||
ddred044 reduce 1.110 -> 1.11
|
||||
ddred045 reduce -1.1 -> -1.1
|
||||
ddred046 reduce -1.10 -> -1.1
|
||||
ddred047 reduce -1.100 -> -1.1
|
||||
ddred048 reduce -1.110 -> -1.11
|
||||
ddred049 reduce 9.9 -> 9.9
|
||||
ddred050 reduce 9.90 -> 9.9
|
||||
ddred051 reduce 9.900 -> 9.9
|
||||
ddred052 reduce 9.990 -> 9.99
|
||||
ddred053 reduce -9.9 -> -9.9
|
||||
ddred054 reduce -9.90 -> -9.9
|
||||
ddred055 reduce -9.900 -> -9.9
|
||||
ddred056 reduce -9.990 -> -9.99
|
||||
|
||||
-- some trailing fractional zeros with zeros in units
|
||||
ddred060 reduce 10.0 -> 1E+1
|
||||
ddred061 reduce 10.00 -> 1E+1
|
||||
ddred062 reduce 100.0 -> 1E+2
|
||||
ddred063 reduce 100.00 -> 1E+2
|
||||
ddred064 reduce 1.1000E+3 -> 1.1E+3
|
||||
ddred065 reduce 1.10000E+3 -> 1.1E+3
|
||||
ddred066 reduce -10.0 -> -1E+1
|
||||
ddred067 reduce -10.00 -> -1E+1
|
||||
ddred068 reduce -100.0 -> -1E+2
|
||||
ddred069 reduce -100.00 -> -1E+2
|
||||
ddred070 reduce -1.1000E+3 -> -1.1E+3
|
||||
ddred071 reduce -1.10000E+3 -> -1.1E+3
|
||||
|
||||
-- some insignificant trailing zeros with positive exponent
|
||||
ddred080 reduce 10E+1 -> 1E+2
|
||||
ddred081 reduce 100E+1 -> 1E+3
|
||||
ddred082 reduce 1.0E+2 -> 1E+2
|
||||
ddred083 reduce 1.0E+3 -> 1E+3
|
||||
ddred084 reduce 1.1E+3 -> 1.1E+3
|
||||
ddred085 reduce 1.00E+3 -> 1E+3
|
||||
ddred086 reduce 1.10E+3 -> 1.1E+3
|
||||
ddred087 reduce -10E+1 -> -1E+2
|
||||
ddred088 reduce -100E+1 -> -1E+3
|
||||
ddred089 reduce -1.0E+2 -> -1E+2
|
||||
ddred090 reduce -1.0E+3 -> -1E+3
|
||||
ddred091 reduce -1.1E+3 -> -1.1E+3
|
||||
ddred092 reduce -1.00E+3 -> -1E+3
|
||||
ddred093 reduce -1.10E+3 -> -1.1E+3
|
||||
|
||||
-- some significant trailing zeros, were we to be trimming
|
||||
ddred100 reduce 11 -> 11
|
||||
ddred101 reduce 10 -> 1E+1
|
||||
ddred102 reduce 10. -> 1E+1
|
||||
ddred103 reduce 1.1E+1 -> 11
|
||||
ddred104 reduce 1.0E+1 -> 1E+1
|
||||
ddred105 reduce 1.10E+2 -> 1.1E+2
|
||||
ddred106 reduce 1.00E+2 -> 1E+2
|
||||
ddred107 reduce 1.100E+3 -> 1.1E+3
|
||||
ddred108 reduce 1.000E+3 -> 1E+3
|
||||
ddred109 reduce 1.000000E+6 -> 1E+6
|
||||
ddred110 reduce -11 -> -11
|
||||
ddred111 reduce -10 -> -1E+1
|
||||
ddred112 reduce -10. -> -1E+1
|
||||
ddred113 reduce -1.1E+1 -> -11
|
||||
ddred114 reduce -1.0E+1 -> -1E+1
|
||||
ddred115 reduce -1.10E+2 -> -1.1E+2
|
||||
ddred116 reduce -1.00E+2 -> -1E+2
|
||||
ddred117 reduce -1.100E+3 -> -1.1E+3
|
||||
ddred118 reduce -1.000E+3 -> -1E+3
|
||||
ddred119 reduce -1.00000E+5 -> -1E+5
|
||||
ddred120 reduce -1.000000E+6 -> -1E+6
|
||||
ddred121 reduce -10.00000E+6 -> -1E+7
|
||||
ddred122 reduce -100.0000E+6 -> -1E+8
|
||||
ddred123 reduce -1000.000E+6 -> -1E+9
|
||||
ddred124 reduce -10000.00E+6 -> -1E+10
|
||||
ddred125 reduce -100000.0E+6 -> -1E+11
|
||||
ddred126 reduce -1000000.E+6 -> -1E+12
|
||||
|
||||
-- examples from decArith
|
||||
ddred140 reduce '2.1' -> '2.1'
|
||||
ddred141 reduce '-2.0' -> '-2'
|
||||
ddred142 reduce '1.200' -> '1.2'
|
||||
ddred143 reduce '-120' -> '-1.2E+2'
|
||||
ddred144 reduce '120.00' -> '1.2E+2'
|
||||
ddred145 reduce '0.00' -> '0'
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
-- note origami effect on some of these
|
||||
ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380
|
||||
ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384
|
||||
ddred154 reduce 1E-383 -> 1E-383
|
||||
ddred155 reduce 1.000000000000000E-383 -> 1E-383
|
||||
ddred156 reduce 2.000E-395 -> 2E-395 Subnormal
|
||||
ddred157 reduce 1E-398 -> 1E-398 Subnormal
|
||||
|
||||
ddred161 reduce -1E-398 -> -1E-398 Subnormal
|
||||
ddred162 reduce -2.000E-395 -> -2E-395 Subnormal
|
||||
ddred163 reduce -1.000000000000000E-383 -> -1E-383
|
||||
ddred164 reduce -1E-383 -> -1E-383
|
||||
ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380
|
||||
ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384
|
||||
ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
|
||||
ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384
|
||||
ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
|
||||
|
||||
|
||||
-- specials (reduce does not affect payload)
|
||||
ddred820 reduce 'Inf' -> 'Infinity'
|
||||
ddred821 reduce '-Inf' -> '-Infinity'
|
||||
ddred822 reduce NaN -> NaN
|
||||
ddred823 reduce sNaN -> NaN Invalid_operation
|
||||
ddred824 reduce NaN101 -> NaN101
|
||||
ddred825 reduce sNaN010 -> NaN10 Invalid_operation
|
||||
ddred827 reduce -NaN -> -NaN
|
||||
ddred828 reduce -sNaN -> -NaN Invalid_operation
|
||||
ddred829 reduce -NaN101 -> -NaN101
|
||||
ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation
|
||||
|
||||
-- Null test
|
||||
ddred900 reduce # -> NaN Invalid_operation
|
|
@ -0,0 +1,587 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddRemainder.decTest -- decDouble remainder --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks (as base, above)
|
||||
ddrem001 remainder 1 1 -> 0
|
||||
ddrem002 remainder 2 1 -> 0
|
||||
ddrem003 remainder 1 2 -> 1
|
||||
ddrem004 remainder 2 2 -> 0
|
||||
ddrem005 remainder 0 1 -> 0
|
||||
ddrem006 remainder 0 2 -> 0
|
||||
ddrem007 remainder 1 3 -> 1
|
||||
ddrem008 remainder 2 3 -> 2
|
||||
ddrem009 remainder 3 3 -> 0
|
||||
|
||||
ddrem010 remainder 2.4 1 -> 0.4
|
||||
ddrem011 remainder 2.4 -1 -> 0.4
|
||||
ddrem012 remainder -2.4 1 -> -0.4
|
||||
ddrem013 remainder -2.4 -1 -> -0.4
|
||||
ddrem014 remainder 2.40 1 -> 0.40
|
||||
ddrem015 remainder 2.400 1 -> 0.400
|
||||
ddrem016 remainder 2.4 2 -> 0.4
|
||||
ddrem017 remainder 2.400 2 -> 0.400
|
||||
ddrem018 remainder 2. 2 -> 0
|
||||
ddrem019 remainder 20 20 -> 0
|
||||
|
||||
ddrem020 remainder 187 187 -> 0
|
||||
ddrem021 remainder 5 2 -> 1
|
||||
ddrem022 remainder 5 2.0 -> 1.0
|
||||
ddrem023 remainder 5 2.000 -> 1.000
|
||||
ddrem024 remainder 5 0.200 -> 0.000
|
||||
ddrem025 remainder 5 0.200 -> 0.000
|
||||
|
||||
ddrem030 remainder 1 2 -> 1
|
||||
ddrem031 remainder 1 4 -> 1
|
||||
ddrem032 remainder 1 8 -> 1
|
||||
|
||||
ddrem033 remainder 1 16 -> 1
|
||||
ddrem034 remainder 1 32 -> 1
|
||||
ddrem035 remainder 1 64 -> 1
|
||||
ddrem040 remainder 1 -2 -> 1
|
||||
ddrem041 remainder 1 -4 -> 1
|
||||
ddrem042 remainder 1 -8 -> 1
|
||||
ddrem043 remainder 1 -16 -> 1
|
||||
ddrem044 remainder 1 -32 -> 1
|
||||
ddrem045 remainder 1 -64 -> 1
|
||||
ddrem050 remainder -1 2 -> -1
|
||||
ddrem051 remainder -1 4 -> -1
|
||||
ddrem052 remainder -1 8 -> -1
|
||||
ddrem053 remainder -1 16 -> -1
|
||||
ddrem054 remainder -1 32 -> -1
|
||||
ddrem055 remainder -1 64 -> -1
|
||||
ddrem060 remainder -1 -2 -> -1
|
||||
ddrem061 remainder -1 -4 -> -1
|
||||
ddrem062 remainder -1 -8 -> -1
|
||||
ddrem063 remainder -1 -16 -> -1
|
||||
ddrem064 remainder -1 -32 -> -1
|
||||
ddrem065 remainder -1 -64 -> -1
|
||||
|
||||
ddrem066 remainder 999999999 1 -> 0
|
||||
ddrem067 remainder 999999999.4 1 -> 0.4
|
||||
ddrem068 remainder 999999999.5 1 -> 0.5
|
||||
ddrem069 remainder 999999999.9 1 -> 0.9
|
||||
ddrem070 remainder 999999999.999 1 -> 0.999
|
||||
ddrem071 remainder 999999.999999 1 -> 0.999999
|
||||
ddrem072 remainder 9 1 -> 0
|
||||
ddrem073 remainder 9999999999999999 1 -> 0
|
||||
ddrem074 remainder 9999999999999999 2 -> 1
|
||||
ddrem075 remainder 9999999999999999 3 -> 0
|
||||
ddrem076 remainder 9999999999999999 4 -> 3
|
||||
|
||||
ddrem080 remainder 0. 1 -> 0
|
||||
ddrem081 remainder .0 1 -> 0.0
|
||||
ddrem082 remainder 0.00 1 -> 0.00
|
||||
ddrem083 remainder 0.00E+9 1 -> 0
|
||||
ddrem084 remainder 0.00E+3 1 -> 0
|
||||
ddrem085 remainder 0.00E+2 1 -> 0
|
||||
ddrem086 remainder 0.00E+1 1 -> 0.0
|
||||
ddrem087 remainder 0.00E+0 1 -> 0.00
|
||||
ddrem088 remainder 0.00E-0 1 -> 0.00
|
||||
ddrem089 remainder 0.00E-1 1 -> 0.000
|
||||
ddrem090 remainder 0.00E-2 1 -> 0.0000
|
||||
ddrem091 remainder 0.00E-3 1 -> 0.00000
|
||||
ddrem092 remainder 0.00E-4 1 -> 0.000000
|
||||
ddrem093 remainder 0.00E-5 1 -> 0E-7
|
||||
ddrem094 remainder 0.00E-6 1 -> 0E-8
|
||||
ddrem095 remainder 0.0000E-50 1 -> 0E-54
|
||||
|
||||
-- Various flavours of remainder by 0
|
||||
ddrem101 remainder 0 0 -> NaN Division_undefined
|
||||
ddrem102 remainder 0 -0 -> NaN Division_undefined
|
||||
ddrem103 remainder -0 0 -> NaN Division_undefined
|
||||
ddrem104 remainder -0 -0 -> NaN Division_undefined
|
||||
ddrem105 remainder 0.0E5 0 -> NaN Division_undefined
|
||||
ddrem106 remainder 0.000 0 -> NaN Division_undefined
|
||||
-- [Some think this next group should be Division_by_zero exception, but
|
||||
-- IEEE 854 is explicit that it is Invalid operation .. for
|
||||
-- remainder-near, anyway]
|
||||
ddrem107 remainder 0.0001 0 -> NaN Invalid_operation
|
||||
ddrem108 remainder 0.01 0 -> NaN Invalid_operation
|
||||
ddrem109 remainder 0.1 0 -> NaN Invalid_operation
|
||||
ddrem110 remainder 1 0 -> NaN Invalid_operation
|
||||
ddrem111 remainder 1 0.0 -> NaN Invalid_operation
|
||||
ddrem112 remainder 10 0.0 -> NaN Invalid_operation
|
||||
ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
|
||||
ddrem114 remainder 1E+380 0 -> NaN Invalid_operation
|
||||
ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation
|
||||
ddrem116 remainder 0.01 -0 -> NaN Invalid_operation
|
||||
ddrem119 remainder 0.1 -0 -> NaN Invalid_operation
|
||||
ddrem120 remainder 1 -0 -> NaN Invalid_operation
|
||||
ddrem121 remainder 1 -0.0 -> NaN Invalid_operation
|
||||
ddrem122 remainder 10 -0.0 -> NaN Invalid_operation
|
||||
ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
|
||||
ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation
|
||||
-- and zeros on left
|
||||
ddrem130 remainder 0 1 -> 0
|
||||
ddrem131 remainder 0 -1 -> 0
|
||||
ddrem132 remainder 0.0 1 -> 0.0
|
||||
ddrem133 remainder 0.0 -1 -> 0.0
|
||||
ddrem134 remainder -0 1 -> -0
|
||||
ddrem135 remainder -0 -1 -> -0
|
||||
ddrem136 remainder -0.0 1 -> -0.0
|
||||
ddrem137 remainder -0.0 -1 -> -0.0
|
||||
|
||||
-- 0.5ers
|
||||
ddrem143 remainder 0.5 2 -> 0.5
|
||||
ddrem144 remainder 0.5 2.1 -> 0.5
|
||||
ddrem145 remainder 0.5 2.01 -> 0.50
|
||||
ddrem146 remainder 0.5 2.001 -> 0.500
|
||||
ddrem147 remainder 0.50 2 -> 0.50
|
||||
ddrem148 remainder 0.50 2.01 -> 0.50
|
||||
ddrem149 remainder 0.50 2.001 -> 0.500
|
||||
|
||||
-- steadies
|
||||
ddrem150 remainder 1 1 -> 0
|
||||
ddrem151 remainder 1 2 -> 1
|
||||
ddrem152 remainder 1 3 -> 1
|
||||
ddrem153 remainder 1 4 -> 1
|
||||
ddrem154 remainder 1 5 -> 1
|
||||
ddrem155 remainder 1 6 -> 1
|
||||
ddrem156 remainder 1 7 -> 1
|
||||
ddrem157 remainder 1 8 -> 1
|
||||
ddrem158 remainder 1 9 -> 1
|
||||
ddrem159 remainder 1 10 -> 1
|
||||
ddrem160 remainder 1 1 -> 0
|
||||
ddrem161 remainder 2 1 -> 0
|
||||
ddrem162 remainder 3 1 -> 0
|
||||
ddrem163 remainder 4 1 -> 0
|
||||
ddrem164 remainder 5 1 -> 0
|
||||
ddrem165 remainder 6 1 -> 0
|
||||
ddrem166 remainder 7 1 -> 0
|
||||
ddrem167 remainder 8 1 -> 0
|
||||
ddrem168 remainder 9 1 -> 0
|
||||
ddrem169 remainder 10 1 -> 0
|
||||
|
||||
-- some differences from remainderNear
|
||||
ddrem171 remainder 0.4 1.020 -> 0.400
|
||||
ddrem172 remainder 0.50 1.020 -> 0.500
|
||||
ddrem173 remainder 0.51 1.020 -> 0.510
|
||||
ddrem174 remainder 0.52 1.020 -> 0.520
|
||||
ddrem175 remainder 0.6 1.020 -> 0.600
|
||||
|
||||
-- More flavours of remainder by 0
|
||||
ddrem201 remainder 0 0 -> NaN Division_undefined
|
||||
ddrem202 remainder 0.0E5 0 -> NaN Division_undefined
|
||||
ddrem203 remainder 0.000 0 -> NaN Division_undefined
|
||||
ddrem204 remainder 0.0001 0 -> NaN Invalid_operation
|
||||
ddrem205 remainder 0.01 0 -> NaN Invalid_operation
|
||||
ddrem206 remainder 0.1 0 -> NaN Invalid_operation
|
||||
ddrem207 remainder 1 0 -> NaN Invalid_operation
|
||||
ddrem208 remainder 1 0.0 -> NaN Invalid_operation
|
||||
ddrem209 remainder 10 0.0 -> NaN Invalid_operation
|
||||
ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
|
||||
ddrem211 remainder 1E+380 0 -> NaN Invalid_operation
|
||||
|
||||
-- some differences from remainderNear
|
||||
ddrem231 remainder -0.4 1.020 -> -0.400
|
||||
ddrem232 remainder -0.50 1.020 -> -0.500
|
||||
ddrem233 remainder -0.51 1.020 -> -0.510
|
||||
ddrem234 remainder -0.52 1.020 -> -0.520
|
||||
ddrem235 remainder -0.6 1.020 -> -0.600
|
||||
|
||||
-- high Xs
|
||||
ddrem240 remainder 1E+2 1.00 -> 0.00
|
||||
|
||||
-- ddrem3xx are from DiagBigDecimal
|
||||
ddrem301 remainder 1 3 -> 1
|
||||
ddrem302 remainder 5 5 -> 0
|
||||
ddrem303 remainder 13 10 -> 3
|
||||
ddrem304 remainder 13 50 -> 13
|
||||
ddrem305 remainder 13 100 -> 13
|
||||
ddrem306 remainder 13 1000 -> 13
|
||||
ddrem307 remainder .13 1 -> 0.13
|
||||
ddrem308 remainder 0.133 1 -> 0.133
|
||||
ddrem309 remainder 0.1033 1 -> 0.1033
|
||||
ddrem310 remainder 1.033 1 -> 0.033
|
||||
ddrem311 remainder 10.33 1 -> 0.33
|
||||
ddrem312 remainder 10.33 10 -> 0.33
|
||||
ddrem313 remainder 103.3 1 -> 0.3
|
||||
ddrem314 remainder 133 10 -> 3
|
||||
ddrem315 remainder 1033 10 -> 3
|
||||
ddrem316 remainder 1033 50 -> 33
|
||||
ddrem317 remainder 101.0 3 -> 2.0
|
||||
ddrem318 remainder 102.0 3 -> 0.0
|
||||
ddrem319 remainder 103.0 3 -> 1.0
|
||||
ddrem320 remainder 2.40 1 -> 0.40
|
||||
ddrem321 remainder 2.400 1 -> 0.400
|
||||
ddrem322 remainder 2.4 1 -> 0.4
|
||||
ddrem323 remainder 2.4 2 -> 0.4
|
||||
ddrem324 remainder 2.400 2 -> 0.400
|
||||
ddrem325 remainder 1 0.3 -> 0.1
|
||||
ddrem326 remainder 1 0.30 -> 0.10
|
||||
ddrem327 remainder 1 0.300 -> 0.100
|
||||
ddrem328 remainder 1 0.3000 -> 0.1000
|
||||
ddrem329 remainder 1.0 0.3 -> 0.1
|
||||
ddrem330 remainder 1.00 0.3 -> 0.10
|
||||
ddrem331 remainder 1.000 0.3 -> 0.100
|
||||
ddrem332 remainder 1.0000 0.3 -> 0.1000
|
||||
ddrem333 remainder 0.5 2 -> 0.5
|
||||
ddrem334 remainder 0.5 2.1 -> 0.5
|
||||
ddrem335 remainder 0.5 2.01 -> 0.50
|
||||
ddrem336 remainder 0.5 2.001 -> 0.500
|
||||
ddrem337 remainder 0.50 2 -> 0.50
|
||||
ddrem338 remainder 0.50 2.01 -> 0.50
|
||||
ddrem339 remainder 0.50 2.001 -> 0.500
|
||||
|
||||
ddrem340 remainder 0.5 0.5000001 -> 0.5000000
|
||||
ddrem341 remainder 0.5 0.50000001 -> 0.50000000
|
||||
ddrem342 remainder 0.5 0.500000001 -> 0.500000000
|
||||
ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000
|
||||
ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000
|
||||
ddrem345 remainder 0.5 0.4999999 -> 1E-7
|
||||
ddrem346 remainder 0.5 0.49999999 -> 1E-8
|
||||
ddrem347 remainder 0.5 0.499999999 -> 1E-9
|
||||
ddrem348 remainder 0.5 0.4999999999 -> 1E-10
|
||||
ddrem349 remainder 0.5 0.49999999999 -> 1E-11
|
||||
ddrem350 remainder 0.5 0.499999999999 -> 1E-12
|
||||
|
||||
ddrem351 remainder 0.03 7 -> 0.03
|
||||
ddrem352 remainder 5 2 -> 1
|
||||
ddrem353 remainder 4.1 2 -> 0.1
|
||||
ddrem354 remainder 4.01 2 -> 0.01
|
||||
ddrem355 remainder 4.001 2 -> 0.001
|
||||
ddrem356 remainder 4.0001 2 -> 0.0001
|
||||
ddrem357 remainder 4.00001 2 -> 0.00001
|
||||
ddrem358 remainder 4.000001 2 -> 0.000001
|
||||
ddrem359 remainder 4.0000001 2 -> 1E-7
|
||||
|
||||
ddrem360 remainder 1.2 0.7345 -> 0.4655
|
||||
ddrem361 remainder 0.8 12 -> 0.8
|
||||
ddrem362 remainder 0.8 0.2 -> 0.0
|
||||
ddrem363 remainder 0.8 0.3 -> 0.2
|
||||
ddrem364 remainder 0.800 12 -> 0.800
|
||||
ddrem365 remainder 0.800 1.7 -> 0.800
|
||||
ddrem366 remainder 2.400 2 -> 0.400
|
||||
|
||||
ddrem371 remainder 2.400 2 -> 0.400
|
||||
|
||||
ddrem381 remainder 12345 1 -> 0
|
||||
ddrem382 remainder 12345 1.0001 -> 0.7657
|
||||
ddrem383 remainder 12345 1.001 -> 0.668
|
||||
ddrem384 remainder 12345 1.01 -> 0.78
|
||||
ddrem385 remainder 12345 1.1 -> 0.8
|
||||
ddrem386 remainder 12355 4 -> 3
|
||||
ddrem387 remainder 12345 4 -> 1
|
||||
ddrem388 remainder 12355 4.0001 -> 2.6912
|
||||
ddrem389 remainder 12345 4.0001 -> 0.6914
|
||||
ddrem390 remainder 12345 4.9 -> 1.9
|
||||
ddrem391 remainder 12345 4.99 -> 4.73
|
||||
ddrem392 remainder 12345 4.999 -> 2.469
|
||||
ddrem393 remainder 12345 4.9999 -> 0.2469
|
||||
ddrem394 remainder 12345 5 -> 0
|
||||
ddrem395 remainder 12345 5.0001 -> 4.7532
|
||||
ddrem396 remainder 12345 5.001 -> 2.532
|
||||
ddrem397 remainder 12345 5.01 -> 0.36
|
||||
ddrem398 remainder 12345 5.1 -> 3.0
|
||||
|
||||
-- the nasty division-by-1 cases
|
||||
ddrem401 remainder 0.5 1 -> 0.5
|
||||
ddrem402 remainder 0.55 1 -> 0.55
|
||||
ddrem403 remainder 0.555 1 -> 0.555
|
||||
ddrem404 remainder 0.5555 1 -> 0.5555
|
||||
ddrem405 remainder 0.55555 1 -> 0.55555
|
||||
ddrem406 remainder 0.555555 1 -> 0.555555
|
||||
ddrem407 remainder 0.5555555 1 -> 0.5555555
|
||||
ddrem408 remainder 0.55555555 1 -> 0.55555555
|
||||
ddrem409 remainder 0.555555555 1 -> 0.555555555
|
||||
|
||||
-- folddowns
|
||||
ddrem421 remainder 1E+384 1 -> NaN Division_impossible
|
||||
ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped
|
||||
ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped
|
||||
ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
|
||||
ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
|
||||
ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped
|
||||
ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped
|
||||
ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
|
||||
ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
|
||||
ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
|
||||
-- tinies
|
||||
ddrem431 remainder 1E-397 1E-398 -> 0E-398
|
||||
ddrem432 remainder 1E-397 2E-398 -> 0E-398
|
||||
ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal
|
||||
ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal
|
||||
ddrem435 remainder 1E-397 5E-398 -> 0E-398
|
||||
ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal
|
||||
ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal
|
||||
ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal
|
||||
ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal
|
||||
ddrem440 remainder 1E-397 10E-398 -> 0E-398
|
||||
ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal
|
||||
ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal
|
||||
ddrem443 remainder 100E-397 20E-398 -> 0E-398
|
||||
ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal
|
||||
ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal
|
||||
|
||||
-- zero signs
|
||||
ddrem650 remainder 1 1 -> 0
|
||||
ddrem651 remainder -1 1 -> -0
|
||||
ddrem652 remainder 1 -1 -> 0
|
||||
ddrem653 remainder -1 -1 -> -0
|
||||
ddrem654 remainder 0 1 -> 0
|
||||
ddrem655 remainder -0 1 -> -0
|
||||
ddrem656 remainder 0 -1 -> 0
|
||||
ddrem657 remainder -0 -1 -> -0
|
||||
ddrem658 remainder 0.00 1 -> 0.00
|
||||
ddrem659 remainder -0.00 1 -> -0.00
|
||||
|
||||
-- Specials
|
||||
ddrem680 remainder Inf -Inf -> NaN Invalid_operation
|
||||
ddrem681 remainder Inf -1000 -> NaN Invalid_operation
|
||||
ddrem682 remainder Inf -1 -> NaN Invalid_operation
|
||||
ddrem683 remainder Inf 0 -> NaN Invalid_operation
|
||||
ddrem684 remainder Inf -0 -> NaN Invalid_operation
|
||||
ddrem685 remainder Inf 1 -> NaN Invalid_operation
|
||||
ddrem686 remainder Inf 1000 -> NaN Invalid_operation
|
||||
ddrem687 remainder Inf Inf -> NaN Invalid_operation
|
||||
ddrem688 remainder -1000 Inf -> -1000
|
||||
ddrem689 remainder -Inf Inf -> NaN Invalid_operation
|
||||
ddrem691 remainder -1 Inf -> -1
|
||||
ddrem692 remainder 0 Inf -> 0
|
||||
ddrem693 remainder -0 Inf -> -0
|
||||
ddrem694 remainder 1 Inf -> 1
|
||||
ddrem695 remainder 1000 Inf -> 1000
|
||||
ddrem696 remainder Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddrem700 remainder -Inf -Inf -> NaN Invalid_operation
|
||||
ddrem701 remainder -Inf -1000 -> NaN Invalid_operation
|
||||
ddrem702 remainder -Inf -1 -> NaN Invalid_operation
|
||||
ddrem703 remainder -Inf -0 -> NaN Invalid_operation
|
||||
ddrem704 remainder -Inf 0 -> NaN Invalid_operation
|
||||
ddrem705 remainder -Inf 1 -> NaN Invalid_operation
|
||||
ddrem706 remainder -Inf 1000 -> NaN Invalid_operation
|
||||
ddrem707 remainder -Inf Inf -> NaN Invalid_operation
|
||||
ddrem708 remainder -Inf -Inf -> NaN Invalid_operation
|
||||
ddrem709 remainder -1000 Inf -> -1000
|
||||
ddrem710 remainder -1 -Inf -> -1
|
||||
ddrem711 remainder -0 -Inf -> -0
|
||||
ddrem712 remainder 0 -Inf -> 0
|
||||
ddrem713 remainder 1 -Inf -> 1
|
||||
ddrem714 remainder 1000 -Inf -> 1000
|
||||
ddrem715 remainder Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddrem721 remainder NaN -Inf -> NaN
|
||||
ddrem722 remainder NaN -1000 -> NaN
|
||||
ddrem723 remainder NaN -1 -> NaN
|
||||
ddrem724 remainder NaN -0 -> NaN
|
||||
ddrem725 remainder -NaN 0 -> -NaN
|
||||
ddrem726 remainder NaN 1 -> NaN
|
||||
ddrem727 remainder NaN 1000 -> NaN
|
||||
ddrem728 remainder NaN Inf -> NaN
|
||||
ddrem729 remainder NaN -NaN -> NaN
|
||||
ddrem730 remainder -Inf NaN -> NaN
|
||||
ddrem731 remainder -1000 NaN -> NaN
|
||||
ddrem732 remainder -1 NaN -> NaN
|
||||
ddrem733 remainder -0 -NaN -> -NaN
|
||||
ddrem734 remainder 0 NaN -> NaN
|
||||
ddrem735 remainder 1 -NaN -> -NaN
|
||||
ddrem736 remainder 1000 NaN -> NaN
|
||||
ddrem737 remainder Inf NaN -> NaN
|
||||
|
||||
ddrem741 remainder sNaN -Inf -> NaN Invalid_operation
|
||||
ddrem742 remainder sNaN -1000 -> NaN Invalid_operation
|
||||
ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation
|
||||
ddrem744 remainder sNaN -0 -> NaN Invalid_operation
|
||||
ddrem745 remainder sNaN 0 -> NaN Invalid_operation
|
||||
ddrem746 remainder sNaN 1 -> NaN Invalid_operation
|
||||
ddrem747 remainder sNaN 1000 -> NaN Invalid_operation
|
||||
ddrem749 remainder sNaN NaN -> NaN Invalid_operation
|
||||
ddrem750 remainder sNaN sNaN -> NaN Invalid_operation
|
||||
ddrem751 remainder NaN sNaN -> NaN Invalid_operation
|
||||
ddrem752 remainder -Inf sNaN -> NaN Invalid_operation
|
||||
ddrem753 remainder -1000 sNaN -> NaN Invalid_operation
|
||||
ddrem754 remainder -1 sNaN -> NaN Invalid_operation
|
||||
ddrem755 remainder -0 sNaN -> NaN Invalid_operation
|
||||
ddrem756 remainder 0 sNaN -> NaN Invalid_operation
|
||||
ddrem757 remainder 1 sNaN -> NaN Invalid_operation
|
||||
ddrem758 remainder 1000 sNaN -> NaN Invalid_operation
|
||||
ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- propaging NaNs
|
||||
ddrem760 remainder NaN1 NaN7 -> NaN1
|
||||
ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
|
||||
ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
|
||||
ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
|
||||
ddrem764 remainder 15 NaN11 -> NaN11
|
||||
ddrem765 remainder NaN6 NaN12 -> NaN6
|
||||
ddrem766 remainder Inf NaN13 -> NaN13
|
||||
ddrem767 remainder NaN14 -Inf -> NaN14
|
||||
ddrem768 remainder 0 NaN15 -> NaN15
|
||||
ddrem769 remainder NaN16 -0 -> NaN16
|
||||
|
||||
-- edge cases of impossible
|
||||
ddrem770 remainder 1234567890123456 10 -> 6
|
||||
ddrem771 remainder 1234567890123456 1 -> 0
|
||||
ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible
|
||||
ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible
|
||||
|
||||
-- long operand checks
|
||||
ddrem801 remainder 12345678000 100 -> 0
|
||||
ddrem802 remainder 1 12345678000 -> 1
|
||||
ddrem803 remainder 1234567800 10 -> 0
|
||||
ddrem804 remainder 1 1234567800 -> 1
|
||||
ddrem805 remainder 1234567890 10 -> 0
|
||||
ddrem806 remainder 1 1234567890 -> 1
|
||||
ddrem807 remainder 1234567891 10 -> 1
|
||||
ddrem808 remainder 1 1234567891 -> 1
|
||||
ddrem809 remainder 12345678901 100 -> 1
|
||||
ddrem810 remainder 1 12345678901 -> 1
|
||||
ddrem811 remainder 1234567896 10 -> 6
|
||||
ddrem812 remainder 1 1234567896 -> 1
|
||||
|
||||
ddrem821 remainder 12345678000 100 -> 0
|
||||
ddrem822 remainder 1 12345678000 -> 1
|
||||
ddrem823 remainder 1234567800 10 -> 0
|
||||
ddrem824 remainder 1 1234567800 -> 1
|
||||
ddrem825 remainder 1234567890 10 -> 0
|
||||
ddrem826 remainder 1 1234567890 -> 1
|
||||
ddrem827 remainder 1234567891 10 -> 1
|
||||
ddrem828 remainder 1 1234567891 -> 1
|
||||
ddrem829 remainder 12345678901 100 -> 1
|
||||
ddrem830 remainder 1 12345678901 -> 1
|
||||
ddrem831 remainder 1234567896 10 -> 6
|
||||
ddrem832 remainder 1 1234567896 -> 1
|
||||
|
||||
-- from divideint
|
||||
ddrem840 remainder 100000000.0 1 -> 0.0
|
||||
ddrem841 remainder 100000000.4 1 -> 0.4
|
||||
ddrem842 remainder 100000000.5 1 -> 0.5
|
||||
ddrem843 remainder 100000000.9 1 -> 0.9
|
||||
ddrem844 remainder 100000000.999 1 -> 0.999
|
||||
ddrem850 remainder 100000003 5 -> 3
|
||||
ddrem851 remainder 10000003 5 -> 3
|
||||
ddrem852 remainder 1000003 5 -> 3
|
||||
ddrem853 remainder 100003 5 -> 3
|
||||
ddrem854 remainder 10003 5 -> 3
|
||||
ddrem855 remainder 1003 5 -> 3
|
||||
ddrem856 remainder 103 5 -> 3
|
||||
ddrem857 remainder 13 5 -> 3
|
||||
ddrem858 remainder 1 5 -> 1
|
||||
|
||||
-- Vladimir's cases 1234567890123456
|
||||
ddrem860 remainder 123.0e1 1000000000000000 -> 1230
|
||||
ddrem861 remainder 1230 1000000000000000 -> 1230
|
||||
ddrem862 remainder 12.3e2 1000000000000000 -> 1230
|
||||
ddrem863 remainder 1.23e3 1000000000000000 -> 1230
|
||||
ddrem864 remainder 123e1 1000000000000000 -> 1230
|
||||
ddrem870 remainder 123e1 1000000000000000 -> 1230
|
||||
ddrem871 remainder 123e1 100000000000000 -> 1230
|
||||
ddrem872 remainder 123e1 10000000000000 -> 1230
|
||||
ddrem873 remainder 123e1 1000000000000 -> 1230
|
||||
ddrem874 remainder 123e1 100000000000 -> 1230
|
||||
ddrem875 remainder 123e1 10000000000 -> 1230
|
||||
ddrem876 remainder 123e1 1000000000 -> 1230
|
||||
ddrem877 remainder 123e1 100000000 -> 1230
|
||||
ddrem878 remainder 1230 100000000 -> 1230
|
||||
ddrem879 remainder 123e1 10000000 -> 1230
|
||||
ddrem880 remainder 123e1 1000000 -> 1230
|
||||
ddrem881 remainder 123e1 100000 -> 1230
|
||||
ddrem882 remainder 123e1 10000 -> 1230
|
||||
ddrem883 remainder 123e1 1000 -> 230
|
||||
ddrem884 remainder 123e1 100 -> 30
|
||||
ddrem885 remainder 123e1 10 -> 0
|
||||
ddrem886 remainder 123e1 1 -> 0
|
||||
|
||||
ddrem890 remainder 123e1 2000000000000000 -> 1230
|
||||
ddrem891 remainder 123e1 200000000000000 -> 1230
|
||||
ddrem892 remainder 123e1 20000000000000 -> 1230
|
||||
ddrem893 remainder 123e1 2000000000000 -> 1230
|
||||
ddrem894 remainder 123e1 200000000000 -> 1230
|
||||
ddrem895 remainder 123e1 20000000000 -> 1230
|
||||
ddrem896 remainder 123e1 2000000000 -> 1230
|
||||
ddrem897 remainder 123e1 200000000 -> 1230
|
||||
ddrem899 remainder 123e1 20000000 -> 1230
|
||||
ddrem900 remainder 123e1 2000000 -> 1230
|
||||
ddrem901 remainder 123e1 200000 -> 1230
|
||||
ddrem902 remainder 123e1 20000 -> 1230
|
||||
ddrem903 remainder 123e1 2000 -> 1230
|
||||
ddrem904 remainder 123e1 200 -> 30
|
||||
ddrem905 remainder 123e1 20 -> 10
|
||||
ddrem906 remainder 123e1 2 -> 0
|
||||
|
||||
ddrem910 remainder 123e1 5000000000000000 -> 1230
|
||||
ddrem911 remainder 123e1 500000000000000 -> 1230
|
||||
ddrem912 remainder 123e1 50000000000000 -> 1230
|
||||
ddrem913 remainder 123e1 5000000000000 -> 1230
|
||||
ddrem914 remainder 123e1 500000000000 -> 1230
|
||||
ddrem915 remainder 123e1 50000000000 -> 1230
|
||||
ddrem916 remainder 123e1 5000000000 -> 1230
|
||||
ddrem917 remainder 123e1 500000000 -> 1230
|
||||
ddrem919 remainder 123e1 50000000 -> 1230
|
||||
ddrem920 remainder 123e1 5000000 -> 1230
|
||||
ddrem921 remainder 123e1 500000 -> 1230
|
||||
ddrem922 remainder 123e1 50000 -> 1230
|
||||
ddrem923 remainder 123e1 5000 -> 1230
|
||||
ddrem924 remainder 123e1 500 -> 230
|
||||
ddrem925 remainder 123e1 50 -> 30
|
||||
ddrem926 remainder 123e1 5 -> 0
|
||||
|
||||
ddrem930 remainder 123e1 9000000000000000 -> 1230
|
||||
ddrem931 remainder 123e1 900000000000000 -> 1230
|
||||
ddrem932 remainder 123e1 90000000000000 -> 1230
|
||||
ddrem933 remainder 123e1 9000000000000 -> 1230
|
||||
ddrem934 remainder 123e1 900000000000 -> 1230
|
||||
ddrem935 remainder 123e1 90000000000 -> 1230
|
||||
ddrem936 remainder 123e1 9000000000 -> 1230
|
||||
ddrem937 remainder 123e1 900000000 -> 1230
|
||||
ddrem939 remainder 123e1 90000000 -> 1230
|
||||
ddrem940 remainder 123e1 9000000 -> 1230
|
||||
ddrem941 remainder 123e1 900000 -> 1230
|
||||
ddrem942 remainder 123e1 90000 -> 1230
|
||||
ddrem943 remainder 123e1 9000 -> 1230
|
||||
ddrem944 remainder 123e1 900 -> 330
|
||||
ddrem945 remainder 123e1 90 -> 60
|
||||
ddrem946 remainder 123e1 9 -> 6
|
||||
|
||||
ddrem950 remainder 123e1 1000000000000000 -> 1230
|
||||
ddrem961 remainder 123e1 2999999999999999 -> 1230
|
||||
ddrem962 remainder 123e1 3999999999999999 -> 1230
|
||||
ddrem963 remainder 123e1 4999999999999999 -> 1230
|
||||
ddrem964 remainder 123e1 5999999999999999 -> 1230
|
||||
ddrem965 remainder 123e1 6999999999999999 -> 1230
|
||||
ddrem966 remainder 123e1 7999999999999999 -> 1230
|
||||
ddrem967 remainder 123e1 8999999999999999 -> 1230
|
||||
ddrem968 remainder 123e1 9999999999999999 -> 1230
|
||||
ddrem969 remainder 123e1 9876543210987654 -> 1230
|
||||
|
||||
ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
|
||||
|
||||
-- overflow and underflow tests [from divide]
|
||||
ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
|
||||
ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
|
||||
ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
|
||||
ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
|
||||
ddrem1055 remainder 1e-277 1e+311 -> 1E-277
|
||||
ddrem1056 remainder 1e-277 -1e+311 -> 1E-277
|
||||
ddrem1057 remainder -1e-277 1e+311 -> -1E-277
|
||||
ddrem1058 remainder -1e-277 -1e+311 -> -1E-277
|
||||
|
||||
-- Null tests
|
||||
ddrem1000 remainder 10 # -> NaN Invalid_operation
|
||||
ddrem1001 remainder # 10 -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,615 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddRemainderNear.decTest -- decDouble remainder-near --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- sanity checks (as base, above)
|
||||
ddrmn001 remaindernear 1 1 -> 0
|
||||
ddrmn002 remaindernear 2 1 -> 0
|
||||
ddrmn003 remaindernear 1 2 -> 1
|
||||
ddrmn004 remaindernear 2 2 -> 0
|
||||
ddrmn005 remaindernear 0 1 -> 0
|
||||
ddrmn006 remaindernear 0 2 -> 0
|
||||
ddrmn007 remaindernear 1 3 -> 1
|
||||
ddrmn008 remaindernear 2 3 -> -1
|
||||
ddrmn009 remaindernear 3 3 -> 0
|
||||
|
||||
ddrmn010 remaindernear 2.4 1 -> 0.4
|
||||
ddrmn011 remaindernear 2.4 -1 -> 0.4
|
||||
ddrmn012 remaindernear -2.4 1 -> -0.4
|
||||
ddrmn013 remaindernear -2.4 -1 -> -0.4
|
||||
ddrmn014 remaindernear 2.40 1 -> 0.40
|
||||
ddrmn015 remaindernear 2.400 1 -> 0.400
|
||||
ddrmn016 remaindernear 2.4 2 -> 0.4
|
||||
ddrmn017 remaindernear 2.400 2 -> 0.400
|
||||
ddrmn018 remaindernear 2. 2 -> 0
|
||||
ddrmn019 remaindernear 20 20 -> 0
|
||||
|
||||
ddrmn020 remaindernear 187 187 -> 0
|
||||
ddrmn021 remaindernear 5 2 -> 1
|
||||
ddrmn022 remaindernear 5 2.0 -> 1.0
|
||||
ddrmn023 remaindernear 5 2.000 -> 1.000
|
||||
ddrmn024 remaindernear 5 0.200 -> 0.000
|
||||
ddrmn025 remaindernear 5 0.200 -> 0.000
|
||||
|
||||
ddrmn030 remaindernear 1 2 -> 1
|
||||
ddrmn031 remaindernear 1 4 -> 1
|
||||
ddrmn032 remaindernear 1 8 -> 1
|
||||
|
||||
ddrmn033 remaindernear 1 16 -> 1
|
||||
ddrmn034 remaindernear 1 32 -> 1
|
||||
ddrmn035 remaindernear 1 64 -> 1
|
||||
ddrmn040 remaindernear 1 -2 -> 1
|
||||
ddrmn041 remaindernear 1 -4 -> 1
|
||||
ddrmn042 remaindernear 1 -8 -> 1
|
||||
ddrmn043 remaindernear 1 -16 -> 1
|
||||
ddrmn044 remaindernear 1 -32 -> 1
|
||||
ddrmn045 remaindernear 1 -64 -> 1
|
||||
ddrmn050 remaindernear -1 2 -> -1
|
||||
ddrmn051 remaindernear -1 4 -> -1
|
||||
ddrmn052 remaindernear -1 8 -> -1
|
||||
ddrmn053 remaindernear -1 16 -> -1
|
||||
ddrmn054 remaindernear -1 32 -> -1
|
||||
ddrmn055 remaindernear -1 64 -> -1
|
||||
ddrmn060 remaindernear -1 -2 -> -1
|
||||
ddrmn061 remaindernear -1 -4 -> -1
|
||||
ddrmn062 remaindernear -1 -8 -> -1
|
||||
ddrmn063 remaindernear -1 -16 -> -1
|
||||
ddrmn064 remaindernear -1 -32 -> -1
|
||||
ddrmn065 remaindernear -1 -64 -> -1
|
||||
|
||||
ddrmn066 remaindernear 9.9 1 -> -0.1
|
||||
ddrmn067 remaindernear 99.7 1 -> -0.3
|
||||
ddrmn068 remaindernear 999999999 1 -> 0
|
||||
ddrmn069 remaindernear 999999999.4 1 -> 0.4
|
||||
ddrmn070 remaindernear 999999999.5 1 -> -0.5
|
||||
ddrmn071 remaindernear 999999999.9 1 -> -0.1
|
||||
ddrmn072 remaindernear 999999999.999 1 -> -0.001
|
||||
ddrmn073 remaindernear 999999.999999 1 -> -0.000001
|
||||
ddrmn074 remaindernear 9 1 -> 0
|
||||
ddrmn075 remaindernear 9999999999999999 1 -> 0
|
||||
ddrmn076 remaindernear 9999999999999999 2 -> -1
|
||||
ddrmn077 remaindernear 9999999999999999 3 -> 0
|
||||
ddrmn078 remaindernear 9999999999999999 4 -> -1
|
||||
|
||||
ddrmn080 remaindernear 0. 1 -> 0
|
||||
ddrmn081 remaindernear .0 1 -> 0.0
|
||||
ddrmn082 remaindernear 0.00 1 -> 0.00
|
||||
ddrmn083 remaindernear 0.00E+9 1 -> 0
|
||||
ddrmn084 remaindernear 0.00E+3 1 -> 0
|
||||
ddrmn085 remaindernear 0.00E+2 1 -> 0
|
||||
ddrmn086 remaindernear 0.00E+1 1 -> 0.0
|
||||
ddrmn087 remaindernear 0.00E+0 1 -> 0.00
|
||||
ddrmn088 remaindernear 0.00E-0 1 -> 0.00
|
||||
ddrmn089 remaindernear 0.00E-1 1 -> 0.000
|
||||
ddrmn090 remaindernear 0.00E-2 1 -> 0.0000
|
||||
ddrmn091 remaindernear 0.00E-3 1 -> 0.00000
|
||||
ddrmn092 remaindernear 0.00E-4 1 -> 0.000000
|
||||
ddrmn093 remaindernear 0.00E-5 1 -> 0E-7
|
||||
ddrmn094 remaindernear 0.00E-6 1 -> 0E-8
|
||||
ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54
|
||||
|
||||
-- Various flavours of remaindernear by 0
|
||||
ddrmn101 remaindernear 0 0 -> NaN Division_undefined
|
||||
ddrmn102 remaindernear 0 -0 -> NaN Division_undefined
|
||||
ddrmn103 remaindernear -0 0 -> NaN Division_undefined
|
||||
ddrmn104 remaindernear -0 -0 -> NaN Division_undefined
|
||||
ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
|
||||
ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined
|
||||
-- [Some think this next group should be Division_by_zero exception, but
|
||||
-- IEEE 854 is explicit that it is Invalid operation .. for
|
||||
-- remainder-near, anyway]
|
||||
ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
|
||||
ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
|
||||
ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
|
||||
ddrmn110 remaindernear 1 0 -> NaN Invalid_operation
|
||||
ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
|
||||
ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
|
||||
ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
|
||||
ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
|
||||
ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
|
||||
ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
|
||||
ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
|
||||
ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation
|
||||
ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
|
||||
ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
|
||||
ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
|
||||
ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
|
||||
-- and zeros on left
|
||||
ddrmn130 remaindernear 0 1 -> 0
|
||||
ddrmn131 remaindernear 0 -1 -> 0
|
||||
ddrmn132 remaindernear 0.0 1 -> 0.0
|
||||
ddrmn133 remaindernear 0.0 -1 -> 0.0
|
||||
ddrmn134 remaindernear -0 1 -> -0
|
||||
ddrmn135 remaindernear -0 -1 -> -0
|
||||
ddrmn136 remaindernear -0.0 1 -> -0.0
|
||||
ddrmn137 remaindernear -0.0 -1 -> -0.0
|
||||
|
||||
-- 0.5ers
|
||||
ddrmn143 remaindernear 0.5 2 -> 0.5
|
||||
ddrmn144 remaindernear 0.5 2.1 -> 0.5
|
||||
ddrmn145 remaindernear 0.5 2.01 -> 0.50
|
||||
ddrmn146 remaindernear 0.5 2.001 -> 0.500
|
||||
ddrmn147 remaindernear 0.50 2 -> 0.50
|
||||
ddrmn148 remaindernear 0.50 2.01 -> 0.50
|
||||
ddrmn149 remaindernear 0.50 2.001 -> 0.500
|
||||
|
||||
-- steadies
|
||||
ddrmn150 remaindernear 1 1 -> 0
|
||||
ddrmn151 remaindernear 1 2 -> 1
|
||||
ddrmn152 remaindernear 1 3 -> 1
|
||||
ddrmn153 remaindernear 1 4 -> 1
|
||||
ddrmn154 remaindernear 1 5 -> 1
|
||||
ddrmn155 remaindernear 1 6 -> 1
|
||||
ddrmn156 remaindernear 1 7 -> 1
|
||||
ddrmn157 remaindernear 1 8 -> 1
|
||||
ddrmn158 remaindernear 1 9 -> 1
|
||||
ddrmn159 remaindernear 1 10 -> 1
|
||||
ddrmn160 remaindernear 1 1 -> 0
|
||||
ddrmn161 remaindernear 2 1 -> 0
|
||||
ddrmn162 remaindernear 3 1 -> 0
|
||||
ddrmn163 remaindernear 4 1 -> 0
|
||||
ddrmn164 remaindernear 5 1 -> 0
|
||||
ddrmn165 remaindernear 6 1 -> 0
|
||||
ddrmn166 remaindernear 7 1 -> 0
|
||||
ddrmn167 remaindernear 8 1 -> 0
|
||||
ddrmn168 remaindernear 9 1 -> 0
|
||||
ddrmn169 remaindernear 10 1 -> 0
|
||||
|
||||
-- some differences from remainder
|
||||
ddrmn171 remaindernear 0.4 1.020 -> 0.400
|
||||
ddrmn172 remaindernear 0.50 1.020 -> 0.500
|
||||
ddrmn173 remaindernear 0.51 1.020 -> 0.510
|
||||
ddrmn174 remaindernear 0.52 1.020 -> -0.500
|
||||
ddrmn175 remaindernear 0.6 1.020 -> -0.420
|
||||
|
||||
-- More flavours of remaindernear by 0
|
||||
ddrmn201 remaindernear 0 0 -> NaN Division_undefined
|
||||
ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
|
||||
ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined
|
||||
ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
|
||||
ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
|
||||
ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
|
||||
ddrmn207 remaindernear 1 0 -> NaN Invalid_operation
|
||||
ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
|
||||
ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
|
||||
ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
|
||||
ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
|
||||
|
||||
-- tests from the extended specification
|
||||
ddrmn221 remaindernear 2.1 3 -> -0.9
|
||||
ddrmn222 remaindernear 10 6 -> -2
|
||||
ddrmn223 remaindernear 10 3 -> 1
|
||||
ddrmn224 remaindernear -10 3 -> -1
|
||||
ddrmn225 remaindernear 10.2 1 -> 0.2
|
||||
ddrmn226 remaindernear 10 0.3 -> 0.1
|
||||
ddrmn227 remaindernear 3.6 1.3 -> -0.3
|
||||
|
||||
-- some differences from remainder
|
||||
ddrmn231 remaindernear -0.4 1.020 -> -0.400
|
||||
ddrmn232 remaindernear -0.50 1.020 -> -0.500
|
||||
ddrmn233 remaindernear -0.51 1.020 -> -0.510
|
||||
ddrmn234 remaindernear -0.52 1.020 -> 0.500
|
||||
ddrmn235 remaindernear -0.6 1.020 -> 0.420
|
||||
|
||||
-- high Xs
|
||||
ddrmn240 remaindernear 1E+2 1.00 -> 0.00
|
||||
|
||||
-- ddrmn3xx are from DiagBigDecimal
|
||||
ddrmn301 remaindernear 1 3 -> 1
|
||||
ddrmn302 remaindernear 5 5 -> 0
|
||||
ddrmn303 remaindernear 13 10 -> 3
|
||||
ddrmn304 remaindernear 13 50 -> 13
|
||||
ddrmn305 remaindernear 13 100 -> 13
|
||||
ddrmn306 remaindernear 13 1000 -> 13
|
||||
ddrmn307 remaindernear .13 1 -> 0.13
|
||||
ddrmn308 remaindernear 0.133 1 -> 0.133
|
||||
ddrmn309 remaindernear 0.1033 1 -> 0.1033
|
||||
ddrmn310 remaindernear 1.033 1 -> 0.033
|
||||
ddrmn311 remaindernear 10.33 1 -> 0.33
|
||||
ddrmn312 remaindernear 10.33 10 -> 0.33
|
||||
ddrmn313 remaindernear 103.3 1 -> 0.3
|
||||
ddrmn314 remaindernear 133 10 -> 3
|
||||
ddrmn315 remaindernear 1033 10 -> 3
|
||||
ddrmn316 remaindernear 1033 50 -> -17
|
||||
ddrmn317 remaindernear 101.0 3 -> -1.0
|
||||
ddrmn318 remaindernear 102.0 3 -> 0.0
|
||||
ddrmn319 remaindernear 103.0 3 -> 1.0
|
||||
ddrmn320 remaindernear 2.40 1 -> 0.40
|
||||
ddrmn321 remaindernear 2.400 1 -> 0.400
|
||||
ddrmn322 remaindernear 2.4 1 -> 0.4
|
||||
ddrmn323 remaindernear 2.4 2 -> 0.4
|
||||
ddrmn324 remaindernear 2.400 2 -> 0.400
|
||||
ddrmn325 remaindernear 1 0.3 -> 0.1
|
||||
ddrmn326 remaindernear 1 0.30 -> 0.10
|
||||
ddrmn327 remaindernear 1 0.300 -> 0.100
|
||||
ddrmn328 remaindernear 1 0.3000 -> 0.1000
|
||||
ddrmn329 remaindernear 1.0 0.3 -> 0.1
|
||||
ddrmn330 remaindernear 1.00 0.3 -> 0.10
|
||||
ddrmn331 remaindernear 1.000 0.3 -> 0.100
|
||||
ddrmn332 remaindernear 1.0000 0.3 -> 0.1000
|
||||
ddrmn333 remaindernear 0.5 2 -> 0.5
|
||||
ddrmn334 remaindernear 0.5 2.1 -> 0.5
|
||||
ddrmn335 remaindernear 0.5 2.01 -> 0.50
|
||||
ddrmn336 remaindernear 0.5 2.001 -> 0.500
|
||||
ddrmn337 remaindernear 0.50 2 -> 0.50
|
||||
ddrmn338 remaindernear 0.50 2.01 -> 0.50
|
||||
ddrmn339 remaindernear 0.50 2.001 -> 0.500
|
||||
|
||||
ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7
|
||||
ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8
|
||||
ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9
|
||||
ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
|
||||
ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
|
||||
ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7
|
||||
ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8
|
||||
ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9
|
||||
ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
|
||||
ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
|
||||
ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
|
||||
|
||||
ddrmn351 remaindernear 0.03 7 -> 0.03
|
||||
ddrmn352 remaindernear 5 2 -> 1
|
||||
ddrmn353 remaindernear 4.1 2 -> 0.1
|
||||
ddrmn354 remaindernear 4.01 2 -> 0.01
|
||||
ddrmn355 remaindernear 4.001 2 -> 0.001
|
||||
ddrmn356 remaindernear 4.0001 2 -> 0.0001
|
||||
ddrmn357 remaindernear 4.00001 2 -> 0.00001
|
||||
ddrmn358 remaindernear 4.000001 2 -> 0.000001
|
||||
ddrmn359 remaindernear 4.0000001 2 -> 1E-7
|
||||
|
||||
ddrmn360 remaindernear 1.2 0.7345 -> -0.2690
|
||||
ddrmn361 remaindernear 0.8 12 -> 0.8
|
||||
ddrmn362 remaindernear 0.8 0.2 -> 0.0
|
||||
ddrmn363 remaindernear 0.8 0.3 -> -0.1
|
||||
ddrmn364 remaindernear 0.800 12 -> 0.800
|
||||
ddrmn365 remaindernear 0.800 1.7 -> 0.800
|
||||
ddrmn366 remaindernear 2.400 2 -> 0.400
|
||||
|
||||
-- round to even
|
||||
ddrmn371 remaindernear 121 2 -> 1
|
||||
ddrmn372 remaindernear 122 2 -> 0
|
||||
ddrmn373 remaindernear 123 2 -> -1
|
||||
ddrmn374 remaindernear 124 2 -> 0
|
||||
ddrmn375 remaindernear 125 2 -> 1
|
||||
ddrmn376 remaindernear 126 2 -> 0
|
||||
ddrmn377 remaindernear 127 2 -> -1
|
||||
|
||||
ddrmn381 remaindernear 12345 1 -> 0
|
||||
ddrmn382 remaindernear 12345 1.0001 -> -0.2344
|
||||
ddrmn383 remaindernear 12345 1.001 -> -0.333
|
||||
ddrmn384 remaindernear 12345 1.01 -> -0.23
|
||||
ddrmn385 remaindernear 12345 1.1 -> -0.3
|
||||
ddrmn386 remaindernear 12355 4 -> -1
|
||||
ddrmn387 remaindernear 12345 4 -> 1
|
||||
ddrmn388 remaindernear 12355 4.0001 -> -1.3089
|
||||
ddrmn389 remaindernear 12345 4.0001 -> 0.6914
|
||||
ddrmn390 remaindernear 12345 4.9 -> 1.9
|
||||
ddrmn391 remaindernear 12345 4.99 -> -0.26
|
||||
ddrmn392 remaindernear 12345 4.999 -> 2.469
|
||||
ddrmn393 remaindernear 12345 4.9999 -> 0.2469
|
||||
ddrmn394 remaindernear 12345 5 -> 0
|
||||
ddrmn395 remaindernear 12345 5.0001 -> -0.2469
|
||||
ddrmn396 remaindernear 12345 5.001 -> -2.469
|
||||
ddrmn397 remaindernear 12345 5.01 -> 0.36
|
||||
ddrmn398 remaindernear 12345 5.1 -> -2.1
|
||||
|
||||
-- the nasty division-by-1 cases
|
||||
ddrmn401 remaindernear 0.4 1 -> 0.4
|
||||
ddrmn402 remaindernear 0.45 1 -> 0.45
|
||||
ddrmn403 remaindernear 0.455 1 -> 0.455
|
||||
ddrmn404 remaindernear 0.4555 1 -> 0.4555
|
||||
ddrmn405 remaindernear 0.45555 1 -> 0.45555
|
||||
ddrmn406 remaindernear 0.455555 1 -> 0.455555
|
||||
ddrmn407 remaindernear 0.4555555 1 -> 0.4555555
|
||||
ddrmn408 remaindernear 0.45555555 1 -> 0.45555555
|
||||
ddrmn409 remaindernear 0.455555555 1 -> 0.455555555
|
||||
-- with spill... [412 exercises sticktab loop]
|
||||
ddrmn411 remaindernear 0.5 1 -> 0.5
|
||||
ddrmn412 remaindernear 0.55 1 -> -0.45
|
||||
ddrmn413 remaindernear 0.555 1 -> -0.445
|
||||
ddrmn414 remaindernear 0.5555 1 -> -0.4445
|
||||
ddrmn415 remaindernear 0.55555 1 -> -0.44445
|
||||
ddrmn416 remaindernear 0.555555 1 -> -0.444445
|
||||
ddrmn417 remaindernear 0.5555555 1 -> -0.4444445
|
||||
ddrmn418 remaindernear 0.55555555 1 -> -0.44444445
|
||||
ddrmn419 remaindernear 0.555555555 1 -> -0.444444445
|
||||
|
||||
-- folddowns
|
||||
ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible
|
||||
ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped
|
||||
ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped
|
||||
ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
|
||||
ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
|
||||
ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped
|
||||
ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped
|
||||
ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
|
||||
ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
|
||||
ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
|
||||
-- tinies
|
||||
ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398
|
||||
ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398
|
||||
ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal
|
||||
ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal
|
||||
ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398
|
||||
ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal
|
||||
ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal
|
||||
ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal
|
||||
ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal
|
||||
ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398
|
||||
ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal
|
||||
ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal
|
||||
ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398
|
||||
ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal
|
||||
ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal
|
||||
|
||||
-- zero signs
|
||||
ddrmn650 remaindernear 1 1 -> 0
|
||||
ddrmn651 remaindernear -1 1 -> -0
|
||||
ddrmn652 remaindernear 1 -1 -> 0
|
||||
ddrmn653 remaindernear -1 -1 -> -0
|
||||
ddrmn654 remaindernear 0 1 -> 0
|
||||
ddrmn655 remaindernear -0 1 -> -0
|
||||
ddrmn656 remaindernear 0 -1 -> 0
|
||||
ddrmn657 remaindernear -0 -1 -> -0
|
||||
ddrmn658 remaindernear 0.00 1 -> 0.00
|
||||
ddrmn659 remaindernear -0.00 1 -> -0.00
|
||||
|
||||
-- Specials
|
||||
ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
|
||||
ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
|
||||
ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation
|
||||
ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation
|
||||
ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation
|
||||
ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation
|
||||
ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
|
||||
ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation
|
||||
ddrmn688 remaindernear -1000 Inf -> -1000
|
||||
ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
|
||||
ddrmn691 remaindernear -1 Inf -> -1
|
||||
ddrmn692 remaindernear 0 Inf -> 0
|
||||
ddrmn693 remaindernear -0 Inf -> -0
|
||||
ddrmn694 remaindernear 1 Inf -> 1
|
||||
ddrmn695 remaindernear 1000 Inf -> 1000
|
||||
ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
|
||||
ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
|
||||
ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
|
||||
ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
|
||||
ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
|
||||
ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
|
||||
ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
|
||||
ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
|
||||
ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
|
||||
ddrmn709 remaindernear -1000 Inf -> -1000
|
||||
ddrmn710 remaindernear -1 -Inf -> -1
|
||||
ddrmn711 remaindernear -0 -Inf -> -0
|
||||
ddrmn712 remaindernear 0 -Inf -> 0
|
||||
ddrmn713 remaindernear 1 -Inf -> 1
|
||||
ddrmn714 remaindernear 1000 -Inf -> 1000
|
||||
ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddrmn721 remaindernear NaN -Inf -> NaN
|
||||
ddrmn722 remaindernear NaN -1000 -> NaN
|
||||
ddrmn723 remaindernear NaN -1 -> NaN
|
||||
ddrmn724 remaindernear NaN -0 -> NaN
|
||||
ddrmn725 remaindernear -NaN 0 -> -NaN
|
||||
ddrmn726 remaindernear NaN 1 -> NaN
|
||||
ddrmn727 remaindernear NaN 1000 -> NaN
|
||||
ddrmn728 remaindernear NaN Inf -> NaN
|
||||
ddrmn729 remaindernear NaN -NaN -> NaN
|
||||
ddrmn730 remaindernear -Inf NaN -> NaN
|
||||
ddrmn731 remaindernear -1000 NaN -> NaN
|
||||
ddrmn732 remaindernear -1 NaN -> NaN
|
||||
ddrmn733 remaindernear -0 -NaN -> -NaN
|
||||
ddrmn734 remaindernear 0 NaN -> NaN
|
||||
ddrmn735 remaindernear 1 -NaN -> -NaN
|
||||
ddrmn736 remaindernear 1000 NaN -> NaN
|
||||
ddrmn737 remaindernear Inf NaN -> NaN
|
||||
|
||||
ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
|
||||
ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
|
||||
ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
|
||||
ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
|
||||
ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
|
||||
ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
|
||||
ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
|
||||
ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
|
||||
ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
|
||||
ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
|
||||
ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
|
||||
ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
|
||||
ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
|
||||
ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
|
||||
ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
|
||||
ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
|
||||
ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
|
||||
ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- propaging NaNs
|
||||
ddrmn760 remaindernear NaN1 NaN7 -> NaN1
|
||||
ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
|
||||
ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
|
||||
ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
|
||||
ddrmn764 remaindernear 15 NaN11 -> NaN11
|
||||
ddrmn765 remaindernear NaN6 NaN12 -> NaN6
|
||||
ddrmn766 remaindernear Inf NaN13 -> NaN13
|
||||
ddrmn767 remaindernear NaN14 -Inf -> NaN14
|
||||
ddrmn768 remaindernear 0 NaN15 -> NaN15
|
||||
ddrmn769 remaindernear NaN16 -0 -> NaN16
|
||||
|
||||
-- edge cases of impossible
|
||||
ddrmn770 remaindernear 1234567890123456 10 -> -4
|
||||
ddrmn771 remaindernear 1234567890123456 1 -> 0
|
||||
ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible
|
||||
ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible
|
||||
|
||||
-- long operand checks
|
||||
ddrmn801 remaindernear 12345678000 100 -> 0
|
||||
ddrmn802 remaindernear 1 12345678000 -> 1
|
||||
ddrmn803 remaindernear 1234567800 10 -> 0
|
||||
ddrmn804 remaindernear 1 1234567800 -> 1
|
||||
ddrmn805 remaindernear 1234567890 10 -> 0
|
||||
ddrmn806 remaindernear 1 1234567890 -> 1
|
||||
ddrmn807 remaindernear 1234567891 10 -> 1
|
||||
ddrmn808 remaindernear 1 1234567891 -> 1
|
||||
ddrmn809 remaindernear 12345678901 100 -> 1
|
||||
ddrmn810 remaindernear 1 12345678901 -> 1
|
||||
ddrmn811 remaindernear 1234567896 10 -> -4
|
||||
ddrmn812 remaindernear 1 1234567896 -> 1
|
||||
|
||||
ddrmn821 remaindernear 12345678000 100 -> 0
|
||||
ddrmn822 remaindernear 1 12345678000 -> 1
|
||||
ddrmn823 remaindernear 1234567800 10 -> 0
|
||||
ddrmn824 remaindernear 1 1234567800 -> 1
|
||||
ddrmn825 remaindernear 1234567890 10 -> 0
|
||||
ddrmn826 remaindernear 1 1234567890 -> 1
|
||||
ddrmn827 remaindernear 1234567891 10 -> 1
|
||||
ddrmn828 remaindernear 1 1234567891 -> 1
|
||||
ddrmn829 remaindernear 12345678901 100 -> 1
|
||||
ddrmn830 remaindernear 1 12345678901 -> 1
|
||||
ddrmn831 remaindernear 1234567896 10 -> -4
|
||||
ddrmn832 remaindernear 1 1234567896 -> 1
|
||||
|
||||
-- from divideint
|
||||
ddrmn840 remaindernear 100000000.0 1 -> 0.0
|
||||
ddrmn841 remaindernear 100000000.4 1 -> 0.4
|
||||
ddrmn842 remaindernear 100000000.5 1 -> 0.5
|
||||
ddrmn843 remaindernear 100000000.9 1 -> -0.1
|
||||
ddrmn844 remaindernear 100000000.999 1 -> -0.001
|
||||
ddrmn850 remaindernear 100000003 5 -> -2
|
||||
ddrmn851 remaindernear 10000003 5 -> -2
|
||||
ddrmn852 remaindernear 1000003 5 -> -2
|
||||
ddrmn853 remaindernear 100003 5 -> -2
|
||||
ddrmn854 remaindernear 10003 5 -> -2
|
||||
ddrmn855 remaindernear 1003 5 -> -2
|
||||
ddrmn856 remaindernear 103 5 -> -2
|
||||
ddrmn857 remaindernear 13 5 -> -2
|
||||
ddrmn858 remaindernear 1 5 -> 1
|
||||
|
||||
-- Vladimir's cases 1234567890123456
|
||||
ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
|
||||
ddrmn861 remaindernear 1230 1000000000000000 -> 1230
|
||||
ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
|
||||
ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
|
||||
ddrmn864 remaindernear 123e1 1000000000000000 -> 1230
|
||||
ddrmn870 remaindernear 123e1 1000000000000000 -> 1230
|
||||
ddrmn871 remaindernear 123e1 100000000000000 -> 1230
|
||||
ddrmn872 remaindernear 123e1 10000000000000 -> 1230
|
||||
ddrmn873 remaindernear 123e1 1000000000000 -> 1230
|
||||
ddrmn874 remaindernear 123e1 100000000000 -> 1230
|
||||
ddrmn875 remaindernear 123e1 10000000000 -> 1230
|
||||
ddrmn876 remaindernear 123e1 1000000000 -> 1230
|
||||
ddrmn877 remaindernear 123e1 100000000 -> 1230
|
||||
ddrmn878 remaindernear 1230 100000000 -> 1230
|
||||
ddrmn879 remaindernear 123e1 10000000 -> 1230
|
||||
ddrmn880 remaindernear 123e1 1000000 -> 1230
|
||||
ddrmn881 remaindernear 123e1 100000 -> 1230
|
||||
ddrmn882 remaindernear 123e1 10000 -> 1230
|
||||
ddrmn883 remaindernear 123e1 1000 -> 230
|
||||
ddrmn884 remaindernear 123e1 100 -> 30
|
||||
ddrmn885 remaindernear 123e1 10 -> 0
|
||||
ddrmn886 remaindernear 123e1 1 -> 0
|
||||
|
||||
ddrmn890 remaindernear 123e1 2000000000000000 -> 1230
|
||||
ddrmn891 remaindernear 123e1 200000000000000 -> 1230
|
||||
ddrmn892 remaindernear 123e1 20000000000000 -> 1230
|
||||
ddrmn893 remaindernear 123e1 2000000000000 -> 1230
|
||||
ddrmn894 remaindernear 123e1 200000000000 -> 1230
|
||||
ddrmn895 remaindernear 123e1 20000000000 -> 1230
|
||||
ddrmn896 remaindernear 123e1 2000000000 -> 1230
|
||||
ddrmn897 remaindernear 123e1 200000000 -> 1230
|
||||
ddrmn899 remaindernear 123e1 20000000 -> 1230
|
||||
ddrmn900 remaindernear 123e1 2000000 -> 1230
|
||||
ddrmn901 remaindernear 123e1 200000 -> 1230
|
||||
ddrmn902 remaindernear 123e1 20000 -> 1230
|
||||
ddrmn903 remaindernear 123e1 2000 -> -770
|
||||
ddrmn904 remaindernear 123e1 200 -> 30
|
||||
ddrmn905 remaindernear 123e1 20 -> -10
|
||||
ddrmn906 remaindernear 123e1 2 -> 0
|
||||
|
||||
ddrmn910 remaindernear 123e1 5000000000000000 -> 1230
|
||||
ddrmn911 remaindernear 123e1 500000000000000 -> 1230
|
||||
ddrmn912 remaindernear 123e1 50000000000000 -> 1230
|
||||
ddrmn913 remaindernear 123e1 5000000000000 -> 1230
|
||||
ddrmn914 remaindernear 123e1 500000000000 -> 1230
|
||||
ddrmn915 remaindernear 123e1 50000000000 -> 1230
|
||||
ddrmn916 remaindernear 123e1 5000000000 -> 1230
|
||||
ddrmn917 remaindernear 123e1 500000000 -> 1230
|
||||
ddrmn919 remaindernear 123e1 50000000 -> 1230
|
||||
ddrmn920 remaindernear 123e1 5000000 -> 1230
|
||||
ddrmn921 remaindernear 123e1 500000 -> 1230
|
||||
ddrmn922 remaindernear 123e1 50000 -> 1230
|
||||
ddrmn923 remaindernear 123e1 5000 -> 1230
|
||||
ddrmn924 remaindernear 123e1 500 -> 230
|
||||
ddrmn925 remaindernear 123e1 50 -> -20
|
||||
ddrmn926 remaindernear 123e1 5 -> 0
|
||||
|
||||
ddrmn930 remaindernear 123e1 9000000000000000 -> 1230
|
||||
ddrmn931 remaindernear 123e1 900000000000000 -> 1230
|
||||
ddrmn932 remaindernear 123e1 90000000000000 -> 1230
|
||||
ddrmn933 remaindernear 123e1 9000000000000 -> 1230
|
||||
ddrmn934 remaindernear 123e1 900000000000 -> 1230
|
||||
ddrmn935 remaindernear 123e1 90000000000 -> 1230
|
||||
ddrmn936 remaindernear 123e1 9000000000 -> 1230
|
||||
ddrmn937 remaindernear 123e1 900000000 -> 1230
|
||||
ddrmn939 remaindernear 123e1 90000000 -> 1230
|
||||
ddrmn940 remaindernear 123e1 9000000 -> 1230
|
||||
ddrmn941 remaindernear 123e1 900000 -> 1230
|
||||
ddrmn942 remaindernear 123e1 90000 -> 1230
|
||||
ddrmn943 remaindernear 123e1 9000 -> 1230
|
||||
ddrmn944 remaindernear 123e1 900 -> 330
|
||||
ddrmn945 remaindernear 123e1 90 -> -30
|
||||
ddrmn946 remaindernear 123e1 9 -> -3
|
||||
|
||||
ddrmn950 remaindernear 123e1 1000000000000000 -> 1230
|
||||
ddrmn961 remaindernear 123e1 2999999999999999 -> 1230
|
||||
ddrmn962 remaindernear 123e1 3999999999999999 -> 1230
|
||||
ddrmn963 remaindernear 123e1 4999999999999999 -> 1230
|
||||
ddrmn964 remaindernear 123e1 5999999999999999 -> 1230
|
||||
ddrmn965 remaindernear 123e1 6999999999999999 -> 1230
|
||||
ddrmn966 remaindernear 123e1 7999999999999999 -> 1230
|
||||
ddrmn967 remaindernear 123e1 8999999999999999 -> 1230
|
||||
ddrmn968 remaindernear 123e1 9999999999999999 -> 1230
|
||||
ddrmn969 remaindernear 123e1 9876543210987654 -> 1230
|
||||
|
||||
ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
|
||||
|
||||
-- overflow and underflow tests [from divide]
|
||||
ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
|
||||
ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
|
||||
ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
|
||||
ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
|
||||
ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
|
||||
ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
|
||||
ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
|
||||
ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
|
||||
|
||||
-- Null tests
|
||||
ddrmn1000 remaindernear 10 # -> NaN Invalid_operation
|
||||
ddrmn1001 remaindernear # 10 -> NaN Invalid_operation
|
||||
|
|
@ -0,0 +1,262 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddRotate.decTest -- rotate a decDouble coefficient left or right --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddrot001 rotate 0 0 -> 0
|
||||
ddrot002 rotate 0 2 -> 0
|
||||
ddrot003 rotate 1 2 -> 100
|
||||
ddrot004 rotate 1 15 -> 1000000000000000
|
||||
ddrot005 rotate 1 16 -> 1
|
||||
ddrot006 rotate 1 -1 -> 1000000000000000
|
||||
ddrot007 rotate 0 -2 -> 0
|
||||
ddrot008 rotate 1234567890123456 -1 -> 6123456789012345
|
||||
ddrot009 rotate 1234567890123456 -15 -> 2345678901234561
|
||||
ddrot010 rotate 1234567890123456 -16 -> 1234567890123456
|
||||
ddrot011 rotate 9934567890123456 -15 -> 9345678901234569
|
||||
ddrot012 rotate 9934567890123456 -16 -> 9934567890123456
|
||||
|
||||
-- rhs must be an integer
|
||||
ddrot015 rotate 1 1.5 -> NaN Invalid_operation
|
||||
ddrot016 rotate 1 1.0 -> NaN Invalid_operation
|
||||
ddrot017 rotate 1 0.1 -> NaN Invalid_operation
|
||||
ddrot018 rotate 1 0.0 -> NaN Invalid_operation
|
||||
ddrot019 rotate 1 1E+1 -> NaN Invalid_operation
|
||||
ddrot020 rotate 1 1E+99 -> NaN Invalid_operation
|
||||
ddrot021 rotate 1 Inf -> NaN Invalid_operation
|
||||
ddrot022 rotate 1 -Inf -> NaN Invalid_operation
|
||||
-- and |rhs| <= precision
|
||||
ddrot025 rotate 1 -1000 -> NaN Invalid_operation
|
||||
ddrot026 rotate 1 -17 -> NaN Invalid_operation
|
||||
ddrot027 rotate 1 17 -> NaN Invalid_operation
|
||||
ddrot028 rotate 1 1000 -> NaN Invalid_operation
|
||||
|
||||
-- full pattern
|
||||
ddrot030 rotate 1234567890123456 -16 -> 1234567890123456
|
||||
ddrot031 rotate 1234567890123456 -15 -> 2345678901234561
|
||||
ddrot032 rotate 1234567890123456 -14 -> 3456789012345612
|
||||
ddrot033 rotate 1234567890123456 -13 -> 4567890123456123
|
||||
ddrot034 rotate 1234567890123456 -12 -> 5678901234561234
|
||||
ddrot035 rotate 1234567890123456 -11 -> 6789012345612345
|
||||
ddrot036 rotate 1234567890123456 -10 -> 7890123456123456
|
||||
ddrot037 rotate 1234567890123456 -9 -> 8901234561234567
|
||||
ddrot038 rotate 1234567890123456 -8 -> 9012345612345678
|
||||
ddrot039 rotate 1234567890123456 -7 -> 123456123456789
|
||||
ddrot040 rotate 1234567890123456 -6 -> 1234561234567890
|
||||
ddrot041 rotate 1234567890123456 -5 -> 2345612345678901
|
||||
ddrot042 rotate 1234567890123456 -4 -> 3456123456789012
|
||||
ddrot043 rotate 1234567890123456 -3 -> 4561234567890123
|
||||
ddrot044 rotate 1234567890123456 -2 -> 5612345678901234
|
||||
ddrot045 rotate 1234567890123456 -1 -> 6123456789012345
|
||||
ddrot046 rotate 1234567890123456 -0 -> 1234567890123456
|
||||
|
||||
ddrot047 rotate 1234567890123456 +0 -> 1234567890123456
|
||||
ddrot048 rotate 1234567890123456 +1 -> 2345678901234561
|
||||
ddrot049 rotate 1234567890123456 +2 -> 3456789012345612
|
||||
ddrot050 rotate 1234567890123456 +3 -> 4567890123456123
|
||||
ddrot051 rotate 1234567890123456 +4 -> 5678901234561234
|
||||
ddrot052 rotate 1234567890123456 +5 -> 6789012345612345
|
||||
ddrot053 rotate 1234567890123456 +6 -> 7890123456123456
|
||||
ddrot054 rotate 1234567890123456 +7 -> 8901234561234567
|
||||
ddrot055 rotate 1234567890123456 +8 -> 9012345612345678
|
||||
ddrot056 rotate 1234567890123456 +9 -> 123456123456789
|
||||
ddrot057 rotate 1234567890123456 +10 -> 1234561234567890
|
||||
ddrot058 rotate 1234567890123456 +11 -> 2345612345678901
|
||||
ddrot059 rotate 1234567890123456 +12 -> 3456123456789012
|
||||
ddrot060 rotate 1234567890123456 +13 -> 4561234567890123
|
||||
ddrot061 rotate 1234567890123456 +14 -> 5612345678901234
|
||||
ddrot062 rotate 1234567890123456 +15 -> 6123456789012345
|
||||
ddrot063 rotate 1234567890123456 +16 -> 1234567890123456
|
||||
|
||||
-- zeros
|
||||
ddrot070 rotate 0E-10 +9 -> 0E-10
|
||||
ddrot071 rotate 0E-10 -9 -> 0E-10
|
||||
ddrot072 rotate 0.000 +9 -> 0.000
|
||||
ddrot073 rotate 0.000 -9 -> 0.000
|
||||
ddrot074 rotate 0E+10 +9 -> 0E+10
|
||||
ddrot075 rotate 0E+10 -9 -> 0E+10
|
||||
ddrot076 rotate -0E-10 +9 -> -0E-10
|
||||
ddrot077 rotate -0E-10 -9 -> -0E-10
|
||||
ddrot078 rotate -0.000 +9 -> -0.000
|
||||
ddrot079 rotate -0.000 -9 -> -0.000
|
||||
ddrot080 rotate -0E+10 +9 -> -0E+10
|
||||
ddrot081 rotate -0E+10 -9 -> -0E+10
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384
|
||||
ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384
|
||||
ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384
|
||||
ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384
|
||||
ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368
|
||||
ddrot146 rotate 1E-383 -15 -> 1.0E-382
|
||||
ddrot147 rotate 1E-383 1 -> 1.0E-382
|
||||
ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368
|
||||
ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384
|
||||
ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398
|
||||
ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398
|
||||
ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384
|
||||
ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384
|
||||
ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398
|
||||
ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398
|
||||
ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384
|
||||
ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383
|
||||
ddrot161 rotate 1E-398 -15 -> 1.0E-397
|
||||
ddrot162 rotate 1E-398 1 -> 1.0E-397
|
||||
ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383
|
||||
-- negatives
|
||||
ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384
|
||||
ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384
|
||||
ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384
|
||||
ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384
|
||||
ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368
|
||||
ddrot176 rotate -1E-383 -15 -> -1.0E-382
|
||||
ddrot177 rotate -1E-383 1 -> -1.0E-382
|
||||
ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368
|
||||
ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384
|
||||
ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398
|
||||
ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398
|
||||
ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384
|
||||
ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384
|
||||
ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398
|
||||
ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398
|
||||
ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384
|
||||
ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383
|
||||
ddrot191 rotate -1E-398 -15 -> -1.0E-397
|
||||
ddrot192 rotate -1E-398 1 -> -1.0E-397
|
||||
ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383
|
||||
|
||||
-- more negatives (of sanities)
|
||||
ddrot201 rotate -0 0 -> -0
|
||||
ddrot202 rotate -0 2 -> -0
|
||||
ddrot203 rotate -1 2 -> -100
|
||||
ddrot204 rotate -1 15 -> -1000000000000000
|
||||
ddrot205 rotate -1 16 -> -1
|
||||
ddrot206 rotate -1 -1 -> -1000000000000000
|
||||
ddrot207 rotate -0 -2 -> -0
|
||||
ddrot208 rotate -1234567890123456 -1 -> -6123456789012345
|
||||
ddrot209 rotate -1234567890123456 -15 -> -2345678901234561
|
||||
ddrot210 rotate -1234567890123456 -16 -> -1234567890123456
|
||||
ddrot211 rotate -9934567890123456 -15 -> -9345678901234569
|
||||
ddrot212 rotate -9934567890123456 -16 -> -9934567890123456
|
||||
|
||||
|
||||
-- Specials; NaNs are handled as usual
|
||||
ddrot781 rotate -Inf -8 -> -Infinity
|
||||
ddrot782 rotate -Inf -1 -> -Infinity
|
||||
ddrot783 rotate -Inf -0 -> -Infinity
|
||||
ddrot784 rotate -Inf 0 -> -Infinity
|
||||
ddrot785 rotate -Inf 1 -> -Infinity
|
||||
ddrot786 rotate -Inf 8 -> -Infinity
|
||||
ddrot787 rotate -1000 -Inf -> NaN Invalid_operation
|
||||
ddrot788 rotate -Inf -Inf -> NaN Invalid_operation
|
||||
ddrot789 rotate -1 -Inf -> NaN Invalid_operation
|
||||
ddrot790 rotate -0 -Inf -> NaN Invalid_operation
|
||||
ddrot791 rotate 0 -Inf -> NaN Invalid_operation
|
||||
ddrot792 rotate 1 -Inf -> NaN Invalid_operation
|
||||
ddrot793 rotate 1000 -Inf -> NaN Invalid_operation
|
||||
ddrot794 rotate Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddrot800 rotate Inf -Inf -> NaN Invalid_operation
|
||||
ddrot801 rotate Inf -8 -> Infinity
|
||||
ddrot802 rotate Inf -1 -> Infinity
|
||||
ddrot803 rotate Inf -0 -> Infinity
|
||||
ddrot804 rotate Inf 0 -> Infinity
|
||||
ddrot805 rotate Inf 1 -> Infinity
|
||||
ddrot806 rotate Inf 8 -> Infinity
|
||||
ddrot807 rotate Inf Inf -> NaN Invalid_operation
|
||||
ddrot808 rotate -1000 Inf -> NaN Invalid_operation
|
||||
ddrot809 rotate -Inf Inf -> NaN Invalid_operation
|
||||
ddrot810 rotate -1 Inf -> NaN Invalid_operation
|
||||
ddrot811 rotate -0 Inf -> NaN Invalid_operation
|
||||
ddrot812 rotate 0 Inf -> NaN Invalid_operation
|
||||
ddrot813 rotate 1 Inf -> NaN Invalid_operation
|
||||
ddrot814 rotate 1000 Inf -> NaN Invalid_operation
|
||||
ddrot815 rotate Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddrot821 rotate NaN -Inf -> NaN
|
||||
ddrot822 rotate NaN -1000 -> NaN
|
||||
ddrot823 rotate NaN -1 -> NaN
|
||||
ddrot824 rotate NaN -0 -> NaN
|
||||
ddrot825 rotate NaN 0 -> NaN
|
||||
ddrot826 rotate NaN 1 -> NaN
|
||||
ddrot827 rotate NaN 1000 -> NaN
|
||||
ddrot828 rotate NaN Inf -> NaN
|
||||
ddrot829 rotate NaN NaN -> NaN
|
||||
ddrot830 rotate -Inf NaN -> NaN
|
||||
ddrot831 rotate -1000 NaN -> NaN
|
||||
ddrot832 rotate -1 NaN -> NaN
|
||||
ddrot833 rotate -0 NaN -> NaN
|
||||
ddrot834 rotate 0 NaN -> NaN
|
||||
ddrot835 rotate 1 NaN -> NaN
|
||||
ddrot836 rotate 1000 NaN -> NaN
|
||||
ddrot837 rotate Inf NaN -> NaN
|
||||
|
||||
ddrot841 rotate sNaN -Inf -> NaN Invalid_operation
|
||||
ddrot842 rotate sNaN -1000 -> NaN Invalid_operation
|
||||
ddrot843 rotate sNaN -1 -> NaN Invalid_operation
|
||||
ddrot844 rotate sNaN -0 -> NaN Invalid_operation
|
||||
ddrot845 rotate sNaN 0 -> NaN Invalid_operation
|
||||
ddrot846 rotate sNaN 1 -> NaN Invalid_operation
|
||||
ddrot847 rotate sNaN 1000 -> NaN Invalid_operation
|
||||
ddrot848 rotate sNaN NaN -> NaN Invalid_operation
|
||||
ddrot849 rotate sNaN sNaN -> NaN Invalid_operation
|
||||
ddrot850 rotate NaN sNaN -> NaN Invalid_operation
|
||||
ddrot851 rotate -Inf sNaN -> NaN Invalid_operation
|
||||
ddrot852 rotate -1000 sNaN -> NaN Invalid_operation
|
||||
ddrot853 rotate -1 sNaN -> NaN Invalid_operation
|
||||
ddrot854 rotate -0 sNaN -> NaN Invalid_operation
|
||||
ddrot855 rotate 0 sNaN -> NaN Invalid_operation
|
||||
ddrot856 rotate 1 sNaN -> NaN Invalid_operation
|
||||
ddrot857 rotate 1000 sNaN -> NaN Invalid_operation
|
||||
ddrot858 rotate Inf sNaN -> NaN Invalid_operation
|
||||
ddrot859 rotate NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddrot861 rotate NaN1 -Inf -> NaN1
|
||||
ddrot862 rotate +NaN2 -1000 -> NaN2
|
||||
ddrot863 rotate NaN3 1000 -> NaN3
|
||||
ddrot864 rotate NaN4 Inf -> NaN4
|
||||
ddrot865 rotate NaN5 +NaN6 -> NaN5
|
||||
ddrot866 rotate -Inf NaN7 -> NaN7
|
||||
ddrot867 rotate -1000 NaN8 -> NaN8
|
||||
ddrot868 rotate 1000 NaN9 -> NaN9
|
||||
ddrot869 rotate Inf +NaN10 -> NaN10
|
||||
ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
|
||||
ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
|
||||
ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
|
||||
ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
|
||||
ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
|
||||
ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
|
||||
ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
|
||||
ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
|
||||
ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
|
||||
ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
|
||||
ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
|
||||
ddrot882 rotate -NaN26 NaN28 -> -NaN26
|
||||
ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
|
||||
ddrot884 rotate 1000 -NaN30 -> -NaN30
|
||||
ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
|
|
@ -0,0 +1,389 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddSameQuantum.decTest -- check decDouble quantums match --
|
||||
-- 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 --
|
||||
-- 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
|
||||
|
||||
-- All operands and results are decDoubles.
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddsamq001 samequantum 0 0 -> 1
|
||||
ddsamq002 samequantum 0 1 -> 1
|
||||
ddsamq003 samequantum 1 0 -> 1
|
||||
ddsamq004 samequantum 1 1 -> 1
|
||||
|
||||
ddsamq011 samequantum 10 1E+1 -> 0
|
||||
ddsamq012 samequantum 10E+1 10E+1 -> 1
|
||||
ddsamq013 samequantum 100 10E+1 -> 0
|
||||
ddsamq014 samequantum 100 1E+2 -> 0
|
||||
ddsamq015 samequantum 0.1 1E-2 -> 0
|
||||
ddsamq016 samequantum 0.1 1E-1 -> 1
|
||||
ddsamq017 samequantum 0.1 1E-0 -> 0
|
||||
ddsamq018 samequantum 999 999 -> 1
|
||||
ddsamq019 samequantum 999E-1 99.9 -> 1
|
||||
ddsamq020 samequantum 111E-1 22.2 -> 1
|
||||
ddsamq021 samequantum 111E-1 1234.2 -> 1
|
||||
|
||||
-- zeros
|
||||
ddsamq030 samequantum 0.0 1.1 -> 1
|
||||
ddsamq031 samequantum 0.0 1.11 -> 0
|
||||
ddsamq032 samequantum 0.0 0 -> 0
|
||||
ddsamq033 samequantum 0.0 0.0 -> 1
|
||||
ddsamq034 samequantum 0.0 0.00 -> 0
|
||||
ddsamq035 samequantum 0E+1 0E+0 -> 0
|
||||
ddsamq036 samequantum 0E+1 0E+1 -> 1
|
||||
ddsamq037 samequantum 0E+1 0E+2 -> 0
|
||||
ddsamq038 samequantum 0E-17 0E-16 -> 0
|
||||
ddsamq039 samequantum 0E-17 0E-17 -> 1
|
||||
ddsamq040 samequantum 0E-17 0E-18 -> 0
|
||||
ddsamq041 samequantum 0E-17 0.0E-15 -> 0
|
||||
ddsamq042 samequantum 0E-17 0.0E-16 -> 1
|
||||
ddsamq043 samequantum 0E-17 0.0E-17 -> 0
|
||||
ddsamq044 samequantum -0E-17 0.0E-16 -> 1
|
||||
ddsamq045 samequantum 0E-17 -0.0E-17 -> 0
|
||||
ddsamq046 samequantum 0E-17 -0.0E-16 -> 1
|
||||
ddsamq047 samequantum -0E-17 0.0E-17 -> 0
|
||||
ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
|
||||
ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
|
||||
ddsamq052 samequantum 1E-383 1E-383 -> 1
|
||||
ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
|
||||
ddsamq054 samequantum 1E-398 1E-398 -> 1
|
||||
ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
|
||||
ddsamq056 samequantum 1E-383 1E-383 -> 1
|
||||
ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
|
||||
ddsamq058 samequantum 1E-398 1E-398 -> 1
|
||||
|
||||
ddsamq061 samequantum -1E-398 -1E-398 -> 1
|
||||
ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
|
||||
ddsamq063 samequantum -1E-383 -1E-383 -> 1
|
||||
ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
|
||||
ddsamq065 samequantum -1E-398 -1E-398 -> 1
|
||||
ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
|
||||
ddsamq067 samequantum -1E-383 -1E-383 -> 1
|
||||
ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
|
||||
|
||||
ddsamq071 samequantum -4E-398 -1E-398 -> 1
|
||||
ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1
|
||||
ddsamq073 samequantum -4E-383 -1E-383 -> 1
|
||||
ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1
|
||||
ddsamq075 samequantum -4E-398 -1E-398 -> 1
|
||||
ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1
|
||||
ddsamq077 samequantum -4E-383 -1E-383 -> 1
|
||||
ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1
|
||||
|
||||
ddsamq081 samequantum -4E-397 -1E-398 -> 0
|
||||
ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0
|
||||
ddsamq083 samequantum -4E-346 -1E-383 -> 0
|
||||
ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0
|
||||
ddsamq085 samequantum -4E-397 -1E-398 -> 0
|
||||
ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0
|
||||
ddsamq087 samequantum -4E-346 -1E-383 -> 0
|
||||
ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0
|
||||
|
||||
-- specials & combinations
|
||||
ddsamq0110 samequantum -Inf -Inf -> 1
|
||||
ddsamq0111 samequantum -Inf Inf -> 1
|
||||
ddsamq0112 samequantum -Inf NaN -> 0
|
||||
ddsamq0113 samequantum -Inf -7E+3 -> 0
|
||||
ddsamq0114 samequantum -Inf -7 -> 0
|
||||
ddsamq0115 samequantum -Inf -7E-3 -> 0
|
||||
ddsamq0116 samequantum -Inf -0E-3 -> 0
|
||||
ddsamq0117 samequantum -Inf -0 -> 0
|
||||
ddsamq0118 samequantum -Inf -0E+3 -> 0
|
||||
ddsamq0119 samequantum -Inf 0E-3 -> 0
|
||||
ddsamq0120 samequantum -Inf 0 -> 0
|
||||
ddsamq0121 samequantum -Inf 0E+3 -> 0
|
||||
ddsamq0122 samequantum -Inf 7E-3 -> 0
|
||||
ddsamq0123 samequantum -Inf 7 -> 0
|
||||
ddsamq0124 samequantum -Inf 7E+3 -> 0
|
||||
ddsamq0125 samequantum -Inf sNaN -> 0
|
||||
|
||||
ddsamq0210 samequantum Inf -Inf -> 1
|
||||
ddsamq0211 samequantum Inf Inf -> 1
|
||||
ddsamq0212 samequantum Inf NaN -> 0
|
||||
ddsamq0213 samequantum Inf -7E+3 -> 0
|
||||
ddsamq0214 samequantum Inf -7 -> 0
|
||||
ddsamq0215 samequantum Inf -7E-3 -> 0
|
||||
ddsamq0216 samequantum Inf -0E-3 -> 0
|
||||
ddsamq0217 samequantum Inf -0 -> 0
|
||||
ddsamq0218 samequantum Inf -0E+3 -> 0
|
||||
ddsamq0219 samequantum Inf 0E-3 -> 0
|
||||
ddsamq0220 samequantum Inf 0 -> 0
|
||||
ddsamq0221 samequantum Inf 0E+3 -> 0
|
||||
ddsamq0222 samequantum Inf 7E-3 -> 0
|
||||
ddsamq0223 samequantum Inf 7 -> 0
|
||||
ddsamq0224 samequantum Inf 7E+3 -> 0
|
||||
ddsamq0225 samequantum Inf sNaN -> 0
|
||||
|
||||
ddsamq0310 samequantum NaN -Inf -> 0
|
||||
ddsamq0311 samequantum NaN Inf -> 0
|
||||
ddsamq0312 samequantum NaN NaN -> 1
|
||||
ddsamq0313 samequantum NaN -7E+3 -> 0
|
||||
ddsamq0314 samequantum NaN -7 -> 0
|
||||
ddsamq0315 samequantum NaN -7E-3 -> 0
|
||||
ddsamq0316 samequantum NaN -0E-3 -> 0
|
||||
ddsamq0317 samequantum NaN -0 -> 0
|
||||
ddsamq0318 samequantum NaN -0E+3 -> 0
|
||||
ddsamq0319 samequantum NaN 0E-3 -> 0
|
||||
ddsamq0320 samequantum NaN 0 -> 0
|
||||
ddsamq0321 samequantum NaN 0E+3 -> 0
|
||||
ddsamq0322 samequantum NaN 7E-3 -> 0
|
||||
ddsamq0323 samequantum NaN 7 -> 0
|
||||
ddsamq0324 samequantum NaN 7E+3 -> 0
|
||||
ddsamq0325 samequantum NaN sNaN -> 1
|
||||
|
||||
ddsamq0410 samequantum -7E+3 -Inf -> 0
|
||||
ddsamq0411 samequantum -7E+3 Inf -> 0
|
||||
ddsamq0412 samequantum -7E+3 NaN -> 0
|
||||
ddsamq0413 samequantum -7E+3 -7E+3 -> 1
|
||||
ddsamq0414 samequantum -7E+3 -7 -> 0
|
||||
ddsamq0415 samequantum -7E+3 -7E-3 -> 0
|
||||
ddsamq0416 samequantum -7E+3 -0E-3 -> 0
|
||||
ddsamq0417 samequantum -7E+3 -0 -> 0
|
||||
ddsamq0418 samequantum -7E+3 -0E+3 -> 1
|
||||
ddsamq0419 samequantum -7E+3 0E-3 -> 0
|
||||
ddsamq0420 samequantum -7E+3 0 -> 0
|
||||
ddsamq0421 samequantum -7E+3 0E+3 -> 1
|
||||
ddsamq0422 samequantum -7E+3 7E-3 -> 0
|
||||
ddsamq0423 samequantum -7E+3 7 -> 0
|
||||
ddsamq0424 samequantum -7E+3 7E+3 -> 1
|
||||
ddsamq0425 samequantum -7E+3 sNaN -> 0
|
||||
|
||||
ddsamq0510 samequantum -7 -Inf -> 0
|
||||
ddsamq0511 samequantum -7 Inf -> 0
|
||||
ddsamq0512 samequantum -7 NaN -> 0
|
||||
ddsamq0513 samequantum -7 -7E+3 -> 0
|
||||
ddsamq0514 samequantum -7 -7 -> 1
|
||||
ddsamq0515 samequantum -7 -7E-3 -> 0
|
||||
ddsamq0516 samequantum -7 -0E-3 -> 0
|
||||
ddsamq0517 samequantum -7 -0 -> 1
|
||||
ddsamq0518 samequantum -7 -0E+3 -> 0
|
||||
ddsamq0519 samequantum -7 0E-3 -> 0
|
||||
ddsamq0520 samequantum -7 0 -> 1
|
||||
ddsamq0521 samequantum -7 0E+3 -> 0
|
||||
ddsamq0522 samequantum -7 7E-3 -> 0
|
||||
ddsamq0523 samequantum -7 7 -> 1
|
||||
ddsamq0524 samequantum -7 7E+3 -> 0
|
||||
ddsamq0525 samequantum -7 sNaN -> 0
|
||||
|
||||
ddsamq0610 samequantum -7E-3 -Inf -> 0
|
||||
ddsamq0611 samequantum -7E-3 Inf -> 0
|
||||
ddsamq0612 samequantum -7E-3 NaN -> 0
|
||||
ddsamq0613 samequantum -7E-3 -7E+3 -> 0
|
||||
ddsamq0614 samequantum -7E-3 -7 -> 0
|
||||
ddsamq0615 samequantum -7E-3 -7E-3 -> 1
|
||||
ddsamq0616 samequantum -7E-3 -0E-3 -> 1
|
||||
ddsamq0617 samequantum -7E-3 -0 -> 0
|
||||
ddsamq0618 samequantum -7E-3 -0E+3 -> 0
|
||||
ddsamq0619 samequantum -7E-3 0E-3 -> 1
|
||||
ddsamq0620 samequantum -7E-3 0 -> 0
|
||||
ddsamq0621 samequantum -7E-3 0E+3 -> 0
|
||||
ddsamq0622 samequantum -7E-3 7E-3 -> 1
|
||||
ddsamq0623 samequantum -7E-3 7 -> 0
|
||||
ddsamq0624 samequantum -7E-3 7E+3 -> 0
|
||||
ddsamq0625 samequantum -7E-3 sNaN -> 0
|
||||
|
||||
ddsamq0710 samequantum -0E-3 -Inf -> 0
|
||||
ddsamq0711 samequantum -0E-3 Inf -> 0
|
||||
ddsamq0712 samequantum -0E-3 NaN -> 0
|
||||
ddsamq0713 samequantum -0E-3 -7E+3 -> 0
|
||||
ddsamq0714 samequantum -0E-3 -7 -> 0
|
||||
ddsamq0715 samequantum -0E-3 -7E-3 -> 1
|
||||
ddsamq0716 samequantum -0E-3 -0E-3 -> 1
|
||||
ddsamq0717 samequantum -0E-3 -0 -> 0
|
||||
ddsamq0718 samequantum -0E-3 -0E+3 -> 0
|
||||
ddsamq0719 samequantum -0E-3 0E-3 -> 1
|
||||
ddsamq0720 samequantum -0E-3 0 -> 0
|
||||
ddsamq0721 samequantum -0E-3 0E+3 -> 0
|
||||
ddsamq0722 samequantum -0E-3 7E-3 -> 1
|
||||
ddsamq0723 samequantum -0E-3 7 -> 0
|
||||
ddsamq0724 samequantum -0E-3 7E+3 -> 0
|
||||
ddsamq0725 samequantum -0E-3 sNaN -> 0
|
||||
|
||||
ddsamq0810 samequantum -0 -Inf -> 0
|
||||
ddsamq0811 samequantum -0 Inf -> 0
|
||||
ddsamq0812 samequantum -0 NaN -> 0
|
||||
ddsamq0813 samequantum -0 -7E+3 -> 0
|
||||
ddsamq0814 samequantum -0 -7 -> 1
|
||||
ddsamq0815 samequantum -0 -7E-3 -> 0
|
||||
ddsamq0816 samequantum -0 -0E-3 -> 0
|
||||
ddsamq0817 samequantum -0 -0 -> 1
|
||||
ddsamq0818 samequantum -0 -0E+3 -> 0
|
||||
ddsamq0819 samequantum -0 0E-3 -> 0
|
||||
ddsamq0820 samequantum -0 0 -> 1
|
||||
ddsamq0821 samequantum -0 0E+3 -> 0
|
||||
ddsamq0822 samequantum -0 7E-3 -> 0
|
||||
ddsamq0823 samequantum -0 7 -> 1
|
||||
ddsamq0824 samequantum -0 7E+3 -> 0
|
||||
ddsamq0825 samequantum -0 sNaN -> 0
|
||||
|
||||
ddsamq0910 samequantum -0E+3 -Inf -> 0
|
||||
ddsamq0911 samequantum -0E+3 Inf -> 0
|
||||
ddsamq0912 samequantum -0E+3 NaN -> 0
|
||||
ddsamq0913 samequantum -0E+3 -7E+3 -> 1
|
||||
ddsamq0914 samequantum -0E+3 -7 -> 0
|
||||
ddsamq0915 samequantum -0E+3 -7E-3 -> 0
|
||||
ddsamq0916 samequantum -0E+3 -0E-3 -> 0
|
||||
ddsamq0917 samequantum -0E+3 -0 -> 0
|
||||
ddsamq0918 samequantum -0E+3 -0E+3 -> 1
|
||||
ddsamq0919 samequantum -0E+3 0E-3 -> 0
|
||||
ddsamq0920 samequantum -0E+3 0 -> 0
|
||||
ddsamq0921 samequantum -0E+3 0E+3 -> 1
|
||||
ddsamq0922 samequantum -0E+3 7E-3 -> 0
|
||||
ddsamq0923 samequantum -0E+3 7 -> 0
|
||||
ddsamq0924 samequantum -0E+3 7E+3 -> 1
|
||||
ddsamq0925 samequantum -0E+3 sNaN -> 0
|
||||
|
||||
ddsamq1110 samequantum 0E-3 -Inf -> 0
|
||||
ddsamq1111 samequantum 0E-3 Inf -> 0
|
||||
ddsamq1112 samequantum 0E-3 NaN -> 0
|
||||
ddsamq1113 samequantum 0E-3 -7E+3 -> 0
|
||||
ddsamq1114 samequantum 0E-3 -7 -> 0
|
||||
ddsamq1115 samequantum 0E-3 -7E-3 -> 1
|
||||
ddsamq1116 samequantum 0E-3 -0E-3 -> 1
|
||||
ddsamq1117 samequantum 0E-3 -0 -> 0
|
||||
ddsamq1118 samequantum 0E-3 -0E+3 -> 0
|
||||
ddsamq1119 samequantum 0E-3 0E-3 -> 1
|
||||
ddsamq1120 samequantum 0E-3 0 -> 0
|
||||
ddsamq1121 samequantum 0E-3 0E+3 -> 0
|
||||
ddsamq1122 samequantum 0E-3 7E-3 -> 1
|
||||
ddsamq1123 samequantum 0E-3 7 -> 0
|
||||
ddsamq1124 samequantum 0E-3 7E+3 -> 0
|
||||
ddsamq1125 samequantum 0E-3 sNaN -> 0
|
||||
|
||||
ddsamq1210 samequantum 0 -Inf -> 0
|
||||
ddsamq1211 samequantum 0 Inf -> 0
|
||||
ddsamq1212 samequantum 0 NaN -> 0
|
||||
ddsamq1213 samequantum 0 -7E+3 -> 0
|
||||
ddsamq1214 samequantum 0 -7 -> 1
|
||||
ddsamq1215 samequantum 0 -7E-3 -> 0
|
||||
ddsamq1216 samequantum 0 -0E-3 -> 0
|
||||
ddsamq1217 samequantum 0 -0 -> 1
|
||||
ddsamq1218 samequantum 0 -0E+3 -> 0
|
||||
ddsamq1219 samequantum 0 0E-3 -> 0
|
||||
ddsamq1220 samequantum 0 0 -> 1
|
||||
ddsamq1221 samequantum 0 0E+3 -> 0
|
||||
ddsamq1222 samequantum 0 7E-3 -> 0
|
||||
ddsamq1223 samequantum 0 7 -> 1
|
||||
ddsamq1224 samequantum 0 7E+3 -> 0
|
||||
ddsamq1225 samequantum 0 sNaN -> 0
|
||||
|
||||
ddsamq1310 samequantum 0E+3 -Inf -> 0
|
||||
ddsamq1311 samequantum 0E+3 Inf -> 0
|
||||
ddsamq1312 samequantum 0E+3 NaN -> 0
|
||||
ddsamq1313 samequantum 0E+3 -7E+3 -> 1
|
||||
ddsamq1314 samequantum 0E+3 -7 -> 0
|
||||
ddsamq1315 samequantum 0E+3 -7E-3 -> 0
|
||||
ddsamq1316 samequantum 0E+3 -0E-3 -> 0
|
||||
ddsamq1317 samequantum 0E+3 -0 -> 0
|
||||
ddsamq1318 samequantum 0E+3 -0E+3 -> 1
|
||||
ddsamq1319 samequantum 0E+3 0E-3 -> 0
|
||||
ddsamq1320 samequantum 0E+3 0 -> 0
|
||||
ddsamq1321 samequantum 0E+3 0E+3 -> 1
|
||||
ddsamq1322 samequantum 0E+3 7E-3 -> 0
|
||||
ddsamq1323 samequantum 0E+3 7 -> 0
|
||||
ddsamq1324 samequantum 0E+3 7E+3 -> 1
|
||||
ddsamq1325 samequantum 0E+3 sNaN -> 0
|
||||
|
||||
ddsamq1410 samequantum 7E-3 -Inf -> 0
|
||||
ddsamq1411 samequantum 7E-3 Inf -> 0
|
||||
ddsamq1412 samequantum 7E-3 NaN -> 0
|
||||
ddsamq1413 samequantum 7E-3 -7E+3 -> 0
|
||||
ddsamq1414 samequantum 7E-3 -7 -> 0
|
||||
ddsamq1415 samequantum 7E-3 -7E-3 -> 1
|
||||
ddsamq1416 samequantum 7E-3 -0E-3 -> 1
|
||||
ddsamq1417 samequantum 7E-3 -0 -> 0
|
||||
ddsamq1418 samequantum 7E-3 -0E+3 -> 0
|
||||
ddsamq1419 samequantum 7E-3 0E-3 -> 1
|
||||
ddsamq1420 samequantum 7E-3 0 -> 0
|
||||
ddsamq1421 samequantum 7E-3 0E+3 -> 0
|
||||
ddsamq1422 samequantum 7E-3 7E-3 -> 1
|
||||
ddsamq1423 samequantum 7E-3 7 -> 0
|
||||
ddsamq1424 samequantum 7E-3 7E+3 -> 0
|
||||
ddsamq1425 samequantum 7E-3 sNaN -> 0
|
||||
|
||||
ddsamq1510 samequantum 7 -Inf -> 0
|
||||
ddsamq1511 samequantum 7 Inf -> 0
|
||||
ddsamq1512 samequantum 7 NaN -> 0
|
||||
ddsamq1513 samequantum 7 -7E+3 -> 0
|
||||
ddsamq1514 samequantum 7 -7 -> 1
|
||||
ddsamq1515 samequantum 7 -7E-3 -> 0
|
||||
ddsamq1516 samequantum 7 -0E-3 -> 0
|
||||
ddsamq1517 samequantum 7 -0 -> 1
|
||||
ddsamq1518 samequantum 7 -0E+3 -> 0
|
||||
ddsamq1519 samequantum 7 0E-3 -> 0
|
||||
ddsamq1520 samequantum 7 0 -> 1
|
||||
ddsamq1521 samequantum 7 0E+3 -> 0
|
||||
ddsamq1522 samequantum 7 7E-3 -> 0
|
||||
ddsamq1523 samequantum 7 7 -> 1
|
||||
ddsamq1524 samequantum 7 7E+3 -> 0
|
||||
ddsamq1525 samequantum 7 sNaN -> 0
|
||||
|
||||
ddsamq1610 samequantum 7E+3 -Inf -> 0
|
||||
ddsamq1611 samequantum 7E+3 Inf -> 0
|
||||
ddsamq1612 samequantum 7E+3 NaN -> 0
|
||||
ddsamq1613 samequantum 7E+3 -7E+3 -> 1
|
||||
ddsamq1614 samequantum 7E+3 -7 -> 0
|
||||
ddsamq1615 samequantum 7E+3 -7E-3 -> 0
|
||||
ddsamq1616 samequantum 7E+3 -0E-3 -> 0
|
||||
ddsamq1617 samequantum 7E+3 -0 -> 0
|
||||
ddsamq1618 samequantum 7E+3 -0E+3 -> 1
|
||||
ddsamq1619 samequantum 7E+3 0E-3 -> 0
|
||||
ddsamq1620 samequantum 7E+3 0 -> 0
|
||||
ddsamq1621 samequantum 7E+3 0E+3 -> 1
|
||||
ddsamq1622 samequantum 7E+3 7E-3 -> 0
|
||||
ddsamq1623 samequantum 7E+3 7 -> 0
|
||||
ddsamq1624 samequantum 7E+3 7E+3 -> 1
|
||||
ddsamq1625 samequantum 7E+3 sNaN -> 0
|
||||
|
||||
ddsamq1710 samequantum sNaN -Inf -> 0
|
||||
ddsamq1711 samequantum sNaN Inf -> 0
|
||||
ddsamq1712 samequantum sNaN NaN -> 1
|
||||
ddsamq1713 samequantum sNaN -7E+3 -> 0
|
||||
ddsamq1714 samequantum sNaN -7 -> 0
|
||||
ddsamq1715 samequantum sNaN -7E-3 -> 0
|
||||
ddsamq1716 samequantum sNaN -0E-3 -> 0
|
||||
ddsamq1717 samequantum sNaN -0 -> 0
|
||||
ddsamq1718 samequantum sNaN -0E+3 -> 0
|
||||
ddsamq1719 samequantum sNaN 0E-3 -> 0
|
||||
ddsamq1720 samequantum sNaN 0 -> 0
|
||||
ddsamq1721 samequantum sNaN 0E+3 -> 0
|
||||
ddsamq1722 samequantum sNaN 7E-3 -> 0
|
||||
ddsamq1723 samequantum sNaN 7 -> 0
|
||||
ddsamq1724 samequantum sNaN 7E+3 -> 0
|
||||
ddsamq1725 samequantum sNaN sNaN -> 1
|
||||
-- noisy NaNs
|
||||
ddsamq1730 samequantum sNaN3 sNaN3 -> 1
|
||||
ddsamq1731 samequantum sNaN3 sNaN4 -> 1
|
||||
ddsamq1732 samequantum NaN3 NaN3 -> 1
|
||||
ddsamq1733 samequantum NaN3 NaN4 -> 1
|
||||
ddsamq1734 samequantum sNaN3 3 -> 0
|
||||
ddsamq1735 samequantum NaN3 3 -> 0
|
||||
ddsamq1736 samequantum 4 sNaN4 -> 0
|
||||
ddsamq1737 samequantum 3 NaN3 -> 0
|
||||
ddsamq1738 samequantum Inf sNaN4 -> 0
|
||||
ddsamq1739 samequantum -Inf NaN3 -> 0
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddScalebB.decTest -- scale a decDouble by powers of 10 --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Max |rhs| is 2*(384+16) = 800
|
||||
|
||||
-- Sanity checks
|
||||
ddscb001 scaleb 7.50 10 -> 7.50E+10
|
||||
ddscb002 scaleb 7.50 3 -> 7.50E+3
|
||||
ddscb003 scaleb 7.50 2 -> 750
|
||||
ddscb004 scaleb 7.50 1 -> 75.0
|
||||
ddscb005 scaleb 7.50 0 -> 7.50
|
||||
ddscb006 scaleb 7.50 -1 -> 0.750
|
||||
ddscb007 scaleb 7.50 -2 -> 0.0750
|
||||
ddscb008 scaleb 7.50 -10 -> 7.50E-10
|
||||
ddscb009 scaleb -7.50 3 -> -7.50E+3
|
||||
ddscb010 scaleb -7.50 2 -> -750
|
||||
ddscb011 scaleb -7.50 1 -> -75.0
|
||||
ddscb012 scaleb -7.50 0 -> -7.50
|
||||
ddscb013 scaleb -7.50 -1 -> -0.750
|
||||
|
||||
-- Infinities
|
||||
ddscb014 scaleb Infinity 1 -> Infinity
|
||||
ddscb015 scaleb -Infinity 2 -> -Infinity
|
||||
ddscb016 scaleb Infinity -1 -> Infinity
|
||||
ddscb017 scaleb -Infinity -2 -> -Infinity
|
||||
|
||||
-- Next two are somewhat undefined in 754r; treat as non-integer
|
||||
ddscb018 scaleb 10 Infinity -> NaN Invalid_operation
|
||||
ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation
|
||||
|
||||
-- NaNs are undefined in 754r; assume usual processing
|
||||
-- NaNs, 0 payload
|
||||
ddscb021 scaleb NaN 1 -> NaN
|
||||
ddscb022 scaleb -NaN -1 -> -NaN
|
||||
ddscb023 scaleb sNaN 1 -> NaN Invalid_operation
|
||||
ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
|
||||
ddscb025 scaleb 4 NaN -> NaN
|
||||
ddscb026 scaleb -Inf -NaN -> -NaN
|
||||
ddscb027 scaleb 4 sNaN -> NaN Invalid_operation
|
||||
ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- non-integer RHS
|
||||
ddscb030 scaleb 1.23 1 -> 12.3
|
||||
ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
|
||||
ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
|
||||
ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
|
||||
ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
|
||||
ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
|
||||
ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
|
||||
ddscb037 scaleb 1.23 -1 -> 0.123
|
||||
ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation
|
||||
ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
|
||||
ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
|
||||
ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
|
||||
ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
|
||||
ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
|
||||
ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
|
||||
ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
|
||||
ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
|
||||
ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
|
||||
|
||||
-- out-of range RHS
|
||||
ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded
|
||||
ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded
|
||||
ddscb122 scaleb 1.23 801 -> NaN Invalid_operation
|
||||
ddscb123 scaleb 1.23 802 -> NaN Invalid_operation
|
||||
ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation
|
||||
ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation
|
||||
|
||||
-- NaNs, non-0 payload
|
||||
-- propagating NaNs
|
||||
ddscb861 scaleb NaN01 -Inf -> NaN1
|
||||
ddscb862 scaleb -NaN02 -1000 -> -NaN2
|
||||
ddscb863 scaleb NaN03 1000 -> NaN3
|
||||
ddscb864 scaleb NaN04 Inf -> NaN4
|
||||
ddscb865 scaleb NaN05 NaN61 -> NaN5
|
||||
ddscb866 scaleb -Inf -NaN71 -> -NaN71
|
||||
ddscb867 scaleb -1000 NaN81 -> NaN81
|
||||
ddscb868 scaleb 1000 NaN91 -> NaN91
|
||||
ddscb869 scaleb Inf NaN101 -> NaN101
|
||||
ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
|
||||
ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
|
||||
ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
|
||||
ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
|
||||
ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
|
||||
ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
|
||||
ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
|
||||
ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
|
||||
ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
|
||||
ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
|
||||
ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
|
||||
|
||||
-- finites
|
||||
ddscb051 scaleb 7 -2 -> 0.07
|
||||
ddscb052 scaleb -7 -2 -> -0.07
|
||||
ddscb053 scaleb 75 -2 -> 0.75
|
||||
ddscb054 scaleb -75 -2 -> -0.75
|
||||
ddscb055 scaleb 7.50 -2 -> 0.0750
|
||||
ddscb056 scaleb -7.50 -2 -> -0.0750
|
||||
ddscb057 scaleb 7.500 -2 -> 0.07500
|
||||
ddscb058 scaleb -7.500 -2 -> -0.07500
|
||||
ddscb061 scaleb 7 -1 -> 0.7
|
||||
ddscb062 scaleb -7 -1 -> -0.7
|
||||
ddscb063 scaleb 75 -1 -> 7.5
|
||||
ddscb064 scaleb -75 -1 -> -7.5
|
||||
ddscb065 scaleb 7.50 -1 -> 0.750
|
||||
ddscb066 scaleb -7.50 -1 -> -0.750
|
||||
ddscb067 scaleb 7.500 -1 -> 0.7500
|
||||
ddscb068 scaleb -7.500 -1 -> -0.7500
|
||||
ddscb071 scaleb 7 0 -> 7
|
||||
ddscb072 scaleb -7 0 -> -7
|
||||
ddscb073 scaleb 75 0 -> 75
|
||||
ddscb074 scaleb -75 0 -> -75
|
||||
ddscb075 scaleb 7.50 0 -> 7.50
|
||||
ddscb076 scaleb -7.50 0 -> -7.50
|
||||
ddscb077 scaleb 7.500 0 -> 7.500
|
||||
ddscb078 scaleb -7.500 0 -> -7.500
|
||||
ddscb081 scaleb 7 1 -> 7E+1
|
||||
ddscb082 scaleb -7 1 -> -7E+1
|
||||
ddscb083 scaleb 75 1 -> 7.5E+2
|
||||
ddscb084 scaleb -75 1 -> -7.5E+2
|
||||
ddscb085 scaleb 7.50 1 -> 75.0
|
||||
ddscb086 scaleb -7.50 1 -> -75.0
|
||||
ddscb087 scaleb 7.500 1 -> 75.00
|
||||
ddscb088 scaleb -7.500 1 -> -75.00
|
||||
ddscb091 scaleb 7 2 -> 7E+2
|
||||
ddscb092 scaleb -7 2 -> -7E+2
|
||||
ddscb093 scaleb 75 2 -> 7.5E+3
|
||||
ddscb094 scaleb -75 2 -> -7.5E+3
|
||||
ddscb095 scaleb 7.50 2 -> 750
|
||||
ddscb096 scaleb -7.50 2 -> -750
|
||||
ddscb097 scaleb 7.500 2 -> 750.0
|
||||
ddscb098 scaleb -7.500 2 -> -750.0
|
||||
|
||||
-- zeros
|
||||
ddscb111 scaleb 0 1 -> 0E+1
|
||||
ddscb112 scaleb -0 2 -> -0E+2
|
||||
ddscb113 scaleb 0E+4 3 -> 0E+7
|
||||
ddscb114 scaleb -0E+4 4 -> -0E+8
|
||||
ddscb115 scaleb 0.0000 5 -> 0E+1
|
||||
ddscb116 scaleb -0.0000 6 -> -0E+2
|
||||
ddscb117 scaleb 0E-141 7 -> 0E-134
|
||||
ddscb118 scaleb -0E-141 8 -> -0E-133
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded
|
||||
ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded
|
||||
ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded
|
||||
ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384
|
||||
ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383
|
||||
ddscb137 scaleb 1E-383 +1 -> 1E-382
|
||||
ddscb138 scaleb 1E-383 -0 -> 1E-383
|
||||
ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal
|
||||
ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382
|
||||
ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
|
||||
ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
|
||||
ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal
|
||||
ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal
|
||||
ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
||||
ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal
|
||||
ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal
|
||||
ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382
|
||||
ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383
|
||||
ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded
|
||||
ddscb156 scaleb -1E-383 +1 -> -1E-382
|
||||
ddscb157 scaleb -1E-383 -0 -> -1E-383
|
||||
ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal
|
||||
ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded
|
||||
ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384
|
||||
ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383
|
||||
ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded
|
||||
ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded
|
||||
|
||||
-- some Origami
|
||||
-- (these check that overflow is being done correctly)
|
||||
ddscb171 scaleb 1000E+365 +1 -> 1.000E+369
|
||||
ddscb172 scaleb 1000E+366 +1 -> 1.000E+370
|
||||
ddscb173 scaleb 1000E+367 +1 -> 1.000E+371
|
||||
ddscb174 scaleb 1000E+368 +1 -> 1.000E+372
|
||||
ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped
|
||||
ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped
|
||||
ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped
|
||||
ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped
|
||||
ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped
|
||||
ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped
|
||||
ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped
|
||||
ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped
|
||||
ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped
|
||||
ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped
|
||||
ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped
|
||||
ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped
|
||||
ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded
|
||||
|
||||
-- and a few more subnormal truncations
|
||||
-- (these check that underflow is being done correctly)
|
||||
ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
|
||||
ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
|
||||
ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded
|
||||
ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded
|
||||
ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded
|
||||
ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded
|
||||
ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded
|
||||
ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded
|
||||
ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded
|
||||
ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded
|
||||
ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded
|
||||
ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded
|
||||
ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded
|
||||
ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded
|
||||
ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded
|
||||
ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded
|
||||
ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
|
||||
|
|
@ -0,0 +1,262 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddShift.decTest -- shift decDouble coefficient left or right --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check
|
||||
ddshi001 shift 0 0 -> 0
|
||||
ddshi002 shift 0 2 -> 0
|
||||
ddshi003 shift 1 2 -> 100
|
||||
ddshi004 shift 1 15 -> 1000000000000000
|
||||
ddshi005 shift 1 16 -> 0
|
||||
ddshi006 shift 1 -1 -> 0
|
||||
ddshi007 shift 0 -2 -> 0
|
||||
ddshi008 shift 1234567890123456 -1 -> 123456789012345
|
||||
ddshi009 shift 1234567890123456 -15 -> 1
|
||||
ddshi010 shift 1234567890123456 -16 -> 0
|
||||
ddshi011 shift 9934567890123456 -15 -> 9
|
||||
ddshi012 shift 9934567890123456 -16 -> 0
|
||||
|
||||
-- rhs must be an integer
|
||||
ddshi015 shift 1 1.5 -> NaN Invalid_operation
|
||||
ddshi016 shift 1 1.0 -> NaN Invalid_operation
|
||||
ddshi017 shift 1 0.1 -> NaN Invalid_operation
|
||||
ddshi018 shift 1 0.0 -> NaN Invalid_operation
|
||||
ddshi019 shift 1 1E+1 -> NaN Invalid_operation
|
||||
ddshi020 shift 1 1E+99 -> NaN Invalid_operation
|
||||
ddshi021 shift 1 Inf -> NaN Invalid_operation
|
||||
ddshi022 shift 1 -Inf -> NaN Invalid_operation
|
||||
-- and |rhs| <= precision
|
||||
ddshi025 shift 1 -1000 -> NaN Invalid_operation
|
||||
ddshi026 shift 1 -17 -> NaN Invalid_operation
|
||||
ddshi027 shift 1 17 -> NaN Invalid_operation
|
||||
ddshi028 shift 1 1000 -> NaN Invalid_operation
|
||||
|
||||
-- full shifting pattern
|
||||
ddshi030 shift 1234567890123456 -16 -> 0
|
||||
ddshi031 shift 1234567890123456 -15 -> 1
|
||||
ddshi032 shift 1234567890123456 -14 -> 12
|
||||
ddshi033 shift 1234567890123456 -13 -> 123
|
||||
ddshi034 shift 1234567890123456 -12 -> 1234
|
||||
ddshi035 shift 1234567890123456 -11 -> 12345
|
||||
ddshi036 shift 1234567890123456 -10 -> 123456
|
||||
ddshi037 shift 1234567890123456 -9 -> 1234567
|
||||
ddshi038 shift 1234567890123456 -8 -> 12345678
|
||||
ddshi039 shift 1234567890123456 -7 -> 123456789
|
||||
ddshi040 shift 1234567890123456 -6 -> 1234567890
|
||||
ddshi041 shift 1234567890123456 -5 -> 12345678901
|
||||
ddshi042 shift 1234567890123456 -4 -> 123456789012
|
||||
ddshi043 shift 1234567890123456 -3 -> 1234567890123
|
||||
ddshi044 shift 1234567890123456 -2 -> 12345678901234
|
||||
ddshi045 shift 1234567890123456 -1 -> 123456789012345
|
||||
ddshi046 shift 1234567890123456 -0 -> 1234567890123456
|
||||
|
||||
ddshi047 shift 1234567890123456 +0 -> 1234567890123456
|
||||
ddshi048 shift 1234567890123456 +1 -> 2345678901234560
|
||||
ddshi049 shift 1234567890123456 +2 -> 3456789012345600
|
||||
ddshi050 shift 1234567890123456 +3 -> 4567890123456000
|
||||
ddshi051 shift 1234567890123456 +4 -> 5678901234560000
|
||||
ddshi052 shift 1234567890123456 +5 -> 6789012345600000
|
||||
ddshi053 shift 1234567890123456 +6 -> 7890123456000000
|
||||
ddshi054 shift 1234567890123456 +7 -> 8901234560000000
|
||||
ddshi055 shift 1234567890123456 +8 -> 9012345600000000
|
||||
ddshi056 shift 1234567890123456 +9 -> 123456000000000
|
||||
ddshi057 shift 1234567890123456 +10 -> 1234560000000000
|
||||
ddshi058 shift 1234567890123456 +11 -> 2345600000000000
|
||||
ddshi059 shift 1234567890123456 +12 -> 3456000000000000
|
||||
ddshi060 shift 1234567890123456 +13 -> 4560000000000000
|
||||
ddshi061 shift 1234567890123456 +14 -> 5600000000000000
|
||||
ddshi062 shift 1234567890123456 +15 -> 6000000000000000
|
||||
ddshi063 shift 1234567890123456 +16 -> 0
|
||||
|
||||
-- zeros
|
||||
ddshi070 shift 0E-10 +9 -> 0E-10
|
||||
ddshi071 shift 0E-10 -9 -> 0E-10
|
||||
ddshi072 shift 0.000 +9 -> 0.000
|
||||
ddshi073 shift 0.000 -9 -> 0.000
|
||||
ddshi074 shift 0E+10 +9 -> 0E+10
|
||||
ddshi075 shift 0E+10 -9 -> 0E+10
|
||||
ddshi076 shift -0E-10 +9 -> -0E-10
|
||||
ddshi077 shift -0E-10 -9 -> -0E-10
|
||||
ddshi078 shift -0.000 +9 -> -0.000
|
||||
ddshi079 shift -0.000 -9 -> -0.000
|
||||
ddshi080 shift -0E+10 +9 -> -0E+10
|
||||
ddshi081 shift -0E+10 -9 -> -0E+10
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383
|
||||
ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369
|
||||
ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384
|
||||
ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384
|
||||
ddshi145 shift 1E-383 -1 -> 0E-383
|
||||
ddshi146 shift 1E-383 -15 -> 0E-383
|
||||
ddshi147 shift 1E-383 1 -> 1.0E-382
|
||||
ddshi148 shift 1E-383 15 -> 1.000000000000000E-368
|
||||
ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384
|
||||
ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398
|
||||
ddshi153 shift 1.000000000000000E-383 1 -> 0E-398
|
||||
ddshi154 shift 1.000000000000000E-383 15 -> 0E-398
|
||||
ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384
|
||||
ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398
|
||||
ddshi157 shift 9.000000000000000E-383 1 -> 0E-398
|
||||
ddshi158 shift 9.000000000000000E-383 15 -> 0E-398
|
||||
ddshi160 shift 1E-398 -1 -> 0E-398
|
||||
ddshi161 shift 1E-398 -15 -> 0E-398
|
||||
ddshi162 shift 1E-398 1 -> 1.0E-397
|
||||
ddshi163 shift 1E-398 15 -> 1.000000000000000E-383
|
||||
-- negatives
|
||||
ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383
|
||||
ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369
|
||||
ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384
|
||||
ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384
|
||||
ddshi175 shift -1E-383 -1 -> -0E-383
|
||||
ddshi176 shift -1E-383 -15 -> -0E-383
|
||||
ddshi177 shift -1E-383 1 -> -1.0E-382
|
||||
ddshi178 shift -1E-383 15 -> -1.000000000000000E-368
|
||||
ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384
|
||||
ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398
|
||||
ddshi183 shift -1.000000000000000E-383 1 -> -0E-398
|
||||
ddshi184 shift -1.000000000000000E-383 15 -> -0E-398
|
||||
ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384
|
||||
ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398
|
||||
ddshi187 shift -9.000000000000000E-383 1 -> -0E-398
|
||||
ddshi188 shift -9.000000000000000E-383 15 -> -0E-398
|
||||
ddshi190 shift -1E-398 -1 -> -0E-398
|
||||
ddshi191 shift -1E-398 -15 -> -0E-398
|
||||
ddshi192 shift -1E-398 1 -> -1.0E-397
|
||||
ddshi193 shift -1E-398 15 -> -1.000000000000000E-383
|
||||
|
||||
-- more negatives (of sanities)
|
||||
ddshi201 shift -0 0 -> -0
|
||||
ddshi202 shift -0 2 -> -0
|
||||
ddshi203 shift -1 2 -> -100
|
||||
ddshi204 shift -1 15 -> -1000000000000000
|
||||
ddshi205 shift -1 16 -> -0
|
||||
ddshi206 shift -1 -1 -> -0
|
||||
ddshi207 shift -0 -2 -> -0
|
||||
ddshi208 shift -1234567890123456 -1 -> -123456789012345
|
||||
ddshi209 shift -1234567890123456 -15 -> -1
|
||||
ddshi210 shift -1234567890123456 -16 -> -0
|
||||
ddshi211 shift -9934567890123456 -15 -> -9
|
||||
ddshi212 shift -9934567890123456 -16 -> -0
|
||||
|
||||
|
||||
-- Specials; NaNs are handled as usual
|
||||
ddshi781 shift -Inf -8 -> -Infinity
|
||||
ddshi782 shift -Inf -1 -> -Infinity
|
||||
ddshi783 shift -Inf -0 -> -Infinity
|
||||
ddshi784 shift -Inf 0 -> -Infinity
|
||||
ddshi785 shift -Inf 1 -> -Infinity
|
||||
ddshi786 shift -Inf 8 -> -Infinity
|
||||
ddshi787 shift -1000 -Inf -> NaN Invalid_operation
|
||||
ddshi788 shift -Inf -Inf -> NaN Invalid_operation
|
||||
ddshi789 shift -1 -Inf -> NaN Invalid_operation
|
||||
ddshi790 shift -0 -Inf -> NaN Invalid_operation
|
||||
ddshi791 shift 0 -Inf -> NaN Invalid_operation
|
||||
ddshi792 shift 1 -Inf -> NaN Invalid_operation
|
||||
ddshi793 shift 1000 -Inf -> NaN Invalid_operation
|
||||
ddshi794 shift Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddshi800 shift Inf -Inf -> NaN Invalid_operation
|
||||
ddshi801 shift Inf -8 -> Infinity
|
||||
ddshi802 shift Inf -1 -> Infinity
|
||||
ddshi803 shift Inf -0 -> Infinity
|
||||
ddshi804 shift Inf 0 -> Infinity
|
||||
ddshi805 shift Inf 1 -> Infinity
|
||||
ddshi806 shift Inf 8 -> Infinity
|
||||
ddshi807 shift Inf Inf -> NaN Invalid_operation
|
||||
ddshi808 shift -1000 Inf -> NaN Invalid_operation
|
||||
ddshi809 shift -Inf Inf -> NaN Invalid_operation
|
||||
ddshi810 shift -1 Inf -> NaN Invalid_operation
|
||||
ddshi811 shift -0 Inf -> NaN Invalid_operation
|
||||
ddshi812 shift 0 Inf -> NaN Invalid_operation
|
||||
ddshi813 shift 1 Inf -> NaN Invalid_operation
|
||||
ddshi814 shift 1000 Inf -> NaN Invalid_operation
|
||||
ddshi815 shift Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddshi821 shift NaN -Inf -> NaN
|
||||
ddshi822 shift NaN -1000 -> NaN
|
||||
ddshi823 shift NaN -1 -> NaN
|
||||
ddshi824 shift NaN -0 -> NaN
|
||||
ddshi825 shift NaN 0 -> NaN
|
||||
ddshi826 shift NaN 1 -> NaN
|
||||
ddshi827 shift NaN 1000 -> NaN
|
||||
ddshi828 shift NaN Inf -> NaN
|
||||
ddshi829 shift NaN NaN -> NaN
|
||||
ddshi830 shift -Inf NaN -> NaN
|
||||
ddshi831 shift -1000 NaN -> NaN
|
||||
ddshi832 shift -1 NaN -> NaN
|
||||
ddshi833 shift -0 NaN -> NaN
|
||||
ddshi834 shift 0 NaN -> NaN
|
||||
ddshi835 shift 1 NaN -> NaN
|
||||
ddshi836 shift 1000 NaN -> NaN
|
||||
ddshi837 shift Inf NaN -> NaN
|
||||
|
||||
ddshi841 shift sNaN -Inf -> NaN Invalid_operation
|
||||
ddshi842 shift sNaN -1000 -> NaN Invalid_operation
|
||||
ddshi843 shift sNaN -1 -> NaN Invalid_operation
|
||||
ddshi844 shift sNaN -0 -> NaN Invalid_operation
|
||||
ddshi845 shift sNaN 0 -> NaN Invalid_operation
|
||||
ddshi846 shift sNaN 1 -> NaN Invalid_operation
|
||||
ddshi847 shift sNaN 1000 -> NaN Invalid_operation
|
||||
ddshi848 shift sNaN NaN -> NaN Invalid_operation
|
||||
ddshi849 shift sNaN sNaN -> NaN Invalid_operation
|
||||
ddshi850 shift NaN sNaN -> NaN Invalid_operation
|
||||
ddshi851 shift -Inf sNaN -> NaN Invalid_operation
|
||||
ddshi852 shift -1000 sNaN -> NaN Invalid_operation
|
||||
ddshi853 shift -1 sNaN -> NaN Invalid_operation
|
||||
ddshi854 shift -0 sNaN -> NaN Invalid_operation
|
||||
ddshi855 shift 0 sNaN -> NaN Invalid_operation
|
||||
ddshi856 shift 1 sNaN -> NaN Invalid_operation
|
||||
ddshi857 shift 1000 sNaN -> NaN Invalid_operation
|
||||
ddshi858 shift Inf sNaN -> NaN Invalid_operation
|
||||
ddshi859 shift NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddshi861 shift NaN1 -Inf -> NaN1
|
||||
ddshi862 shift +NaN2 -1000 -> NaN2
|
||||
ddshi863 shift NaN3 1000 -> NaN3
|
||||
ddshi864 shift NaN4 Inf -> NaN4
|
||||
ddshi865 shift NaN5 +NaN6 -> NaN5
|
||||
ddshi866 shift -Inf NaN7 -> NaN7
|
||||
ddshi867 shift -1000 NaN8 -> NaN8
|
||||
ddshi868 shift 1000 NaN9 -> NaN9
|
||||
ddshi869 shift Inf +NaN10 -> NaN10
|
||||
ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
|
||||
ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
|
||||
ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
|
||||
ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
|
||||
ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
|
||||
ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
|
||||
ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
|
||||
ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
|
||||
ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
|
||||
ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
|
||||
ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
|
||||
ddshi882 shift -NaN26 NaN28 -> -NaN26
|
||||
ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
|
||||
ddshi884 shift 1000 -NaN30 -> -NaN30
|
||||
ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
|
|
@ -0,0 +1,629 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddSubtract.decTest -- decDouble subtraction --
|
||||
-- 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
|
||||
|
||||
-- This set of tests are for decDoubles only; all arguments are
|
||||
-- representable in a decDouble
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- [first group are 'quick confidence check']
|
||||
ddsub001 subtract 0 0 -> '0'
|
||||
ddsub002 subtract 1 1 -> '0'
|
||||
ddsub003 subtract 1 2 -> '-1'
|
||||
ddsub004 subtract 2 1 -> '1'
|
||||
ddsub005 subtract 2 2 -> '0'
|
||||
ddsub006 subtract 3 2 -> '1'
|
||||
ddsub007 subtract 2 3 -> '-1'
|
||||
|
||||
ddsub011 subtract -0 0 -> '-0'
|
||||
ddsub012 subtract -1 1 -> '-2'
|
||||
ddsub013 subtract -1 2 -> '-3'
|
||||
ddsub014 subtract -2 1 -> '-3'
|
||||
ddsub015 subtract -2 2 -> '-4'
|
||||
ddsub016 subtract -3 2 -> '-5'
|
||||
ddsub017 subtract -2 3 -> '-5'
|
||||
|
||||
ddsub021 subtract 0 -0 -> '0'
|
||||
ddsub022 subtract 1 -1 -> '2'
|
||||
ddsub023 subtract 1 -2 -> '3'
|
||||
ddsub024 subtract 2 -1 -> '3'
|
||||
ddsub025 subtract 2 -2 -> '4'
|
||||
ddsub026 subtract 3 -2 -> '5'
|
||||
ddsub027 subtract 2 -3 -> '5'
|
||||
|
||||
ddsub030 subtract 11 1 -> 10
|
||||
ddsub031 subtract 10 1 -> 9
|
||||
ddsub032 subtract 9 1 -> 8
|
||||
ddsub033 subtract 1 1 -> 0
|
||||
ddsub034 subtract 0 1 -> -1
|
||||
ddsub035 subtract -1 1 -> -2
|
||||
ddsub036 subtract -9 1 -> -10
|
||||
ddsub037 subtract -10 1 -> -11
|
||||
ddsub038 subtract -11 1 -> -12
|
||||
|
||||
ddsub040 subtract '5.75' '3.3' -> '2.45'
|
||||
ddsub041 subtract '5' '-3' -> '8'
|
||||
ddsub042 subtract '-5' '-3' -> '-2'
|
||||
ddsub043 subtract '-7' '2.5' -> '-9.5'
|
||||
ddsub044 subtract '0.7' '0.3' -> '0.4'
|
||||
ddsub045 subtract '1.3' '0.3' -> '1.0'
|
||||
ddsub046 subtract '1.25' '1.25' -> '0.00'
|
||||
|
||||
ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
|
||||
ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
|
||||
|
||||
ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
|
||||
ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
|
||||
ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded
|
||||
ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded
|
||||
ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded
|
||||
-- symmetry:
|
||||
ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
|
||||
ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
|
||||
ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded
|
||||
ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded
|
||||
ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded
|
||||
|
||||
-- some of the next group are really constructor tests
|
||||
ddsub090 subtract '00.0' '0.0' -> '0.0'
|
||||
ddsub091 subtract '00.0' '0.00' -> '0.00'
|
||||
ddsub092 subtract '0.00' '00.0' -> '0.00'
|
||||
ddsub093 subtract '00.0' '0.00' -> '0.00'
|
||||
ddsub094 subtract '0.00' '00.0' -> '0.00'
|
||||
ddsub095 subtract '3' '.3' -> '2.7'
|
||||
ddsub096 subtract '3.' '.3' -> '2.7'
|
||||
ddsub097 subtract '3.0' '.3' -> '2.7'
|
||||
ddsub098 subtract '3.00' '.3' -> '2.70'
|
||||
ddsub099 subtract '3' '3' -> '0'
|
||||
ddsub100 subtract '3' '+3' -> '0'
|
||||
ddsub101 subtract '3' '-3' -> '6'
|
||||
ddsub102 subtract '3' '0.3' -> '2.7'
|
||||
ddsub103 subtract '3.' '0.3' -> '2.7'
|
||||
ddsub104 subtract '3.0' '0.3' -> '2.7'
|
||||
ddsub105 subtract '3.00' '0.3' -> '2.70'
|
||||
ddsub106 subtract '3' '3.0' -> '0.0'
|
||||
ddsub107 subtract '3' '+3.0' -> '0.0'
|
||||
ddsub108 subtract '3' '-3.0' -> '6.0'
|
||||
|
||||
-- the above all from add; massaged and extended. Now some new ones...
|
||||
-- [particularly important for comparisons]
|
||||
-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
|
||||
-- with input rounding.
|
||||
ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
|
||||
ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
|
||||
ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
|
||||
ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
|
||||
ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
|
||||
ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
|
||||
ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
|
||||
ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
|
||||
ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
|
||||
ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
|
||||
ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
|
||||
ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
|
||||
ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
|
||||
ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
|
||||
ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
|
||||
ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
|
||||
ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
|
||||
ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
|
||||
ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
|
||||
ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
|
||||
ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
|
||||
ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
|
||||
ddsub142 subtract '1' '0.999999999' -> '1E-9'
|
||||
ddsub143 subtract '0.999999999' '1' -> '-1E-9'
|
||||
ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
|
||||
ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
|
||||
ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
|
||||
|
||||
-- additional scaled arithmetic tests [0.97 problem]
|
||||
ddsub160 subtract '0' '.1' -> '-0.1'
|
||||
ddsub161 subtract '00' '.97983' -> '-0.97983'
|
||||
ddsub162 subtract '0' '.9' -> '-0.9'
|
||||
ddsub163 subtract '0' '0.102' -> '-0.102'
|
||||
ddsub164 subtract '0' '.4' -> '-0.4'
|
||||
ddsub165 subtract '0' '.307' -> '-0.307'
|
||||
ddsub166 subtract '0' '.43822' -> '-0.43822'
|
||||
ddsub167 subtract '0' '.911' -> '-0.911'
|
||||
ddsub168 subtract '.0' '.02' -> '-0.02'
|
||||
ddsub169 subtract '00' '.392' -> '-0.392'
|
||||
ddsub170 subtract '0' '.26' -> '-0.26'
|
||||
ddsub171 subtract '0' '0.51' -> '-0.51'
|
||||
ddsub172 subtract '0' '.2234' -> '-0.2234'
|
||||
ddsub173 subtract '0' '.2' -> '-0.2'
|
||||
ddsub174 subtract '.0' '.0008' -> '-0.0008'
|
||||
-- 0. on left
|
||||
ddsub180 subtract '0.0' '-.1' -> '0.1'
|
||||
ddsub181 subtract '0.00' '-.97983' -> '0.97983'
|
||||
ddsub182 subtract '0.0' '-.9' -> '0.9'
|
||||
ddsub183 subtract '0.0' '-0.102' -> '0.102'
|
||||
ddsub184 subtract '0.0' '-.4' -> '0.4'
|
||||
ddsub185 subtract '0.0' '-.307' -> '0.307'
|
||||
ddsub186 subtract '0.0' '-.43822' -> '0.43822'
|
||||
ddsub187 subtract '0.0' '-.911' -> '0.911'
|
||||
ddsub188 subtract '0.0' '-.02' -> '0.02'
|
||||
ddsub189 subtract '0.00' '-.392' -> '0.392'
|
||||
ddsub190 subtract '0.0' '-.26' -> '0.26'
|
||||
ddsub191 subtract '0.0' '-0.51' -> '0.51'
|
||||
ddsub192 subtract '0.0' '-.2234' -> '0.2234'
|
||||
ddsub193 subtract '0.0' '-.2' -> '0.2'
|
||||
ddsub194 subtract '0.0' '-.0008' -> '0.0008'
|
||||
-- negatives of same
|
||||
ddsub200 subtract '0' '-.1' -> '0.1'
|
||||
ddsub201 subtract '00' '-.97983' -> '0.97983'
|
||||
ddsub202 subtract '0' '-.9' -> '0.9'
|
||||
ddsub203 subtract '0' '-0.102' -> '0.102'
|
||||
ddsub204 subtract '0' '-.4' -> '0.4'
|
||||
ddsub205 subtract '0' '-.307' -> '0.307'
|
||||
ddsub206 subtract '0' '-.43822' -> '0.43822'
|
||||
ddsub207 subtract '0' '-.911' -> '0.911'
|
||||
ddsub208 subtract '.0' '-.02' -> '0.02'
|
||||
ddsub209 subtract '00' '-.392' -> '0.392'
|
||||
ddsub210 subtract '0' '-.26' -> '0.26'
|
||||
ddsub211 subtract '0' '-0.51' -> '0.51'
|
||||
ddsub212 subtract '0' '-.2234' -> '0.2234'
|
||||
ddsub213 subtract '0' '-.2' -> '0.2'
|
||||
ddsub214 subtract '.0' '-.0008' -> '0.0008'
|
||||
|
||||
-- more fixed, LHS swaps [really the same as testcases under add]
|
||||
ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
|
||||
ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
|
||||
ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
|
||||
ddsub223 subtract '-56267E-9' 0 -> '-0.000056267'
|
||||
ddsub224 subtract '-56267E-8' 0 -> '-0.00056267'
|
||||
ddsub225 subtract '-56267E-7' 0 -> '-0.0056267'
|
||||
ddsub226 subtract '-56267E-6' 0 -> '-0.056267'
|
||||
ddsub227 subtract '-56267E-5' 0 -> '-0.56267'
|
||||
ddsub228 subtract '-56267E-2' 0 -> '-562.67'
|
||||
ddsub229 subtract '-56267E-1' 0 -> '-5626.7'
|
||||
ddsub230 subtract '-56267E-0' 0 -> '-56267'
|
||||
-- symmetry ...
|
||||
ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
|
||||
ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
|
||||
ddsub242 subtract 0 '-56267E-10' -> '0.0000056267'
|
||||
ddsub243 subtract 0 '-56267E-9' -> '0.000056267'
|
||||
ddsub244 subtract 0 '-56267E-8' -> '0.00056267'
|
||||
ddsub245 subtract 0 '-56267E-7' -> '0.0056267'
|
||||
ddsub246 subtract 0 '-56267E-6' -> '0.056267'
|
||||
ddsub247 subtract 0 '-56267E-5' -> '0.56267'
|
||||
ddsub248 subtract 0 '-56267E-2' -> '562.67'
|
||||
ddsub249 subtract 0 '-56267E-1' -> '5626.7'
|
||||
ddsub250 subtract 0 '-56267E-0' -> '56267'
|
||||
|
||||
-- now some more from the 'new' add
|
||||
ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
|
||||
ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
|
||||
|
||||
-- some carrying effects
|
||||
ddsub321 subtract '0.9998' '0.0000' -> '0.9998'
|
||||
ddsub322 subtract '0.9998' '0.0001' -> '0.9997'
|
||||
ddsub323 subtract '0.9998' '0.0002' -> '0.9996'
|
||||
ddsub324 subtract '0.9998' '0.0003' -> '0.9995'
|
||||
ddsub325 subtract '0.9998' '-0.0000' -> '0.9998'
|
||||
ddsub326 subtract '0.9998' '-0.0001' -> '0.9999'
|
||||
ddsub327 subtract '0.9998' '-0.0002' -> '1.0000'
|
||||
ddsub328 subtract '0.9998' '-0.0003' -> '1.0001'
|
||||
|
||||
-- internal boundaries
|
||||
ddsub346 subtract '10000e+9' '7' -> '9999999999993'
|
||||
ddsub347 subtract '10000e+9' '70' -> '9999999999930'
|
||||
ddsub348 subtract '10000e+9' '700' -> '9999999999300'
|
||||
ddsub349 subtract '10000e+9' '7000' -> '9999999993000'
|
||||
ddsub350 subtract '10000e+9' '70000' -> '9999999930000'
|
||||
ddsub351 subtract '10000e+9' '700000' -> '9999999300000'
|
||||
ddsub352 subtract '7' '10000e+9' -> '-9999999999993'
|
||||
ddsub353 subtract '70' '10000e+9' -> '-9999999999930'
|
||||
ddsub354 subtract '700' '10000e+9' -> '-9999999999300'
|
||||
ddsub355 subtract '7000' '10000e+9' -> '-9999999993000'
|
||||
ddsub356 subtract '70000' '10000e+9' -> '-9999999930000'
|
||||
ddsub357 subtract '700000' '10000e+9' -> '-9999999300000'
|
||||
|
||||
-- zero preservation
|
||||
ddsub361 subtract 1 '0.0001' -> '0.9999'
|
||||
ddsub362 subtract 1 '0.00001' -> '0.99999'
|
||||
ddsub363 subtract 1 '0.000001' -> '0.999999'
|
||||
ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'
|
||||
ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded
|
||||
|
||||
-- some funny zeros [in case of bad signum]
|
||||
ddsub370 subtract 1 0 -> 1
|
||||
ddsub371 subtract 1 0. -> 1
|
||||
ddsub372 subtract 1 .0 -> 1.0
|
||||
ddsub373 subtract 1 0.0 -> 1.0
|
||||
ddsub374 subtract 0 1 -> -1
|
||||
ddsub375 subtract 0. 1 -> -1
|
||||
ddsub376 subtract .0 1 -> -1.0
|
||||
ddsub377 subtract 0.0 1 -> -1.0
|
||||
|
||||
-- leading 0 digit before round
|
||||
ddsub910 subtract -103519362 -51897955.3 -> -51621406.7
|
||||
ddsub911 subtract 159579.444 89827.5229 -> 69751.9211
|
||||
|
||||
ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded
|
||||
ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded
|
||||
ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995
|
||||
ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996
|
||||
ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded
|
||||
ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000
|
||||
ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999
|
||||
ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994
|
||||
ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994
|
||||
ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994
|
||||
|
||||
-- more LHS swaps [were fixed]
|
||||
ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
|
||||
ddsub391 subtract '-56267E-6' 0 -> '-0.056267'
|
||||
ddsub392 subtract '-56267E-5' 0 -> '-0.56267'
|
||||
ddsub393 subtract '-56267E-4' 0 -> '-5.6267'
|
||||
ddsub394 subtract '-56267E-3' 0 -> '-56.267'
|
||||
ddsub395 subtract '-56267E-2' 0 -> '-562.67'
|
||||
ddsub396 subtract '-56267E-1' 0 -> '-5626.7'
|
||||
ddsub397 subtract '-56267E-0' 0 -> '-56267'
|
||||
ddsub398 subtract '-5E-10' 0 -> '-5E-10'
|
||||
ddsub399 subtract '-5E-7' 0 -> '-5E-7'
|
||||
ddsub400 subtract '-5E-6' 0 -> '-0.000005'
|
||||
ddsub401 subtract '-5E-5' 0 -> '-0.00005'
|
||||
ddsub402 subtract '-5E-4' 0 -> '-0.0005'
|
||||
ddsub403 subtract '-5E-1' 0 -> '-0.5'
|
||||
ddsub404 subtract '-5E0' 0 -> '-5'
|
||||
ddsub405 subtract '-5E1' 0 -> '-50'
|
||||
ddsub406 subtract '-5E5' 0 -> '-500000'
|
||||
ddsub407 subtract '-5E15' 0 -> '-5000000000000000'
|
||||
ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded
|
||||
ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded
|
||||
ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded
|
||||
ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded
|
||||
|
||||
-- more RHS swaps [were fixed]
|
||||
ddsub420 subtract 0 '-56267E-10' -> '0.0000056267'
|
||||
ddsub421 subtract 0 '-56267E-6' -> '0.056267'
|
||||
ddsub422 subtract 0 '-56267E-5' -> '0.56267'
|
||||
ddsub423 subtract 0 '-56267E-4' -> '5.6267'
|
||||
ddsub424 subtract 0 '-56267E-3' -> '56.267'
|
||||
ddsub425 subtract 0 '-56267E-2' -> '562.67'
|
||||
ddsub426 subtract 0 '-56267E-1' -> '5626.7'
|
||||
ddsub427 subtract 0 '-56267E-0' -> '56267'
|
||||
ddsub428 subtract 0 '-5E-10' -> '5E-10'
|
||||
ddsub429 subtract 0 '-5E-7' -> '5E-7'
|
||||
ddsub430 subtract 0 '-5E-6' -> '0.000005'
|
||||
ddsub431 subtract 0 '-5E-5' -> '0.00005'
|
||||
ddsub432 subtract 0 '-5E-4' -> '0.0005'
|
||||
ddsub433 subtract 0 '-5E-1' -> '0.5'
|
||||
ddsub434 subtract 0 '-5E0' -> '5'
|
||||
ddsub435 subtract 0 '-5E1' -> '50'
|
||||
ddsub436 subtract 0 '-5E5' -> '500000'
|
||||
ddsub437 subtract 0 '-5E15' -> '5000000000000000'
|
||||
ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded
|
||||
ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded
|
||||
ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded
|
||||
ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded
|
||||
|
||||
|
||||
-- try borderline precision, with carries, etc.
|
||||
ddsub461 subtract '1E+16' '1' -> '9999999999999999'
|
||||
ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
|
||||
ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
|
||||
ddsub464 subtract '-1' '-1E+16' -> '9999999999999999'
|
||||
ddsub465 subtract '7E+15' '1' -> '6999999999999999'
|
||||
ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
|
||||
ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
|
||||
ddsub468 subtract '-1' '-7E+15' -> '6999999999999999'
|
||||
|
||||
-- 1234567890123456 1234567890123456 1 23456789012345
|
||||
ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded
|
||||
ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded
|
||||
ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded
|
||||
ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded
|
||||
ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999'
|
||||
ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998'
|
||||
ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997'
|
||||
ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996'
|
||||
ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995'
|
||||
ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994'
|
||||
|
||||
-- and some more, including residue effects and different roundings
|
||||
rounding: half_up
|
||||
ddsub500 subtract '1231234567456789' 0 -> '1231234567456789'
|
||||
ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
|
||||
ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
|
||||
ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
|
||||
ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
|
||||
ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
|
||||
ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
|
||||
ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
|
||||
ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded
|
||||
ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
|
||||
ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
|
||||
ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
|
||||
ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub516 subtract '1231234567456789' 1 -> '1231234567456788'
|
||||
ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
ddsub520 subtract '1231234567456789' 0 -> '1231234567456789'
|
||||
ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
|
||||
ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
|
||||
ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
|
||||
ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
|
||||
ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
|
||||
ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
|
||||
ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
|
||||
ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
|
||||
ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
|
||||
ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
|
||||
ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
|
||||
ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub536 subtract '1231234567456789' 1 -> '1231234567456788'
|
||||
ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
|
||||
-- critical few with even bottom digit...
|
||||
ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded
|
||||
ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
ddsub550 subtract '1231234567456789' 0 -> '1231234567456789'
|
||||
ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded
|
||||
ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded
|
||||
ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded
|
||||
ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
|
||||
ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
|
||||
ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
|
||||
ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
|
||||
ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
|
||||
ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
|
||||
ddsub566 subtract '1231234567456789' 1 -> '1231234567456788'
|
||||
ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded
|
||||
ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded
|
||||
ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded
|
||||
|
||||
-- symmetry...
|
||||
rounding: half_up
|
||||
ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789'
|
||||
ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788'
|
||||
ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789'
|
||||
ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
|
||||
ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788'
|
||||
ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
-- critical few with even bottom digit...
|
||||
ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789'
|
||||
ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
|
||||
ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788'
|
||||
ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
|
||||
ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
|
||||
ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded
|
||||
|
||||
|
||||
-- lots of leading zeros in intermediate result, and showing effects of
|
||||
-- input rounding would have affected the following
|
||||
rounding: half_up
|
||||
ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
|
||||
ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
|
||||
ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
|
||||
ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
|
||||
ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
|
||||
|
||||
rounding: half_even
|
||||
ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
|
||||
ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
|
||||
ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
|
||||
ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
|
||||
ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
|
||||
|
||||
ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
|
||||
ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
|
||||
ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
|
||||
ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
|
||||
ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
|
||||
|
||||
rounding: down
|
||||
ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
|
||||
ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
|
||||
ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
|
||||
ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
|
||||
ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
|
||||
|
||||
-- Specials
|
||||
ddsub780 subtract -Inf Inf -> -Infinity
|
||||
ddsub781 subtract -Inf 1000 -> -Infinity
|
||||
ddsub782 subtract -Inf 1 -> -Infinity
|
||||
ddsub783 subtract -Inf -0 -> -Infinity
|
||||
ddsub784 subtract -Inf -1 -> -Infinity
|
||||
ddsub785 subtract -Inf -1000 -> -Infinity
|
||||
ddsub787 subtract -1000 Inf -> -Infinity
|
||||
ddsub788 subtract -Inf Inf -> -Infinity
|
||||
ddsub789 subtract -1 Inf -> -Infinity
|
||||
ddsub790 subtract 0 Inf -> -Infinity
|
||||
ddsub791 subtract 1 Inf -> -Infinity
|
||||
ddsub792 subtract 1000 Inf -> -Infinity
|
||||
|
||||
ddsub800 subtract Inf Inf -> NaN Invalid_operation
|
||||
ddsub801 subtract Inf 1000 -> Infinity
|
||||
ddsub802 subtract Inf 1 -> Infinity
|
||||
ddsub803 subtract Inf 0 -> Infinity
|
||||
ddsub804 subtract Inf -0 -> Infinity
|
||||
ddsub805 subtract Inf -1 -> Infinity
|
||||
ddsub806 subtract Inf -1000 -> Infinity
|
||||
ddsub807 subtract Inf -Inf -> Infinity
|
||||
ddsub808 subtract -1000 -Inf -> Infinity
|
||||
ddsub809 subtract -Inf -Inf -> NaN Invalid_operation
|
||||
ddsub810 subtract -1 -Inf -> Infinity
|
||||
ddsub811 subtract -0 -Inf -> Infinity
|
||||
ddsub812 subtract 0 -Inf -> Infinity
|
||||
ddsub813 subtract 1 -Inf -> Infinity
|
||||
ddsub814 subtract 1000 -Inf -> Infinity
|
||||
ddsub815 subtract Inf -Inf -> Infinity
|
||||
|
||||
ddsub821 subtract NaN Inf -> NaN
|
||||
ddsub822 subtract -NaN 1000 -> -NaN
|
||||
ddsub823 subtract NaN 1 -> NaN
|
||||
ddsub824 subtract NaN 0 -> NaN
|
||||
ddsub825 subtract NaN -0 -> NaN
|
||||
ddsub826 subtract NaN -1 -> NaN
|
||||
ddsub827 subtract NaN -1000 -> NaN
|
||||
ddsub828 subtract NaN -Inf -> NaN
|
||||
ddsub829 subtract -NaN NaN -> -NaN
|
||||
ddsub830 subtract -Inf NaN -> NaN
|
||||
ddsub831 subtract -1000 NaN -> NaN
|
||||
ddsub832 subtract -1 NaN -> NaN
|
||||
ddsub833 subtract -0 NaN -> NaN
|
||||
ddsub834 subtract 0 NaN -> NaN
|
||||
ddsub835 subtract 1 NaN -> NaN
|
||||
ddsub836 subtract 1000 -NaN -> -NaN
|
||||
ddsub837 subtract Inf NaN -> NaN
|
||||
|
||||
ddsub841 subtract sNaN Inf -> NaN Invalid_operation
|
||||
ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
|
||||
ddsub843 subtract sNaN 1 -> NaN Invalid_operation
|
||||
ddsub844 subtract sNaN 0 -> NaN Invalid_operation
|
||||
ddsub845 subtract sNaN -0 -> NaN Invalid_operation
|
||||
ddsub846 subtract sNaN -1 -> NaN Invalid_operation
|
||||
ddsub847 subtract sNaN -1000 -> NaN Invalid_operation
|
||||
ddsub848 subtract sNaN NaN -> NaN Invalid_operation
|
||||
ddsub849 subtract sNaN sNaN -> NaN Invalid_operation
|
||||
ddsub850 subtract NaN sNaN -> NaN Invalid_operation
|
||||
ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
|
||||
ddsub852 subtract -1000 sNaN -> NaN Invalid_operation
|
||||
ddsub853 subtract -1 sNaN -> NaN Invalid_operation
|
||||
ddsub854 subtract -0 sNaN -> NaN Invalid_operation
|
||||
ddsub855 subtract 0 sNaN -> NaN Invalid_operation
|
||||
ddsub856 subtract 1 sNaN -> NaN Invalid_operation
|
||||
ddsub857 subtract 1000 sNaN -> NaN Invalid_operation
|
||||
ddsub858 subtract Inf sNaN -> NaN Invalid_operation
|
||||
ddsub859 subtract NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddsub861 subtract NaN01 -Inf -> NaN1
|
||||
ddsub862 subtract -NaN02 -1000 -> -NaN2
|
||||
ddsub863 subtract NaN03 1000 -> NaN3
|
||||
ddsub864 subtract NaN04 Inf -> NaN4
|
||||
ddsub865 subtract NaN05 NaN61 -> NaN5
|
||||
ddsub866 subtract -Inf -NaN71 -> -NaN71
|
||||
ddsub867 subtract -1000 NaN81 -> NaN81
|
||||
ddsub868 subtract 1000 NaN91 -> NaN91
|
||||
ddsub869 subtract Inf NaN101 -> NaN101
|
||||
ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
|
||||
ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
|
||||
ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
|
||||
ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
|
||||
ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
|
||||
ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
|
||||
ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
|
||||
ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
|
||||
ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
|
||||
ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
|
||||
ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
|
||||
|
||||
-- edge case spills
|
||||
ddsub901 subtract 2.E-3 1.002 -> -1.000
|
||||
ddsub902 subtract 2.0E-3 1.002 -> -1.0000
|
||||
ddsub903 subtract 2.00E-3 1.0020 -> -1.00000
|
||||
ddsub904 subtract 2.000E-3 1.00200 -> -1.000000
|
||||
ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
|
||||
ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
|
||||
ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
|
||||
ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
|
||||
|
||||
-- subnormals and overflows covered under Add
|
||||
|
||||
-- Null tests
|
||||
ddsub9990 subtract 10 # -> NaN Invalid_operation
|
||||
ddsub9991 subtract # 10 -> NaN Invalid_operation
|
|
@ -0,0 +1,257 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddToIntegral.decTest -- round Double to integral value --
|
||||
-- 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 --
|
||||
-- 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
|
||||
|
||||
-- This set of tests tests the extended specification 'round-to-integral
|
||||
-- value-exact' operations (from IEEE 854, later modified in 754r).
|
||||
-- All non-zero results are defined as being those from either copy or
|
||||
-- quantize, so those are assumed to have been tested extensively
|
||||
-- elsewhere; the tests here are for integrity, rounding mode, etc.
|
||||
-- Also, it is assumed the test harness will use these tests for both
|
||||
-- ToIntegralExact (which does set Inexact) and the fixed-name
|
||||
-- functions (which do not set Inexact).
|
||||
|
||||
-- Note that decNumber implements an earlier definition of toIntegral
|
||||
-- which never sets Inexact; the decTest operator for that is called
|
||||
-- 'tointegral' instead of 'tointegralx'.
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
ddintx001 tointegralx 0 -> 0
|
||||
ddintx002 tointegralx 0.0 -> 0
|
||||
ddintx003 tointegralx 0.1 -> 0 Inexact Rounded
|
||||
ddintx004 tointegralx 0.2 -> 0 Inexact Rounded
|
||||
ddintx005 tointegralx 0.3 -> 0 Inexact Rounded
|
||||
ddintx006 tointegralx 0.4 -> 0 Inexact Rounded
|
||||
ddintx007 tointegralx 0.5 -> 0 Inexact Rounded
|
||||
ddintx008 tointegralx 0.6 -> 1 Inexact Rounded
|
||||
ddintx009 tointegralx 0.7 -> 1 Inexact Rounded
|
||||
ddintx010 tointegralx 0.8 -> 1 Inexact Rounded
|
||||
ddintx011 tointegralx 0.9 -> 1 Inexact Rounded
|
||||
ddintx012 tointegralx 1 -> 1
|
||||
ddintx013 tointegralx 1.0 -> 1 Rounded
|
||||
ddintx014 tointegralx 1.1 -> 1 Inexact Rounded
|
||||
ddintx015 tointegralx 1.2 -> 1 Inexact Rounded
|
||||
ddintx016 tointegralx 1.3 -> 1 Inexact Rounded
|
||||
ddintx017 tointegralx 1.4 -> 1 Inexact Rounded
|
||||
ddintx018 tointegralx 1.5 -> 2 Inexact Rounded
|
||||
ddintx019 tointegralx 1.6 -> 2 Inexact Rounded
|
||||
ddintx020 tointegralx 1.7 -> 2 Inexact Rounded
|
||||
ddintx021 tointegralx 1.8 -> 2 Inexact Rounded
|
||||
ddintx022 tointegralx 1.9 -> 2 Inexact Rounded
|
||||
-- negatives
|
||||
ddintx031 tointegralx -0 -> -0
|
||||
ddintx032 tointegralx -0.0 -> -0
|
||||
ddintx033 tointegralx -0.1 -> -0 Inexact Rounded
|
||||
ddintx034 tointegralx -0.2 -> -0 Inexact Rounded
|
||||
ddintx035 tointegralx -0.3 -> -0 Inexact Rounded
|
||||
ddintx036 tointegralx -0.4 -> -0 Inexact Rounded
|
||||
ddintx037 tointegralx -0.5 -> -0 Inexact Rounded
|
||||
ddintx038 tointegralx -0.6 -> -1 Inexact Rounded
|
||||
ddintx039 tointegralx -0.7 -> -1 Inexact Rounded
|
||||
ddintx040 tointegralx -0.8 -> -1 Inexact Rounded
|
||||
ddintx041 tointegralx -0.9 -> -1 Inexact Rounded
|
||||
ddintx042 tointegralx -1 -> -1
|
||||
ddintx043 tointegralx -1.0 -> -1 Rounded
|
||||
ddintx044 tointegralx -1.1 -> -1 Inexact Rounded
|
||||
ddintx045 tointegralx -1.2 -> -1 Inexact Rounded
|
||||
ddintx046 tointegralx -1.3 -> -1 Inexact Rounded
|
||||
ddintx047 tointegralx -1.4 -> -1 Inexact Rounded
|
||||
ddintx048 tointegralx -1.5 -> -2 Inexact Rounded
|
||||
ddintx049 tointegralx -1.6 -> -2 Inexact Rounded
|
||||
ddintx050 tointegralx -1.7 -> -2 Inexact Rounded
|
||||
ddintx051 tointegralx -1.8 -> -2 Inexact Rounded
|
||||
ddintx052 tointegralx -1.9 -> -2 Inexact Rounded
|
||||
-- next two would be NaN using quantize(x, 0)
|
||||
ddintx053 tointegralx 10E+60 -> 1.0E+61
|
||||
ddintx054 tointegralx -10E+60 -> -1.0E+61
|
||||
|
||||
-- numbers around precision
|
||||
ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
|
||||
ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
|
||||
ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
|
||||
ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
|
||||
ddintx065 tointegralx '56267E-0' -> '56267'
|
||||
ddintx066 tointegralx '56267E+0' -> '56267'
|
||||
ddintx067 tointegralx '56267E+1' -> '5.6267E+5'
|
||||
ddintx068 tointegralx '56267E+9' -> '5.6267E+13'
|
||||
ddintx069 tointegralx '56267E+10' -> '5.6267E+14'
|
||||
ddintx070 tointegralx '56267E+11' -> '5.6267E+15'
|
||||
ddintx071 tointegralx '56267E+12' -> '5.6267E+16'
|
||||
ddintx072 tointegralx '56267E+13' -> '5.6267E+17'
|
||||
ddintx073 tointegralx '1.23E+96' -> '1.23E+96'
|
||||
ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped
|
||||
|
||||
ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
|
||||
ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
|
||||
ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
|
||||
ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
|
||||
ddintx085 tointegralx '-56267E-0' -> '-56267'
|
||||
ddintx086 tointegralx '-56267E+0' -> '-56267'
|
||||
ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
|
||||
ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
|
||||
ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
|
||||
ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
|
||||
ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
|
||||
ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
|
||||
ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
|
||||
ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped
|
||||
|
||||
-- subnormal inputs
|
||||
ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded
|
||||
ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
|
||||
ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
|
||||
ddintx103 tointegralx 0E-299 -> 0
|
||||
|
||||
-- specials and zeros
|
||||
ddintx120 tointegralx 'Inf' -> Infinity
|
||||
ddintx121 tointegralx '-Inf' -> -Infinity
|
||||
ddintx122 tointegralx NaN -> NaN
|
||||
ddintx123 tointegralx sNaN -> NaN Invalid_operation
|
||||
ddintx124 tointegralx 0 -> 0
|
||||
ddintx125 tointegralx -0 -> -0
|
||||
ddintx126 tointegralx 0.000 -> 0
|
||||
ddintx127 tointegralx 0.00 -> 0
|
||||
ddintx128 tointegralx 0.0 -> 0
|
||||
ddintx129 tointegralx 0 -> 0
|
||||
ddintx130 tointegralx 0E-3 -> 0
|
||||
ddintx131 tointegralx 0E-2 -> 0
|
||||
ddintx132 tointegralx 0E-1 -> 0
|
||||
ddintx133 tointegralx 0E-0 -> 0
|
||||
ddintx134 tointegralx 0E+1 -> 0E+1
|
||||
ddintx135 tointegralx 0E+2 -> 0E+2
|
||||
ddintx136 tointegralx 0E+3 -> 0E+3
|
||||
ddintx137 tointegralx 0E+4 -> 0E+4
|
||||
ddintx138 tointegralx 0E+5 -> 0E+5
|
||||
ddintx139 tointegralx -0.000 -> -0
|
||||
ddintx140 tointegralx -0.00 -> -0
|
||||
ddintx141 tointegralx -0.0 -> -0
|
||||
ddintx142 tointegralx -0 -> -0
|
||||
ddintx143 tointegralx -0E-3 -> -0
|
||||
ddintx144 tointegralx -0E-2 -> -0
|
||||
ddintx145 tointegralx -0E-1 -> -0
|
||||
ddintx146 tointegralx -0E-0 -> -0
|
||||
ddintx147 tointegralx -0E+1 -> -0E+1
|
||||
ddintx148 tointegralx -0E+2 -> -0E+2
|
||||
ddintx149 tointegralx -0E+3 -> -0E+3
|
||||
ddintx150 tointegralx -0E+4 -> -0E+4
|
||||
ddintx151 tointegralx -0E+5 -> -0E+5
|
||||
-- propagating NaNs
|
||||
ddintx152 tointegralx NaN808 -> NaN808
|
||||
ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
|
||||
ddintx154 tointegralx -NaN808 -> -NaN808
|
||||
ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
|
||||
ddintx156 tointegralx -NaN -> -NaN
|
||||
ddintx157 tointegralx -sNaN -> -NaN Invalid_operation
|
||||
|
||||
-- examples
|
||||
rounding: half_up
|
||||
ddintx200 tointegralx 2.1 -> 2 Inexact Rounded
|
||||
ddintx201 tointegralx 100 -> 100
|
||||
ddintx202 tointegralx 100.0 -> 100 Rounded
|
||||
ddintx203 tointegralx 101.5 -> 102 Inexact Rounded
|
||||
ddintx204 tointegralx -101.5 -> -102 Inexact Rounded
|
||||
ddintx205 tointegralx 10E+5 -> 1.0E+6
|
||||
ddintx206 tointegralx 7.89E+77 -> 7.89E+77
|
||||
ddintx207 tointegralx -Inf -> -Infinity
|
||||
|
||||
|
||||
-- all rounding modes
|
||||
rounding: half_even
|
||||
ddintx210 tointegralx 55.5 -> 56 Inexact Rounded
|
||||
ddintx211 tointegralx 56.5 -> 56 Inexact Rounded
|
||||
ddintx212 tointegralx 57.5 -> 58 Inexact Rounded
|
||||
ddintx213 tointegralx -55.5 -> -56 Inexact Rounded
|
||||
ddintx214 tointegralx -56.5 -> -56 Inexact Rounded
|
||||
ddintx215 tointegralx -57.5 -> -58 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
|
||||
ddintx220 tointegralx 55.5 -> 56 Inexact Rounded
|
||||
ddintx221 tointegralx 56.5 -> 57 Inexact Rounded
|
||||
ddintx222 tointegralx 57.5 -> 58 Inexact Rounded
|
||||
ddintx223 tointegralx -55.5 -> -56 Inexact Rounded
|
||||
ddintx224 tointegralx -56.5 -> -57 Inexact Rounded
|
||||
ddintx225 tointegralx -57.5 -> -58 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
|
||||
ddintx230 tointegralx 55.5 -> 55 Inexact Rounded
|
||||
ddintx231 tointegralx 56.5 -> 56 Inexact Rounded
|
||||
ddintx232 tointegralx 57.5 -> 57 Inexact Rounded
|
||||
ddintx233 tointegralx -55.5 -> -55 Inexact Rounded
|
||||
ddintx234 tointegralx -56.5 -> -56 Inexact Rounded
|
||||
ddintx235 tointegralx -57.5 -> -57 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
|
||||
ddintx240 tointegralx 55.3 -> 56 Inexact Rounded
|
||||
ddintx241 tointegralx 56.3 -> 57 Inexact Rounded
|
||||
ddintx242 tointegralx 57.3 -> 58 Inexact Rounded
|
||||
ddintx243 tointegralx -55.3 -> -56 Inexact Rounded
|
||||
ddintx244 tointegralx -56.3 -> -57 Inexact Rounded
|
||||
ddintx245 tointegralx -57.3 -> -58 Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
|
||||
ddintx250 tointegralx 55.7 -> 55 Inexact Rounded
|
||||
ddintx251 tointegralx 56.7 -> 56 Inexact Rounded
|
||||
ddintx252 tointegralx 57.7 -> 57 Inexact Rounded
|
||||
ddintx253 tointegralx -55.7 -> -55 Inexact Rounded
|
||||
ddintx254 tointegralx -56.7 -> -56 Inexact Rounded
|
||||
ddintx255 tointegralx -57.7 -> -57 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
|
||||
ddintx260 tointegralx 55.3 -> 56 Inexact Rounded
|
||||
ddintx261 tointegralx 56.3 -> 57 Inexact Rounded
|
||||
ddintx262 tointegralx 57.3 -> 58 Inexact Rounded
|
||||
ddintx263 tointegralx -55.3 -> -55 Inexact Rounded
|
||||
ddintx264 tointegralx -56.3 -> -56 Inexact Rounded
|
||||
ddintx265 tointegralx -57.3 -> -57 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
|
||||
ddintx270 tointegralx 55.7 -> 55 Inexact Rounded
|
||||
ddintx271 tointegralx 56.7 -> 56 Inexact Rounded
|
||||
ddintx272 tointegralx 57.7 -> 57 Inexact Rounded
|
||||
ddintx273 tointegralx -55.7 -> -56 Inexact Rounded
|
||||
ddintx274 tointegralx -56.7 -> -57 Inexact Rounded
|
||||
ddintx275 tointegralx -57.7 -> -58 Inexact Rounded
|
||||
|
||||
-- Int and uInt32 edge values for testing conversions
|
||||
ddintx300 tointegralx -2147483646 -> -2147483646
|
||||
ddintx301 tointegralx -2147483647 -> -2147483647
|
||||
ddintx302 tointegralx -2147483648 -> -2147483648
|
||||
ddintx303 tointegralx -2147483649 -> -2147483649
|
||||
ddintx304 tointegralx 2147483646 -> 2147483646
|
||||
ddintx305 tointegralx 2147483647 -> 2147483647
|
||||
ddintx306 tointegralx 2147483648 -> 2147483648
|
||||
ddintx307 tointegralx 2147483649 -> 2147483649
|
||||
ddintx308 tointegralx 4294967294 -> 4294967294
|
||||
ddintx309 tointegralx 4294967295 -> 4294967295
|
||||
ddintx310 tointegralx 4294967296 -> 4294967296
|
||||
ddintx311 tointegralx 4294967297 -> 4294967297
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
------------------------------------------------------------------------
|
||||
-- ddXor.decTest -- digitwise logical XOR for decDoubles --
|
||||
-- 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
|
||||
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
extended: 1
|
||||
clamp: 1
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check (truth table)
|
||||
ddxor001 xor 0 0 -> 0
|
||||
ddxor002 xor 0 1 -> 1
|
||||
ddxor003 xor 1 0 -> 1
|
||||
ddxor004 xor 1 1 -> 0
|
||||
ddxor005 xor 1100 1010 -> 110
|
||||
-- and at msd and msd-1
|
||||
ddxor006 xor 0000000000000000 0000000000000000 -> 0
|
||||
ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000
|
||||
ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000
|
||||
ddxor009 xor 1000000000000000 1000000000000000 -> 0
|
||||
ddxor010 xor 0000000000000000 0000000000000000 -> 0
|
||||
ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000
|
||||
ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000
|
||||
ddxor013 xor 0100000000000000 0100000000000000 -> 0
|
||||
|
||||
-- Various lengths
|
||||
-- 1234567890123456 1234567890123456 1234567890123456
|
||||
ddxor021 xor 1111111110000000 1111111110000000 -> 0
|
||||
ddxor022 xor 111111110000000 111111110000000 -> 0
|
||||
ddxor023 xor 11111110000000 11111110000000 -> 0
|
||||
ddxor024 xor 1111110000000 1111110000000 -> 0
|
||||
ddxor025 xor 111110000000 111110000000 -> 0
|
||||
ddxor026 xor 11110000000 11110000000 -> 0
|
||||
ddxor027 xor 1110000000 1110000000 -> 0
|
||||
ddxor028 xor 110000000 110000000 -> 0
|
||||
ddxor029 xor 10000000 10000000 -> 0
|
||||
ddxor030 xor 1000000 1000000 -> 0
|
||||
ddxor031 xor 100000 100000 -> 0
|
||||
ddxor032 xor 10000 10000 -> 0
|
||||
ddxor033 xor 1000 1000 -> 0
|
||||
ddxor034 xor 100 100 -> 0
|
||||
ddxor035 xor 10 10 -> 0
|
||||
ddxor036 xor 1 1 -> 0
|
||||
|
||||
ddxor040 xor 111111111 111111111111 -> 111000000000
|
||||
ddxor041 xor 11111111 111111111111 -> 111100000000
|
||||
ddxor042 xor 11111111 111111111 -> 100000000
|
||||
ddxor043 xor 1111111 100000010 -> 101111101
|
||||
ddxor044 xor 111111 100000100 -> 100111011
|
||||
ddxor045 xor 11111 100001000 -> 100010111
|
||||
ddxor046 xor 1111 100010000 -> 100011111
|
||||
ddxor047 xor 111 100100000 -> 100100111
|
||||
ddxor048 xor 11 101000000 -> 101000011
|
||||
ddxor049 xor 1 110000000 -> 110000001
|
||||
|
||||
ddxor050 xor 1111111111 1 -> 1111111110
|
||||
ddxor051 xor 111111111 1 -> 111111110
|
||||
ddxor052 xor 11111111 1 -> 11111110
|
||||
ddxor053 xor 1111111 1 -> 1111110
|
||||
ddxor054 xor 111111 1 -> 111110
|
||||
ddxor055 xor 11111 1 -> 11110
|
||||
ddxor056 xor 1111 1 -> 1110
|
||||
ddxor057 xor 111 1 -> 110
|
||||
ddxor058 xor 11 1 -> 10
|
||||
ddxor059 xor 1 1 -> 0
|
||||
|
||||
ddxor060 xor 1111111111 0 -> 1111111111
|
||||
ddxor061 xor 111111111 0 -> 111111111
|
||||
ddxor062 xor 11111111 0 -> 11111111
|
||||
ddxor063 xor 1111111 0 -> 1111111
|
||||
ddxor064 xor 111111 0 -> 111111
|
||||
ddxor065 xor 11111 0 -> 11111
|
||||
ddxor066 xor 1111 0 -> 1111
|
||||
ddxor067 xor 111 0 -> 111
|
||||
ddxor068 xor 11 0 -> 11
|
||||
ddxor069 xor 1 0 -> 1
|
||||
|
||||
ddxor070 xor 1 1111111111 -> 1111111110
|
||||
ddxor071 xor 1 111111111 -> 111111110
|
||||
ddxor072 xor 1 11111111 -> 11111110
|
||||
ddxor073 xor 1 1111111 -> 1111110
|
||||
ddxor074 xor 1 111111 -> 111110
|
||||
ddxor075 xor 1 11111 -> 11110
|
||||
ddxor076 xor 1 1111 -> 1110
|
||||
ddxor077 xor 1 111 -> 110
|
||||
ddxor078 xor 1 11 -> 10
|
||||
ddxor079 xor 1 1 -> 0
|
||||
|
||||
ddxor080 xor 0 1111111111 -> 1111111111
|
||||
ddxor081 xor 0 111111111 -> 111111111
|
||||
ddxor082 xor 0 11111111 -> 11111111
|
||||
ddxor083 xor 0 1111111 -> 1111111
|
||||
ddxor084 xor 0 111111 -> 111111
|
||||
ddxor085 xor 0 11111 -> 11111
|
||||
ddxor086 xor 0 1111 -> 1111
|
||||
ddxor087 xor 0 111 -> 111
|
||||
ddxor088 xor 0 11 -> 11
|
||||
ddxor089 xor 0 1 -> 1
|
||||
|
||||
ddxor090 xor 011111111 111101111 -> 100010000
|
||||
ddxor091 xor 101111111 111101111 -> 10010000
|
||||
ddxor092 xor 110111111 111101111 -> 1010000
|
||||
ddxor093 xor 111011111 111101111 -> 110000
|
||||
ddxor094 xor 111101111 111101111 -> 0
|
||||
ddxor095 xor 111110111 111101111 -> 11000
|
||||
ddxor096 xor 111111011 111101111 -> 10100
|
||||
ddxor097 xor 111111101 111101111 -> 10010
|
||||
ddxor098 xor 111111110 111101111 -> 10001
|
||||
|
||||
ddxor100 xor 111101111 011111111 -> 100010000
|
||||
ddxor101 xor 111101111 101111111 -> 10010000
|
||||
ddxor102 xor 111101111 110111111 -> 1010000
|
||||
ddxor103 xor 111101111 111011111 -> 110000
|
||||
ddxor104 xor 111101111 111101111 -> 0
|
||||
ddxor105 xor 111101111 111110111 -> 11000
|
||||
ddxor106 xor 111101111 111111011 -> 10100
|
||||
ddxor107 xor 111101111 111111101 -> 10010
|
||||
ddxor108 xor 111101111 111111110 -> 10001
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
ddxor220 xor 111111112 111111111 -> NaN Invalid_operation
|
||||
ddxor221 xor 333333333 333333333 -> NaN Invalid_operation
|
||||
ddxor222 xor 555555555 555555555 -> NaN Invalid_operation
|
||||
ddxor223 xor 777777777 777777777 -> NaN Invalid_operation
|
||||
ddxor224 xor 999999999 999999999 -> NaN Invalid_operation
|
||||
ddxor225 xor 222222222 999999999 -> NaN Invalid_operation
|
||||
ddxor226 xor 444444444 999999999 -> NaN Invalid_operation
|
||||
ddxor227 xor 666666666 999999999 -> NaN Invalid_operation
|
||||
ddxor228 xor 888888888 999999999 -> NaN Invalid_operation
|
||||
ddxor229 xor 999999999 222222222 -> NaN Invalid_operation
|
||||
ddxor230 xor 999999999 444444444 -> NaN Invalid_operation
|
||||
ddxor231 xor 999999999 666666666 -> NaN Invalid_operation
|
||||
ddxor232 xor 999999999 888888888 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation
|
||||
ddxor241 xor 567367689 934981942 -> NaN Invalid_operation
|
||||
ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation
|
||||
ddxor243 xor -756253257 138579234 -> NaN Invalid_operation
|
||||
ddxor244 xor 835590149 567435400 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation
|
||||
ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation
|
||||
ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation
|
||||
ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation
|
||||
ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation
|
||||
ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation
|
||||
ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation
|
||||
ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation
|
||||
ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation
|
||||
ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation
|
||||
ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation
|
||||
ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation
|
||||
ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation
|
||||
ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation
|
||||
ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation
|
||||
ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation
|
||||
ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation
|
||||
ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation
|
||||
ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation
|
||||
ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation
|
||||
ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation
|
||||
ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation
|
||||
ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation
|
||||
ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation
|
||||
ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation
|
||||
ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation
|
||||
ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation
|
||||
-- signs
|
||||
ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation
|
||||
ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation
|
||||
ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation
|
||||
ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100
|
||||
|
||||
-- Nmax, Nmin, Ntiny-like
|
||||
ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation
|
||||
ddxor332 xor 3 1E-299 -> NaN Invalid_operation
|
||||
ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation
|
||||
ddxor334 xor 5 1E-200 -> NaN Invalid_operation
|
||||
ddxor335 xor 6 -1E-200 -> NaN Invalid_operation
|
||||
ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation
|
||||
ddxor337 xor 8 -1E-299 -> NaN Invalid_operation
|
||||
ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation
|
||||
ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation
|
||||
ddxor342 xor 1E-299 01 -> NaN Invalid_operation
|
||||
ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation
|
||||
ddxor344 xor 1E-208 18 -> NaN Invalid_operation
|
||||
ddxor345 xor -1E-207 -10 -> NaN Invalid_operation
|
||||
ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation
|
||||
ddxor347 xor -1E-299 10 -> NaN Invalid_operation
|
||||
ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
ddxor361 xor 1.0 1 -> NaN Invalid_operation
|
||||
ddxor362 xor 1E+1 1 -> NaN Invalid_operation
|
||||
ddxor363 xor 0.0 1 -> NaN Invalid_operation
|
||||
ddxor364 xor 0E+1 1 -> NaN Invalid_operation
|
||||
ddxor365 xor 9.9 1 -> NaN Invalid_operation
|
||||
ddxor366 xor 9E+1 1 -> NaN Invalid_operation
|
||||
ddxor371 xor 0 1.0 -> NaN Invalid_operation
|
||||
ddxor372 xor 0 1E+1 -> NaN Invalid_operation
|
||||
ddxor373 xor 0 0.0 -> NaN Invalid_operation
|
||||
ddxor374 xor 0 0E+1 -> NaN Invalid_operation
|
||||
ddxor375 xor 0 9.9 -> NaN Invalid_operation
|
||||
ddxor376 xor 0 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
ddxor780 xor -Inf -Inf -> NaN Invalid_operation
|
||||
ddxor781 xor -Inf -1000 -> NaN Invalid_operation
|
||||
ddxor782 xor -Inf -1 -> NaN Invalid_operation
|
||||
ddxor783 xor -Inf -0 -> NaN Invalid_operation
|
||||
ddxor784 xor -Inf 0 -> NaN Invalid_operation
|
||||
ddxor785 xor -Inf 1 -> NaN Invalid_operation
|
||||
ddxor786 xor -Inf 1000 -> NaN Invalid_operation
|
||||
ddxor787 xor -1000 -Inf -> NaN Invalid_operation
|
||||
ddxor788 xor -Inf -Inf -> NaN Invalid_operation
|
||||
ddxor789 xor -1 -Inf -> NaN Invalid_operation
|
||||
ddxor790 xor -0 -Inf -> NaN Invalid_operation
|
||||
ddxor791 xor 0 -Inf -> NaN Invalid_operation
|
||||
ddxor792 xor 1 -Inf -> NaN Invalid_operation
|
||||
ddxor793 xor 1000 -Inf -> NaN Invalid_operation
|
||||
ddxor794 xor Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
ddxor800 xor Inf -Inf -> NaN Invalid_operation
|
||||
ddxor801 xor Inf -1000 -> NaN Invalid_operation
|
||||
ddxor802 xor Inf -1 -> NaN Invalid_operation
|
||||
ddxor803 xor Inf -0 -> NaN Invalid_operation
|
||||
ddxor804 xor Inf 0 -> NaN Invalid_operation
|
||||
ddxor805 xor Inf 1 -> NaN Invalid_operation
|
||||
ddxor806 xor Inf 1000 -> NaN Invalid_operation
|
||||
ddxor807 xor Inf Inf -> NaN Invalid_operation
|
||||
ddxor808 xor -1000 Inf -> NaN Invalid_operation
|
||||
ddxor809 xor -Inf Inf -> NaN Invalid_operation
|
||||
ddxor810 xor -1 Inf -> NaN Invalid_operation
|
||||
ddxor811 xor -0 Inf -> NaN Invalid_operation
|
||||
ddxor812 xor 0 Inf -> NaN Invalid_operation
|
||||
ddxor813 xor 1 Inf -> NaN Invalid_operation
|
||||
ddxor814 xor 1000 Inf -> NaN Invalid_operation
|
||||
ddxor815 xor Inf Inf -> NaN Invalid_operation
|
||||
|
||||
ddxor821 xor NaN -Inf -> NaN Invalid_operation
|
||||
ddxor822 xor NaN -1000 -> NaN Invalid_operation
|
||||
ddxor823 xor NaN -1 -> NaN Invalid_operation
|
||||
ddxor824 xor NaN -0 -> NaN Invalid_operation
|
||||
ddxor825 xor NaN 0 -> NaN Invalid_operation
|
||||
ddxor826 xor NaN 1 -> NaN Invalid_operation
|
||||
ddxor827 xor NaN 1000 -> NaN Invalid_operation
|
||||
ddxor828 xor NaN Inf -> NaN Invalid_operation
|
||||
ddxor829 xor NaN NaN -> NaN Invalid_operation
|
||||
ddxor830 xor -Inf NaN -> NaN Invalid_operation
|
||||
ddxor831 xor -1000 NaN -> NaN Invalid_operation
|
||||
ddxor832 xor -1 NaN -> NaN Invalid_operation
|
||||
ddxor833 xor -0 NaN -> NaN Invalid_operation
|
||||
ddxor834 xor 0 NaN -> NaN Invalid_operation
|
||||
ddxor835 xor 1 NaN -> NaN Invalid_operation
|
||||
ddxor836 xor 1000 NaN -> NaN Invalid_operation
|
||||
ddxor837 xor Inf NaN -> NaN Invalid_operation
|
||||
|
||||
ddxor841 xor sNaN -Inf -> NaN Invalid_operation
|
||||
ddxor842 xor sNaN -1000 -> NaN Invalid_operation
|
||||
ddxor843 xor sNaN -1 -> NaN Invalid_operation
|
||||
ddxor844 xor sNaN -0 -> NaN Invalid_operation
|
||||
ddxor845 xor sNaN 0 -> NaN Invalid_operation
|
||||
ddxor846 xor sNaN 1 -> NaN Invalid_operation
|
||||
ddxor847 xor sNaN 1000 -> NaN Invalid_operation
|
||||
ddxor848 xor sNaN NaN -> NaN Invalid_operation
|
||||
ddxor849 xor sNaN sNaN -> NaN Invalid_operation
|
||||
ddxor850 xor NaN sNaN -> NaN Invalid_operation
|
||||
ddxor851 xor -Inf sNaN -> NaN Invalid_operation
|
||||
ddxor852 xor -1000 sNaN -> NaN Invalid_operation
|
||||
ddxor853 xor -1 sNaN -> NaN Invalid_operation
|
||||
ddxor854 xor -0 sNaN -> NaN Invalid_operation
|
||||
ddxor855 xor 0 sNaN -> NaN Invalid_operation
|
||||
ddxor856 xor 1 sNaN -> NaN Invalid_operation
|
||||
ddxor857 xor 1000 sNaN -> NaN Invalid_operation
|
||||
ddxor858 xor Inf sNaN -> NaN Invalid_operation
|
||||
ddxor859 xor NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
ddxor861 xor NaN1 -Inf -> NaN Invalid_operation
|
||||
ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation
|
||||
ddxor863 xor NaN3 1000 -> NaN Invalid_operation
|
||||
ddxor864 xor NaN4 Inf -> NaN Invalid_operation
|
||||
ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
|
||||
ddxor866 xor -Inf NaN7 -> NaN Invalid_operation
|
||||
ddxor867 xor -1000 NaN8 -> NaN Invalid_operation
|
||||
ddxor868 xor 1000 NaN9 -> NaN Invalid_operation
|
||||
ddxor869 xor Inf +NaN10 -> NaN Invalid_operation
|
||||
ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation
|
||||
ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation
|
||||
ddxor873 xor sNaN13 1000 -> NaN Invalid_operation
|
||||
ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
|
||||
ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
|
||||
ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
|
||||
ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
|
||||
ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation
|
||||
ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation
|
||||
ddxor880 xor Inf sNaN23 -> NaN Invalid_operation
|
||||
ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
|
||||
ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
|
||||
ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
|
||||
ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation
|
||||
ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
------------------------------------------------------------------------
|
||||
-- dqAbs.decTest -- decQuad absolute value, heeding sNaN --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
clamp: 1
|
||||
precision: 34
|
||||
maxExponent: 6144
|
||||
minExponent: -6143
|
||||
rounding: half_even
|
||||
|
||||
dqabs001 abs '1' -> '1'
|
||||
dqabs002 abs '-1' -> '1'
|
||||
dqabs003 abs '1.00' -> '1.00'
|
||||
dqabs004 abs '-1.00' -> '1.00'
|
||||
dqabs005 abs '0' -> '0'
|
||||
dqabs006 abs '0.00' -> '0.00'
|
||||
dqabs007 abs '00.0' -> '0.0'
|
||||
dqabs008 abs '00.00' -> '0.00'
|
||||
dqabs009 abs '00' -> '0'
|
||||
|
||||
dqabs010 abs '-2' -> '2'
|
||||
dqabs011 abs '2' -> '2'
|
||||
dqabs012 abs '-2.00' -> '2.00'
|
||||
dqabs013 abs '2.00' -> '2.00'
|
||||
dqabs014 abs '-0' -> '0'
|
||||
dqabs015 abs '-0.00' -> '0.00'
|
||||
dqabs016 abs '-00.0' -> '0.0'
|
||||
dqabs017 abs '-00.00' -> '0.00'
|
||||
dqabs018 abs '-00' -> '0'
|
||||
|
||||
dqabs020 abs '-2000000' -> '2000000'
|
||||
dqabs021 abs '2000000' -> '2000000'
|
||||
|
||||
dqabs030 abs '+0.1' -> '0.1'
|
||||
dqabs031 abs '-0.1' -> '0.1'
|
||||
dqabs032 abs '+0.01' -> '0.01'
|
||||
dqabs033 abs '-0.01' -> '0.01'
|
||||
dqabs034 abs '+0.001' -> '0.001'
|
||||
dqabs035 abs '-0.001' -> '0.001'
|
||||
dqabs036 abs '+0.000001' -> '0.000001'
|
||||
dqabs037 abs '-0.000001' -> '0.000001'
|
||||
dqabs038 abs '+0.000000000001' -> '1E-12'
|
||||
dqabs039 abs '-0.000000000001' -> '1E-12'
|
||||
|
||||
-- examples from decArith
|
||||
dqabs040 abs '2.1' -> '2.1'
|
||||
dqabs041 abs '-100' -> '100'
|
||||
dqabs042 abs '101.5' -> '101.5'
|
||||
dqabs043 abs '-101.5' -> '101.5'
|
||||
|
||||
-- more fixed, potential LHS swaps/overlays if done by subtract 0
|
||||
dqabs060 abs '-56267E-10' -> '0.0000056267'
|
||||
dqabs061 abs '-56267E-5' -> '0.56267'
|
||||
dqabs062 abs '-56267E-2' -> '562.67'
|
||||
dqabs063 abs '-56267E-1' -> '5626.7'
|
||||
dqabs065 abs '-56267E-0' -> '56267'
|
||||
|
||||
-- subnormals and underflow
|
||||
|
||||
-- long operand tests
|
||||
dqabs321 abs 1234567890123456 -> 1234567890123456
|
||||
dqabs322 abs 12345678000 -> 12345678000
|
||||
dqabs323 abs 1234567800 -> 1234567800
|
||||
dqabs324 abs 1234567890 -> 1234567890
|
||||
dqabs325 abs 1234567891 -> 1234567891
|
||||
dqabs326 abs 12345678901 -> 12345678901
|
||||
dqabs327 abs 1234567896 -> 1234567896
|
||||
|
||||
-- zeros
|
||||
dqabs111 abs 0 -> 0
|
||||
dqabs112 abs -0 -> 0
|
||||
dqabs113 abs 0E+6 -> 0E+6
|
||||
dqabs114 abs -0E+6 -> 0E+6
|
||||
dqabs115 abs 0.0000 -> 0.0000
|
||||
dqabs116 abs -0.0000 -> 0.0000
|
||||
dqabs117 abs 0E-141 -> 0E-141
|
||||
dqabs118 abs -0E-141 -> 0E-141
|
||||
|
||||
-- full coefficients, alternating bits
|
||||
dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
|
||||
dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
|
||||
dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
|
||||
dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
|
||||
|
||||
-- Nmax, Nmin, Ntiny
|
||||
dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
|
||||
dqabs132 abs 1E-6143 -> 1E-6143
|
||||
dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
|
||||
dqabs134 abs 1E-6176 -> 1E-6176 Subnormal
|
||||
|
||||
dqabs135 abs -1E-6176 -> 1E-6176 Subnormal
|
||||
dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
|
||||
dqabs137 abs -1E-6143 -> 1E-6143
|
||||
dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
|
||||
|
||||
-- specials
|
||||
dqabs520 abs 'Inf' -> 'Infinity'
|
||||
dqabs521 abs '-Inf' -> 'Infinity'
|
||||
dqabs522 abs NaN -> NaN
|
||||
dqabs523 abs sNaN -> NaN Invalid_operation
|
||||
dqabs524 abs NaN22 -> NaN22
|
||||
dqabs525 abs sNaN33 -> NaN33 Invalid_operation
|
||||
dqabs526 abs -NaN22 -> -NaN22
|
||||
dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
dqabs900 abs # -> NaN Invalid_operation
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,420 @@
|
|||
------------------------------------------------------------------------
|
||||
-- dqAnd.decTest -- digitwise logical AND for decQuads --
|
||||
-- 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
|
||||
|
||||
extended: 1
|
||||
clamp: 1
|
||||
precision: 34
|
||||
maxExponent: 6144
|
||||
minExponent: -6143
|
||||
rounding: half_even
|
||||
|
||||
-- Sanity check (truth table)
|
||||
dqand001 and 0 0 -> 0
|
||||
dqand002 and 0 1 -> 0
|
||||
dqand003 and 1 0 -> 0
|
||||
dqand004 and 1 1 -> 1
|
||||
dqand005 and 1100 1010 -> 1000
|
||||
-- and at msd and msd-1
|
||||
-- 1234567890123456789012345678901234
|
||||
dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
|
||||
dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
|
||||
dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
|
||||
dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
|
||||
dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
|
||||
dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0
|
||||
dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0
|
||||
dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
|
||||
|
||||
-- Various lengths
|
||||
-- 1234567890123456789012345678901234
|
||||
|
||||
dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111
|
||||
dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111
|
||||
dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111
|
||||
dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111
|
||||
dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111
|
||||
dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111
|
||||
dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111
|
||||
dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111
|
||||
dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111
|
||||
dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111
|
||||
dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111
|
||||
dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111
|
||||
dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111
|
||||
dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111
|
||||
dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111
|
||||
dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111
|
||||
dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111
|
||||
dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111
|
||||
dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111
|
||||
dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111
|
||||
dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111
|
||||
dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111
|
||||
dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111
|
||||
dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111
|
||||
dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111
|
||||
dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111
|
||||
dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111
|
||||
dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111
|
||||
dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111
|
||||
dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111
|
||||
dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111
|
||||
dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011
|
||||
dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101
|
||||
dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110
|
||||
|
||||
dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111
|
||||
dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111
|
||||
dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111
|
||||
dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111
|
||||
dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111
|
||||
dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111
|
||||
dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111
|
||||
dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111
|
||||
dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111
|
||||
dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111
|
||||
dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111
|
||||
dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111
|
||||
dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111
|
||||
dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111
|
||||
dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111
|
||||
dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111
|
||||
dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111
|
||||
dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111
|
||||
dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111
|
||||
dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111
|
||||
dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111
|
||||
dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111
|
||||
dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111
|
||||
dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111
|
||||
dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111
|
||||
dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111
|
||||
dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111
|
||||
dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111
|
||||
dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111
|
||||
dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111
|
||||
dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111
|
||||
dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011
|
||||
dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101
|
||||
dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
|
||||
dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110
|
||||
dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
|
||||
|
||||
dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111
|
||||
dqand024 and 1111111111111111 111111111111111 -> 111111111111111
|
||||
dqand025 and 1111111111111111 11111111111111 -> 11111111111111
|
||||
dqand026 and 1111111111111111 1111111111111 -> 1111111111111
|
||||
dqand027 and 1111111111111111 111111111111 -> 111111111111
|
||||
dqand028 and 1111111111111111 11111111111 -> 11111111111
|
||||
dqand029 and 1111111111111111 1111111111 -> 1111111111
|
||||
dqand030 and 1111111111111111 111111111 -> 111111111
|
||||
dqand031 and 1111111111111111 11111111 -> 11111111
|
||||
dqand032 and 1111111111111111 1111111 -> 1111111
|
||||
dqand033 and 1111111111111111 111111 -> 111111
|
||||
dqand034 and 1111111111111111 11111 -> 11111
|
||||
dqand035 and 1111111111111111 1111 -> 1111
|
||||
dqand036 and 1111111111111111 111 -> 111
|
||||
dqand037 and 1111111111111111 11 -> 11
|
||||
dqand038 and 1111111111111111 1 -> 1
|
||||
dqand039 and 1111111111111111 0 -> 0
|
||||
|
||||
dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111
|
||||
dqand041 and 111111111111111 1111111111111111 -> 111111111111111
|
||||
dqand042 and 111111111111111 1111111111111111 -> 111111111111111
|
||||
dqand043 and 11111111111111 1111111111111111 -> 11111111111111
|
||||
dqand044 and 1111111111111 1111111111111111 -> 1111111111111
|
||||
dqand045 and 111111111111 1111111111111111 -> 111111111111
|
||||
dqand046 and 11111111111 1111111111111111 -> 11111111111
|
||||
dqand047 and 1111111111 1111111111111111 -> 1111111111
|
||||
dqand048 and 111111111 1111111111111111 -> 111111111
|
||||
dqand049 and 11111111 1111111111111111 -> 11111111
|
||||
dqand050 and 1111111 1111111111111111 -> 1111111
|
||||
dqand051 and 111111 1111111111111111 -> 111111
|
||||
dqand052 and 11111 1111111111111111 -> 11111
|
||||
dqand053 and 1111 1111111111111111 -> 1111
|
||||
dqand054 and 111 1111111111111111 -> 111
|
||||
dqand055 and 11 1111111111111111 -> 11
|
||||
dqand056 and 1 1111111111111111 -> 1
|
||||
dqand057 and 0 1111111111111111 -> 0
|
||||
|
||||
dqand150 and 1111111111 1 -> 1
|
||||
dqand151 and 111111111 1 -> 1
|
||||
dqand152 and 11111111 1 -> 1
|
||||
dqand153 and 1111111 1 -> 1
|
||||
dqand154 and 111111 1 -> 1
|
||||
dqand155 and 11111 1 -> 1
|
||||
dqand156 and 1111 1 -> 1
|
||||
dqand157 and 111 1 -> 1
|
||||
dqand158 and 11 1 -> 1
|
||||
dqand159 and 1 1 -> 1
|
||||
|
||||
dqand160 and 1111111111 0 -> 0
|
||||
dqand161 and 111111111 0 -> 0
|
||||
dqand162 and 11111111 0 -> 0
|
||||
dqand163 and 1111111 0 -> 0
|
||||
dqand164 and 111111 0 -> 0
|
||||
dqand165 and 11111 0 -> 0
|
||||
dqand166 and 1111 0 -> 0
|
||||
dqand167 and 111 0 -> 0
|
||||
dqand168 and 11 0 -> 0
|
||||
dqand169 and 1 0 -> 0
|
||||
|
||||
dqand170 and 1 1111111111 -> 1
|
||||
dqand171 and 1 111111111 -> 1
|
||||
dqand172 and 1 11111111 -> 1
|
||||
dqand173 and 1 1111111 -> 1
|
||||
dqand174 and 1 111111 -> 1
|
||||
dqand175 and 1 11111 -> 1
|
||||
dqand176 and 1 1111 -> 1
|
||||
dqand177 and 1 111 -> 1
|
||||
dqand178 and 1 11 -> 1
|
||||
dqand179 and 1 1 -> 1
|
||||
|
||||
dqand180 and 0 1111111111 -> 0
|
||||
dqand181 and 0 111111111 -> 0
|
||||
dqand182 and 0 11111111 -> 0
|
||||
dqand183 and 0 1111111 -> 0
|
||||
dqand184 and 0 111111 -> 0
|
||||
dqand185 and 0 11111 -> 0
|
||||
dqand186 and 0 1111 -> 0
|
||||
dqand187 and 0 111 -> 0
|
||||
dqand188 and 0 11 -> 0
|
||||
dqand189 and 0 1 -> 0
|
||||
|
||||
dqand090 and 011111111 111111111 -> 11111111
|
||||
dqand091 and 101111111 111111111 -> 101111111
|
||||
dqand092 and 110111111 111111111 -> 110111111
|
||||
dqand093 and 111011111 111111111 -> 111011111
|
||||
dqand094 and 111101111 111111111 -> 111101111
|
||||
dqand095 and 111110111 111111111 -> 111110111
|
||||
dqand096 and 111111011 111111111 -> 111111011
|
||||
dqand097 and 111111101 111111111 -> 111111101
|
||||
dqand098 and 111111110 111111111 -> 111111110
|
||||
|
||||
dqand100 and 111111111 011111111 -> 11111111
|
||||
dqand101 and 111111111 101111111 -> 101111111
|
||||
dqand102 and 111111111 110111111 -> 110111111
|
||||
dqand103 and 111111111 111011111 -> 111011111
|
||||
dqand104 and 111111111 111101111 -> 111101111
|
||||
dqand105 and 111111111 111110111 -> 111110111
|
||||
dqand106 and 111111111 111111011 -> 111111011
|
||||
dqand107 and 111111111 111111101 -> 111111101
|
||||
dqand108 and 111111111 111111110 -> 111111110
|
||||
|
||||
-- non-0/1 should not be accepted, nor should signs
|
||||
dqand220 and 111111112 111111111 -> NaN Invalid_operation
|
||||
dqand221 and 333333333 333333333 -> NaN Invalid_operation
|
||||
dqand222 and 555555555 555555555 -> NaN Invalid_operation
|
||||
dqand223 and 777777777 777777777 -> NaN Invalid_operation
|
||||
dqand224 and 999999999 999999999 -> NaN Invalid_operation
|
||||
dqand225 and 222222222 999999999 -> NaN Invalid_operation
|
||||
dqand226 and 444444444 999999999 -> NaN Invalid_operation
|
||||
dqand227 and 666666666 999999999 -> NaN Invalid_operation
|
||||
dqand228 and 888888888 999999999 -> NaN Invalid_operation
|
||||
dqand229 and 999999999 222222222 -> NaN Invalid_operation
|
||||
dqand230 and 999999999 444444444 -> NaN Invalid_operation
|
||||
dqand231 and 999999999 666666666 -> NaN Invalid_operation
|
||||
dqand232 and 999999999 888888888 -> NaN Invalid_operation
|
||||
-- a few randoms
|
||||
dqand240 and 567468689 -934981942 -> NaN Invalid_operation
|
||||
dqand241 and 567367689 934981942 -> NaN Invalid_operation
|
||||
dqand242 and -631917772 -706014634 -> NaN Invalid_operation
|
||||
dqand243 and -756253257 138579234 -> NaN Invalid_operation
|
||||
dqand244 and 835590149 567435400 -> NaN Invalid_operation
|
||||
-- test MSD
|
||||
dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
|
||||
-- test MSD-1
|
||||
dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
|
||||
dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
|
||||
dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
|
||||
dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
|
||||
dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
|
||||
dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
|
||||
dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
|
||||
dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
|
||||
-- test LSD
|
||||
dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
|
||||
dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
|
||||
dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
|
||||
dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
|
||||
dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
|
||||
dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
|
||||
dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
|
||||
dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
|
||||
-- test Middie
|
||||
dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
|
||||
dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
|
||||
dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
|
||||
dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
|
||||
dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
|
||||
dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
|
||||
dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
|
||||
dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
|
||||
-- signs
|
||||
dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
|
||||
dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
|
||||
dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
|
||||
dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000
|
||||
|
||||
-- Nmax, Nmin, Ntiny-like
|
||||
dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation
|
||||
dqand332 and 3 1E-999 -> NaN Invalid_operation
|
||||
dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation
|
||||
dqand334 and 5 1E-900 -> NaN Invalid_operation
|
||||
dqand335 and 6 -1E-900 -> NaN Invalid_operation
|
||||
dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation
|
||||
dqand337 and 8 -1E-999 -> NaN Invalid_operation
|
||||
dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation
|
||||
dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation
|
||||
dqand342 and 1E-999 01 -> NaN Invalid_operation
|
||||
dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation
|
||||
dqand344 and 1E-900 18 -> NaN Invalid_operation
|
||||
dqand345 and -1E-900 -10 -> NaN Invalid_operation
|
||||
dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation
|
||||
dqand347 and -1E-999 10 -> NaN Invalid_operation
|
||||
dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation
|
||||
|
||||
-- A few other non-integers
|
||||
dqand361 and 1.0 1 -> NaN Invalid_operation
|
||||
dqand362 and 1E+1 1 -> NaN Invalid_operation
|
||||
dqand363 and 0.0 1 -> NaN Invalid_operation
|
||||
dqand364 and 0E+1 1 -> NaN Invalid_operation
|
||||
dqand365 and 9.9 1 -> NaN Invalid_operation
|
||||
dqand366 and 9E+1 1 -> NaN Invalid_operation
|
||||
dqand371 and 0 1.0 -> NaN Invalid_operation
|
||||
dqand372 and 0 1E+1 -> NaN Invalid_operation
|
||||
dqand373 and 0 0.0 -> NaN Invalid_operation
|
||||
dqand374 and 0 0E+1 -> NaN Invalid_operation
|
||||
dqand375 and 0 9.9 -> NaN Invalid_operation
|
||||
dqand376 and 0 9E+1 -> NaN Invalid_operation
|
||||
|
||||
-- All Specials are in error
|
||||
dqand780 and -Inf -Inf -> NaN Invalid_operation
|
||||
dqand781 and -Inf -1000 -> NaN Invalid_operation
|
||||
dqand782 and -Inf -1 -> NaN Invalid_operation
|
||||
dqand783 and -Inf -0 -> NaN Invalid_operation
|
||||
dqand784 and -Inf 0 -> NaN Invalid_operation
|
||||
dqand785 and -Inf 1 -> NaN Invalid_operation
|
||||
dqand786 and -Inf 1000 -> NaN Invalid_operation
|
||||
dqand787 and -1000 -Inf -> NaN Invalid_operation
|
||||
dqand788 and -Inf -Inf -> NaN Invalid_operation
|
||||
dqand789 and -1 -Inf -> NaN Invalid_operation
|
||||
dqand790 and -0 -Inf -> NaN Invalid_operation
|
||||
dqand791 and 0 -Inf -> NaN Invalid_operation
|
||||
dqand792 and 1 -Inf -> NaN Invalid_operation
|
||||
dqand793 and 1000 -Inf -> NaN Invalid_operation
|
||||
dqand794 and Inf -Inf -> NaN Invalid_operation
|
||||
|
||||
dqand800 and Inf -Inf -> NaN Invalid_operation
|
||||
dqand801 and Inf -1000 -> NaN Invalid_operation
|
||||
dqand802 and Inf -1 -> NaN Invalid_operation
|
||||
dqand803 and Inf -0 -> NaN Invalid_operation
|
||||
dqand804 and Inf 0 -> NaN Invalid_operation
|
||||
dqand805 and Inf 1 -> NaN Invalid_operation
|
||||
dqand806 and Inf 1000 -> NaN Invalid_operation
|
||||
dqand807 and Inf Inf -> NaN Invalid_operation
|
||||
dqand808 and -1000 Inf -> NaN Invalid_operation
|
||||
dqand809 and -Inf Inf -> NaN Invalid_operation
|
||||
dqand810 and -1 Inf -> NaN Invalid_operation
|
||||
dqand811 and -0 Inf -> NaN Invalid_operation
|
||||
dqand812 and 0 Inf -> NaN Invalid_operation
|
||||
dqand813 and 1 Inf -> NaN Invalid_operation
|
||||
dqand814 and 1000 Inf -> NaN Invalid_operation
|
||||
dqand815 and Inf Inf -> NaN Invalid_operation
|
||||
|
||||
dqand821 and NaN -Inf -> NaN Invalid_operation
|
||||
dqand822 and NaN -1000 -> NaN Invalid_operation
|
||||
dqand823 and NaN -1 -> NaN Invalid_operation
|
||||
dqand824 and NaN -0 -> NaN Invalid_operation
|
||||
dqand825 and NaN 0 -> NaN Invalid_operation
|
||||
dqand826 and NaN 1 -> NaN Invalid_operation
|
||||
dqand827 and NaN 1000 -> NaN Invalid_operation
|
||||
dqand828 and NaN Inf -> NaN Invalid_operation
|
||||
dqand829 and NaN NaN -> NaN Invalid_operation
|
||||
dqand830 and -Inf NaN -> NaN Invalid_operation
|
||||
dqand831 and -1000 NaN -> NaN Invalid_operation
|
||||
dqand832 and -1 NaN -> NaN Invalid_operation
|
||||
dqand833 and -0 NaN -> NaN Invalid_operation
|
||||
dqand834 and 0 NaN -> NaN Invalid_operation
|
||||
dqand835 and 1 NaN -> NaN Invalid_operation
|
||||
dqand836 and 1000 NaN -> NaN Invalid_operation
|
||||
dqand837 and Inf NaN -> NaN Invalid_operation
|
||||
|
||||
dqand841 and sNaN -Inf -> NaN Invalid_operation
|
||||
dqand842 and sNaN -1000 -> NaN Invalid_operation
|
||||
dqand843 and sNaN -1 -> NaN Invalid_operation
|
||||
dqand844 and sNaN -0 -> NaN Invalid_operation
|
||||
dqand845 and sNaN 0 -> NaN Invalid_operation
|
||||
dqand846 and sNaN 1 -> NaN Invalid_operation
|
||||
dqand847 and sNaN 1000 -> NaN Invalid_operation
|
||||
dqand848 and sNaN NaN -> NaN Invalid_operation
|
||||
dqand849 and sNaN sNaN -> NaN Invalid_operation
|
||||
dqand850 and NaN sNaN -> NaN Invalid_operation
|
||||
dqand851 and -Inf sNaN -> NaN Invalid_operation
|
||||
dqand852 and -1000 sNaN -> NaN Invalid_operation
|
||||
dqand853 and -1 sNaN -> NaN Invalid_operation
|
||||
dqand854 and -0 sNaN -> NaN Invalid_operation
|
||||
dqand855 and 0 sNaN -> NaN Invalid_operation
|
||||
dqand856 and 1 sNaN -> NaN Invalid_operation
|
||||
dqand857 and 1000 sNaN -> NaN Invalid_operation
|
||||
dqand858 and Inf sNaN -> NaN Invalid_operation
|
||||
dqand859 and NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
dqand861 and NaN1 -Inf -> NaN Invalid_operation
|
||||
dqand862 and +NaN2 -1000 -> NaN Invalid_operation
|
||||
dqand863 and NaN3 1000 -> NaN Invalid_operation
|
||||
dqand864 and NaN4 Inf -> NaN Invalid_operation
|
||||
dqand865 and NaN5 +NaN6 -> NaN Invalid_operation
|
||||
dqand866 and -Inf NaN7 -> NaN Invalid_operation
|
||||
dqand867 and -1000 NaN8 -> NaN Invalid_operation
|
||||
dqand868 and 1000 NaN9 -> NaN Invalid_operation
|
||||
dqand869 and Inf +NaN10 -> NaN Invalid_operation
|
||||
dqand871 and sNaN11 -Inf -> NaN Invalid_operation
|
||||
dqand872 and sNaN12 -1000 -> NaN Invalid_operation
|
||||
dqand873 and sNaN13 1000 -> NaN Invalid_operation
|
||||
dqand874 and sNaN14 NaN17 -> NaN Invalid_operation
|
||||
dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation
|
||||
dqand876 and NaN16 sNaN19 -> NaN Invalid_operation
|
||||
dqand877 and -Inf +sNaN20 -> NaN Invalid_operation
|
||||
dqand878 and -1000 sNaN21 -> NaN Invalid_operation
|
||||
dqand879 and 1000 sNaN22 -> NaN Invalid_operation
|
||||
dqand880 and Inf sNaN23 -> NaN Invalid_operation
|
||||
dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
|
||||
dqand882 and -NaN26 NaN28 -> NaN Invalid_operation
|
||||
dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
|
||||
dqand884 and 1000 -NaN30 -> NaN Invalid_operation
|
||||
dqand885 and 1000 -sNaN31 -> NaN Invalid_operation
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,372 @@
|
|||
------------------------------------------------------------------------
|
||||
-- dqCanonical.decTest -- test decQuad canonical results --
|
||||
-- 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
|
||||
|
||||
-- This file tests that copy operations leave uncanonical operands
|
||||
-- unchanged, and vice versa
|
||||
|
||||
-- All operands and results are decQuads.
|
||||
extended: 1
|
||||
clamp: 1
|
||||
precision: 34
|
||||
maxExponent: 6144
|
||||
minExponent: -6143
|
||||
rounding: half_even
|
||||
|
||||
-- Uncanonical declets are: abc, where:
|
||||
-- a=1,2,3
|
||||
-- b=6,7,e,f
|
||||
-- c=e,f
|
||||
|
||||
-- assert some standard (canonical) values; this tests that FromString
|
||||
-- produces canonical results (many more in decimalNN)
|
||||
dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan002 apply 0 -> #22080000000000000000000000000000
|
||||
dqcan003 apply 1 -> #22080000000000000000000000000001
|
||||
dqcan004 apply -1 -> #a2080000000000000000000000000001
|
||||
dqcan005 apply Infinity -> #78000000000000000000000000000000
|
||||
dqcan006 apply -Infinity -> #f8000000000000000000000000000000
|
||||
dqcan007 apply -NaN -> #fc000000000000000000000000000000
|
||||
dqcan008 apply -sNaN -> #fe000000000000000000000000000000
|
||||
dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan012 apply 7.50 -> #220780000000000000000000000003d0
|
||||
dqcan013 apply 9.99 -> #220780000000000000000000000000ff
|
||||
|
||||
-- Base tests for canonical encodings (individual operator
|
||||
-- propagation is tested later)
|
||||
|
||||
-- Finites: declets in coefficient
|
||||
dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
|
||||
-- NaN: declets in payload
|
||||
dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
|
||||
-- sNaN: declets in payload
|
||||
dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
|
||||
|
||||
-- Inf: exponent continuation bits
|
||||
dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
|
||||
-- Inf: coefficient continuation bits (first, last, and a few others)
|
||||
dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000
|
||||
dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000
|
||||
dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000
|
||||
dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000
|
||||
dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000
|
||||
dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000
|
||||
dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000
|
||||
dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000
|
||||
dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000
|
||||
dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000
|
||||
dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000
|
||||
dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000
|
||||
dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000
|
||||
dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000
|
||||
dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000
|
||||
dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000
|
||||
|
||||
|
||||
-- Now the operators -- trying to check paths that might fail to
|
||||
-- canonicalize propagated operands
|
||||
|
||||
----- Add:
|
||||
-- Finites: neutral 0
|
||||
dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
-- tiny zero
|
||||
dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
|
||||
dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
|
||||
-- tiny non zero
|
||||
dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
|
||||
dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
|
||||
-- NaN: declets in payload
|
||||
dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN: declets in payload
|
||||
dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
|
||||
dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
|
||||
dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000
|
||||
dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
|
||||
|
||||
----- Class: [does not return encoded]
|
||||
|
||||
----- Compare:
|
||||
dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001
|
||||
dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000
|
||||
dqcan233 compare 1 -Inf -> #22080000000000000000000000000001
|
||||
dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
|
||||
----- CompareSig:
|
||||
dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001
|
||||
dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000
|
||||
dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001
|
||||
dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
|
||||
----- Copy: [does not usually canonicalize]
|
||||
-- finites
|
||||
dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
|
||||
dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff
|
||||
-- NaNs
|
||||
dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
|
||||
dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN
|
||||
dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
|
||||
dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- Inf
|
||||
dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000
|
||||
dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000
|
||||
|
||||
----- CopyAbs: [does not usually canonicalize]
|
||||
-- finites
|
||||
dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
|
||||
dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
|
||||
-- NaNs
|
||||
dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
|
||||
dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN
|
||||
dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
|
||||
dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- Inf
|
||||
dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000
|
||||
dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000
|
||||
|
||||
----- CopyNegate: [does not usually canonicalize]
|
||||
-- finites
|
||||
dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff
|
||||
dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
|
||||
-- NaNs
|
||||
dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff
|
||||
dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN
|
||||
dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff
|
||||
dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- Inf
|
||||
dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000
|
||||
dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000
|
||||
|
||||
----- CopySign: [does not usually canonicalize]
|
||||
-- finites
|
||||
dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff
|
||||
dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff
|
||||
-- NaNs
|
||||
dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff
|
||||
dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN
|
||||
dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff
|
||||
dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- Inf
|
||||
dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000
|
||||
dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000
|
||||
|
||||
----- Multiply:
|
||||
-- Finites: neutral 0
|
||||
dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000
|
||||
dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000
|
||||
-- negative
|
||||
dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000
|
||||
dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000
|
||||
-- NaN: declets in payload
|
||||
dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
|
||||
dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
|
||||
dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
|
||||
-- sNaN: declets in payload
|
||||
dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
|
||||
dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
|
||||
dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000
|
||||
dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000
|
||||
dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000
|
||||
|
||||
----- Quantize:
|
||||
dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000
|
||||
dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000
|
||||
dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
|
||||
----- Subtract:
|
||||
-- Finites: neutral 0
|
||||
dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
|
||||
-- tiny zero
|
||||
dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded
|
||||
dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
|
||||
-- tiny non zero
|
||||
dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
|
||||
dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
|
||||
-- NaN: declets in payload
|
||||
dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- NaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
-- sNaN: declets in payload
|
||||
dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
-- sNaN: exponent continuation bits [excluding sNaN selector]
|
||||
dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
-- Inf: exponent continuation bits
|
||||
dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000
|
||||
dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
|
||||
-- Inf: coefficient continuation bits
|
||||
dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000
|
||||
dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
|
||||
dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000
|
||||
dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
|
||||
dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000
|
||||
dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
|
||||
|
||||
----- ToIntegral:
|
||||
dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000
|
||||
dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff
|
||||
dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
|
||||
-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
|
||||
dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff
|
||||
dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded
|
||||
dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded
|
||||
dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded
|
||||
dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff
|
||||
dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded
|
||||
dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded
|
||||
dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
------------------------------------------------------------------------
|
||||
-- dqClass.decTest -- decQuad Class operations --
|
||||
-- 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
|
||||
|
||||
-- [New 2006.11.27]
|
||||
|
||||
extended: 1
|
||||
clamp: 1
|
||||
precision: 34
|
||||
maxExponent: 6144
|
||||
minExponent: -6143
|
||||
rounding: half_even
|
||||
|
||||
dqcla001 class 0 -> +Zero
|
||||
dqcla002 class 0.00 -> +Zero
|
||||
dqcla003 class 0E+5 -> +Zero
|
||||
dqcla004 class 1E-6176 -> +Subnormal
|
||||
dqcla005 class 0.1E-6143 -> +Subnormal
|
||||
dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal
|
||||
dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal
|
||||
dqcla008 class 1E-6143 -> +Normal
|
||||
dqcla009 class 1E-100 -> +Normal
|
||||
dqcla010 class 1E-10 -> +Normal
|
||||
dqcla012 class 1E-1 -> +Normal
|
||||
dqcla013 class 1 -> +Normal
|
||||
dqcla014 class 2.50 -> +Normal
|
||||
dqcla015 class 100.100 -> +Normal
|
||||
dqcla016 class 1E+30 -> +Normal
|
||||
dqcla017 class 1E+6144 -> +Normal
|
||||
dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal
|
||||
dqcla019 class Inf -> +Infinity
|
||||
|
||||
dqcla021 class -0 -> -Zero
|
||||
dqcla022 class -0.00 -> -Zero
|
||||
dqcla023 class -0E+5 -> -Zero
|
||||
dqcla024 class -1E-6176 -> -Subnormal
|
||||
dqcla025 class -0.1E-6143 -> -Subnormal
|
||||
dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal
|
||||
dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal
|
||||
dqcla028 class -1E-6143 -> -Normal
|
||||
dqcla029 class -1E-100 -> -Normal
|
||||
dqcla030 class -1E-10 -> -Normal
|
||||
dqcla032 class -1E-1 -> -Normal
|
||||
dqcla033 class -1 -> -Normal
|
||||
dqcla034 class -2.50 -> -Normal
|
||||
dqcla035 class -100.100 -> -Normal
|
||||
dqcla036 class -1E+30 -> -Normal
|
||||
dqcla037 class -1E+6144 -> -Normal
|
||||
dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal
|
||||
dqcla039 class -Inf -> -Infinity
|
||||
|
||||
dqcla041 class NaN -> NaN
|
||||
dqcla042 class -NaN -> NaN
|
||||
dqcla043 class +NaN12345 -> NaN
|
||||
dqcla044 class sNaN -> sNaN
|
||||
dqcla045 class -sNaN -> sNaN
|
||||
dqcla046 class +sNaN12345 -> sNaN
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue