Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

agriconnect / libpython3.8-testsuite   deb

Repository URL to install this package:

Version: 3.8.5-1+stretch1 

/ usr / lib / python3.8 / test / decimaltestdata / ddMultiply.decTest

------------------------------------------------------------------------
-- ddMultiply.decTest -- decDouble multiplication                     --
-- Copyright (c) IBM Corporation, 1981, 2008.  All rights reserved.   --
------------------------------------------------------------------------
-- Please see the document "General Decimal Arithmetic Testcases"     --
-- at http://www2.hursley.ibm.com/decimal for the description of      --
-- these testcases.                                                   --
--                                                                    --
-- These testcases are experimental ('beta' versions), and they       --
-- may contain errors.  They are offered on an as-is basis.  In       --
-- particular, achieving the same results as the tests here is not    --
-- a guarantee that an implementation complies with any Standard      --
-- or specification.  The tests are not exhaustive.                   --
--                                                                    --
-- Please send comments, suggestions, and corrections to the author:  --
--   Mike Cowlishaw, IBM Fellow                                       --
--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
--   mfc@uk.ibm.com                                                   --
------------------------------------------------------------------------
version: 2.59

-- This set of tests are for decDoubles only; all arguments are
-- representable in a decDouble
precision:   16
maxExponent: 384
minExponent: -383
extended:    1
clamp:       1
rounding:    half_even

-- sanity checks
ddmul000 multiply 2      2 -> 4
ddmul001 multiply 2      3 -> 6
ddmul002 multiply 5      1 -> 5
ddmul003 multiply 5      2 -> 10
ddmul004 multiply 1.20   2 -> 2.40
ddmul005 multiply 1.20   0 -> 0.00
ddmul006 multiply 1.20  -2 -> -2.40
ddmul007 multiply -1.20  2 -> -2.40
ddmul008 multiply -1.20  0 -> -0.00
ddmul009 multiply -1.20 -2 -> 2.40
ddmul010 multiply 5.09 7.1 -> 36.139
ddmul011 multiply 2.5    4 -> 10.0
ddmul012 multiply 2.50   4 -> 10.00
ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
ddmul015 multiply 2.50   4 -> 10.00
ddmul016 multiply  9.999999999  9.999999999 ->  99.99999998000000 Inexact Rounded
ddmul017 multiply  9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
ddmul018 multiply -9.999999999  9.999999999 -> -99.99999998000000 Inexact Rounded
ddmul019 multiply -9.999999999 -9.999999999 ->  99.99999998000000 Inexact Rounded

-- zeros, etc.
ddmul021 multiply  0      0     ->  0
ddmul022 multiply  0     -0     -> -0
ddmul023 multiply -0      0     -> -0
ddmul024 multiply -0     -0     ->  0
ddmul025 multiply -0.0   -0.0   ->  0.00
ddmul026 multiply -0.0   -0.0   ->  0.00
ddmul027 multiply -0.0   -0.0   ->  0.00
ddmul028 multiply -0.0   -0.0   ->  0.00
ddmul030 multiply  5.00   1E-3  ->  0.00500
ddmul031 multiply  00.00  0.000 ->  0.00000
ddmul032 multiply  00.00  0E-3  ->  0.00000     -- rhs is 0
ddmul033 multiply  0E-3   00.00 ->  0.00000     -- lhs is 0
ddmul034 multiply -5.00   1E-3  -> -0.00500
ddmul035 multiply -00.00  0.000 -> -0.00000
ddmul036 multiply -00.00  0E-3  -> -0.00000     -- rhs is 0
ddmul037 multiply -0E-3   00.00 -> -0.00000     -- lhs is 0
ddmul038 multiply  5.00  -1E-3  -> -0.00500
ddmul039 multiply  00.00 -0.000 -> -0.00000
ddmul040 multiply  00.00 -0E-3  -> -0.00000     -- rhs is 0
ddmul041 multiply  0E-3  -00.00 -> -0.00000     -- lhs is 0
ddmul042 multiply -5.00  -1E-3  ->  0.00500
ddmul043 multiply -00.00 -0.000 ->  0.00000
ddmul044 multiply -00.00 -0E-3  ->  0.00000     -- rhs is 0
ddmul045 multiply -0E-3  -00.00 ->  0.00000     -- lhs is 0

-- examples from decarith
ddmul050 multiply 1.20 3        -> 3.60
ddmul051 multiply 7    3        -> 21
ddmul052 multiply 0.9  0.8      -> 0.72
ddmul053 multiply 0.9  -0       -> -0.0
ddmul054 multiply 654321 654321 -> 428135971041

ddmul060 multiply 123.45 1e7  ->  1.2345E+9
ddmul061 multiply 123.45 1e8  ->  1.2345E+10
ddmul062 multiply 123.45 1e+9 ->  1.2345E+11
ddmul063 multiply 123.45 1e10 ->  1.2345E+12
ddmul064 multiply 123.45 1e11 ->  1.2345E+13
ddmul065 multiply 123.45 1e12 ->  1.2345E+14
ddmul066 multiply 123.45 1e13 ->  1.2345E+15


-- test some intermediate lengths
--                    1234567890123456
ddmul080 multiply 0.1 1230123456456789     -> 123012345645678.9
ddmul084 multiply 0.1 1230123456456789     -> 123012345645678.9
ddmul090 multiply 1230123456456789     0.1 -> 123012345645678.9
ddmul094 multiply 1230123456456789     0.1 -> 123012345645678.9

-- test some more edge cases and carries
ddmul101 multiply 9 9   -> 81
ddmul102 multiply 9 90   -> 810
ddmul103 multiply 9 900   -> 8100
ddmul104 multiply 9 9000   -> 81000
ddmul105 multiply 9 90000   -> 810000
ddmul106 multiply 9 900000   -> 8100000
ddmul107 multiply 9 9000000   -> 81000000
ddmul108 multiply 9 90000000   -> 810000000
ddmul109 multiply 9 900000000   -> 8100000000
ddmul110 multiply 9 9000000000   -> 81000000000
ddmul111 multiply 9 90000000000   -> 810000000000
ddmul112 multiply 9 900000000000   -> 8100000000000
ddmul113 multiply 9 9000000000000   -> 81000000000000
ddmul114 multiply 9 90000000000000   -> 810000000000000
ddmul115 multiply 9 900000000000000   -> 8100000000000000
--ddmul116 multiply 9 9000000000000000   -> 81000000000000000
--ddmul117 multiply 9 90000000000000000   -> 810000000000000000
--ddmul118 multiply 9 900000000000000000   -> 8100000000000000000
--ddmul119 multiply 9 9000000000000000000   -> 81000000000000000000
--ddmul120 multiply 9 90000000000000000000   -> 810000000000000000000
--ddmul121 multiply 9 900000000000000000000   -> 8100000000000000000000
--ddmul122 multiply 9 9000000000000000000000   -> 81000000000000000000000
--ddmul123 multiply 9 90000000000000000000000   -> 810000000000000000000000
-- test some more edge cases without carries
ddmul131 multiply 3 3   -> 9
ddmul132 multiply 3 30   -> 90
ddmul133 multiply 3 300   -> 900
ddmul134 multiply 3 3000   -> 9000
ddmul135 multiply 3 30000   -> 90000
ddmul136 multiply 3 300000   -> 900000
ddmul137 multiply 3 3000000   -> 9000000
ddmul138 multiply 3 30000000   -> 90000000
ddmul139 multiply 3 300000000   -> 900000000
ddmul140 multiply 3 3000000000   -> 9000000000
ddmul141 multiply 3 30000000000   -> 90000000000
ddmul142 multiply 3 300000000000   -> 900000000000
ddmul143 multiply 3 3000000000000   -> 9000000000000
ddmul144 multiply 3 30000000000000   -> 90000000000000
ddmul145 multiply 3 300000000000000   -> 900000000000000

-- test some edge cases with exact rounding
ddmul301 multiply 9 9   -> 81
ddmul302 multiply 9 90   -> 810
ddmul303 multiply 9 900   -> 8100
ddmul304 multiply 9 9000   -> 81000
ddmul305 multiply 9 90000   -> 810000
ddmul306 multiply 9 900000   -> 8100000
ddmul307 multiply 9 9000000   -> 81000000
ddmul308 multiply 9 90000000   -> 810000000
ddmul309 multiply 9 900000000   -> 8100000000
ddmul310 multiply 9 9000000000   -> 81000000000
ddmul311 multiply 9 90000000000   -> 810000000000
ddmul312 multiply 9 900000000000   -> 8100000000000
ddmul313 multiply 9 9000000000000   -> 81000000000000
ddmul314 multiply 9 90000000000000   -> 810000000000000
ddmul315 multiply 9 900000000000000   -> 8100000000000000
ddmul316 multiply 9 9000000000000000   -> 8.100000000000000E+16  Rounded
ddmul317 multiply 90 9000000000000000   -> 8.100000000000000E+17  Rounded
ddmul318 multiply 900 9000000000000000   -> 8.100000000000000E+18  Rounded
ddmul319 multiply 9000 9000000000000000   -> 8.100000000000000E+19  Rounded
ddmul320 multiply 90000 9000000000000000   -> 8.100000000000000E+20  Rounded
ddmul321 multiply 900000 9000000000000000   -> 8.100000000000000E+21  Rounded
ddmul322 multiply 9000000 9000000000000000   -> 8.100000000000000E+22  Rounded
ddmul323 multiply 90000000 9000000000000000   -> 8.100000000000000E+23  Rounded

-- tryzeros cases
ddmul504  multiply  0E-260 1000E-260  -> 0E-398 Clamped
ddmul505  multiply  100E+260 0E+260   -> 0E+369 Clamped
-- 65K-1 case
ddmul506 multiply 77.1 850 -> 65535.0

-- mixed with zeros
ddmul541 multiply  0    -1     -> -0
ddmul542 multiply -0    -1     ->  0
ddmul543 multiply  0     1     ->  0
ddmul544 multiply -0     1     -> -0
ddmul545 multiply -1     0     -> -0
ddmul546 multiply -1    -0     ->  0
ddmul547 multiply  1     0     ->  0
ddmul548 multiply  1    -0     -> -0

ddmul551 multiply  0.0  -1     -> -0.0
ddmul552 multiply -0.0  -1     ->  0.0
ddmul553 multiply  0.0   1     ->  0.0
ddmul554 multiply -0.0   1     -> -0.0
ddmul555 multiply -1.0   0     -> -0.0
ddmul556 multiply -1.0  -0     ->  0.0
ddmul557 multiply  1.0   0     ->  0.0
ddmul558 multiply  1.0  -0     -> -0.0

ddmul561 multiply  0    -1.0   -> -0.0
ddmul562 multiply -0    -1.0   ->  0.0
ddmul563 multiply  0     1.0   ->  0.0
ddmul564 multiply -0     1.0   -> -0.0
ddmul565 multiply -1     0.0   -> -0.0
ddmul566 multiply -1    -0.0   ->  0.0
ddmul567 multiply  1     0.0   ->  0.0
ddmul568 multiply  1    -0.0   -> -0.0

ddmul571 multiply  0.0  -1.0   -> -0.00
ddmul572 multiply -0.0  -1.0   ->  0.00
ddmul573 multiply  0.0   1.0   ->  0.00
ddmul574 multiply -0.0   1.0   -> -0.00
ddmul575 multiply -1.0   0.0   -> -0.00
ddmul576 multiply -1.0  -0.0   ->  0.00
ddmul577 multiply  1.0   0.0   ->  0.00
ddmul578 multiply  1.0  -0.0   -> -0.00


-- Specials
ddmul580 multiply  Inf  -Inf   -> -Infinity
ddmul581 multiply  Inf  -1000  -> -Infinity
ddmul582 multiply  Inf  -1     -> -Infinity
ddmul583 multiply  Inf  -0     ->  NaN  Invalid_operation
ddmul584 multiply  Inf   0     ->  NaN  Invalid_operation
ddmul585 multiply  Inf   1     ->  Infinity
ddmul586 multiply  Inf   1000  ->  Infinity
ddmul587 multiply  Inf   Inf   ->  Infinity
ddmul588 multiply -1000  Inf   -> -Infinity
ddmul589 multiply -Inf   Inf   -> -Infinity
ddmul590 multiply -1     Inf   -> -Infinity
ddmul591 multiply -0     Inf   ->  NaN  Invalid_operation
ddmul592 multiply  0     Inf   ->  NaN  Invalid_operation
ddmul593 multiply  1     Inf   ->  Infinity
ddmul594 multiply  1000  Inf   ->  Infinity
ddmul595 multiply  Inf   Inf   ->  Infinity

ddmul600 multiply -Inf  -Inf   ->  Infinity
ddmul601 multiply -Inf  -1000  ->  Infinity
ddmul602 multiply -Inf  -1     ->  Infinity
ddmul603 multiply -Inf  -0     ->  NaN  Invalid_operation
ddmul604 multiply -Inf   0     ->  NaN  Invalid_operation
ddmul605 multiply -Inf   1     -> -Infinity
ddmul606 multiply -Inf   1000  -> -Infinity
ddmul607 multiply -Inf   Inf   -> -Infinity
ddmul608 multiply -1000  Inf   -> -Infinity
ddmul609 multiply -Inf  -Inf   ->  Infinity
ddmul610 multiply -1    -Inf   ->  Infinity
ddmul611 multiply -0    -Inf   ->  NaN  Invalid_operation
ddmul612 multiply  0    -Inf   ->  NaN  Invalid_operation
ddmul613 multiply  1    -Inf   -> -Infinity
ddmul614 multiply  1000 -Inf   -> -Infinity
ddmul615 multiply  Inf  -Inf   -> -Infinity

ddmul621 multiply  NaN -Inf    ->  NaN
ddmul622 multiply  NaN -1000   ->  NaN
ddmul623 multiply  NaN -1      ->  NaN
ddmul624 multiply  NaN -0      ->  NaN
ddmul625 multiply  NaN  0      ->  NaN
ddmul626 multiply  NaN  1      ->  NaN
ddmul627 multiply  NaN  1000   ->  NaN
ddmul628 multiply  NaN  Inf    ->  NaN
ddmul629 multiply  NaN  NaN    ->  NaN
ddmul630 multiply -Inf  NaN    ->  NaN
ddmul631 multiply -1000 NaN    ->  NaN
ddmul632 multiply -1    NaN    ->  NaN
ddmul633 multiply -0    NaN    ->  NaN
ddmul634 multiply  0    NaN    ->  NaN
ddmul635 multiply  1    NaN    ->  NaN
ddmul636 multiply  1000 NaN    ->  NaN
ddmul637 multiply  Inf  NaN    ->  NaN

ddmul641 multiply  sNaN -Inf   ->  NaN  Invalid_operation
ddmul642 multiply  sNaN -1000  ->  NaN  Invalid_operation
ddmul643 multiply  sNaN -1     ->  NaN  Invalid_operation
ddmul644 multiply  sNaN -0     ->  NaN  Invalid_operation
ddmul645 multiply  sNaN  0     ->  NaN  Invalid_operation
ddmul646 multiply  sNaN  1     ->  NaN  Invalid_operation
ddmul647 multiply  sNaN  1000  ->  NaN  Invalid_operation
ddmul648 multiply  sNaN  NaN   ->  NaN  Invalid_operation
ddmul649 multiply  sNaN sNaN   ->  NaN  Invalid_operation
ddmul650 multiply  NaN  sNaN   ->  NaN  Invalid_operation
ddmul651 multiply -Inf  sNaN   ->  NaN  Invalid_operation
ddmul652 multiply -1000 sNaN   ->  NaN  Invalid_operation
ddmul653 multiply -1    sNaN   ->  NaN  Invalid_operation
ddmul654 multiply -0    sNaN   ->  NaN  Invalid_operation
ddmul655 multiply  0    sNaN   ->  NaN  Invalid_operation
ddmul656 multiply  1    sNaN   ->  NaN  Invalid_operation
ddmul657 multiply  1000 sNaN   ->  NaN  Invalid_operation
ddmul658 multiply  Inf  sNaN   ->  NaN  Invalid_operation
ddmul659 multiply  NaN  sNaN   ->  NaN  Invalid_operation

-- propagating NaNs
ddmul661 multiply  NaN9 -Inf   ->  NaN9
ddmul662 multiply  NaN8  999   ->  NaN8
ddmul663 multiply  NaN71 Inf   ->  NaN71
ddmul664 multiply  NaN6  NaN5  ->  NaN6
ddmul665 multiply -Inf   NaN4  ->  NaN4
ddmul666 multiply -999   NaN33 ->  NaN33
ddmul667 multiply  Inf   NaN2  ->  NaN2

ddmul671 multiply  sNaN99 -Inf    ->  NaN99 Invalid_operation
ddmul672 multiply  sNaN98 -11     ->  NaN98 Invalid_operation
ddmul673 multiply  sNaN97  NaN    ->  NaN97 Invalid_operation
ddmul674 multiply  sNaN16 sNaN94  ->  NaN16 Invalid_operation
ddmul675 multiply  NaN95  sNaN93  ->  NaN93 Invalid_operation
ddmul676 multiply -Inf    sNaN92  ->  NaN92 Invalid_operation
ddmul677 multiply  088    sNaN91  ->  NaN91 Invalid_operation
ddmul678 multiply  Inf    sNaN90  ->  NaN90 Invalid_operation
ddmul679 multiply  NaN    sNaN89  ->  NaN89 Invalid_operation

ddmul681 multiply -NaN9 -Inf   -> -NaN9
ddmul682 multiply -NaN8  999   -> -NaN8
ddmul683 multiply -NaN71 Inf   -> -NaN71
ddmul684 multiply -NaN6 -NaN5  -> -NaN6
ddmul685 multiply -Inf  -NaN4  -> -NaN4
ddmul686 multiply -999  -NaN33 -> -NaN33
ddmul687 multiply  Inf  -NaN2  -> -NaN2

ddmul691 multiply -sNaN99 -Inf    -> -NaN99 Invalid_operation
ddmul692 multiply -sNaN98 -11     -> -NaN98 Invalid_operation
ddmul693 multiply -sNaN97  NaN    -> -NaN97 Invalid_operation
ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
ddmul695 multiply -NaN95  -sNaN93 -> -NaN93 Invalid_operation
ddmul696 multiply -Inf    -sNaN92 -> -NaN92 Invalid_operation
ddmul697 multiply  088    -sNaN91 -> -NaN91 Invalid_operation
ddmul698 multiply  Inf    -sNaN90 -> -NaN90 Invalid_operation
ddmul699 multiply -NaN    -sNaN89 -> -NaN89 Invalid_operation

ddmul701 multiply -NaN  -Inf   -> -NaN
ddmul702 multiply -NaN   999   -> -NaN
ddmul703 multiply -NaN   Inf   -> -NaN
ddmul704 multiply -NaN  -NaN   -> -NaN
ddmul705 multiply -Inf  -NaN0  -> -NaN
ddmul706 multiply -999  -NaN   -> -NaN
ddmul707 multiply  Inf  -NaN   -> -NaN

ddmul711 multiply -sNaN   -Inf    -> -NaN Invalid_operation
ddmul712 multiply -sNaN   -11     -> -NaN Invalid_operation
ddmul713 multiply -sNaN00  NaN    -> -NaN Invalid_operation
ddmul714 multiply -sNaN   -sNaN   -> -NaN Invalid_operation
ddmul715 multiply -NaN    -sNaN   -> -NaN Invalid_operation
ddmul716 multiply -Inf    -sNaN   -> -NaN Invalid_operation
ddmul717 multiply  088    -sNaN   -> -NaN Invalid_operation
ddmul718 multiply  Inf    -sNaN   -> -NaN Invalid_operation
ddmul719 multiply -NaN    -sNaN   -> -NaN Invalid_operation

-- overflow and underflow tests .. note subnormal results
-- signs
ddmul751 multiply  1e+277  1e+311 ->  Infinity Overflow Inexact Rounded
ddmul752 multiply  1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
ddmul753 multiply -1e+277  1e+311 -> -Infinity Overflow Inexact Rounded
ddmul754 multiply -1e+277 -1e+311 ->  Infinity Overflow Inexact Rounded
ddmul755 multiply  1e-277  1e-311 ->  0E-398 Underflow Subnormal Inexact Rounded Clamped
Loading ...