summaryrefslogtreecommitdiffstats
path: root/Lib/test/decimaltestdata/base.decTest
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2007-09-19 03:06:30 (GMT)
committerThomas Wouters <thomas@python.org>2007-09-19 03:06:30 (GMT)
commit1b7f891f416830d0c46ca1c9e1bfe62f05cda655 (patch)
treefc092d34bebe4223a3026d1992bf17cc0ea2b2b0 /Lib/test/decimaltestdata/base.decTest
parent782d6b44a1cc003106bac3a310d3e4ac3768adbd (diff)
downloadcpython-1b7f891f416830d0c46ca1c9e1bfe62f05cda655.zip
cpython-1b7f891f416830d0c46ca1c9e1bfe62f05cda655.tar.gz
cpython-1b7f891f416830d0c46ca1c9e1bfe62f05cda655.tar.bz2
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. ........
Diffstat (limited to 'Lib/test/decimaltestdata/base.decTest')
-rw-r--r--Lib/test/decimaltestdata/base.decTest363
1 files changed, 251 insertions, 112 deletions
diff --git a/Lib/test/decimaltestdata/base.decTest b/Lib/test/decimaltestdata/base.decTest
index 96a4b9d..de0b813 100644
--- a/Lib/test/decimaltestdata/base.decTest
+++ b/Lib/test/decimaltestdata/base.decTest
@@ -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
+
+