Python-checkins
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
February 2004
- 53 participants
- 308 discussions

python/dist/src/Lib/test test_types.py, 1.55, 1.55.8.1
by doerwalter@users.sourceforge.net Feb. 6, 2004
by doerwalter@users.sourceforge.net Feb. 6, 2004
Feb. 6, 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8790/Lib/test
Modified Files:
Tag: release23-maint
test_types.py
Log Message:
Backport checkin:
Fix test failure message (from SF patch #885008)
Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.55
retrieving revision 1.55.8.1
diff -C2 -d -r1.55 -r1.55.8.1
*** test_types.py 17 Jun 2003 19:27:39 -0000 1.55
--- test_types.py 6 Feb 2004 18:33:11 -0000 1.55.8.1
***************
*** 33,37 ****
if 0 or 0: raise TestFailed, '0 or 0 is true instead of false'
if 1 and 1: pass
! else: raise TestFailed, '1 and 1 is false instead of false'
if not 1: raise TestFailed, 'not 1 is true instead of false'
--- 33,37 ----
if 0 or 0: raise TestFailed, '0 or 0 is true instead of false'
if 1 and 1: pass
! else: raise TestFailed, '1 and 1 is false instead of true'
if not 1: raise TestFailed, 'not 1 is true instead of false'
1
0

Feb. 6, 2004
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8122
Modified Files:
ceval.c
Log Message:
SF patch #864059: optimize eval_frame
Simplified version of Neal Norwitz's patch which adds gotos for
opcodes that set "why". This skips a number of tests where the
outcome of the tests are known in advance.
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.373
retrieving revision 2.374
diff -C2 -d -r2.373 -r2.374
*** ceval.c 20 Nov 2003 01:44:58 -0000 2.373
--- ceval.c 6 Feb 2004 18:32:33 -0000 2.374
***************
*** 1579,1588 ****
case BREAK_LOOP:
why = WHY_BREAK;
! break;
case CONTINUE_LOOP:
retval = PyInt_FromLong(oparg);
why = WHY_CONTINUE;
! break;
case RAISE_VARARGS:
--- 1579,1588 ----
case BREAK_LOOP:
why = WHY_BREAK;
! goto fast_block_end;
case CONTINUE_LOOP:
retval = PyInt_FromLong(oparg);
why = WHY_CONTINUE;
! goto fast_block_end;
case RAISE_VARARGS:
***************
*** 1621,1625 ****
retval = POP();
why = WHY_RETURN;
! break;
case YIELD_VALUE:
--- 1621,1625 ----
retval = POP();
why = WHY_RETURN;
! goto fast_block_end;
case YIELD_VALUE:
***************
*** 1627,1632 ****
f->f_stacktop = stack_pointer;
why = WHY_YIELD;
! break;
!
case EXEC_STMT:
--- 1627,1631 ----
f->f_stacktop = stack_pointer;
why = WHY_YIELD;
! goto fast_yield;
case EXEC_STMT:
***************
*** 2328,2331 ****
--- 2327,2331 ----
/* Unwind stacks if a (pseudo) exception occurred */
+ fast_block_end:
while (why != WHY_NOT && why != WHY_YIELD && f->f_iblock > 0) {
PyTryBlock *b = PyFrame_BlockPop(f);
***************
*** 2411,2414 ****
--- 2411,2415 ----
retval = NULL;
+ fast_yield:
if (tstate->use_tracing) {
if (tstate->c_tracefunc
1
0

Feb. 6, 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8301/Lib/test
Modified Files:
test_types.py
Log Message:
Fix test failure message (from SF patch #885008)
Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** test_types.py 8 Dec 2003 11:38:45 -0000 1.56
--- test_types.py 6 Feb 2004 18:30:31 -0000 1.57
***************
*** 29,33 ****
if 0 or 0: raise TestFailed, '0 or 0 is true instead of false'
if 1 and 1: pass
! else: raise TestFailed, '1 and 1 is false instead of false'
if not 1: raise TestFailed, 'not 1 is true instead of false'
--- 29,33 ----
if 0 or 0: raise TestFailed, '0 or 0 is true instead of false'
if 1 and 1: pass
! else: raise TestFailed, '1 and 1 is false instead of true'
if not 1: raise TestFailed, 'not 1 is true instead of false'
1
0

Feb. 6, 2004
Update of /cvsroot/python/python/nondist/sandbox/decimal/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18673/tests
Modified Files:
abs.decTest add.decTest base.decTest clamp.decTest
compare.decTest divide.decTest divideint.decTest
inexact.decTest max.decTest min.decTest minus.decTest
multiply.decTest normalize.decTest plus.decTest power.decTest
quantize.decTest randomBound32.decTest randoms.decTest
remainder.decTest remainderNear.decTest rescale.decTest
rounding.decTest squareroot.decTest subtract.decTest
testall.decTest tointegral.decTest trim.decTest
Added Files:
samequantum.decTest
Log Message:
Added new tests, fix Decimal/test_Decimal to have samequantum.
--- NEW FILE: samequantum.decTest ---
------------------------------------------------------------------------
-- samequantum.decTest -- check quantums match --
-- Copyright (c) IBM Corporation, 2001, 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(a)uk.ibm.com --
------------------------------------------------------------------------
version: 2.35
extended: 1
precision: 9
rounding: half_up
maxExponent: 999
minExponent: -999
samq001 samequantum 0 0 -> 1
samq002 samequantum 0 1 -> 1
samq003 samequantum 1 0 -> 1
samq004 samequantum 1 1 -> 1
samq011 samequantum 10 1E+1 -> 0
samq012 samequantum 10E+1 10E+1 -> 1
samq013 samequantum 100 10E+1 -> 0
samq014 samequantum 100 1E+2 -> 0
samq015 samequantum 0.1 1E-2 -> 0
samq016 samequantum 0.1 1E-1 -> 1
samq017 samequantum 0.1 1E-0 -> 0
samq018 samequantum 999 999 -> 1
samq019 samequantum 999E-1 99.9 -> 1
samq020 samequantum 111E-1 22.2 -> 1
samq021 samequantum 111E-1 1234.2 -> 1
-- zeros
samq030 samequantum 0.0 1.1 -> 1
samq031 samequantum 0.0 1.11 -> 0
samq032 samequantum 0.0 0 -> 0
samq033 samequantum 0.0 0.0 -> 1
samq034 samequantum 0.0 0.00 -> 0
samq035 samequantum 0E+1 0E+0 -> 0
samq036 samequantum 0E+1 0E+1 -> 1
samq037 samequantum 0E+1 0E+2 -> 0
samq038 samequantum 0E-17 0E-16 -> 0
samq039 samequantum 0E-17 0E-17 -> 1
samq040 samequantum 0E-17 0E-18 -> 0
samq041 samequantum 0E-17 0.0E-15 -> 0
samq042 samequantum 0E-17 0.0E-16 -> 1
samq043 samequantum 0E-17 0.0E-17 -> 0
samq044 samequantum -0E-17 0.0E-16 -> 1
samq045 samequantum 0E-17 -0.0E-17 -> 0
samq046 samequantum 0E-17 -0.0E-16 -> 1
samq047 samequantum -0E-17 0.0E-17 -> 0
samq048 samequantum -0E-17 -0.0E-16 -> 1
samq049 samequantum -0E-17 -0.0E-17 -> 0
-- specials & combinations
samq0110 samequantum -Inf -Inf -> 1
samq0111 samequantum -Inf Inf -> 1
samq0112 samequantum -Inf NaN -> 0
samq0113 samequantum -Inf -7E+3 -> 0
samq0114 samequantum -Inf -7 -> 0
samq0115 samequantum -Inf -7E-3 -> 0
samq0116 samequantum -Inf -0E-3 -> 0
samq0117 samequantum -Inf -0 -> 0
samq0118 samequantum -Inf -0E+3 -> 0
samq0119 samequantum -Inf 0E-3 -> 0
samq0120 samequantum -Inf 0 -> 0
samq0121 samequantum -Inf 0E+3 -> 0
samq0122 samequantum -Inf 7E-3 -> 0
samq0123 samequantum -Inf 7 -> 0
samq0124 samequantum -Inf 7E+3 -> 0
samq0125 samequantum -Inf sNaN -> 0
samq0210 samequantum Inf -Inf -> 1
samq0211 samequantum Inf Inf -> 1
samq0212 samequantum Inf NaN -> 0
samq0213 samequantum Inf -7E+3 -> 0
samq0214 samequantum Inf -7 -> 0
samq0215 samequantum Inf -7E-3 -> 0
samq0216 samequantum Inf -0E-3 -> 0
samq0217 samequantum Inf -0 -> 0
samq0218 samequantum Inf -0E+3 -> 0
samq0219 samequantum Inf 0E-3 -> 0
samq0220 samequantum Inf 0 -> 0
samq0221 samequantum Inf 0E+3 -> 0
samq0222 samequantum Inf 7E-3 -> 0
samq0223 samequantum Inf 7 -> 0
samq0224 samequantum Inf 7E+3 -> 0
samq0225 samequantum Inf sNaN -> 0
samq0310 samequantum NaN -Inf -> 0
samq0311 samequantum NaN Inf -> 0
samq0312 samequantum NaN NaN -> 1
samq0313 samequantum NaN -7E+3 -> 0
samq0314 samequantum NaN -7 -> 0
samq0315 samequantum NaN -7E-3 -> 0
samq0316 samequantum NaN -0E-3 -> 0
samq0317 samequantum NaN -0 -> 0
samq0318 samequantum NaN -0E+3 -> 0
samq0319 samequantum NaN 0E-3 -> 0
samq0320 samequantum NaN 0 -> 0
samq0321 samequantum NaN 0E+3 -> 0
samq0322 samequantum NaN 7E-3 -> 0
samq0323 samequantum NaN 7 -> 0
samq0324 samequantum NaN 7E+3 -> 0
samq0325 samequantum NaN sNaN -> 1
samq0410 samequantum -7E+3 -Inf -> 0
samq0411 samequantum -7E+3 Inf -> 0
samq0412 samequantum -7E+3 NaN -> 0
samq0413 samequantum -7E+3 -7E+3 -> 1
samq0414 samequantum -7E+3 -7 -> 0
samq0415 samequantum -7E+3 -7E-3 -> 0
samq0416 samequantum -7E+3 -0E-3 -> 0
samq0417 samequantum -7E+3 -0 -> 0
samq0418 samequantum -7E+3 -0E+3 -> 1
samq0419 samequantum -7E+3 0E-3 -> 0
samq0420 samequantum -7E+3 0 -> 0
samq0421 samequantum -7E+3 0E+3 -> 1
samq0422 samequantum -7E+3 7E-3 -> 0
samq0423 samequantum -7E+3 7 -> 0
samq0424 samequantum -7E+3 7E+3 -> 1
samq0425 samequantum -7E+3 sNaN -> 0
samq0510 samequantum -7 -Inf -> 0
samq0511 samequantum -7 Inf -> 0
samq0512 samequantum -7 NaN -> 0
samq0513 samequantum -7 -7E+3 -> 0
samq0514 samequantum -7 -7 -> 1
samq0515 samequantum -7 -7E-3 -> 0
samq0516 samequantum -7 -0E-3 -> 0
samq0517 samequantum -7 -0 -> 1
samq0518 samequantum -7 -0E+3 -> 0
samq0519 samequantum -7 0E-3 -> 0
samq0520 samequantum -7 0 -> 1
samq0521 samequantum -7 0E+3 -> 0
samq0522 samequantum -7 7E-3 -> 0
samq0523 samequantum -7 7 -> 1
samq0524 samequantum -7 7E+3 -> 0
samq0525 samequantum -7 sNaN -> 0
samq0610 samequantum -7E-3 -Inf -> 0
samq0611 samequantum -7E-3 Inf -> 0
samq0612 samequantum -7E-3 NaN -> 0
samq0613 samequantum -7E-3 -7E+3 -> 0
samq0614 samequantum -7E-3 -7 -> 0
samq0615 samequantum -7E-3 -7E-3 -> 1
samq0616 samequantum -7E-3 -0E-3 -> 1
samq0617 samequantum -7E-3 -0 -> 0
samq0618 samequantum -7E-3 -0E+3 -> 0
samq0619 samequantum -7E-3 0E-3 -> 1
samq0620 samequantum -7E-3 0 -> 0
samq0621 samequantum -7E-3 0E+3 -> 0
samq0622 samequantum -7E-3 7E-3 -> 1
samq0623 samequantum -7E-3 7 -> 0
samq0624 samequantum -7E-3 7E+3 -> 0
samq0625 samequantum -7E-3 sNaN -> 0
samq0710 samequantum -0E-3 -Inf -> 0
samq0711 samequantum -0E-3 Inf -> 0
samq0712 samequantum -0E-3 NaN -> 0
samq0713 samequantum -0E-3 -7E+3 -> 0
samq0714 samequantum -0E-3 -7 -> 0
samq0715 samequantum -0E-3 -7E-3 -> 1
samq0716 samequantum -0E-3 -0E-3 -> 1
samq0717 samequantum -0E-3 -0 -> 0
samq0718 samequantum -0E-3 -0E+3 -> 0
samq0719 samequantum -0E-3 0E-3 -> 1
samq0720 samequantum -0E-3 0 -> 0
samq0721 samequantum -0E-3 0E+3 -> 0
samq0722 samequantum -0E-3 7E-3 -> 1
samq0723 samequantum -0E-3 7 -> 0
samq0724 samequantum -0E-3 7E+3 -> 0
samq0725 samequantum -0E-3 sNaN -> 0
samq0810 samequantum -0 -Inf -> 0
samq0811 samequantum -0 Inf -> 0
samq0812 samequantum -0 NaN -> 0
samq0813 samequantum -0 -7E+3 -> 0
samq0814 samequantum -0 -7 -> 1
samq0815 samequantum -0 -7E-3 -> 0
samq0816 samequantum -0 -0E-3 -> 0
samq0817 samequantum -0 -0 -> 1
samq0818 samequantum -0 -0E+3 -> 0
samq0819 samequantum -0 0E-3 -> 0
samq0820 samequantum -0 0 -> 1
samq0821 samequantum -0 0E+3 -> 0
samq0822 samequantum -0 7E-3 -> 0
samq0823 samequantum -0 7 -> 1
samq0824 samequantum -0 7E+3 -> 0
samq0825 samequantum -0 sNaN -> 0
samq0910 samequantum -0E+3 -Inf -> 0
samq0911 samequantum -0E+3 Inf -> 0
samq0912 samequantum -0E+3 NaN -> 0
samq0913 samequantum -0E+3 -7E+3 -> 1
samq0914 samequantum -0E+3 -7 -> 0
samq0915 samequantum -0E+3 -7E-3 -> 0
samq0916 samequantum -0E+3 -0E-3 -> 0
samq0917 samequantum -0E+3 -0 -> 0
samq0918 samequantum -0E+3 -0E+3 -> 1
samq0919 samequantum -0E+3 0E-3 -> 0
samq0920 samequantum -0E+3 0 -> 0
samq0921 samequantum -0E+3 0E+3 -> 1
samq0922 samequantum -0E+3 7E-3 -> 0
samq0923 samequantum -0E+3 7 -> 0
samq0924 samequantum -0E+3 7E+3 -> 1
samq0925 samequantum -0E+3 sNaN -> 0
samq1110 samequantum 0E-3 -Inf -> 0
samq1111 samequantum 0E-3 Inf -> 0
samq1112 samequantum 0E-3 NaN -> 0
samq1113 samequantum 0E-3 -7E+3 -> 0
samq1114 samequantum 0E-3 -7 -> 0
samq1115 samequantum 0E-3 -7E-3 -> 1
samq1116 samequantum 0E-3 -0E-3 -> 1
samq1117 samequantum 0E-3 -0 -> 0
samq1118 samequantum 0E-3 -0E+3 -> 0
samq1119 samequantum 0E-3 0E-3 -> 1
samq1120 samequantum 0E-3 0 -> 0
samq1121 samequantum 0E-3 0E+3 -> 0
samq1122 samequantum 0E-3 7E-3 -> 1
samq1123 samequantum 0E-3 7 -> 0
samq1124 samequantum 0E-3 7E+3 -> 0
samq1125 samequantum 0E-3 sNaN -> 0
samq1210 samequantum 0 -Inf -> 0
samq1211 samequantum 0 Inf -> 0
samq1212 samequantum 0 NaN -> 0
samq1213 samequantum 0 -7E+3 -> 0
samq1214 samequantum 0 -7 -> 1
samq1215 samequantum 0 -7E-3 -> 0
samq1216 samequantum 0 -0E-3 -> 0
samq1217 samequantum 0 -0 -> 1
samq1218 samequantum 0 -0E+3 -> 0
samq1219 samequantum 0 0E-3 -> 0
samq1220 samequantum 0 0 -> 1
samq1221 samequantum 0 0E+3 -> 0
samq1222 samequantum 0 7E-3 -> 0
samq1223 samequantum 0 7 -> 1
samq1224 samequantum 0 7E+3 -> 0
samq1225 samequantum 0 sNaN -> 0
samq1310 samequantum 0E+3 -Inf -> 0
samq1311 samequantum 0E+3 Inf -> 0
samq1312 samequantum 0E+3 NaN -> 0
samq1313 samequantum 0E+3 -7E+3 -> 1
samq1314 samequantum 0E+3 -7 -> 0
samq1315 samequantum 0E+3 -7E-3 -> 0
samq1316 samequantum 0E+3 -0E-3 -> 0
samq1317 samequantum 0E+3 -0 -> 0
samq1318 samequantum 0E+3 -0E+3 -> 1
samq1319 samequantum 0E+3 0E-3 -> 0
samq1320 samequantum 0E+3 0 -> 0
samq1321 samequantum 0E+3 0E+3 -> 1
samq1322 samequantum 0E+3 7E-3 -> 0
samq1323 samequantum 0E+3 7 -> 0
samq1324 samequantum 0E+3 7E+3 -> 1
samq1325 samequantum 0E+3 sNaN -> 0
samq1410 samequantum 7E-3 -Inf -> 0
samq1411 samequantum 7E-3 Inf -> 0
samq1412 samequantum 7E-3 NaN -> 0
samq1413 samequantum 7E-3 -7E+3 -> 0
samq1414 samequantum 7E-3 -7 -> 0
samq1415 samequantum 7E-3 -7E-3 -> 1
samq1416 samequantum 7E-3 -0E-3 -> 1
samq1417 samequantum 7E-3 -0 -> 0
samq1418 samequantum 7E-3 -0E+3 -> 0
samq1419 samequantum 7E-3 0E-3 -> 1
samq1420 samequantum 7E-3 0 -> 0
samq1421 samequantum 7E-3 0E+3 -> 0
samq1422 samequantum 7E-3 7E-3 -> 1
samq1423 samequantum 7E-3 7 -> 0
samq1424 samequantum 7E-3 7E+3 -> 0
samq1425 samequantum 7E-3 sNaN -> 0
samq1510 samequantum 7 -Inf -> 0
samq1511 samequantum 7 Inf -> 0
samq1512 samequantum 7 NaN -> 0
samq1513 samequantum 7 -7E+3 -> 0
samq1514 samequantum 7 -7 -> 1
samq1515 samequantum 7 -7E-3 -> 0
samq1516 samequantum 7 -0E-3 -> 0
samq1517 samequantum 7 -0 -> 1
samq1518 samequantum 7 -0E+3 -> 0
samq1519 samequantum 7 0E-3 -> 0
samq1520 samequantum 7 0 -> 1
samq1521 samequantum 7 0E+3 -> 0
samq1522 samequantum 7 7E-3 -> 0
samq1523 samequantum 7 7 -> 1
samq1524 samequantum 7 7E+3 -> 0
samq1525 samequantum 7 sNaN -> 0
samq1610 samequantum 7E+3 -Inf -> 0
samq1611 samequantum 7E+3 Inf -> 0
samq1612 samequantum 7E+3 NaN -> 0
samq1613 samequantum 7E+3 -7E+3 -> 1
samq1614 samequantum 7E+3 -7 -> 0
samq1615 samequantum 7E+3 -7E-3 -> 0
samq1616 samequantum 7E+3 -0E-3 -> 0
samq1617 samequantum 7E+3 -0 -> 0
samq1618 samequantum 7E+3 -0E+3 -> 1
samq1619 samequantum 7E+3 0E-3 -> 0
samq1620 samequantum 7E+3 0 -> 0
samq1621 samequantum 7E+3 0E+3 -> 1
samq1622 samequantum 7E+3 7E-3 -> 0
samq1623 samequantum 7E+3 7 -> 0
samq1624 samequantum 7E+3 7E+3 -> 1
samq1625 samequantum 7E+3 sNaN -> 0
samq1710 samequantum sNaN -Inf -> 0
samq1711 samequantum sNaN Inf -> 0
samq1712 samequantum sNaN NaN -> 1
samq1713 samequantum sNaN -7E+3 -> 0
samq1714 samequantum sNaN -7 -> 0
samq1715 samequantum sNaN -7E-3 -> 0
samq1716 samequantum sNaN -0E-3 -> 0
samq1717 samequantum sNaN -0 -> 0
samq1718 samequantum sNaN -0E+3 -> 0
samq1719 samequantum sNaN 0E-3 -> 0
samq1720 samequantum sNaN 0 -> 0
samq1721 samequantum sNaN 0E+3 -> 0
samq1722 samequantum sNaN 7E-3 -> 0
samq1723 samequantum sNaN 7 -> 0
samq1724 samequantum sNaN 7E+3 -> 0
samq1725 samequantum sNaN sNaN -> 1
-- noisy NaNs
samq1730 samequantum sNaN3 sNaN3 -> 1
samq1731 samequantum sNaN3 sNaN4 -> 1
samq1732 samequantum NaN3 NaN3 -> 1
samq1733 samequantum NaN3 NaN4 -> 1
samq1734 samequantum sNaN3 3 -> 0
samq1735 samequantum NaN3 3 -> 0
samq1736 samequantum 4 sNaN4 -> 0
samq1737 samequantum 3 NaN3 -> 0
samq1738 samequantum Inf sNaN4 -> 0
samq1739 samequantum -Inf NaN3 -> 0
Index: abs.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/abs.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** abs.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- abs.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of tests primarily tests the existence of the operator.
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of tests primarily tests the existence of the operator.
***************
*** 151,155 ****
absx521 abs '-Inf' -> 'Infinity'
absx522 abs NaN -> NaN
! absx523 abs sNaN -> NaN Invalid_operation
-- Null tests
--- 151,159 ----
absx521 abs '-Inf' -> 'Infinity'
absx522 abs NaN -> NaN
! absx523 abs sNaN -> NaN Invalid_operation
! absx524 abs NaN22 -> NaN22
! absx525 abs sNaN33 -> NaN33 Invalid_operation
! absx526 abs -NaN22 -> -NaN22
! absx527 abs -sNaN33 -> -NaN33 Invalid_operation
-- Null tests
Index: add.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/add.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** add.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- add.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
precision: 9
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
precision: 9
***************
*** 833,836 ****
--- 833,837 ----
addx792 add 1 -Inf -> -Infinity
addx793 add 1000 -Inf -> -Infinity
+ addx794 add Inf -Inf -> NaN Invalid_operation
addx800 add Inf -Inf -> NaN Invalid_operation
***************
*** 889,916 ****
addx859 add NaN sNaN -> NaN Invalid_operation
-- overflow, underflow and subnormal tests
maxexponent: 999999999
minexponent: -999999999
precision: 9
! addx860 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded
! addx861 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded
! addx862 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal
! addx863 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal
! addx864 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal
! addx865 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal
! addx866 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded
! addx867 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded
! addx868 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal
! addx869 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal
! addx870 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal
! addx871 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal
! addx872 add -1E+999999999 +9E+999999999 -> 8E+999999999
! addx873 add -9E+999999999 +1E+999999999 -> -8E+999999999
precision: 3
! addx880 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded
! addx881 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
! addx882 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded
! addx883 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
precision: 3
--- 890,943 ----
addx859 add NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ addx861 add NaN1 -Inf -> NaN1
+ addx862 add +NaN2 -1000 -> NaN2
+ addx863 add NaN3 1000 -> NaN3
+ addx864 add NaN4 Inf -> NaN4
+ addx865 add NaN5 +NaN6 -> NaN5
+ addx866 add -Inf NaN7 -> NaN7
+ addx867 add -1000 NaN8 -> NaN8
+ addx868 add 1000 NaN9 -> NaN9
+ addx869 add Inf +NaN10 -> NaN10
+ addx871 add sNaN11 -Inf -> NaN11 Invalid_operation
+ addx872 add sNaN12 -1000 -> NaN12 Invalid_operation
+ addx873 add sNaN13 1000 -> NaN13 Invalid_operation
+ addx874 add sNaN14 NaN17 -> NaN14 Invalid_operation
+ addx875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
+ addx876 add NaN16 sNaN19 -> NaN19 Invalid_operation
+ addx877 add -Inf +sNaN20 -> NaN20 Invalid_operation
+ addx878 add -1000 sNaN21 -> NaN21 Invalid_operation
+ addx879 add 1000 sNaN22 -> NaN22 Invalid_operation
+ addx880 add Inf sNaN23 -> NaN23 Invalid_operation
+ addx881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ addx882 add -NaN26 NaN28 -> -NaN26
+ addx883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ addx884 add 1000 -NaN30 -> -NaN30
+ addx885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
+
-- overflow, underflow and subnormal tests
maxexponent: 999999999
minexponent: -999999999
precision: 9
! addx890 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded
! addx891 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded
! addx892 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal
! addx893 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal
! addx894 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal
! addx895 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal
! addx896 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded
! addx897 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded
! addx898 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal
! addx899 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal
! addx900 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal
! addx901 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal
! addx902 add -1E+999999999 +9E+999999999 -> 8E+999999999
! addx903 add -9E+999999999 +1E+999999999 -> -8E+999999999
precision: 3
! addx904 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded
! addx905 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
! addx906 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded
! addx907 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
precision: 3
***************
*** 968,971 ****
--- 995,1031 ----
addx971 add 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+ -- check overflow edge case
+ precision: 7
+ rounding: half_up
+ maxExponent: 96
+ minExponent: -95
+ addx972 apply 9.999999E+96 -> 9.999999E+96
+ addx973 add 9.999999E+96 1 -> 9.999999E+96 Inexact Rounded
+ addx974 add 9999999E+90 1 -> 9.999999E+96 Inexact Rounded
+ addx975 add 9999999E+90 1E+90 -> Infinity Overflow Inexact Rounded
+ addx976 add 9999999E+90 9E+89 -> Infinity Overflow Inexact Rounded
+ addx977 add 9999999E+90 8E+89 -> Infinity Overflow Inexact Rounded
+ addx978 add 9999999E+90 7E+89 -> Infinity Overflow Inexact Rounded
+ addx979 add 9999999E+90 6E+89 -> Infinity Overflow Inexact Rounded
+ addx980 add 9999999E+90 5E+89 -> Infinity Overflow Inexact Rounded
+ addx981 add 9999999E+90 4E+89 -> 9.999999E+96 Inexact Rounded
+ addx982 add 9999999E+90 3E+89 -> 9.999999E+96 Inexact Rounded
+ addx983 add 9999999E+90 2E+89 -> 9.999999E+96 Inexact Rounded
+ addx984 add 9999999E+90 1E+89 -> 9.999999E+96 Inexact Rounded
+
+ addx985 apply -9.999999E+96 -> -9.999999E+96
+ addx986 add -9.999999E+96 -1 -> -9.999999E+96 Inexact Rounded
+ addx987 add -9999999E+90 -1 -> -9.999999E+96 Inexact Rounded
+ addx988 add -9999999E+90 -1E+90 -> -Infinity Overflow Inexact Rounded
+ addx989 add -9999999E+90 -9E+89 -> -Infinity Overflow Inexact Rounded
+ addx990 add -9999999E+90 -8E+89 -> -Infinity Overflow Inexact Rounded
+ addx991 add -9999999E+90 -7E+89 -> -Infinity Overflow Inexact Rounded
+ addx992 add -9999999E+90 -6E+89 -> -Infinity Overflow Inexact Rounded
+ addx993 add -9999999E+90 -5E+89 -> -Infinity Overflow Inexact Rounded
+ addx994 add -9999999E+90 -4E+89 -> -9.999999E+96 Inexact Rounded
+ addx995 add -9999999E+90 -3E+89 -> -9.999999E+96 Inexact Rounded
+ addx996 add -9999999E+90 -2E+89 -> -9.999999E+96 Inexact Rounded
+ addx997 add -9999999E+90 -1E+89 -> -9.999999E+96 Inexact Rounded
+
-- check for double-rounded subnormals
precision: 5
Index: base.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/base.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** base.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- base.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This file tests base conversions from string to a decimal number
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This file tests base conversions from string to a decimal number
***************
*** 353,356 ****
--- 353,357 ----
basx411 toSci 7E-13 -> 7E-13
basx412 toEng 7E-13 -> 700E-15
+
-- Exacts remain exact up to precision ..
precision: 9
***************
*** 566,597 ****
basx567 toSci "Infinit" -> NaN Conversion_syntax
basx568 toSci "-Infinit" -> NaN Conversion_syntax
! basx569 toSci "-sNa" -> NaN Conversion_syntax
-- subnormals and overflows
! basx570 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
! basx571 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
! basx572 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal
! basx573 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal
! basx574 toSci '0.1e1000000000' -> 1E+999999999
! basx575 toSci '10e-1000000000' -> 1.0E-999999999
! basx576 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
! basx577 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded
! basx578 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
! basx579 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded
! basx580 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded
! basx581 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
-- negatives the same
! basx582 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
! basx583 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
! basx584 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal
! basx585 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal
! basx586 toSci '-0.1e1000000000' -> -1E+999999999
! basx587 toSci '-10e-1000000000' -> -1.0E-999999999
! basx588 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
! basx589 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded
! basx590 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
! basx591 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded
! basx592 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded
! basx593 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-- Zeros
--- 567,604 ----
basx567 toSci "Infinit" -> NaN Conversion_syntax
basx568 toSci "-Infinit" -> NaN Conversion_syntax
! basx569 toSci "0Inf" -> NaN Conversion_syntax
! basx570 toSci "9Inf" -> NaN Conversion_syntax
! basx571 toSci "-0Inf" -> NaN Conversion_syntax
! basx572 toSci "-9Inf" -> NaN Conversion_syntax
! 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
-- Zeros
***************
*** 675,716 ****
-- Specials
basx700 toSci "NaN" -> NaN
basx701 toSci "nan" -> NaN
basx702 toSci "nAn" -> NaN
basx703 toSci "NAN" -> NaN
! basx704 toSci "+NaN" -> NaN Conversion_syntax
! basx705 toSci "+nan" -> NaN Conversion_syntax
! basx706 toSci "+nAn" -> NaN Conversion_syntax
! basx707 toSci "+NAN" -> NaN Conversion_syntax
! basx708 toSci "-NaN" -> NaN Conversion_syntax
! basx709 toSci "-nan" -> NaN Conversion_syntax
! basx710 toSci "-nAn" -> NaN Conversion_syntax
! basx711 toSci "-NAN" -> NaN Conversion_syntax
! basx720 toSci "sNaN" -> sNaN
! basx721 toSci "snan" -> sNaN
! basx722 toSci "SnAn" -> sNaN
! basx723 toSci "SNAN" -> sNaN
! basx724 toSci "+sNaN" -> NaN Conversion_syntax
! basx725 toSci "+snan" -> NaN Conversion_syntax
! basx726 toSci "+SnAn" -> NaN Conversion_syntax
! basx727 toSci "+SNAN" -> NaN Conversion_syntax
! basx728 toSci "-sNaN" -> NaN Conversion_syntax
! basx729 toSci "-snan" -> NaN Conversion_syntax
! basx730 toSci "-SnAn" -> NaN Conversion_syntax
! basx731 toSci "-SNAN" -> NaN Conversion_syntax
! basx740 toSci "Inf" -> Infinity
! basx741 toSci "inf" -> Infinity
! basx742 toSci "iNf" -> Infinity
! basx743 toSci "INF" -> Infinity
! basx744 toSci "+Inf" -> Infinity
! basx745 toSci "+inf" -> Infinity
! basx746 toSci "+iNf" -> Infinity
! basx747 toSci "+INF" -> Infinity
! basx748 toSci "-Inf" -> -Infinity
! basx749 toSci "-inf" -> -Infinity
! basx750 toSci "-iNf" -> -Infinity
! basx751 toSci "-INF" -> -Infinity
basx760 toSci "Infinity" -> Infinity
--- 682,748 ----
-- Specials
+ precision: 4
basx700 toSci "NaN" -> NaN
basx701 toSci "nan" -> NaN
basx702 toSci "nAn" -> NaN
basx703 toSci "NAN" -> NaN
! basx704 toSci "+NaN" -> NaN
! basx705 toSci "+nan" -> NaN
! basx706 toSci "+nAn" -> NaN
! basx707 toSci "+NAN" -> NaN
! basx708 toSci "-NaN" -> -NaN
! basx709 toSci "-nan" -> -NaN
! basx710 toSci "-nAn" -> -NaN
! basx711 toSci "-NAN" -> -NaN
! basx712 toSci 'NaN0' -> NaN
! basx713 toSci 'NaN1' -> NaN1
! basx714 toSci 'NaN12' -> NaN12
! basx715 toSci 'NaN123' -> NaN123
! basx716 toSci 'NaN1234' -> NaN1234
! basx717 toSci 'NaN01' -> NaN1
! basx718 toSci 'NaN012' -> NaN12
! basx719 toSci 'NaN0123' -> NaN123
! basx720 toSci 'NaN01234' -> NaN1234
! basx721 toSci 'NaN001' -> NaN1
! basx722 toSci 'NaN0012' -> NaN12
! basx723 toSci 'NaN00123' -> NaN123
! basx724 toSci 'NaN001234' -> NaN1234
! basx725 toSci 'NaN12345' -> NaN Conversion_syntax
! basx726 toSci 'NaN123e+1' -> NaN Conversion_syntax
! basx727 toSci 'NaN12.45' -> NaN Conversion_syntax
! basx728 toSci 'NaN-12' -> NaN Conversion_syntax
! basx729 toSci 'NaN+12' -> NaN Conversion_syntax
! basx730 toSci "sNaN" -> sNaN
! basx731 toSci "snan" -> sNaN
! basx732 toSci "SnAn" -> sNaN
! basx733 toSci "SNAN" -> sNaN
! basx734 toSci "+sNaN" -> sNaN
! basx735 toSci "+snan" -> sNaN
! basx736 toSci "+SnAn" -> sNaN
! basx737 toSci "+SNAN" -> sNaN
! basx738 toSci "-sNaN" -> -sNaN
! basx739 toSci "-snan" -> -sNaN
! basx740 toSci "-SnAn" -> -sNaN
! basx741 toSci "-SNAN" -> -sNaN
! basx742 toSci 'sNaN0000' -> sNaN
! basx743 toSci 'sNaN7' -> sNaN7
! basx744 toSci 'sNaN007234' -> sNaN7234
! basx745 toSci 'sNaN72345' -> NaN Conversion_syntax
! basx746 toSci 'sNaN72.45' -> NaN Conversion_syntax
! basx747 toSci 'sNaN-72' -> NaN Conversion_syntax
! basx748 toSci "Inf" -> Infinity
! basx749 toSci "inf" -> Infinity
! basx750 toSci "iNf" -> Infinity
! basx751 toSci "INF" -> Infinity
! basx752 toSci "+Inf" -> Infinity
! basx753 toSci "+inf" -> Infinity
! basx754 toSci "+iNf" -> Infinity
! basx755 toSci "+INF" -> Infinity
! basx756 toSci "-Inf" -> -Infinity
! basx757 toSci "-inf" -> -Infinity
! basx758 toSci "-iNf" -> -Infinity
! basx759 toSci "-INF" -> -Infinity
basx760 toSci "Infinity" -> Infinity
***************
*** 730,738 ****
basx772 toEng "NaN" -> NaN
basx773 toEng "-Infinity" -> -Infinity
! basx774 toEng "-sNaN" -> NaN Conversion_syntax
! basx775 toEng "-NaN" -> NaN Conversion_syntax
basx776 toEng "+Infinity" -> Infinity
! basx778 toEng "+sNaN" -> NaN Conversion_syntax
! basx779 toEng "+NaN" -> NaN Conversion_syntax
basx780 toEng "INFINITY" -> Infinity
basx781 toEng "SNAN" -> sNaN
--- 762,770 ----
basx772 toEng "NaN" -> NaN
basx773 toEng "-Infinity" -> -Infinity
! basx774 toEng "-sNaN" -> -sNaN
! basx775 toEng "-NaN" -> -NaN
basx776 toEng "+Infinity" -> Infinity
! basx778 toEng "+sNaN" -> sNaN
! basx779 toEng "+NaN" -> NaN
basx780 toEng "INFINITY" -> Infinity
basx781 toEng "SNAN" -> sNaN
***************
*** 750,756 ****
basx793 toEng "sNaN" -> sNaN
basx801 toEng 0.000000000 -> 0E-9
! basx802 toEng 0.00000000 -> 0E-9
! basx803 toEng 0.0000000 -> 0E-9
basx804 toEng 0.000000 -> 0.000000
basx805 toEng 0.00000 -> 0.00000
--- 782,791 ----
basx793 toEng "sNaN" -> sNaN
+ -- Zero toEng, etc.
+ basx800 toEng 0e+1 -> "0.00E+3" -- doc example
+
basx801 toEng 0.000000000 -> 0E-9
! basx802 toEng 0.00000000 -> 0.00E-6
! basx803 toEng 0.0000000 -> 0.0E-6
basx804 toEng 0.000000 -> 0.000000
basx805 toEng 0.00000 -> 0.00000
***************
*** 769,774 ****
basx818 toEng -0.00000 -> -0.00000
basx819 toEng -0.000000 -> -0.000000
! basx820 toEng -0.0000000 -> -0E-9
! basx821 toEng -0.00000000 -> -0E-9
basx822 toEng -0.000000000 -> -0E-9
--- 804,809 ----
basx818 toEng -0.00000 -> -0.00000
basx819 toEng -0.000000 -> -0.000000
! basx820 toEng -0.0000000 -> -0.0E-6
! basx821 toEng -0.00000000 -> -0.00E-6
basx822 toEng -0.000000000 -> -0E-9
***************
*** 776,807 ****
basx831 toEng 0.00E+1 -> 0.0
basx832 toEng 0.00E+2 -> 0
! basx833 toEng 0.00E+3 -> 0
! basx834 toEng 0.00E+4 -> 0
basx835 toEng 0.00E+5 -> 0E+3
! basx836 toEng 0.00E+6 -> 0E+3
! basx837 toEng 0.00E+7 -> 0E+3
basx838 toEng 0.00E+8 -> 0E+6
! basx839 toEng 0.00E+9 -> 0E+6
basx840 toEng 0.0E+0 -> 0.0
basx841 toEng 0.0E+1 -> 0
! basx842 toEng 0.0E+2 -> 0
! basx843 toEng 0.0E+3 -> 0
basx844 toEng 0.0E+4 -> 0E+3
! basx845 toEng 0.0E+5 -> 0E+3
! basx846 toEng 0.0E+6 -> 0E+3
basx847 toEng 0.0E+7 -> 0E+6
! basx848 toEng 0.0E+8 -> 0E+6
! basx849 toEng 0.0E+9 -> 0E+6
basx850 toEng 0E+0 -> 0
! basx851 toEng 0E+1 -> 0
! basx852 toEng 0E+2 -> 0
basx853 toEng 0E+3 -> 0E+3
! basx854 toEng 0E+4 -> 0E+3
! basx855 toEng 0E+5 -> 0E+3
basx856 toEng 0E+6 -> 0E+6
! basx857 toEng 0E+7 -> 0E+6
! basx858 toEng 0E+8 -> 0E+6
basx859 toEng 0E+9 -> 0E+9
--- 811,842 ----
basx831 toEng 0.00E+1 -> 0.0
basx832 toEng 0.00E+2 -> 0
! basx833 toEng 0.00E+3 -> 0.00E+3
! basx834 toEng 0.00E+4 -> 0.0E+3
basx835 toEng 0.00E+5 -> 0E+3
! basx836 toEng 0.00E+6 -> 0.00E+6
! basx837 toEng 0.00E+7 -> 0.0E+6
basx838 toEng 0.00E+8 -> 0E+6
! basx839 toEng 0.00E+9 -> 0.00E+9
basx840 toEng 0.0E+0 -> 0.0
basx841 toEng 0.0E+1 -> 0
! basx842 toEng 0.0E+2 -> 0.00E+3
! basx843 toEng 0.0E+3 -> 0.0E+3
basx844 toEng 0.0E+4 -> 0E+3
! basx845 toEng 0.0E+5 -> 0.00E+6
! basx846 toEng 0.0E+6 -> 0.0E+6
basx847 toEng 0.0E+7 -> 0E+6
! basx848 toEng 0.0E+8 -> 0.00E+9
! basx849 toEng 0.0E+9 -> 0.0E+9
basx850 toEng 0E+0 -> 0
! basx851 toEng 0E+1 -> 0.00E+3
! basx852 toEng 0E+2 -> 0.0E+3
basx853 toEng 0E+3 -> 0E+3
! basx854 toEng 0E+4 -> 0.00E+6
! basx855 toEng 0E+5 -> 0.0E+6
basx856 toEng 0E+6 -> 0E+6
! basx857 toEng 0E+7 -> 0.00E+9
! basx858 toEng 0E+8 -> 0.0E+9
basx859 toEng 0E+9 -> 0E+9
***************
*** 812,819 ****
basx864 toEng 0.0E-4 -> 0.00000
basx865 toEng 0.0E-5 -> 0.000000
! basx866 toEng 0.0E-6 -> 0E-9
! basx867 toEng 0.0E-7 -> 0E-9
basx868 toEng 0.0E-8 -> 0E-9
! basx869 toEng 0.0E-9 -> 0E-12
basx870 toEng 0.00E-0 -> 0.00
--- 847,854 ----
basx864 toEng 0.0E-4 -> 0.00000
basx865 toEng 0.0E-5 -> 0.000000
! basx866 toEng 0.0E-6 -> 0.0E-6
! basx867 toEng 0.0E-7 -> 0.00E-6
basx868 toEng 0.0E-8 -> 0E-9
! basx869 toEng 0.0E-9 -> 0.0E-9
basx870 toEng 0.00E-0 -> 0.00
***************
*** 822,830 ****
basx873 toEng 0.00E-3 -> 0.00000
basx874 toEng 0.00E-4 -> 0.000000
! basx875 toEng 0.00E-5 -> 0E-9
! basx876 toEng 0.00E-6 -> 0E-9
basx877 toEng 0.00E-7 -> 0E-9
! basx878 toEng 0.00E-8 -> 0E-12
! basx879 toEng 0.00E-9 -> 0E-12
-- Giga exponent initial tests
--- 857,865 ----
basx873 toEng 0.00E-3 -> 0.00000
basx874 toEng 0.00E-4 -> 0.000000
! basx875 toEng 0.00E-5 -> 0.0E-6
! basx876 toEng 0.00E-6 -> 0.00E-6
basx877 toEng 0.00E-7 -> 0E-9
! basx878 toEng 0.00E-8 -> 0.0E-9
! basx879 toEng 0.00E-9 -> 0.00E-9
-- Giga exponent initial tests
Index: clamp.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/clamp.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** clamp.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- clamp.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of tests uses the same limits as the 8-byte concrete
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of tests uses the same limits as the 8-byte concrete
Index: compare.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/compare.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** compare.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- compare.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- Note that we cannot assume add/subtract tests cover paths adequately,
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- Note that we cannot assume add/subtract tests cover paths adequately,
***************
*** 632,635 ****
--- 632,638 ----
comx836 compare 1000 NaN -> NaN
comx837 compare Inf NaN -> NaN
+ comx838 compare -NaN -NaN -> -NaN
+ comx839 compare +NaN -NaN -> NaN
+ comx840 compare -NaN +NaN -> -NaN
comx841 compare sNaN -Inf -> NaN Invalid_operation
***************
*** 653,691 ****
comx859 compare NaN sNaN -> NaN Invalid_operation
-- overflow and underflow tests .. subnormal results now allowed
maxExponent: 999999999
minexponent: -999999999
! comx860 compare +1.23456789012345E-0 9E+999999999 -> -1
! comx861 compare 9E+999999999 +1.23456789012345E-0 -> 1
! comx862 compare +0.100 9E-999999999 -> 1
! comx863 compare 9E-999999999 +0.100 -> -1
! comx865 compare -1.23456789012345E-0 9E+999999999 -> -1
! comx866 compare 9E+999999999 -1.23456789012345E-0 -> 1
! comx867 compare -0.100 9E-999999999 -> -1
! comx868 compare 9E-999999999 -0.100 -> 1
! comx869 compare 1e-599999999 1e-400000001 -> -1
! comx870 compare 1e-599999999 1e-400000000 -> -1
! comx871 compare 1e-600000000 1e-400000000 -> -1
! comx872 compare 9e-999999998 0.01 -> -1
! comx873 compare 9e-999999998 0.1 -> -1
! comx874 compare 0.01 9e-999999998 -> 1
! comx875 compare 1e599999999 1e400000001 -> 1
! comx876 compare 1e599999999 1e400000000 -> 1
! comx877 compare 1e600000000 1e400000000 -> 1
! comx878 compare 9e999999998 100 -> 1
! comx879 compare 9e999999998 10 -> 1
! comx880 compare 100 9e999999998 -> -1
-- signs
! comx881 compare 1e+777777777 1e+411111111 -> 1
! comx882 compare 1e+777777777 -1e+411111111 -> 1
! comx883 compare -1e+777777777 1e+411111111 -> -1
! comx884 compare -1e+777777777 -1e+411111111 -> -1
! comx885 compare 1e-777777777 1e-411111111 -> -1
! comx886 compare 1e-777777777 -1e-411111111 -> 1
! comx887 compare -1e-777777777 1e-411111111 -> -1
! comx888 compare -1e-777777777 -1e-411111111 -> 1
-- Null tests
! comx900 compare 10 # -> NaN Invalid_operation
! comx901 compare # 10 -> NaN Invalid_operation
--- 656,717 ----
comx859 compare NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ comx860 compare NaN9 -Inf -> NaN9
+ comx861 compare NaN8 999 -> NaN8
+ comx862 compare NaN77 Inf -> NaN77
+ comx863 compare -NaN67 NaN5 -> -NaN67
+ comx864 compare -Inf -NaN4 -> -NaN4
+ comx865 compare -999 -NaN33 -> -NaN33
+ comx866 compare Inf NaN2 -> NaN2
+ comx867 compare -NaN41 -NaN42 -> -NaN41
+ comx868 compare +NaN41 -NaN42 -> NaN41
+ comx869 compare -NaN41 +NaN42 -> -NaN41
+ comx870 compare +NaN41 +NaN42 -> NaN41
+
+ comx871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
+ comx872 compare sNaN98 -11 -> NaN98 Invalid_operation
+ comx873 compare sNaN97 NaN -> NaN97 Invalid_operation
+ comx874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
+ comx875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
+ comx876 compare -Inf sNaN92 -> NaN92 Invalid_operation
+ comx877 compare 088 sNaN81 -> NaN81 Invalid_operation
+ comx878 compare Inf sNaN90 -> NaN90 Invalid_operation
+ comx879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
+
-- overflow and underflow tests .. subnormal results now allowed
maxExponent: 999999999
minexponent: -999999999
! comx880 compare +1.23456789012345E-0 9E+999999999 -> -1
! comx881 compare 9E+999999999 +1.23456789012345E-0 -> 1
! comx882 compare +0.100 9E-999999999 -> 1
! comx883 compare 9E-999999999 +0.100 -> -1
! comx885 compare -1.23456789012345E-0 9E+999999999 -> -1
! comx886 compare 9E+999999999 -1.23456789012345E-0 -> 1
! comx887 compare -0.100 9E-999999999 -> -1
! comx888 compare 9E-999999999 -0.100 -> 1
! comx889 compare 1e-599999999 1e-400000001 -> -1
! comx890 compare 1e-599999999 1e-400000000 -> -1
! comx891 compare 1e-600000000 1e-400000000 -> -1
! comx892 compare 9e-999999998 0.01 -> -1
! comx893 compare 9e-999999998 0.1 -> -1
! comx894 compare 0.01 9e-999999998 -> 1
! comx895 compare 1e599999999 1e400000001 -> 1
! comx896 compare 1e599999999 1e400000000 -> 1
! comx897 compare 1e600000000 1e400000000 -> 1
! comx898 compare 9e999999998 100 -> 1
! comx899 compare 9e999999998 10 -> 1
! comx900 compare 100 9e999999998 -> -1
-- signs
! comx901 compare 1e+777777777 1e+411111111 -> 1
! comx902 compare 1e+777777777 -1e+411111111 -> 1
! comx903 compare -1e+777777777 1e+411111111 -> -1
! comx904 compare -1e+777777777 -1e+411111111 -> -1
! comx905 compare 1e-777777777 1e-411111111 -> -1
! comx906 compare 1e-777777777 -1e-411111111 -> 1
! comx907 compare -1e-777777777 1e-411111111 -> -1
! comx908 compare -1e-777777777 -1e-411111111 -> 1
-- Null tests
! comx990 compare 10 # -> NaN Invalid_operation
! comx991 compare # 10 -> NaN Invalid_operation
Index: divide.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divide.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** divide.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- divide.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 134,137 ****
--- 134,140 ----
divx119 divide 10 1 -> 10
+ divx120 divide 3E+1 0.001 -> 3E+4
+ divx121 divide 2.200 2 -> 1.100
+
divx130 divide 12345 4.999 -> 2469.49390 Inexact Rounded
divx131 divide 12345 4.99 -> 2473.94790 Inexact Rounded
***************
*** 304,307 ****
--- 307,318 ----
divx452 divide 1 1234567896 -> 8.10000003434400E-10 Inexact Rounded
+ -- high-lows
+ divx453 divide 1e+1 1 -> 1E+1
+ divx454 divide 1e+1 1.0 -> 1E+1
+ divx455 divide 1e+1 1.00 -> 1E+1
+ divx456 divide 1e+2 2 -> 5E+1
+ divx457 divide 1e+2 2.0 -> 5E+1
+ divx458 divide 1e+2 2.00 -> 5E+1
+
-- some from IEEE discussions
divx460 divide 3e0 2e0 -> 1.5
***************
*** 528,532 ****
-- more zeros, etc.
! precision: 9
divx731 divide 5.00 1E-3 -> 5.00E+3
divx732 divide 00.00 0.000 -> NaN Division_undefined
--- 539,547 ----
-- more zeros, etc.
! precision: 16
! rounding: half_up
! maxExponent: 384
! minExponent: -383
!
divx731 divide 5.00 1E-3 -> 5.00E+3
divx732 divide 00.00 0.000 -> NaN Division_undefined
***************
*** 576,591 ****
divx781 divide Inf -1000 -> -Infinity
divx782 divide Inf -1 -> -Infinity
! divx783 divide Inf -0 -> -Infinity Division_by_zero
! divx784 divide Inf 0 -> Infinity Division_by_zero
divx785 divide Inf 1 -> Infinity
divx786 divide Inf 1000 -> Infinity
divx787 divide Inf Inf -> NaN Invalid_operation
! divx788 divide -1000 Inf -> -0E-1007 Clamped
divx789 divide -Inf Inf -> NaN Invalid_operation
! divx790 divide -1 Inf -> -0E-1007 Clamped
! divx791 divide -0 Inf -> -0E-1007 Clamped
! divx792 divide 0 Inf -> 0E-1007 Clamped
! divx793 divide 1 Inf -> 0E-1007 Clamped
! divx794 divide 1000 Inf -> 0E-1007 Clamped
divx795 divide Inf Inf -> NaN Invalid_operation
--- 591,606 ----
divx781 divide Inf -1000 -> -Infinity
divx782 divide Inf -1 -> -Infinity
! divx783 divide Inf -0 -> -Infinity
! divx784 divide Inf 0 -> Infinity
divx785 divide Inf 1 -> Infinity
divx786 divide Inf 1000 -> Infinity
divx787 divide Inf Inf -> NaN Invalid_operation
! divx788 divide -1000 Inf -> -0E-398 Clamped
divx789 divide -Inf Inf -> NaN Invalid_operation
! divx790 divide -1 Inf -> -0E-398 Clamped
! divx791 divide -0 Inf -> -0E-398 Clamped
! divx792 divide 0 Inf -> 0E-398 Clamped
! divx793 divide 1 Inf -> 0E-398 Clamped
! divx794 divide 1000 Inf -> 0E-398 Clamped
divx795 divide Inf Inf -> NaN Invalid_operation
***************
*** 593,608 ****
divx801 divide -Inf -1000 -> Infinity
divx802 divide -Inf -1 -> Infinity
! divx803 divide -Inf -0 -> Infinity Division_by_zero
! divx804 divide -Inf 0 -> -Infinity Division_by_zero
divx805 divide -Inf 1 -> -Infinity
divx806 divide -Inf 1000 -> -Infinity
divx807 divide -Inf Inf -> NaN Invalid_operation
! divx808 divide -1000 Inf -> -0E-1007 Clamped
divx809 divide -Inf -Inf -> NaN Invalid_operation
! divx810 divide -1 -Inf -> 0E-1007 Clamped
! divx811 divide -0 -Inf -> 0E-1007 Clamped
! divx812 divide 0 -Inf -> -0E-1007 Clamped
! divx813 divide 1 -Inf -> -0E-1007 Clamped
! divx814 divide 1000 -Inf -> -0E-1007 Clamped
divx815 divide Inf -Inf -> NaN Invalid_operation
--- 608,623 ----
divx801 divide -Inf -1000 -> Infinity
divx802 divide -Inf -1 -> Infinity
! divx803 divide -Inf -0 -> Infinity
! divx804 divide -Inf 0 -> -Infinity
divx805 divide -Inf 1 -> -Infinity
divx806 divide -Inf 1000 -> -Infinity
divx807 divide -Inf Inf -> NaN Invalid_operation
! divx808 divide -1000 Inf -> -0E-398 Clamped
divx809 divide -Inf -Inf -> NaN Invalid_operation
! divx810 divide -1 -Inf -> 0E-398 Clamped
! divx811 divide -0 -Inf -> 0E-398 Clamped
! divx812 divide 0 -Inf -> -0E-398 Clamped
! divx813 divide 1 -Inf -> -0E-398 Clamped
! divx814 divide 1000 -Inf -> -0E-398 Clamped
divx815 divide Inf -Inf -> NaN Invalid_operation
***************
*** 645,648 ****
--- 660,700 ----
divx859 divide NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ divx861 divide NaN9 -Inf -> NaN9
+ divx862 divide NaN8 1000 -> NaN8
+ divx863 divide NaN7 Inf -> NaN7
+ divx864 divide NaN6 NaN5 -> NaN6
+ divx865 divide -Inf NaN4 -> NaN4
+ divx866 divide -1000 NaN3 -> NaN3
+ divx867 divide Inf NaN2 -> NaN2
+
+ divx871 divide sNaN99 -Inf -> NaN99 Invalid_operation
+ divx872 divide sNaN98 -1 -> NaN98 Invalid_operation
+ divx873 divide sNaN97 NaN -> NaN97 Invalid_operation
+ divx874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
+ divx875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
+ divx876 divide -Inf sNaN92 -> NaN92 Invalid_operation
+ divx877 divide 0 sNaN91 -> NaN91 Invalid_operation
+ divx878 divide Inf sNaN90 -> NaN90 Invalid_operation
+ divx879 divide NaN sNaN89 -> NaN89 Invalid_operation
+
+ divx881 divide -NaN9 -Inf -> -NaN9
+ divx882 divide -NaN8 1000 -> -NaN8
+ divx883 divide -NaN7 Inf -> -NaN7
+ divx884 divide -NaN6 -NaN5 -> -NaN6
+ divx885 divide -Inf -NaN4 -> -NaN4
+ divx886 divide -1000 -NaN3 -> -NaN3
+ divx887 divide Inf -NaN2 -> -NaN2
+
+ divx891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
+ divx892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
+ divx893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
+ divx894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
+ divx895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ divx896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
+ divx897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
+ divx898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
+ divx899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
+
maxexponent: 999999999
minexponent: -999999999
***************
*** 689,692 ****
--- 741,745 ----
-- overflow and underflow tests
+ precision: 9
maxexponent: 999999999
minexponent: -999999999
***************
*** 751,754 ****
--- 804,816 ----
divx1003 divide 1.52446E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+ -- a rounding problem in one implementation
+ precision: 34
+ rounding: half_up
+ maxExponent: 6144
+ minExponent: -6143
+ -- Unbounded answer to 40 digits:
+ -- 1.465811965811965811965811965811965811966E+7000
+ divx1010 divide 343E6000 234E-1000 -> Infinity Overflow Inexact Rounded
+
-- Null tests
divx9998 divide 10 # -> NaN Invalid_operation
Index: divideint.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divideint.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** divideint.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- divideint.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 337,342 ****
dvix581 divideint Inf -1000 -> -Infinity
dvix582 divideint Inf -1 -> -Infinity
! dvix583 divideint Inf -0 -> -Infinity Division_by_zero
! dvix584 divideint Inf 0 -> Infinity Division_by_zero
dvix585 divideint Inf 1 -> Infinity
dvix586 divideint Inf 1000 -> Infinity
--- 337,342 ----
dvix581 divideint Inf -1000 -> -Infinity
dvix582 divideint Inf -1 -> -Infinity
! dvix583 divideint Inf -0 -> -Infinity
! dvix584 divideint Inf 0 -> Infinity
dvix585 divideint Inf 1 -> Infinity
dvix586 divideint Inf 1000 -> Infinity
***************
*** 354,359 ****
dvix601 divideint -Inf -1000 -> Infinity
dvix602 divideint -Inf -1 -> Infinity
! dvix603 divideint -Inf -0 -> Infinity Division_by_zero
! dvix604 divideint -Inf 0 -> -Infinity Division_by_zero
dvix605 divideint -Inf 1 -> -Infinity
dvix606 divideint -Inf 1000 -> -Infinity
--- 354,359 ----
dvix601 divideint -Inf -1000 -> Infinity
dvix602 divideint -Inf -1 -> Infinity
! dvix603 divideint -Inf -0 -> Infinity
! dvix604 divideint -Inf 0 -> -Infinity
dvix605 divideint -Inf 1 -> -Infinity
dvix606 divideint -Inf 1000 -> -Infinity
***************
*** 406,447 ****
dvix659 divideint NaN sNaN -> NaN Invalid_operation
-- some long operand cases again
precision: 8
! dvix660 divideint 100000001 1 -> NaN Division_impossible
! dvix661 divideint 100000000.4 1 -> NaN Division_impossible
! dvix662 divideint 100000000.5 1 -> NaN Division_impossible
! dvix663 divideint 100000000.9 1 -> NaN Division_impossible
! dvix664 divideint 100000000.999 1 -> NaN Division_impossible
precision: 6
! dvix690 divideint 100000000 1 -> NaN Division_impossible
! dvix691 divideint 10000000 1 -> NaN Division_impossible
! dvix692 divideint 1000000 1 -> NaN Division_impossible
! dvix693 divideint 100000 1 -> 100000
! dvix694 divideint 10000 1 -> 10000
! dvix695 divideint 1000 1 -> 1000
! dvix696 divideint 100 1 -> 100
! dvix697 divideint 10 1 -> 10
! dvix698 divideint 1 1 -> 1
precision: 9
maxexponent: 999999999
minexponent: -999999999
! dvix672 divideint 1 0.99e999999999 -> 0
! dvix673 divideint 1 0.999999999e999999999 -> 0
! dvix674 divideint 9e999999999 1 -> NaN Division_impossible
! dvix675 divideint 9.9e999999999 1 -> NaN Division_impossible
! dvix676 divideint 9.99e999999999 1 -> NaN Division_impossible
! dvix677 divideint 9.99999999e999999999 1 -> NaN Division_impossible
! dvix680 divideint 0.1 9e-999999999 -> NaN Division_impossible
! dvix681 divideint 0.1 99e-999999999 -> NaN Division_impossible
! dvix682 divideint 0.1 999e-999999999 -> NaN Division_impossible
! dvix683 divideint 0.1 9e-999999998 -> NaN Division_impossible
! dvix684 divideint 0.1 99e-999999998 -> NaN Division_impossible
! dvix685 divideint 0.1 999e-999999998 -> NaN Division_impossible
! dvix686 divideint 0.1 999e-999999997 -> NaN Division_impossible
! dvix687 divideint 0.1 9999e-999999997 -> NaN Division_impossible
! dvix688 divideint 0.1 99999e-999999997 -> NaN Division_impossible
--- 406,467 ----
dvix659 divideint NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ dvix661 divideint NaN9 -Inf -> NaN9
+ dvix662 divideint NaN8 1000 -> NaN8
+ dvix663 divideint NaN7 Inf -> NaN7
+ dvix664 divideint -NaN6 NaN5 -> -NaN6
+ dvix665 divideint -Inf NaN4 -> NaN4
+ dvix666 divideint -1000 NaN3 -> NaN3
+ dvix667 divideint Inf -NaN2 -> -NaN2
+
+ dvix671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
+ dvix672 divideint sNaN98 -1 -> NaN98 Invalid_operation
+ dvix673 divideint sNaN97 NaN -> NaN97 Invalid_operation
+ dvix674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
+ dvix675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
+ dvix676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
+ dvix677 divideint 0 sNaN91 -> NaN91 Invalid_operation
+ dvix678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
+ dvix679 divideint NaN sNaN89 -> NaN89 Invalid_operation
+
-- some long operand cases again
precision: 8
! dvix710 divideint 100000001 1 -> NaN Division_impossible
! dvix711 divideint 100000000.4 1 -> NaN Division_impossible
! dvix712 divideint 100000000.5 1 -> NaN Division_impossible
! dvix713 divideint 100000000.9 1 -> NaN Division_impossible
! dvix714 divideint 100000000.999 1 -> NaN Division_impossible
precision: 6
! dvix720 divideint 100000000 1 -> NaN Division_impossible
! dvix721 divideint 10000000 1 -> NaN Division_impossible
! dvix722 divideint 1000000 1 -> NaN Division_impossible
! dvix723 divideint 100000 1 -> 100000
! dvix724 divideint 10000 1 -> 10000
! dvix725 divideint 1000 1 -> 1000
! dvix726 divideint 100 1 -> 100
! dvix727 divideint 10 1 -> 10
! dvix728 divideint 1 1 -> 1
! dvix729 divideint 1 10 -> 0
precision: 9
maxexponent: 999999999
minexponent: -999999999
! dvix732 divideint 1 0.99e999999999 -> 0
! dvix733 divideint 1 0.999999999e999999999 -> 0
! dvix734 divideint 9e999999999 1 -> NaN Division_impossible
! dvix735 divideint 9.9e999999999 1 -> NaN Division_impossible
! dvix736 divideint 9.99e999999999 1 -> NaN Division_impossible
! dvix737 divideint 9.99999999e999999999 1 -> NaN Division_impossible
! dvix740 divideint 0.1 9e-999999999 -> NaN Division_impossible
! dvix741 divideint 0.1 99e-999999999 -> NaN Division_impossible
! dvix742 divideint 0.1 999e-999999999 -> NaN Division_impossible
! dvix743 divideint 0.1 9e-999999998 -> NaN Division_impossible
! dvix744 divideint 0.1 99e-999999998 -> NaN Division_impossible
! dvix745 divideint 0.1 999e-999999998 -> NaN Division_impossible
! dvix746 divideint 0.1 999e-999999997 -> NaN Division_impossible
! dvix747 divideint 0.1 9999e-999999997 -> NaN Division_impossible
! dvix748 divideint 0.1 99999e-999999997 -> NaN Division_impossible
Index: inexact.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/inexact.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** inexact.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- inexact.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
Index: max.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/max.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** max.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- max.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- we assume that base comparison is tested in compare.decTest, so
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- we assume that base comparison is tested in compare.decTest, so
***************
*** 154,162 ****
maxx179 max NaN sNaN -> NaN Invalid_operation
! -- from examples
! maxx180 max '3' '2' -> '3'
! maxx181 max '-10' '3' -> '3'
! maxx182 max '1.0' '1' -> '1.0'
! maxx183 max '1' '1.0' -> '1'
-- rounding checks
--- 154,175 ----
maxx179 max NaN sNaN -> NaN Invalid_operation
! -- propagating NaNs
! maxx181 max NaN9 -Inf -> NaN9
! maxx182 max NaN8 9 -> NaN8
! maxx183 max -NaN7 Inf -> -NaN7
! maxx184 max NaN6 NaN5 -> NaN6
! maxx185 max -Inf NaN4 -> NaN4
! maxx186 max -9 -NaN3 -> -NaN3
! maxx187 max Inf NaN2 -> NaN2
!
! maxx191 max sNaN99 -Inf -> NaN99 Invalid_operation
! maxx192 max sNaN98 -1 -> NaN98 Invalid_operation
! maxx193 max -sNaN97 NaN -> -NaN97 Invalid_operation
! maxx194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
! maxx195 max NaN95 sNaN93 -> NaN93 Invalid_operation
! maxx196 max -Inf sNaN92 -> NaN92 Invalid_operation
! maxx197 max 0 sNaN91 -> NaN91 Invalid_operation
! maxx198 max Inf -sNaN90 -> -NaN90 Invalid_operation
! maxx199 max NaN sNaN89 -> NaN89 Invalid_operation
-- rounding checks
***************
*** 203,206 ****
--- 216,225 ----
maxx238 max 1 -1234567896 -> 1
+ -- from examples
+ maxx280 max '3' '2' -> '3'
+ maxx281 max '-10' '3' -> '3'
+ maxx282 max '1.0' '1' -> '1.0'
+ maxx283 max '1' '1.0' -> '1'
+
-- overflow and underflow tests ...
maxExponent: 999999999
Index: min.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/min.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** min.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- min.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- we assume that base comparison is tested in compare.decTest, so
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- we assume that base comparison is tested in compare.decTest, so
***************
*** 126,132 ****
mnmx150 min -Inf NaN -> NaN
mnmx151 min -1000 NaN -> NaN
! mnmx152 min -1 NaN -> NaN
mnmx153 min -0 NaN -> NaN
! mnmx154 min 0 NaN -> NaN
mnmx155 min 1 NaN -> NaN
mnmx156 min 1000 NaN -> NaN
--- 126,132 ----
mnmx150 min -Inf NaN -> NaN
mnmx151 min -1000 NaN -> NaN
! mnmx152 min -1 -NaN -> -NaN
mnmx153 min -0 NaN -> NaN
! mnmx154 min 0 -NaN -> -NaN
mnmx155 min 1 NaN -> NaN
mnmx156 min 1000 NaN -> NaN
***************
*** 137,142 ****
mnmx163 min sNaN -1 -> NaN Invalid_operation
mnmx164 min sNaN -0 -> NaN Invalid_operation
! mnmx165 min sNaN 0 -> NaN Invalid_operation
! mnmx166 min sNaN 1 -> NaN Invalid_operation
mnmx167 min sNaN 1000 -> NaN Invalid_operation
mnmx168 min sNaN NaN -> NaN Invalid_operation
--- 137,142 ----
mnmx163 min sNaN -1 -> NaN Invalid_operation
mnmx164 min sNaN -0 -> NaN Invalid_operation
! mnmx165 min -sNaN 0 -> -NaN Invalid_operation
! mnmx166 min -sNaN 1 -> -NaN Invalid_operation
mnmx167 min sNaN 1000 -> NaN Invalid_operation
mnmx168 min sNaN NaN -> NaN Invalid_operation
***************
*** 153,162 ****
mnmx179 min NaN sNaN -> NaN Invalid_operation
! -- from examples
! mnmx180 min '3' '2' -> '2'
! mnmx181 min '-10' '3' -> '-10'
! mnmx182 min '1.0' '1' -> '1.0'
! mnmx183 min '1' '1.0' -> '1'
-- rounding checks -- chosen is rounded, or not
--- 153,174 ----
mnmx179 min NaN sNaN -> NaN Invalid_operation
! -- propagating NaNs
! mnmx181 min NaN9 -Inf -> NaN9
! mnmx182 min -NaN8 9990 -> -NaN8
! mnmx183 min NaN71 Inf -> NaN71
! mnmx184 min NaN6 NaN51 -> NaN6
! mnmx185 min -Inf NaN41 -> NaN41
! mnmx186 min -9999 -NaN33 -> -NaN33
! mnmx187 min Inf NaN2 -> NaN2
+ mnmx191 min sNaN99 -Inf -> NaN99 Invalid_operation
+ mnmx192 min sNaN98 -11 -> NaN98 Invalid_operation
+ mnmx193 min -sNaN97 NaN -> -NaN97 Invalid_operation
+ mnmx194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
+ mnmx195 min NaN95 sNaN93 -> NaN93 Invalid_operation
+ mnmx196 min -Inf sNaN92 -> NaN92 Invalid_operation
+ mnmx197 min 088 sNaN91 -> NaN91 Invalid_operation
+ mnmx198 min Inf -sNaN90 -> -NaN90 Invalid_operation
+ mnmx199 min NaN sNaN86 -> NaN86 Invalid_operation
-- rounding checks -- chosen is rounded, or not
***************
*** 203,206 ****
--- 215,224 ----
mnmx238 min 1 1234567896 -> 1
+ -- from examples
+ mnmx280 min '3' '2' -> '2'
+ mnmx281 min '-10' '3' -> '-10'
+ mnmx282 min '1.0' '1' -> '1.0'
+ mnmx283 min '1' '1.0' -> '1'
+
-- overflow and underflow tests .. subnormal results [inputs] now allowed
maxExponent: 999999999
Index: minus.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/minus.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** minus.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- minus.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of tests primarily tests the existence of the operator.
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of tests primarily tests the existence of the operator.
***************
*** 170,174 ****
minx421 minus '-Inf' -> 'Infinity'
minx422 minus NaN -> NaN
! minx423 minus sNaN -> NaN Invalid_operation
-- Null tests
--- 170,180 ----
minx421 minus '-Inf' -> 'Infinity'
minx422 minus NaN -> NaN
! minx423 minus sNaN -> NaN Invalid_operation
! minx424 minus NaN255 -> NaN255
! minx425 minus sNaN256 -> NaN256 Invalid_operation
! minx426 minus -NaN -> -NaN
! minx427 minus -sNaN -> -NaN Invalid_operation
! minx428 minus -NaN255 -> -NaN255
! minx429 minus -sNaN256 -> -NaN256 Invalid_operation
-- Null tests
Index: multiply.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/multiply.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** multiply.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- multiply.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 403,406 ****
--- 403,461 ----
mulx659 multiply NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ mulx661 multiply NaN9 -Inf -> NaN9
+ mulx662 multiply NaN8 999 -> NaN8
+ mulx663 multiply NaN71 Inf -> NaN71
+ mulx664 multiply NaN6 NaN5 -> NaN6
+ mulx665 multiply -Inf NaN4 -> NaN4
+ mulx666 multiply -999 NaN33 -> NaN33
+ mulx667 multiply Inf NaN2 -> NaN2
+
+ mulx671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
+ mulx672 multiply sNaN98 -11 -> NaN98 Invalid_operation
+ mulx673 multiply sNaN97 NaN -> NaN97 Invalid_operation
+ mulx674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
+ mulx675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
+ mulx676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
+ mulx677 multiply 088 sNaN91 -> NaN91 Invalid_operation
+ mulx678 multiply Inf sNaN90 -> NaN90 Invalid_operation
+ mulx679 multiply NaN sNaN89 -> NaN89 Invalid_operation
+
+ mulx681 multiply -NaN9 -Inf -> -NaN9
+ mulx682 multiply -NaN8 999 -> -NaN8
+ mulx683 multiply -NaN71 Inf -> -NaN71
+ mulx684 multiply -NaN6 -NaN5 -> -NaN6
+ mulx685 multiply -Inf -NaN4 -> -NaN4
+ mulx686 multiply -999 -NaN33 -> -NaN33
+ mulx687 multiply Inf -NaN2 -> -NaN2
+
+ mulx691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
+ mulx692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
+ mulx693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
+ mulx694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
+ mulx695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ mulx696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
+ mulx697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
+ mulx698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
+ mulx699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+ mulx701 multiply -NaN -Inf -> -NaN
+ mulx702 multiply -NaN 999 -> -NaN
+ mulx703 multiply -NaN Inf -> -NaN
+ mulx704 multiply -NaN -NaN -> -NaN
+ mulx705 multiply -Inf -NaN0 -> -NaN
+ mulx706 multiply -999 -NaN -> -NaN
+ mulx707 multiply Inf -NaN -> -NaN
+
+ mulx711 multiply -sNaN -Inf -> -NaN Invalid_operation
+ mulx712 multiply -sNaN -11 -> -NaN Invalid_operation
+ mulx713 multiply -sNaN00 NaN -> -NaN Invalid_operation
+ mulx714 multiply -sNaN -sNaN -> -NaN Invalid_operation
+ mulx715 multiply -NaN -sNaN -> -NaN Invalid_operation
+ mulx716 multiply -Inf -sNaN -> -NaN Invalid_operation
+ mulx717 multiply 088 -sNaN -> -NaN Invalid_operation
+ mulx718 multiply Inf -sNaN -> -NaN Invalid_operation
+ mulx719 multiply -NaN -sNaN -> -NaN Invalid_operation
+
-- overflow and underflow tests .. note subnormal results
maxexponent: 999999999
Index: normalize.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/normalize.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** normalize.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- normalize.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 214,218 ****
nrmx821 normalize '-Inf' -> '-Infinity'
nrmx822 normalize NaN -> NaN
! nrmx823 normalize sNaN -> NaN Invalid_operation
-- Null test
--- 214,224 ----
nrmx821 normalize '-Inf' -> '-Infinity'
nrmx822 normalize NaN -> NaN
! nrmx823 normalize sNaN -> NaN Invalid_operation
! nrmx824 normalize NaN101 -> NaN101
! nrmx825 normalize sNaN010 -> NaN10 Invalid_operation
! nrmx827 normalize -NaN -> -NaN
! nrmx828 normalize -sNaN -> -NaN Invalid_operation
! nrmx829 normalize -NaN101 -> -NaN101
! nrmx830 normalize -sNaN010 -> -NaN10 Invalid_operation
-- Null test
Index: plus.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/plus.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** plus.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- plus.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of tests primarily tests the existence of the operator.
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of tests primarily tests the existence of the operator.
***************
*** 111,115 ****
plux151 plus '-Inf' -> '-Infinity'
plux152 plus NaN -> NaN
! plux153 plus sNaN -> NaN Invalid_operation
-- overflow tests
--- 111,121 ----
plux151 plus '-Inf' -> '-Infinity'
plux152 plus NaN -> NaN
! plux153 plus sNaN -> NaN Invalid_operation
! plux154 plus NaN77 -> NaN77
! plux155 plus sNaN88 -> NaN88 Invalid_operation
! plux156 plus -NaN -> -NaN
! plux157 plus -sNaN -> -NaN Invalid_operation
! plux158 plus -NaN77 -> -NaN77
! plux159 plus -sNaN88 -> -NaN88 Invalid_operation
-- overflow tests
Index: power.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/power.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** power.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- power.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of testcases tests raising numbers to an integer power only.
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of testcases tests raising numbers to an integer power only.
***************
*** 574,589 ****
powx659 power NaN sNaN -> NaN Invalid_operation
-- Examples from extended specification
! powx660 power Inf -2 -> 0
! powx661 power Inf -1 -> 0
! powx662 power Inf 0 -> 1
! powx663 power Inf 1 -> Infinity
! powx664 power Inf 2 -> Infinity
! powx665 power -Inf -2 -> 0
! powx666 power -Inf -1 -> -0
! powx667 power -Inf 0 -> 1
! powx668 power -Inf 1 -> -Infinity
! powx669 power -Inf 2 -> Infinity
! powx670 power 0 0 -> NaN Invalid_operation
-- long operand and RHS range checks
--- 574,609 ----
powx659 power NaN sNaN -> NaN Invalid_operation
+ -- NaN propagation
+ powx660 power NaN3 sNaN7 -> NaN7 Invalid_operation
+ powx661 power sNaN8 NaN6 -> NaN8 Invalid_operation
+ powx662 power 1 sNaN7 -> NaN7 Invalid_operation
+ powx663 power sNaN8 1 -> NaN8 Invalid_operation
+ powx664 power Inf sNaN7 -> NaN7 Invalid_operation
+ powx665 power sNaN8 Inf -> NaN Invalid_operation
+ powx666 power Inf NaN9 -> NaN9
+ powx667 power NaN6 Inf -> NaN Invalid_operation
+ powx668 power 1 NaN5 -> NaN5
+ powx669 power NaN2 1 -> NaN2
+ powx670 power NaN2 Nan4 -> NaN2
+ powx671 power NaN Nan4 -> NaN
+ powx672 power NaN345 Nan -> NaN345
+ powx673 power Inf -sNaN7 -> -NaN7 Invalid_operation
+ powx674 power -sNaN8 Inf -> NaN Invalid_operation
+ powx675 power Inf -NaN9 -> -NaN9
+ powx676 power -NaN6 Inf -> NaN Invalid_operation
+ powx677 power -NaN2 -Nan4 -> -NaN2
+
-- Examples from extended specification
! powx690 power Inf -2 -> 0
! powx691 power Inf -1 -> 0
! powx692 power Inf 0 -> 1
! powx693 power Inf 1 -> Infinity
! powx694 power Inf 2 -> Infinity
! powx695 power -Inf -2 -> 0
! powx696 power -Inf -1 -> -0
! powx697 power -Inf 0 -> 1
! powx698 power -Inf 1 -> -Infinity
! powx699 power -Inf 2 -> Infinity
! powx700 power 0 0 -> NaN Invalid_operation
-- long operand and RHS range checks
Index: quantize.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/quantize.decTest,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** quantize.decTest 12 Aug 2003 23:05:30 -0000 1.2
--- quantize.decTest 6 Feb 2004 16:56:03 -0000 1.3
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- Most of the tests here assume a "regular pattern", where the
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- Most of the tests here assume a "regular pattern", where the
***************
*** 78,90 ****
quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded
quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
! quax065 quantize 2 Inf -> NaN Invalid_operation
! quax066 quantize -0.1 1 -> -0 Inexact Rounded
! quax067 quantize -0 1e+5 -> -0E+5
! quax068 quantize +35236450.6 1e-2 -> NaN Invalid_operation
! quax069 quantize -35236450.6 1e-2 -> NaN Invalid_operation
! quax070 quantize 217 1e-1 -> 217.0
! quax071 quantize 217 1e+0 -> 217
! quax072 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
! quax073 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-- general tests ..
--- 78,91 ----
quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded
quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
! quax065 quantize -Inf Inf -> -Infinity
! quax066 quantize 2 Inf -> NaN Invalid_operation
! quax067 quantize -0.1 1 -> -0 Inexact Rounded
! quax068 quantize -0 1e+5 -> -0E+5
! quax069 quantize +35236450.6 1e-2 -> NaN Invalid_operation
! quax070 quantize -35236450.6 1e-2 -> NaN Invalid_operation
! quax071 quantize 217 1e-1 -> 217.0
! quax072 quantize 217 1e+0 -> 217
! quax073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
! quax074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-- general tests ..
***************
*** 539,543 ****
-- Specials
! quax580 quantize Inf -Inf -> NaN Invalid_operation
quax581 quantize Inf 1e-1000 -> NaN Invalid_operation
quax582 quantize Inf 1e-1 -> NaN Invalid_operation
--- 540,544 ----
-- Specials
! quax580 quantize Inf -Inf -> Infinity
quax581 quantize Inf 1e-1000 -> NaN Invalid_operation
quax582 quantize Inf 1e-1 -> NaN Invalid_operation
***************
*** 545,560 ****
quax584 quantize Inf 1e1 -> NaN Invalid_operation
quax585 quantize Inf 1e1000 -> NaN Invalid_operation
! quax586 quantize Inf Inf -> NaN Invalid_operation
quax587 quantize -1000 Inf -> NaN Invalid_operation
! quax588 quantize -Inf Inf -> NaN Invalid_operation
quax589 quantize -1 Inf -> NaN Invalid_operation
quax590 quantize 0 Inf -> NaN Invalid_operation
quax591 quantize 1 Inf -> NaN Invalid_operation
quax592 quantize 1000 Inf -> NaN Invalid_operation
! quax593 quantize Inf Inf -> NaN Invalid_operation
quax594 quantize Inf 1e-0 -> NaN Invalid_operation
quax595 quantize -0 Inf -> NaN Invalid_operation
! quax600 quantize -Inf -Inf -> NaN Invalid_operation
quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation
quax602 quantize -Inf 1e-1 -> NaN Invalid_operation
--- 546,561 ----
quax584 quantize Inf 1e1 -> NaN Invalid_operation
quax585 quantize Inf 1e1000 -> NaN Invalid_operation
! quax586 quantize Inf Inf -> Infinity
quax587 quantize -1000 Inf -> NaN Invalid_operation
! quax588 quantize -Inf Inf -> -Infinity
quax589 quantize -1 Inf -> NaN Invalid_operation
quax590 quantize 0 Inf -> NaN Invalid_operation
quax591 quantize 1 Inf -> NaN Invalid_operation
quax592 quantize 1000 Inf -> NaN Invalid_operation
! quax593 quantize Inf Inf -> Infinity
quax594 quantize Inf 1e-0 -> NaN Invalid_operation
quax595 quantize -0 Inf -> NaN Invalid_operation
! quax600 quantize -Inf -Inf -> -Infinity
quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation
quax602 quantize -Inf 1e-1 -> NaN Invalid_operation
***************
*** 562,577 ****
quax604 quantize -Inf 1e1 -> NaN Invalid_operation
quax605 quantize -Inf 1e1000 -> NaN Invalid_operation
! quax606 quantize -Inf Inf -> NaN Invalid_operation
quax607 quantize -1000 Inf -> NaN Invalid_operation
! quax608 quantize -Inf -Inf -> NaN Invalid_operation
quax609 quantize -1 -Inf -> NaN Invalid_operation
quax610 quantize 0 -Inf -> NaN Invalid_operation
quax611 quantize 1 -Inf -> NaN Invalid_operation
quax612 quantize 1000 -Inf -> NaN Invalid_operation
! quax613 quantize Inf -Inf -> NaN Invalid_operation
quax614 quantize -Inf 1e-0 -> NaN Invalid_operation
quax615 quantize -0 -Inf -> NaN Invalid_operation
! quax621 quantize NaN -Inf -> NaN Invalid_operation
quax622 quantize NaN 1e-1000 -> NaN
quax623 quantize NaN 1e-1 -> NaN
--- 563,578 ----
quax604 quantize -Inf 1e1 -> NaN Invalid_operation
quax605 quantize -Inf 1e1000 -> NaN Invalid_operation
! quax606 quantize -Inf Inf -> -Infinity
quax607 quantize -1000 Inf -> NaN Invalid_operation
! quax608 quantize -Inf -Inf -> -Infinity
quax609 quantize -1 -Inf -> NaN Invalid_operation
quax610 quantize 0 -Inf -> NaN Invalid_operation
quax611 quantize 1 -Inf -> NaN Invalid_operation
quax612 quantize 1000 -Inf -> NaN Invalid_operation
! quax613 quantize Inf -Inf -> Infinity
quax614 quantize -Inf 1e-0 -> NaN Invalid_operation
quax615 quantize -0 -Inf -> NaN Invalid_operation
! quax621 quantize NaN -Inf -> NaN
quax622 quantize NaN 1e-1000 -> NaN
quax623 quantize NaN 1e-1 -> NaN
***************
*** 579,585 ****
quax625 quantize NaN 1e1 -> NaN
quax626 quantize NaN 1e1000 -> NaN
! quax627 quantize NaN Inf -> NaN Invalid_operation
quax628 quantize NaN NaN -> NaN
! quax629 quantize -Inf NaN -> NaN Invalid_operation
quax630 quantize -1000 NaN -> NaN
quax631 quantize -1 NaN -> NaN
--- 580,586 ----
quax625 quantize NaN 1e1 -> NaN
quax626 quantize NaN 1e1000 -> NaN
! quax627 quantize NaN Inf -> NaN
quax628 quantize NaN NaN -> NaN
! quax629 quantize -Inf NaN -> NaN
quax630 quantize -1000 NaN -> NaN
quax631 quantize -1 NaN -> NaN
***************
*** 587,591 ****
quax633 quantize 1 NaN -> NaN
quax634 quantize 1000 NaN -> NaN
! quax635 quantize Inf NaN -> NaN Invalid_operation
quax636 quantize NaN 1e-0 -> NaN
quax637 quantize -0 NaN -> NaN
--- 588,592 ----
quax633 quantize 1 NaN -> NaN
quax634 quantize 1000 NaN -> NaN
! quax635 quantize Inf NaN -> NaN
quax636 quantize NaN 1e-0 -> NaN
quax637 quantize -0 NaN -> NaN
***************
*** 611,614 ****
--- 612,652 ----
quax659 quantize -0 sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ quax661 quantize NaN9 -Inf -> NaN9
+ quax662 quantize NaN8 919 -> NaN8
+ quax663 quantize NaN71 Inf -> NaN71
+ quax664 quantize NaN6 NaN5 -> NaN6
+ quax665 quantize -Inf NaN4 -> NaN4
+ quax666 quantize -919 NaN31 -> NaN31
+ quax667 quantize Inf NaN2 -> NaN2
+
+ quax671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
+ quax672 quantize sNaN98 -11 -> NaN98 Invalid_operation
+ quax673 quantize sNaN97 NaN -> NaN97 Invalid_operation
+ quax674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
+ quax675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
+ quax676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
+ quax677 quantize 088 sNaN91 -> NaN91 Invalid_operation
+ quax678 quantize Inf sNaN90 -> NaN90 Invalid_operation
+ quax679 quantize NaN sNaN88 -> NaN88 Invalid_operation
+
+ quax681 quantize -NaN9 -Inf -> -NaN9
+ quax682 quantize -NaN8 919 -> -NaN8
+ quax683 quantize -NaN71 Inf -> -NaN71
+ quax684 quantize -NaN6 -NaN5 -> -NaN6
+ quax685 quantize -Inf -NaN4 -> -NaN4
+ quax686 quantize -919 -NaN31 -> -NaN31
+ quax687 quantize Inf -NaN2 -> -NaN2
+
+ quax691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
+ quax692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
+ quax693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
+ quax694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
+ quax695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ quax696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
+ quax697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
+ quax698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
+ quax699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
+
-- subnormals and underflow
precision: 4
Index: randomBound32.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randomBound32.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** randomBound32.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- randomBound32.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- These testcases test calculations at precisions 31, 32, and 33, to
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- These testcases test calculations at precisions 31, 32, and 33, to
Index: randoms.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randoms.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** randoms.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- randoms.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 1298,1302 ****
xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded
xpow159 power -18861647. 99794587 -> -4.28957460E+726063462 Inexact Rounded
! xrem159 remainder -18861647. 99794586.7 -> -18861647
xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded
xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded
--- 1298,1302 ----
xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded
xpow159 power -18861647. 99794587 -> -4.28957460E+726063462 Inexact Rounded
! xrem159 remainder -18861647. 99794586.7 -> -18861647.0
xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded
xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded
***************
*** 2226,2230 ****
xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded
xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded
! xrem275 remainder -1156008.8 -8870382.36 -> -1156008.8
xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56
xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded
--- 2226,2230 ----
xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded
xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded
! xrem275 remainder -1156008.8 -8870382.36 -> -1156008.80
xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56
xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded
***************
*** 2890,2894 ****
xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded
xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded
! xrem358 remainder -1546783 -51935370.4 -> -1546783
xsub358 subtract -1546783 -51935370.4 -> 50388587.4
xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded
--- 2890,2894 ----
xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded
xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded
! xrem358 remainder -1546783 -51935370.4 -> -1546783.0
xsub358 subtract -1546783 -51935370.4 -> 50388587.4
xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded
Index: remainder.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainder.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** remainder.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- remainder.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 52,57 ****
remx022 remainder 5 2.0 -> 1.0
remx023 remainder 5 2.000 -> 1.000
! remx024 remainder 5 0.200 -> 0
! remx025 remainder 5 0.200 -> 0
remx030 remainder 1 2 -> 1
--- 52,57 ----
remx022 remainder 5 2.0 -> 1.0
remx023 remainder 5 2.000 -> 1.000
! remx024 remainder 5 0.200 -> 0.000
! remx025 remainder 5 0.200 -> 0.000
remx030 remainder 1 2 -> 1
***************
*** 157,165 ****
remx143 remainder 0.5 2 -> 0.5
remx144 remainder 0.5 2.1 -> 0.5
! remx145 remainder 0.5 2.01 -> 0.5
! remx146 remainder 0.5 2.001 -> 0.5
remx147 remainder 0.50 2 -> 0.50
remx148 remainder 0.50 2.01 -> 0.50
! remx149 remainder 0.50 2.001 -> 0.50
-- steadies
--- 157,165 ----
remx143 remainder 0.5 2 -> 0.5
remx144 remainder 0.5 2.1 -> 0.5
! remx145 remainder 0.5 2.01 -> 0.50
! remx146 remainder 0.5 2.001 -> 0.500
remx147 remainder 0.50 2 -> 0.50
remx148 remainder 0.50 2.01 -> 0.50
! remx149 remainder 0.50 2.001 -> 0.500
-- steadies
***************
*** 186,194 ****
-- some differences from remainderNear
! remx171 remainder 0.4 1.020 -> 0.4
! remx172 remainder 0.50 1.020 -> 0.50
! remx173 remainder 0.51 1.020 -> 0.51
! remx174 remainder 0.52 1.020 -> 0.52
! remx175 remainder 0.6 1.020 -> 0.6
--- 186,194 ----
-- some differences from remainderNear
! remx171 remainder 0.4 1.020 -> 0.400
! remx172 remainder 0.50 1.020 -> 0.500
! remx173 remainder 0.51 1.020 -> 0.510
! remx174 remainder 0.52 1.020 -> 0.520
! remx175 remainder 0.6 1.020 -> 0.600
***************
*** 209,217 ****
-- some differences from remainderNear
! remx231 remainder 0.4 1.020 -> 0.4
! remx232 remainder 0.50 1.020 -> 0.50
! remx233 remainder 0.51 1.020 -> 0.51
! remx234 remainder 0.52 1.020 -> 0.52
! remx235 remainder 0.6 1.020 -> 0.6
-- test some cases that are close to exponent overflow
--- 209,221 ----
-- some differences from remainderNear
! remx231 remainder -0.4 1.020 -> -0.400
! remx232 remainder -0.50 1.020 -> -0.500
! remx233 remainder -0.51 1.020 -> -0.510
! remx234 remainder -0.52 1.020 -> -0.520
! remx235 remainder -0.6 1.020 -> -0.600
!
! -- high Xs
! remx240 remainder 1E+2 1.00 -> 0.00
!
-- test some cases that are close to exponent overflow
***************
*** 256,260 ****
remx316 remainder 1033 50 -> 33
remx317 remainder 101.0 3 -> 2.0
! remx318 remainder 102.0 3 -> 0
remx319 remainder 103.0 3 -> 1.0
remx320 remainder 2.40 1 -> 0.40
--- 260,264 ----
remx316 remainder 1033 50 -> 33
remx317 remainder 101.0 3 -> 2.0
! remx318 remainder 102.0 3 -> 0.0
remx319 remainder 103.0 3 -> 1.0
remx320 remainder 2.40 1 -> 0.40
***************
*** 273,287 ****
remx333 remainder 0.5 2 -> 0.5
remx334 remainder 0.5 2.1 -> 0.5
! remx335 remainder 0.5 2.01 -> 0.5
! remx336 remainder 0.5 2.001 -> 0.5
remx337 remainder 0.50 2 -> 0.50
remx338 remainder 0.50 2.01 -> 0.50
! remx339 remainder 0.50 2.001 -> 0.50
! remx340 remainder 0.5 0.5000001 -> 0.5
! remx341 remainder 0.5 0.50000001 -> 0.5
! remx342 remainder 0.5 0.500000001 -> 0.5
! remx343 remainder 0.5 0.5000000001 -> 0.5
! remx344 remainder 0.5 0.50000000001 -> 0.5
remx345 remainder 0.5 0.4999999 -> 1E-7
remx346 remainder 0.5 0.49999999 -> 1E-8
--- 277,291 ----
remx333 remainder 0.5 2 -> 0.5
remx334 remainder 0.5 2.1 -> 0.5
! remx335 remainder 0.5 2.01 -> 0.50
! remx336 remainder 0.5 2.001 -> 0.500
remx337 remainder 0.50 2 -> 0.50
remx338 remainder 0.50 2.01 -> 0.50
! remx339 remainder 0.50 2.001 -> 0.500
! remx340 remainder 0.5 0.5000001 -> 0.5000000
! remx341 remainder 0.5 0.50000001 -> 0.50000000
! remx342 remainder 0.5 0.500000001 -> 0.500000000
! remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded
! remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded
remx345 remainder 0.5 0.4999999 -> 1E-7
remx346 remainder 0.5 0.49999999 -> 1E-8
***************
*** 303,307 ****
remx360 remainder 1.2 0.7345 -> 0.4655
remx361 remainder 0.8 12 -> 0.8
! remx362 remainder 0.8 0.2 -> 0
remx363 remainder 0.8 0.3 -> 0.2
remx364 remainder 0.800 12 -> 0.800
--- 307,311 ----
remx360 remainder 1.2 0.7345 -> 0.4655
remx361 remainder 0.8 12 -> 0.8
! remx362 remainder 0.8 0.2 -> 0.0
remx363 remainder 0.8 0.3 -> 0.2
remx364 remainder 0.800 12 -> 0.800
***************
*** 312,317 ****
remx371 remainder 2.400 2 -> 0.400
precision: 3
! -- long operand case
remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded
precision: 5
--- 316,322 ----
remx371 remainder 2.400 2 -> 0.400
precision: 3
! -- long operand, rounded, case
remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded
+ -- 12000000000000
precision: 5
***************
*** 387,401 ****
remx723 remainder NaN -1 -> NaN
remx724 remainder NaN -0 -> NaN
! remx725 remainder NaN 0 -> NaN
remx726 remainder NaN 1 -> NaN
remx727 remainder NaN 1000 -> NaN
remx728 remainder NaN Inf -> NaN
! remx729 remainder NaN NaN -> NaN
remx730 remainder -Inf NaN -> NaN
remx731 remainder -1000 NaN -> NaN
remx732 remainder -1 NaN -> NaN
! remx733 remainder -0 NaN -> NaN
remx734 remainder 0 NaN -> NaN
! remx735 remainder 1 NaN -> NaN
remx736 remainder 1000 NaN -> NaN
remx737 remainder Inf NaN -> NaN
--- 392,406 ----
remx723 remainder NaN -1 -> NaN
remx724 remainder NaN -0 -> NaN
! remx725 remainder -NaN 0 -> -NaN
remx726 remainder NaN 1 -> NaN
remx727 remainder NaN 1000 -> NaN
remx728 remainder NaN Inf -> NaN
! remx729 remainder NaN -NaN -> NaN
remx730 remainder -Inf NaN -> NaN
remx731 remainder -1000 NaN -> NaN
remx732 remainder -1 NaN -> NaN
! remx733 remainder -0 -NaN -> -NaN
remx734 remainder 0 NaN -> NaN
! remx735 remainder 1 -NaN -> -NaN
remx736 remainder 1000 NaN -> NaN
remx737 remainder Inf NaN -> NaN
***************
*** 403,407 ****
remx741 remainder sNaN -Inf -> NaN Invalid_operation
remx742 remainder sNaN -1000 -> NaN Invalid_operation
! remx743 remainder sNaN -1 -> NaN Invalid_operation
remx744 remainder sNaN -0 -> NaN Invalid_operation
remx745 remainder sNaN 0 -> NaN Invalid_operation
--- 408,412 ----
remx741 remainder sNaN -Inf -> NaN Invalid_operation
remx742 remainder sNaN -1000 -> NaN Invalid_operation
! remx743 remainder -sNaN -1 -> -NaN Invalid_operation
remx744 remainder sNaN -0 -> NaN Invalid_operation
remx745 remainder sNaN 0 -> NaN Invalid_operation
***************
*** 418,423 ****
remx757 remainder 1 sNaN -> NaN Invalid_operation
remx758 remainder 1000 sNaN -> NaN Invalid_operation
! remx759 remainder Inf sNaN -> NaN Invalid_operation
! remx760 remainder NaN sNaN -> NaN Invalid_operation
-- test some cases that are close to exponent overflow
--- 423,439 ----
remx757 remainder 1 sNaN -> NaN Invalid_operation
remx758 remainder 1000 sNaN -> NaN Invalid_operation
! remx759 remainder Inf -sNaN -> -NaN Invalid_operation
!
! -- propaging NaNs
! remx760 remainder NaN1 NaN7 -> NaN1
! remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
! remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
! remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
! remx764 remainder 15 NaN11 -> NaN11
! remx765 remainder NaN6 NaN12 -> NaN6
! remx766 remainder Inf NaN13 -> NaN13
! remx767 remainder NaN14 -Inf -> NaN14
! remx768 remainder 0 NaN15 -> NaN15
! remx769 remainder NaN16 -0 -> NaN16
-- test some cases that are close to exponent overflow
Index: remainderNear.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainderNear.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** remainderNear.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- remainderNear.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 51,56 ****
rmnx022 remaindernear 5 2.0 -> 1.0
rmnx023 remaindernear 5 2.000 -> 1.000
! rmnx024 remaindernear 5 0.200 -> 0
! rmnx025 remaindernear 5 0.200 -> 0
rmnx030 remaindernear 1 2 -> 1
--- 51,56 ----
rmnx022 remaindernear 5 2.0 -> 1.0
rmnx023 remaindernear 5 2.000 -> 1.000
! rmnx024 remaindernear 5 0.200 -> 0.000
! rmnx025 remaindernear 5 0.200 -> 0.000
rmnx030 remaindernear 1 2 -> 1
***************
*** 158,171 ****
rmmx143 remaindernear 0.5 2 -> 0.5
rmmx144 remaindernear 0.5 2.1 -> 0.5
! rmmx145 remaindernear 0.5 2.01 -> 0.5
! rmmx146 remaindernear 0.5 2.001 -> 0.5
rmmx147 remaindernear 0.50 2 -> 0.50
rmmx148 remaindernear 0.50 2.01 -> 0.50
! rmmx149 remaindernear 0.50 2.001 -> 0.50
-- some differences from remainder
! rmnx150 remaindernear 0.4 1.020 -> 0.4
! rmnx151 remaindernear 0.50 1.020 -> 0.50
! rmnx152 remaindernear 0.51 1.020 -> 0.51
rmnx153 remaindernear 0.52 1.020 -> -0.500
rmnx154 remaindernear 0.6 1.020 -> -0.420
--- 158,171 ----
rmmx143 remaindernear 0.5 2 -> 0.5
rmmx144 remaindernear 0.5 2.1 -> 0.5
! rmmx145 remaindernear 0.5 2.01 -> 0.50
! rmmx146 remaindernear 0.5 2.001 -> 0.500
rmmx147 remaindernear 0.50 2 -> 0.50
rmmx148 remaindernear 0.50 2.01 -> 0.50
! rmmx149 remaindernear 0.50 2.001 -> 0.500
-- some differences from remainder
! rmnx150 remaindernear 0.4 1.020 -> 0.400
! rmnx151 remaindernear 0.50 1.020 -> 0.500
! rmnx152 remaindernear 0.51 1.020 -> 0.510
rmnx153 remaindernear 0.52 1.020 -> -0.500
rmnx154 remaindernear 0.6 1.020 -> -0.420
***************
*** 246,252 ****
-- some differences from remainder
! rmnx231 remaindernear 0.4 1.020 -> 0.4
! rmnx232 remaindernear 0.50 1.020 -> 0.50
! rmnx233 remaindernear 0.51 1.020 -> 0.51
rmnx234 remaindernear 0.52 1.020 -> -0.500
rmnx235 remaindernear 0.6 1.020 -> -0.420
--- 246,252 ----
-- some differences from remainder
! rmnx231 remaindernear 0.4 1.020 -> 0.400
! rmnx232 remaindernear 0.50 1.020 -> 0.500
! rmnx233 remaindernear 0.51 1.020 -> 0.510
rmnx234 remaindernear 0.52 1.020 -> -0.500
rmnx235 remaindernear 0.6 1.020 -> -0.420
***************
*** 293,297 ****
rmnx316 remaindernear 1033 50 -> -17
rmnx317 remaindernear 101.0 3 -> -1.0
! rmnx318 remaindernear 102.0 3 -> 0
rmnx319 remaindernear 103.0 3 -> 1.0
rmnx320 remaindernear 2.40 1 -> 0.40
--- 293,297 ----
rmnx316 remaindernear 1033 50 -> -17
rmnx317 remaindernear 101.0 3 -> -1.0
! rmnx318 remaindernear 102.0 3 -> 0.0
rmnx319 remaindernear 103.0 3 -> 1.0
rmnx320 remaindernear 2.40 1 -> 0.40
***************
*** 310,318 ****
rmnx333 remaindernear 0.5 2 -> 0.5
rmnx334 remaindernear 0.5 2.1 -> 0.5
! rmnx335 remaindernear 0.5 2.01 -> 0.5
! rmnx336 remaindernear 0.5 2.001 -> 0.5
rmnx337 remaindernear 0.50 2 -> 0.50
rmnx338 remaindernear 0.50 2.01 -> 0.50
! rmnx339 remaindernear 0.50 2.001 -> 0.50
rmnx340 remaindernear 0.5 0.5000001 -> -1E-7
--- 310,318 ----
rmnx333 remaindernear 0.5 2 -> 0.5
rmnx334 remaindernear 0.5 2.1 -> 0.5
! rmnx335 remaindernear 0.5 2.01 -> 0.50
! rmnx336 remaindernear 0.5 2.001 -> 0.500
rmnx337 remaindernear 0.50 2 -> 0.50
rmnx338 remaindernear 0.50 2.01 -> 0.50
! rmnx339 remaindernear 0.50 2.001 -> 0.500
rmnx340 remaindernear 0.5 0.5000001 -> -1E-7
***************
*** 339,343 ****
rmnx360 remaindernear 1.2 0.7345 -> -0.2690
rmnx361 remaindernear 0.8 12 -> 0.8
! rmnx362 remaindernear 0.8 0.2 -> 0
rmnx363 remaindernear 0.8 0.3 -> -0.1
rmnx364 remaindernear 0.800 12 -> 0.800
--- 339,343 ----
rmnx360 remaindernear 1.2 0.7345 -> -0.2690
rmnx361 remaindernear 0.8 12 -> 0.8
! rmnx362 remaindernear 0.8 0.2 -> 0.0
rmnx363 remaindernear 0.8 0.3 -> -0.1
rmnx364 remaindernear 0.800 12 -> 0.800
***************
*** 460,464 ****
rmnx730 remaindernear -Inf NaN -> NaN
rmnx731 remaindernear -1000 NaN -> NaN
! rmnx732 remaindernear -1 NaN -> NaN
rmnx733 remaindernear -0 NaN -> NaN
rmnx734 remaindernear 0 NaN -> NaN
--- 460,464 ----
rmnx730 remaindernear -Inf NaN -> NaN
rmnx731 remaindernear -1000 NaN -> NaN
! rmnx732 remaindernear -1 -NaN -> -NaN
rmnx733 remaindernear -0 NaN -> NaN
rmnx734 remaindernear 0 NaN -> NaN
***************
*** 469,473 ****
rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation
rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation
! rmnx743 remaindernear sNaN -1 -> NaN Invalid_operation
rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation
rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation
--- 469,473 ----
rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation
rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation
! rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation
rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation
rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation
***************
*** 480,484 ****
rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation
rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation
! rmnx755 remaindernear -0 sNaN -> NaN Invalid_operation
rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation
rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation
--- 480,484 ----
rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation
rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation
! rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation
rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation
rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation
***************
*** 487,501 ****
rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation
-- test some cases that are close to exponent overflow
maxexponent: 999999999
minexponent: -999999999
! rmnx770 remaindernear 1 1e999999999 -> 1
! rmnx771 remaindernear 1 0.9e999999999 -> 1
! rmnx772 remaindernear 1 0.99e999999999 -> 1
! rmnx773 remaindernear 1 0.999999999e999999999 -> 1
! rmnx774 remaindernear 9e999999999 1 -> NaN Division_impossible
! rmnx775 remaindernear 9.9e999999999 1 -> NaN Division_impossible
! rmnx776 remaindernear 9.99e999999999 1 -> NaN Division_impossible
! rmnx777 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible
--- 487,513 ----
rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation
+ -- propaging NaNs
+ rmnx761 remaindernear NaN1 NaN7 -> NaN1
+ rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
+ rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation
+ rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
+ rmnx765 remaindernear 15 NaN11 -> NaN11
+ rmnx766 remaindernear NaN6 NaN12 -> NaN6
+ rmnx767 remaindernear Inf -NaN13 -> -NaN13
+ rmnx768 remaindernear NaN14 -Inf -> NaN14
+ rmnx769 remaindernear 0 NaN15 -> NaN15
+ rmnx770 remaindernear -NaN16 -0 -> -NaN16
+
-- test some cases that are close to exponent overflow
maxexponent: 999999999
minexponent: -999999999
! rmnx780 remaindernear 1 1e999999999 -> 1
! rmnx781 remaindernear 1 0.9e999999999 -> 1
! rmnx782 remaindernear 1 0.99e999999999 -> 1
! rmnx783 remaindernear 1 0.999999999e999999999 -> 1
! rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible
! rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible
! rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible
! rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible
***************
*** 504,515 ****
maxexponent: 999999999
minexponent: -999999999
! rmnx780 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded
! rmnx781 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible
! rmnx782 remaindernear +0.100 9E+999999999 -> 0.100
! rmnx783 remaindernear 9E-999999999 +9.100 -> 9E-999999999
! rmnx785 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded
! rmnx786 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible
! rmnx787 remaindernear -0.100 9E+999999999 -> -0.100
! rmnx788 remaindernear 9E-999999999 -9.100 -> 9E-999999999
-- long operands checks
--- 516,527 ----
maxexponent: 999999999
minexponent: -999999999
! rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded
! rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible
! rmnx792 remaindernear +0.100 9E+999999999 -> 0.100
! rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999
! rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded
! rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible
! rmnx797 remaindernear -0.100 9E+999999999 -> -0.100
! rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999
-- long operands checks
Index: rescale.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rescale.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rescale.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- rescale.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- [obsolete] Quantize.decTest has the improved version
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- [obsolete] Quantize.decTest has the improved version
***************
*** 525,529 ****
-- Specials
! resx580 rescale Inf -Inf -> NaN Invalid_operation
resx581 rescale Inf -1000 -> NaN Invalid_operation
resx582 rescale Inf -1 -> NaN Invalid_operation
--- 525,529 ----
-- Specials
! resx580 rescale Inf -Inf -> Infinity
resx581 rescale Inf -1000 -> NaN Invalid_operation
resx582 rescale Inf -1 -> NaN Invalid_operation
***************
*** 531,546 ****
resx584 rescale Inf 1 -> NaN Invalid_operation
resx585 rescale Inf 1000 -> NaN Invalid_operation
! resx586 rescale Inf Inf -> NaN Invalid_operation
resx587 rescale -1000 Inf -> NaN Invalid_operation
! resx588 rescale -Inf Inf -> NaN Invalid_operation
resx589 rescale -1 Inf -> NaN Invalid_operation
resx590 rescale 0 Inf -> NaN Invalid_operation
resx591 rescale 1 Inf -> NaN Invalid_operation
resx592 rescale 1000 Inf -> NaN Invalid_operation
! resx593 rescale Inf Inf -> NaN Invalid_operation
resx594 rescale Inf -0 -> NaN Invalid_operation
resx595 rescale -0 Inf -> NaN Invalid_operation
! resx600 rescale -Inf -Inf -> NaN Invalid_operation
resx601 rescale -Inf -1000 -> NaN Invalid_operation
resx602 rescale -Inf -1 -> NaN Invalid_operation
--- 531,546 ----
resx584 rescale Inf 1 -> NaN Invalid_operation
resx585 rescale Inf 1000 -> NaN Invalid_operation
! resx586 rescale Inf Inf -> Infinity
resx587 rescale -1000 Inf -> NaN Invalid_operation
! resx588 rescale -Inf Inf -> -Infinity
resx589 rescale -1 Inf -> NaN Invalid_operation
resx590 rescale 0 Inf -> NaN Invalid_operation
resx591 rescale 1 Inf -> NaN Invalid_operation
resx592 rescale 1000 Inf -> NaN Invalid_operation
! resx593 rescale Inf Inf -> Infinity
resx594 rescale Inf -0 -> NaN Invalid_operation
resx595 rescale -0 Inf -> NaN Invalid_operation
! resx600 rescale -Inf -Inf -> -Infinity
resx601 rescale -Inf -1000 -> NaN Invalid_operation
resx602 rescale -Inf -1 -> NaN Invalid_operation
***************
*** 548,563 ****
resx604 rescale -Inf 1 -> NaN Invalid_operation
resx605 rescale -Inf 1000 -> NaN Invalid_operation
! resx606 rescale -Inf Inf -> NaN Invalid_operation
resx607 rescale -1000 Inf -> NaN Invalid_operation
! resx608 rescale -Inf -Inf -> NaN Invalid_operation
resx609 rescale -1 -Inf -> NaN Invalid_operation
resx610 rescale 0 -Inf -> NaN Invalid_operation
resx611 rescale 1 -Inf -> NaN Invalid_operation
resx612 rescale 1000 -Inf -> NaN Invalid_operation
! resx613 rescale Inf -Inf -> NaN Invalid_operation
resx614 rescale -Inf -0 -> NaN Invalid_operation
resx615 rescale -0 -Inf -> NaN Invalid_operation
! resx621 rescale NaN -Inf -> NaN Invalid_operation
resx622 rescale NaN -1000 -> NaN
resx623 rescale NaN -1 -> NaN
--- 548,563 ----
resx604 rescale -Inf 1 -> NaN Invalid_operation
resx605 rescale -Inf 1000 -> NaN Invalid_operation
! resx606 rescale -Inf Inf -> -Infinity
resx607 rescale -1000 Inf -> NaN Invalid_operation
! resx608 rescale -Inf -Inf -> -Infinity
resx609 rescale -1 -Inf -> NaN Invalid_operation
resx610 rescale 0 -Inf -> NaN Invalid_operation
resx611 rescale 1 -Inf -> NaN Invalid_operation
resx612 rescale 1000 -Inf -> NaN Invalid_operation
! resx613 rescale Inf -Inf -> Infinity
resx614 rescale -Inf -0 -> NaN Invalid_operation
resx615 rescale -0 -Inf -> NaN Invalid_operation
! resx621 rescale NaN -Inf -> NaN
resx622 rescale NaN -1000 -> NaN
resx623 rescale NaN -1 -> NaN
***************
*** 565,577 ****
resx625 rescale NaN 1 -> NaN
resx626 rescale NaN 1000 -> NaN
! resx627 rescale NaN Inf -> NaN Invalid_operation
resx628 rescale NaN NaN -> NaN
! resx629 rescale -Inf NaN -> NaN Invalid_operation
resx630 rescale -1000 NaN -> NaN
resx631 rescale -1 NaN -> NaN
resx632 rescale 0 NaN -> NaN
! resx633 rescale 1 NaN -> NaN
resx634 rescale 1000 NaN -> NaN
! resx635 rescale Inf NaN -> NaN Invalid_operation
resx636 rescale NaN -0 -> NaN
resx637 rescale -0 NaN -> NaN
--- 565,577 ----
resx625 rescale NaN 1 -> NaN
resx626 rescale NaN 1000 -> NaN
! resx627 rescale NaN Inf -> NaN
resx628 rescale NaN NaN -> NaN
! resx629 rescale -Inf NaN -> NaN
resx630 rescale -1000 NaN -> NaN
resx631 rescale -1 NaN -> NaN
resx632 rescale 0 NaN -> NaN
! resx633 rescale 1 -NaN -> -NaN
resx634 rescale 1000 NaN -> NaN
! resx635 rescale Inf NaN -> NaN
resx636 rescale NaN -0 -> NaN
resx637 rescale -0 NaN -> NaN
***************
*** 583,588 ****
resx645 rescale sNaN 1 -> NaN Invalid_operation
resx646 rescale sNaN 1000 -> NaN Invalid_operation
! resx647 rescale sNaN NaN -> NaN Invalid_operation
! resx648 rescale sNaN sNaN -> NaN Invalid_operation
resx649 rescale NaN sNaN -> NaN Invalid_operation
resx650 rescale -Inf sNaN -> NaN Invalid_operation
--- 583,588 ----
resx645 rescale sNaN 1 -> NaN Invalid_operation
resx646 rescale sNaN 1000 -> NaN Invalid_operation
! resx647 rescale -sNaN NaN -> -NaN Invalid_operation
! resx648 rescale sNaN -sNaN -> NaN Invalid_operation
resx649 rescale NaN sNaN -> NaN Invalid_operation
resx650 rescale -Inf sNaN -> NaN Invalid_operation
***************
*** 590,594 ****
resx652 rescale -1 sNaN -> NaN Invalid_operation
resx653 rescale 0 sNaN -> NaN Invalid_operation
! resx654 rescale 1 sNaN -> NaN Invalid_operation
resx655 rescale 1000 sNaN -> NaN Invalid_operation
resx656 rescale Inf sNaN -> NaN Invalid_operation
--- 590,594 ----
resx652 rescale -1 sNaN -> NaN Invalid_operation
resx653 rescale 0 sNaN -> NaN Invalid_operation
! resx654 rescale 1 -sNaN -> -NaN Invalid_operation
resx655 rescale 1000 sNaN -> NaN Invalid_operation
resx656 rescale Inf sNaN -> NaN Invalid_operation
***************
*** 597,600 ****
--- 597,619 ----
resx659 rescale -0 sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ resx661 rescale NaN9 -Inf -> NaN9
+ resx662 rescale NaN81 919 -> NaN81
+ resx663 rescale NaN72 Inf -> NaN72
+ resx664 rescale -NaN66 NaN5 -> -NaN66
+ resx665 rescale -Inf NaN4 -> NaN4
+ resx666 rescale -919 NaN32 -> NaN32
+ resx667 rescale Inf NaN2 -> NaN2
+
+ resx671 rescale sNaN99 -Inf -> NaN99 Invalid_operation
+ resx672 rescale -sNaN98 -11 -> -NaN98 Invalid_operation
+ resx673 rescale sNaN97 NaN -> NaN97 Invalid_operation
+ resx674 rescale sNaN16 sNaN94 -> NaN16 Invalid_operation
+ resx675 rescale NaN95 sNaN93 -> NaN93 Invalid_operation
+ resx676 rescale -Inf sNaN92 -> NaN92 Invalid_operation
+ resx677 rescale 088 -sNaN91 -> -NaN91 Invalid_operation
+ resx678 rescale Inf -sNaN90 -> -NaN90 Invalid_operation
+ resx679 rescale NaN sNaN87 -> NaN87 Invalid_operation
+
-- subnormals and underflow
precision: 4
Index: rounding.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rounding.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rounding.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- rounding.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- These tests require that implementations take account of residues in
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- These tests require that implementations take account of residues in
Index: squareroot.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/squareroot.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** squareroot.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- squareroot.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 2948,2951 ****
--- 2948,2957 ----
sqtx822 squareroot NaN -> NaN
sqtx823 squareroot sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ sqtx824 squareroot sNaN123 -> NaN123 Invalid_operation
+ sqtx825 squareroot -sNaN321 -> -NaN321 Invalid_operation
+ sqtx826 squareroot NaN456 -> NaN456
+ sqtx827 squareroot -NaN654 -> -NaN654
+ sqtx828 squareroot NaN1 -> NaN1
-- Null test
Index: subtract.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/subtract.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** subtract.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- subtract.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 724,728 ****
subx821 subtract NaN Inf -> NaN
! subx822 subtract NaN 1000 -> NaN
subx823 subtract NaN 1 -> NaN
subx824 subtract NaN 0 -> NaN
--- 724,728 ----
subx821 subtract NaN Inf -> NaN
! subx822 subtract -NaN 1000 -> -NaN
subx823 subtract NaN 1 -> NaN
subx824 subtract NaN 0 -> NaN
***************
*** 731,735 ****
subx827 subtract NaN -1000 -> NaN
subx828 subtract NaN -Inf -> NaN
! subx829 subtract NaN NaN -> NaN
subx830 subtract -Inf NaN -> NaN
subx831 subtract -1000 NaN -> NaN
--- 731,735 ----
subx827 subtract NaN -1000 -> NaN
subx828 subtract NaN -Inf -> NaN
! subx829 subtract -NaN NaN -> -NaN
subx830 subtract -Inf NaN -> NaN
subx831 subtract -1000 NaN -> NaN
***************
*** 738,746 ****
subx834 subtract 0 NaN -> NaN
subx835 subtract 1 NaN -> NaN
! subx836 subtract 1000 NaN -> NaN
subx837 subtract Inf NaN -> NaN
subx841 subtract sNaN Inf -> NaN Invalid_operation
! subx842 subtract sNaN 1000 -> NaN Invalid_operation
subx843 subtract sNaN 1 -> NaN Invalid_operation
subx844 subtract sNaN 0 -> NaN Invalid_operation
--- 738,746 ----
subx834 subtract 0 NaN -> NaN
subx835 subtract 1 NaN -> NaN
! subx836 subtract 1000 -NaN -> -NaN
subx837 subtract Inf NaN -> NaN
subx841 subtract sNaN Inf -> NaN Invalid_operation
! subx842 subtract -sNaN 1000 -> -NaN Invalid_operation
subx843 subtract sNaN 1 -> NaN Invalid_operation
subx844 subtract sNaN 0 -> NaN Invalid_operation
***************
*** 751,755 ****
subx849 subtract sNaN sNaN -> NaN Invalid_operation
subx850 subtract NaN sNaN -> NaN Invalid_operation
! subx851 subtract -Inf sNaN -> NaN Invalid_operation
subx852 subtract -1000 sNaN -> NaN Invalid_operation
subx853 subtract -1 sNaN -> NaN Invalid_operation
--- 751,755 ----
subx849 subtract sNaN sNaN -> NaN Invalid_operation
subx850 subtract NaN sNaN -> NaN Invalid_operation
! subx851 subtract -Inf -sNaN -> -NaN Invalid_operation
subx852 subtract -1000 sNaN -> NaN Invalid_operation
subx853 subtract -1 sNaN -> NaN Invalid_operation
***************
*** 761,764 ****
--- 761,786 ----
subx859 subtract NaN sNaN -> NaN Invalid_operation
+ -- propagating NaNs
+ subx861 subtract NaN01 -Inf -> NaN1
+ subx862 subtract -NaN02 -1000 -> -NaN2
+ subx863 subtract NaN03 1000 -> NaN3
+ subx864 subtract NaN04 Inf -> NaN4
+ subx865 subtract NaN05 NaN61 -> NaN5
+ subx866 subtract -Inf -NaN71 -> -NaN71
+ subx867 subtract -1000 NaN81 -> NaN81
+ subx868 subtract 1000 NaN91 -> NaN91
+ subx869 subtract Inf NaN101 -> NaN101
+ subx871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
+ subx872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
+ subx873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
+ subx874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
+ subx875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
+ subx876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
+ subx877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
+ subx878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
+ subx879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
+ subx880 subtract Inf sNaN231 -> NaN231 Invalid_operation
+ subx881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
+
-- subnormals and underflows
precision: 3
Index: testall.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/testall.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** testall.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- testall.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- core tests (using Extended: 1) --------------------------------------
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- core tests (using Extended: 1) --------------------------------------
***************
*** 42,45 ****
--- 42,46 ----
dectest: rescale -- [obsolete]
dectest: rounding
+ dectest: samequantum
dectest: squareroot
dectest: subtract
Index: tointegral.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/tointegral.decTest,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tointegral.decTest 12 Aug 2003 23:05:30 -0000 1.1
--- tointegral.decTest 6 Feb 2004 16:56:03 -0000 1.2
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
-- This set of tests tests the extended specification 'round-to-integral
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
-- This set of tests tests the extended specification 'round-to-integral
***************
*** 24,28 ****
-- All non-zero results are defined as being those from either copy or
-- quantize, so those are assumed to have been tested.
! -- Note that 754r requires that not be set, and we similarly
-- assume Rounded is not set.
--- 24,28 ----
-- All non-zero results are defined as being those from either copy or
-- quantize, so those are assumed to have been tested.
! -- Note that 754r requires that Inexact not be set, and we similarly
-- assume Rounded is not set.
***************
*** 149,152 ****
--- 149,159 ----
intx150 tointegral -0E+4 -> -0E+4
intx151 tointegral -0E+5 -> -0E+5
+ -- propagating NaNs
+ intx152 tointegral NaN808 -> NaN808
+ intx153 tointegral sNaN080 -> NaN80 Invalid_operation
+ intx154 tointegral -NaN808 -> -NaN808
+ intx155 tointegral -sNaN080 -> -NaN80 Invalid_operation
+ intx156 tointegral -NaN -> -NaN
+ intx157 tointegral -sNaN -> -NaN Invalid_operation
-- examples
Index: trim.decTest
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/trim.decTest,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** trim.decTest 12 Aug 2003 23:05:30 -0000 1.4
--- trim.decTest 6 Feb 2004 16:56:03 -0000 1.5
***************
*** 18,22 ****
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.28
extended: 1
--- 18,22 ----
-- mfc(a)uk.ibm.com --
------------------------------------------------------------------------
! version: 2.35
extended: 1
***************
*** 142,145 ****
--- 142,151 ----
trmx322 trim NaN -> NaN
trmx323 trim sNaN -> sNaN
+ trmx324 trim NaN999 -> NaN999
+ trmx325 trim sNaN777 -> sNaN777
+ trmx326 trim -NaN -> -NaN
+ trmx327 trim -sNaN -> -sNaN
+ trmx328 trim -NaN999 -> -NaN999
+ trmx329 trim -sNaN777 -> -sNaN777
-- Null test
1
0

python/nondist/sandbox/decimal Decimal.py, 1.13, 1.14 test_Decimal.py, 1.6, 1.7
by eprice@users.sourceforge.net Feb. 6, 2004
by eprice@users.sourceforge.net Feb. 6, 2004
Feb. 6, 2004
Update of /cvsroot/python/python/nondist/sandbox/decimal
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18673
Modified Files:
Decimal.py test_Decimal.py
Log Message:
Added new tests, fix Decimal/test_Decimal to have samequantum.
Index: Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Decimal.py 6 Feb 2004 16:31:32 -0000 1.13
--- Decimal.py 6 Feb 2004 16:56:03 -0000 1.14
***************
*** 1805,1809 ****
--- 1805,1822 ----
return self.rescale(exp._exp, rounding, context, watchexp)
+ def samequantum(self, other, context=None):
+ """Test whether self and other have the same exponent.
+ same as self._exp == other._exp, except NaN == sNaN
+ """
+ if self._isnan() or other._isnan():
+ if self._isnan() and other._isnan():
+ return True
+ return False
+ if self._isinfinity() or other._isinfinity():
+ if self._isinfinity() and other._isinfinity():
+ return True
+ return False
+ return self._exp == other._exp
def rescale(self, exp, rounding = None, context=None, watchexp = 1):
"""Rescales so that the exponent is exp.
***************
*** 2282,2285 ****
--- 2295,2300 ----
def rescale(self, a, b):
return a.rescale(b, context=self)
+ def samequantum(self, a, b):
+ return a.samequantum(b, context=self)
def squareroot(self, a):
return a.sqrt(context=self)
Index: test_Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** test_Decimal.py 6 Feb 2004 16:31:32 -0000 1.6
--- test_Decimal.py 6 Feb 2004 16:56:03 -0000 1.7
***************
*** 202,205 ****
--- 202,207 ----
try:
result = str(funct(*vals))
+ if fname == 'samequantum':
+ result = str(int(eval(result))) # 'True', 'False' -> '1', '0'
except ExceptionList, error:
self.fail("Raised %s in %s" % (error, s))
***************
*** 244,265 ****
self.context.clamp = clamp
- def test_add(self):
- """Tests the Decimal class on Cowlishaw's add tests.
-
- See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
- """
- self.eval_file(dir + 'add' + '.decTest')
-
def test_abs(self):
"""Tests the Decimal class on Cowlishaw's abs tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'abs' + '.decTest')
def test_base(self):
"""Tests the Decimal class on Cowlishaw's base tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'base' + '.decTest')
--- 246,267 ----
self.context.clamp = clamp
def test_abs(self):
"""Tests the Decimal class on Cowlishaw's abs tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'abs' + '.decTest')
+ def test_add(self):
+ """Tests the Decimal class on Cowlishaw's add tests.
+
+ See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
+ """
+ self.eval_file(dir + 'add' + '.decTest')
+
def test_base(self):
"""Tests the Decimal class on Cowlishaw's base tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'base' + '.decTest')
***************
*** 268,272 ****
"""Tests the Decimal class on Cowlishaw's clamp tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'clamp' + '.decTest')
--- 270,274 ----
"""Tests the Decimal class on Cowlishaw's clamp tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'clamp' + '.decTest')
***************
*** 275,279 ****
"""Tests the Decimal class on Cowlishaw's compare tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'compare' + '.decTest')
--- 277,281 ----
"""Tests the Decimal class on Cowlishaw's compare tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'compare' + '.decTest')
***************
*** 282,286 ****
"""Tests the Decimal class on Cowlishaw's divide tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'divide' + '.decTest')
--- 284,288 ----
"""Tests the Decimal class on Cowlishaw's divide tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'divide' + '.decTest')
***************
*** 289,293 ****
"""Tests the Decimal class on Cowlishaw's divideint tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'divideint' + '.decTest')
--- 291,295 ----
"""Tests the Decimal class on Cowlishaw's divideint tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'divideint' + '.decTest')
***************
*** 296,314 ****
"""Tests the Decimal class on Cowlishaw's inexact tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'inexact' + '.decTest')
- def test_integer(self):
- """Tests the Decimal class on Cowlishaw's integer tests.
-
- See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
- """
- self.eval_file(dir + 'integer' + '.decTest')
-
def test_max(self):
"""Tests the Decimal class on Cowlishaw's max tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'max' + '.decTest')
--- 298,309 ----
"""Tests the Decimal class on Cowlishaw's inexact tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'inexact' + '.decTest')
def test_max(self):
"""Tests the Decimal class on Cowlishaw's max tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'max' + '.decTest')
***************
*** 317,321 ****
"""Tests the Decimal class on Cowlishaw's min tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'min' + '.decTest')
--- 312,316 ----
"""Tests the Decimal class on Cowlishaw's min tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'min' + '.decTest')
***************
*** 324,328 ****
"""Tests the Decimal class on Cowlishaw's minus tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'minus' + '.decTest')
--- 319,323 ----
"""Tests the Decimal class on Cowlishaw's minus tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'minus' + '.decTest')
***************
*** 331,335 ****
"""Tests the Decimal class on Cowlishaw's multiply tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir+'multiply'+'.decTest')
--- 326,330 ----
"""Tests the Decimal class on Cowlishaw's multiply tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir+'multiply'+'.decTest')
***************
*** 338,342 ****
"""Tests the Decimal class on Cowlishaw's normalize tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'normalize' + '.decTest')
--- 333,337 ----
"""Tests the Decimal class on Cowlishaw's normalize tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'normalize' + '.decTest')
***************
*** 345,349 ****
"""Tests the Decimal class on Cowlishaw's plus tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'plus' + '.decTest')
--- 340,344 ----
"""Tests the Decimal class on Cowlishaw's plus tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'plus' + '.decTest')
***************
*** 352,356 ****
"""Tests the Decimal class on Cowlishaw's power tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'power' + '.decTest')
--- 347,351 ----
"""Tests the Decimal class on Cowlishaw's power tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'power' + '.decTest')
***************
*** 359,363 ****
"""Tests the Decimal class on Cowlishaw's quantize tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'quantize' + '.decTest')
--- 354,358 ----
"""Tests the Decimal class on Cowlishaw's quantize tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'quantize' + '.decTest')
***************
*** 366,370 ****
"""Tests the Decimal class on Cowlishaw's randomBound32 tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'randomBound32' + '.decTest')
--- 361,365 ----
"""Tests the Decimal class on Cowlishaw's randomBound32 tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'randomBound32' + '.decTest')
***************
*** 373,377 ****
"""Tests the Decimal class on Cowlishaw's randoms tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'randoms' + '.decTest')
--- 368,372 ----
"""Tests the Decimal class on Cowlishaw's randoms tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'randoms' + '.decTest')
***************
*** 380,384 ****
"""Tests the Decimal class on Cowlishaw's remainder tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'remainder' + '.decTest')
--- 375,379 ----
"""Tests the Decimal class on Cowlishaw's remainder tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'remainder' + '.decTest')
***************
*** 387,391 ****
"""Tests the Decimal class on Cowlishaw's remainderNear tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'remainderNear' + '.decTest')
--- 382,386 ----
"""Tests the Decimal class on Cowlishaw's remainderNear tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'remainderNear' + '.decTest')
***************
*** 394,405 ****
"""Tests the Decimal class on Cowlishaw's rounding tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'rounding' + '.decTest')
def test_squareroot(self):
"""Tests the Decimal class on Cowlishaw's squareroot tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'squareroot' + '.decTest')
--- 389,407 ----
"""Tests the Decimal class on Cowlishaw's rounding tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'rounding' + '.decTest')
+ def test_samequantum(self):
+ """Tests the Decimal class on Cowlishaw's samequantum tests.
+
+ See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
+ """
+ self.eval_file(dir + 'samequantum' + '.decTest')
+
def test_squareroot(self):
"""Tests the Decimal class on Cowlishaw's squareroot tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'squareroot' + '.decTest')
***************
*** 408,412 ****
"""Tests the Decimal class on Cowlishaw's subtract tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'subtract' + '.decTest')
--- 410,414 ----
"""Tests the Decimal class on Cowlishaw's subtract tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'subtract' + '.decTest')
***************
*** 415,419 ****
"""Tests the Decimal class on Cowlishaw's tointegral tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'tointegral' + '.decTest')
--- 417,421 ----
"""Tests the Decimal class on Cowlishaw's tointegral tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'tointegral' + '.decTest')
***************
*** 422,426 ****
"""Tests the Decimal class on Cowlishaw's trim tests.
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
"""
self.eval_file(dir + 'trim' + '.decTest')
--- 424,428 ----
"""Tests the Decimal class on Cowlishaw's trim tests.
! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite.
"""
self.eval_file(dir + 'trim' + '.decTest')
1
0

python/nondist/sandbox/decimal Decimal.py, 1.12, 1.13 test_Decimal.py, 1.5, 1.6
by eprice@users.sourceforge.net Feb. 6, 2004
by eprice@users.sourceforge.net Feb. 6, 2004
Feb. 6, 2004
Update of /cvsroot/python/python/nondist/sandbox/decimal
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12521
Modified Files:
Decimal.py test_Decimal.py
Log Message:
Updated to pass newer test cases. Most notably, NaNs with diagnostic info work.
Index: Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Decimal.py 12 Aug 2003 23:04:23 -0000 1.12
--- Decimal.py 6 Feb 2004 16:31:32 -0000 1.13
***************
*** 248,252 ****
def handle(self, context, *args):
if args:
! return (NaN,NaN)
return NaN
--- 248,253 ----
def handle(self, context, *args):
if args:
! if args[0] == 1: #sNaN, must drop 's' but keep diagnostics
! return Decimal( (args[1]._sign, args[1]._int, 'n') )
return NaN
***************
*** 374,377 ****
--- 375,382 ----
ExceptionList = filter(filterfunct, globals().values())
+ #To fix reloading, force it to create a new context
+ #Old contexts have different exceptions in their dicts, making problems.
+ if hasattr(threading.currentThread(), '__decimal_context__'):
+ del threading.currentThread().__decimal_context__
def setcontext(context):
***************
*** 423,433 ****
return
if isnan(value):
! sig = isnan(value) - 1
! self._exp = sig and 'N' or 'n'
! self._sign = 0
! self._int = (0,) #snan or nan
return
self._convertString(value, context)
- # Only a string if it works here
return
--- 428,444 ----
return
if isnan(value):
! sig, sign, diag = isnan(value)
! if len(diag) > context.prec: #Diagnostic info too long
! self._sign, self._int, self._exp = \
! context.raise_error(ConversionSyntax)
! return
! if sig == 1:
! self._exp = 'n' #qNaN
! else: #sig == 2
! self._exp = 'N' #sNaN
! self._sign = sign
! self._int = tuple(map(int, tuple(diag))) #Diagnostic info
return
self._convertString(value, context)
return
***************
*** 441,452 ****
raise ValueError, 'Invalid arguments'
if value[0] not in [0,1]:
! raise ValueError, 'Invalid sign'
# FIXME: Add more input validation checks here
self._sign = value[0]
self._int = tuple(value[1])
if value[2] in ('F','n','N'):
! self._exp = value[2]
else:
! self._exp = long(value[2])
return
--- 452,464 ----
raise ValueError, 'Invalid arguments'
if value[0] not in [0,1]:
! raise ValueError, 'Invalid sign'
!
# FIXME: Add more input validation checks here
self._sign = value[0]
self._int = tuple(value[1])
if value[2] in ('F','n','N'):
! self._exp = value[2]
else:
! self._exp = long(value[2])
return
***************
*** 468,472 ****
if isinstance(value, float):
! #self._convertString(_floatToString(value), context)
#
# This would give a more strictly accurate representation,
--- 480,485 ----
if isinstance(value, float):
! # Another possibility would be:
! # self._convertString(_floatToString(value), context)
#
# This would give a more strictly accurate representation,
***************
*** 521,531 ****
if self._isnan() == 2:
! return context.raise_error(InvalidOperation, 'sNaN')
if other is not None and other._isnan() == 2:
! return context.raise_error(InvalidOperation, 'sNaN')
if self._isnan():
! return NaN
if other is not None and other._isnan():
! return NaN
return 0
--- 534,546 ----
if self._isnan() == 2:
! return context.raise_error(InvalidOperation, 'sNaN',
! 1, self)
if other is not None and other._isnan() == 2:
! return context.raise_error(InvalidOperation, 'sNaN',
! 1, other)
if self._isnan():
! return self
if other is not None and other._isnan():
! return other
return 0
***************
*** 540,544 ****
self._sign, self._int, self._exp = _string2exact(value)
except ValueError:
! self._sign, self._int, self._exp = context.raise_error(ConversionSyntax)
return
--- 555,560 ----
self._sign, self._int, self._exp = _string2exact(value)
except ValueError:
! self._sign, self._int, self._exp = \
! context.raise_error(ConversionSyntax)
return
***************
*** 660,671 ****
"""
if self._isnan():
if self._isnan() == 2:
! return 'sNaN'
! return 'NaN'
if self._isinfinity():
! sign = self._isinfinity()
! if sign > 0:
! return 'Infinity'
! return '-Infinity'
if context is None:
--- 676,690 ----
"""
if self._isnan():
+ minus = '-'*self._sign
+ if self._int == (0,):
+ info = ''
+ else:
+ info = ''.join(map(str, self._int))
if self._isnan() == 2:
! return minus + 'sNaN' + info
! return minus + 'NaN' + info
if self._isinfinity():
! minus = '-'*self._sign
! return minus + 'Infinity'
if context is None:
***************
*** 675,678 ****
--- 694,717 ----
numdigits = len(self._int)
leftdigits = self._exp + numdigits
+ if eng and not self: #self = 0eX wants 0[.0[0]]eY, not [[0]0]0eY
+ if self._exp < 0 and self._exp >= -6: #short, no need for e/E
+ s = '-'*self._sign + '0.' + '0'*(abs(self._exp))
+ return s
+ #exp is closest mult. of 3 >= self._exp
+ exp = ((self._exp - 1)// 3 + 1) * 3
+ if exp != self._exp:
+ s = '0.'+'0'*(exp - self._exp)
+ else:
+ s = '0'
+ if exp != 0:
+ if context.capitals:
+ s += 'E'
+ else:
+ s += 'e'
+ if exp > 0:
+ s += '+' #0.0e+3, not 0.0e3
+ s += str(exp)
+ s = '-'*self._sign + s
+ return s
if eng:
dotplace = (leftdigits-1)%3+1
***************
*** 900,904 ****
if context is None:
context = getcontext()
! # -Decimal(0) = Decimal(0), which we don't want
# (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.)
# so we change the sign directly.
--- 939,946 ----
if context is None:
context = getcontext()
! ans = self._check_nans(other, context=context)
! if ans:
! return ans
! # -Decimal(0) = Decimal(0), which we don't want since
# (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.)
# so we change the sign directly.
***************
*** 1076,1079 ****
--- 1118,1123 ----
context.raise_error(Clamped, 'Division by infinity')
return Decimal((sign, (0,), context.Etiny()))
+ if self._isinfinity():
+ return Infsign[sign]
#These two have different precision.
if not self:
***************
*** 1089,1105 ****
if not other:
return context.raise_error(DivisionByZero, 'x / 0', sign)
- if self._isinfinity():
- return Infsign[sign]
if divmod:
if other._isinfinity():
return (Decimal((sign, (0,), 0)), Decimal(self))
- if not self:
- otherside = Decimal(self)
- otherside._exp = min(self._exp, other._exp)
- return (Decimal((sign, (0,), 0)), otherside)
-
- if not other:
- return context.raise_error(DivisionByZero, 'divmod(x,0)',
- sign, 1)
if self._isinfinity():
if divmod == 1:
--- 1133,1139 ----
***************
*** 1111,1114 ****
--- 1145,1156 ----
return (Infsign[sign],
context.raise_error(InvalidOperation, 'INF % x'))
+ if not self:
+ otherside = Decimal(self)
+ otherside._exp = min(self._exp, other._exp)
+ return (Decimal((sign, (0,), 0)), otherside)
+
+ if not other:
+ return context.raise_error(DivisionByZero, 'divmod(x,0)',
+ sign, 1)
#OK, so neither = 0, INF
***************
*** 1121,1125 ****
if divmod == 1 or divmod == 3:
! ans2 = Decimal(self)
if shouldround:
ans2 = ans2.fix(context=context)
--- 1163,1168 ----
if divmod == 1 or divmod == 3:
! exp = min(self._exp, other._exp)
! ans2 = self.rescale(exp, context=context, watchexp=0)
if shouldround:
ans2 = ans2.fix(context=context)
***************
*** 1160,1165 ****
watchexp=0)
context.regard_flags(*frozen)
- if not otherside:
- otherside._exp = 0
if shouldround:
otherside = otherside.fix(context=context)
--- 1203,1206 ----
***************
*** 1199,1204 ****
context.regard_flags(*frozen)
- if not otherside:
- otherside._exp = 0
return (Decimal(res), otherside)
--- 1240,1243 ----
***************
*** 1332,1336 ****
"""Converts self to a long, truncating if necessary."""
if self._isnan():
-
context = getcontext()
return context.raise_error(InvalidContext)
--- 1371,1374 ----
***************
*** 1755,1763 ****
if context is None:
context = getcontext()
! if exp._isinfinity() or self._isinfinity():
! return context.raise_error(InvalidOperation, 'quantize with an INF')
ans = self._check_nans(exp, context)
if ans:
return ans
return self.rescale(exp._exp, rounding, context, watchexp)
--- 1793,1806 ----
if context is None:
context = getcontext()
!
ans = self._check_nans(exp, context)
if ans:
return ans
+
+ if exp._isinfinity() or self._isinfinity():
+ if exp._isinfinity() and self._isinfinity():
+ return self #if both are inf, it is OK
+ return context.raise_error(InvalidOperation,
+ 'quantize with one INF')
return self.rescale(exp._exp, rounding, context, watchexp)
***************
*** 2491,2495 ****
DEFAULT_TRAPS = BASIC_DEFAULT_TRAPS
DEFAULT_FLAGS= BASIC_DEFAULT_FLAGS
! DEFAULT_ROUNDING_DECISION = EXTENDED_DEFAULT_ROUNDING_DECISION
elif DEFAULT_CONTEXT == EXTENDED_DEFAULT_CONTEXT:
--- 2534,2538 ----
DEFAULT_TRAPS = BASIC_DEFAULT_TRAPS
DEFAULT_FLAGS= BASIC_DEFAULT_FLAGS
! DEFAULT_ROUNDING_DECISION = BASIC_DEFAULT_ROUNDING_DECISION
elif DEFAULT_CONTEXT == EXTENDED_DEFAULT_CONTEXT:
***************
*** 2524,2537 ****
"""Determines whether a string or float is NaN
! 1 => NaN
! 2 => sNaN
"""
if isinstance(num, float):
num = str(num)
num = num.lower()
! if num == 'nan':
! return 1
! if num == 'snan':
! return 2
return 0
--- 2567,2594 ----
"""Determines whether a string or float is NaN
! (1, sign, diagnostic info as string) => NaN
! (2, sign, diagnostic info as string) => sNaN
! 0 => not a NaN
"""
if isinstance(num, float):
num = str(num)
num = num.lower()
!
! #get the sign, get rid of trailing [+-]
! sign = 0
! if num[0] == '+':
! num = num[1:]
! elif num[0] == '-': #elif avoids '+-nan'
! num = num[1:]
! sign = 1
!
! if num.startswith('nan'):
! if len(num) > 3 and not num[3:].isdigit(): #diagnostic info
! return 0
! return (1, sign, num[3:].lstrip('0'))
! if num.startswith('snan'):
! if len(num) > 4 and not num[4:].isdigit():
! return 0
! return (2, sign, num[4:].lstrip('0'))
return 0
Index: test_Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test_Decimal.py 12 Nov 2003 20:38:41 -0000 1.5
--- test_Decimal.py 6 Feb 2004 16:31:32 -0000 1.6
***************
*** 12,15 ****
--- 12,19 ----
skip_expected = not os.path.isdir(dir)
+ # Make sure it actually raises errors when not expected and caught in flags
+ # Slower, since it runs some things several times.
+ EXTENDEDERRORTEST = False
+
#Map the test cases' error names to the actual errors
***************
*** 158,161 ****
--- 162,178 ----
v = FixQuotes(val)
if fname in ('tosci', 'toeng'):
+ if EXTENDEDERRORTEST:
+ for error in theirexceptions:
+ self.context.trap_enablers[error] = 1
+ try:
+ funct(self.context.new(v))
+ except error:
+ pass
+ except ExceptionList, e:
+ self.fail("Raised %s in %s when %s disabled" % \
+ (e, s, error))
+ else:
+ self.fail("Did not raise %s in %s" % (error, s))
+ self.context.trap_enablers[error] = 0
v = self.context.new(v)
#elif fname == 'rescale' and i == 1:
***************
*** 169,173 ****
ans = FixQuotes(ans)
!
try:
result = str(funct(*vals))
--- 186,203 ----
ans = FixQuotes(ans)
!
! if EXTENDEDERRORTEST and fname not in ('tosci', 'toeng'):
! for error in theirexceptions:
! self.context.trap_enablers[error] = 1
! try:
! funct(*vals)
! except error:
! pass
! except ExceptionList, e:
! self.fail("Raised %s in %s when %s disabled" % \
! (e, s, error))
! else:
! self.fail("Did not raise %s in %s" % (error, s))
! self.context.trap_enablers[error] = 0
try:
result = str(funct(*vals))
***************
*** 184,189 ****
theirexceptions.sort()
! self.assertEqual(result, ans, 'Incorrect answer for ' + s + ' -- got ' + result)
! self.assertEqual(myexceptions, theirexceptions, 'Incorrect flags set in ' + s + ' -- got '
+ str(myexceptions))
--- 214,221 ----
theirexceptions.sort()
! self.assertEqual(result, ans,
! 'Incorrect answer for ' + s + ' -- got ' + result)
! self.assertEqual(myexceptions, theirexceptions,
! 'Incorrect flags set in ' + s + ' -- got ' \
+ str(myexceptions))
***************
*** 268,277 ****
self.eval_file(dir + 'inexact' + '.decTest')
! #def test_integer(self):
! # """Tests the Decimal class on Cowlishaw's integer tests.
! #
! # See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
! # """
! # self.eval_file(dir + 'integer' + '.decTest')
def test_max(self):
--- 300,309 ----
self.eval_file(dir + 'inexact' + '.decTest')
! def test_integer(self):
! """Tests the Decimal class on Cowlishaw's integer tests.
!
! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite.
! """
! self.eval_file(dir + 'integer' + '.decTest')
def test_max(self):
1
0
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32534
Modified Files:
this.py
Log Message:
Back rev 1.3 out per Raymond's request.
Index: this.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/this.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** this.py 6 Feb 2004 02:52:15 -0000 1.3
--- this.py 6 Feb 2004 04:40:56 -0000 1.4
***************
*** 21,23 ****
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
! print s.decode('rot_13')
--- 21,28 ----
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
! d = {}
! for c in (65, 97):
! for i in range(26):
! d[chr(i+c)] = chr((i+13) % 26 + c)
!
! print "".join([d.get(c, c) for c in s])
1
0
Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27649
Modified Files:
NEWS
Log Message:
added notes about weakref changes
Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.926
retrieving revision 1.927
diff -C2 -d -r1.926 -r1.927
*** NEWS 2 Feb 2004 13:39:00 -0000 1.926
--- NEWS 6 Feb 2004 04:15:22 -0000 1.927
***************
*** 13,16 ****
--- 13,31 ----
-----------------
+ - Made omitted callback and None equivalent for weakref.ref() and
+ weakref.proxy(); the None case wasn't handled correctly in all
+ cases.
+
+ - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
+ assumed that initial existing entries in an object's weakref list
+ would not be removed while allocating a new weakref object. Since
+ GC could be invoked at that time, however, that assumption was
+ invalid. In a truly obscure case of GC being triggered during
+ creation for a new weakref object for an referent which already
+ has a weakref without a callback which is only referenced from
+ cyclic trash, a memory error can occur. This consistently created a
+ segfault in a debug build, but provided less predictable behavior in
+ a release build.
+
- input() builtin function now respects compiler flags such as
__future__ statements. SF patch 876178.
1
0

Feb. 6, 2004
Update of /cvsroot/python/python/dist/src/Misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27554
Modified Files:
Tag: release23-maint
NEWS
Log Message:
added notes about weakref changes
Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.831.4.87
retrieving revision 1.831.4.88
diff -C2 -d -r1.831.4.87 -r1.831.4.88
*** NEWS 19 Dec 2003 02:06:06 -0000 1.831.4.87
--- NEWS 6 Feb 2004 04:14:41 -0000 1.831.4.88
***************
*** 5,8 ****
--- 5,31 ----
(editors: check NEWS.help for information about editing NEWS using ReST.)
+ What's New in Python 2.3.4 (final)?
+ ===================================
+
+ *Release date: DD-MMM-2004*
+
+ Core and builtins
+ -----------------
+
+ - Made omitted callback and None equivalent for weakref.ref() and
+ weakref.proxy(); the None case wasn't handled correctly in all
+ cases.
+
+ - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
+ assumed that initial existing entries in an object's weakref list
+ would not be removed while allocating a new weakref object. Since
+ GC could be invoked at that time, however, that assumption was
+ invalid. In a truly obscure case of GC being triggered during
+ creation for a new weakref object for an referent which already
+ has a weakref without a callback which is only referenced from
+ cyclic trash, a memory error can occur. This consistently created a
+ segfault in a debug build, but provided less predictable behavior in
+ a release build.
+
What's New in Python 2.3.3 (final)?
===================================
1
0
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11893
Modified Files:
this.py
Log Message:
Simple is better than complex.
Index: this.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/this.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** this.py 8 Feb 2002 20:41:34 -0000 1.2
--- this.py 6 Feb 2004 02:52:15 -0000 1.3
***************
*** 21,28 ****
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
! d = {}
! for c in (65, 97):
! for i in range(26):
! d[chr(i+c)] = chr((i+13) % 26 + c)
!
! print "".join([d.get(c, c) for c in s])
--- 21,23 ----
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
! print s.decode('rot_13')
1
0