------------------------------------------------------------------------
-- divideint0.decTest -- decimal integer division (simplified)        --
-- 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.58

extended:    0
precision:   9
rounding:    half_up
maxExponent: 999
minexponent: -999

dvi001 divideint  1     1    ->  1
dvi002 divideint  2     1    ->  2
dvi003 divideint  1     2    ->  0
dvi004 divideint  2     2    ->  1
dvi005 divideint  0     1    ->  0
dvi006 divideint  0     2    ->  0
dvi007 divideint  1     3    ->  0
dvi008 divideint  2     3    ->  0
dvi009 divideint  3     3    ->  1

dvi010 divideint  2.4   1    ->  2
dvi011 divideint  2.4   -1   ->  -2
dvi012 divideint  -2.4  1    ->  -2
dvi013 divideint  -2.4  -1   ->  2
dvi014 divideint  2.40  1    ->  2
dvi015 divideint  2.400 1    ->  2
dvi016 divideint  2.4   2    ->  1
dvi017 divideint  2.400 2    ->  1
dvi018 divideint  2.    2    ->  1
dvi019 divideint  20    20   ->  1

dvi020 divideint  187   187  ->  1
dvi021 divideint  5     2    ->  2
dvi022 divideint  5     2.0    ->  2
dvi023 divideint  5     2.000  ->  2
dvi024 divideint  5     0.200  ->  25
dvi025 divideint  5     0.200  ->  25

dvi030 divideint  1     2      ->  0
dvi031 divideint  1     4      ->  0
dvi032 divideint  1     8      ->  0
dvi033 divideint  1     16     ->  0
dvi034 divideint  1     32     ->  0
dvi035 divideint  1     64     ->  0
dvi040 divideint  1    -2      ->  0
dvi041 divideint  1    -4      ->  0
dvi042 divideint  1    -8      ->  0
dvi043 divideint  1    -16     ->  0
dvi044 divideint  1    -32     ->  0
dvi045 divideint  1    -64     ->  0
dvi050 divideint -1     2      ->  0
dvi051 divideint -1     4      ->  0
dvi052 divideint -1     8      ->  0
dvi053 divideint -1     16     ->  0
dvi054 divideint -1     32     ->  0
dvi055 divideint -1     64     ->  0
dvi060 divideint -1    -2      ->  0
dvi061 divideint -1    -4      ->  0
dvi062 divideint -1    -8      ->  0
dvi063 divideint -1    -16     ->  0
dvi064 divideint -1    -32     ->  0
dvi065 divideint -1    -64     ->  0

-- some lostDigits cases here
dvi070 divideint  999999999     1  ->  999999999
dvi071 divideint  999999999.4   1  ->  999999999 Inexact Lost_digits Rounded
dvi072 divideint  999999999.5   1  -> ? Division_impossible Inexact Lost_digits Rounded
dvi073 divideint  999999999.9   1  -> ? Division_impossible Inexact Lost_digits Rounded
dvi074 divideint  999999999.999 1  -> ? Division_impossible Inexact Lost_digits Rounded
precision: 6
dvi080 divideint  999999999     1  -> ? Division_impossible Inexact Lost_digits Rounded
dvi081 divideint  99999999      1  -> ? Division_impossible Inexact Lost_digits Rounded
dvi082 divideint  9999999       1  -> ? Division_impossible Inexact Lost_digits Rounded
dvi083 divideint  999999        1  ->  999999
dvi084 divideint  99999         1  ->  99999
dvi085 divideint  9999          1  ->  9999
dvi086 divideint  999           1  ->  999
dvi087 divideint  99            1  ->  99
dvi088 divideint  9             1  ->  9

precision: 9
dvi090 divideint  0.            1    ->  0
dvi091 divideint  .0            1    ->  0
dvi092 divideint  0.00          1    ->  0
dvi093 divideint  0.00E+9       1    ->  0
dvi094 divideint  0.0000E-50    1    ->  0

dvi100 divideint  1  1   -> 1
dvi101 divideint  1  2   -> 0
dvi102 divideint  1  3   -> 0
dvi103 divideint  1  4   -> 0
dvi104 divideint  1  5   -> 0
dvi105 divideint  1  6   -> 0
dvi106 divideint  1  7   -> 0
dvi107 divideint  1  8   -> 0
dvi108 divideint  1  9   -> 0
dvi109 divideint  1  10  -> 0
dvi110 divideint  1  1   -> 1
dvi111 divideint  2  1   -> 2
dvi112 divideint  3  1   -> 3
dvi113 divideint  4  1   -> 4
dvi114 divideint  5  1   -> 5
dvi115 divideint  6  1   -> 6
dvi116 divideint  7  1   -> 7
dvi117 divideint  8  1   -> 8
dvi118 divideint  9  1   -> 9
dvi119 divideint  10 1   -> 10

-- from DiagBigDecimal
dvi131 divideint  101.3   1     ->  101
dvi132 divideint  101.0   1     ->  101
dvi133 divideint  101.3   3     ->  33
dvi134 divideint  101.0   3     ->  33
dvi135 divideint  2.4     1     ->  2
dvi136 divideint  2.400   1     ->  2
dvi137 divideint  18      18    ->  1
dvi138 divideint  1120    1000  ->  1
dvi139 divideint  2.4     2     ->  1
dvi140 divideint  2.400   2     ->  1
dvi141 divideint  0.5     2.000 ->  0
dvi142 divideint  8.005   7     ->  1
dvi143 divideint  5       2     ->  2
dvi144 divideint  0       2     ->  0
dvi145 divideint  0.00    2     ->  0

-- Others
dvi150 divideint  12345  4.999  ->  2469
dvi151 divideint  12345  4.99   ->  2473
dvi152 divideint  12345  4.9    ->  2519
dvi153 divideint  12345  5      ->  2469
dvi154 divideint  12345  5.1    ->  2420
dvi155 divideint  12345  5.01   ->  2464
dvi156 divideint  12345  5.001  ->  2468
dvi157 divideint    101  7.6    ->  13


-- Various flavours of divideint by 0
maxexponent: 999999999
minexponent: -999999999
dvi201 divideint  0      0   -> ? Division_undefined
dvi202 divideint  0.0E5  0   -> ? Division_undefined
dvi203 divideint  0.000  0   -> ? Division_undefined
dvi204 divideint  0.0001 0   -> ? Division_by_zero
dvi205 divideint  0.01   0   -> ? Division_by_zero
dvi206 divideint  0.1    0   -> ? Division_by_zero
dvi207 divideint  1      0   -> ? Division_by_zero
dvi208 divideint  1      0.0 -> ? Division_by_zero
dvi209 divideint 10      0.0 -> ? Division_by_zero
dvi210 divideint 1E+100  0.0 -> ? Division_by_zero
dvi211 divideint 1E+1000 0   -> ? Division_by_zero

-- test some cases that are close to exponent overflow
maxexponent: 999999999
minexponent: -999999999
dvi270 divideint 1 1e999999999    -> 0
dvi271 divideint 1 0.9e999999999  -> 0
dvi272 divideint 1 0.99e999999999 -> 0
dvi273 divideint 1 0.999999999e999999999 -> 0
dvi274 divideint 9e999999999    1       -> ? Division_impossible
dvi275 divideint 9.9e999999999  1       -> ? Division_impossible
dvi276 divideint 9.99e999999999 1       -> ? Division_impossible
dvi277 divideint 9.99999999e999999999 1 -> ? Division_impossible

dvi280 divideint 0.1 9e-999999999       -> ? Division_impossible
dvi281 divideint 0.1 99e-999999999      -> ? Division_impossible
dvi282 divideint 0.1 999e-999999999     -> ? Division_impossible

dvi283 divideint 0.1 9e-999999998       -> ? Division_impossible
dvi284 divideint 0.1 99e-999999998      -> ? Division_impossible
dvi285 divideint 0.1 999e-999999998     -> ? Division_impossible
dvi286 divideint 0.1 999e-999999997     -> ? Division_impossible
dvi287 divideint 0.1 9999e-999999997    -> ? Division_impossible
dvi288 divideint 0.1 99999e-999999997   -> ? Division_impossible


-- overflow and underflow tests [from divide]
maxexponent: 999999999
minexponent: -999999999
dvi330 divideint +1.23456789012345E-0 9E+999999999    -> 0 Inexact Lost_digits Rounded
dvi331 divideint 9E+999999999 +0.23456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
dvi332 divideint +0.100 9E+999999999    -> 0
dvi333 divideint 9E-999999999 +9.100    -> 0
dvi335 divideint -1.23456789012345E-0 9E+999999999    -> 0 Inexact Lost_digits Rounded
dvi336 divideint 9E+999999999 -0.83456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
dvi337 divideint -0.100 9E+999999999    -> 0
dvi338 divideint 9E-999999999 -9.100    -> 0

-- lostDigits checks
maxexponent: 999
minexponent: -999
precision: 9
dvi401 divideint 12345678000 100 -> 123456780 Rounded
dvi402 divideint 1 12345678000   -> 0 Rounded
dvi403 divideint 1234567800  10  -> 123456780 Rounded
dvi404 divideint 1 1234567800    -> 0 Rounded
dvi405 divideint 1234567890  10  -> 123456789 Rounded
dvi406 divideint 1 1234567890    -> 0 Rounded
dvi407 divideint 1234567891  10  -> 123456789 Inexact Lost_digits Rounded
dvi408 divideint 1 1234567891    -> 0 Inexact Lost_digits Rounded
dvi409 divideint 12345678901 100 -> 123456789 Inexact Lost_digits Rounded
dvi410 divideint 1 12345678901   -> 0 Inexact Lost_digits Rounded
dvi411 divideint 1234567896  10  -> 123456790 Inexact Lost_digits Rounded
dvi412 divideint 1 1234567896    -> 0 Inexact Lost_digits Rounded

precision: 15
-- still checking for [no] lostDigits
dvi441 divideint 12345678000 1 -> 12345678000
dvi442 divideint 1 12345678000 -> 0
dvi443 divideint 1234567800  1 -> 1234567800
dvi444 divideint 1 1234567800  -> 0
dvi445 divideint 1234567890  1 -> 1234567890
dvi446 divideint 1 1234567890  -> 0
dvi447 divideint 1234567891  1 -> 1234567891
dvi448 divideint 1 1234567891  -> 0
dvi449 divideint 12345678901 1 -> 12345678901
dvi450 divideint 1 12345678901 -> 0
dvi451 divideint 1234567896  1 -> 1234567896
dvi452 divideint 1 1234567896  -> 0

-- Null tests
dvi900 divideint  10  # -> ? Invalid_operation
dvi901 divideint   # 10 -> ? Invalid_operation

