service plugin and qdecimal library has been added
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
------------------------------------------------------------------------
|
||||
-- abs0.decTest -- decimal absolute value (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
|
||||
|
||||
-- This set of tests primarily tests the existence of the operator.
|
||||
-- Additon, subtraction, rounding, and more overflows are tested
|
||||
-- elsewhere.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
abs001 abs '1' -> '1'
|
||||
abs002 abs '-1' -> '1'
|
||||
abs003 abs '1.00' -> '1.00'
|
||||
abs004 abs '-1.00' -> '1.00'
|
||||
abs005 abs '0' -> '0'
|
||||
abs006 abs '0.00' -> '0'
|
||||
abs007 abs '00.0' -> '0'
|
||||
abs008 abs '00.00' -> '0'
|
||||
abs009 abs '00' -> '0'
|
||||
|
||||
abs010 abs '-2' -> '2'
|
||||
abs011 abs '2' -> '2'
|
||||
abs012 abs '-2.00' -> '2.00'
|
||||
abs013 abs '2.00' -> '2.00'
|
||||
abs014 abs '-0' -> '0'
|
||||
abs015 abs '-0.00' -> '0'
|
||||
abs016 abs '-00.0' -> '0'
|
||||
abs017 abs '-00.00' -> '0'
|
||||
abs018 abs '-00' -> '0'
|
||||
|
||||
abs020 abs '-2000000' -> '2000000'
|
||||
abs021 abs '2000000' -> '2000000'
|
||||
precision: 7
|
||||
abs022 abs '-2000000' -> '2000000'
|
||||
abs023 abs '2000000' -> '2000000'
|
||||
precision: 6
|
||||
abs024 abs '-2000000' -> '2.00000E+6' Rounded
|
||||
abs025 abs '2000000' -> '2.00000E+6' Rounded
|
||||
precision: 3
|
||||
abs026 abs '-2000000' -> '2.00E+6' Rounded
|
||||
abs027 abs '2000000' -> '2.00E+6' Rounded
|
||||
|
||||
abs030 abs '+0.1' -> '0.1'
|
||||
abs031 abs '-0.1' -> '0.1'
|
||||
abs032 abs '+0.01' -> '0.01'
|
||||
abs033 abs '-0.01' -> '0.01'
|
||||
abs034 abs '+0.001' -> '0.001'
|
||||
abs035 abs '-0.001' -> '0.001'
|
||||
abs036 abs '+0.000001' -> '0.000001'
|
||||
abs037 abs '-0.000001' -> '0.000001'
|
||||
abs038 abs '+0.000000000001' -> '1E-12'
|
||||
abs039 abs '-0.000000000001' -> '1E-12'
|
||||
|
||||
-- examples from decArith
|
||||
precision: 9
|
||||
abs040 abs '2.1' -> '2.1'
|
||||
abs041 abs '-100' -> '100'
|
||||
abs042 abs '101.5' -> '101.5'
|
||||
abs043 abs '-101.5' -> '101.5'
|
||||
|
||||
-- more fixed, potential LHS swaps/overlays if done by subtract 0
|
||||
precision: 9
|
||||
abs060 abs '-56267E-10' -> '0.0000056267'
|
||||
abs061 abs '-56267E-5' -> '0.56267'
|
||||
abs062 abs '-56267E-2' -> '562.67'
|
||||
abs063 abs '-56267E-1' -> '5626.7'
|
||||
abs065 abs '-56267E-0' -> '56267'
|
||||
|
||||
-- overflow tests [underflow not possible]
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 3
|
||||
abs120 abs 9.999E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
abs301 abs 12345678000 -> 1.23456780E+10 Rounded
|
||||
abs302 abs 1234567800 -> 1.23456780E+9 Rounded
|
||||
abs303 abs 1234567890 -> 1.23456789E+9 Rounded
|
||||
abs304 abs 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
abs305 abs 12345678901 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
abs306 abs 1234567896 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
abs321 abs 12345678000 -> 12345678000
|
||||
abs322 abs 1234567800 -> 1234567800
|
||||
abs323 abs 1234567890 -> 1234567890
|
||||
abs324 abs 1234567891 -> 1234567891
|
||||
abs325 abs 12345678901 -> 12345678901
|
||||
abs326 abs 1234567896 -> 1234567896
|
||||
|
||||
-- Null tests
|
||||
abs400 abs # -> ? Invalid_operation
|
||||
@@ -0,0 +1,522 @@
|
||||
------------------------------------------------------------------------
|
||||
-- add0.decTest -- decimal addition (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
|
||||
|
||||
-- [first group are 'quick confidence check']
|
||||
add001 add 1 1 -> 2
|
||||
add002 add 2 3 -> 5
|
||||
add003 add '5.75' '3.3' -> 9.05
|
||||
add004 add '5' '-3' -> 2
|
||||
add005 add '-5' '-3' -> -8
|
||||
add006 add '-7' '2.5' -> -4.5
|
||||
add007 add '0.7' '0.3' -> 1.0
|
||||
add008 add '1.25' '1.25' -> 2.50
|
||||
add009 add '1.23456789' '1.00000000' -> '2.23456789'
|
||||
add010 add '1.23456789' '1.00000011' -> '2.23456800'
|
||||
|
||||
add011 add '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Lost_digits Rounded
|
||||
add012 add '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Lost_digits Rounded
|
||||
add013 add '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Lost_digits Rounded
|
||||
add014 add '0.44444444449' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
add015 add '0.444444444499' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
add016 add '0.4444444444999' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
add017 add '0.4444444445000' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
add018 add '0.4444444445001' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
add019 add '0.444444444501' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
add020 add '0.44444444451' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
|
||||
add021 add 0 1 -> 1
|
||||
add022 add 1 1 -> 2
|
||||
add023 add 2 1 -> 3
|
||||
add024 add 3 1 -> 4
|
||||
add025 add 4 1 -> 5
|
||||
add026 add 5 1 -> 6
|
||||
add027 add 6 1 -> 7
|
||||
add028 add 7 1 -> 8
|
||||
add029 add 8 1 -> 9
|
||||
add030 add 9 1 -> 10
|
||||
|
||||
-- some carrying effects
|
||||
add031 add '0.9998' '0.0000' -> '0.9998'
|
||||
add032 add '0.9998' '0.0001' -> '0.9999'
|
||||
add033 add '0.9998' '0.0002' -> '1.0000'
|
||||
add034 add '0.9998' '0.0003' -> '1.0001'
|
||||
|
||||
add035 add '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded
|
||||
add036 add '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded
|
||||
add037 add '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded
|
||||
add038 add '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded
|
||||
add039 add '700000' '10000e+9' -> '1.00000007E+13' Rounded
|
||||
|
||||
-- symmetry:
|
||||
add040 add '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
|
||||
add041 add '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
|
||||
add042 add '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
|
||||
add044 add '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded
|
||||
add045 add '10000e+9' '700000' -> '1.00000007E+13' Rounded
|
||||
|
||||
-- same, higher precision
|
||||
precision: 15
|
||||
add046 add '10000e+9' '7' -> '10000000000007'
|
||||
add047 add '10000e+9' '70' -> '10000000000070'
|
||||
add048 add '10000e+9' '700' -> '10000000000700'
|
||||
add049 add '10000e+9' '7000' -> '10000000007000'
|
||||
add050 add '10000e+9' '70000' -> '10000000070000'
|
||||
add051 add '10000e+9' '700000' -> '10000000700000'
|
||||
|
||||
-- zero preservation
|
||||
precision: 6
|
||||
add060 add '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
|
||||
add061 add 1 '0.0001' -> '1.0001'
|
||||
add062 add 1 '0.00001' -> '1.00001'
|
||||
add063 add 1 '0.000001' -> '1.00000' Inexact Rounded
|
||||
add064 add 1 '0.0000001' -> '1.00000' Inexact Rounded
|
||||
add065 add 1 '0.00000001' -> '1.00000' Inexact Rounded
|
||||
|
||||
-- some funny zeros [in case of bad signum]
|
||||
add070 add 1 0 -> 1
|
||||
add071 add 1 0. -> 1
|
||||
add072 add 1 .0 -> 1
|
||||
add073 add 1 0.0 -> 1
|
||||
add074 add 0 1 -> 1
|
||||
add075 add 0. 1 -> 1
|
||||
add076 add .0 1 -> 1
|
||||
add077 add 0.0 1 -> 1
|
||||
|
||||
precision: 9
|
||||
|
||||
-- some carries
|
||||
add080 add 999999998 1 -> 999999999
|
||||
add081 add 999999999 1 -> 1.00000000E+9 Rounded
|
||||
add082 add 99999999 1 -> 100000000
|
||||
add083 add 9999999 1 -> 10000000
|
||||
add084 add 999999 1 -> 1000000
|
||||
add085 add 99999 1 -> 100000
|
||||
add086 add 9999 1 -> 10000
|
||||
add087 add 999 1 -> 1000
|
||||
add088 add 99 1 -> 100
|
||||
add089 add 9 1 -> 10
|
||||
|
||||
|
||||
-- more LHS swaps [were fixed]
|
||||
add090 add '-56267E-10' 0 -> '-0.0000056267'
|
||||
add091 add '-56267E-6' 0 -> '-0.056267'
|
||||
add092 add '-56267E-5' 0 -> '-0.56267'
|
||||
add093 add '-56267E-4' 0 -> '-5.6267'
|
||||
add094 add '-56267E-3' 0 -> '-56.267'
|
||||
add095 add '-56267E-2' 0 -> '-562.67'
|
||||
add096 add '-56267E-1' 0 -> '-5626.7'
|
||||
add097 add '-56267E-0' 0 -> '-56267'
|
||||
add098 add '-5E-10' 0 -> '-5E-10'
|
||||
add099 add '-5E-7' 0 -> '-5E-7'
|
||||
add100 add '-5E-6' 0 -> '-0.000005'
|
||||
add101 add '-5E-5' 0 -> '-0.00005'
|
||||
add102 add '-5E-4' 0 -> '-0.0005'
|
||||
add103 add '-5E-1' 0 -> '-0.5'
|
||||
add104 add '-5E0' 0 -> '-5'
|
||||
add105 add '-5E1' 0 -> '-50'
|
||||
add106 add '-5E5' 0 -> '-500000'
|
||||
add107 add '-5E8' 0 -> '-500000000'
|
||||
add108 add '-5E9' 0 -> '-5E+9'
|
||||
add109 add '-5E10' 0 -> '-5E+10'
|
||||
add110 add '-5E11' 0 -> '-5E+11'
|
||||
add111 add '-5E100' 0 -> '-5E+100'
|
||||
|
||||
-- more RHS swaps [were fixed]
|
||||
add113 add 0 '-56267E-10' -> '-0.0000056267'
|
||||
add114 add 0 '-56267E-6' -> '-0.056267'
|
||||
add116 add 0 '-56267E-5' -> '-0.56267'
|
||||
add117 add 0 '-56267E-4' -> '-5.6267'
|
||||
add119 add 0 '-56267E-3' -> '-56.267'
|
||||
add120 add 0 '-56267E-2' -> '-562.67'
|
||||
add121 add 0 '-56267E-1' -> '-5626.7'
|
||||
add122 add 0 '-56267E-0' -> '-56267'
|
||||
add123 add 0 '-5E-10' -> '-5E-10'
|
||||
add124 add 0 '-5E-7' -> '-5E-7'
|
||||
add125 add 0 '-5E-6' -> '-0.000005'
|
||||
add126 add 0 '-5E-5' -> '-0.00005'
|
||||
add127 add 0 '-5E-4' -> '-0.0005'
|
||||
add128 add 0 '-5E-1' -> '-0.5'
|
||||
add129 add 0 '-5E0' -> '-5'
|
||||
add130 add 0 '-5E1' -> '-50'
|
||||
add131 add 0 '-5E5' -> '-500000'
|
||||
add132 add 0 '-5E8' -> '-500000000'
|
||||
add133 add 0 '-5E9' -> '-5E+9'
|
||||
add134 add 0 '-5E10' -> '-5E+10'
|
||||
add135 add 0 '-5E11' -> '-5E+11'
|
||||
add136 add 0 '-5E100' -> '-5E+100'
|
||||
|
||||
-- [some of the next group are really constructor tests]
|
||||
add140 add '00.0' 0 -> '0'
|
||||
add141 add '0.00' 0 -> '0'
|
||||
add142 add 0 '0.00' -> '0'
|
||||
add143 add 0 '00.0' -> '0'
|
||||
|
||||
add150 add '00.0' '0.00' -> '0'
|
||||
add151 add '0.00' '00.0' -> '0'
|
||||
add152 add '3' '.3' -> '3.3'
|
||||
add153 add '3.' '.3' -> '3.3'
|
||||
add154 add '3.0' '.3' -> '3.3'
|
||||
add155 add '3.00' '.3' -> '3.30'
|
||||
add156 add '3' '3' -> '6'
|
||||
add157 add '3' '+3' -> '6'
|
||||
add158 add '3' '-3' -> '0'
|
||||
add159 add '0.3' '-0.3' -> '0'
|
||||
add160 add '0.03' '-0.03' -> '0'
|
||||
|
||||
-- try borderline precision, with carries, etc.
|
||||
precision: 15
|
||||
add161 add '1E+12' '-1' -> '999999999999'
|
||||
add162 add '1E+12' '1.11' -> '1000000000001.11'
|
||||
add163 add '1.11' '1E+12' -> '1000000000001.11'
|
||||
add164 add '-1' '1E+12' -> '999999999999'
|
||||
add165 add '7E+12' '-1' -> '6999999999999'
|
||||
add166 add '7E+12' '1.11' -> '7000000000001.11'
|
||||
add167 add '1.11' '7E+12' -> '7000000000001.11'
|
||||
add168 add '-1' '7E+12' -> '6999999999999'
|
||||
|
||||
-- 123456789012345 123456789012345 1 23456789012345
|
||||
add170 add '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded
|
||||
add171 add '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded
|
||||
add172 add '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded
|
||||
add173 add '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded
|
||||
add174 add '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded
|
||||
add175 add '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded
|
||||
add176 add '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded
|
||||
add177 add '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded
|
||||
add178 add '0.444444444444444' '0.555555555555555' -> '0.999999999999999'
|
||||
add179 add '0.444444444444444' '0.555555555555554' -> '0.999999999999998'
|
||||
add180 add '0.444444444444444' '0.555555555555553' -> '0.999999999999997'
|
||||
add181 add '0.444444444444444' '0.555555555555552' -> '0.999999999999996'
|
||||
add182 add '0.444444444444444' '0.555555555555551' -> '0.999999999999995'
|
||||
add183 add '0.444444444444444' '0.555555555555550' -> '0.999999999999994'
|
||||
|
||||
-- and some more, including residue effects and different roundings
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
add200 add '123456789' 0 -> '123456789'
|
||||
add201 add '123456789' 0.000000001 -> '123456789' Inexact Rounded
|
||||
add202 add '123456789' 0.000001 -> '123456789' Inexact Rounded
|
||||
add203 add '123456789' 0.1 -> '123456789' Inexact Rounded
|
||||
add204 add '123456789' 0.4 -> '123456789' Inexact Rounded
|
||||
add205 add '123456789' 0.49 -> '123456789' Inexact Rounded
|
||||
add206 add '123456789' 0.499999 -> '123456789' Inexact Rounded
|
||||
add207 add '123456789' 0.499999999 -> '123456789' Inexact Rounded
|
||||
add208 add '123456789' 0.5 -> '123456790' Inexact Rounded
|
||||
add209 add '123456789' 0.500000001 -> '123456790' Inexact Rounded
|
||||
add210 add '123456789' 0.500001 -> '123456790' Inexact Rounded
|
||||
add211 add '123456789' 0.51 -> '123456790' Inexact Rounded
|
||||
add212 add '123456789' 0.6 -> '123456790' Inexact Rounded
|
||||
add213 add '123456789' 0.9 -> '123456790' Inexact Rounded
|
||||
add214 add '123456789' 0.99999 -> '123456790' Inexact Rounded
|
||||
add215 add '123456789' 0.999999999 -> '123456790' Inexact Rounded
|
||||
add216 add '123456789' 1 -> '123456790'
|
||||
add217 add '123456789' 1.000000001 -> '123456790' Inexact Lost_digits Rounded
|
||||
add218 add '123456789' 1.00001 -> '123456790' Inexact Rounded
|
||||
add219 add '123456789' 1.1 -> '123456790' Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
add220 add '123456789' 0 -> '123456789'
|
||||
add221 add '123456789' 0.000000001 -> '123456789' Inexact Rounded
|
||||
add222 add '123456789' 0.000001 -> '123456789' Inexact Rounded
|
||||
add223 add '123456789' 0.1 -> '123456789' Inexact Rounded
|
||||
add224 add '123456789' 0.4 -> '123456789' Inexact Rounded
|
||||
add225 add '123456789' 0.49 -> '123456789' Inexact Rounded
|
||||
add226 add '123456789' 0.499999 -> '123456789' Inexact Rounded
|
||||
add227 add '123456789' 0.499999999 -> '123456789' Inexact Rounded
|
||||
add228 add '123456789' 0.5 -> '123456790' Inexact Rounded
|
||||
add229 add '123456789' 0.500000001 -> '123456790' Inexact Rounded
|
||||
add230 add '123456789' 0.500001 -> '123456790' Inexact Rounded
|
||||
add231 add '123456789' 0.51 -> '123456790' Inexact Rounded
|
||||
add232 add '123456789' 0.6 -> '123456790' Inexact Rounded
|
||||
add233 add '123456789' 0.9 -> '123456790' Inexact Rounded
|
||||
add234 add '123456789' 0.99999 -> '123456790' Inexact Rounded
|
||||
add235 add '123456789' 0.999999999 -> '123456790' Inexact Rounded
|
||||
add236 add '123456789' 1 -> '123456790'
|
||||
add237 add '123456789' 1.00000001 -> '123456790' Inexact Rounded
|
||||
add238 add '123456789' 1.00001 -> '123456790' Inexact Rounded
|
||||
add239 add '123456789' 1.1 -> '123456790' Inexact Rounded
|
||||
-- critical few with even bottom digit...
|
||||
add240 add '123456788' 0.499999999 -> '123456788' Inexact Rounded
|
||||
add241 add '123456788' 0.5 -> '123456788' Inexact Rounded
|
||||
add242 add '123456788' 0.500000001 -> '123456789' Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
add250 add '123456789' 0 -> '123456789'
|
||||
add251 add '123456789' 0.000000001 -> '123456789' Inexact Rounded
|
||||
add252 add '123456789' 0.000001 -> '123456789' Inexact Rounded
|
||||
add253 add '123456789' 0.1 -> '123456789' Inexact Rounded
|
||||
add254 add '123456789' 0.4 -> '123456789' Inexact Rounded
|
||||
add255 add '123456789' 0.49 -> '123456789' Inexact Rounded
|
||||
add256 add '123456789' 0.499999 -> '123456789' Inexact Rounded
|
||||
add257 add '123456789' 0.499999999 -> '123456789' Inexact Rounded
|
||||
add258 add '123456789' 0.5 -> '123456789' Inexact Rounded
|
||||
add259 add '123456789' 0.500000001 -> '123456789' Inexact Rounded
|
||||
add260 add '123456789' 0.500001 -> '123456789' Inexact Rounded
|
||||
add261 add '123456789' 0.51 -> '123456789' Inexact Rounded
|
||||
add262 add '123456789' 0.6 -> '123456789' Inexact Rounded
|
||||
add263 add '123456789' 0.9 -> '123456789' Inexact Rounded
|
||||
add264 add '123456789' 0.99999 -> '123456789' Inexact Rounded
|
||||
add265 add '123456789' 0.999999999 -> '123456789' Inexact Rounded
|
||||
add266 add '123456789' 1 -> '123456790'
|
||||
add267 add '123456789' 1.00000001 -> '123456790' Inexact Rounded
|
||||
add268 add '123456789' 1.00001 -> '123456790' Inexact Rounded
|
||||
add269 add '123456789' 1.1 -> '123456790' Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
|
||||
-- input preparation tests
|
||||
precision: 3
|
||||
|
||||
add300 add '12345678900000' 9999999999999 -> '2.23E+13' Inexact Lost_digits Rounded
|
||||
add301 add '9999999999999' 12345678900000 -> '2.23E+13' Inexact Lost_digits Rounded
|
||||
add302 add '12E+3' '3456' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
-- next was 1.54E+4 under old [truncate to digits+1] rules
|
||||
add303 add '12E+3' '3446' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
add304 add '12E+3' '3454' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
add305 add '12E+3' '3444' -> '1.54E+4' Inexact Lost_digits Rounded
|
||||
|
||||
add306 add '3456' '12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
-- next was 1.54E+4 under old [truncate to digits+1] rules
|
||||
add307 add '3446' '12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
add308 add '3454' '12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
add309 add '3444' '12E+3' -> '1.54E+4' Inexact Lost_digits Rounded
|
||||
|
||||
-- 1 in last place tests
|
||||
add501 add -1 1 -> 0
|
||||
add502 add 0 1 -> 1
|
||||
add503 add 1 1 -> 2
|
||||
add504 add 12 1 -> 13
|
||||
add505 add 98 1 -> 99
|
||||
add506 add 99 1 -> 100
|
||||
add507 add 100 1 -> 101
|
||||
add508 add 101 1 -> 102
|
||||
add509 add -1 -1 -> -2
|
||||
add510 add 0 -1 -> -1
|
||||
add511 add 1 -1 -> 0
|
||||
add512 add 12 -1 -> 11
|
||||
add513 add 98 -1 -> 97
|
||||
add514 add 99 -1 -> 98
|
||||
add515 add 100 -1 -> 99
|
||||
add516 add 101 -1 -> 100
|
||||
|
||||
add521 add -0.01 0.01 -> 0
|
||||
add522 add 0.00 0.01 -> 0.01
|
||||
add523 add 0.01 0.01 -> 0.02
|
||||
add524 add 0.12 0.01 -> 0.13
|
||||
add525 add 0.98 0.01 -> 0.99
|
||||
add526 add 0.99 0.01 -> 1.00
|
||||
add527 add 1.00 0.01 -> 1.01
|
||||
add528 add 1.01 0.01 -> 1.02
|
||||
add529 add -0.01 -0.01 -> -0.02
|
||||
add530 add 0.00 -0.01 -> -0.01
|
||||
add531 add 0.01 -0.01 -> 0
|
||||
add532 add 0.12 -0.01 -> 0.11
|
||||
add533 add 0.98 -0.01 -> 0.97
|
||||
add534 add 0.99 -0.01 -> 0.98
|
||||
add535 add 1.00 -0.01 -> 0.99
|
||||
add536 add 1.01 -0.01 -> 1.00
|
||||
|
||||
-- ulp replacement tests
|
||||
precision: 9
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
add600 add 1 77e-7 -> 1.0000077
|
||||
add601 add 1 77e-8 -> 1.00000077
|
||||
add602 add 1 77e-9 -> 1.00000008 Inexact Rounded
|
||||
add603 add 1 77e-10 -> 1.00000001 Inexact Rounded
|
||||
add604 add 1 77e-11 -> 1.00000000 Inexact Rounded
|
||||
add605 add 1 77e-12 -> 1.00000000 Inexact Rounded
|
||||
add606 add 1 77e-999 -> 1.00000000 Inexact Rounded
|
||||
add607 add 1 77e-9999999 -> 1.00000000 Inexact Rounded
|
||||
|
||||
add610 add 10 77e-7 -> 10.0000077
|
||||
add611 add 10 77e-8 -> 10.0000008 Inexact Rounded
|
||||
add612 add 10 77e-9 -> 10.0000001 Inexact Rounded
|
||||
add613 add 10 77e-10 -> 10.0000000 Inexact Rounded
|
||||
add614 add 10 77e-11 -> 10.0000000 Inexact Rounded
|
||||
add615 add 10 77e-12 -> 10.0000000 Inexact Rounded
|
||||
add616 add 10 77e-999 -> 10.0000000 Inexact Rounded
|
||||
add617 add 10 77e-9999999 -> 10.0000000 Inexact Rounded
|
||||
|
||||
add620 add 77e-7 1 -> 1.0000077
|
||||
add621 add 77e-8 1 -> 1.00000077
|
||||
add622 add 77e-9 1 -> 1.00000008 Inexact Rounded
|
||||
add623 add 77e-10 1 -> 1.00000001 Inexact Rounded
|
||||
add624 add 77e-11 1 -> 1.00000000 Inexact Rounded
|
||||
add625 add 77e-12 1 -> 1.00000000 Inexact Rounded
|
||||
add626 add 77e-999 1 -> 1.00000000 Inexact Rounded
|
||||
add627 add 77e-9999999 1 -> 1.00000000 Inexact Rounded
|
||||
|
||||
add630 add 77e-7 10 -> 10.0000077
|
||||
add631 add 77e-8 10 -> 10.0000008 Inexact Rounded
|
||||
add632 add 77e-9 10 -> 10.0000001 Inexact Rounded
|
||||
add633 add 77e-10 10 -> 10.0000000 Inexact Rounded
|
||||
add634 add 77e-11 10 -> 10.0000000 Inexact Rounded
|
||||
add635 add 77e-12 10 -> 10.0000000 Inexact Rounded
|
||||
add636 add 77e-999 10 -> 10.0000000 Inexact Rounded
|
||||
add637 add 77e-9999999 10 -> 10.0000000 Inexact Rounded
|
||||
|
||||
-- negative ulps
|
||||
|
||||
-- Note that since we are under X3.274 rules, the rounding here after
|
||||
-- subtraction is from the leftmost digit of the operands, not the
|
||||
-- result. Hence, for example: 'add642 add 1 -77e-9' becomes:
|
||||
--
|
||||
-- 1000000000 E-9
|
||||
-- - 0000000077 E-9
|
||||
-- ----------
|
||||
-- 0999999923 E-9
|
||||
--
|
||||
-- which is rounded to 9 digits from the left (and including the leading
|
||||
-- 0 in this case).
|
||||
|
||||
add640 add 1 -77e-7 -> 0.9999923
|
||||
add641 add 1 -77e-8 -> 0.99999923
|
||||
add642 add 1 -77e-9 -> 0.99999992 Inexact Rounded
|
||||
add643 add 1 -77e-10 -> 0.99999999 Inexact Rounded
|
||||
add644 add 1 -77e-11 -> 1.00000000 Inexact Rounded
|
||||
add645 add 1 -77e-12 -> 1.00000000 Inexact Rounded
|
||||
add646 add 1 -77e-999 -> 1.00000000 Inexact Rounded
|
||||
add647 add 1 -77e-9999999 -> 1.00000000 Inexact Rounded
|
||||
|
||||
add650 add 10 -77e-7 -> 9.9999923
|
||||
add651 add 10 -77e-8 -> 9.9999992 Inexact Rounded
|
||||
add652 add 10 -77e-9 -> 9.9999999 Inexact Rounded
|
||||
add653 add 10 -77e-10 -> 10.0000000 Inexact Rounded
|
||||
add654 add 10 -77e-11 -> 10.0000000 Inexact Rounded
|
||||
add655 add 10 -77e-12 -> 10.0000000 Inexact Rounded
|
||||
add656 add 10 -77e-999 -> 10.0000000 Inexact Rounded
|
||||
add657 add 10 -77e-9999999 -> 10.0000000 Inexact Rounded
|
||||
|
||||
add660 add -77e-7 1 -> 0.9999923
|
||||
add661 add -77e-8 1 -> 0.99999923
|
||||
add662 add -77e-9 1 -> 0.99999992 Inexact Rounded
|
||||
add663 add -77e-10 1 -> 0.99999999 Inexact Rounded
|
||||
add664 add -77e-11 1 -> 1.00000000 Inexact Rounded
|
||||
add665 add -77e-12 1 -> 1.00000000 Inexact Rounded
|
||||
add666 add -77e-999 1 -> 1.00000000 Inexact Rounded
|
||||
add667 add -77e-9999999 1 -> 1.00000000 Inexact Rounded
|
||||
|
||||
add670 add -77e-7 10 -> 9.9999923
|
||||
add671 add -77e-8 10 -> 9.9999992 Inexact Rounded
|
||||
add672 add -77e-9 10 -> 9.9999999 Inexact Rounded
|
||||
add673 add -77e-10 10 -> 10.0000000 Inexact Rounded
|
||||
add674 add -77e-11 10 -> 10.0000000 Inexact Rounded
|
||||
add675 add -77e-12 10 -> 10.0000000 Inexact Rounded
|
||||
add676 add -77e-999 10 -> 10.0000000 Inexact Rounded
|
||||
add677 add -77e-9999999 10 -> 10.0000000 Inexact Rounded
|
||||
|
||||
-- negative negative ulps
|
||||
add680 add -1 77e-7 -> -0.9999923
|
||||
add681 add -1 77e-8 -> -0.99999923
|
||||
add682 add -1 77e-9 -> -0.99999992 Inexact Rounded
|
||||
add683 add -1 77e-10 -> -0.99999999 Inexact Rounded
|
||||
add684 add -1 77e-11 -> -1.00000000 Inexact Rounded
|
||||
add685 add -1 77e-12 -> -1.00000000 Inexact Rounded
|
||||
add686 add -1 77e-999 -> -1.00000000 Inexact Rounded
|
||||
add687 add -1 77e-9999999 -> -1.00000000 Inexact Rounded
|
||||
|
||||
add690 add -10 77e-7 -> -9.9999923
|
||||
add691 add -10 77e-8 -> -9.9999992 Inexact Rounded
|
||||
add692 add -10 77e-9 -> -9.9999999 Inexact Rounded
|
||||
add693 add -10 77e-10 -> -10.0000000 Inexact Rounded
|
||||
add694 add -10 77e-11 -> -10.0000000 Inexact Rounded
|
||||
add695 add -10 77e-12 -> -10.0000000 Inexact Rounded
|
||||
add696 add -10 77e-999 -> -10.0000000 Inexact Rounded
|
||||
add697 add -10 77e-9999999 -> -10.0000000 Inexact Rounded
|
||||
|
||||
add700 add 77e-7 -1 -> -0.9999923
|
||||
add701 add 77e-8 -1 -> -0.99999923
|
||||
add702 add 77e-9 -1 -> -0.99999992 Inexact Rounded
|
||||
add703 add 77e-10 -1 -> -0.99999999 Inexact Rounded
|
||||
add704 add 77e-11 -1 -> -1.00000000 Inexact Rounded
|
||||
add705 add 77e-12 -1 -> -1.00000000 Inexact Rounded
|
||||
add706 add 77e-999 -1 -> -1.00000000 Inexact Rounded
|
||||
add707 add 77e-9999999 -1 -> -1.00000000 Inexact Rounded
|
||||
|
||||
add710 add 77e-7 -10 -> -9.9999923
|
||||
add711 add 77e-8 -10 -> -9.9999992 Inexact Rounded
|
||||
add712 add 77e-9 -10 -> -9.9999999 Inexact Rounded
|
||||
add713 add 77e-10 -10 -> -10.0000000 Inexact Rounded
|
||||
add714 add 77e-11 -10 -> -10.0000000 Inexact Rounded
|
||||
add715 add 77e-12 -10 -> -10.0000000 Inexact Rounded
|
||||
add716 add 77e-999 -10 -> -10.0000000 Inexact Rounded
|
||||
add717 add 77e-9999999 -10 -> -10.0000000 Inexact Rounded
|
||||
|
||||
|
||||
-- overflow and underflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 9
|
||||
add330 add 1E+999999999 9E+999999999 -> ? Overflow Inexact Rounded
|
||||
add331 add 9E+999999999 1E+999999999 -> ? Overflow Inexact Rounded
|
||||
add332 add -1.1E-999999999 1E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
add333 add 1E-999999999 -1.1e-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
add334 add -1E+999999999 -9E+999999999 -> ? Overflow Inexact Rounded
|
||||
add335 add -9E+999999999 -1E+999999999 -> ? Overflow Inexact Rounded
|
||||
add336 add +1.1E-999999999 -1E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
add337 add -1E-999999999 +1.1e-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
precision: 3
|
||||
add338 add 9.999E+999999999 0 -> ? Inexact Lost_digits Overflow Rounded
|
||||
add339 add 0 9.999E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
add401 add 12345678000 0 -> 1.23456780E+10 Rounded
|
||||
add402 add 0 12345678000 -> 1.23456780E+10 Rounded
|
||||
add403 add 1234567800 0 -> 1.23456780E+9 Rounded
|
||||
add404 add 0 1234567800 -> 1.23456780E+9 Rounded
|
||||
add405 add 1234567890 0 -> 1.23456789E+9 Rounded
|
||||
add406 add 0 1234567890 -> 1.23456789E+9 Rounded
|
||||
add407 add 1234567891 0 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
add408 add 0 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
add409 add 12345678901 0 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
add410 add 0 12345678901 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
add411 add 1234567896 0 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
add412 add 0 1234567896 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for lostDigits
|
||||
add441 add 12345678000 0 -> 12345678000
|
||||
add442 add 0 12345678000 -> 12345678000
|
||||
add443 add 1234567800 0 -> 1234567800
|
||||
add444 add 0 1234567800 -> 1234567800
|
||||
add445 add 1234567890 0 -> 1234567890
|
||||
add446 add 0 1234567890 -> 1234567890
|
||||
add447 add 1234567891 0 -> 1234567891
|
||||
add448 add 0 1234567891 -> 1234567891
|
||||
add449 add 12345678901 0 -> 12345678901
|
||||
add450 add 0 12345678901 -> 12345678901
|
||||
add451 add 1234567896 0 -> 1234567896
|
||||
add452 add 0 1234567896 -> 1234567896
|
||||
|
||||
-- Null tests
|
||||
add900 add 10 # -> ? Invalid_operation
|
||||
add901 add # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,892 @@
|
||||
------------------------------------------------------------------------
|
||||
-- base0.decTest -- base decimal <--> string conversions (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
|
||||
|
||||
-- This file tests base conversions from string to a decimal number
|
||||
-- and back to a string (in either Scientific or Engineering form),
|
||||
-- using the simplified arithmetic rules
|
||||
|
||||
extended: 0
|
||||
precision: 15
|
||||
rounding: half_up
|
||||
maxExponent: 999999999
|
||||
minexponent: -999999999
|
||||
|
||||
bas001 toSci 0 -> 0
|
||||
bas002 toSci 1 -> 1
|
||||
bas003 toSci 1.0 -> 1.0
|
||||
bas004 toSci 1.00 -> 1.00
|
||||
bas005 toSci 10 -> 10
|
||||
bas006 toSci 1000 -> 1000
|
||||
bas007 toSci 10.0 -> 10.0
|
||||
bas008 toSci 10.1 -> 10.1
|
||||
bas009 toSci 10.4 -> 10.4
|
||||
bas010 toSci 10.5 -> 10.5
|
||||
bas011 toSci 10.6 -> 10.6
|
||||
bas012 toSci 10.9 -> 10.9
|
||||
bas013 toSci 11.0 -> 11.0
|
||||
bas014 toSci 1.234 -> 1.234
|
||||
bas015 toSci 0.123 -> 0.123
|
||||
bas016 toSci 0.012 -> 0.012
|
||||
|
||||
bas021 toSci -1 -> -1
|
||||
bas022 toSci -1.0 -> -1.0
|
||||
bas023 toSci -0.1 -> -0.1
|
||||
bas024 toSci -9.1 -> -9.1
|
||||
bas025 toSci -9.11 -> -9.11
|
||||
bas026 toSci -9.119 -> -9.119
|
||||
bas027 toSci -9.999 -> -9.999
|
||||
|
||||
bas030 toSci '123456789.123456' -> '123456789.123456'
|
||||
bas031 toSci '123456789.000000' -> '123456789.000000'
|
||||
bas032 toSci '123456789123456' -> '123456789123456'
|
||||
bas033 toSci '0.0000123456789' -> '0.0000123456789'
|
||||
bas034 toSci '0.00000123456789' -> '0.00000123456789'
|
||||
bas035 toSci '0.000000123456789' -> '1.23456789E-7'
|
||||
bas036 toSci '0.0000000123456789' -> '1.23456789E-8'
|
||||
|
||||
bas037 toSci '0.123456789012344' -> '0.123456789012344'
|
||||
bas038 toSci '0.123456789012345' -> '0.123456789012345'
|
||||
|
||||
-- String [many more examples are implicitly tested elsewhere]
|
||||
-- strings without E cannot generate E in result
|
||||
bas101 toSci "12" -> '12'
|
||||
bas102 toSci "-76" -> '-76'
|
||||
bas103 toSci "12.76" -> '12.76'
|
||||
bas104 toSci "+12.76" -> '12.76'
|
||||
bas105 toSci "012.76" -> '12.76'
|
||||
bas106 toSci "+0.003" -> '0.003'
|
||||
bas107 toSci "17." -> '17'
|
||||
bas108 toSci ".5" -> '0.5'
|
||||
bas109 toSci "044" -> '44'
|
||||
bas110 toSci "0044" -> '44'
|
||||
bas111 toSci "0.0005" -> '0.0005'
|
||||
bas112 toSci "00.00005" -> '0.00005'
|
||||
bas113 toSci "0.000005" -> '0.000005'
|
||||
bas114 toSci "0.0000005" -> '5E-7'
|
||||
bas115 toSci "0.00000005" -> '5E-8'
|
||||
bas116 toSci "12345678.543210" -> '12345678.543210'
|
||||
bas117 toSci "2345678.543210" -> '2345678.543210'
|
||||
bas118 toSci "345678.543210" -> '345678.543210'
|
||||
bas119 toSci "0345678.54321" -> '345678.54321'
|
||||
bas120 toSci "345678.5432" -> '345678.5432'
|
||||
bas121 toSci "+345678.5432" -> '345678.5432'
|
||||
bas122 toSci "+0345678.5432" -> '345678.5432'
|
||||
bas123 toSci "+00345678.5432" -> '345678.5432'
|
||||
bas124 toSci "-345678.5432" -> '-345678.5432'
|
||||
bas125 toSci "-0345678.5432" -> '-345678.5432'
|
||||
bas126 toSci "-00345678.5432" -> '-345678.5432'
|
||||
|
||||
-- [No exotics as no Unicode]
|
||||
|
||||
-- Numbers with E
|
||||
bas130 toSci "0.000E-1" -> '0'
|
||||
bas131 toSci "0.000E-2" -> '0'
|
||||
bas132 toSci "0.000E-3" -> '0'
|
||||
bas133 toSci "0.000E-4" -> '0'
|
||||
bas134 toSci "0.00E-2" -> '0'
|
||||
bas135 toSci "0.00E-3" -> '0'
|
||||
bas136 toSci "0.00E-4" -> '0'
|
||||
bas137 toSci "0.00E-5" -> '0'
|
||||
bas138 toSci "+0E+9" -> '0'
|
||||
bas139 toSci "-0E+9" -> '0'
|
||||
|
||||
bas140 toSci "1E+9" -> '1E+9'
|
||||
bas141 toSci "1e+09" -> '1E+9'
|
||||
bas142 toSci "1E+90" -> '1E+90'
|
||||
bas143 toSci "+1E+009" -> '1E+9'
|
||||
bas144 toSci "0E+9" -> '0'
|
||||
bas145 toSci "1E+9" -> '1E+9'
|
||||
bas146 toSci "1E+09" -> '1E+9'
|
||||
bas147 toSci "1e+90" -> '1E+90'
|
||||
bas148 toSci "1E+009" -> '1E+9'
|
||||
bas149 toSci "000E+9" -> '0'
|
||||
bas150 toSci "1E9" -> '1E+9'
|
||||
bas151 toSci "1e09" -> '1E+9'
|
||||
bas152 toSci "1E90" -> '1E+90'
|
||||
bas153 toSci "1E009" -> '1E+9'
|
||||
bas154 toSci "0E9" -> '0'
|
||||
bas155 toSci "0.000e+0" -> '0'
|
||||
bas156 toSci "0.000E-1" -> '0'
|
||||
bas157 toSci "4E+9" -> '4E+9'
|
||||
bas158 toSci "44E+9" -> '4.4E+10'
|
||||
bas159 toSci "0.73e-7" -> '7.3E-8'
|
||||
bas160 toSci "00E+9" -> '0'
|
||||
bas161 toSci "00E-9" -> '0'
|
||||
bas162 toSci "10E+9" -> '1.0E+10'
|
||||
bas163 toSci "10E+09" -> '1.0E+10'
|
||||
bas164 toSci "10e+90" -> '1.0E+91'
|
||||
bas165 toSci "10E+009" -> '1.0E+10'
|
||||
bas166 toSci "100e+9" -> '1.00E+11'
|
||||
bas167 toSci "100e+09" -> '1.00E+11'
|
||||
bas168 toSci "100E+90" -> '1.00E+92'
|
||||
bas169 toSci "100e+009" -> '1.00E+11'
|
||||
|
||||
bas170 toSci "1.265" -> '1.265'
|
||||
bas171 toSci "1.265E-20" -> '1.265E-20'
|
||||
bas172 toSci "1.265E-8" -> '1.265E-8'
|
||||
bas173 toSci "1.265E-4" -> '0.0001265'
|
||||
bas174 toSci "1.265E-3" -> '0.001265'
|
||||
bas175 toSci "1.265E-2" -> '0.01265'
|
||||
bas176 toSci "1.265E-1" -> '0.1265'
|
||||
bas177 toSci "1.265E-0" -> '1.265'
|
||||
bas178 toSci "1.265E+1" -> '12.65'
|
||||
bas179 toSci "1.265E+2" -> '126.5'
|
||||
bas180 toSci "1.265E+3" -> '1265'
|
||||
bas181 toSci "1.265E+4" -> '1.265E+4'
|
||||
bas182 toSci "1.265E+8" -> '1.265E+8'
|
||||
bas183 toSci "1.265E+20" -> '1.265E+20'
|
||||
|
||||
bas190 toSci "12.65" -> '12.65'
|
||||
bas191 toSci "12.65E-20" -> '1.265E-19'
|
||||
bas192 toSci "12.65E-8" -> '1.265E-7'
|
||||
bas193 toSci "12.65E-4" -> '0.001265'
|
||||
bas194 toSci "12.65E-3" -> '0.01265'
|
||||
bas195 toSci "12.65E-2" -> '0.1265'
|
||||
bas196 toSci "12.65E-1" -> '1.265'
|
||||
bas197 toSci "12.65E-0" -> '12.65'
|
||||
bas198 toSci "12.65E+1" -> '126.5'
|
||||
bas199 toSci "12.65E+2" -> '1265'
|
||||
bas200 toSci "12.65E+3" -> '1.265E+4'
|
||||
bas201 toSci "12.65E+4" -> '1.265E+5'
|
||||
bas202 toSci "12.65E+8" -> '1.265E+9'
|
||||
bas203 toSci "12.65E+20" -> '1.265E+21'
|
||||
|
||||
bas210 toSci "126.5" -> '126.5'
|
||||
bas211 toSci "126.5E-20" -> '1.265E-18'
|
||||
bas212 toSci "126.5E-8" -> '0.000001265'
|
||||
bas213 toSci "126.5E-4" -> '0.01265'
|
||||
bas214 toSci "126.5E-3" -> '0.1265'
|
||||
bas215 toSci "126.5E-2" -> '1.265'
|
||||
bas216 toSci "126.5E-1" -> '12.65'
|
||||
bas217 toSci "126.5E-0" -> '126.5'
|
||||
bas218 toSci "126.5E+1" -> '1265'
|
||||
bas219 toSci "126.5E+2" -> '1.265E+4'
|
||||
bas220 toSci "126.5E+3" -> '1.265E+5'
|
||||
bas221 toSci "126.5E+4" -> '1.265E+6'
|
||||
bas222 toSci "126.5E+8" -> '1.265E+10'
|
||||
bas223 toSci "126.5E+20" -> '1.265E+22'
|
||||
|
||||
bas230 toSci "1265" -> '1265'
|
||||
bas231 toSci "1265E-20" -> '1.265E-17'
|
||||
bas232 toSci "1265E-8" -> '0.00001265'
|
||||
bas233 toSci "1265E-4" -> '0.1265'
|
||||
bas234 toSci "1265E-3" -> '1.265'
|
||||
bas235 toSci "1265E-2" -> '12.65'
|
||||
bas236 toSci "1265E-1" -> '126.5'
|
||||
bas237 toSci "1265E-0" -> '1265'
|
||||
bas238 toSci "1265E+1" -> '1.265E+4'
|
||||
bas239 toSci "1265E+2" -> '1.265E+5'
|
||||
bas240 toSci "1265E+3" -> '1.265E+6'
|
||||
bas241 toSci "1265E+4" -> '1.265E+7'
|
||||
bas242 toSci "1265E+8" -> '1.265E+11'
|
||||
bas243 toSci "1265E+20" -> '1.265E+23'
|
||||
|
||||
bas250 toSci "0.1265" -> '0.1265'
|
||||
bas251 toSci "0.1265E-20" -> '1.265E-21'
|
||||
bas252 toSci "0.1265E-8" -> '1.265E-9'
|
||||
bas253 toSci "0.1265E-4" -> '0.00001265'
|
||||
bas254 toSci "0.1265E-3" -> '0.0001265'
|
||||
bas255 toSci "0.1265E-2" -> '0.001265'
|
||||
bas256 toSci "0.1265E-1" -> '0.01265'
|
||||
bas257 toSci "0.1265E-0" -> '0.1265'
|
||||
bas258 toSci "0.1265E+1" -> '1.265'
|
||||
bas259 toSci "0.1265E+2" -> '12.65'
|
||||
bas260 toSci "0.1265E+3" -> '126.5'
|
||||
bas261 toSci "0.1265E+4" -> '1265'
|
||||
bas262 toSci "0.1265E+8" -> '1.265E+7'
|
||||
bas263 toSci "0.1265E+20" -> '1.265E+19'
|
||||
|
||||
bas270 toSci "0.09e999" -> '9E+997'
|
||||
bas271 toSci "0.9e999" -> '9E+998'
|
||||
bas272 toSci "9e999" -> '9E+999'
|
||||
bas273 toSci "9.9e999" -> '9.9E+999'
|
||||
bas274 toSci "9.99e999" -> '9.99E+999'
|
||||
bas275 toSci "9.99e-999" -> '9.99E-999'
|
||||
bas276 toSci "9.9e-999" -> '9.9E-999'
|
||||
bas277 toSci "9e-999" -> '9E-999'
|
||||
bas279 toSci "99e-999" -> '9.9E-998'
|
||||
bas280 toSci "999e-999" -> '9.99E-997'
|
||||
bas281 toSci '0.9e-998' -> '9E-999'
|
||||
bas282 toSci '0.09e-997' -> '9E-999'
|
||||
bas283 toSci '0.1e1000' -> '1E+999'
|
||||
bas284 toSci '10e-1000' -> '1.0E-999'
|
||||
|
||||
-- Engineering notation tests
|
||||
bas301 toSci 10e12 -> 1.0E+13
|
||||
bas302 toEng 10e12 -> 10E+12
|
||||
bas303 toSci 10e11 -> 1.0E+12
|
||||
bas304 toEng 10e11 -> 1.0E+12
|
||||
bas305 toSci 10e10 -> 1.0E+11
|
||||
bas306 toEng 10e10 -> 100E+9
|
||||
bas307 toSci 10e9 -> 1.0E+10
|
||||
bas308 toEng 10e9 -> 10E+9
|
||||
bas309 toSci 10e8 -> 1.0E+9
|
||||
bas310 toEng 10e8 -> 1.0E+9
|
||||
bas311 toSci 10e7 -> 1.0E+8
|
||||
bas312 toEng 10e7 -> 100E+6
|
||||
bas313 toSci 10e6 -> 1.0E+7
|
||||
bas314 toEng 10e6 -> 10E+6
|
||||
bas315 toSci 10e5 -> 1.0E+6
|
||||
bas316 toEng 10e5 -> 1.0E+6
|
||||
bas317 toSci 10e4 -> 1.0E+5
|
||||
bas318 toEng 10e4 -> 100E+3
|
||||
bas319 toSci 10e3 -> 1.0E+4
|
||||
bas320 toEng 10e3 -> 10E+3
|
||||
bas321 toSci 10e2 -> 1.0E+3
|
||||
bas322 toEng 10e2 -> 1.0E+3
|
||||
bas323 toSci 10e1 -> 1.0E+2
|
||||
bas324 toEng 10e1 -> 100
|
||||
bas325 toSci 10e0 -> 10
|
||||
bas326 toEng 10e0 -> 10
|
||||
bas327 toSci 10e-1 -> 1.0
|
||||
bas328 toEng 10e-1 -> 1.0
|
||||
bas329 toSci 10e-2 -> 0.10
|
||||
bas330 toEng 10e-2 -> 0.10
|
||||
bas331 toSci 10e-3 -> 0.010
|
||||
bas332 toEng 10e-3 -> 0.010
|
||||
bas333 toSci 10e-4 -> 0.0010
|
||||
bas334 toEng 10e-4 -> 0.0010
|
||||
bas335 toSci 10e-5 -> 0.00010
|
||||
bas336 toEng 10e-5 -> 0.00010
|
||||
bas337 toSci 10e-6 -> 0.000010
|
||||
bas338 toEng 10e-6 -> 0.000010
|
||||
bas339 toSci 10e-7 -> 0.0000010
|
||||
bas340 toEng 10e-7 -> 0.0000010
|
||||
bas341 toSci 10e-8 -> 1.0E-7
|
||||
bas342 toEng 10e-8 -> 100E-9
|
||||
bas343 toSci 10e-9 -> 1.0E-8
|
||||
bas344 toEng 10e-9 -> 10E-9
|
||||
bas345 toSci 10e-10 -> 1.0E-9
|
||||
bas346 toEng 10e-10 -> 1.0E-9
|
||||
bas347 toSci 10e-11 -> 1.0E-10
|
||||
bas348 toEng 10e-11 -> 100E-12
|
||||
bas349 toSci 10e-12 -> 1.0E-11
|
||||
bas350 toEng 10e-12 -> 10E-12
|
||||
bas351 toSci 10e-13 -> 1.0E-12
|
||||
bas352 toEng 10e-13 -> 1.0E-12
|
||||
|
||||
bas361 toSci 7E12 -> 7E+12
|
||||
bas362 toEng 7E12 -> 7E+12
|
||||
bas363 toSci 7E11 -> 7E+11
|
||||
bas364 toEng 7E11 -> 700E+9
|
||||
bas365 toSci 7E10 -> 7E+10
|
||||
bas366 toEng 7E10 -> 70E+9
|
||||
bas367 toSci 7E9 -> 7E+9
|
||||
bas368 toEng 7E9 -> 7E+9
|
||||
bas369 toSci 7E8 -> 7E+8
|
||||
bas370 toEng 7E8 -> 700E+6
|
||||
bas371 toSci 7E7 -> 7E+7
|
||||
bas372 toEng 7E7 -> 70E+6
|
||||
bas373 toSci 7E6 -> 7E+6
|
||||
bas374 toEng 7E6 -> 7E+6
|
||||
bas375 toSci 7E5 -> 7E+5
|
||||
bas376 toEng 7E5 -> 700E+3
|
||||
bas377 toSci 7E4 -> 7E+4
|
||||
bas378 toEng 7E4 -> 70E+3
|
||||
bas379 toSci 7E3 -> 7E+3
|
||||
bas380 toEng 7E3 -> 7E+3
|
||||
bas381 toSci 7E2 -> 7E+2
|
||||
bas382 toEng 7E2 -> 700
|
||||
bas383 toSci 7E1 -> 7E+1
|
||||
bas384 toEng 7E1 -> 70
|
||||
bas385 toSci 7E0 -> 7
|
||||
bas386 toEng 7E0 -> 7
|
||||
bas387 toSci 7E-1 -> 0.7
|
||||
bas388 toEng 7E-1 -> 0.7
|
||||
bas389 toSci 7E-2 -> 0.07
|
||||
bas390 toEng 7E-2 -> 0.07
|
||||
bas391 toSci 7E-3 -> 0.007
|
||||
bas392 toEng 7E-3 -> 0.007
|
||||
bas393 toSci 7E-4 -> 0.0007
|
||||
bas394 toEng 7E-4 -> 0.0007
|
||||
bas395 toSci 7E-5 -> 0.00007
|
||||
bas396 toEng 7E-5 -> 0.00007
|
||||
bas397 toSci 7E-6 -> 0.000007
|
||||
bas398 toEng 7E-6 -> 0.000007
|
||||
bas399 toSci 7E-7 -> 7E-7
|
||||
bas400 toEng 7E-7 -> 700E-9
|
||||
bas401 toSci 7E-8 -> 7E-8
|
||||
bas402 toEng 7E-8 -> 70E-9
|
||||
bas403 toSci 7E-9 -> 7E-9
|
||||
bas404 toEng 7E-9 -> 7E-9
|
||||
bas405 toSci 7E-10 -> 7E-10
|
||||
bas406 toEng 7E-10 -> 700E-12
|
||||
bas407 toSci 7E-11 -> 7E-11
|
||||
bas408 toEng 7E-11 -> 70E-12
|
||||
bas409 toSci 7E-12 -> 7E-12
|
||||
bas410 toEng 7E-12 -> 7E-12
|
||||
bas411 toSci 7E-13 -> 7E-13
|
||||
bas412 toEng 7E-13 -> 700E-15
|
||||
-- Exacts remain exact within precision ..
|
||||
precision: 9
|
||||
bas420 toSci 100 -> 100
|
||||
bas421 toEng 100 -> 100
|
||||
bas422 toSci 1000 -> 1000
|
||||
bas423 toEng 1000 -> 1000
|
||||
bas424 toSci 999.9 -> 999.9
|
||||
bas425 toEng 999.9 -> 999.9
|
||||
bas426 toSci 1000.0 -> 1000.0
|
||||
bas427 toEng 1000.0 -> 1000.0
|
||||
bas428 toSci 1000.1 -> 1000.1
|
||||
bas429 toEng 1000.1 -> 1000.1
|
||||
bas430 toSci 10000 -> 10000
|
||||
bas431 toEng 10000 -> 10000
|
||||
bas432 toSci 100000 -> 100000
|
||||
bas433 toEng 100000 -> 100000
|
||||
bas434 toSci 1000000 -> 1000000
|
||||
bas435 toEng 1000000 -> 1000000
|
||||
bas436 toSci 10000000 -> 10000000
|
||||
bas437 toEng 10000000 -> 10000000
|
||||
bas438 toSci 100000000 -> 100000000
|
||||
bas439 toEng 100000000 -> 100000000
|
||||
bas440 toSci 1000000000 -> 1.00000000E+9 Rounded
|
||||
bas441 toEng 1000000000 -> 1.00000000E+9 Rounded
|
||||
bas442 toSci 10000000000 -> 1.00000000E+10 Rounded
|
||||
bas443 toEng 10000000000 -> 10.0000000E+9 Rounded
|
||||
bas444 toSci 100000000000 -> 1.00000000E+11 Rounded
|
||||
bas445 toEng 100000000000 -> 100.000000E+9 Rounded
|
||||
bas446 toSci 100000000300 -> 1.00000000E+11 Rounded Inexact
|
||||
bas447 toEng 100000000499 -> 100.000000E+9 Rounded Inexact
|
||||
bas448 toSci 100000000500 -> 1.00000001E+11 Rounded Inexact
|
||||
bas449 toEng 100000000900 -> 100.000001E+9 Rounded Inexact
|
||||
|
||||
-- The 'baddies' tests from DiagBigDecimal, plus some new ones
|
||||
bas500 toSci '1..2' -> ? Conversion_syntax
|
||||
bas501 toSci '.' -> ? Conversion_syntax
|
||||
bas502 toSci '..' -> ? Conversion_syntax
|
||||
bas503 toSci '++1' -> ? Conversion_syntax
|
||||
bas504 toSci '--1' -> ? Conversion_syntax
|
||||
bas505 toSci '-+1' -> ? Conversion_syntax
|
||||
bas506 toSci '+-1' -> ? Conversion_syntax
|
||||
bas507 toSci '12e' -> ? Conversion_syntax
|
||||
bas508 toSci '12e++' -> ? Conversion_syntax
|
||||
bas509 toSci '12f4' -> ? Conversion_syntax
|
||||
bas510 toSci ' +1' -> ? Conversion_syntax
|
||||
bas511 toSci '+ 1' -> ? Conversion_syntax
|
||||
bas512 toSci '12 ' -> ? Conversion_syntax
|
||||
bas513 toSci ' + 1' -> ? Conversion_syntax
|
||||
bas514 toSci ' - 1 ' -> ? Conversion_syntax
|
||||
bas515 toSci 'x' -> ? Conversion_syntax
|
||||
bas516 toSci '-1-' -> ? Conversion_syntax
|
||||
bas517 toSci '12-' -> ? Conversion_syntax
|
||||
bas518 toSci '3+' -> ? Conversion_syntax
|
||||
bas519 toSci '' -> ? Conversion_syntax
|
||||
bas520 toSci '1e-' -> ? Conversion_syntax
|
||||
bas521 toSci '7e99999a' -> ? Conversion_syntax
|
||||
bas522 toSci '7e123567890x' -> ? Conversion_syntax
|
||||
bas523 toSci '7e12356789012x' -> ? Conversion_syntax
|
||||
bas524 toSci '' -> ? Conversion_syntax
|
||||
bas525 toSci 'e100' -> ? Conversion_syntax
|
||||
bas526 toSci '\u0e5a' -> ? Conversion_syntax
|
||||
bas527 toSci '\u0b65' -> ? Conversion_syntax
|
||||
bas528 toSci '123,65' -> ? Conversion_syntax
|
||||
bas529 toSci '1.34.5' -> ? Conversion_syntax
|
||||
bas530 toSci '.123.5' -> ? Conversion_syntax
|
||||
bas531 toSci '01.35.' -> ? Conversion_syntax
|
||||
bas532 toSci '01.35-' -> ? Conversion_syntax
|
||||
bas533 toSci '0000..' -> ? Conversion_syntax
|
||||
bas534 toSci '.0000.' -> ? Conversion_syntax
|
||||
bas535 toSci '00..00' -> ? Conversion_syntax
|
||||
bas536 toSci '111e*123' -> ? Conversion_syntax
|
||||
bas537 toSci '111e123-' -> ? Conversion_syntax
|
||||
bas538 toSci '111e+12+' -> ? Conversion_syntax
|
||||
bas539 toSci '111e1-3-' -> ? Conversion_syntax
|
||||
bas540 toSci '111e1*23' -> ? Conversion_syntax
|
||||
bas541 toSci '111e1e+3' -> ? Conversion_syntax
|
||||
bas542 toSci '1e1.0' -> ? Conversion_syntax
|
||||
bas543 toSci '1e123e' -> ? Conversion_syntax
|
||||
bas544 toSci 'ten' -> ? Conversion_syntax
|
||||
bas545 toSci 'ONE' -> ? Conversion_syntax
|
||||
bas546 toSci '1e.1' -> ? Conversion_syntax
|
||||
bas547 toSci '1e1.' -> ? Conversion_syntax
|
||||
bas548 toSci '1ee' -> ? Conversion_syntax
|
||||
bas549 toSci 'e+1' -> ? Conversion_syntax
|
||||
bas550 toSci '1.23.4' -> ? Conversion_syntax
|
||||
bas551 toSci '1.2.1' -> ? Conversion_syntax
|
||||
bas552 toSci '1E+1.2' -> ? Conversion_syntax
|
||||
bas553 toSci '1E+1.2.3' -> ? Conversion_syntax
|
||||
bas554 toSci '1E++1' -> ? Conversion_syntax
|
||||
bas555 toSci '1E--1' -> ? Conversion_syntax
|
||||
bas556 toSci '1E+-1' -> ? Conversion_syntax
|
||||
bas557 toSci '1E-+1' -> ? Conversion_syntax
|
||||
bas558 toSci '1E''1' -> ? Conversion_syntax
|
||||
bas559 toSci "1E""1" -> ? Conversion_syntax
|
||||
bas560 toSci "1E""""" -> ? Conversion_syntax
|
||||
-- Near-specials
|
||||
bas561 toSci "qNaN" -> ? Conversion_syntax
|
||||
bas562 toSci "NaNq" -> ? Conversion_syntax
|
||||
bas563 toSci "NaNs" -> ? Conversion_syntax
|
||||
bas564 toSci "Infi" -> ? Conversion_syntax
|
||||
bas565 toSci "Infin" -> ? Conversion_syntax
|
||||
bas566 toSci "Infini" -> ? Conversion_syntax
|
||||
bas567 toSci "Infinit" -> ? Conversion_syntax
|
||||
|
||||
-- Xflows for all precisions
|
||||
bas570 toSci '99e999999999' -> ? Overflow Inexact Rounded
|
||||
bas571 toSci '999e999999999' -> ? Overflow Inexact Rounded
|
||||
bas572 toSci '0.9e-999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas573 toSci '0.09e-999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas574 toSci '0.1e1000000000' -> 1E+999999999
|
||||
bas575 toSci '10e-1000000000' -> 1.0E-999999999
|
||||
bas576 toSci '0.9e9999999999' -> ? Overflow Inexact Rounded
|
||||
bas577 toSci '99e-9999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas578 toSci '111e9999999999' -> ? Overflow Inexact Rounded
|
||||
bas579 toSci '1111e-9999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas580 toSci '1111e-99999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas581 toSci '7e1000000000' -> ? Overflow Inexact Rounded
|
||||
-- negatives the same
|
||||
bas582 toSci '-99e999999999' -> ? Overflow Inexact Rounded
|
||||
bas583 toSci '-999e999999999' -> ? Overflow Inexact Rounded
|
||||
bas584 toSci '-0.9e-999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas585 toSci '-0.09e-999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas586 toSci '-0.1e1000000000' -> -1E+999999999
|
||||
bas587 toSci '-10e-1000000000' -> -1.0E-999999999
|
||||
bas588 toSci '-0.9e9999999999' -> ? Overflow Inexact Rounded
|
||||
bas589 toSci '-99e-9999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas590 toSci '-111e9999999999' -> ? Overflow Inexact Rounded
|
||||
bas591 toSci '-1111e-9999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas592 toSci '-1111e-99999999999' -> ? Underflow Subnormal Inexact Rounded
|
||||
bas593 toSci '-7e1000000000' -> ? Overflow Inexact Rounded
|
||||
|
||||
-- Specials not allowed unless extended: 1
|
||||
bas700 toSci "Infinity" -> ? Conversion_syntax
|
||||
bas701 toSci "sNaN" -> ? Conversion_syntax
|
||||
bas702 toSci "NaN" -> ? Conversion_syntax
|
||||
bas703 toSci "-Infinity" -> ? Conversion_syntax
|
||||
bas704 toSci "-sNaN" -> ? Conversion_syntax
|
||||
bas705 toSci "-NaN" -> ? Conversion_syntax
|
||||
bas706 toSci "+Infinity" -> ? Conversion_syntax
|
||||
bas708 toSci "+sNaN" -> ? Conversion_syntax
|
||||
bas709 toSci "+NaN" -> ? Conversion_syntax
|
||||
bas710 toSci "INFINITY" -> ? Conversion_syntax
|
||||
bas711 toSci "SNAN" -> ? Conversion_syntax
|
||||
bas712 toSci "NAN" -> ? Conversion_syntax
|
||||
bas713 toSci "infinity" -> ? Conversion_syntax
|
||||
bas714 toSci "snan" -> ? Conversion_syntax
|
||||
bas715 toSci "nan" -> ? Conversion_syntax
|
||||
bas716 toSci "InFINITY" -> ? Conversion_syntax
|
||||
bas717 toSci "SnAN" -> ? Conversion_syntax
|
||||
bas718 toSci "nAN" -> ? Conversion_syntax
|
||||
bas719 toSci "iNfinity" -> ? Conversion_syntax
|
||||
bas720 toSci "sNan" -> ? Conversion_syntax
|
||||
bas721 toSci "Nan" -> ? Conversion_syntax
|
||||
|
||||
bas601 toSci 0.000000000 -> 0
|
||||
bas602 toSci 0.00000000 -> 0
|
||||
bas603 toSci 0.0000000 -> 0
|
||||
bas604 toSci 0.000000 -> 0
|
||||
bas605 toSci 0.00000 -> 0
|
||||
bas606 toSci 0.0000 -> 0
|
||||
bas607 toSci 0.000 -> 0
|
||||
bas608 toSci 0.00 -> 0
|
||||
bas609 toSci 0.0 -> 0
|
||||
bas610 toSci .0 -> 0
|
||||
bas611 toSci 0. -> 0
|
||||
bas612 toSci -.0 -> 0
|
||||
bas613 toSci -0. -> 0
|
||||
bas614 toSci -0.0 -> 0
|
||||
bas615 toSci -0.00 -> 0
|
||||
bas616 toSci -0.000 -> 0
|
||||
bas617 toSci -0.0000 -> 0
|
||||
bas618 toSci -0.00000 -> 0
|
||||
bas619 toSci -0.000000 -> 0
|
||||
bas620 toSci -0.0000000 -> 0
|
||||
bas621 toSci -0.00000000 -> 0
|
||||
bas622 toSci -0.000000000 -> 0
|
||||
|
||||
bas630 toSci 0.00E+0 -> 0
|
||||
bas631 toSci 0.00E+1 -> 0
|
||||
bas632 toSci 0.00E+2 -> 0
|
||||
bas633 toSci 0.00E+3 -> 0
|
||||
bas634 toSci 0.00E+4 -> 0
|
||||
bas635 toSci 0.00E+5 -> 0
|
||||
bas636 toSci 0.00E+6 -> 0
|
||||
bas637 toSci 0.00E+7 -> 0
|
||||
bas638 toSci 0.00E+8 -> 0
|
||||
bas639 toSci 0.00E+9 -> 0
|
||||
|
||||
bas640 toSci 0.0E+0 -> 0
|
||||
bas641 toSci 0.0E+1 -> 0
|
||||
bas642 toSci 0.0E+2 -> 0
|
||||
bas643 toSci 0.0E+3 -> 0
|
||||
bas644 toSci 0.0E+4 -> 0
|
||||
bas645 toSci 0.0E+5 -> 0
|
||||
bas646 toSci 0.0E+6 -> 0
|
||||
bas647 toSci 0.0E+7 -> 0
|
||||
bas648 toSci 0.0E+8 -> 0
|
||||
bas649 toSci 0.0E+9 -> 0
|
||||
|
||||
bas650 toSci 0E+0 -> 0
|
||||
bas651 toSci 0E+1 -> 0
|
||||
bas652 toSci 0E+2 -> 0
|
||||
bas653 toSci 0E+3 -> 0
|
||||
bas654 toSci 0E+4 -> 0
|
||||
bas655 toSci 0E+5 -> 0
|
||||
bas656 toSci 0E+6 -> 0
|
||||
bas657 toSci 0E+7 -> 0
|
||||
bas658 toSci 0E+8 -> 0
|
||||
bas659 toSci 0E+9 -> 0
|
||||
|
||||
bas660 toSci 0.0E-0 -> 0
|
||||
bas661 toSci 0.0E-1 -> 0
|
||||
bas662 toSci 0.0E-2 -> 0
|
||||
bas663 toSci 0.0E-3 -> 0
|
||||
bas664 toSci 0.0E-4 -> 0
|
||||
bas665 toSci 0.0E-5 -> 0
|
||||
bas666 toSci 0.0E-6 -> 0
|
||||
bas667 toSci 0.0E-7 -> 0
|
||||
bas668 toSci 0.0E-8 -> 0
|
||||
bas669 toSci 0.0E-9 -> 0
|
||||
|
||||
bas670 toSci 0.00E-0 -> 0
|
||||
bas671 toSci 0.00E-1 -> 0
|
||||
bas672 toSci 0.00E-2 -> 0
|
||||
bas673 toSci 0.00E-3 -> 0
|
||||
bas674 toSci 0.00E-4 -> 0
|
||||
bas675 toSci 0.00E-5 -> 0
|
||||
bas676 toSci 0.00E-6 -> 0
|
||||
bas677 toSci 0.00E-7 -> 0
|
||||
bas678 toSci 0.00E-8 -> 0
|
||||
bas679 toSci 0.00E-9 -> 0
|
||||
|
||||
-- Zeros for toEng
|
||||
bas801 toEng 0.000000000 -> 0
|
||||
bas802 toEng 0.00000000 -> 0
|
||||
bas803 toEng 0.0000000 -> 0
|
||||
bas804 toEng 0.000000 -> 0
|
||||
bas805 toEng 0.00000 -> 0
|
||||
bas806 toEng 0.0000 -> 0
|
||||
bas807 toEng 0.000 -> 0
|
||||
bas808 toEng 0.00 -> 0
|
||||
bas809 toEng 0.0 -> 0
|
||||
bas810 toEng .0 -> 0
|
||||
bas811 toEng 0. -> 0
|
||||
bas812 toEng -.0 -> 0
|
||||
bas813 toEng -0. -> 0
|
||||
bas814 toEng -0.0 -> 0
|
||||
bas815 toEng -0.00 -> 0
|
||||
bas816 toEng -0.000 -> 0
|
||||
bas817 toEng -0.0000 -> 0
|
||||
bas818 toEng -0.00000 -> 0
|
||||
bas819 toEng -0.000000 -> 0
|
||||
bas820 toEng -0.0000000 -> 0
|
||||
bas821 toEng -0.00000000 -> 0
|
||||
bas822 toEng -0.000000000 -> 0
|
||||
|
||||
bas830 toEng 0.00E+0 -> 0
|
||||
bas831 toEng 0.00E+1 -> 0
|
||||
bas832 toEng 0.00E+2 -> 0
|
||||
bas833 toEng 0.00E+3 -> 0
|
||||
bas834 toEng 0.00E+4 -> 0
|
||||
bas835 toEng 0.00E+5 -> 0
|
||||
bas836 toEng 0.00E+6 -> 0
|
||||
bas837 toEng 0.00E+7 -> 0
|
||||
bas838 toEng 0.00E+8 -> 0
|
||||
bas839 toEng 0.00E+9 -> 0
|
||||
|
||||
bas840 toEng 0.0E+0 -> 0
|
||||
bas841 toEng 0.0E+1 -> 0
|
||||
bas842 toEng 0.0E+2 -> 0
|
||||
bas843 toEng 0.0E+3 -> 0
|
||||
bas844 toEng 0.0E+4 -> 0
|
||||
bas845 toEng 0.0E+5 -> 0
|
||||
bas846 toEng 0.0E+6 -> 0
|
||||
bas847 toEng 0.0E+7 -> 0
|
||||
bas848 toEng 0.0E+8 -> 0
|
||||
bas849 toEng 0.0E+9 -> 0
|
||||
|
||||
bas850 toEng 0E+0 -> 0
|
||||
bas851 toEng 0E+1 -> 0
|
||||
bas852 toEng 0E+2 -> 0
|
||||
bas853 toEng 0E+3 -> 0
|
||||
bas854 toEng 0E+4 -> 0
|
||||
bas855 toEng 0E+5 -> 0
|
||||
bas856 toEng 0E+6 -> 0
|
||||
bas857 toEng 0E+7 -> 0
|
||||
bas858 toEng 0E+8 -> 0
|
||||
bas859 toEng 0E+9 -> 0
|
||||
|
||||
bas860 toEng 0.0E-0 -> 0
|
||||
bas861 toEng 0.0E-1 -> 0
|
||||
bas862 toEng 0.0E-2 -> 0
|
||||
bas863 toEng 0.0E-3 -> 0
|
||||
bas864 toEng 0.0E-4 -> 0
|
||||
bas865 toEng 0.0E-5 -> 0
|
||||
bas866 toEng 0.0E-6 -> 0
|
||||
bas867 toEng 0.0E-7 -> 0
|
||||
bas868 toEng 0.0E-8 -> 0
|
||||
bas869 toEng 0.0E-9 -> 0
|
||||
|
||||
bas870 toEng 0.00E-0 -> 0
|
||||
bas871 toEng 0.00E-1 -> 0
|
||||
bas872 toEng 0.00E-2 -> 0
|
||||
bas873 toEng 0.00E-3 -> 0
|
||||
bas874 toEng 0.00E-4 -> 0
|
||||
bas875 toEng 0.00E-5 -> 0
|
||||
bas876 toEng 0.00E-6 -> 0
|
||||
bas877 toEng 0.00E-7 -> 0
|
||||
bas878 toEng 0.00E-8 -> 0
|
||||
bas879 toEng 0.00E-9 -> 0
|
||||
|
||||
-- Giga exponent
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
|
||||
bas951 toSci '99e999' -> '9.9E+1000'
|
||||
bas952 toSci '999e999' -> '9.99E+1001'
|
||||
bas953 toSci '0.9e-999' -> '9E-1000'
|
||||
bas954 toSci '0.09e-999' -> '9E-1001'
|
||||
bas955 toSci '0.1e1001' -> '1E+1000'
|
||||
bas956 toSci '10e-1001' -> '1.0E-1000'
|
||||
bas957 toSci '0.9e9999' -> '9E+9998'
|
||||
bas958 toSci '99e-9999' -> '9.9E-9998'
|
||||
bas959 toSci '111e9997' -> '1.11E+9999'
|
||||
bas960 toSci '1111e-9999' -> '1.111E-9996'
|
||||
bas961 toSci '99e9999' -> '9.9E+10000'
|
||||
bas962 toSci '999e9999' -> '9.99E+10001'
|
||||
bas963 toSci '0.9e-9999' -> '9E-10000'
|
||||
bas964 toSci '0.09e-9999' -> '9E-10001'
|
||||
bas965 toSci '0.1e10001' -> '1E+10000'
|
||||
bas966 toSci '10e-10001' -> '1.0E-10000'
|
||||
bas967 toSci '0.9e99999' -> '9E+99998'
|
||||
bas968 toSci '99e-99999' -> '9.9E-99998'
|
||||
bas969 toSci '111e99999' -> '1.11E+100001'
|
||||
bas970 toSci '1111e-99999' -> '1.111E-99996'
|
||||
bas971 toSci "0.09e999999999" -> '9E+999999997'
|
||||
bas972 toSci "0.9e999999999" -> '9E+999999998'
|
||||
bas973 toSci "9e999999999" -> '9E+999999999'
|
||||
bas974 toSci "9.9e999999999" -> '9.9E+999999999'
|
||||
bas975 toSci "9.99e999999999" -> '9.99E+999999999'
|
||||
bas976 toSci "9.99e-999999999" -> '9.99E-999999999'
|
||||
bas977 toSci "9.9e-999999999" -> '9.9E-999999999'
|
||||
bas978 toSci "9e-999999999" -> '9E-999999999'
|
||||
bas979 toSci "99e-999999999" -> '9.9E-999999998'
|
||||
bas980 toSci "999e-999999999" -> '9.99E-999999997'
|
||||
|
||||
-- Varying exponent maximums
|
||||
maxexponent: 0
|
||||
minexponent: 0
|
||||
emax001 toSci -1E+2 -> ? Overflow Inexact Rounded
|
||||
emax002 toSci -100 -> ? Overflow Inexact Rounded
|
||||
emax003 toSci -10 -> ? Overflow Inexact Rounded
|
||||
emax004 toSci -9.9 -> -9.9
|
||||
emax005 toSci -9 -> -9
|
||||
emax006 toSci -1 -> -1
|
||||
emax007 toSci 0 -> 0
|
||||
emax008 toSci 1 -> 1
|
||||
emax009 toSci 9 -> 9
|
||||
emax010 toSci 9.9 -> 9.9
|
||||
emax011 toSci 10 -> ? Overflow Inexact Rounded
|
||||
emax012 toSci 100 -> ? Overflow Inexact Rounded
|
||||
emax013 toSci 1E+2 -> ? Overflow Inexact Rounded
|
||||
emax014 toSci 0.99 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax015 toSci 0.1 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax016 toSci 0.01 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax017 toSci 1E-1 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax018 toSci 1E-2 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
maxexponent: 1
|
||||
minexponent: -1
|
||||
emax100 toSci -1E+3 -> ? Overflow Inexact Rounded
|
||||
emax101 toSci -1E+2 -> ? Overflow Inexact Rounded
|
||||
emax102 toSci -100 -> ? Overflow Inexact Rounded
|
||||
emax103 toSci -10 -> -10
|
||||
emax104 toSci -9.9 -> -9.9
|
||||
emax105 toSci -9 -> -9
|
||||
emax106 toSci -1 -> -1
|
||||
emax107 toSci 0 -> 0
|
||||
emax108 toSci 1 -> 1
|
||||
emax109 toSci 9 -> 9
|
||||
emax110 toSci 9.9 -> 9.9
|
||||
emax111 toSci 10 -> 10
|
||||
emax112 toSci 100 -> ? Overflow Inexact Rounded
|
||||
emax113 toSci 1E+2 -> ? Overflow Inexact Rounded
|
||||
emax114 toSci 1E+3 -> ? Overflow Inexact Rounded
|
||||
emax115 toSci 0.99 -> 0.99
|
||||
emax116 toSci 0.1 -> 0.1
|
||||
emax117 toSci 0.01 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax118 toSci 1E-1 -> 0.1
|
||||
emax119 toSci 1E-2 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax120 toSci 1E-3 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
maxexponent: 2
|
||||
minexponent: -2
|
||||
emax200 toSci -1E+3 -> ? Overflow Inexact Rounded
|
||||
emax201 toSci -1E+2 -> -1E+2
|
||||
emax202 toSci -100 -> -100
|
||||
emax203 toSci -10 -> -10
|
||||
emax204 toSci -9.9 -> -9.9
|
||||
emax205 toSci -9 -> -9
|
||||
emax206 toSci -1 -> -1
|
||||
emax207 toSci 0 -> 0
|
||||
emax208 toSci 1 -> 1
|
||||
emax209 toSci 9 -> 9
|
||||
emax210 toSci 9.9 -> 9.9
|
||||
emax211 toSci 10 -> 10
|
||||
emax212 toSci 100 -> 100
|
||||
emax213 toSci 1E+2 -> 1E+2
|
||||
emax214 toSci 1E+3 -> ? Overflow Inexact Rounded
|
||||
emax215 toSci 0.99 -> 0.99
|
||||
emax216 toSci 0.1 -> 0.1
|
||||
emax217 toSci 0.01 -> 0.01
|
||||
emax218 toSci 0.001 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax219 toSci 1E-1 -> 0.1
|
||||
emax220 toSci 1E-2 -> 0.01
|
||||
emax221 toSci 1E-3 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
maxexponent: 7
|
||||
minexponent: -7
|
||||
emax231 toSci 1E-8 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax232 toSci 1E-7 -> 1E-7
|
||||
emax233 toSci 1E-6 -> 0.000001
|
||||
emax234 toSci 1E-5 -> 0.00001
|
||||
emax235 toSci 1E+5 -> 1E+5
|
||||
emax236 toSci 1E+6 -> 1E+6
|
||||
emax237 toSci 1E+7 -> 1E+7
|
||||
emax238 toSci 1E+8 -> ? Overflow Inexact Rounded
|
||||
|
||||
maxexponent: 9
|
||||
minexponent: -9
|
||||
emax241 toSci 1E-10 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax242 toSci 1E-9 -> 1E-9
|
||||
emax243 toSci 1E-8 -> 1E-8
|
||||
emax244 toSci 1E-7 -> 1E-7
|
||||
emax245 toSci 1E+7 -> 1E+7
|
||||
emax246 toSci 1E+8 -> 1E+8
|
||||
emax247 toSci 1E+9 -> 1E+9
|
||||
emax248 toSci 1E+10 -> ? Overflow Inexact Rounded
|
||||
|
||||
maxexponent: 10 -- boundary
|
||||
minexponent: -10
|
||||
emax251 toSci 1E-11 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax252 toSci 1E-10 -> 1E-10
|
||||
emax253 toSci 1E-9 -> 1E-9
|
||||
emax254 toSci 1E-8 -> 1E-8
|
||||
emax255 toSci 1E+8 -> 1E+8
|
||||
emax256 toSci 1E+9 -> 1E+9
|
||||
emax257 toSci 1E+10 -> 1E+10
|
||||
emax258 toSci 1E+11 -> ? Overflow Inexact Rounded
|
||||
emax261 toSci 1.00E-11 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax262 toSci 1.00E-10 -> 1.00E-10
|
||||
emax263 toSci 1.00E-9 -> 1.00E-9
|
||||
emax264 toSci 1.00E-8 -> 1.00E-8
|
||||
emax265 toSci 1.00E+8 -> 1.00E+8
|
||||
emax266 toSci 1.00E+9 -> 1.00E+9
|
||||
emax267 toSci 1.00E+10 -> 1.00E+10
|
||||
emax268 toSci 1.00E+11 -> ? Overflow Inexact Rounded
|
||||
emax271 toSci 9.99E-11 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax272 toSci 9.99E-10 -> 9.99E-10
|
||||
emax273 toSci 9.99E-9 -> 9.99E-9
|
||||
emax274 toSci 9.99E-8 -> 9.99E-8
|
||||
emax275 toSci 9.99E+8 -> 9.99E+8
|
||||
emax276 toSci 9.99E+9 -> 9.99E+9
|
||||
emax277 toSci 9.99E+10 -> 9.99E+10
|
||||
emax278 toSci 9.99E+11 -> ? Overflow Inexact Rounded
|
||||
|
||||
maxexponent: 99
|
||||
minexponent: -99
|
||||
emax281 toSci 1E-100 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax282 toSci 1E-99 -> 1E-99
|
||||
emax283 toSci 1E-98 -> 1E-98
|
||||
emax284 toSci 1E+98 -> 1E+98
|
||||
emax285 toSci 1E+99 -> 1E+99
|
||||
emax286 toSci 1E+100 -> ? Overflow Inexact Rounded
|
||||
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
emax291 toSci 1E-1000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax292 toSci 1E-999 -> 1E-999
|
||||
emax293 toSci 1E+999 -> 1E+999
|
||||
emax294 toSci 1E+1000 -> ? Overflow Inexact Rounded
|
||||
maxexponent: 9999
|
||||
minexponent: -9999
|
||||
emax301 toSci 1E-10000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax302 toSci 1E-9999 -> 1E-9999
|
||||
emax303 toSci 1E+9999 -> 1E+9999
|
||||
emax304 toSci 1E+10000 -> ? Overflow Inexact Rounded
|
||||
maxexponent: 99999
|
||||
minexponent: -99999
|
||||
emax311 toSci 1E-100000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax312 toSci 1E-99999 -> 1E-99999
|
||||
emax313 toSci 1E+99999 -> 1E+99999
|
||||
emax314 toSci 1E+100000 -> ? Overflow Inexact Rounded
|
||||
maxexponent: 999999
|
||||
minexponent: -999999
|
||||
emax321 toSci 1E-1000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax322 toSci 1E-999999 -> 1E-999999
|
||||
emax323 toSci 1E+999999 -> 1E+999999
|
||||
emax324 toSci 1E+1000000 -> ? Overflow Inexact Rounded
|
||||
maxexponent: 9999999
|
||||
minexponent: -9999999
|
||||
emax331 toSci 1E-10000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax332 toSci 1E-9999999 -> 1E-9999999
|
||||
emax333 toSci 1E+9999999 -> 1E+9999999
|
||||
emax334 toSci 1E+10000000 -> ? Overflow Inexact Rounded
|
||||
maxexponent: 99999999
|
||||
minexponent: -99999999
|
||||
emax341 toSci 1E-100000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax342 toSci 1E-99999999 -> 1E-99999999
|
||||
emax343 toSci 1E+99999999 -> 1E+99999999
|
||||
emax344 toSci 1E+100000000 -> ? Overflow Inexact Rounded
|
||||
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
emax351 toSci 1E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax352 toSci 1E-999999999 -> 1E-999999999
|
||||
emax353 toSci 1E+999999999 -> 1E+999999999
|
||||
emax354 toSci 1E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax355 toSci 1.000E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax356 toSci 1.000E-999999999 -> 1.000E-999999999
|
||||
emax357 toSci 1.000E+999999999 -> 1.000E+999999999
|
||||
emax358 toSci 1.000E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax359 toSci 1.001E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax360 toSci 1.001E-999999999 -> 1.001E-999999999
|
||||
emax361 toSci 1.001E+999999999 -> 1.001E+999999999
|
||||
emax362 toSci 1.001E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax363 toSci 9.000E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax364 toSci 9.000E-999999999 -> 9.000E-999999999
|
||||
emax365 toSci 9.000E+999999999 -> 9.000E+999999999
|
||||
emax366 toSci 9.000E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax367 toSci 9.999E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax368 toSci 9.999E-999999999 -> 9.999E-999999999
|
||||
emax369 toSci 9.999E+999999999 -> 9.999E+999999999
|
||||
emax370 toSci 9.999E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax371 toSci -1E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax372 toSci -1E-999999999 -> -1E-999999999
|
||||
emax373 toSci -1E+999999999 -> -1E+999999999
|
||||
emax374 toSci -1E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax375 toSci -1.000E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax376 toSci -1.000E-999999999 -> -1.000E-999999999
|
||||
emax377 toSci -1.000E+999999999 -> -1.000E+999999999
|
||||
emax378 toSci -1.000E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax379 toSci -1.001E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax380 toSci -1.001E-999999999 -> -1.001E-999999999
|
||||
emax381 toSci -1.001E+999999999 -> -1.001E+999999999
|
||||
emax382 toSci -1.001E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax383 toSci -9.000E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax384 toSci -9.000E-999999999 -> -9.000E-999999999
|
||||
emax385 toSci -9.000E+999999999 -> -9.000E+999999999
|
||||
emax386 toSci -9.000E+1000000000 -> ? Overflow Inexact Rounded
|
||||
emax387 toSci -9.999E-1000000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
emax388 toSci -9.999E-999999999 -> -9.999E-999999999
|
||||
emax389 toSci -9.999E+999999999 -> -9.999E+999999999
|
||||
emax390 toSci -9.999E+1000000000 -> ? Overflow Inexact Rounded
|
||||
|
||||
@@ -0,0 +1,492 @@
|
||||
------------------------------------------------------------------------
|
||||
-- compare0.decTest -- decimal comparison (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
|
||||
|
||||
-- Note that we cannot assume add/subtract tests cover paths adequately,
|
||||
-- here, because the code might be quite different (comparison cannot
|
||||
-- overflow or underflow, so actual subtractions are not necessary).
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
com001 compare -2 -2 -> 0
|
||||
com002 compare -2 -1 -> -1
|
||||
com003 compare -2 0 -> -1
|
||||
com004 compare -2 1 -> -1
|
||||
com005 compare -2 2 -> -1
|
||||
com006 compare -1 -2 -> 1
|
||||
com007 compare -1 -1 -> 0
|
||||
com008 compare -1 0 -> -1
|
||||
com009 compare -1 1 -> -1
|
||||
com010 compare -1 2 -> -1
|
||||
com011 compare 0 -2 -> 1
|
||||
com012 compare 0 -1 -> 1
|
||||
com013 compare 0 0 -> 0
|
||||
com014 compare 0 1 -> -1
|
||||
com015 compare 0 2 -> -1
|
||||
com016 compare 1 -2 -> 1
|
||||
com017 compare 1 -1 -> 1
|
||||
com018 compare 1 0 -> 1
|
||||
com019 compare 1 1 -> 0
|
||||
com020 compare 1 2 -> -1
|
||||
com021 compare 2 -2 -> 1
|
||||
com022 compare 2 -1 -> 1
|
||||
com023 compare 2 0 -> 1
|
||||
com025 compare 2 1 -> 1
|
||||
com026 compare 2 2 -> 0
|
||||
|
||||
com031 compare -20 -20 -> 0
|
||||
com032 compare -20 -10 -> -1
|
||||
com033 compare -20 00 -> -1
|
||||
com034 compare -20 10 -> -1
|
||||
com035 compare -20 20 -> -1
|
||||
com036 compare -10 -20 -> 1
|
||||
com037 compare -10 -10 -> 0
|
||||
com038 compare -10 00 -> -1
|
||||
com039 compare -10 10 -> -1
|
||||
com040 compare -10 20 -> -1
|
||||
com041 compare 00 -20 -> 1
|
||||
com042 compare 00 -10 -> 1
|
||||
com043 compare 00 00 -> 0
|
||||
com044 compare 00 10 -> -1
|
||||
com045 compare 00 20 -> -1
|
||||
com046 compare 10 -20 -> 1
|
||||
com047 compare 10 -10 -> 1
|
||||
com048 compare 10 00 -> 1
|
||||
com049 compare 10 10 -> 0
|
||||
com050 compare 10 20 -> -1
|
||||
com051 compare 20 -20 -> 1
|
||||
com052 compare 20 -10 -> 1
|
||||
com053 compare 20 00 -> 1
|
||||
com055 compare 20 10 -> 1
|
||||
com056 compare 20 20 -> 0
|
||||
|
||||
com061 compare -2.0 -2.0 -> 0
|
||||
com062 compare -2.0 -1.0 -> -1
|
||||
com063 compare -2.0 0.0 -> -1
|
||||
com064 compare -2.0 1.0 -> -1
|
||||
com065 compare -2.0 2.0 -> -1
|
||||
com066 compare -1.0 -2.0 -> 1
|
||||
com067 compare -1.0 -1.0 -> 0
|
||||
com068 compare -1.0 0.0 -> -1
|
||||
com069 compare -1.0 1.0 -> -1
|
||||
com070 compare -1.0 2.0 -> -1
|
||||
com071 compare 0.0 -2.0 -> 1
|
||||
com072 compare 0.0 -1.0 -> 1
|
||||
com073 compare 0.0 0.0 -> 0
|
||||
com074 compare 0.0 1.0 -> -1
|
||||
com075 compare 0.0 2.0 -> -1
|
||||
com076 compare 1.0 -2.0 -> 1
|
||||
com077 compare 1.0 -1.0 -> 1
|
||||
com078 compare 1.0 0.0 -> 1
|
||||
com079 compare 1.0 1.0 -> 0
|
||||
com080 compare 1.0 2.0 -> -1
|
||||
com081 compare 2.0 -2.0 -> 1
|
||||
com082 compare 2.0 -1.0 -> 1
|
||||
com083 compare 2.0 0.0 -> 1
|
||||
com085 compare 2.0 1.0 -> 1
|
||||
com086 compare 2.0 2.0 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
precision: 9
|
||||
com100 compare 7.0 7.0 -> 0
|
||||
com101 compare 7.0 7 -> 0
|
||||
com102 compare 7 7.0 -> 0
|
||||
com103 compare 7E+0 7.0 -> 0
|
||||
com104 compare 70E-1 7.0 -> 0
|
||||
com105 compare 0.7E+1 7 -> 0
|
||||
com106 compare 70E-1 7 -> 0
|
||||
com107 compare 7.0 7E+0 -> 0
|
||||
com108 compare 7.0 70E-1 -> 0
|
||||
com109 compare 7 0.7E+1 -> 0
|
||||
com110 compare 7 70E-1 -> 0
|
||||
|
||||
com120 compare 8.0 7.0 -> 1
|
||||
com121 compare 8.0 7 -> 1
|
||||
com122 compare 8 7.0 -> 1
|
||||
com123 compare 8E+0 7.0 -> 1
|
||||
com124 compare 80E-1 7.0 -> 1
|
||||
com125 compare 0.8E+1 7 -> 1
|
||||
com126 compare 80E-1 7 -> 1
|
||||
com127 compare 8.0 7E+0 -> 1
|
||||
com128 compare 8.0 70E-1 -> 1
|
||||
com129 compare 8 0.7E+1 -> 1
|
||||
com130 compare 8 70E-1 -> 1
|
||||
|
||||
com140 compare 8.0 9.0 -> -1
|
||||
com141 compare 8.0 9 -> -1
|
||||
com142 compare 8 9.0 -> -1
|
||||
com143 compare 8E+0 9.0 -> -1
|
||||
com144 compare 80E-1 9.0 -> -1
|
||||
com145 compare 0.8E+1 9 -> -1
|
||||
com146 compare 80E-1 9 -> -1
|
||||
com147 compare 8.0 9E+0 -> -1
|
||||
com148 compare 8.0 90E-1 -> -1
|
||||
com149 compare 8 0.9E+1 -> -1
|
||||
com150 compare 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
com200 compare -7.0 7.0 -> -1
|
||||
com201 compare -7.0 7 -> -1
|
||||
com202 compare -7 7.0 -> -1
|
||||
com203 compare -7E+0 7.0 -> -1
|
||||
com204 compare -70E-1 7.0 -> -1
|
||||
com205 compare -0.7E+1 7 -> -1
|
||||
com206 compare -70E-1 7 -> -1
|
||||
com207 compare -7.0 7E+0 -> -1
|
||||
com208 compare -7.0 70E-1 -> -1
|
||||
com209 compare -7 0.7E+1 -> -1
|
||||
com210 compare -7 70E-1 -> -1
|
||||
|
||||
com220 compare -8.0 7.0 -> -1
|
||||
com221 compare -8.0 7 -> -1
|
||||
com222 compare -8 7.0 -> -1
|
||||
com223 compare -8E+0 7.0 -> -1
|
||||
com224 compare -80E-1 7.0 -> -1
|
||||
com225 compare -0.8E+1 7 -> -1
|
||||
com226 compare -80E-1 7 -> -1
|
||||
com227 compare -8.0 7E+0 -> -1
|
||||
com228 compare -8.0 70E-1 -> -1
|
||||
com229 compare -8 0.7E+1 -> -1
|
||||
com230 compare -8 70E-1 -> -1
|
||||
|
||||
com240 compare -8.0 9.0 -> -1
|
||||
com241 compare -8.0 9 -> -1
|
||||
com242 compare -8 9.0 -> -1
|
||||
com243 compare -8E+0 9.0 -> -1
|
||||
com244 compare -80E-1 9.0 -> -1
|
||||
com245 compare -0.8E+1 9 -> -1
|
||||
com246 compare -80E-1 9 -> -1
|
||||
com247 compare -8.0 9E+0 -> -1
|
||||
com248 compare -8.0 90E-1 -> -1
|
||||
com249 compare -8 0.9E+1 -> -1
|
||||
com250 compare -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
com300 compare 7.0 -7.0 -> 1
|
||||
com301 compare 7.0 -7 -> 1
|
||||
com302 compare 7 -7.0 -> 1
|
||||
com303 compare 7E+0 -7.0 -> 1
|
||||
com304 compare 70E-1 -7.0 -> 1
|
||||
com305 compare .7E+1 -7 -> 1
|
||||
com306 compare 70E-1 -7 -> 1
|
||||
com307 compare 7.0 -7E+0 -> 1
|
||||
com308 compare 7.0 -70E-1 -> 1
|
||||
com309 compare 7 -.7E+1 -> 1
|
||||
com310 compare 7 -70E-1 -> 1
|
||||
|
||||
com320 compare 8.0 -7.0 -> 1
|
||||
com321 compare 8.0 -7 -> 1
|
||||
com322 compare 8 -7.0 -> 1
|
||||
com323 compare 8E+0 -7.0 -> 1
|
||||
com324 compare 80E-1 -7.0 -> 1
|
||||
com325 compare .8E+1 -7 -> 1
|
||||
com326 compare 80E-1 -7 -> 1
|
||||
com327 compare 8.0 -7E+0 -> 1
|
||||
com328 compare 8.0 -70E-1 -> 1
|
||||
com329 compare 8 -.7E+1 -> 1
|
||||
com330 compare 8 -70E-1 -> 1
|
||||
|
||||
com340 compare 8.0 -9.0 -> 1
|
||||
com341 compare 8.0 -9 -> 1
|
||||
com342 compare 8 -9.0 -> 1
|
||||
com343 compare 8E+0 -9.0 -> 1
|
||||
com344 compare 80E-1 -9.0 -> 1
|
||||
com345 compare .8E+1 -9 -> 1
|
||||
com346 compare 80E-1 -9 -> 1
|
||||
com347 compare 8.0 -9E+0 -> 1
|
||||
com348 compare 8.0 -90E-1 -> 1
|
||||
com349 compare 8 -.9E+1 -> 1
|
||||
com350 compare 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
com400 compare -7.0 -7.0 -> 0
|
||||
com401 compare -7.0 -7 -> 0
|
||||
com402 compare -7 -7.0 -> 0
|
||||
com403 compare -7E+0 -7.0 -> 0
|
||||
com404 compare -70E-1 -7.0 -> 0
|
||||
com405 compare -.7E+1 -7 -> 0
|
||||
com406 compare -70E-1 -7 -> 0
|
||||
com407 compare -7.0 -7E+0 -> 0
|
||||
com408 compare -7.0 -70E-1 -> 0
|
||||
com409 compare -7 -.7E+1 -> 0
|
||||
com410 compare -7 -70E-1 -> 0
|
||||
|
||||
com420 compare -8.0 -7.0 -> -1
|
||||
com421 compare -8.0 -7 -> -1
|
||||
com422 compare -8 -7.0 -> -1
|
||||
com423 compare -8E+0 -7.0 -> -1
|
||||
com424 compare -80E-1 -7.0 -> -1
|
||||
com425 compare -.8E+1 -7 -> -1
|
||||
com426 compare -80E-1 -7 -> -1
|
||||
com427 compare -8.0 -7E+0 -> -1
|
||||
com428 compare -8.0 -70E-1 -> -1
|
||||
com429 compare -8 -.7E+1 -> -1
|
||||
com430 compare -8 -70E-1 -> -1
|
||||
|
||||
com440 compare -8.0 -9.0 -> 1
|
||||
com441 compare -8.0 -9 -> 1
|
||||
com442 compare -8 -9.0 -> 1
|
||||
com443 compare -8E+0 -9.0 -> 1
|
||||
com444 compare -80E-1 -9.0 -> 1
|
||||
com445 compare -.8E+1 -9 -> 1
|
||||
com446 compare -80E-1 -9 -> 1
|
||||
com447 compare -8.0 -9E+0 -> 1
|
||||
com448 compare -8.0 -90E-1 -> 1
|
||||
com449 compare -8 -.9E+1 -> 1
|
||||
com450 compare -8 -90E-1 -> 1
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
com460 compare 9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
com461 compare -9.99999999E+999999999 9.99999999E+999999999 -> -1
|
||||
com462 compare 9.99999999E+999999999 -9.99999999E+999999999 -> 1
|
||||
com463 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
precision: 40
|
||||
com470 compare 123.4560000000000000E789 123.456E789 -> 0
|
||||
com471 compare 123.456000000000000E-89 123.456E-89 -> 0
|
||||
com472 compare 123.45600000000000E789 123.456E789 -> 0
|
||||
com473 compare 123.4560000000000E-89 123.456E-89 -> 0
|
||||
com474 compare 123.456000000000E789 123.456E789 -> 0
|
||||
com475 compare 123.45600000000E-89 123.456E-89 -> 0
|
||||
com476 compare 123.4560000000E789 123.456E789 -> 0
|
||||
com477 compare 123.456000000E-89 123.456E-89 -> 0
|
||||
com478 compare 123.45600000E789 123.456E789 -> 0
|
||||
com479 compare 123.4560000E-89 123.456E-89 -> 0
|
||||
com480 compare 123.456000E789 123.456E789 -> 0
|
||||
com481 compare 123.45600E-89 123.456E-89 -> 0
|
||||
com482 compare 123.4560E789 123.456E789 -> 0
|
||||
com483 compare 123.456E-89 123.456E-89 -> 0
|
||||
com484 compare 123.456E-89 123.4560000000000000E-89 -> 0
|
||||
com485 compare 123.456E789 123.456000000000000E789 -> 0
|
||||
com486 compare 123.456E-89 123.45600000000000E-89 -> 0
|
||||
com487 compare 123.456E789 123.4560000000000E789 -> 0
|
||||
com488 compare 123.456E-89 123.456000000000E-89 -> 0
|
||||
com489 compare 123.456E789 123.45600000000E789 -> 0
|
||||
com490 compare 123.456E-89 123.4560000000E-89 -> 0
|
||||
com491 compare 123.456E789 123.456000000E789 -> 0
|
||||
com492 compare 123.456E-89 123.45600000E-89 -> 0
|
||||
com493 compare 123.456E789 123.4560000E789 -> 0
|
||||
com494 compare 123.456E-89 123.456000E-89 -> 0
|
||||
com495 compare 123.456E789 123.45600E789 -> 0
|
||||
com496 compare 123.456E-89 123.4560E-89 -> 0
|
||||
com497 compare 123.456E789 123.456E789 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
precision: 9
|
||||
com500 compare 1 1E-15 -> 1
|
||||
com501 compare 1 1E-14 -> 1
|
||||
com502 compare 1 1E-13 -> 1
|
||||
com503 compare 1 1E-12 -> 1
|
||||
com504 compare 1 1E-11 -> 1
|
||||
com505 compare 1 1E-10 -> 1
|
||||
com506 compare 1 1E-9 -> 1
|
||||
com507 compare 1 1E-8 -> 1
|
||||
com508 compare 1 1E-7 -> 1
|
||||
com509 compare 1 1E-6 -> 1
|
||||
com510 compare 1 1E-5 -> 1
|
||||
com511 compare 1 1E-4 -> 1
|
||||
com512 compare 1 1E-3 -> 1
|
||||
com513 compare 1 1E-2 -> 1
|
||||
com514 compare 1 1E-1 -> 1
|
||||
com515 compare 1 1E-0 -> 0
|
||||
com516 compare 1 1E+1 -> -1
|
||||
com517 compare 1 1E+2 -> -1
|
||||
com518 compare 1 1E+3 -> -1
|
||||
com519 compare 1 1E+4 -> -1
|
||||
com521 compare 1 1E+5 -> -1
|
||||
com522 compare 1 1E+6 -> -1
|
||||
com523 compare 1 1E+7 -> -1
|
||||
com524 compare 1 1E+8 -> -1
|
||||
com525 compare 1 1E+9 -> -1
|
||||
com526 compare 1 1E+10 -> -1
|
||||
com527 compare 1 1E+11 -> -1
|
||||
com528 compare 1 1E+12 -> -1
|
||||
com529 compare 1 1E+13 -> -1
|
||||
com530 compare 1 1E+14 -> -1
|
||||
com531 compare 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
com540 compare 1E-15 1 -> -1
|
||||
com541 compare 1E-14 1 -> -1
|
||||
com542 compare 1E-13 1 -> -1
|
||||
com543 compare 1E-12 1 -> -1
|
||||
com544 compare 1E-11 1 -> -1
|
||||
com545 compare 1E-10 1 -> -1
|
||||
com546 compare 1E-9 1 -> -1
|
||||
com547 compare 1E-8 1 -> -1
|
||||
com548 compare 1E-7 1 -> -1
|
||||
com549 compare 1E-6 1 -> -1
|
||||
com550 compare 1E-5 1 -> -1
|
||||
com551 compare 1E-4 1 -> -1
|
||||
com552 compare 1E-3 1 -> -1
|
||||
com553 compare 1E-2 1 -> -1
|
||||
com554 compare 1E-1 1 -> -1
|
||||
com555 compare 1E-0 1 -> 0
|
||||
com556 compare 1E+1 1 -> 1
|
||||
com557 compare 1E+2 1 -> 1
|
||||
com558 compare 1E+3 1 -> 1
|
||||
com559 compare 1E+4 1 -> 1
|
||||
com561 compare 1E+5 1 -> 1
|
||||
com562 compare 1E+6 1 -> 1
|
||||
com563 compare 1E+7 1 -> 1
|
||||
com564 compare 1E+8 1 -> 1
|
||||
com565 compare 1E+9 1 -> 1
|
||||
com566 compare 1E+10 1 -> 1
|
||||
com567 compare 1E+11 1 -> 1
|
||||
com568 compare 1E+12 1 -> 1
|
||||
com569 compare 1E+13 1 -> 1
|
||||
com570 compare 1E+14 1 -> 1
|
||||
com571 compare 1E+15 1 -> 1
|
||||
-- similar with an useful coefficient, one side only
|
||||
com580 compare 0.000000987654321 1E-15 -> 1
|
||||
com581 compare 0.000000987654321 1E-14 -> 1
|
||||
com582 compare 0.000000987654321 1E-13 -> 1
|
||||
com583 compare 0.000000987654321 1E-12 -> 1
|
||||
com584 compare 0.000000987654321 1E-11 -> 1
|
||||
com585 compare 0.000000987654321 1E-10 -> 1
|
||||
com586 compare 0.000000987654321 1E-9 -> 1
|
||||
com587 compare 0.000000987654321 1E-8 -> 1
|
||||
com588 compare 0.000000987654321 1E-7 -> 1
|
||||
com589 compare 0.000000987654321 1E-6 -> -1
|
||||
com590 compare 0.000000987654321 1E-5 -> -1
|
||||
com591 compare 0.000000987654321 1E-4 -> -1
|
||||
com592 compare 0.000000987654321 1E-3 -> -1
|
||||
com593 compare 0.000000987654321 1E-2 -> -1
|
||||
com594 compare 0.000000987654321 1E-1 -> -1
|
||||
com595 compare 0.000000987654321 1E-0 -> -1
|
||||
com596 compare 0.000000987654321 1E+1 -> -1
|
||||
com597 compare 0.000000987654321 1E+2 -> -1
|
||||
com598 compare 0.000000987654321 1E+3 -> -1
|
||||
com599 compare 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
precision: 20
|
||||
com600 compare 12 12.2345 -> -1
|
||||
com601 compare 12.0 12.2345 -> -1
|
||||
com602 compare 12.00 12.2345 -> -1
|
||||
com603 compare 12.000 12.2345 -> -1
|
||||
com604 compare 12.0000 12.2345 -> -1
|
||||
com605 compare 12.00000 12.2345 -> -1
|
||||
com606 compare 12.000000 12.2345 -> -1
|
||||
com607 compare 12.0000000 12.2345 -> -1
|
||||
com608 compare 12.00000000 12.2345 -> -1
|
||||
com609 compare 12.000000000 12.2345 -> -1
|
||||
com610 compare 12.1234 12 -> 1
|
||||
com611 compare 12.1234 12.0 -> 1
|
||||
com612 compare 12.1234 12.00 -> 1
|
||||
com613 compare 12.1234 12.000 -> 1
|
||||
com614 compare 12.1234 12.0000 -> 1
|
||||
com615 compare 12.1234 12.00000 -> 1
|
||||
com616 compare 12.1234 12.000000 -> 1
|
||||
com617 compare 12.1234 12.0000000 -> 1
|
||||
com618 compare 12.1234 12.00000000 -> 1
|
||||
com619 compare 12.1234 12.000000000 -> 1
|
||||
com620 compare -12 -12.2345 -> 1
|
||||
com621 compare -12.0 -12.2345 -> 1
|
||||
com622 compare -12.00 -12.2345 -> 1
|
||||
com623 compare -12.000 -12.2345 -> 1
|
||||
com624 compare -12.0000 -12.2345 -> 1
|
||||
com625 compare -12.00000 -12.2345 -> 1
|
||||
com626 compare -12.000000 -12.2345 -> 1
|
||||
com627 compare -12.0000000 -12.2345 -> 1
|
||||
com628 compare -12.00000000 -12.2345 -> 1
|
||||
com629 compare -12.000000000 -12.2345 -> 1
|
||||
com630 compare -12.1234 -12 -> -1
|
||||
com631 compare -12.1234 -12.0 -> -1
|
||||
com632 compare -12.1234 -12.00 -> -1
|
||||
com633 compare -12.1234 -12.000 -> -1
|
||||
com634 compare -12.1234 -12.0000 -> -1
|
||||
com635 compare -12.1234 -12.00000 -> -1
|
||||
com636 compare -12.1234 -12.000000 -> -1
|
||||
com637 compare -12.1234 -12.0000000 -> -1
|
||||
com638 compare -12.1234 -12.00000000 -> -1
|
||||
com639 compare -12.1234 -12.000000000 -> -1
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
precision: 20
|
||||
com680 compare 12 12 -> 0
|
||||
com681 compare 12 12.0 -> 0
|
||||
com682 compare 12 12.00 -> 0
|
||||
com683 compare 12 12.000 -> 0
|
||||
com684 compare 12 12.0000 -> 0
|
||||
com685 compare 12 12.00000 -> 0
|
||||
com686 compare 12 12.000000 -> 0
|
||||
com687 compare 12 12.0000000 -> 0
|
||||
com688 compare 12 12.00000000 -> 0
|
||||
com689 compare 12 12.000000000 -> 0
|
||||
com690 compare 12 12 -> 0
|
||||
com691 compare 12.0 12 -> 0
|
||||
com692 compare 12.00 12 -> 0
|
||||
com693 compare 12.000 12 -> 0
|
||||
com694 compare 12.0000 12 -> 0
|
||||
com695 compare 12.00000 12 -> 0
|
||||
com696 compare 12.000000 12 -> 0
|
||||
com697 compare 12.0000000 12 -> 0
|
||||
com698 compare 12.00000000 12 -> 0
|
||||
com699 compare 12.000000000 12 -> 0
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
com701 compare 12345678000 1 -> 1 Rounded
|
||||
com702 compare 1 12345678000 -> -1 Rounded
|
||||
com703 compare 1234567800 1 -> 1 Rounded
|
||||
com704 compare 1 1234567800 -> -1 Rounded
|
||||
com705 compare 1234567890 1 -> 1 Rounded
|
||||
com706 compare 1 1234567890 -> -1 Rounded
|
||||
com707 compare 1234567891 1 -> 1 Inexact Lost_digits Rounded
|
||||
com708 compare 1 1234567891 -> -1 Inexact Lost_digits Rounded
|
||||
com709 compare 12345678901 1 -> 1 Inexact Lost_digits Rounded
|
||||
com710 compare 1 12345678901 -> -1 Inexact Lost_digits Rounded
|
||||
com711 compare 1234567896 1 -> 1 Inexact Lost_digits Rounded
|
||||
com712 compare 1 1234567896 -> -1 Inexact Lost_digits Rounded
|
||||
com713 compare -1234567891 1 -> -1 Inexact Lost_digits Rounded
|
||||
com714 compare 1 -1234567891 -> 1 Inexact Lost_digits Rounded
|
||||
com715 compare -12345678901 1 -> -1 Inexact Lost_digits Rounded
|
||||
com716 compare 1 -12345678901 -> 1 Inexact Lost_digits Rounded
|
||||
com717 compare -1234567896 1 -> -1 Inexact Lost_digits Rounded
|
||||
com718 compare 1 -1234567896 -> 1 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
com741 compare 12345678000 1 -> 1
|
||||
com742 compare 1 12345678000 -> -1
|
||||
com743 compare 1234567800 1 -> 1
|
||||
com744 compare 1 1234567800 -> -1
|
||||
com745 compare 1234567890 1 -> 1
|
||||
com746 compare 1 1234567890 -> -1
|
||||
com747 compare 1234567891 1 -> 1
|
||||
com748 compare 1 1234567891 -> -1
|
||||
com749 compare 12345678901 1 -> 1
|
||||
com750 compare 1 12345678901 -> -1
|
||||
com751 compare 1234567896 1 -> 1
|
||||
com752 compare 1 1234567896 -> -1
|
||||
|
||||
-- Null tests
|
||||
com900 compare 10 # -> ? Invalid_operation
|
||||
com901 compare # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,547 @@
|
||||
------------------------------------------------------------------------
|
||||
-- comparetotal0.decTest -- decimal comparison using total ordering --
|
||||
-- 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
|
||||
|
||||
-- Note that we cannot assume add/subtract tests cover paths adequately,
|
||||
-- here, because the code might be quite different (comparison cannot
|
||||
-- overflow or underflow, so actual subtractions are not necessary).
|
||||
-- Similarly, comparetotal will have some radically different paths
|
||||
-- than compare.
|
||||
|
||||
extended: 0
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
|
||||
-- sanity checks
|
||||
cot001 comparetotal -2 -2 -> 0
|
||||
cot002 comparetotal -2 -1 -> -1
|
||||
cot003 comparetotal -2 0 -> -1
|
||||
cot004 comparetotal -2 1 -> -1
|
||||
cot005 comparetotal -2 2 -> -1
|
||||
cot006 comparetotal -1 -2 -> 1
|
||||
cot007 comparetotal -1 -1 -> 0
|
||||
cot008 comparetotal -1 0 -> -1
|
||||
cot009 comparetotal -1 1 -> -1
|
||||
cot010 comparetotal -1 2 -> -1
|
||||
cot011 comparetotal 0 -2 -> 1
|
||||
cot012 comparetotal 0 -1 -> 1
|
||||
cot013 comparetotal 0 0 -> 0
|
||||
cot014 comparetotal 0 1 -> -1
|
||||
cot015 comparetotal 0 2 -> -1
|
||||
cot016 comparetotal 1 -2 -> 1
|
||||
cot017 comparetotal 1 -1 -> 1
|
||||
cot018 comparetotal 1 0 -> 1
|
||||
cot019 comparetotal 1 1 -> 0
|
||||
cot020 comparetotal 1 2 -> -1
|
||||
cot021 comparetotal 2 -2 -> 1
|
||||
cot022 comparetotal 2 -1 -> 1
|
||||
cot023 comparetotal 2 0 -> 1
|
||||
cot025 comparetotal 2 1 -> 1
|
||||
cot026 comparetotal 2 2 -> 0
|
||||
|
||||
cot031 comparetotal -20 -20 -> 0
|
||||
cot032 comparetotal -20 -10 -> -1
|
||||
cot033 comparetotal -20 00 -> -1
|
||||
cot034 comparetotal -20 10 -> -1
|
||||
cot035 comparetotal -20 20 -> -1
|
||||
cot036 comparetotal -10 -20 -> 1
|
||||
cot037 comparetotal -10 -10 -> 0
|
||||
cot038 comparetotal -10 00 -> -1
|
||||
cot039 comparetotal -10 10 -> -1
|
||||
cot040 comparetotal -10 20 -> -1
|
||||
cot041 comparetotal 00 -20 -> 1
|
||||
cot042 comparetotal 00 -10 -> 1
|
||||
cot043 comparetotal 00 00 -> 0
|
||||
cot044 comparetotal 00 10 -> -1
|
||||
cot045 comparetotal 00 20 -> -1
|
||||
cot046 comparetotal 10 -20 -> 1
|
||||
cot047 comparetotal 10 -10 -> 1
|
||||
cot048 comparetotal 10 00 -> 1
|
||||
cot049 comparetotal 10 10 -> 0
|
||||
cot050 comparetotal 10 20 -> -1
|
||||
cot051 comparetotal 20 -20 -> 1
|
||||
cot052 comparetotal 20 -10 -> 1
|
||||
cot053 comparetotal 20 00 -> 1
|
||||
cot055 comparetotal 20 10 -> 1
|
||||
cot056 comparetotal 20 20 -> 0
|
||||
|
||||
cot061 comparetotal -2.0 -2.0 -> 0
|
||||
cot062 comparetotal -2.0 -1.0 -> -1
|
||||
cot063 comparetotal -2.0 0.0 -> -1
|
||||
cot064 comparetotal -2.0 1.0 -> -1
|
||||
cot065 comparetotal -2.0 2.0 -> -1
|
||||
cot066 comparetotal -1.0 -2.0 -> 1
|
||||
cot067 comparetotal -1.0 -1.0 -> 0
|
||||
cot068 comparetotal -1.0 0.0 -> -1
|
||||
cot069 comparetotal -1.0 1.0 -> -1
|
||||
cot070 comparetotal -1.0 2.0 -> -1
|
||||
cot071 comparetotal 0.0 -2.0 -> 1
|
||||
cot072 comparetotal 0.0 -1.0 -> 1
|
||||
cot073 comparetotal 0.0 0.0 -> 0
|
||||
cot074 comparetotal 0.0 1.0 -> -1
|
||||
cot075 comparetotal 0.0 2.0 -> -1
|
||||
cot076 comparetotal 1.0 -2.0 -> 1
|
||||
cot077 comparetotal 1.0 -1.0 -> 1
|
||||
cot078 comparetotal 1.0 0.0 -> 1
|
||||
cot079 comparetotal 1.0 1.0 -> 0
|
||||
cot080 comparetotal 1.0 2.0 -> -1
|
||||
cot081 comparetotal 2.0 -2.0 -> 1
|
||||
cot082 comparetotal 2.0 -1.0 -> 1
|
||||
cot083 comparetotal 2.0 0.0 -> 1
|
||||
cot085 comparetotal 2.0 1.0 -> 1
|
||||
cot086 comparetotal 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
cot090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
cot091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
|
||||
cot092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
|
||||
cot093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
-- in this first group, compare would compare all equal
|
||||
cot100 comparetotal 7.0 7.0 -> 0
|
||||
cot101 comparetotal 7.0 7 -> -1
|
||||
cot102 comparetotal 7 7.0 -> 1
|
||||
cot103 comparetotal 7E+0 7.0 -> 1
|
||||
cot104 comparetotal 70E-1 7.0 -> 0
|
||||
cot105 comparetotal 0.7E+1 7 -> 0
|
||||
cot106 comparetotal 70E-1 7 -> -1
|
||||
cot107 comparetotal 7.0 7E+0 -> -1
|
||||
cot108 comparetotal 7.0 70E-1 -> 0
|
||||
cot109 comparetotal 7 0.7E+1 -> 0
|
||||
cot110 comparetotal 7 70E-1 -> 1
|
||||
|
||||
cot120 comparetotal 8.0 7.0 -> 1
|
||||
cot121 comparetotal 8.0 7 -> 1
|
||||
cot122 comparetotal 8 7.0 -> 1
|
||||
cot123 comparetotal 8E+0 7.0 -> 1
|
||||
cot124 comparetotal 80E-1 7.0 -> 1
|
||||
cot125 comparetotal 0.8E+1 7 -> 1
|
||||
cot126 comparetotal 80E-1 7 -> 1
|
||||
cot127 comparetotal 8.0 7E+0 -> 1
|
||||
cot128 comparetotal 8.0 70E-1 -> 1
|
||||
cot129 comparetotal 8 0.7E+1 -> 1
|
||||
cot130 comparetotal 8 70E-1 -> 1
|
||||
|
||||
cot140 comparetotal 8.0 9.0 -> -1
|
||||
cot141 comparetotal 8.0 9 -> -1
|
||||
cot142 comparetotal 8 9.0 -> -1
|
||||
cot143 comparetotal 8E+0 9.0 -> -1
|
||||
cot144 comparetotal 80E-1 9.0 -> -1
|
||||
cot145 comparetotal 0.8E+1 9 -> -1
|
||||
cot146 comparetotal 80E-1 9 -> -1
|
||||
cot147 comparetotal 8.0 9E+0 -> -1
|
||||
cot148 comparetotal 8.0 90E-1 -> -1
|
||||
cot149 comparetotal 8 0.9E+1 -> -1
|
||||
cot150 comparetotal 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
cot200 comparetotal -7.0 7.0 -> -1
|
||||
cot201 comparetotal -7.0 7 -> -1
|
||||
cot202 comparetotal -7 7.0 -> -1
|
||||
cot203 comparetotal -7E+0 7.0 -> -1
|
||||
cot204 comparetotal -70E-1 7.0 -> -1
|
||||
cot205 comparetotal -0.7E+1 7 -> -1
|
||||
cot206 comparetotal -70E-1 7 -> -1
|
||||
cot207 comparetotal -7.0 7E+0 -> -1
|
||||
cot208 comparetotal -7.0 70E-1 -> -1
|
||||
cot209 comparetotal -7 0.7E+1 -> -1
|
||||
cot210 comparetotal -7 70E-1 -> -1
|
||||
|
||||
cot220 comparetotal -8.0 7.0 -> -1
|
||||
cot221 comparetotal -8.0 7 -> -1
|
||||
cot222 comparetotal -8 7.0 -> -1
|
||||
cot223 comparetotal -8E+0 7.0 -> -1
|
||||
cot224 comparetotal -80E-1 7.0 -> -1
|
||||
cot225 comparetotal -0.8E+1 7 -> -1
|
||||
cot226 comparetotal -80E-1 7 -> -1
|
||||
cot227 comparetotal -8.0 7E+0 -> -1
|
||||
cot228 comparetotal -8.0 70E-1 -> -1
|
||||
cot229 comparetotal -8 0.7E+1 -> -1
|
||||
cot230 comparetotal -8 70E-1 -> -1
|
||||
|
||||
cot240 comparetotal -8.0 9.0 -> -1
|
||||
cot241 comparetotal -8.0 9 -> -1
|
||||
cot242 comparetotal -8 9.0 -> -1
|
||||
cot243 comparetotal -8E+0 9.0 -> -1
|
||||
cot244 comparetotal -80E-1 9.0 -> -1
|
||||
cot245 comparetotal -0.8E+1 9 -> -1
|
||||
cot246 comparetotal -80E-1 9 -> -1
|
||||
cot247 comparetotal -8.0 9E+0 -> -1
|
||||
cot248 comparetotal -8.0 90E-1 -> -1
|
||||
cot249 comparetotal -8 0.9E+1 -> -1
|
||||
cot250 comparetotal -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
cot300 comparetotal 7.0 -7.0 -> 1
|
||||
cot301 comparetotal 7.0 -7 -> 1
|
||||
cot302 comparetotal 7 -7.0 -> 1
|
||||
cot303 comparetotal 7E+0 -7.0 -> 1
|
||||
cot304 comparetotal 70E-1 -7.0 -> 1
|
||||
cot305 comparetotal .7E+1 -7 -> 1
|
||||
cot306 comparetotal 70E-1 -7 -> 1
|
||||
cot307 comparetotal 7.0 -7E+0 -> 1
|
||||
cot308 comparetotal 7.0 -70E-1 -> 1
|
||||
cot309 comparetotal 7 -.7E+1 -> 1
|
||||
cot310 comparetotal 7 -70E-1 -> 1
|
||||
|
||||
cot320 comparetotal 8.0 -7.0 -> 1
|
||||
cot321 comparetotal 8.0 -7 -> 1
|
||||
cot322 comparetotal 8 -7.0 -> 1
|
||||
cot323 comparetotal 8E+0 -7.0 -> 1
|
||||
cot324 comparetotal 80E-1 -7.0 -> 1
|
||||
cot325 comparetotal .8E+1 -7 -> 1
|
||||
cot326 comparetotal 80E-1 -7 -> 1
|
||||
cot327 comparetotal 8.0 -7E+0 -> 1
|
||||
cot328 comparetotal 8.0 -70E-1 -> 1
|
||||
cot329 comparetotal 8 -.7E+1 -> 1
|
||||
cot330 comparetotal 8 -70E-1 -> 1
|
||||
|
||||
cot340 comparetotal 8.0 -9.0 -> 1
|
||||
cot341 comparetotal 8.0 -9 -> 1
|
||||
cot342 comparetotal 8 -9.0 -> 1
|
||||
cot343 comparetotal 8E+0 -9.0 -> 1
|
||||
cot344 comparetotal 80E-1 -9.0 -> 1
|
||||
cot345 comparetotal .8E+1 -9 -> 1
|
||||
cot346 comparetotal 80E-1 -9 -> 1
|
||||
cot347 comparetotal 8.0 -9E+0 -> 1
|
||||
cot348 comparetotal 8.0 -90E-1 -> 1
|
||||
cot349 comparetotal 8 -.9E+1 -> 1
|
||||
cot350 comparetotal 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
cot400 comparetotal -7.0 -7.0 -> 0
|
||||
cot401 comparetotal -7.0 -7 -> 1
|
||||
cot402 comparetotal -7 -7.0 -> -1
|
||||
cot403 comparetotal -7E+0 -7.0 -> -1
|
||||
cot404 comparetotal -70E-1 -7.0 -> 0
|
||||
cot405 comparetotal -.7E+1 -7 -> 0
|
||||
cot406 comparetotal -70E-1 -7 -> 1
|
||||
cot407 comparetotal -7.0 -7E+0 -> 1
|
||||
cot408 comparetotal -7.0 -70E-1 -> 0
|
||||
cot409 comparetotal -7 -.7E+1 -> 0
|
||||
cot410 comparetotal -7 -70E-1 -> -1
|
||||
|
||||
cot420 comparetotal -8.0 -7.0 -> -1
|
||||
cot421 comparetotal -8.0 -7 -> -1
|
||||
cot422 comparetotal -8 -7.0 -> -1
|
||||
cot423 comparetotal -8E+0 -7.0 -> -1
|
||||
cot424 comparetotal -80E-1 -7.0 -> -1
|
||||
cot425 comparetotal -.8E+1 -7 -> -1
|
||||
cot426 comparetotal -80E-1 -7 -> -1
|
||||
cot427 comparetotal -8.0 -7E+0 -> -1
|
||||
cot428 comparetotal -8.0 -70E-1 -> -1
|
||||
cot429 comparetotal -8 -.7E+1 -> -1
|
||||
cot430 comparetotal -8 -70E-1 -> -1
|
||||
|
||||
cot440 comparetotal -8.0 -9.0 -> 1
|
||||
cot441 comparetotal -8.0 -9 -> 1
|
||||
cot442 comparetotal -8 -9.0 -> 1
|
||||
cot443 comparetotal -8E+0 -9.0 -> 1
|
||||
cot444 comparetotal -80E-1 -9.0 -> 1
|
||||
cot445 comparetotal -.8E+1 -9 -> 1
|
||||
cot446 comparetotal -80E-1 -9 -> 1
|
||||
cot447 comparetotal -8.0 -9E+0 -> 1
|
||||
cot448 comparetotal -8.0 -90E-1 -> 1
|
||||
cot449 comparetotal -8 -.9E+1 -> 1
|
||||
cot450 comparetotal -8 -90E-1 -> 1
|
||||
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
precision: 40
|
||||
cot470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
|
||||
cot471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
|
||||
cot472 comparetotal 123.45600000000000E789 123.456E789 -> -1
|
||||
cot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
|
||||
cot474 comparetotal 123.456000000000E789 123.456E789 -> -1
|
||||
cot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
|
||||
cot476 comparetotal 123.4560000000E789 123.456E789 -> -1
|
||||
cot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
|
||||
cot478 comparetotal 123.45600000E789 123.456E789 -> -1
|
||||
cot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
|
||||
cot480 comparetotal 123.456000E789 123.456E789 -> -1
|
||||
cot481 comparetotal 123.45600E-89 123.456E-89 -> -1
|
||||
cot482 comparetotal 123.4560E789 123.456E789 -> -1
|
||||
cot483 comparetotal 123.456E-89 123.456E-89 -> 0
|
||||
cot484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
|
||||
cot485 comparetotal 123.456E789 123.456000000000000E789 -> 1
|
||||
cot486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
|
||||
cot487 comparetotal 123.456E789 123.4560000000000E789 -> 1
|
||||
cot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
|
||||
cot489 comparetotal 123.456E789 123.45600000000E789 -> 1
|
||||
cot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
|
||||
cot491 comparetotal 123.456E789 123.456000000E789 -> 1
|
||||
cot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
|
||||
cot493 comparetotal 123.456E789 123.4560000E789 -> 1
|
||||
cot494 comparetotal 123.456E-89 123.456000E-89 -> 1
|
||||
cot495 comparetotal 123.456E789 123.45600E789 -> 1
|
||||
cot496 comparetotal 123.456E-89 123.4560E-89 -> 1
|
||||
cot497 comparetotal 123.456E789 123.456E789 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
precision: 9
|
||||
cot500 comparetotal 1 1E-15 -> 1
|
||||
cot501 comparetotal 1 1E-14 -> 1
|
||||
cot502 comparetotal 1 1E-13 -> 1
|
||||
cot503 comparetotal 1 1E-12 -> 1
|
||||
cot504 comparetotal 1 1E-11 -> 1
|
||||
cot505 comparetotal 1 1E-10 -> 1
|
||||
cot506 comparetotal 1 1E-9 -> 1
|
||||
cot507 comparetotal 1 1E-8 -> 1
|
||||
cot508 comparetotal 1 1E-7 -> 1
|
||||
cot509 comparetotal 1 1E-6 -> 1
|
||||
cot510 comparetotal 1 1E-5 -> 1
|
||||
cot511 comparetotal 1 1E-4 -> 1
|
||||
cot512 comparetotal 1 1E-3 -> 1
|
||||
cot513 comparetotal 1 1E-2 -> 1
|
||||
cot514 comparetotal 1 1E-1 -> 1
|
||||
cot515 comparetotal 1 1E-0 -> 0
|
||||
cot516 comparetotal 1 1E+1 -> -1
|
||||
cot517 comparetotal 1 1E+2 -> -1
|
||||
cot518 comparetotal 1 1E+3 -> -1
|
||||
cot519 comparetotal 1 1E+4 -> -1
|
||||
cot521 comparetotal 1 1E+5 -> -1
|
||||
cot522 comparetotal 1 1E+6 -> -1
|
||||
cot523 comparetotal 1 1E+7 -> -1
|
||||
cot524 comparetotal 1 1E+8 -> -1
|
||||
cot525 comparetotal 1 1E+9 -> -1
|
||||
cot526 comparetotal 1 1E+10 -> -1
|
||||
cot527 comparetotal 1 1E+11 -> -1
|
||||
cot528 comparetotal 1 1E+12 -> -1
|
||||
cot529 comparetotal 1 1E+13 -> -1
|
||||
cot530 comparetotal 1 1E+14 -> -1
|
||||
cot531 comparetotal 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
cot540 comparetotal 1E-15 1 -> -1
|
||||
cot541 comparetotal 1E-14 1 -> -1
|
||||
cot542 comparetotal 1E-13 1 -> -1
|
||||
cot543 comparetotal 1E-12 1 -> -1
|
||||
cot544 comparetotal 1E-11 1 -> -1
|
||||
cot545 comparetotal 1E-10 1 -> -1
|
||||
cot546 comparetotal 1E-9 1 -> -1
|
||||
cot547 comparetotal 1E-8 1 -> -1
|
||||
cot548 comparetotal 1E-7 1 -> -1
|
||||
cot549 comparetotal 1E-6 1 -> -1
|
||||
cot550 comparetotal 1E-5 1 -> -1
|
||||
cot551 comparetotal 1E-4 1 -> -1
|
||||
cot552 comparetotal 1E-3 1 -> -1
|
||||
cot553 comparetotal 1E-2 1 -> -1
|
||||
cot554 comparetotal 1E-1 1 -> -1
|
||||
cot555 comparetotal 1E-0 1 -> 0
|
||||
cot556 comparetotal 1E+1 1 -> 1
|
||||
cot557 comparetotal 1E+2 1 -> 1
|
||||
cot558 comparetotal 1E+3 1 -> 1
|
||||
cot559 comparetotal 1E+4 1 -> 1
|
||||
cot561 comparetotal 1E+5 1 -> 1
|
||||
cot562 comparetotal 1E+6 1 -> 1
|
||||
cot563 comparetotal 1E+7 1 -> 1
|
||||
cot564 comparetotal 1E+8 1 -> 1
|
||||
cot565 comparetotal 1E+9 1 -> 1
|
||||
cot566 comparetotal 1E+10 1 -> 1
|
||||
cot567 comparetotal 1E+11 1 -> 1
|
||||
cot568 comparetotal 1E+12 1 -> 1
|
||||
cot569 comparetotal 1E+13 1 -> 1
|
||||
cot570 comparetotal 1E+14 1 -> 1
|
||||
cot571 comparetotal 1E+15 1 -> 1
|
||||
-- similar with an useful coefficient, one side only
|
||||
cot580 comparetotal 0.000000987654321 1E-15 -> 1
|
||||
cot581 comparetotal 0.000000987654321 1E-14 -> 1
|
||||
cot582 comparetotal 0.000000987654321 1E-13 -> 1
|
||||
cot583 comparetotal 0.000000987654321 1E-12 -> 1
|
||||
cot584 comparetotal 0.000000987654321 1E-11 -> 1
|
||||
cot585 comparetotal 0.000000987654321 1E-10 -> 1
|
||||
cot586 comparetotal 0.000000987654321 1E-9 -> 1
|
||||
cot587 comparetotal 0.000000987654321 1E-8 -> 1
|
||||
cot588 comparetotal 0.000000987654321 1E-7 -> 1
|
||||
cot589 comparetotal 0.000000987654321 1E-6 -> -1
|
||||
cot590 comparetotal 0.000000987654321 1E-5 -> -1
|
||||
cot591 comparetotal 0.000000987654321 1E-4 -> -1
|
||||
cot592 comparetotal 0.000000987654321 1E-3 -> -1
|
||||
cot593 comparetotal 0.000000987654321 1E-2 -> -1
|
||||
cot594 comparetotal 0.000000987654321 1E-1 -> -1
|
||||
cot595 comparetotal 0.000000987654321 1E-0 -> -1
|
||||
cot596 comparetotal 0.000000987654321 1E+1 -> -1
|
||||
cot597 comparetotal 0.000000987654321 1E+2 -> -1
|
||||
cot598 comparetotal 0.000000987654321 1E+3 -> -1
|
||||
cot599 comparetotal 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
precision: 20
|
||||
cot600 comparetotal 12 12.2345 -> -1
|
||||
cot601 comparetotal 12.0 12.2345 -> -1
|
||||
cot602 comparetotal 12.00 12.2345 -> -1
|
||||
cot603 comparetotal 12.000 12.2345 -> -1
|
||||
cot604 comparetotal 12.0000 12.2345 -> -1
|
||||
cot605 comparetotal 12.00000 12.2345 -> -1
|
||||
cot606 comparetotal 12.000000 12.2345 -> -1
|
||||
cot607 comparetotal 12.0000000 12.2345 -> -1
|
||||
cot608 comparetotal 12.00000000 12.2345 -> -1
|
||||
cot609 comparetotal 12.000000000 12.2345 -> -1
|
||||
cot610 comparetotal 12.1234 12 -> 1
|
||||
cot611 comparetotal 12.1234 12.0 -> 1
|
||||
cot612 comparetotal 12.1234 12.00 -> 1
|
||||
cot613 comparetotal 12.1234 12.000 -> 1
|
||||
cot614 comparetotal 12.1234 12.0000 -> 1
|
||||
cot615 comparetotal 12.1234 12.00000 -> 1
|
||||
cot616 comparetotal 12.1234 12.000000 -> 1
|
||||
cot617 comparetotal 12.1234 12.0000000 -> 1
|
||||
cot618 comparetotal 12.1234 12.00000000 -> 1
|
||||
cot619 comparetotal 12.1234 12.000000000 -> 1
|
||||
cot620 comparetotal -12 -12.2345 -> 1
|
||||
cot621 comparetotal -12.0 -12.2345 -> 1
|
||||
cot622 comparetotal -12.00 -12.2345 -> 1
|
||||
cot623 comparetotal -12.000 -12.2345 -> 1
|
||||
cot624 comparetotal -12.0000 -12.2345 -> 1
|
||||
cot625 comparetotal -12.00000 -12.2345 -> 1
|
||||
cot626 comparetotal -12.000000 -12.2345 -> 1
|
||||
cot627 comparetotal -12.0000000 -12.2345 -> 1
|
||||
cot628 comparetotal -12.00000000 -12.2345 -> 1
|
||||
cot629 comparetotal -12.000000000 -12.2345 -> 1
|
||||
cot630 comparetotal -12.1234 -12 -> -1
|
||||
cot631 comparetotal -12.1234 -12.0 -> -1
|
||||
cot632 comparetotal -12.1234 -12.00 -> -1
|
||||
cot633 comparetotal -12.1234 -12.000 -> -1
|
||||
cot634 comparetotal -12.1234 -12.0000 -> -1
|
||||
cot635 comparetotal -12.1234 -12.00000 -> -1
|
||||
cot636 comparetotal -12.1234 -12.000000 -> -1
|
||||
cot637 comparetotal -12.1234 -12.0000000 -> -1
|
||||
cot638 comparetotal -12.1234 -12.00000000 -> -1
|
||||
cot639 comparetotal -12.1234 -12.000000000 -> -1
|
||||
precision: 9
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
precision: 20
|
||||
cot680 comparetotal 12 12 -> 0
|
||||
cot681 comparetotal 12 12.0 -> 1
|
||||
cot682 comparetotal 12 12.00 -> 1
|
||||
cot683 comparetotal 12 12.000 -> 1
|
||||
cot684 comparetotal 12 12.0000 -> 1
|
||||
cot685 comparetotal 12 12.00000 -> 1
|
||||
cot686 comparetotal 12 12.000000 -> 1
|
||||
cot687 comparetotal 12 12.0000000 -> 1
|
||||
cot688 comparetotal 12 12.00000000 -> 1
|
||||
cot689 comparetotal 12 12.000000000 -> 1
|
||||
cot690 comparetotal 12 12 -> 0
|
||||
cot691 comparetotal 12.0 12 -> -1
|
||||
cot692 comparetotal 12.00 12 -> -1
|
||||
cot693 comparetotal 12.000 12 -> -1
|
||||
cot694 comparetotal 12.0000 12 -> -1
|
||||
cot695 comparetotal 12.00000 12 -> -1
|
||||
cot696 comparetotal 12.000000 12 -> -1
|
||||
cot697 comparetotal 12.0000000 12 -> -1
|
||||
cot698 comparetotal 12.00000000 12 -> -1
|
||||
cot699 comparetotal 12.000000000 12 -> -1
|
||||
|
||||
-- long operand checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
cot701 comparetotal 12345678000 1 -> 1 Rounded
|
||||
cot702 comparetotal 1 12345678000 -> -1 Rounded
|
||||
cot703 comparetotal 1234567800 1 -> 1 Rounded
|
||||
cot704 comparetotal 1 1234567800 -> -1 Rounded
|
||||
cot705 comparetotal 1234567890 1 -> 1 Rounded
|
||||
cot706 comparetotal 1 1234567890 -> -1 Rounded
|
||||
cot707 comparetotal 1234567891 1 -> 1 Rounded Inexact Lost_digits
|
||||
cot708 comparetotal 1 1234567891 -> -1 Rounded Inexact Lost_digits
|
||||
cot709 comparetotal 12345678901 1 -> 1 Rounded Inexact Lost_digits
|
||||
cot710 comparetotal 1 12345678901 -> -1 Rounded Inexact Lost_digits
|
||||
cot711 comparetotal 1234567896 1 -> 1 Rounded Inexact Lost_digits
|
||||
cot712 comparetotal 1 1234567896 -> -1 Rounded Inexact Lost_digits
|
||||
cot713 comparetotal -1234567891 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot714 comparetotal 1 -1234567891 -> 1 Rounded Inexact Lost_digits
|
||||
cot715 comparetotal -12345678901 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot716 comparetotal 1 -12345678901 -> 1 Rounded Inexact Lost_digits
|
||||
cot717 comparetotal -1234567896 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot718 comparetotal 1 -1234567896 -> 1 Rounded Inexact Lost_digits
|
||||
|
||||
precision: 15
|
||||
-- same with plenty of precision
|
||||
cot721 comparetotal 12345678000 1 -> 1
|
||||
cot722 comparetotal 1 12345678000 -> -1
|
||||
cot723 comparetotal 1234567800 1 -> 1
|
||||
cot724 comparetotal 1 1234567800 -> -1
|
||||
cot725 comparetotal 1234567890 1 -> 1
|
||||
cot726 comparetotal 1 1234567890 -> -1
|
||||
cot727 comparetotal 1234567891 1 -> 1
|
||||
cot728 comparetotal 1 1234567891 -> -1
|
||||
cot729 comparetotal 12345678901 1 -> 1
|
||||
cot730 comparetotal 1 12345678901 -> -1
|
||||
cot731 comparetotal 1234567896 1 -> 1
|
||||
cot732 comparetotal 1 1234567896 -> -1
|
||||
|
||||
-- residue cases (NB operands rounded on input)
|
||||
precision: 5
|
||||
cot740 comparetotal 1 0.9999999 -> 1 Rounded Inexact Lost_digits
|
||||
cot741 comparetotal 1 0.999999 -> 1 Rounded Inexact Lost_digits
|
||||
cot742 comparetotal 1 0.99999 -> 1
|
||||
cot743 comparetotal 1 1.0000 -> 1
|
||||
cot744 comparetotal 1 1.00001 -> 1 Rounded Inexact Lost_digits
|
||||
cot745 comparetotal 1 1.000001 -> 1 Rounded Inexact Lost_digits
|
||||
cot746 comparetotal 1 1.0000001 -> 1 Rounded Inexact Lost_digits
|
||||
cot750 comparetotal 0.9999999 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot751 comparetotal 0.999999 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot752 comparetotal 0.99999 1 -> -1
|
||||
cot753 comparetotal 1.0000 1 -> -1
|
||||
cot754 comparetotal 1.00001 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot755 comparetotal 1.000001 1 -> -1 Rounded Inexact Lost_digits
|
||||
cot756 comparetotal 1.0000001 1 -> -1 Rounded Inexact Lost_digits
|
||||
|
||||
-- overflow and underflow tests .. subnormal results now allowed
|
||||
maxExponent: 999999999
|
||||
minexponent: -999999999
|
||||
cot1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1 Rounded Inexact Lost_digits
|
||||
cot1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1 Rounded Inexact Lost_digits
|
||||
cot1082 comparetotal +0.100 9E-999999999 -> 1
|
||||
cot1083 comparetotal 9E-999999999 +0.100 -> -1
|
||||
cot1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1 Rounded Inexact Lost_digits
|
||||
cot1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1 Rounded Inexact Lost_digits
|
||||
cot1087 comparetotal -0.100 9E-999999999 -> -1
|
||||
cot1088 comparetotal 9E-999999999 -0.100 -> 1
|
||||
|
||||
cot1089 comparetotal 1e-599999999 1e-400000001 -> -1
|
||||
cot1090 comparetotal 1e-599999999 1e-400000000 -> -1
|
||||
cot1091 comparetotal 1e-600000000 1e-400000000 -> -1
|
||||
cot1092 comparetotal 9e-999999998 0.01 -> -1
|
||||
cot1093 comparetotal 9e-999999998 0.1 -> -1
|
||||
cot1094 comparetotal 0.01 9e-999999998 -> 1
|
||||
cot1095 comparetotal 1e599999999 1e400000001 -> 1
|
||||
cot1096 comparetotal 1e599999999 1e400000000 -> 1
|
||||
cot1097 comparetotal 1e600000000 1e400000000 -> 1
|
||||
cot1098 comparetotal 9e999999998 100 -> 1
|
||||
cot1099 comparetotal 9e999999998 10 -> 1
|
||||
cot1100 comparetotal 100 9e999999998 -> -1
|
||||
-- signs
|
||||
cot1101 comparetotal 1e+777777777 1e+411111111 -> 1
|
||||
cot1102 comparetotal 1e+777777777 -1e+411111111 -> 1
|
||||
cot1103 comparetotal -1e+777777777 1e+411111111 -> -1
|
||||
cot1104 comparetotal -1e+777777777 -1e+411111111 -> -1
|
||||
cot1105 comparetotal 1e-777777777 1e-411111111 -> -1
|
||||
cot1106 comparetotal 1e-777777777 -1e-411111111 -> 1
|
||||
cot1107 comparetotal -1e-777777777 1e-411111111 -> -1
|
||||
cot1108 comparetotal -1e-777777777 -1e-411111111 -> 1
|
||||
|
||||
-- Null tests
|
||||
cot9990 comparetotal 10 # -> ? Invalid_operation
|
||||
cot9991 comparetotal # 10 -> ? Invalid_operation
|
||||
@@ -0,0 +1,258 @@
|
||||
------------------------------------------------------------------------
|
||||
-- divide0.decTest -- decimal 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
|
||||
|
||||
div001 divide 1 1 -> 1
|
||||
div002 divide 2 1 -> 2
|
||||
div003 divide 1 2 -> 0.5
|
||||
div004 divide 2 2 -> 1
|
||||
div005 divide 0 1 -> 0
|
||||
div006 divide 0 2 -> 0
|
||||
div007 divide 1 3 -> 0.333333333 Inexact Rounded
|
||||
div008 divide 2 3 -> 0.666666667 Inexact Rounded
|
||||
div009 divide 3 3 -> 1
|
||||
|
||||
div010 divide 2.4 1 -> 2.4
|
||||
div011 divide 2.4 -1 -> -2.4
|
||||
div012 divide -2.4 1 -> -2.4
|
||||
div013 divide -2.4 -1 -> 2.4
|
||||
div014 divide 2.40 1 -> 2.4
|
||||
div015 divide 2.400 1 -> 2.4
|
||||
div016 divide 2.4 2 -> 1.2
|
||||
div017 divide 2.400 2 -> 1.2
|
||||
div018 divide 2. 2 -> 1
|
||||
div019 divide 20 20 -> 1
|
||||
|
||||
div020 divide 187 187 -> 1
|
||||
div021 divide 5 2 -> 2.5
|
||||
div022 divide 5 2.0 -> 2.5
|
||||
div023 divide 5 2.000 -> 2.5
|
||||
div024 divide 5 0.200 -> 25
|
||||
div025 divide 5 0.200 -> 25
|
||||
div026 divide 10 1 -> 10
|
||||
div027 divide 100 1 -> 100
|
||||
div028 divide 1000 1 -> 1000
|
||||
div029 divide 1000 100 -> 10
|
||||
|
||||
div030 divide 1 2 -> 0.5
|
||||
div031 divide 1 4 -> 0.25
|
||||
div032 divide 1 8 -> 0.125
|
||||
div033 divide 1 16 -> 0.0625
|
||||
div034 divide 1 32 -> 0.03125
|
||||
div035 divide 1 64 -> 0.015625
|
||||
div040 divide 1 -2 -> -0.5
|
||||
div041 divide 1 -4 -> -0.25
|
||||
div042 divide 1 -8 -> -0.125
|
||||
div043 divide 1 -16 -> -0.0625
|
||||
div044 divide 1 -32 -> -0.03125
|
||||
div045 divide 1 -64 -> -0.015625
|
||||
div050 divide -1 2 -> -0.5
|
||||
div051 divide -1 4 -> -0.25
|
||||
div052 divide -1 8 -> -0.125
|
||||
div053 divide -1 16 -> -0.0625
|
||||
div054 divide -1 32 -> -0.03125
|
||||
div055 divide -1 64 -> -0.015625
|
||||
div060 divide -1 -2 -> 0.5
|
||||
div061 divide -1 -4 -> 0.25
|
||||
div062 divide -1 -8 -> 0.125
|
||||
div063 divide -1 -16 -> 0.0625
|
||||
div064 divide -1 -32 -> 0.03125
|
||||
div065 divide -1 -64 -> 0.015625
|
||||
|
||||
div070 divide 999999999 1 -> 999999999
|
||||
div071 divide 999999999.4 1 -> 999999999 Inexact Lost_digits Rounded
|
||||
div072 divide 999999999.5 1 -> 1E+9 Inexact Lost_digits Rounded
|
||||
div073 divide 999999999.9 1 -> 1E+9 Inexact Lost_digits Rounded
|
||||
div074 divide 999999999.999 1 -> 1E+9 Inexact Lost_digits Rounded
|
||||
precision: 6
|
||||
div080 divide 999999999 1 -> 1E+9 Inexact Lost_digits Rounded
|
||||
div081 divide 99999999 1 -> 1E+8 Inexact Lost_digits Rounded
|
||||
div082 divide 9999999 1 -> 1E+7 Inexact Lost_digits Rounded
|
||||
div083 divide 999999 1 -> 999999
|
||||
div084 divide 99999 1 -> 99999
|
||||
div085 divide 9999 1 -> 9999
|
||||
div086 divide 999 1 -> 999
|
||||
div087 divide 99 1 -> 99
|
||||
div088 divide 9 1 -> 9
|
||||
|
||||
precision: 9
|
||||
div090 divide 0. 1 -> 0
|
||||
div091 divide .0 1 -> 0
|
||||
div092 divide 0.00 1 -> 0
|
||||
div093 divide 0.00E+9 1 -> 0
|
||||
div094 divide 0.0000E-50 1 -> 0
|
||||
|
||||
div095 divide 1 1E-8 -> 100000000
|
||||
div096 divide 1 1E-9 -> 1E+9
|
||||
div097 divide 1 1E-10 -> 1E+10
|
||||
div098 divide 1 1E-11 -> 1E+11
|
||||
div099 divide 1 1E-12 -> 1E+12
|
||||
|
||||
div100 divide 1 1 -> 1
|
||||
div101 divide 1 2 -> 0.5
|
||||
div102 divide 1 3 -> 0.333333333 Inexact Rounded
|
||||
div103 divide 1 4 -> 0.25
|
||||
div104 divide 1 5 -> 0.2
|
||||
div105 divide 1 6 -> 0.166666667 Inexact Rounded
|
||||
div106 divide 1 7 -> 0.142857143 Inexact Rounded
|
||||
div107 divide 1 8 -> 0.125
|
||||
div108 divide 1 9 -> 0.111111111 Inexact Rounded
|
||||
div109 divide 1 10 -> 0.1
|
||||
div110 divide 1 1 -> 1
|
||||
div111 divide 2 1 -> 2
|
||||
div112 divide 3 1 -> 3
|
||||
div113 divide 4 1 -> 4
|
||||
div114 divide 5 1 -> 5
|
||||
div115 divide 6 1 -> 6
|
||||
div116 divide 7 1 -> 7
|
||||
div117 divide 8 1 -> 8
|
||||
div118 divide 9 1 -> 9
|
||||
div119 divide 10 1 -> 10
|
||||
|
||||
div130 divide 12345 4.999 -> 2469.4939 Inexact Rounded
|
||||
div131 divide 12345 4.99 -> 2473.9479 Inexact Rounded
|
||||
div132 divide 12345 4.9 -> 2519.38776 Inexact Rounded
|
||||
div133 divide 12345 5 -> 2469
|
||||
div134 divide 12345 5.1 -> 2420.58824 Inexact Rounded
|
||||
div135 divide 12345 5.01 -> 2464.07186 Inexact Rounded
|
||||
div136 divide 12345 5.001 -> 2468.5063 Inexact Rounded
|
||||
|
||||
-- Various flavours of divide by 0
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
div201 divide 0 0 -> ? Division_undefined
|
||||
div202 divide 0.0E5 0 -> ? Division_undefined
|
||||
div203 divide 0.000 0 -> ? Division_undefined
|
||||
div204 divide 0.0001 0 -> ? Division_by_zero
|
||||
div205 divide 0.01 0 -> ? Division_by_zero
|
||||
div206 divide 0.1 0 -> ? Division_by_zero
|
||||
div207 divide 1 0 -> ? Division_by_zero
|
||||
div208 divide 1 0.0 -> ? Division_by_zero
|
||||
div209 divide 10 0.0 -> ? Division_by_zero
|
||||
div210 divide 1E+100 0.0 -> ? Division_by_zero
|
||||
div211 divide 1E+1000 0 -> ? Division_by_zero
|
||||
|
||||
-- test possibly imprecise results
|
||||
div220 divide 391 597 -> 0.654941374 Inexact Rounded
|
||||
div221 divide 391 -597 -> -0.654941374 Inexact Rounded
|
||||
div222 divide -391 597 -> -0.654941374 Inexact Rounded
|
||||
div223 divide -391 -597 -> 0.654941374 Inexact Rounded
|
||||
|
||||
-- test some cases that are close to exponent overflow
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
div270 divide 1 1e999999999 -> 1E-999999999
|
||||
div271 divide 1 0.9e999999999 -> 1.11111111E-999999999 Inexact Rounded
|
||||
div272 divide 1 0.99e999999999 -> 1.01010101E-999999999 Inexact Rounded
|
||||
div273 divide 1 0.999999999e999999999 -> 1E-999999999 Inexact Rounded
|
||||
div274 divide 9e999999999 1 -> 9E+999999999
|
||||
div275 divide 9.9e999999999 1 -> 9.9E+999999999
|
||||
div276 divide 9.99e999999999 1 -> 9.99E+999999999
|
||||
div277 divide 9.99999999e999999999 1 -> 9.99999999E+999999999
|
||||
|
||||
div280 divide 0.1 9e-999999999 -> 1.11111111E+999999997 Inexact Rounded
|
||||
div281 divide 0.1 99e-999999999 -> 1.01010101E+999999996 Inexact Rounded
|
||||
div282 divide 0.1 999e-999999999 -> 1.001001E+999999995 Inexact Rounded
|
||||
|
||||
div283 divide 0.1 9e-999999998 -> 1.11111111E+999999996 Inexact Rounded
|
||||
div284 divide 0.1 99e-999999998 -> 1.01010101E+999999995 Inexact Rounded
|
||||
div285 divide 0.1 999e-999999998 -> 1.001001E+999999994 Inexact Rounded
|
||||
div286 divide 0.1 999e-999999997 -> 1.001001E+999999993 Inexact Rounded
|
||||
div287 divide 0.1 9999e-999999997 -> 1.00010001E+999999992 Inexact Rounded
|
||||
div288 divide 0.1 99999e-999999997 -> 1.00001E+999999991 Inexact Rounded
|
||||
|
||||
-- overflow and underflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
div330 divide +1.23456789012345E-0 9E+999999999 -> ? Inexact Lost_digits Rounded Underflow Subnormal
|
||||
div331 divide 9E+999999999 +0.23456789012345E-0 -> ? Inexact Lost_digits Overflow Rounded
|
||||
div332 divide +0.100 9E+999999999 -> ? Inexact Rounded Underflow Subnormal
|
||||
div333 divide 9E-999999999 +9.100 -> ? Inexact Rounded Underflow Subnormal
|
||||
div335 divide -1.23456789012345E-0 9E+999999999 -> ? Inexact Lost_digits Rounded Underflow Subnormal
|
||||
div336 divide 9E+999999999 -0.83456789012345E-0 -> ? Inexact Lost_digits Overflow Rounded
|
||||
div337 divide -0.100 9E+999999999 -> ? Inexact Rounded Underflow Subnormal
|
||||
div338 divide 9E-999999999 -9.100 -> ? Inexact Rounded Underflow Subnormal
|
||||
|
||||
-- 'subnormal' results (all underflow or overflow in base arithemtic)
|
||||
div360 divide 1e-600000000 1e+400000001 -> ? Underflow Subnormal Inexact Rounded
|
||||
div361 divide 1e-600000000 1e+400000002 -> ? Underflow Subnormal Inexact Rounded
|
||||
div362 divide 1e-600000000 1e+400000003 -> ? Underflow Subnormal Inexact Rounded
|
||||
div363 divide 1e-600000000 1e+400000004 -> ? Underflow Subnormal Inexact Rounded
|
||||
div364 divide 1e-600000000 1e+400000005 -> ? Underflow Subnormal Inexact Rounded
|
||||
div365 divide 1e-600000000 1e+400000006 -> ? Underflow Subnormal Inexact Rounded
|
||||
div366 divide 1e-600000000 1e+400000007 -> ? Underflow Subnormal Inexact Rounded
|
||||
div367 divide 1e-600000000 1e+400000008 -> ? Underflow Subnormal Inexact Rounded
|
||||
div368 divide 1e-600000000 1e+400000009 -> ? Underflow Subnormal Inexact Rounded
|
||||
div369 divide 1e-600000000 1e+400000010 -> ? Underflow Subnormal Inexact Rounded
|
||||
-- [no equivalent of 'subnormal' for overflow]
|
||||
div370 divide 1e+600000000 1e-400000001 -> ? Overflow Inexact Rounded
|
||||
div371 divide 1e+600000000 1e-400000002 -> ? Overflow Inexact Rounded
|
||||
div372 divide 1e+600000000 1e-400000003 -> ? Overflow Inexact Rounded
|
||||
div373 divide 1e+600000000 1e-400000004 -> ? Overflow Inexact Rounded
|
||||
div374 divide 1e+600000000 1e-400000005 -> ? Overflow Inexact Rounded
|
||||
div375 divide 1e+600000000 1e-400000006 -> ? Overflow Inexact Rounded
|
||||
div376 divide 1e+600000000 1e-400000007 -> ? Overflow Inexact Rounded
|
||||
div377 divide 1e+600000000 1e-400000008 -> ? Overflow Inexact Rounded
|
||||
div378 divide 1e+600000000 1e-400000009 -> ? Overflow Inexact Rounded
|
||||
div379 divide 1e+600000000 1e-400000010 -> ? Overflow Inexact Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
div401 divide 12345678000 1 -> 1.2345678E+10 Rounded
|
||||
div402 divide 1 12345678000 -> 8.10000066E-11 Inexact Rounded
|
||||
div403 divide 1234567800 1 -> 1.2345678E+9 Rounded
|
||||
div404 divide 1 1234567800 -> 8.10000066E-10 Inexact Rounded
|
||||
div405 divide 1234567890 1 -> 1.23456789E+9 Rounded
|
||||
div406 divide 1 1234567890 -> 8.10000007E-10 Inexact Rounded
|
||||
div407 divide 1234567891 1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
div408 divide 1 1234567891 -> 8.10000007E-10 Inexact Lost_digits Rounded
|
||||
div409 divide 12345678901 1 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
div410 divide 1 12345678901 -> 8.10000007E-11 Inexact Lost_digits Rounded
|
||||
div411 divide 1234567896 1 -> 1.2345679E+9 Inexact Lost_digits Rounded
|
||||
div412 divide 1 1234567896 -> 8.10000001E-10 Inexact Lost_digits Rounded
|
||||
-- previous case different (8.10000003E-10) if no input rounding
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
div441 divide 12345678000 1 -> 12345678000
|
||||
div442 divide 1 12345678000 -> 8.10000066420005E-11 Inexact Rounded
|
||||
div443 divide 1234567800 1 -> 1234567800
|
||||
div444 divide 1 1234567800 -> 8.10000066420005E-10 Inexact Rounded
|
||||
div445 divide 1234567890 1 -> 1234567890
|
||||
div446 divide 1 1234567890 -> 8.10000007371E-10 Inexact Rounded
|
||||
div447 divide 1234567891 1 -> 1234567891
|
||||
div448 divide 1 1234567891 -> 8.100000067149E-10 Inexact Rounded
|
||||
div449 divide 12345678901 1 -> 12345678901
|
||||
div450 divide 1 12345678901 -> 8.1000000730539E-11 Inexact Rounded
|
||||
div451 divide 1234567896 1 -> 1234567896
|
||||
div452 divide 1 1234567896 -> 8.100000034344E-10 Inexact Rounded
|
||||
|
||||
-- Null tests
|
||||
div900 divide 10 # -> ? Invalid_operation
|
||||
div901 divide # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
------------------------------------------------------------------------
|
||||
-- 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
|
||||
|
||||
@@ -0,0 +1,491 @@
|
||||
------------------------------------------------------------------------
|
||||
-- exp0.decTest -- decimal natural exponentiation (subset) --
|
||||
-- Copyright (c) IBM Corporation, 2005, 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
|
||||
|
||||
-- Tests of the exponential funtion. Currently all testcases here
|
||||
-- show results which are correctly rounded (within <= 0.5 ulp).
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minexponent: -383
|
||||
|
||||
-- basics
|
||||
exp002 exp -1 -> 0.367879441 Inexact Rounded
|
||||
exp003 exp 0 -> 1
|
||||
exp004 exp 1 -> 2.71828183 Inexact Rounded
|
||||
|
||||
-- tiny edge cases
|
||||
precision: 7
|
||||
exp021 exp 0.1 -> 1.105171 Inexact Rounded
|
||||
exp022 exp 0.01 -> 1.010050 Inexact Rounded
|
||||
exp023 exp 0.00001 -> 1.000010 Inexact Rounded
|
||||
exp024 exp 0.000001 -> 1.000001 Inexact Rounded
|
||||
exp025 exp 0.0000001 -> 1.000000 Inexact Rounded
|
||||
exp026 exp 0.0000003 -> 1.000000 Inexact Rounded
|
||||
exp027 exp 0.0000004 -> 1.000000 Inexact Rounded
|
||||
exp028 exp 0.0000005 -> 1.000001 Inexact Rounded
|
||||
exp029 exp 0.0000008 -> 1.000001 Inexact Rounded
|
||||
exp030 exp 0.0000009 -> 1.000001 Inexact Rounded
|
||||
exp031 exp 0.0000010 -> 1.000001 Inexact Rounded
|
||||
exp032 exp 0.0000011 -> 1.000001 Inexact Rounded
|
||||
exp033 exp 0.00000009 -> 1.000000 Inexact Rounded
|
||||
exp034 exp 0.00000005 -> 1.000000 Inexact Rounded
|
||||
exp035 exp 0.00000004 -> 1.000000 Inexact Rounded
|
||||
exp036 exp 0.00000001 -> 1.000000 Inexact Rounded
|
||||
|
||||
-- and some more zeros
|
||||
exp037 exp 0.00000000 -> 1
|
||||
exp038 exp 0E+100 -> 1
|
||||
exp039 exp 0E-100 -> 1
|
||||
|
||||
-- basic e=0, e=1, e=2, e=4, e>=8 cases
|
||||
precision: 7
|
||||
exp041 exp 1 -> 2.718282 Inexact Rounded
|
||||
exp042 exp -1 -> 0.3678794 Inexact Rounded
|
||||
exp043 exp 10 -> 22026.47 Inexact Rounded
|
||||
exp044 exp -10 -> 0.00004539993 Inexact Rounded
|
||||
exp045 exp 100 -> 2.688117E+43 Inexact Rounded
|
||||
exp046 exp -100 -> 3.720076E-44 Inexact Rounded
|
||||
exp047 exp 1000 -> ? Overflow Inexact Rounded
|
||||
exp048 exp -1000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
exp049 exp 100000000 -> ? Overflow Inexact Rounded
|
||||
exp050 exp -100000000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
|
||||
|
||||
-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences
|
||||
precision: 50
|
||||
exp101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
|
||||
precision: 31
|
||||
exp102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded
|
||||
precision: 30
|
||||
exp103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded
|
||||
precision: 29
|
||||
exp104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded
|
||||
precision: 28
|
||||
exp105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded
|
||||
precision: 27
|
||||
exp106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded
|
||||
precision: 26
|
||||
exp107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded
|
||||
precision: 25
|
||||
exp108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded
|
||||
precision: 24
|
||||
exp109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded
|
||||
precision: 23
|
||||
exp110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded
|
||||
precision: 22
|
||||
exp111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded
|
||||
precision: 21
|
||||
exp112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded
|
||||
precision: 20
|
||||
exp113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded
|
||||
precision: 19
|
||||
exp114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded
|
||||
precision: 18
|
||||
exp115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded
|
||||
precision: 17
|
||||
exp116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded
|
||||
precision: 16
|
||||
exp117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded
|
||||
precision: 15
|
||||
exp118 exp -9E-8 -> 0.999999910000004 Inexact Rounded
|
||||
precision: 14
|
||||
exp119 exp -9E-8 -> 0.99999991000000 Inexact Rounded
|
||||
precision: 13
|
||||
exp120 exp -9E-8 -> 0.9999999100000 Inexact Rounded
|
||||
precision: 12
|
||||
exp121 exp -9E-8 -> 0.999999910000 Inexact Rounded
|
||||
precision: 11
|
||||
exp122 exp -9E-8 -> 0.99999991000 Inexact Rounded
|
||||
precision: 10
|
||||
exp123 exp -9E-8 -> 0.9999999100 Inexact Rounded
|
||||
precision: 9
|
||||
exp124 exp -9E-8 -> 0.999999910 Inexact Rounded
|
||||
precision: 8
|
||||
exp125 exp -9E-8 -> 0.99999991 Inexact Rounded
|
||||
precision: 7
|
||||
exp126 exp -9E-8 -> 0.9999999 Inexact Rounded
|
||||
precision: 6
|
||||
exp127 exp -9E-8 -> 1.00000 Inexact Rounded
|
||||
precision: 5
|
||||
exp128 exp -9E-8 -> 1.0000 Inexact Rounded
|
||||
precision: 4
|
||||
exp129 exp -9E-8 -> 1.000 Inexact Rounded
|
||||
precision: 3
|
||||
exp130 exp -9E-8 -> 1.00 Inexact Rounded
|
||||
precision: 2
|
||||
exp131 exp -9E-8 -> 1.0 Inexact Rounded
|
||||
precision: 1
|
||||
exp132 exp -9E-8 -> 1 Inexact Rounded
|
||||
|
||||
|
||||
-- sanity checks, with iteration counts [normalized so 0<=|x|<1]
|
||||
precision: 50
|
||||
|
||||
exp210 exp 0 -> 1
|
||||
-- iterations: 2
|
||||
exp211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded
|
||||
-- iterations: 8
|
||||
exp212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded
|
||||
-- iterations: 6
|
||||
exp213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
|
||||
-- iterations: 15
|
||||
exp214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded
|
||||
-- iterations: 14
|
||||
exp215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded
|
||||
-- iterations: 39
|
||||
exp217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded
|
||||
-- iterations: 41
|
||||
exp218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded
|
||||
-- iterations: 43
|
||||
exp219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded
|
||||
-- iterations: 27
|
||||
exp222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded
|
||||
-- iterations: 28
|
||||
exp223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded
|
||||
-- iterations: 30
|
||||
exp224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded
|
||||
-- iterations: 36
|
||||
exp225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded
|
||||
-- iterations: 28
|
||||
exp227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded
|
||||
-- iterations: 29
|
||||
exp228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded
|
||||
-- iterations: 30
|
||||
exp233 exp 0 -> 1
|
||||
-- iterations: 2
|
||||
exp234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded
|
||||
-- iterations: 7
|
||||
exp235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded
|
||||
-- iterations: 6
|
||||
exp236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded
|
||||
-- iterations: 15
|
||||
exp237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded
|
||||
-- iterations: 13
|
||||
exp238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded
|
||||
-- iterations: 25
|
||||
exp239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded
|
||||
-- iterations: 38
|
||||
exp240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded
|
||||
-- iterations: 41
|
||||
exp241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded
|
||||
-- iterations: 42
|
||||
exp242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded
|
||||
-- iterations: 28
|
||||
exp246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded
|
||||
-- iterations: 29
|
||||
exp247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded
|
||||
-- iterations: 36
|
||||
exp248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded
|
||||
-- iterations: 26
|
||||
exp249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded
|
||||
-- iterations: 28
|
||||
exp250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded
|
||||
-- iterations: 28
|
||||
exp251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded
|
||||
-- iterations: 29
|
||||
|
||||
-- 0<-x<<1 effects
|
||||
precision: 30
|
||||
exp320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded
|
||||
exp321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded
|
||||
exp322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded
|
||||
precision: 20
|
||||
exp323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded
|
||||
exp324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded
|
||||
exp325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded
|
||||
precision: 14
|
||||
exp326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded
|
||||
exp327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded
|
||||
exp328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded
|
||||
|
||||
-- 0<x<<1 effects
|
||||
precision: 30
|
||||
exp340 exp 4.9999999999999E-8 -> 1.00000005000000124999902083328 Inexact Rounded
|
||||
exp341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded
|
||||
exp342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded
|
||||
precision: 20
|
||||
exp343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded
|
||||
exp344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded
|
||||
exp345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded
|
||||
precision: 14
|
||||
exp346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded
|
||||
exp347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded
|
||||
exp348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded
|
||||
|
||||
-- cases near 1 -- 1 2345678901234567890
|
||||
precision: 20
|
||||
exp401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded
|
||||
exp402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded
|
||||
exp403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded
|
||||
exp404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded
|
||||
exp405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded
|
||||
exp406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded
|
||||
exp407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded
|
||||
precision: 14
|
||||
exp411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded
|
||||
exp412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded
|
||||
exp413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded
|
||||
exp414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded
|
||||
exp415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded
|
||||
exp416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded
|
||||
exp417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded
|
||||
|
||||
-- overflows
|
||||
precision: 7
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
exp704 exp 1000000 -> ? Overflow Inexact Rounded
|
||||
exp705 exp 100000 -> ? Overflow Inexact Rounded
|
||||
exp706 exp 10000 -> ? Overflow Inexact Rounded
|
||||
exp707 exp 1000 -> ? Overflow Inexact Rounded
|
||||
precision: 16
|
||||
exp725 exp 886.4952608027076 -> ? Overflow Inexact Rounded
|
||||
exp726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded
|
||||
|
||||
-- subnormals and underflows, including underflow-to-zero edge point
|
||||
precision: 7
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
exp754 exp -1000000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
exp755 exp -100000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
exp756 exp -10000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
exp757 exp -1000 -> ? Underflow Inexact Rounded Clamped Subnormal
|
||||
exp759 exp -881.8901 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp760 exp -885 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp761 exp -888 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp762 exp -890 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp763 exp -892.9 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp764 exp -893 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp765 exp -893.5 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp766 exp -895.7056 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp769 exp -895.8 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp770 exp -895.73 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp771 exp -896.3987 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp772 exp -896.3988 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp773 exp -898.0081 -> ? Inexact Rounded Underflow Subnormal
|
||||
exp774 exp -898.0082 -> ? Inexact Rounded Underflow Subnormal
|
||||
|
||||
--
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
|
||||
-- Null test
|
||||
exp900 exp # -> ? Invalid_operation
|
||||
|
||||
|
||||
-- Randoms P=50, within 0-999
|
||||
Precision: 50
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
exp1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded
|
||||
exp1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded
|
||||
exp1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded
|
||||
exp1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded
|
||||
exp1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded
|
||||
exp1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded
|
||||
exp1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded
|
||||
exp1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded
|
||||
exp1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded
|
||||
exp1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded
|
||||
exp1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded
|
||||
exp1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded
|
||||
exp1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded
|
||||
exp1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded
|
||||
exp1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded
|
||||
exp1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded
|
||||
exp1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded
|
||||
exp1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded
|
||||
exp1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded
|
||||
exp1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded
|
||||
exp1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded
|
||||
exp1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded
|
||||
exp1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded
|
||||
exp1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded
|
||||
exp1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded
|
||||
exp1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded
|
||||
exp1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded
|
||||
exp1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded
|
||||
exp1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded
|
||||
exp1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded
|
||||
exp1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded
|
||||
exp1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded
|
||||
exp1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded
|
||||
exp1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded
|
||||
exp1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded
|
||||
exp1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded
|
||||
exp1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded
|
||||
exp1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded
|
||||
exp1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded
|
||||
exp1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded
|
||||
|
||||
-- Randoms P=34, within 0-999
|
||||
Precision: 34
|
||||
maxExponent: 6144
|
||||
minExponent: -6143
|
||||
exp1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded
|
||||
exp1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded
|
||||
exp1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded
|
||||
exp1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded
|
||||
exp1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded
|
||||
exp1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded
|
||||
exp1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded
|
||||
exp1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded
|
||||
exp1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded
|
||||
exp1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded
|
||||
exp1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded
|
||||
exp1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded
|
||||
exp1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded
|
||||
exp1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded
|
||||
exp1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded
|
||||
exp1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded
|
||||
exp1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded
|
||||
exp1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded
|
||||
exp1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded
|
||||
exp1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded
|
||||
exp1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded
|
||||
exp1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded
|
||||
exp1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded
|
||||
exp1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded
|
||||
exp1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded
|
||||
exp1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded
|
||||
exp1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded
|
||||
exp1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded
|
||||
exp1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded
|
||||
exp1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded
|
||||
exp1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded
|
||||
exp1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded
|
||||
exp1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded
|
||||
exp1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded
|
||||
exp1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded
|
||||
exp1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded
|
||||
exp1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded
|
||||
exp1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded
|
||||
exp1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded
|
||||
exp1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded
|
||||
|
||||
-- Randoms P=16, within 0-99
|
||||
Precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
exp1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded
|
||||
exp1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded
|
||||
exp1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded
|
||||
exp1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded
|
||||
exp1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded
|
||||
exp1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded
|
||||
exp1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded
|
||||
exp1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded
|
||||
exp1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded
|
||||
exp1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded
|
||||
exp1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded
|
||||
exp1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded
|
||||
exp1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded
|
||||
exp1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded
|
||||
exp1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded
|
||||
exp1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded
|
||||
exp1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded
|
||||
exp1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded
|
||||
exp1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded
|
||||
exp1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded
|
||||
exp1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded
|
||||
exp1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded
|
||||
exp1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded
|
||||
exp1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded
|
||||
exp1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded
|
||||
exp1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded
|
||||
exp1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded
|
||||
exp1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded
|
||||
exp1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded
|
||||
exp1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded
|
||||
exp1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded
|
||||
exp1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded
|
||||
exp1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded
|
||||
exp1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded
|
||||
exp1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded
|
||||
exp1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded
|
||||
exp1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded
|
||||
exp1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded
|
||||
exp1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded
|
||||
exp1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded
|
||||
|
||||
-- Randoms P=7, within 0-9
|
||||
Precision: 7
|
||||
maxExponent: 96
|
||||
minExponent: -95
|
||||
exp1001 exp 2.395441 -> 10.97304 Inexact Rounded
|
||||
exp1002 exp 0.6406779 -> 1.897767 Inexact Rounded
|
||||
exp1003 exp 0.5618218 -> 1.753865 Inexact Rounded
|
||||
exp1004 exp 3.055120 -> 21.22373 Inexact Rounded
|
||||
exp1005 exp 1.536792 -> 4.649650 Inexact Rounded
|
||||
exp1006 exp 0.0801591 -> 1.083459 Inexact Rounded
|
||||
exp1007 exp 0.0966875 -> 1.101516 Inexact Rounded
|
||||
exp1008 exp 0.0646761 -> 1.066813 Inexact Rounded
|
||||
exp1009 exp 0.0095670 -> 1.009613 Inexact Rounded
|
||||
exp1010 exp 2.956859 -> 19.23745 Inexact Rounded
|
||||
exp1011 exp 7.504679 -> 1816.522 Inexact Rounded
|
||||
exp1012 exp 0.0045259 -> 1.004536 Inexact Rounded
|
||||
exp1013 exp 3.810071 -> 45.15364 Inexact Rounded
|
||||
exp1014 exp 1.502390 -> 4.492413 Inexact Rounded
|
||||
exp1015 exp 0.0321523 -> 1.032675 Inexact Rounded
|
||||
exp1016 exp 0.0057214 -> 1.005738 Inexact Rounded
|
||||
exp1017 exp 9.811445 -> 18241.33 Inexact Rounded
|
||||
exp1018 exp 3.245249 -> 25.66810 Inexact Rounded
|
||||
exp1019 exp 0.3189742 -> 1.375716 Inexact Rounded
|
||||
exp1020 exp 0.8621610 -> 2.368273 Inexact Rounded
|
||||
exp1021 exp 0.0122511 -> 1.012326 Inexact Rounded
|
||||
exp1022 exp 2.202088 -> 9.043877 Inexact Rounded
|
||||
exp1023 exp 8.778203 -> 6491.202 Inexact Rounded
|
||||
exp1024 exp 0.1896279 -> 1.208800 Inexact Rounded
|
||||
exp1025 exp 0.4510947 -> 1.570030 Inexact Rounded
|
||||
exp1026 exp 0.276413 -> 1.318392 Inexact Rounded
|
||||
exp1027 exp 4.490067 -> 89.12742 Inexact Rounded
|
||||
exp1028 exp 0.0439786 -> 1.044960 Inexact Rounded
|
||||
exp1029 exp 0.8168245 -> 2.263301 Inexact Rounded
|
||||
exp1030 exp 0.0391658 -> 1.039943 Inexact Rounded
|
||||
exp1031 exp 9.261816 -> 10528.24 Inexact Rounded
|
||||
exp1032 exp 9.611186 -> 14930.87 Inexact Rounded
|
||||
exp1033 exp 9.118125 -> 9119.087 Inexact Rounded
|
||||
exp1034 exp 9.469083 -> 12953.00 Inexact Rounded
|
||||
exp1035 exp 0.0499983 -> 1.051269 Inexact Rounded
|
||||
exp1036 exp 0.0050746 -> 1.005087 Inexact Rounded
|
||||
exp1037 exp 0.0014696 -> 1.001471 Inexact Rounded
|
||||
exp1038 exp 9.138494 -> 9306.739 Inexact Rounded
|
||||
exp1039 exp 0.0065436 -> 1.006565 Inexact Rounded
|
||||
exp1040 exp 0.7284803 -> 2.071930 Inexact Rounded
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
------------------------------------------------------------------------
|
||||
-- fma0.decTest -- decimal fused multiply add (subset arithmetic) --
|
||||
-- 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: 384
|
||||
minexponent: -383
|
||||
|
||||
-- FMA is not defined in subset, so all values return Invalid
|
||||
-- [And no special values, of course.]
|
||||
|
||||
-- Sanity checks
|
||||
fma0001 fma 1 1 1 -> ? Invalid_operation
|
||||
|
||||
-- zeros, etc.
|
||||
fma2021 fma 0 0 0E+999999 -> ? Invalid_operation
|
||||
|
||||
-- examples from decarith
|
||||
fma2050 fma 1.20 3 0E+999999 -> ? Invalid_operation
|
||||
fma2051 fma 7 3 0E+999999 -> ? Invalid_operation
|
||||
fma2052 fma 0.9 0.8 0E+999999 -> ? Invalid_operation
|
||||
fma2053 fma 0.9 -0 0E+999999 -> ? Invalid_operation
|
||||
fma2054 fma 654321 654321 0E+999999 -> ? Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
fma39990 fma 1 10 # -> ? Invalid_operation
|
||||
fma39991 fma 1 # 10 -> ? Invalid_operation
|
||||
@@ -0,0 +1,174 @@
|
||||
------------------------------------------------------------------------
|
||||
-- inexact0.decTest -- decimal inexact and rounded edge cases (simp.) --
|
||||
-- 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
|
||||
|
||||
inx001 add 1 1 -> 2
|
||||
inx002 add 123456789 0 -> 123456789
|
||||
inx003 add 123456789 0.0 -> 123456789
|
||||
inx004 add 123456789 0.00 -> 123456789
|
||||
inx005 add 123456789 1 -> 123456790
|
||||
inx006 add 123456789 0.1 -> 123456789 Inexact Rounded
|
||||
inx007 add 123456789 0.01 -> 123456789 Inexact Rounded
|
||||
inx008 add 123456789 0.001 -> 123456789 Inexact Rounded
|
||||
inx009 add 123456789 0.000001 -> 123456789 Inexact Rounded
|
||||
inx010 add 123456789 0.000000001 -> 123456789 Inexact Rounded
|
||||
inx011 add 123456789 0.000000000001 -> 123456789 Inexact Rounded
|
||||
|
||||
inx012 add 123456789 0.9 -> 123456790 Inexact Rounded
|
||||
inx013 add 123456789 0.09 -> 123456789 Inexact Rounded
|
||||
inx014 add 123456789 0.009 -> 123456789 Inexact Rounded
|
||||
inx015 add 123456789 0.000009 -> 123456789 Inexact Rounded
|
||||
inx016 add 123456789 0.000000009 -> 123456789 Inexact Rounded
|
||||
inx017 add 123456789 0.000000000009 -> 123456789 Inexact Rounded
|
||||
|
||||
inx021 add 1 -1 -> 0
|
||||
inx022 add 123456789 -0 -> 123456789
|
||||
inx023 add 123456789 -0.0 -> 123456789
|
||||
inx024 add 123456789 -0.00 -> 123456789
|
||||
inx025 add 123456789 -1 -> 123456788
|
||||
inx026 add 123456789 -0.1 -> 123456789 Inexact Rounded
|
||||
inx027 add 123456789 -0.01 -> 123456789 Inexact Rounded
|
||||
inx028 add 123456789 -0.001 -> 123456789 Inexact Rounded
|
||||
inx029 add 123456789 -0.000001 -> 123456789 Inexact Rounded
|
||||
inx030 add 123456789 -0.000000001 -> 123456789 Inexact Rounded
|
||||
inx031 add 123456789 -0.000000000001 -> 123456789 Inexact Rounded
|
||||
inx032 add 123456789 -0.9 -> 123456788 Inexact Rounded
|
||||
inx033 add 123456789 -0.09 -> 123456789 Inexact Rounded
|
||||
inx034 add 123456789 -0.009 -> 123456789 Inexact Rounded
|
||||
inx035 add 123456789 -0.000009 -> 123456789 Inexact Rounded
|
||||
inx036 add 123456789 -0.000000009 -> 123456789 Inexact Rounded
|
||||
inx037 add 123456789 -0.000000000009 -> 123456789 Inexact Rounded
|
||||
|
||||
inx042 add 0 123456789 -> 123456789
|
||||
inx043 add 0.0 123456789 -> 123456789
|
||||
inx044 add 0.00 123456789 -> 123456789
|
||||
inx045 add 1 123456789 -> 123456790
|
||||
inx046 add 0.1 123456789 -> 123456789 Inexact Rounded
|
||||
inx047 add 0.01 123456789 -> 123456789 Inexact Rounded
|
||||
inx048 add 0.001 123456789 -> 123456789 Inexact Rounded
|
||||
inx049 add 0.000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx050 add 0.000000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx051 add 0.000000000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx052 add 0.9 123456789 -> 123456790 Inexact Rounded
|
||||
inx053 add 0.09 123456789 -> 123456789 Inexact Rounded
|
||||
inx054 add 0.009 123456789 -> 123456789 Inexact Rounded
|
||||
inx055 add 0.000009 123456789 -> 123456789 Inexact Rounded
|
||||
inx056 add 0.000000009 123456789 -> 123456789 Inexact Rounded
|
||||
inx057 add 0.000000000009 123456789 -> 123456789 Inexact Rounded
|
||||
|
||||
inx062 add -0 123456789 -> 123456789
|
||||
inx063 add -0.0 123456789 -> 123456789
|
||||
inx064 add -0.00 123456789 -> 123456789
|
||||
inx065 add -1 123456789 -> 123456788
|
||||
inx066 add -0.1 123456789 -> 123456789 Inexact Rounded
|
||||
inx067 add -0.01 123456789 -> 123456789 Inexact Rounded
|
||||
inx068 add -0.001 123456789 -> 123456789 Inexact Rounded
|
||||
inx069 add -0.000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx070 add -0.000000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx071 add -0.000000000001 123456789 -> 123456789 Inexact Rounded
|
||||
inx072 add -0.9 123456789 -> 123456788 Inexact Rounded
|
||||
inx073 add -0.09 123456789 -> 123456789 Inexact Rounded
|
||||
inx074 add -0.009 123456789 -> 123456789 Inexact Rounded
|
||||
inx075 add -0.000009 123456789 -> 123456789 Inexact Rounded
|
||||
inx076 add -0.000000009 123456789 -> 123456789 Inexact Rounded
|
||||
inx077 add -0.000000000009 123456789 -> 123456789 Inexact Rounded
|
||||
|
||||
-- some boundaries
|
||||
inx081 add 999999999 0 -> 999999999
|
||||
inx082 add 0.999999999 0.000000000 -> 0.999999999
|
||||
inx083 add 999999999 1 -> 1.00000000E+9 Rounded
|
||||
inx084 add 0.999999999 0.000000001 -> 1.00000000 Rounded
|
||||
inx085 add 999999999 2 -> 1.00000000E+9 Inexact Rounded
|
||||
inx086 add 0.999999999 0.000000002 -> 1.00000000 Inexact Rounded
|
||||
inx087 add 999999999 3 -> 1.00000000E+9 Inexact Rounded
|
||||
inx089 add 0.999999999 0.000000003 -> 1.00000000 Inexact Rounded
|
||||
|
||||
-- minus, plus, and subtract all assumed to work like add.
|
||||
|
||||
-- multiply
|
||||
precision: 8
|
||||
inx101 multiply 1000 1000 -> 1000000
|
||||
inx102 multiply 9000 9000 -> 81000000
|
||||
inx103 multiply 9999 9999 -> 99980001
|
||||
inx104 multiply 1000 10000 -> 10000000
|
||||
inx105 multiply 10000 10000 -> 1.0000000E+8 Rounded
|
||||
inx106 multiply 10001 10000 -> 1.0001000E+8 Rounded
|
||||
inx107 multiply 10001 10001 -> 1.0002000E+8 Inexact Rounded
|
||||
inx108 multiply 10101 10001 -> 1.0102010E+8 Inexact Rounded
|
||||
inx109 multiply 10001 10101 -> 1.0102010E+8 Inexact Rounded
|
||||
|
||||
-- divide
|
||||
precision: 4
|
||||
inx201 divide 1000 1000 -> 1
|
||||
inx202 divide 1000 1 -> 1000
|
||||
inx203 divide 1000 2 -> 500
|
||||
inx204 divide 1000 3 -> 333.3 Inexact Rounded
|
||||
inx205 divide 1000 4 -> 250
|
||||
inx206 divide 1000 5 -> 200
|
||||
inx207 divide 1000 6 -> 166.7 Inexact Rounded
|
||||
inx208 divide 1000 7 -> 142.9 Inexact Rounded
|
||||
inx209 divide 1000 8 -> 125
|
||||
inx210 divide 1000 9 -> 111.1 Inexact Rounded
|
||||
inx211 divide 1000 10 -> 100
|
||||
|
||||
inx220 divide 1 1 -> 1
|
||||
inx221 divide 1 2 -> 0.5
|
||||
inx222 divide 1 4 -> 0.25
|
||||
inx223 divide 1 8 -> 0.125
|
||||
inx224 divide 1 16 -> 0.0625
|
||||
inx225 divide 1 32 -> 0.03125
|
||||
inx226 divide 1 64 -> 0.01563 Inexact Rounded
|
||||
inx227 divide 1 128 -> 0.007813 Inexact Rounded
|
||||
|
||||
-- power
|
||||
precision: 4
|
||||
inx301 power 0.5 2 -> 0.25
|
||||
inx302 power 0.5 4 -> 0.0625
|
||||
inx303 power 0.5 8 -> 0.003906 Inexact Rounded
|
||||
inx304 power 0.5 16 -> 0.00001526 Inexact Rounded
|
||||
inx305 power 0.5 32 -> 2.328E-10 Inexact Rounded
|
||||
|
||||
-- compare, divideInteger, and remainder are always exact
|
||||
|
||||
-- rescale
|
||||
precision: 4
|
||||
inx401 rescale 0 0 -> 0
|
||||
inx402 rescale 1 0 -> 1
|
||||
inx403 rescale 0.1 +2 -> 0E+2 Inexact Rounded
|
||||
inx404 rescale 0.1 +1 -> 0E+1 Inexact Rounded
|
||||
inx405 rescale 0.1 0 -> 0 Inexact Rounded
|
||||
inx406 rescale 0.1 -1 -> 0.1
|
||||
inx407 rescale 0.1 -2 -> 0.10
|
||||
|
||||
-- lostDigits implies Inexact...
|
||||
precision: 9
|
||||
inx801 plus 123456789 -> 123456789
|
||||
inx802 plus 1234567890 -> 1.23456789E+9 Rounded
|
||||
inx803 plus 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
inx804 plus 1234567892 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
inx805 plus 1234567899 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
inx806 plus 1234567900 -> 1.23456790E+9 Rounded
|
||||
|
||||
@@ -0,0 +1,467 @@
|
||||
------------------------------------------------------------------------
|
||||
-- ln0.decTest -- decimal natural logarithm subset --
|
||||
-- Copyright (c) IBM Corporation, 2005, 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: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minexponent: -383
|
||||
|
||||
-- basics (examples in specification, etc.)
|
||||
ln0001 ln 0 -> ? Invalid_operation
|
||||
ln0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded
|
||||
ln0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded
|
||||
ln0004 ln 0.1 -> -2.302585092994046 Inexact Rounded
|
||||
ln0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded
|
||||
ln0006 ln 1 -> 0
|
||||
ln0007 ln 1.5 -> 0.4054651081081644 Inexact Rounded
|
||||
ln0008 ln 2 -> 0.6931471805599453 Inexact Rounded
|
||||
ln0009 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded
|
||||
ln0010 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded
|
||||
ln0011 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded
|
||||
ln0012 ln 10 -> 2.302585092994046 Inexact Rounded
|
||||
ln0013 ln 10.5 -> 2.351375257163478 Inexact Rounded
|
||||
ln0014 ln 9999 -> 9.210240366975849 Inexact Rounded
|
||||
ln0015 ln 1E6 -> 13.81551055796427 Inexact Rounded
|
||||
ln0016 ln 1E+9 -> 20.72326583694641 Inexact Rounded
|
||||
|
||||
-- notable cases
|
||||
-- negatives
|
||||
ln0021 ln -1E-9 -> ? Invalid_operation
|
||||
ln0022 ln -0.0007 -> ? Invalid_operation
|
||||
ln0023 ln -0.1 -> ? Invalid_operation
|
||||
ln0024 ln -0.7 -> ? Invalid_operation
|
||||
ln0025 ln -1 -> ? Invalid_operation
|
||||
ln0026 ln -1.5 -> ? Invalid_operation
|
||||
ln0027 ln -2 -> ? Invalid_operation
|
||||
ln0029 ln -10.5 -> ? Invalid_operation
|
||||
ln0028 ln -9999 -> ? Invalid_operation
|
||||
ln0030 ln -2.718281828459045 -> ? Invalid_operation
|
||||
ln0031 ln -2.718281828459046 -> ? Invalid_operation
|
||||
ln0032 ln -0 -> ? Invalid_operation
|
||||
ln0033 ln -0E+17 -> ? Invalid_operation
|
||||
ln0034 ln -0E-17 -> ? Invalid_operation
|
||||
-- other zeros
|
||||
ln0041 ln 0 -> ? Invalid_operation
|
||||
ln0042 ln 0E+17 -> ? Invalid_operation
|
||||
ln0043 ln 0E-17 -> ? Invalid_operation
|
||||
-- ones
|
||||
ln0050 ln 1 -> 0
|
||||
ln0051 ln 1.0 -> 0
|
||||
ln0052 ln 1.000000000000000 -> 0
|
||||
ln0053 ln 1.000000000000000000 -> 0 Rounded
|
||||
ln0054 ln 1.000000000000000001 -> 0 Rounded Lost_digits Inexact
|
||||
|
||||
-- lower precision basics
|
||||
Precision: 7
|
||||
ln0101 ln 0 -> ? Invalid_operation
|
||||
ln0102 ln 1E-9 -> -20.72327 Inexact Rounded
|
||||
ln0103 ln 0.0007 -> -7.264430 Inexact Rounded
|
||||
ln0104 ln 0.1 -> -2.302585 Inexact Rounded
|
||||
ln0105 ln 0.7 -> -0.3566749 Inexact Rounded
|
||||
ln0106 ln 1 -> 0
|
||||
ln0107 ln 1.5 -> 0.4054651 Inexact Rounded
|
||||
ln0108 ln 2 -> 0.6931472 Inexact Rounded
|
||||
ln0111 ln 2.718282 -> 1.000000 Inexact Rounded
|
||||
ln0112 ln 10 -> 2.302585 Inexact Rounded
|
||||
ln0113 ln 10.5 -> 2.351375 Inexact Rounded
|
||||
ln0114 ln 9999 -> 9.210240 Inexact Rounded
|
||||
ln0115 ln 1E6 -> 13.81551 Inexact Rounded
|
||||
ln0116 ln 1E+9 -> 20.72327 Inexact Rounded
|
||||
|
||||
-- extreme input range values
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
Precision: 16
|
||||
|
||||
ln0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded
|
||||
ln0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded
|
||||
ln0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded
|
||||
ln0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded
|
||||
ln0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded
|
||||
ln0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded
|
||||
|
||||
ln0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded
|
||||
ln0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded
|
||||
ln0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded
|
||||
ln0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded
|
||||
ln0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded
|
||||
ln0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
|
||||
ln0916 ln 9.999999999999999999999999e+999999 -> ? Lost_digits Overflow Inexact Rounded
|
||||
|
||||
-- randoms
|
||||
-- P=50, within 0-999
|
||||
Precision: 50
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
ln1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded
|
||||
ln1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded
|
||||
ln1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded
|
||||
ln1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded
|
||||
ln1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded
|
||||
ln1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded
|
||||
ln1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded
|
||||
ln1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded
|
||||
ln1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded
|
||||
ln1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded
|
||||
ln1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded
|
||||
ln1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded
|
||||
ln1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded
|
||||
ln1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded
|
||||
ln1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded
|
||||
ln1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded
|
||||
ln1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded
|
||||
ln1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded
|
||||
ln1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded
|
||||
ln1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded
|
||||
ln1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded
|
||||
ln1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded
|
||||
ln1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded
|
||||
ln1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded
|
||||
ln1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded
|
||||
ln1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded
|
||||
ln1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded
|
||||
ln1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded
|
||||
ln1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded
|
||||
ln1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded
|
||||
ln1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded
|
||||
ln1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded
|
||||
ln1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded
|
||||
ln1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded
|
||||
ln1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded
|
||||
ln1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded
|
||||
ln1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded
|
||||
ln1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded
|
||||
ln1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded
|
||||
ln1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded
|
||||
|
||||
-- P=34, within 0-999
|
||||
Precision: 34
|
||||
ln1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded
|
||||
ln1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded
|
||||
ln1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded
|
||||
ln1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded
|
||||
ln1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded
|
||||
ln1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded
|
||||
ln1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded
|
||||
ln1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded
|
||||
ln1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded
|
||||
ln1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded
|
||||
ln1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded
|
||||
ln1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded
|
||||
ln1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded
|
||||
ln1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded
|
||||
ln1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded
|
||||
ln1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded
|
||||
ln1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded
|
||||
ln1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded
|
||||
ln1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded
|
||||
ln1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded
|
||||
ln1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded
|
||||
ln1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded
|
||||
ln1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded
|
||||
ln1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded
|
||||
ln1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded
|
||||
ln1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded
|
||||
ln1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded
|
||||
ln1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded
|
||||
ln1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded
|
||||
ln1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded
|
||||
ln1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded
|
||||
ln1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded
|
||||
ln1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded
|
||||
ln1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded
|
||||
ln1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded
|
||||
ln1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded
|
||||
ln1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded
|
||||
ln1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded
|
||||
ln1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded
|
||||
ln1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded
|
||||
|
||||
-- P=16, within 0-99
|
||||
Precision: 16
|
||||
ln1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded
|
||||
ln1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded
|
||||
ln1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded
|
||||
ln1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded
|
||||
ln1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded
|
||||
ln1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded
|
||||
ln1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded
|
||||
ln1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded
|
||||
ln1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded
|
||||
ln1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded
|
||||
ln1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded
|
||||
ln1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded
|
||||
ln1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded
|
||||
ln1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded
|
||||
ln1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded
|
||||
ln1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded
|
||||
ln1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded
|
||||
ln1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded
|
||||
ln1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded
|
||||
ln1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded
|
||||
ln1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded
|
||||
ln1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded
|
||||
ln1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded
|
||||
ln1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded
|
||||
ln1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded
|
||||
ln1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded
|
||||
ln1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded
|
||||
ln1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded
|
||||
ln1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded
|
||||
ln1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded
|
||||
ln1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded
|
||||
ln1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded
|
||||
ln1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded
|
||||
ln1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded
|
||||
ln1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded
|
||||
ln1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded
|
||||
ln1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded
|
||||
ln1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded
|
||||
ln1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded
|
||||
ln1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded
|
||||
|
||||
-- P=7, within 0-9
|
||||
Precision: 7
|
||||
ln1001 ln 0.0912025 -> -2.394673 Inexact Rounded
|
||||
ln1002 ln 0.9728626 -> -0.02751242 Inexact Rounded
|
||||
ln1003 ln 0.3886032 -> -0.9451965 Inexact Rounded
|
||||
ln1004 ln 8.798639 -> 2.174597 Inexact Rounded
|
||||
ln1005 ln 2.459121 -> 0.8998040 Inexact Rounded
|
||||
ln1006 ln 2.013193 -> 0.6997220 Inexact Rounded
|
||||
ln1007 ln 9.064857 -> 2.204405 Inexact Rounded
|
||||
ln1008 ln 5.796417 -> 1.757240 Inexact Rounded
|
||||
ln1009 ln 0.1143471 -> -2.168517 Inexact Rounded
|
||||
ln1010 ln 0.5341542 -> -0.6270707 Inexact Rounded
|
||||
ln1011 ln 6.693781 -> 1.901179 Inexact Rounded
|
||||
ln1012 ln 0.0081779 -> -4.806320 Inexact Rounded
|
||||
ln1013 ln 8.313616 -> 2.117895 Inexact Rounded
|
||||
ln1014 ln 3.486925 -> 1.249020 Inexact Rounded
|
||||
ln1015 ln 0.1801401 -> -1.714020 Inexact Rounded
|
||||
ln1016 ln 0.5227148 -> -0.6487193 Inexact Rounded
|
||||
ln1017 ln 7.818111 -> 2.056443 Inexact Rounded
|
||||
ln1018 ln 0.0870671 -> -2.441076 Inexact Rounded
|
||||
ln1019 ln 8.153966 -> 2.098504 Inexact Rounded
|
||||
ln1020 ln 2.040975 -> 0.7134276 Inexact Rounded
|
||||
ln1021 ln 1.481642 -> 0.3931509 Inexact Rounded
|
||||
ln1022 ln 0.2610123 -> -1.343188 Inexact Rounded
|
||||
ln1023 ln 0.466723 -> -0.7620193 Inexact Rounded
|
||||
ln1024 ln 0.0518756 -> -2.958907 Inexact Rounded
|
||||
ln1025 ln 2.056410 -> 0.7209617 Inexact Rounded
|
||||
ln1026 ln 0.181522 -> -1.706378 Inexact Rounded
|
||||
ln1027 ln 0.515551 -> -0.6625190 Inexact Rounded
|
||||
ln1028 ln 8.425089 -> 2.131214 Inexact Rounded
|
||||
ln1029 ln 2.077091 -> 0.7309684 Inexact Rounded
|
||||
ln1030 ln 6.212705 -> 1.826596 Inexact Rounded
|
||||
ln1031 ln 5.729343 -> 1.745601 Inexact Rounded
|
||||
ln1032 ln 4.831251 -> 1.575105 Inexact Rounded
|
||||
ln1033 ln 2.029760 -> 0.7079176 Inexact Rounded
|
||||
ln1034 ln 8.615060 -> 2.153512 Inexact Rounded
|
||||
ln1035 ln 0.0611511 -> -2.794407 Inexact Rounded
|
||||
ln1036 ln 5.195269 -> 1.647748 Inexact Rounded
|
||||
ln1037 ln 9.617686 -> 2.263604 Inexact Rounded
|
||||
ln1038 ln 0.0049382 -> -5.310754 Inexact Rounded
|
||||
ln1039 ln 2.786840 -> 1.024908 Inexact Rounded
|
||||
ln1040 ln 0.0091073 -> -4.698679 Inexact Rounded
|
||||
|
||||
-- from here 3-digit tests are based on reverse exp tests
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minexponent: -383
|
||||
|
||||
ln001 ln 0 -> ? Invalid_operation
|
||||
ln002 ln 0.367879441 -> -1.00000000 Inexact Rounded
|
||||
ln003 ln 1 -> 0
|
||||
ln005 ln 2.71828183 -> 1.00000000 Inexact Rounded
|
||||
ln006 ln 2.00000000 -> 0.693147181 Inexact Rounded
|
||||
|
||||
-- tiny edge cases
|
||||
precision: 7
|
||||
ln011 ln 1.105171 -> 0.1000001 Inexact Rounded
|
||||
ln012 ln 1.010050 -> 0.009999835 Inexact Rounded
|
||||
ln013 ln 1.000010 -> 0.000009999950 Inexact Rounded
|
||||
ln014 ln 1.000001 -> 9.999995E-7 Inexact Rounded
|
||||
ln015 ln 1.000000 -> 0
|
||||
|
||||
-- basic e=0, e=1, e=2, e=4, e>=8 cases
|
||||
precision: 7
|
||||
ln041 ln 2.718282 -> 1.000000 Inexact Rounded
|
||||
ln042 ln 0.3678794 -> -1.000000 Inexact Rounded
|
||||
ln043 ln 22026.47 -> 10.00000 Inexact Rounded
|
||||
ln044 ln 0.00004539993 -> -10.00000 Inexact Rounded
|
||||
ln045 ln 2.688117E+43 -> 100.0000 Inexact Rounded
|
||||
ln046 ln 3.720076E-44 -> -100.0000 Inexact Rounded
|
||||
ln048 ln 0E-389 -> ? Invalid_operation
|
||||
|
||||
-- miscellanea
|
||||
precision: 16
|
||||
ln055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded
|
||||
precision: 17
|
||||
ln056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded
|
||||
precision: 18
|
||||
ln057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded
|
||||
precision: 19
|
||||
ln058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded
|
||||
precision: 20
|
||||
ln059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded
|
||||
|
||||
-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences
|
||||
precision: 50
|
||||
ln102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded
|
||||
precision: 30
|
||||
ln103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded
|
||||
precision: 29
|
||||
ln104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded
|
||||
precision: 28
|
||||
ln105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded
|
||||
precision: 27
|
||||
ln106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded
|
||||
precision: 26
|
||||
ln107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded
|
||||
precision: 25
|
||||
ln108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded
|
||||
precision: 24
|
||||
ln109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded
|
||||
precision: 23
|
||||
ln110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded
|
||||
precision: 22
|
||||
ln111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded
|
||||
precision: 21
|
||||
ln112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded
|
||||
precision: 20
|
||||
ln113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded
|
||||
precision: 19
|
||||
ln114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded
|
||||
precision: 18
|
||||
ln115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded
|
||||
-- next is a > 0.5ulp case
|
||||
precision: 17
|
||||
ln116 ln 0.99999991000000405 -> -8.9999999999999879E-8 Inexact Rounded
|
||||
precision: 16
|
||||
ln117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded
|
||||
precision: 15
|
||||
ln118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded
|
||||
precision: 14
|
||||
ln119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded
|
||||
precision: 13
|
||||
ln120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded
|
||||
precision: 12
|
||||
ln121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded
|
||||
precision: 11
|
||||
ln122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded
|
||||
precision: 10
|
||||
ln123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded
|
||||
precision: 9
|
||||
ln124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded
|
||||
precision: 8
|
||||
ln125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded
|
||||
precision: 7
|
||||
ln126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded
|
||||
precision: 16
|
||||
ln126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded
|
||||
precision: 6
|
||||
ln127 ln 0.999999 -> -0.00000100000 Inexact Rounded
|
||||
precision: 5
|
||||
ln128 ln 0.99999 -> -0.000010000 Inexact Rounded
|
||||
precision: 4
|
||||
ln129 ln 0.9999 -> -0.0001000 Inexact Rounded
|
||||
precision: 3
|
||||
ln130 ln 0.999 -> -0.00100 Inexact Rounded
|
||||
precision: 2
|
||||
ln131 ln 0.99 -> -0.010 Inexact Rounded
|
||||
precision: 1
|
||||
ln132 ln 0.9 -> -0.1 Inexact Rounded
|
||||
|
||||
|
||||
-- cases near 1 -- 1 2345678901234567890
|
||||
precision: 20
|
||||
ln401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded
|
||||
ln402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded
|
||||
ln403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded
|
||||
ln404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded
|
||||
ln405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded
|
||||
ln406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded
|
||||
ln407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded
|
||||
precision: 14
|
||||
ln411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded
|
||||
ln413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded
|
||||
ln416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded
|
||||
ln417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded
|
||||
|
||||
-- overflows, including some exp overprecise borderlines
|
||||
precision: 7
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
ln709 ln 9.999999E+384 -> 886.4953 Inexact Rounded
|
||||
ln711 ln 9.999992E+384 -> 886.4953 Inexact Rounded
|
||||
precision: 16
|
||||
ln722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded
|
||||
ln724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded
|
||||
ln726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded
|
||||
|
||||
-- subnormals and underflows for exp, including underflow-to-zero edge point
|
||||
precision: 7
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
ln751 ln 0E-389 -> ? Invalid_operation
|
||||
ln758 ln 1.000001E-383 -> -881.8901 Inexact Rounded
|
||||
ln759 ln 9.99991E-384 -> -881.8901 Inexact Rounded
|
||||
ln760 ln 4.4605E-385 -> -885.0000 Inexact Rounded
|
||||
ln761 ln 2.221E-386 -> -887.9999 Inexact Rounded
|
||||
ln762 ln 3.01E-387 -> -889.9985 Inexact Rounded
|
||||
ln763 ln 1.7E-388 -> -892.8724 Inexact Rounded
|
||||
ln764 ln 1.5E-388 -> -892.9976 Inexact Rounded
|
||||
ln765 ln 9E-389 -> -893.5084 Inexact Rounded
|
||||
ln766 ln 1E-389 -> -895.7056 Inexact Rounded
|
||||
ln774 ln 0E-389 -> ? Invalid_operation
|
||||
|
||||
-- Invalid operations due to restrictions
|
||||
-- [next two probably skipped by most test harnesses]
|
||||
precision: 100000000
|
||||
ln901 ln 0 -> ? Invalid_context
|
||||
precision: 99999999
|
||||
ln902 ln 0 -> ? Invalid_operation
|
||||
|
||||
precision: 9
|
||||
maxExponent: 1000000
|
||||
minExponent: -999999
|
||||
ln903 ln 1 -> ? Invalid_context
|
||||
maxExponent: 999999
|
||||
minExponent: -999999
|
||||
ln904 ln 0 -> ? Invalid_operation
|
||||
maxExponent: 999999
|
||||
minExponent: -1000000
|
||||
ln905 ln 1 -> ? Invalid_context
|
||||
maxExponent: 999999
|
||||
minExponent: -999998
|
||||
ln906 ln 0 -> ? Invalid_operation
|
||||
|
||||
--
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
|
||||
-- Null test
|
||||
ln900 ln # -> ? Invalid_operation
|
||||
|
||||
|
||||
@@ -0,0 +1,456 @@
|
||||
------------------------------------------------------------------------
|
||||
-- log100.decTest -- decimal logarithm in base 10 subset --
|
||||
-- Copyright (c) IBM Corporation, 2005, 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: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minexponent: -383
|
||||
|
||||
-- basics (examples in specification, etc.)
|
||||
log0000 log10 0 -> ? Invalid_operation
|
||||
log0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded
|
||||
log0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded
|
||||
log0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded
|
||||
log0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded
|
||||
log0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded
|
||||
log0006 log10 1 -> 0
|
||||
log0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded
|
||||
log0008 log10 2 -> 0.3010299956639812 Inexact Rounded
|
||||
log0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded
|
||||
log0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded
|
||||
log0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded
|
||||
log0012 log10 7 -> 0.8450980400142568 Inexact Rounded
|
||||
log0013 log10 10 -> 1
|
||||
log0014 log10 10.5 -> 1.021189299069938 Inexact Rounded
|
||||
log0015 log10 11 -> 1.041392685158225 Inexact Rounded
|
||||
log0016 log10 70 -> 1.845098040014257 Inexact Rounded
|
||||
log0017 log10 9999 -> 3.999956568380192 Inexact Rounded
|
||||
log0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded
|
||||
log0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded
|
||||
log0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded
|
||||
|
||||
-- notable cases
|
||||
-- negatives
|
||||
log0031 log10 -1E-9 -> ? Invalid_operation
|
||||
log0032 log10 -0.0007 -> ? Invalid_operation
|
||||
log0033 log10 -0.1 -> ? Invalid_operation
|
||||
log0034 log10 -0.7 -> ? Invalid_operation
|
||||
log0035 log10 -1 -> ? Invalid_operation
|
||||
log0036 log10 -1.5 -> ? Invalid_operation
|
||||
log0037 log10 -2 -> ? Invalid_operation
|
||||
log0038 log10 -10.5 -> ? Invalid_operation
|
||||
log0039 log10 -10.5 -> ? Invalid_operation
|
||||
log0040 log10 -9999 -> ? Invalid_operation
|
||||
log0041 log10 -10 -> ? Invalid_operation
|
||||
log0042 log10 -0 -> ? Invalid_operation
|
||||
log0043 log10 -0E+17 -> ? Invalid_operation
|
||||
log0044 log10 -0E-17 -> ? Invalid_operation
|
||||
-- other zeros
|
||||
log0051 log10 0 -> ? Invalid_operation
|
||||
log0052 log10 0E+17 -> ? Invalid_operation
|
||||
log0053 log10 0E-17 -> ? Invalid_operation
|
||||
-- ones
|
||||
log0061 log10 1 -> 0
|
||||
log0062 log10 1.0 -> 0
|
||||
log0063 log10 1.000000000000000 -> 0
|
||||
log0064 log10 1.000000000000000000 -> 0 Rounded
|
||||
|
||||
-- notable cases -- exact powers of 10
|
||||
log1100 log10 1 -> 0
|
||||
log1101 log10 10 -> 1
|
||||
log1102 log10 100 -> 2
|
||||
log1103 log10 1000 -> 3
|
||||
log1104 log10 10000 -> 4
|
||||
log1105 log10 100000 -> 5
|
||||
log1106 log10 1000000 -> 6
|
||||
log1107 log10 10000000 -> 7
|
||||
log1108 log10 100000000 -> 8
|
||||
log1109 log10 1000000000 -> 9
|
||||
log1110 log10 10000000000 -> 10
|
||||
log1111 log10 100000000000 -> 11
|
||||
log1112 log10 1000000000000 -> 12
|
||||
|
||||
-- check normally exact cases round properly
|
||||
precision: 1
|
||||
log1141 log10 10000000000 -> 1E+1 Rounded
|
||||
log1142 log10 1000000000000 -> 1E+1 Inexact Rounded
|
||||
log1143 log10 1E+100 -> 1E+2 Rounded
|
||||
log1144 log10 1E+123 -> 1E+2 Inexact Rounded
|
||||
log1145 log10 1E+126 -> 1E+2 Inexact Rounded
|
||||
log1146 log10 1E+916 -> 9E+2 Inexact Rounded
|
||||
log1147 log10 1E+999 -> 1E+3 Inexact Rounded
|
||||
|
||||
precision: 2
|
||||
log1151 log10 10000000000 -> 10 Rounded
|
||||
log1152 log10 1000000000000 -> 12 Rounded
|
||||
log1153 log10 1E+100 -> 1.0E+2 Rounded
|
||||
log1154 log10 1E+123 -> 1.2E+2 Inexact Rounded
|
||||
log1155 log10 1E+126 -> 1.3E+2 Inexact Rounded
|
||||
log1156 log10 1E+916 -> 9.2E+2 Inexact Rounded
|
||||
log1157 log10 1E+999 -> 1.0E+3 Inexact Rounded
|
||||
|
||||
precision: 3
|
||||
log1161 log10 10000000000 -> 10 Rounded
|
||||
log1162 log10 1000000000000 -> 12 Rounded
|
||||
log1163 log10 1E+100 -> 100
|
||||
log1164 log10 1E+123 -> 123
|
||||
log1165 log10 1E+126 -> 126
|
||||
log1166 log10 1E+916 -> 916
|
||||
log1167 log10 1E+999 -> 999
|
||||
--
|
||||
|
||||
-- log10(2) .. tests both ln(2) and ln(10) constants, too
|
||||
precision: 50
|
||||
log1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
|
||||
log1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
|
||||
log1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
|
||||
precision: 49
|
||||
log1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded
|
||||
precision: 48
|
||||
log1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded
|
||||
precision: 47
|
||||
log1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded
|
||||
precision: 46
|
||||
log1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded
|
||||
precision: 45
|
||||
log1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded
|
||||
precision: 44
|
||||
log1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded
|
||||
precision: 43
|
||||
log1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded
|
||||
precision: 42
|
||||
log1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded
|
||||
precision: 41
|
||||
log1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded
|
||||
precision: 40
|
||||
log1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded
|
||||
precision: 39
|
||||
log1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded
|
||||
precision: 38
|
||||
log1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded
|
||||
precision: 37
|
||||
log1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded
|
||||
precision: 36
|
||||
log1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded
|
||||
precision: 35
|
||||
log1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded
|
||||
precision: 34
|
||||
log1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded
|
||||
precision: 33
|
||||
log1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded
|
||||
precision: 32
|
||||
log1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded
|
||||
precision: 31
|
||||
log1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded
|
||||
precision: 30
|
||||
log1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded
|
||||
precision: 29
|
||||
log1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded
|
||||
precision: 28
|
||||
log1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded
|
||||
precision: 27
|
||||
log1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded
|
||||
precision: 26
|
||||
log1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded
|
||||
precision: 25
|
||||
log1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded
|
||||
precision: 24
|
||||
log1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded
|
||||
precision: 23
|
||||
log1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded
|
||||
precision: 22
|
||||
log1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded
|
||||
precision: 21
|
||||
log1232 log10 2 -> 0.301029995663981195214 Inexact Rounded
|
||||
precision: 20
|
||||
log1233 log10 2 -> 0.30102999566398119521 Inexact Rounded
|
||||
precision: 19
|
||||
log1234 log10 2 -> 0.3010299956639811952 Inexact Rounded
|
||||
precision: 18
|
||||
log1235 log10 2 -> 0.301029995663981195 Inexact Rounded
|
||||
precision: 17
|
||||
log1236 log10 2 -> 0.30102999566398120 Inexact Rounded
|
||||
precision: 16
|
||||
log1237 log10 2 -> 0.3010299956639812 Inexact Rounded
|
||||
precision: 15
|
||||
log1238 log10 2 -> 0.301029995663981 Inexact Rounded
|
||||
precision: 14
|
||||
log1239 log10 2 -> 0.30102999566398 Inexact Rounded
|
||||
precision: 13
|
||||
log1240 log10 2 -> 0.3010299956640 Inexact Rounded
|
||||
precision: 12
|
||||
log1241 log10 2 -> 0.301029995664 Inexact Rounded
|
||||
precision: 11
|
||||
log1242 log10 2 -> 0.30102999566 Inexact Rounded
|
||||
precision: 10
|
||||
log1243 log10 2 -> 0.3010299957 Inexact Rounded
|
||||
precision: 9
|
||||
log1244 log10 2 -> 0.301029996 Inexact Rounded
|
||||
precision: 8
|
||||
log1245 log10 2 -> 0.30103000 Inexact Rounded
|
||||
precision: 7
|
||||
log1246 log10 2 -> 0.3010300 Inexact Rounded
|
||||
precision: 6
|
||||
log1247 log10 2 -> 0.301030 Inexact Rounded
|
||||
precision: 5
|
||||
log1248 log10 2 -> 0.30103 Inexact Rounded
|
||||
precision: 4
|
||||
log1249 log10 2 -> 0.3010 Inexact Rounded
|
||||
precision: 3
|
||||
log1250 log10 2 -> 0.301 Inexact Rounded
|
||||
precision: 2
|
||||
log1251 log10 2 -> 0.30 Inexact Rounded
|
||||
precision: 1
|
||||
log1252 log10 2 -> 0.3 Inexact Rounded
|
||||
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
|
||||
-- More close-to-e, etc., tests
|
||||
precision: 34
|
||||
log1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded
|
||||
log1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded
|
||||
log1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded
|
||||
log1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded
|
||||
log1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded
|
||||
log1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded
|
||||
log1307 log10 1.000000000000000000000000000000000 -> 0
|
||||
log1308 log10 1.0000000000000000000000000000000001 -> 0 Inexact Rounded Lost_digits
|
||||
log1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded
|
||||
log1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded
|
||||
-- lower p [several with input rounding]
|
||||
precision: 7
|
||||
log1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded
|
||||
log1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded
|
||||
log1322 log10 0.99999999 -> 0 Inexact Rounded Lost_digits
|
||||
log1323 log10 0.999999999 -> 0 Inexact Rounded Lost_digits
|
||||
log1324 log10 1.00000000 -> 0 Rounded
|
||||
log1325 log10 1.00000001 -> 0 Inexact Rounded Lost_digits
|
||||
log1326 log10 1.0000001 -> 0 Inexact Rounded Lost_digits
|
||||
log1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded
|
||||
|
||||
-- Randoms
|
||||
-- P=50, within 0-9999
|
||||
Precision: 50
|
||||
log2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded
|
||||
log2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded
|
||||
log2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded
|
||||
log2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded
|
||||
log2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded
|
||||
log2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded
|
||||
log2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded
|
||||
log2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded
|
||||
log2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded
|
||||
log2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded
|
||||
log2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded
|
||||
log2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded
|
||||
log2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded
|
||||
log2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded
|
||||
log2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded
|
||||
log2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded
|
||||
log2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded
|
||||
log2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded
|
||||
log2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded
|
||||
log2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded
|
||||
log2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded
|
||||
log2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded
|
||||
log2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded
|
||||
log2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded
|
||||
log2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded
|
||||
log2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded
|
||||
log2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded
|
||||
log2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded
|
||||
log2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded
|
||||
log2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded
|
||||
log2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded
|
||||
log2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded
|
||||
log2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded
|
||||
log2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded
|
||||
log2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded
|
||||
log2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded
|
||||
log2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded
|
||||
log2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded
|
||||
log2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded
|
||||
log2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded
|
||||
|
||||
-- P=34, within 0-9999
|
||||
Precision: 34
|
||||
log2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded
|
||||
log2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded
|
||||
log2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded
|
||||
log2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded
|
||||
log2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded
|
||||
log2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded
|
||||
log2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded
|
||||
log2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded
|
||||
log2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded
|
||||
log2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded
|
||||
log2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded
|
||||
log2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded
|
||||
log2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded
|
||||
log2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded
|
||||
log2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded
|
||||
log2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded
|
||||
log2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded
|
||||
log2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded
|
||||
log2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded
|
||||
log2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded
|
||||
log2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded
|
||||
log2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded
|
||||
log2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded
|
||||
log2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded
|
||||
log2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded
|
||||
log2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded
|
||||
log2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded
|
||||
log2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded
|
||||
log2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded
|
||||
log2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded
|
||||
log2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded
|
||||
log2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded
|
||||
log2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded
|
||||
log2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded
|
||||
log2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded
|
||||
log2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded
|
||||
log2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded
|
||||
log2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded
|
||||
log2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded
|
||||
log2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded
|
||||
|
||||
-- P=16, within 0-999
|
||||
Precision: 16
|
||||
log2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded
|
||||
log2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded
|
||||
log2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded
|
||||
log2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded
|
||||
log2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded
|
||||
log2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded
|
||||
log2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded
|
||||
log2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded
|
||||
log2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded
|
||||
log2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded
|
||||
log2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded
|
||||
log2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded
|
||||
log2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded
|
||||
log2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded
|
||||
log2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded
|
||||
log2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded
|
||||
log2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded
|
||||
log2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded
|
||||
log2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded
|
||||
log2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded
|
||||
log2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded
|
||||
log2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded
|
||||
log2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded
|
||||
log2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded
|
||||
log2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded
|
||||
log2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded
|
||||
log2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded
|
||||
log2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded
|
||||
log2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded
|
||||
log2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded
|
||||
log2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded
|
||||
log2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded
|
||||
log2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded
|
||||
log2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded
|
||||
log2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded
|
||||
log2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded
|
||||
log2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded
|
||||
log2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded
|
||||
log2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded
|
||||
log2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded
|
||||
|
||||
-- P=7, within 0-99
|
||||
Precision: 7
|
||||
log2001 log10 57.26089 -> 1.757858 Inexact Rounded
|
||||
log2002 log10 0.0575421 -> -1.240014 Inexact Rounded
|
||||
log2003 log10 0.5918465 -> -0.2277909 Inexact Rounded
|
||||
log2004 log10 0.0068776 -> -2.162563 Inexact Rounded
|
||||
log2005 log10 0.0066833 -> -2.175009 Inexact Rounded
|
||||
log2006 log10 9.926963 -> 0.9968164 Inexact Rounded
|
||||
log2007 log10 0.0041852 -> -2.378284 Inexact Rounded
|
||||
log2008 log10 84.15412 -> 1.925075 Inexact Rounded
|
||||
log2009 log10 2.466856 -> 0.3921438 Inexact Rounded
|
||||
log2010 log10 0.0058047 -> -2.236220 Inexact Rounded
|
||||
log2011 log10 9.885154 -> 0.9949834 Inexact Rounded
|
||||
log2012 log10 0.6667654 -> -0.1760269 Inexact Rounded
|
||||
log2013 log10 34.65736 -> 1.539795 Inexact Rounded
|
||||
log2014 log10 0.0026884 -> -2.570506 Inexact Rounded
|
||||
log2015 log10 0.0432767 -> -1.363746 Inexact Rounded
|
||||
log2016 log10 66.01407 -> 1.819637 Inexact Rounded
|
||||
log2017 log10 0.0070572 -> -2.151368 Inexact Rounded
|
||||
log2018 log10 0.0731613 -> -1.135719 Inexact Rounded
|
||||
log2019 log10 9.838983 -> 0.9929502 Inexact Rounded
|
||||
log2020 log10 15.89696 -> 1.201314 Inexact Rounded
|
||||
log2021 log10 8.459247 -> 0.9273317 Inexact Rounded
|
||||
log2022 log10 0.0010873 -> -2.963651 Inexact Rounded
|
||||
log2023 log10 0.6498619 -> -0.1871789 Inexact Rounded
|
||||
log2024 log10 0.0847008 -> -1.072112 Inexact Rounded
|
||||
log2025 log10 0.0075489 -> -2.122116 Inexact Rounded
|
||||
log2026 log10 51.11152 -> 1.708519 Inexact Rounded
|
||||
log2027 log10 0.7233866 -> -0.1406295 Inexact Rounded
|
||||
log2028 log10 2.254721 -> 0.3530928 Inexact Rounded
|
||||
log2029 log10 6.568444 -> 0.8174625 Inexact Rounded
|
||||
log2030 log10 83.72639 -> 1.922862 Inexact Rounded
|
||||
log2031 log10 6.720585 -> 0.8274071 Inexact Rounded
|
||||
log2032 log10 87.90366 -> 1.944007 Inexact Rounded
|
||||
log2033 log10 0.0433324 -> -1.363187 Inexact Rounded
|
||||
log2034 log10 34.63912 -> 1.539567 Inexact Rounded
|
||||
log2035 log10 0.8089059 -> -0.09210200 Inexact Rounded
|
||||
log2036 log10 7.793405 -> 0.8917272 Inexact Rounded
|
||||
log2037 log10 0.0041757 -> -2.379271 Inexact Rounded
|
||||
log2038 log10 7.135417 -> 0.8534194 Inexact Rounded
|
||||
log2039 log10 12.49570 -> 1.096761 Inexact Rounded
|
||||
log2040 log10 6.356276 -> 0.8032027 Inexact Rounded
|
||||
|
||||
--------
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
|
||||
-- Invalid operations due to restrictions
|
||||
-- [next two probably skipped by most test harnesses]
|
||||
precision: 100000000
|
||||
log901 log10 ? -> ? Invalid_operation
|
||||
precision: 99999999
|
||||
log902 log10 0 -> ? Invalid_operation
|
||||
|
||||
precision: 9
|
||||
maxExponent: 1000000
|
||||
minExponent: -999999
|
||||
log903 log10 1 -> ? Invalid_context
|
||||
maxExponent: 999999
|
||||
minExponent: -999999
|
||||
log904 log10 0 -> ? Invalid_operation
|
||||
maxExponent: 999999
|
||||
minExponent: -1000000
|
||||
log905 log10 1 -> ? Invalid_context
|
||||
maxExponent: 999999
|
||||
minExponent: -999998
|
||||
log906 log10 0 -> ? Invalid_operation
|
||||
|
||||
-- Null test
|
||||
log900 log10 # -> ? Invalid_operation
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
------------------------------------------------------------------------
|
||||
-- max0.decTest -- decimal maximum (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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases, lost digits, and rounding
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
-- sanity checks
|
||||
max001 max -2 -2 -> -2
|
||||
max002 max -2 -1 -> -1
|
||||
max003 max -2 0 -> 0
|
||||
max004 max -2 1 -> 1
|
||||
max005 max -2 2 -> 2
|
||||
max006 max -1 -2 -> -1
|
||||
max007 max -1 -1 -> -1
|
||||
max008 max -1 0 -> 0
|
||||
max009 max -1 1 -> 1
|
||||
max010 max -1 2 -> 2
|
||||
max011 max 0 -2 -> 0
|
||||
max012 max 0 -1 -> 0
|
||||
max013 max 0 0 -> 0
|
||||
max014 max 0 1 -> 1
|
||||
max015 max 0 2 -> 2
|
||||
max016 max 1 -2 -> 1
|
||||
max017 max 1 -1 -> 1
|
||||
max018 max 1 0 -> 1
|
||||
max019 max 1 1 -> 1
|
||||
max020 max 1 2 -> 2
|
||||
max021 max 2 -2 -> 2
|
||||
max022 max 2 -1 -> 2
|
||||
max023 max 2 0 -> 2
|
||||
max025 max 2 1 -> 2
|
||||
max026 max 2 2 -> 2
|
||||
|
||||
-- lostDigits and input rounding checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
max101 max 12345678000 1 -> 1.23456780E+10 Rounded
|
||||
max102 max 1 12345678000 -> 1.23456780E+10 Rounded
|
||||
max103 max 1234567800 1 -> 1.23456780E+9 Rounded
|
||||
max104 max 1 1234567800 -> 1.23456780E+9 Rounded
|
||||
max105 max 1234567890 1 -> 1.23456789E+9 Rounded
|
||||
max106 max 1 1234567890 -> 1.23456789E+9 Rounded
|
||||
max107 max 1234567891 1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
max108 max 1 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
max109 max 12345678901 1 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
max110 max 1 12345678901 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
max111 max 1234567896 1 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
max112 max 1 1234567896 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
max113 max -1234567891 1 -> 1 Inexact Lost_digits Rounded
|
||||
max114 max 1 -1234567891 -> 1 Inexact Lost_digits Rounded
|
||||
max115 max -12345678901 1 -> 1 Inexact Lost_digits Rounded
|
||||
max116 max 1 -12345678901 -> 1 Inexact Lost_digits Rounded
|
||||
max117 max -1234567896 1 -> 1 Inexact Lost_digits Rounded
|
||||
max118 max 1 -1234567896 -> 1 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
max121 max 12345678000 1 -> 12345678000
|
||||
max122 max 1 12345678000 -> 12345678000
|
||||
max123 max 1234567800 1 -> 1234567800
|
||||
max124 max 1 1234567800 -> 1234567800
|
||||
max125 max 1234567890 1 -> 1234567890
|
||||
max126 max 1 1234567890 -> 1234567890
|
||||
max127 max 1234567891 1 -> 1234567891
|
||||
max128 max 1 1234567891 -> 1234567891
|
||||
max129 max 12345678901 1 -> 12345678901
|
||||
max130 max 1 12345678901 -> 12345678901
|
||||
max131 max 1234567896 1 -> 1234567896
|
||||
max132 max 1 1234567896 -> 1234567896
|
||||
max133 max -1234567891 1 -> 1
|
||||
max134 max 1 -1234567891 -> 1
|
||||
max135 max -12345678901 1 -> 1
|
||||
max136 max 1 -12345678901 -> 1
|
||||
max137 max -1234567896 1 -> 1
|
||||
max138 max 1 -1234567896 -> 1
|
||||
|
||||
-- from examples
|
||||
max180 max '3' '2' -> '3'
|
||||
max181 max '-10' '3' -> '3'
|
||||
max182 max '1.0' '1' -> '1.0'
|
||||
max183 max '1' '1.0' -> '1'
|
||||
|
||||
-- Null tests
|
||||
max900 max 10 # -> ? Invalid_operation
|
||||
max901 max # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
------------------------------------------------------------------------
|
||||
-- min0.decTest -- decimal minimum (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
|
||||
|
||||
-- we assume that base comparison is tested in compare.decTest, so
|
||||
-- these mainly cover special cases, lost digits, and rounding
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
-- sanity checks
|
||||
mnm001 min -2 -2 -> -2
|
||||
mnm002 min -2 -1 -> -2
|
||||
mnm003 min -2 0 -> -2
|
||||
mnm004 min -2 1 -> -2
|
||||
mnm005 min -2 2 -> -2
|
||||
mnm006 min -1 -2 -> -2
|
||||
mnm007 min -1 -1 -> -1
|
||||
mnm008 min -1 0 -> -1
|
||||
mnm009 min -1 1 -> -1
|
||||
mnm010 min -1 2 -> -1
|
||||
mnm011 min 0 -2 -> -2
|
||||
mnm012 min 0 -1 -> -1
|
||||
mnm013 min 0 0 -> 0
|
||||
mnm014 min 0 1 -> 0
|
||||
mnm015 min 0 2 -> 0
|
||||
mnm016 min 1 -2 -> -2
|
||||
mnm017 min 1 -1 -> -1
|
||||
mnm018 min 1 0 -> 0
|
||||
mnm019 min 1 1 -> 1
|
||||
mnm020 min 1 2 -> 1
|
||||
mnm021 min 2 -2 -> -2
|
||||
mnm022 min 2 -1 -> -1
|
||||
mnm023 min 2 0 -> 0
|
||||
mnm025 min 2 1 -> 1
|
||||
mnm026 min 2 2 -> 2
|
||||
|
||||
-- lostDigits and input rounding checks
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
mnm101 min -12345678000 1 -> -1.23456780E+10 Rounded
|
||||
mnm102 min 1 -12345678000 -> -1.23456780E+10 Rounded
|
||||
mnm103 min -1234567800 1 -> -1.23456780E+9 Rounded
|
||||
mnm104 min 1 -1234567800 -> -1.23456780E+9 Rounded
|
||||
mnm105 min -1234567890 1 -> -1.23456789E+9 Rounded
|
||||
mnm106 min 1 -1234567890 -> -1.23456789E+9 Rounded
|
||||
mnm107 min -1234567891 1 -> -1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mnm108 min 1 -1234567891 -> -1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mnm109 min -12345678901 1 -> -1.23456789E+10 Inexact Lost_digits Rounded
|
||||
mnm110 min 1 -12345678901 -> -1.23456789E+10 Inexact Lost_digits Rounded
|
||||
mnm111 min -1234567896 1 -> -1.23456790E+9 Inexact Lost_digits Rounded
|
||||
mnm112 min 1 -1234567896 -> -1.23456790E+9 Inexact Lost_digits Rounded
|
||||
mnm113 min 1234567891 1 -> 1 Inexact Lost_digits Rounded
|
||||
mnm114 min 1 1234567891 -> 1 Inexact Lost_digits Rounded
|
||||
mnm115 min 12345678901 1 -> 1 Inexact Lost_digits Rounded
|
||||
mnm116 min 1 12345678901 -> 1 Inexact Lost_digits Rounded
|
||||
mnm117 min 1234567896 1 -> 1 Inexact Lost_digits Rounded
|
||||
mnm118 min 1 1234567896 -> 1 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
mnm121 min -12345678000 1 -> -12345678000
|
||||
mnm122 min 1 -12345678000 -> -12345678000
|
||||
mnm123 min -1234567800 1 -> -1234567800
|
||||
mnm124 min 1 -1234567800 -> -1234567800
|
||||
mnm125 min -1234567890 1 -> -1234567890
|
||||
mnm126 min 1 -1234567890 -> -1234567890
|
||||
mnm127 min -1234567891 1 -> -1234567891
|
||||
mnm128 min 1 -1234567891 -> -1234567891
|
||||
mnm129 min -12345678901 1 -> -12345678901
|
||||
mnm130 min 1 -12345678901 -> -12345678901
|
||||
mnm131 min -1234567896 1 -> -1234567896
|
||||
mnm132 min 1 -1234567896 -> -1234567896
|
||||
mnm133 min 1234567891 1 -> 1
|
||||
mnm134 min 1 1234567891 -> 1
|
||||
mnm135 min 12345678901 1 -> 1
|
||||
mnm136 min 1 12345678901 -> 1
|
||||
mnm137 min 1234567896 1 -> 1
|
||||
mnm138 min 1 1234567896 -> 1
|
||||
|
||||
-- from examples
|
||||
mnm180 min '3' '2' -> '2'
|
||||
mnm181 min '-10' '3' -> '-10'
|
||||
mnm182 min '1.0' '1' -> '1.0'
|
||||
mnm183 min '1' '1.0' -> '1'
|
||||
|
||||
-- Null tests
|
||||
mnm900 min 10 # -> ? Invalid_operation
|
||||
mnm901 min # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
------------------------------------------------------------------------
|
||||
-- minus0.decTest -- decimal negation (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
|
||||
|
||||
-- This set of tests primarily tests the existence of the operator.
|
||||
-- Subtraction, rounding, and more overflows are tested elsewhere.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
min001 minus '1' -> '-1'
|
||||
min002 minus '-1' -> '1'
|
||||
min003 minus '1.00' -> '-1.00'
|
||||
min004 minus '-1.00' -> '1.00'
|
||||
min005 minus '0' -> '0'
|
||||
min006 minus '0.00' -> '0'
|
||||
min007 minus '00.0' -> '0'
|
||||
min008 minus '00.00' -> '0'
|
||||
min009 minus '00' -> '0'
|
||||
|
||||
min010 minus '-2' -> '2'
|
||||
min011 minus '2' -> '-2'
|
||||
min012 minus '-2.00' -> '2.00'
|
||||
min013 minus '2.00' -> '-2.00'
|
||||
min014 minus '-0' -> '0'
|
||||
min015 minus '-0.00' -> '0'
|
||||
min016 minus '-00.0' -> '0'
|
||||
min017 minus '-00.00' -> '0'
|
||||
min018 minus '-00' -> '0'
|
||||
|
||||
min020 minus '-2000000' -> '2000000'
|
||||
min021 minus '2000000' -> '-2000000'
|
||||
precision: 7
|
||||
min022 minus '-2000000' -> '2000000'
|
||||
min023 minus '2000000' -> '-2000000'
|
||||
precision: 6
|
||||
min024 minus '-2000000' -> '2.00000E+6' Rounded
|
||||
min025 minus '2000000' -> '-2.00000E+6' Rounded
|
||||
precision: 3
|
||||
min026 minus '-2000000' -> '2.00E+6' Rounded
|
||||
min027 minus '2000000' -> '-2.00E+6' Rounded
|
||||
|
||||
-- more fixed, potential LHS swaps/overlays if done by subtract 0
|
||||
precision: 9
|
||||
min060 minus '-56267E-10' -> '0.0000056267'
|
||||
min061 minus '-56267E-5' -> '0.56267'
|
||||
min062 minus '-56267E-2' -> '562.67'
|
||||
min063 minus '-56267E-1' -> '5626.7'
|
||||
min065 minus '-56267E-0' -> '56267'
|
||||
|
||||
-- overflow tests [underflow not possible]
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 3
|
||||
min120 minus 9.999E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
min301 minus 12345678000 -> -1.23456780E+10 Rounded
|
||||
min302 minus 1234567800 -> -1.23456780E+9 Rounded
|
||||
min303 minus 1234567890 -> -1.23456789E+9 Rounded
|
||||
min304 minus 1234567891 -> -1.23456789E+9 Inexact Lost_digits Rounded
|
||||
min305 minus 12345678901 -> -1.23456789E+10 Inexact Lost_digits Rounded
|
||||
min306 minus 1234567896 -> -1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
min321 minus 12345678000 -> -12345678000
|
||||
min322 minus 1234567800 -> -1234567800
|
||||
min323 minus 1234567890 -> -1234567890
|
||||
min324 minus 1234567891 -> -1234567891
|
||||
min325 minus 12345678901 -> -12345678901
|
||||
min326 minus 1234567896 -> -1234567896
|
||||
|
||||
-- Null tests
|
||||
min400 minus # -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
------------------------------------------------------------------------
|
||||
-- multiply0.decTest -- decimal multiplication (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
|
||||
|
||||
mul000 multiply 2 2 -> 4
|
||||
mul001 multiply 2 3 -> 6
|
||||
mul002 multiply 5 1 -> 5
|
||||
mul003 multiply 5 2 -> 10
|
||||
mul004 multiply 1.20 2 -> 2.40
|
||||
mul005 multiply 1.20 0 -> 0
|
||||
mul006 multiply 1.20 -2 -> -2.40
|
||||
mul007 multiply -1.20 2 -> -2.40
|
||||
mul008 multiply -1.20 0 -> 0
|
||||
mul009 multiply -1.20 -2 -> 2.40
|
||||
mul010 multiply 5.09 7.1 -> 36.139
|
||||
mul011 multiply 2.5 4 -> 10.0
|
||||
mul012 multiply 2.50 4 -> 10.00
|
||||
mul013 multiply 1.23456789 1.00000000 -> 1.23456789 Rounded
|
||||
mul014 multiply 9.999999999 9.999999999 -> 100.000000 Inexact Lost_digits Rounded
|
||||
mul015 multiply 2.50 4 -> 10.00
|
||||
|
||||
precision: 6
|
||||
mul016 multiply 2.50 4 -> 10.00
|
||||
mul017 multiply 9.999999999 9.999999999 -> 100.000 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 9
|
||||
mul031 multiply 5.00 1E-3 -> 0.00500
|
||||
mul032 multiply 00.00 0.000 -> 0
|
||||
mul033 multiply 00.00 0E-3 -> 0 -- rhs is 0
|
||||
mul034 multiply 0E-3 00.00 -> 0 -- lhs is 0
|
||||
|
||||
-- 1999.12.21: next one is a edge case if intermediate longs are used
|
||||
precision: 15
|
||||
mul039 multiply 999999999999 9765625 -> 9.76562499999023E+18 Inexact Rounded
|
||||
precision: 9
|
||||
|
||||
mul050 multiply 123.45 1e7 -> 1.2345E+9
|
||||
mul051 multiply 123.45 1e8 -> 1.2345E+10
|
||||
mul052 multiply 123.45 1e+9 -> 1.2345E+11
|
||||
mul053 multiply 123.45 1e10 -> 1.2345E+12
|
||||
mul054 multiply 123.45 1e11 -> 1.2345E+13
|
||||
mul055 multiply 123.45 1e12 -> 1.2345E+14
|
||||
mul056 multiply 123.45 1e13 -> 1.2345E+15
|
||||
|
||||
|
||||
-- test some intermediate lengths
|
||||
precision: 9
|
||||
mul080 multiply 0.1 123456789 -> 12345678.9
|
||||
mul081 multiply 0.1 1234567891 -> 123456789 Inexact Lost_digits Rounded
|
||||
mul082 multiply 0.1 12345678912 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mul083 multiply 0.1 12345678912345 -> 1.23456789E+12 Inexact Lost_digits Rounded
|
||||
mul084 multiply 0.1 123456789 -> 12345678.9
|
||||
precision: 8
|
||||
mul085 multiply 0.1 12345678912 -> 1.2345679E+9 Inexact Lost_digits Rounded
|
||||
mul086 multiply 0.1 12345678912345 -> 1.2345679E+12 Inexact Lost_digits Rounded
|
||||
precision: 7
|
||||
mul087 multiply 0.1 12345678912 -> 1.234568E+9 Inexact Lost_digits Rounded
|
||||
mul088 multiply 0.1 12345678912345 -> 1.234568E+12 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 9
|
||||
mul090 multiply 123456789 0.1 -> 12345678.9
|
||||
mul091 multiply 1234567891 0.1 -> 123456789 Inexact Lost_digits Rounded
|
||||
mul092 multiply 12345678912 0.1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mul093 multiply 12345678912345 0.1 -> 1.23456789E+12 Inexact Lost_digits Rounded
|
||||
mul094 multiply 123456789 0.1 -> 12345678.9
|
||||
precision: 8
|
||||
mul095 multiply 12345678912 0.1 -> 1.2345679E+9 Inexact Lost_digits Rounded
|
||||
mul096 multiply 12345678912345 0.1 -> 1.2345679E+12 Inexact Lost_digits Rounded
|
||||
precision: 7
|
||||
mul097 multiply 12345678912 0.1 -> 1.234568E+9 Inexact Lost_digits Rounded
|
||||
mul098 multiply 12345678912345 0.1 -> 1.234568E+12 Inexact Lost_digits Rounded
|
||||
|
||||
-- test some more edge cases and carries
|
||||
maxexponent: 9999
|
||||
minexponent: -9999
|
||||
precision: 33
|
||||
mul101 multiply 9 9 -> 81
|
||||
mul102 multiply 9 90 -> 810
|
||||
mul103 multiply 9 900 -> 8100
|
||||
mul104 multiply 9 9000 -> 81000
|
||||
mul105 multiply 9 90000 -> 810000
|
||||
mul106 multiply 9 900000 -> 8100000
|
||||
mul107 multiply 9 9000000 -> 81000000
|
||||
mul108 multiply 9 90000000 -> 810000000
|
||||
mul109 multiply 9 900000000 -> 8100000000
|
||||
mul110 multiply 9 9000000000 -> 81000000000
|
||||
mul111 multiply 9 90000000000 -> 810000000000
|
||||
mul112 multiply 9 900000000000 -> 8100000000000
|
||||
mul113 multiply 9 9000000000000 -> 81000000000000
|
||||
mul114 multiply 9 90000000000000 -> 810000000000000
|
||||
mul115 multiply 9 900000000000000 -> 8100000000000000
|
||||
mul116 multiply 9 9000000000000000 -> 81000000000000000
|
||||
mul117 multiply 9 90000000000000000 -> 810000000000000000
|
||||
mul118 multiply 9 900000000000000000 -> 8100000000000000000
|
||||
mul119 multiply 9 9000000000000000000 -> 81000000000000000000
|
||||
mul120 multiply 9 90000000000000000000 -> 810000000000000000000
|
||||
mul121 multiply 9 900000000000000000000 -> 8100000000000000000000
|
||||
mul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
|
||||
mul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
|
||||
-- test some more edge cases without carries
|
||||
mul131 multiply 3 3 -> 9
|
||||
mul132 multiply 3 30 -> 90
|
||||
mul133 multiply 3 300 -> 900
|
||||
mul134 multiply 3 3000 -> 9000
|
||||
mul135 multiply 3 30000 -> 90000
|
||||
mul136 multiply 3 300000 -> 900000
|
||||
mul137 multiply 3 3000000 -> 9000000
|
||||
mul138 multiply 3 30000000 -> 90000000
|
||||
mul139 multiply 3 300000000 -> 900000000
|
||||
mul140 multiply 3 3000000000 -> 9000000000
|
||||
mul141 multiply 3 30000000000 -> 90000000000
|
||||
mul142 multiply 3 300000000000 -> 900000000000
|
||||
mul143 multiply 3 3000000000000 -> 9000000000000
|
||||
mul144 multiply 3 30000000000000 -> 90000000000000
|
||||
mul145 multiply 3 300000000000000 -> 900000000000000
|
||||
mul146 multiply 3 3000000000000000 -> 9000000000000000
|
||||
mul147 multiply 3 30000000000000000 -> 90000000000000000
|
||||
mul148 multiply 3 300000000000000000 -> 900000000000000000
|
||||
mul149 multiply 3 3000000000000000000 -> 9000000000000000000
|
||||
mul150 multiply 3 30000000000000000000 -> 90000000000000000000
|
||||
mul151 multiply 3 300000000000000000000 -> 900000000000000000000
|
||||
mul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
|
||||
mul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
|
||||
|
||||
-- 1999.12.21: next one is a edge case if intermediate longs are used
|
||||
precision: 30
|
||||
mul160 multiply 999999999999 9765625 -> 9765624999990234375
|
||||
precision: 9
|
||||
-----
|
||||
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
-- test some cases that are close to exponent overflow/underflow
|
||||
mul170 multiply 1 9e999999999 -> 9E+999999999
|
||||
mul171 multiply 1 9.9e999999999 -> 9.9E+999999999
|
||||
mul172 multiply 1 9.99e999999999 -> 9.99E+999999999
|
||||
mul173 multiply 9e999999999 1 -> 9E+999999999
|
||||
mul174 multiply 9.9e999999999 1 -> 9.9E+999999999
|
||||
mul176 multiply 9.99e999999999 1 -> 9.99E+999999999
|
||||
mul177 multiply 1 9.99999999e999999999 -> 9.99999999E+999999999
|
||||
mul178 multiply 9.99999999e999999999 1 -> 9.99999999E+999999999
|
||||
|
||||
mul180 multiply 0.1 9e-999999998 -> 9E-999999999
|
||||
mul181 multiply 0.1 99e-999999998 -> 9.9E-999999998
|
||||
mul182 multiply 0.1 999e-999999998 -> 9.99E-999999997
|
||||
|
||||
mul183 multiply 0.1 9e-999999998 -> 9E-999999999
|
||||
mul184 multiply 0.1 99e-999999998 -> 9.9E-999999998
|
||||
mul185 multiply 0.1 999e-999999998 -> 9.99E-999999997
|
||||
mul186 multiply 0.1 999e-999999997 -> 9.99E-999999996
|
||||
mul187 multiply 0.1 9999e-999999997 -> 9.999E-999999995
|
||||
mul188 multiply 0.1 99999e-999999997 -> 9.9999E-999999994
|
||||
|
||||
mul190 multiply 1 9e-999999998 -> 9E-999999998
|
||||
mul191 multiply 1 99e-999999998 -> 9.9E-999999997
|
||||
mul192 multiply 1 999e-999999998 -> 9.99E-999999996
|
||||
mul193 multiply 9e-999999998 1 -> 9E-999999998
|
||||
mul194 multiply 99e-999999998 1 -> 9.9E-999999997
|
||||
mul195 multiply 999e-999999998 1 -> 9.99E-999999996
|
||||
|
||||
mul196 multiply 1e-599999999 1e-400000000 -> 1E-999999999
|
||||
mul197 multiply 1e-600000000 1e-399999999 -> 1E-999999999
|
||||
mul198 multiply 1.2e-599999999 1.2e-400000000 -> 1.44E-999999999
|
||||
mul199 multiply 1.2e-600000000 1.2e-399999999 -> 1.44E-999999999
|
||||
|
||||
mul201 multiply 1e599999999 1e400000000 -> 1E+999999999
|
||||
mul202 multiply 1e600000000 1e399999999 -> 1E+999999999
|
||||
mul203 multiply 1.2e599999999 1.2e400000000 -> 1.44E+999999999
|
||||
mul204 multiply 1.2e600000000 1.2e399999999 -> 1.44E+999999999
|
||||
|
||||
-- overflow and underflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
mul230 multiply +1.23456789012345E-0 9E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
mul231 multiply 9E+999999999 +1.23456789012345E-0 -> ? Inexact Lost_digits Overflow Rounded
|
||||
mul232 multiply +0.100 9E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul233 multiply 9E-999999999 +0.100 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul235 multiply -1.23456789012345E-0 9E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
mul236 multiply 9E+999999999 -1.23456789012345E-0 -> ? Inexact Lost_digits Overflow Rounded
|
||||
mul237 multiply -0.100 9E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul238 multiply 9E-999999999 -0.100 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
mul239 multiply 1e-599999999 1e-400000001 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul240 multiply 1e-599999999 1e-400000000 -> 1E-999999999
|
||||
mul241 multiply 1e-600000000 1e-400000000 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul242 multiply 9e-999999998 0.01 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul243 multiply 9e-999999998 0.1 -> 9E-999999999
|
||||
mul244 multiply 0.01 9e-999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul245 multiply 1e599999999 1e400000001 -> ? Overflow Inexact Rounded
|
||||
mul246 multiply 1e599999999 1e400000000 -> 1E+999999999
|
||||
mul247 multiply 1e600000000 1e400000000 -> ? Overflow Inexact Rounded
|
||||
mul248 multiply 9e999999998 100 -> ? Overflow Inexact Rounded
|
||||
mul249 multiply 9e999999998 10 -> 9.0E+999999999
|
||||
mul250 multiply 100 9e999999998 -> ? Overflow Inexact Rounded
|
||||
|
||||
-- 'subnormal' results (all underflow or overflow in base arithemtic)
|
||||
precision: 9
|
||||
mul260 multiply 1e-600000000 1e-400000001 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul261 multiply 1e-600000000 1e-400000002 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul262 multiply 1e-600000000 1e-400000003 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul263 multiply 1e-600000000 1e-400000004 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul264 multiply 1e-600000000 1e-400000005 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul265 multiply 1e-600000000 1e-400000006 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul266 multiply 1e-600000000 1e-400000007 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul267 multiply 1e-600000000 1e-400000008 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul268 multiply 1e-600000000 1e-400000009 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul269 multiply 1e-600000000 1e-400000010 -> ? Underflow Subnormal Inexact Rounded
|
||||
mul270 multiply 1e+600000000 1e+400000001 -> ? Overflow Inexact Rounded
|
||||
mul271 multiply 1e+600000000 1e+400000002 -> ? Overflow Inexact Rounded
|
||||
mul272 multiply 1e+600000000 1e+400000003 -> ? Overflow Inexact Rounded
|
||||
mul273 multiply 1e+600000000 1e+400000004 -> ? Overflow Inexact Rounded
|
||||
mul274 multiply 1e+600000000 1e+400000005 -> ? Overflow Inexact Rounded
|
||||
mul275 multiply 1e+600000000 1e+400000006 -> ? Overflow Inexact Rounded
|
||||
mul276 multiply 1e+600000000 1e+400000007 -> ? Overflow Inexact Rounded
|
||||
mul277 multiply 1e+600000000 1e+400000008 -> ? Overflow Inexact Rounded
|
||||
mul278 multiply 1e+600000000 1e+400000009 -> ? Overflow Inexact Rounded
|
||||
mul279 multiply 1e+600000000 1e+400000010 -> ? Overflow Inexact Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
mul301 multiply 12345678000 1 -> 1.23456780E+10 Rounded
|
||||
mul302 multiply 1 12345678000 -> 1.23456780E+10 Rounded
|
||||
mul303 multiply 1234567800 1 -> 1.23456780E+9 Rounded
|
||||
mul304 multiply 1 1234567800 -> 1.23456780E+9 Rounded
|
||||
mul305 multiply 1234567890 1 -> 1.23456789E+9 Rounded
|
||||
mul306 multiply 1 1234567890 -> 1.23456789E+9 Rounded
|
||||
mul307 multiply 1234567891 1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mul308 multiply 1 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
mul309 multiply 12345678901 1 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
mul310 multiply 1 12345678901 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
mul311 multiply 1234567896 1 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
mul312 multiply 1 1234567896 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
mul341 multiply 12345678000 1 -> 12345678000
|
||||
mul342 multiply 1 12345678000 -> 12345678000
|
||||
mul343 multiply 1234567800 1 -> 1234567800
|
||||
mul344 multiply 1 1234567800 -> 1234567800
|
||||
mul345 multiply 1234567890 1 -> 1234567890
|
||||
mul346 multiply 1 1234567890 -> 1234567890
|
||||
mul347 multiply 1234567891 1 -> 1234567891
|
||||
mul348 multiply 1 1234567891 -> 1234567891
|
||||
mul349 multiply 12345678901 1 -> 12345678901
|
||||
mul350 multiply 1 12345678901 -> 12345678901
|
||||
mul351 multiply 1234567896 1 -> 1234567896
|
||||
mul352 multiply 1 1234567896 -> 1234567896
|
||||
|
||||
-- Null tests
|
||||
mul400 multiply 10 # -> ? Invalid_operation
|
||||
mul401 multiply # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
------------------------------------------------------------------------
|
||||
-- plus0.decTest -- decimal monadic addition (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
|
||||
|
||||
-- This set of tests primarily tests the existence of the operator.
|
||||
-- Addition and rounding, and most overflows, are tested elsewhere.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
plu001 plus '1' -> '1'
|
||||
plu002 plus '-1' -> '-1'
|
||||
plu003 plus '1.00' -> '1.00'
|
||||
plu004 plus '-1.00' -> '-1.00'
|
||||
plu005 plus '0' -> '0'
|
||||
plu006 plus '0.00' -> '0'
|
||||
plu007 plus '00.0' -> '0'
|
||||
plu008 plus '00.00' -> '0'
|
||||
plu009 plus '00' -> '0'
|
||||
|
||||
plu010 plus '-2' -> '-2'
|
||||
plu011 plus '2' -> '2'
|
||||
plu012 plus '-2.00' -> '-2.00'
|
||||
plu013 plus '2.00' -> '2.00'
|
||||
plu014 plus '-0' -> '0'
|
||||
plu015 plus '-0.00' -> '0'
|
||||
plu016 plus '-00.0' -> '0'
|
||||
plu017 plus '-00.00' -> '0'
|
||||
plu018 plus '-00' -> '0'
|
||||
|
||||
plu020 plus '-2000000' -> '-2000000'
|
||||
plu021 plus '2000000' -> '2000000'
|
||||
precision: 7
|
||||
plu022 plus '-2000000' -> '-2000000'
|
||||
plu023 plus '2000000' -> '2000000'
|
||||
precision: 6
|
||||
plu024 plus '-2000000' -> '-2.00000E+6' Rounded
|
||||
plu025 plus '2000000' -> '2.00000E+6' Rounded
|
||||
precision: 3
|
||||
plu026 plus '-2000000' -> '-2.00E+6' Rounded
|
||||
plu027 plus '2000000' -> '2.00E+6' Rounded
|
||||
|
||||
-- more fixed, potential LHS swaps if done by add 0
|
||||
precision: 9
|
||||
plu060 plus '56267E-10' -> '0.0000056267'
|
||||
plu061 plus '56267E-5' -> '0.56267'
|
||||
plu062 plus '56267E-2' -> '562.67'
|
||||
plu063 plus '56267E-1' -> '5626.7'
|
||||
plu065 plus '56267E-0' -> '56267'
|
||||
plu066 plus '56267E+0' -> '56267'
|
||||
plu067 plus '56267E+1' -> '562670'
|
||||
plu068 plus '56267E+2' -> '5626700'
|
||||
plu069 plus '56267E+3' -> '56267000'
|
||||
plu070 plus '56267E+4' -> '562670000'
|
||||
plu071 plus '56267E+5' -> '5.6267E+9'
|
||||
plu072 plus '56267E+6' -> '5.6267E+10'
|
||||
plu080 plus '-56267E-10' -> '-0.0000056267'
|
||||
plu081 plus '-56267E-5' -> '-0.56267'
|
||||
plu082 plus '-56267E-2' -> '-562.67'
|
||||
plu083 plus '-56267E-1' -> '-5626.7'
|
||||
plu085 plus '-56267E-0' -> '-56267'
|
||||
plu086 plus '-56267E+0' -> '-56267'
|
||||
plu087 plus '-56267E+1' -> '-562670'
|
||||
plu088 plus '-56267E+2' -> '-5626700'
|
||||
plu089 plus '-56267E+3' -> '-56267000'
|
||||
plu090 plus '-56267E+4' -> '-562670000'
|
||||
plu091 plus '-56267E+5' -> '-5.6267E+9'
|
||||
plu092 plus '-56267E+6' -> '-5.6267E+10'
|
||||
|
||||
-- overflow tests [underflow not possible]
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 3
|
||||
plu120 plus 9.999E+999999999 -> ? Inexact Lost_digits Overflow Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
plu301 plus 12345678000 -> 1.23456780E+10 Rounded
|
||||
plu302 plus 1234567800 -> 1.23456780E+9 Rounded
|
||||
plu303 plus 1234567890 -> 1.23456789E+9 Rounded
|
||||
plu304 plus 1234567891 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
plu305 plus 12345678901 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
plu306 plus 1234567896 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
plu321 plus 12345678000 -> 12345678000
|
||||
plu322 plus 1234567800 -> 1234567800
|
||||
plu323 plus 1234567890 -> 1234567890
|
||||
plu324 plus 1234567891 -> 1234567891
|
||||
plu325 plus 12345678901 -> 12345678901
|
||||
plu326 plus 1234567896 -> 1234567896
|
||||
|
||||
-- Null tests
|
||||
plu400 plus # -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,391 @@
|
||||
------------------------------------------------------------------------
|
||||
-- power0.decTest -- decimal exponentiation (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
|
||||
|
||||
-- This set of testcases tests raising numbers to an integer power only.
|
||||
-- If arbitrary powers were supported, 1 ulp differences would be
|
||||
-- permitted.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
pow001 power '0' '0' -> '1'
|
||||
pow002 power '0' '1' -> '0'
|
||||
pow003 power '0' '2' -> '0'
|
||||
pow004 power '1' '0' -> '1'
|
||||
pow005 power '1' '1' -> '1'
|
||||
pow006 power '1' '2' -> '1'
|
||||
|
||||
pow010 power '2' '0' -> '1'
|
||||
pow011 power '2' '1' -> '2'
|
||||
pow012 power '2' '2' -> '4'
|
||||
pow013 power '2' '3' -> '8'
|
||||
pow014 power '2' '4' -> '16'
|
||||
pow015 power '2' '5' -> '32'
|
||||
pow016 power '2' '6' -> '64'
|
||||
pow017 power '2' '7' -> '128'
|
||||
pow018 power '2' '8' -> '256'
|
||||
pow019 power '2' '9' -> '512'
|
||||
pow020 power '2' '10' -> '1024'
|
||||
pow021 power '2' '11' -> '2048'
|
||||
pow022 power '2' '12' -> '4096'
|
||||
pow023 power '2' '15' -> '32768'
|
||||
pow024 power '2' '16' -> '65536'
|
||||
pow025 power '2' '31' -> '2.14748365E+9' Inexact Rounded
|
||||
-- NB 0 stripped in next
|
||||
pow026 power '2' '32' -> '4.2949673E+9' Inexact Rounded
|
||||
precision: 10
|
||||
pow027 power '2' '31' -> '2147483648'
|
||||
pow028 power '2' '32' -> '4294967296'
|
||||
precision: 9
|
||||
|
||||
pow030 power '3' '2' -> 9
|
||||
pow031 power '4' '2' -> 16
|
||||
pow032 power '5' '2' -> 25
|
||||
pow033 power '6' '2' -> 36
|
||||
pow034 power '7' '2' -> 49
|
||||
pow035 power '8' '2' -> 64
|
||||
pow036 power '9' '2' -> 81
|
||||
pow037 power '10' '2' -> 100
|
||||
pow038 power '11' '2' -> 121
|
||||
pow039 power '12' '2' -> 144
|
||||
|
||||
pow040 power '3' '3' -> 27
|
||||
pow041 power '4' '3' -> 64
|
||||
pow042 power '5' '3' -> 125
|
||||
pow043 power '6' '3' -> 216
|
||||
pow044 power '7' '3' -> 343
|
||||
|
||||
pow050 power '10' '0' -> 1
|
||||
pow051 power '10' '1' -> 10
|
||||
pow052 power '10' '2' -> 100
|
||||
pow053 power '10' '3' -> 1000
|
||||
pow054 power '10' '4' -> 10000
|
||||
pow055 power '10' '5' -> 100000
|
||||
pow056 power '10' '6' -> 1000000
|
||||
pow057 power '10' '7' -> 10000000
|
||||
pow058 power '10' '8' -> 100000000
|
||||
pow059 power '10' '9' -> 1E+9 Rounded
|
||||
pow060 power '10' '22' -> 1E+22 Rounded
|
||||
pow061 power '10' '77' -> 1E+77 Rounded
|
||||
pow062 power '10' '99' -> 1E+99 Rounded
|
||||
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
pow063 power '10' '999999999' -> '1E+999999999' Rounded
|
||||
pow064 power '10' '999999998' -> '1E+999999998' Rounded
|
||||
pow065 power '10' '999999997' -> '1E+999999997' Rounded
|
||||
pow066 power '10' '333333333' -> '1E+333333333' Rounded
|
||||
maxexponent: 999999
|
||||
minexponent: -999999
|
||||
|
||||
pow070 power '0.3' '0' -> '1'
|
||||
pow071 power '0.3' '1' -> '0.3'
|
||||
pow072 power '0.3' '1.00' -> '0.3'
|
||||
pow073 power '0.3' '2.00' -> '0.09'
|
||||
pow074 power '0.3' '2.000000000' -> '0.09' Rounded
|
||||
pow075 power '6.0' '2' -> '36'
|
||||
pow076 power '-3' '2' -> '9' -- from NetRexx book
|
||||
pow077 power '4' '3' -> '64' -- .. (sort of)
|
||||
|
||||
pow080 power 0.1 0 -> 1
|
||||
pow081 power 0.1 1 -> 0.1
|
||||
pow082 power 0.1 2 -> 0.01
|
||||
pow083 power 0.1 3 -> 0.001
|
||||
pow084 power 0.1 4 -> 0.0001
|
||||
pow085 power 0.1 5 -> 0.00001
|
||||
pow086 power 0.1 6 -> 0.000001
|
||||
pow087 power 0.1 7 -> 1E-7
|
||||
pow088 power 0.1 8 -> 1E-8
|
||||
pow089 power 0.1 9 -> 1E-9
|
||||
|
||||
pow090 power 101 2 -> 10201
|
||||
pow091 power 101 3 -> 1030301
|
||||
pow092 power 101 4 -> 104060401
|
||||
pow093 power 101 5 -> 1.05101005E+10 Inexact Rounded
|
||||
pow094 power 101 6 -> 1.06152015E+12 Inexact Rounded
|
||||
pow095 power 101 7 -> 1.07213535E+14 Inexact Rounded
|
||||
|
||||
-- negative powers
|
||||
pow100 power '0' '-1' -> ? Invalid_operation
|
||||
pow101 power '2' '-1' -> 0.5
|
||||
pow102 power '2' '-2' -> 0.25
|
||||
pow103 power '2' '-4' -> 0.0625
|
||||
pow104 power '2' '-8' -> 0.00390625
|
||||
pow105 power '2' '-16' -> 0.0000152587891 Inexact Rounded
|
||||
pow106 power '2' '-32' -> 2.32830644E-10 Inexact Rounded
|
||||
pow108 power '2' '-64' -> 5.42101086E-20 Inexact Rounded
|
||||
pow110 power '10' '-8' -> 1E-8
|
||||
pow111 power '10' '-7' -> 1E-7
|
||||
pow112 power '10' '-6' -> 0.000001
|
||||
pow113 power '10' '-5' -> 0.00001
|
||||
pow114 power '10' '-4' -> 0.0001
|
||||
pow115 power '10' '-3' -> 0.001
|
||||
pow116 power '10' '-2' -> 0.01
|
||||
pow117 power '10' '-1' -> 0.1
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
pow118 power '10' '-333333333' -> 1E-333333333 Rounded
|
||||
pow119 power '10' '-999999998' -> 1E-999999998 Rounded
|
||||
pow120 power '10' '-999999999' -> 1E-999999999 Rounded
|
||||
maxexponent: 999999
|
||||
minexponent: -999999
|
||||
pow121 power '10' '-77' -> '1E-77' Rounded
|
||||
pow122 power '10' '-22' -> '1E-22' Rounded
|
||||
pow123 power '2' '-1' -> '0.5'
|
||||
pow124 power '2' '-2' -> '0.25'
|
||||
pow125 power '2' '-4' -> '0.0625'
|
||||
pow126 power '0' '-1' -> ? Invalid_operation
|
||||
pow127 power '0' '-2' -> ? Invalid_operation
|
||||
|
||||
-- out-of-range edge cases
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
pow181 power '7' '999999998' -> 2.10892313E+845098038 Inexact Rounded
|
||||
pow182 power '7' '999999999' -> 1.47624619E+845098039 Inexact Rounded
|
||||
pow183 power '7' '1000000000' -> ? Invalid_context Rounded
|
||||
pow184 power '7' '1000000001' -> ? Invalid_context Inexact Lost_digits Rounded
|
||||
pow186 power '7' '-1000000001' -> 9.67705411E-845098041 Inexact Lost_digits Rounded
|
||||
pow187 power '7' '-1000000000' -> 9.67705411E-845098041 Inexact Rounded
|
||||
pow189 power '7' '-999999999' -> 6.77393787E-845098040 Inexact Rounded
|
||||
pow190 power '7' '-999999998' -> 4.74175651E-845098039 Inexact Rounded
|
||||
|
||||
maxexponent: 999999
|
||||
minexponent: -999999
|
||||
|
||||
-- "0.5" tests from original Rexx diagnostics [loop unrolled]
|
||||
pow200 power 0.5 0 -> 1
|
||||
pow201 power 0.5 1 -> 0.5
|
||||
pow202 power 0.5 2 -> 0.25
|
||||
pow203 power 0.5 3 -> 0.125
|
||||
pow204 power 0.5 4 -> 0.0625
|
||||
pow205 power 0.5 5 -> 0.03125
|
||||
pow206 power 0.5 6 -> 0.015625
|
||||
pow207 power 0.5 7 -> 0.0078125
|
||||
pow208 power 0.5 8 -> 0.00390625
|
||||
pow209 power 0.5 9 -> 0.001953125
|
||||
pow210 power 0.5 10 -> 0.0009765625
|
||||
|
||||
-- A (rare) case where the last digit is not within 0.5 ULP
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 9
|
||||
pow215 power "-21971575.0E+31454441" "-7" -> "-4.04549502E-220181139" Inexact Rounded
|
||||
precision: 20
|
||||
pow216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139" Inexact Rounded
|
||||
maxexponent: 999999
|
||||
minexponent: -999999
|
||||
|
||||
-- The Vienna case. Checks both setup and 1/acc working precision
|
||||
-- Modified 1998.12.14 as RHS no longer rounded before use (must fit)
|
||||
-- Modified 1990.02.04 as LHS is now rounded (instead of truncated to guard)
|
||||
-- '123456789E+10' -- lhs .. rounded to 1.23E+18
|
||||
-- '-1.23000e+2' -- rhs .. [was: -1.23455e+2, rounds to -123]
|
||||
-- Without the input rounding, result would be 5.54E-2226
|
||||
precision: 3
|
||||
pow220 power '123456789E+10' '-1.23000e+2' -> '8.74E-2226' Inexact Lost_digits Rounded
|
||||
|
||||
precision: 5
|
||||
pow240 power 1 99999 -> 1
|
||||
pow241 power 1 100000 -> 1 Rounded
|
||||
pow242 power 1 100001 -> 1 Inexact Rounded Lost_digits
|
||||
pow243 power 1 1000000000 -> 1 Rounded
|
||||
pow244 power 1 9999999999 -> 1 Inexact Rounded Lost_digits
|
||||
|
||||
-- Checks for 'Too much precision needed'
|
||||
-- For x^12, digits+elength+1 = digits+3
|
||||
precision: 999999999
|
||||
--SSC: pow249 add 1 1 -> 2 -- check basic operation at this precision
|
||||
pow250 power 2 12 -> ? Overflow
|
||||
precision: 999999998
|
||||
pow251 power 2 12 -> ? Overflow
|
||||
precision: 999999997
|
||||
pow252 power 2 12 -> ? Overflow
|
||||
precision: 999999996
|
||||
pow253 power 2 12 -> 4096
|
||||
precision: 999999995
|
||||
pow254 power 2 12 -> 4096
|
||||
|
||||
|
||||
-- overflow and underflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 9
|
||||
pow260 power 9 999999999 -> 3.05550054E+954242508 Inexact Rounded
|
||||
pow261 power 10 999999999 -> 1E+999999999 Rounded
|
||||
pow262 power 10.0001 999999999 -> ? Overflow Inexact Rounded
|
||||
pow263 power 10.1 999999999 -> ? Overflow Inexact Rounded
|
||||
pow264 power 11 999999999 -> ? Overflow Inexact Rounded
|
||||
pow265 power 12 999999999 -> ? Overflow Inexact Rounded
|
||||
pow266 power 999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow267 power 999999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow268 power 999999999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow269 power 9.9E999999999 999999999 -> ? Overflow Inexact Rounded
|
||||
|
||||
pow270 power 0.5 999999999 -> 4.33559594E-301029996 Inexact Rounded
|
||||
pow271 power 0.1 999999999 -> 1E-999999999
|
||||
pow272 power 0.09 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow273 power 0.05 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow274 power 0.01 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow275 power 0.0001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow277 power 0.0000001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow278 power 0.0000000001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow279 power 1E-999999999 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
pow310 power -9 999999999 -> -3.05550054E+954242508 Inexact Rounded
|
||||
pow311 power -10 999999999 -> -1E+999999999 Rounded
|
||||
pow312 power -10.0001 999999999 -> ? Overflow Inexact Rounded
|
||||
pow313 power -10.1 999999999 -> ? Overflow Inexact Rounded
|
||||
pow314 power -11 999999999 -> ? Overflow Inexact Rounded
|
||||
pow315 power -12 999999999 -> ? Overflow Inexact Rounded
|
||||
pow316 power -999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow317 power -999999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow318 power -999999999 999999999 -> ? Overflow Inexact Rounded
|
||||
pow319 power -9.9E999999999 999999999 -> ? Overflow Inexact Rounded
|
||||
|
||||
pow320 power -0.5 999999999 -> -4.33559594E-301029996 Inexact Rounded
|
||||
pow321 power -0.1 999999999 -> -1E-999999999
|
||||
pow322 power -0.09 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow323 power -0.05 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow324 power -0.01 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow325 power -0.0001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow327 power -0.0000001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow328 power -0.0000000001 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow329 power -1E-999999999 999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
pow330 power -9 999999998 -> 3.3950006E+954242507 Inexact Rounded
|
||||
pow331 power -10 999999998 -> 1E+999999998 Rounded
|
||||
pow332 power -10.0001 999999998 -> ? Overflow Inexact Rounded
|
||||
pow333 power -10.1 999999998 -> ? Overflow Inexact Rounded
|
||||
pow334 power -11 999999998 -> ? Overflow Inexact Rounded
|
||||
pow335 power -12 999999998 -> ? Overflow Inexact Rounded
|
||||
pow336 power -999 999999998 -> ? Overflow Inexact Rounded
|
||||
pow337 power -999999 999999998 -> ? Overflow Inexact Rounded
|
||||
pow338 power -999999999 999999998 -> ? Overflow Inexact Rounded
|
||||
pow339 power -9.9E999999999 999999998 -> ? Overflow Inexact Rounded
|
||||
|
||||
pow340 power -0.5 999999998 -> 8.67119187E-301029996 Inexact Rounded
|
||||
pow341 power -0.1 999999998 -> 1E-999999998
|
||||
pow342 power -0.09 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow343 power -0.05 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow344 power -0.01 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow345 power -0.0001 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow347 power -0.0000001 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow348 power -0.0000000001 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
pow349 power -1E-999999999 999999998 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
-- lostDigits and RHS range checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
pow401 power 12345678000 1 -> 1.2345678E+10 Rounded
|
||||
pow402 power 1234567800 1 -> 1.2345678E+9 Rounded
|
||||
pow403 power 1234567890 1 -> 1.23456789E+9 Rounded
|
||||
pow404 power 1234567891 1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
pow405 power 12345678901 1 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
pow406 power 1234567896 1 -> 1.2345679E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
pow441 power 12345678000 1 -> 12345678000
|
||||
pow442 power 1234567800 1 -> 1234567800
|
||||
pow443 power 1234567890 1 -> 1234567890
|
||||
pow444 power 1234567891 1 -> 1234567891
|
||||
pow445 power 12345678901 1 -> 12345678901
|
||||
pow446 power 1234567896 1 -> 1234567896
|
||||
pow447 power 1 12345678000 -> 1
|
||||
pow448 power 1 -1234567896 -> 1
|
||||
pow449 power 1 1000000000 -> 1
|
||||
pow440 power 1 -1000000000 -> 1
|
||||
|
||||
-- Null tests
|
||||
pow500 power 1 # -> ? Invalid_operation
|
||||
pow501 power # 1 -> ? Invalid_operation
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Below here are the tests with a non-integer rhs, including the --
|
||||
-- tests that previously caused Invalid operation. An integer-only --
|
||||
-- (on rhs) implementation should handle all the tests above as --
|
||||
-- shown, and flag most of the following tests as Invalid. --
|
||||
----------------------------------------------------------------------
|
||||
precision: 16
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
|
||||
pow2000 power 7 '10000000000' -> ? Overflow Inexact Rounded
|
||||
pow2001 power 2 '2.000001' -> 4.000002772589683 Inexact Rounded
|
||||
pow2002 power 2 '2.00000000' -> 4
|
||||
pow2003 power 2 '2.000000001' -> 4.000000002772589 Inexact Rounded
|
||||
pow2004 power 2 '2.0000000001' -> 4.000000000277259 Inexact Rounded
|
||||
pow2005 power 2 '2.00000000001' -> 4.000000000027726 Inexact Rounded
|
||||
pow2006 power 2 '2.000000000001' -> 4.000000000002773 Inexact Rounded
|
||||
pow2007 power 2 '2.0000000000001' -> 4.000000000000277 Inexact Rounded
|
||||
pow2008 power 2 '2.00000000000001' -> 4.000000000000028 Inexact Rounded
|
||||
pow2009 power 2 '2.000000000000001' -> 4.000000000000003 Inexact Rounded
|
||||
pow2010 power 2 '2.0000000000000001' -> 4 Inexact Rounded Lost_digits
|
||||
-- 1 234567890123456
|
||||
|
||||
pow2011 power 1 1234 -> 1
|
||||
precision: 4
|
||||
pow2012 power 1 1234 -> 1
|
||||
precision: 3
|
||||
pow2013 power 1 1234 -> 1 Inexact Rounded Lost_digits
|
||||
pow2014 power 1 12.34e+2 -> 1 Inexact Rounded Lost_digits
|
||||
pow2015 power 1 12.3 -> 1 Inexact Rounded
|
||||
pow2016 power 1 12.0 -> 1
|
||||
pow2017 power 1 1.01 -> 1 Inexact Rounded
|
||||
pow2018 power 2 1.00 -> 2
|
||||
pow2019 power 2 2.00 -> 4
|
||||
precision: 9
|
||||
pow2030 power 1 1.0001 -> 1 Inexact Rounded
|
||||
pow2031 power 1 1.0000001 -> 1 Inexact Rounded
|
||||
pow2032 power 1 1.0000000001 -> 1 Inexact Rounded Lost_digits
|
||||
pow2033 power 1 1.0000000000001 -> 1 Inexact Rounded Lost_digits
|
||||
precision: 5
|
||||
pow2034 power 1 1.0001 -> 1 Inexact Rounded
|
||||
pow2035 power 1 1.0000001 -> 1 Inexact Rounded Lost_digits
|
||||
pow2036 power 1 1.0000000001 -> 1 Inexact Rounded Lost_digits
|
||||
pow2037 power 1 1.0000000000001 -> 1 Inexact Rounded Lost_digits
|
||||
pow2038 power 1 1.0000000000001 -> 1 Inexact Rounded Lost_digits
|
||||
|
||||
-- 1 ** big integer should be exact if no input rounding
|
||||
precision: 15
|
||||
pow2041 power 1 1000000000 -> 1
|
||||
pow2042 power 1 9999999999 -> 1
|
||||
pow2043 power 1 12345678000 -> 1
|
||||
pow2044 power 1 1234567800 -> 1
|
||||
pow2045 power 1 1234567890 -> 1
|
||||
pow2046 power 1 11234567891 -> 1
|
||||
pow2047 power 1 12345678901 -> 1
|
||||
pow2048 power 1 1234567896 -> 1
|
||||
pow2049 power 1 -1234567896 -> 1
|
||||
pow2051 power 1 1000000000 -> 1
|
||||
pow2052 power 1 -1000000000 -> 1
|
||||
pow2053 power 1 12345678000 -> 1
|
||||
pow2054 power 1 -1234567896 -> 1
|
||||
pow2055 power 1 1000000000 -> 1
|
||||
pow2056 power 1 -1000000000 -> 1
|
||||
|
||||
-- (Other x**y results tested in power.decTest)
|
||||
|
||||
@@ -0,0 +1,536 @@
|
||||
------------------------------------------------------------------------
|
||||
-- quantize0.decTest -- decimal quantize operation --
|
||||
-- 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
|
||||
|
||||
-- Most of the tests here assume a "regular pattern", where the
|
||||
-- sign and coefficient are +1.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
-- sanity checks
|
||||
qua001 quantize 0 1e0 -> 0
|
||||
qua002 quantize 1 1e0 -> 1
|
||||
qua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua006 quantize 0.1 1e0 -> 0 Inexact Rounded
|
||||
qua007 quantize 0.1 1e-1 -> 0.1
|
||||
qua008 quantize 0.1 1e-2 -> 0.10
|
||||
qua009 quantize 0.1 1e-3 -> 0.100
|
||||
qua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
|
||||
qua013 quantize 0.9 1e-1 -> 0.9
|
||||
qua014 quantize 0.9 1e-2 -> 0.90
|
||||
qua015 quantize 0.9 1e-3 -> 0.900
|
||||
-- negatives
|
||||
qua021 quantize -0 1e0 -> 0
|
||||
qua022 quantize -1 1e0 -> -1
|
||||
qua023 quantize -0.1 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua025 quantize -0.1 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua026 quantize -0.1 1e0 -> 0 Inexact Rounded
|
||||
qua027 quantize -0.1 1e-1 -> -0.1
|
||||
qua028 quantize -0.1 1e-2 -> -0.10
|
||||
qua029 quantize -0.1 1e-3 -> -0.100
|
||||
qua030 quantize -0.9 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua031 quantize -0.9 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
|
||||
qua033 quantize -0.9 1e-1 -> -0.9
|
||||
qua034 quantize -0.9 1e-2 -> -0.90
|
||||
qua035 quantize -0.9 1e-3 -> -0.900
|
||||
qua036 quantize -0.5 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua037 quantize -0.5 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua038 quantize -0.5 1e+0 -> -1 Inexact Rounded
|
||||
qua039 quantize -0.5 1e-1 -> -0.5
|
||||
qua040 quantize -0.5 1e-2 -> -0.50
|
||||
qua041 quantize -0.5 1e-3 -> -0.500
|
||||
qua042 quantize -0.9 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua043 quantize -0.9 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
|
||||
qua045 quantize -0.9 1e-1 -> -0.9
|
||||
qua046 quantize -0.9 1e-2 -> -0.90
|
||||
qua047 quantize -0.9 1e-3 -> -0.900
|
||||
|
||||
-- examples from Specification
|
||||
qua060 quantize 2.17 0.001 -> 2.170
|
||||
qua061 quantize 2.17 0.01 -> 2.17
|
||||
qua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
|
||||
qua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
|
||||
qua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua066 quantize -0.1 1 -> 0 Inexact Rounded
|
||||
qua067 quantize -0 1e+5 -> 0E+5
|
||||
qua068 quantize +35236450.6 1e-2 -> ? Invalid_operation
|
||||
qua069 quantize -35236450.6 1e-2 -> ? Invalid_operation
|
||||
qua070 quantize 217 1e-1 -> 217.0
|
||||
qua071 quantize 217 1e+0 -> 217
|
||||
qua072 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
|
||||
qua073 quantize 217 1e+2 -> 2E+2 Inexact Rounded
|
||||
|
||||
-- general tests ..
|
||||
qua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
|
||||
qua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
|
||||
qua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
|
||||
qua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
|
||||
qua095 quantize 1.2345 1e-6 -> 1.234500
|
||||
qua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
|
||||
qua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
|
||||
qua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
|
||||
qua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
|
||||
qua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
|
||||
|
||||
qua101 quantize -1 1e0 -> -1
|
||||
qua102 quantize -1 1e-1 -> -1.0
|
||||
qua103 quantize -1 1e-2 -> -1.00
|
||||
qua104 quantize 0 1e0 -> 0
|
||||
qua105 quantize 0 1e-1 -> 0.0
|
||||
qua106 quantize 0 1e-2 -> 0.00
|
||||
qua107 quantize 0.00 1e0 -> 0
|
||||
qua108 quantize 0 1e+1 -> 0E+1
|
||||
qua109 quantize 0 1e+2 -> 0E+2
|
||||
qua110 quantize +1 1e0 -> 1
|
||||
qua111 quantize +1 1e-1 -> 1.0
|
||||
qua112 quantize +1 1e-2 -> 1.00
|
||||
|
||||
qua120 quantize 1.04 1e-3 -> 1.040
|
||||
qua121 quantize 1.04 1e-2 -> 1.04
|
||||
qua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
|
||||
qua123 quantize 1.04 1e0 -> 1 Inexact Rounded
|
||||
qua124 quantize 1.05 1e-3 -> 1.050
|
||||
qua125 quantize 1.05 1e-2 -> 1.05
|
||||
qua126 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
|
||||
qua127 quantize 1.05 1e0 -> 1 Inexact Rounded
|
||||
qua128 quantize 1.05 1e-3 -> 1.050
|
||||
qua129 quantize 1.05 1e-2 -> 1.05
|
||||
qua130 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
|
||||
qua131 quantize 1.05 1e0 -> 1 Inexact Rounded
|
||||
qua132 quantize 1.06 1e-3 -> 1.060
|
||||
qua133 quantize 1.06 1e-2 -> 1.06
|
||||
qua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
|
||||
qua135 quantize 1.06 1e0 -> 1 Inexact Rounded
|
||||
|
||||
qua140 quantize -10 1e-2 -> -10.00
|
||||
qua141 quantize +1 1e-2 -> 1.00
|
||||
qua142 quantize +10 1e-2 -> 10.00
|
||||
qua143 quantize 1E+10 1e-2 -> ? Invalid_operation
|
||||
qua144 quantize 1E-10 1e-2 -> 0.00 Inexact Rounded
|
||||
qua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
|
||||
qua146 quantize 1E-2 1e-2 -> 0.01
|
||||
qua147 quantize 1E-1 1e-2 -> 0.10
|
||||
qua148 quantize 0E-10 1e-2 -> 0.00
|
||||
|
||||
qua150 quantize 1.0600 1e-5 -> 1.06000
|
||||
qua151 quantize 1.0600 1e-4 -> 1.0600
|
||||
qua152 quantize 1.0600 1e-3 -> 1.060 Rounded
|
||||
qua153 quantize 1.0600 1e-2 -> 1.06 Rounded
|
||||
qua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
|
||||
qua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
|
||||
|
||||
-- base tests with non-1 coefficients
|
||||
qua161 quantize 0 -9e0 -> 0
|
||||
qua162 quantize 1 -7e0 -> 1
|
||||
qua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
|
||||
qua165 quantize 0.1 7e+1 -> 0E+1 Inexact Rounded
|
||||
qua166 quantize 0.1 2e0 -> 0 Inexact Rounded
|
||||
qua167 quantize 0.1 3e-1 -> 0.1
|
||||
qua168 quantize 0.1 44e-2 -> 0.10
|
||||
qua169 quantize 0.1 555e-3 -> 0.100
|
||||
qua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
|
||||
qua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
|
||||
qua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
|
||||
qua173 quantize 0.9 -9e-1 -> 0.9
|
||||
qua174 quantize 0.9 7e-2 -> 0.90
|
||||
qua175 quantize 0.9 1.1e-3 -> 0.9000
|
||||
-- negatives
|
||||
qua181 quantize -0 1.1e0 -> 0.0
|
||||
qua182 quantize -1 -1e0 -> -1
|
||||
qua183 quantize -0.1 11e+2 -> 0E+2 Inexact Rounded
|
||||
qua185 quantize -0.1 111e+1 -> 0E+1 Inexact Rounded
|
||||
qua186 quantize -0.1 71e0 -> 0 Inexact Rounded
|
||||
qua187 quantize -0.1 -91e-1 -> -0.1
|
||||
qua188 quantize -0.1 -.1e-2 -> -0.100
|
||||
qua189 quantize -0.1 -1e-3 -> -0.100
|
||||
qua190 quantize -0.9 4e+2 -> 0E+2 Inexact Rounded
|
||||
qua191 quantize -0.9 -4e+1 -> 0E+1 Inexact Rounded
|
||||
qua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
|
||||
qua193 quantize -0.9 100e-1 -> -0.9
|
||||
qua194 quantize -0.9 999e-2 -> -0.90
|
||||
|
||||
-- +ve exponents ..
|
||||
qua201 quantize -1 1e+0 -> -1
|
||||
qua202 quantize -1 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua203 quantize -1 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua204 quantize 0 1e+0 -> 0
|
||||
qua205 quantize 0 1e+1 -> 0E+1
|
||||
qua206 quantize 0 1e+2 -> 0E+2
|
||||
qua207 quantize +1 1e+0 -> 1
|
||||
qua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
|
||||
qua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
|
||||
qua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
|
||||
qua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
|
||||
|
||||
qua240 quantize -10 1e+1 -> -1E+1 Rounded
|
||||
qua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua242 quantize +10 1e+1 -> 1E+1 Rounded
|
||||
qua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
|
||||
qua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
|
||||
qua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
|
||||
qua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
|
||||
qua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
|
||||
qua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
|
||||
qua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
|
||||
qua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
|
||||
qua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
|
||||
-- next one tries to add 9 zeros
|
||||
qua252 quantize 1E+10 1e+1 -> ? Invalid_operation
|
||||
qua253 quantize 1E-10 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua255 quantize 0E-10 1e+1 -> 0E+1
|
||||
qua256 quantize -0E-10 1e+1 -> 0E+1
|
||||
qua257 quantize -0E-1 1e+1 -> 0E+1
|
||||
qua258 quantize -0 1e+1 -> 0E+1
|
||||
qua259 quantize -0E+1 1e+1 -> 0E+1
|
||||
|
||||
qua260 quantize -10 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua264 quantize 1E+2 1e+2 -> 1E+2
|
||||
qua265 quantize 1E+3 1e+2 -> 1.0E+3
|
||||
qua266 quantize 1E+4 1e+2 -> 1.00E+4
|
||||
qua267 quantize 1E+5 1e+2 -> 1.000E+5
|
||||
qua268 quantize 1E+6 1e+2 -> 1.0000E+6
|
||||
qua269 quantize 1E+7 1e+2 -> 1.00000E+7
|
||||
qua270 quantize 1E+8 1e+2 -> 1.000000E+8
|
||||
qua271 quantize 1E+9 1e+2 -> 1.0000000E+9
|
||||
qua272 quantize 1E+10 1e+2 -> 1.00000000E+10
|
||||
qua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua275 quantize 0E-10 1e+2 -> 0E+2
|
||||
|
||||
qua280 quantize -10 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua285 quantize 1E+3 1e+3 -> 1E+3
|
||||
qua286 quantize 1E+4 1e+3 -> 1.0E+4
|
||||
qua287 quantize 1E+5 1e+3 -> 1.00E+5
|
||||
qua288 quantize 1E+6 1e+3 -> 1.000E+6
|
||||
qua289 quantize 1E+7 1e+3 -> 1.0000E+7
|
||||
qua290 quantize 1E+8 1e+3 -> 1.00000E+8
|
||||
qua291 quantize 1E+9 1e+3 -> 1.000000E+9
|
||||
qua292 quantize 1E+10 1e+3 -> 1.0000000E+10
|
||||
qua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
|
||||
qua295 quantize 0E-10 1e+3 -> 0E+3
|
||||
|
||||
-- round up from below [sign wrong in JIT compiler once]
|
||||
qua300 quantize 0.0078 1e-5 -> 0.00780
|
||||
qua301 quantize 0.0078 1e-4 -> 0.0078
|
||||
qua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
|
||||
qua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
|
||||
qua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
|
||||
qua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
|
||||
qua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua310 quantize -0.0078 1e-5 -> -0.00780
|
||||
qua311 quantize -0.0078 1e-4 -> -0.0078
|
||||
qua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
|
||||
qua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
|
||||
qua314 quantize -0.0078 1e-1 -> 0.0 Inexact Rounded
|
||||
qua315 quantize -0.0078 1e0 -> 0 Inexact Rounded
|
||||
qua316 quantize -0.0078 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua317 quantize -0.0078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua320 quantize 0.078 1e-5 -> 0.07800
|
||||
qua321 quantize 0.078 1e-4 -> 0.0780
|
||||
qua322 quantize 0.078 1e-3 -> 0.078
|
||||
qua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
|
||||
qua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
|
||||
qua325 quantize 0.078 1e0 -> 0 Inexact Rounded
|
||||
qua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua330 quantize -0.078 1e-5 -> -0.07800
|
||||
qua331 quantize -0.078 1e-4 -> -0.0780
|
||||
qua332 quantize -0.078 1e-3 -> -0.078
|
||||
qua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
|
||||
qua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
|
||||
qua335 quantize -0.078 1e0 -> 0 Inexact Rounded
|
||||
qua336 quantize -0.078 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua337 quantize -0.078 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua340 quantize 0.78 1e-5 -> 0.78000
|
||||
qua341 quantize 0.78 1e-4 -> 0.7800
|
||||
qua342 quantize 0.78 1e-3 -> 0.780
|
||||
qua343 quantize 0.78 1e-2 -> 0.78
|
||||
qua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
|
||||
qua345 quantize 0.78 1e0 -> 1 Inexact Rounded
|
||||
qua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua350 quantize -0.78 1e-5 -> -0.78000
|
||||
qua351 quantize -0.78 1e-4 -> -0.7800
|
||||
qua352 quantize -0.78 1e-3 -> -0.780
|
||||
qua353 quantize -0.78 1e-2 -> -0.78
|
||||
qua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
|
||||
qua355 quantize -0.78 1e0 -> -1 Inexact Rounded
|
||||
qua356 quantize -0.78 1e+1 -> 0E+1 Inexact Rounded
|
||||
qua357 quantize -0.78 1e+2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua360 quantize 7.8 1e-5 -> 7.80000
|
||||
qua361 quantize 7.8 1e-4 -> 7.8000
|
||||
qua362 quantize 7.8 1e-3 -> 7.800
|
||||
qua363 quantize 7.8 1e-2 -> 7.80
|
||||
qua364 quantize 7.8 1e-1 -> 7.8
|
||||
qua365 quantize 7.8 1e0 -> 8 Inexact Rounded
|
||||
qua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
|
||||
qua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
|
||||
|
||||
qua370 quantize -7.8 1e-5 -> -7.80000
|
||||
qua371 quantize -7.8 1e-4 -> -7.8000
|
||||
qua372 quantize -7.8 1e-3 -> -7.800
|
||||
qua373 quantize -7.8 1e-2 -> -7.80
|
||||
qua374 quantize -7.8 1e-1 -> -7.8
|
||||
qua375 quantize -7.8 1e0 -> -8 Inexact Rounded
|
||||
qua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
|
||||
qua377 quantize -7.8 1e+2 -> 0E+2 Inexact Rounded
|
||||
qua378 quantize -7.8 1e+3 -> 0E+3 Inexact Rounded
|
||||
|
||||
-- some individuals
|
||||
precision: 9
|
||||
qua380 quantize 352364.506 1e-2 -> 352364.51 Inexact Rounded
|
||||
qua381 quantize 3523645.06 1e-2 -> 3523645.06
|
||||
qua382 quantize 35236450.6 1e-2 -> ? Invalid_operation
|
||||
qua383 quantize 352364506 1e-2 -> ? Invalid_operation
|
||||
qua384 quantize -352364.506 1e-2 -> -352364.51 Inexact Rounded
|
||||
qua385 quantize -3523645.06 1e-2 -> -3523645.06
|
||||
qua386 quantize -35236450.6 1e-2 -> ? Invalid_operation
|
||||
qua387 quantize -352364506 1e-2 -> ? Invalid_operation
|
||||
|
||||
rounding: down
|
||||
qua389 quantize 35236450.6 1e-2 -> ? Invalid_operation
|
||||
-- ? should that one instead have been:
|
||||
-- qua389 quantize 35236450.6 1e-2 -> ? Invalid_operation
|
||||
rounding: half_up
|
||||
|
||||
-- and a few more from e-mail discussions
|
||||
precision: 7
|
||||
qua391 quantize 12.34567 1e-3 -> 12.346 Inexact Rounded
|
||||
qua392 quantize 123.4567 1e-3 -> 123.457 Inexact Rounded
|
||||
qua393 quantize 1234.567 1e-3 -> 1234.567
|
||||
qua394 quantize 12345.67 1e-3 -> ? Invalid_operation
|
||||
qua395 quantize 123456.7 1e-3 -> ? Invalid_operation
|
||||
qua396 quantize 1234567. 1e-3 -> ? Invalid_operation
|
||||
|
||||
-- some 9999 round-up cases
|
||||
precision: 9
|
||||
qua400 quantize 9.999 1e-5 -> 9.99900
|
||||
qua401 quantize 9.999 1e-4 -> 9.9990
|
||||
qua402 quantize 9.999 1e-3 -> 9.999
|
||||
qua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
|
||||
qua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
|
||||
qua405 quantize 9.999 1e0 -> 10 Inexact Rounded
|
||||
qua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
|
||||
qua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
|
||||
|
||||
qua410 quantize 0.999 1e-5 -> 0.99900
|
||||
qua411 quantize 0.999 1e-4 -> 0.9990
|
||||
qua412 quantize 0.999 1e-3 -> 0.999
|
||||
qua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
|
||||
qua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
|
||||
qua415 quantize 0.999 1e0 -> 1 Inexact Rounded
|
||||
qua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
qua420 quantize 0.0999 1e-5 -> 0.09990
|
||||
qua421 quantize 0.0999 1e-4 -> 0.0999
|
||||
qua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
|
||||
qua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
|
||||
qua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
|
||||
qua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
|
||||
qua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
qua430 quantize 0.00999 1e-5 -> 0.00999
|
||||
qua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
|
||||
qua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
|
||||
qua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
|
||||
qua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
|
||||
qua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
|
||||
qua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
qua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
|
||||
qua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
|
||||
qua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
|
||||
qua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
|
||||
qua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
|
||||
qua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
|
||||
qua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
precision: 8
|
||||
qua449 quantize 9.999E-15 1e-23 -> ? Invalid_operation
|
||||
qua450 quantize 9.999E-15 1e-22 -> 9.9990000E-15
|
||||
qua451 quantize 9.999E-15 1e-21 -> 9.999000E-15
|
||||
qua452 quantize 9.999E-15 1e-20 -> 9.99900E-15
|
||||
qua453 quantize 9.999E-15 1e-19 -> 9.9990E-15
|
||||
qua454 quantize 9.999E-15 1e-18 -> 9.999E-15
|
||||
qua455 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded
|
||||
qua456 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded
|
||||
qua457 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded
|
||||
qua458 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded
|
||||
qua459 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded
|
||||
qua460 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded
|
||||
qua461 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded
|
||||
qua462 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded
|
||||
qua463 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded
|
||||
qua464 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded
|
||||
qua465 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded
|
||||
qua466 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded
|
||||
qua467 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded
|
||||
qua468 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded
|
||||
qua469 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded
|
||||
qua470 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded
|
||||
qua471 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded
|
||||
qua472 quantize 9.999E-15 1e0 -> 0 Inexact Rounded
|
||||
qua473 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded
|
||||
|
||||
-- long operand checks [rhs checks removed]
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
qua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
|
||||
qua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
|
||||
qua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
|
||||
qua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded Lost_digits
|
||||
qua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded Lost_digits
|
||||
qua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded Lost_digits
|
||||
-- a potential double-round [seen in subset]
|
||||
qua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded Lost_digits
|
||||
qua488 quantize 1234.987647 1e-4 -> 1234.9877 Inexact Rounded Lost_digits
|
||||
|
||||
precision: 15
|
||||
qua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
|
||||
qua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
|
||||
qua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
|
||||
qua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
|
||||
qua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
|
||||
qua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
|
||||
qua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
|
||||
qua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
|
||||
|
||||
-- Zeros
|
||||
qua500 quantize 0 1e1 -> 0E+1
|
||||
qua501 quantize 0 1e0 -> 0
|
||||
qua502 quantize 0 1e-1 -> 0.0
|
||||
qua503 quantize 0.0 1e-1 -> 0.0
|
||||
qua504 quantize 0.0 1e0 -> 0
|
||||
qua505 quantize 0.0 1e+1 -> 0E+1
|
||||
qua506 quantize 0E+1 1e-1 -> 0.0
|
||||
qua507 quantize 0E+1 1e0 -> 0
|
||||
qua508 quantize 0E+1 1e+1 -> 0E+1
|
||||
qua509 quantize -0 1e1 -> 0E+1
|
||||
qua510 quantize -0 1e0 -> 0
|
||||
qua511 quantize -0 1e-1 -> 0.0
|
||||
qua512 quantize -0.0 1e-1 -> 0.0
|
||||
qua513 quantize -0.0 1e0 -> 0
|
||||
qua514 quantize -0.0 1e+1 -> 0E+1
|
||||
qua515 quantize -0E+1 1e-1 -> 0.0
|
||||
qua516 quantize -0E+1 1e0 -> 0
|
||||
qua517 quantize -0E+1 1e+1 -> 0E+1
|
||||
|
||||
-- Suspicious RHS values
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 15
|
||||
qua520 quantize 1.234 1e999999000 -> 0E+999999000 Inexact Rounded
|
||||
qua521 quantize 123.456 1e999999000 -> 0E+999999000 Inexact Rounded
|
||||
qua522 quantize 1.234 1e999999999 -> 0E+999999999 Inexact Rounded
|
||||
qua523 quantize 123.456 1e999999999 -> 0E+999999999 Inexact Rounded
|
||||
qua524 quantize 123.456 1e1000000000 -> ? Invalid_operation
|
||||
qua525 quantize 123.456 1e12345678903 -> ? Invalid_operation
|
||||
-- next four are "won't fit" overflows
|
||||
qua526 quantize 1.234 1e-999999000 -> ? Invalid_operation
|
||||
qua527 quantize 123.456 1e-999999000 -> ? Invalid_operation
|
||||
qua528 quantize 1.234 1e-999999999 -> ? Invalid_operation
|
||||
qua529 quantize 123.456 1e-999999999 -> ? Invalid_operation
|
||||
-- next two input-round rhs to 0
|
||||
qua530 quantize 123.456 1e-1000000014 -> 123 Inexact Rounded
|
||||
qua531 quantize 123.456 1e-12345678903 -> 123 Inexact Rounded
|
||||
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 15
|
||||
qua532 quantize 1.234E+999 1e999 -> 1E+999 Inexact Rounded
|
||||
qua533 quantize 1.234E+998 1e999 -> 0E+999 Inexact Rounded
|
||||
qua534 quantize 1.234 1e999 -> 0E+999 Inexact Rounded
|
||||
qua535 quantize 1.234 1e1000 -> ? Invalid_operation
|
||||
qua536 quantize 1.234 1e5000 -> ? Invalid_operation
|
||||
qua537 quantize 0 1e-999 -> 0E-999
|
||||
-- next two are "won't fit" overflows
|
||||
qua538 quantize 1.234 1e-999 -> ? Invalid_operation
|
||||
qua539 quantize 1.234 1e-1000 -> ? Invalid_operation
|
||||
qua540 quantize 1.234 1e-5000 -> ? Invalid_operation
|
||||
-- [more below]
|
||||
|
||||
-- check bounds (lhs maybe out of range for destination, etc.)
|
||||
precision: 7
|
||||
qua541 quantize 1E+999 1e+999 -> 1E+999
|
||||
qua542 quantize 1E+1000 1e+999 -> ? Invalid_operation
|
||||
qua543 quantize 1E+999 1e+1000 -> ? Invalid_operation
|
||||
qua544 quantize 1E-999 1e-999 -> 1E-999
|
||||
qua545 quantize 1E-1000 1e-999 -> 0E-999 Inexact Rounded
|
||||
qua546 quantize 1E-999 1e-1000 -> ? Invalid_operation
|
||||
qua547 quantize 1E-1005 1e-999 -> 0E-999 Inexact Rounded
|
||||
qua548 quantize 1E-1006 1e-999 -> 0E-999 Inexact Rounded
|
||||
qua549 quantize 1E-1007 1e-999 -> 0E-999 Inexact Rounded
|
||||
qua550 quantize 1E-998 1e-1005 -> ? Invalid_operation -- won't fit
|
||||
qua551 quantize 1E-999 1e-1005 -> ? Invalid_operation
|
||||
qua552 quantize 1E-1000 1e-1005 -> ? Invalid_operation
|
||||
qua553 quantize 1E-999 1e-1006 -> ? Invalid_operation
|
||||
qua554 quantize 1E-999 1e-1007 -> ? Invalid_operation
|
||||
-- related subnormal rounding
|
||||
qua555 quantize 1.666666E-999 1e-1005 -> ? Invalid_operation
|
||||
qua556 quantize 1.666666E-1000 1e-1005 -> ? Invalid_operation
|
||||
qua557 quantize 1.666666E-1001 1e-1005 -> ? Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
qua900 quantize 10 # -> ? Invalid_operation
|
||||
qua901 quantize # 1e10 -> ? Invalid_operation
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,148 @@
|
||||
------------------------------------------------------------------------
|
||||
-- reduce0.decTest -- remove trailing zeros --
|
||||
-- Copyright (c) IBM Corporation, 2003, 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 --
|
||||
------------------------------------------------------------------------
|
||||
-- [This used to be called normalize0.]
|
||||
|
||||
version: 2.58
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
red001 reduce '1' -> '1'
|
||||
red002 reduce '-1' -> '-1'
|
||||
red003 reduce '1.00' -> '1'
|
||||
red004 reduce '-1.00' -> '-1'
|
||||
red005 reduce '0' -> '0'
|
||||
red006 reduce '0.00' -> '0'
|
||||
red007 reduce '00.0' -> '0'
|
||||
red008 reduce '00.00' -> '0'
|
||||
red009 reduce '00' -> '0'
|
||||
|
||||
red010 reduce '-2' -> '-2'
|
||||
red011 reduce '2' -> '2'
|
||||
red012 reduce '-2.00' -> '-2'
|
||||
red013 reduce '2.00' -> '2'
|
||||
red014 reduce '-0' -> '0'
|
||||
red015 reduce '-0.00' -> '0'
|
||||
red016 reduce '-00.0' -> '0'
|
||||
red017 reduce '-00.00' -> '0'
|
||||
red018 reduce '-00' -> '0'
|
||||
red019 reduce '0E+5' -> '0'
|
||||
red020 reduce '-0E+1' -> '0'
|
||||
|
||||
red030 reduce '+0.1' -> '0.1'
|
||||
red031 reduce '-0.1' -> '-0.1'
|
||||
red032 reduce '+0.01' -> '0.01'
|
||||
red033 reduce '-0.01' -> '-0.01'
|
||||
red034 reduce '+0.001' -> '0.001'
|
||||
red035 reduce '-0.001' -> '-0.001'
|
||||
red036 reduce '+0.000001' -> '0.000001'
|
||||
red037 reduce '-0.000001' -> '-0.000001'
|
||||
red038 reduce '+0.000000000001' -> '1E-12'
|
||||
red039 reduce '-0.000000000001' -> '-1E-12'
|
||||
|
||||
red041 reduce 1.1 -> 1.1
|
||||
red042 reduce 1.10 -> 1.1
|
||||
red043 reduce 1.100 -> 1.1
|
||||
red044 reduce 1.110 -> 1.11
|
||||
red045 reduce -1.1 -> -1.1
|
||||
red046 reduce -1.10 -> -1.1
|
||||
red047 reduce -1.100 -> -1.1
|
||||
red048 reduce -1.110 -> -1.11
|
||||
red049 reduce 9.9 -> 9.9
|
||||
red050 reduce 9.90 -> 9.9
|
||||
red051 reduce 9.900 -> 9.9
|
||||
red052 reduce 9.990 -> 9.99
|
||||
red053 reduce -9.9 -> -9.9
|
||||
red054 reduce -9.90 -> -9.9
|
||||
red055 reduce -9.900 -> -9.9
|
||||
red056 reduce -9.990 -> -9.99
|
||||
|
||||
-- some trailing fractional zeros with zeros in units
|
||||
red060 reduce 10.0 -> 1E+1
|
||||
red061 reduce 10.00 -> 1E+1
|
||||
red062 reduce 100.0 -> 1E+2
|
||||
red063 reduce 100.00 -> 1E+2
|
||||
red064 reduce 1.1000E+3 -> 1.1E+3
|
||||
red065 reduce 1.10000E+3 -> 1.1E+3
|
||||
red066 reduce -10.0 -> -1E+1
|
||||
red067 reduce -10.00 -> -1E+1
|
||||
red068 reduce -100.0 -> -1E+2
|
||||
red069 reduce -100.00 -> -1E+2
|
||||
red070 reduce -1.1000E+3 -> -1.1E+3
|
||||
red071 reduce -1.10000E+3 -> -1.1E+3
|
||||
|
||||
-- some insignificant trailing zeros with positive exponent
|
||||
red080 reduce 10E+1 -> 1E+2
|
||||
red081 reduce 100E+1 -> 1E+3
|
||||
red082 reduce 1.0E+2 -> 1E+2
|
||||
red083 reduce 1.0E+3 -> 1E+3
|
||||
red084 reduce 1.1E+3 -> 1.1E+3
|
||||
red085 reduce 1.00E+3 -> 1E+3
|
||||
red086 reduce 1.10E+3 -> 1.1E+3
|
||||
red087 reduce -10E+1 -> -1E+2
|
||||
red088 reduce -100E+1 -> -1E+3
|
||||
red089 reduce -1.0E+2 -> -1E+2
|
||||
red090 reduce -1.0E+3 -> -1E+3
|
||||
red091 reduce -1.1E+3 -> -1.1E+3
|
||||
red092 reduce -1.00E+3 -> -1E+3
|
||||
red093 reduce -1.10E+3 -> -1.1E+3
|
||||
|
||||
-- some significant trailing zeros, were we to be trimming
|
||||
red100 reduce 11 -> 11
|
||||
red101 reduce 10 -> 1E+1
|
||||
red102 reduce 10. -> 1E+1
|
||||
red103 reduce 1.1E+1 -> 11
|
||||
red104 reduce 1.0E+1 -> 1E+1
|
||||
red105 reduce 1.10E+2 -> 1.1E+2
|
||||
red106 reduce 1.00E+2 -> 1E+2
|
||||
red107 reduce 1.100E+3 -> 1.1E+3
|
||||
red108 reduce 1.000E+3 -> 1E+3
|
||||
red109 reduce 1.000000E+6 -> 1E+6
|
||||
red110 reduce -11 -> -11
|
||||
red111 reduce -10 -> -1E+1
|
||||
red112 reduce -10. -> -1E+1
|
||||
red113 reduce -1.1E+1 -> -11
|
||||
red114 reduce -1.0E+1 -> -1E+1
|
||||
red115 reduce -1.10E+2 -> -1.1E+2
|
||||
red116 reduce -1.00E+2 -> -1E+2
|
||||
red117 reduce -1.100E+3 -> -1.1E+3
|
||||
red118 reduce -1.000E+3 -> -1E+3
|
||||
red119 reduce -1.00000E+5 -> -1E+5
|
||||
red120 reduce -1.000000E+6 -> -1E+6
|
||||
red121 reduce -10.00000E+6 -> -1E+7
|
||||
red122 reduce -100.0000E+6 -> -1E+8
|
||||
red123 reduce -1000.000E+6 -> -1E+9
|
||||
red124 reduce -10000.00E+6 -> -1E+10
|
||||
red125 reduce -100000.0E+6 -> -1E+11
|
||||
red126 reduce -1000000.E+6 -> -1E+12
|
||||
|
||||
-- examples from decArith
|
||||
red140 reduce '2.1' -> '2.1'
|
||||
red141 reduce '-2.0' -> '-2'
|
||||
red142 reduce '1.200' -> '1.2'
|
||||
red143 reduce '-120' -> '-1.2E+2'
|
||||
red144 reduce '120.00' -> '1.2E+2'
|
||||
red145 reduce '0.00' -> '0'
|
||||
|
||||
-- Null test
|
||||
red900 reduce # -> ? Invalid_operation
|
||||
@@ -0,0 +1,326 @@
|
||||
------------------------------------------------------------------------
|
||||
-- remainder0.decTest -- decimal remainder (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
|
||||
|
||||
rem001 remainder 1 1 -> 0
|
||||
rem002 remainder 2 1 -> 0
|
||||
rem003 remainder 1 2 -> 1
|
||||
rem004 remainder 2 2 -> 0
|
||||
rem005 remainder 0 1 -> 0
|
||||
rem006 remainder 0 2 -> 0
|
||||
rem007 remainder 1 3 -> 1
|
||||
rem008 remainder 2 3 -> 2
|
||||
rem009 remainder 3 3 -> 0
|
||||
|
||||
rem010 remainder 2.4 1 -> 0.4
|
||||
rem011 remainder 2.4 -1 -> 0.4
|
||||
rem012 remainder -2.4 1 -> -0.4
|
||||
rem013 remainder -2.4 -1 -> -0.4
|
||||
rem014 remainder 2.40 1 -> 0.40
|
||||
rem015 remainder 2.400 1 -> 0.400
|
||||
rem016 remainder 2.4 2 -> 0.4
|
||||
rem017 remainder 2.400 2 -> 0.400
|
||||
rem018 remainder 2. 2 -> 0
|
||||
rem019 remainder 20 20 -> 0
|
||||
|
||||
rem020 remainder 187 187 -> 0
|
||||
rem021 remainder 5 2 -> 1
|
||||
rem022 remainder 5 2.0 -> 1.0
|
||||
rem023 remainder 5 2.000 -> 1.000
|
||||
rem024 remainder 5 0.200 -> 0
|
||||
rem025 remainder 5 0.200 -> 0
|
||||
|
||||
rem030 remainder 1 2 -> 1
|
||||
rem031 remainder 1 4 -> 1
|
||||
rem032 remainder 1 8 -> 1
|
||||
rem033 remainder 1 16 -> 1
|
||||
rem034 remainder 1 32 -> 1
|
||||
rem035 remainder 1 64 -> 1
|
||||
rem040 remainder 1 -2 -> 1
|
||||
rem041 remainder 1 -4 -> 1
|
||||
rem042 remainder 1 -8 -> 1
|
||||
rem043 remainder 1 -16 -> 1
|
||||
rem044 remainder 1 -32 -> 1
|
||||
rem045 remainder 1 -64 -> 1
|
||||
rem050 remainder -1 2 -> -1
|
||||
rem051 remainder -1 4 -> -1
|
||||
rem052 remainder -1 8 -> -1
|
||||
rem053 remainder -1 16 -> -1
|
||||
rem054 remainder -1 32 -> -1
|
||||
rem055 remainder -1 64 -> -1
|
||||
rem060 remainder -1 -2 -> -1
|
||||
rem061 remainder -1 -4 -> -1
|
||||
rem062 remainder -1 -8 -> -1
|
||||
rem063 remainder -1 -16 -> -1
|
||||
rem064 remainder -1 -32 -> -1
|
||||
rem065 remainder -1 -64 -> -1
|
||||
|
||||
rem070 remainder 999999999 1 -> 0
|
||||
rem071 remainder 999999999.4 1 -> 0 Inexact Lost_digits Rounded
|
||||
rem072 remainder 999999999.5 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem073 remainder 999999999.9 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem074 remainder 999999999.999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
precision: 6
|
||||
rem080 remainder 999999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem081 remainder 99999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem082 remainder 9999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem083 remainder 999999 1 -> 0
|
||||
rem084 remainder 99999 1 -> 0
|
||||
rem085 remainder 9999 1 -> 0
|
||||
rem086 remainder 999 1 -> 0
|
||||
rem087 remainder 99 1 -> 0
|
||||
rem088 remainder 9 1 -> 0
|
||||
|
||||
precision: 9
|
||||
rem090 remainder 0. 1 -> 0
|
||||
rem091 remainder .0 1 -> 0
|
||||
rem092 remainder 0.00 1 -> 0
|
||||
rem093 remainder 0.00E+9 1 -> 0
|
||||
rem094 remainder 0.0000E-50 1 -> 0
|
||||
|
||||
rem100 remainder 1 1 -> 0
|
||||
rem101 remainder 1 2 -> 1
|
||||
rem102 remainder 1 3 -> 1
|
||||
rem103 remainder 1 4 -> 1
|
||||
rem104 remainder 1 5 -> 1
|
||||
rem105 remainder 1 6 -> 1
|
||||
rem106 remainder 1 7 -> 1
|
||||
rem107 remainder 1 8 -> 1
|
||||
rem108 remainder 1 9 -> 1
|
||||
rem109 remainder 1 10 -> 1
|
||||
rem110 remainder 1 1 -> 0
|
||||
rem111 remainder 2 1 -> 0
|
||||
rem112 remainder 3 1 -> 0
|
||||
rem113 remainder 4 1 -> 0
|
||||
rem114 remainder 5 1 -> 0
|
||||
rem115 remainder 6 1 -> 0
|
||||
rem116 remainder 7 1 -> 0
|
||||
rem117 remainder 8 1 -> 0
|
||||
rem118 remainder 9 1 -> 0
|
||||
rem119 remainder 10 1 -> 0
|
||||
|
||||
-- Various flavours of remainder by 0
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
rem201 remainder 0 0 -> ? Division_undefined
|
||||
rem202 remainder 0.0E5 0 -> ? Division_undefined
|
||||
rem203 remainder 0.000 0 -> ? Division_undefined
|
||||
rem204 remainder 0.0001 0 -> ? Invalid_operation
|
||||
rem205 remainder 0.01 0 -> ? Invalid_operation
|
||||
rem206 remainder 0.1 0 -> ? Invalid_operation
|
||||
rem207 remainder 1 0 -> ? Invalid_operation
|
||||
rem208 remainder 1 0.0 -> ? Invalid_operation
|
||||
rem209 remainder 10 0.0 -> ? Invalid_operation
|
||||
rem210 remainder 1E+100 0.0 -> ? Invalid_operation
|
||||
rem211 remainder 1E+1000 0 -> ? Invalid_operation
|
||||
|
||||
-- some differences from remainderNear
|
||||
rem231 remainder 0.4 1.020 -> 0.400
|
||||
rem232 remainder 0.50 1.020 -> 0.500
|
||||
rem233 remainder 0.51 1.020 -> 0.510
|
||||
rem234 remainder 0.52 1.020 -> 0.520
|
||||
rem235 remainder 0.6 1.020 -> 0.600
|
||||
|
||||
-- test some cases that are close to exponent overflow
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
rem270 remainder 1 1e999999999 -> 1
|
||||
rem271 remainder 1 0.9e999999999 -> 1
|
||||
rem272 remainder 1 0.99e999999999 -> 1
|
||||
rem273 remainder 1 0.999999999e999999999 -> 1
|
||||
rem274 remainder 9e999999999 1 -> ? Division_impossible
|
||||
rem275 remainder 9.9e999999999 1 -> ? Division_impossible
|
||||
rem276 remainder 9.99e999999999 1 -> ? Division_impossible
|
||||
rem277 remainder 9.99999999e999999999 1 -> ? Division_impossible
|
||||
|
||||
rem280 remainder 0.1 9e-999999999 -> ? Division_impossible
|
||||
rem281 remainder 0.1 99e-999999999 -> ? Division_impossible
|
||||
rem282 remainder 0.1 999e-999999999 -> ? Division_impossible
|
||||
|
||||
rem283 remainder 0.1 9e-999999998 -> ? Division_impossible
|
||||
rem284 remainder 0.1 99e-999999998 -> ? Division_impossible
|
||||
rem285 remainder 0.1 999e-999999998 -> ? Division_impossible
|
||||
rem286 remainder 0.1 999e-999999997 -> ? Division_impossible
|
||||
rem287 remainder 0.1 9999e-999999997 -> ? Division_impossible
|
||||
rem288 remainder 0.1 99999e-999999997 -> ? Division_impossible
|
||||
|
||||
-- rem3xx are from DiagBigDecimal
|
||||
rem301 remainder 1 3 -> 1
|
||||
rem302 remainder 5 5 -> 0
|
||||
rem303 remainder 13 10 -> 3
|
||||
rem304 remainder 13 50 -> 13
|
||||
rem305 remainder 13 100 -> 13
|
||||
rem306 remainder 13 1000 -> 13
|
||||
rem307 remainder .13 1 -> 0.13
|
||||
rem308 remainder 0.133 1 -> 0.133
|
||||
rem309 remainder 0.1033 1 -> 0.1033
|
||||
rem310 remainder 1.033 1 -> 0.033
|
||||
rem311 remainder 10.33 1 -> 0.33
|
||||
rem312 remainder 10.33 10 -> 0.33
|
||||
rem313 remainder 103.3 1 -> 0.3
|
||||
rem314 remainder 133 10 -> 3
|
||||
rem315 remainder 1033 10 -> 3
|
||||
rem316 remainder 1033 50 -> 33
|
||||
rem317 remainder 101.0 3 -> 2.0
|
||||
rem318 remainder 102.0 3 -> 0
|
||||
rem319 remainder 103.0 3 -> 1.0
|
||||
rem320 remainder 2.40 1 -> 0.40
|
||||
rem321 remainder 2.400 1 -> 0.400
|
||||
rem322 remainder 2.4 1 -> 0.4
|
||||
rem323 remainder 2.4 2 -> 0.4
|
||||
rem324 remainder 2.400 2 -> 0.400
|
||||
rem325 remainder 1 0.3 -> 0.1
|
||||
rem326 remainder 1 0.30 -> 0.10
|
||||
rem327 remainder 1 0.300 -> 0.100
|
||||
rem328 remainder 1 0.3000 -> 0.1000
|
||||
rem329 remainder 1.0 0.3 -> 0.1
|
||||
rem330 remainder 1.00 0.3 -> 0.10
|
||||
rem331 remainder 1.000 0.3 -> 0.100
|
||||
rem332 remainder 1.0000 0.3 -> 0.1000
|
||||
rem333 remainder 0.5 2 -> 0.5
|
||||
rem334 remainder 0.5 2.1 -> 0.5
|
||||
rem335 remainder 0.5 2.01 -> 0.50
|
||||
rem336 remainder 0.5 2.001 -> 0.500
|
||||
rem337 remainder 0.50 2 -> 0.50
|
||||
rem338 remainder 0.50 2.01 -> 0.50
|
||||
rem339 remainder 0.50 2.001 -> 0.500
|
||||
|
||||
rem340 remainder 0.5 0.5000001 -> 0.5000000
|
||||
rem341 remainder 0.5 0.50000001 -> 0.50000000
|
||||
rem342 remainder 0.5 0.500000001 -> 0.500000000
|
||||
rem343 remainder 0.5 0.5000000001 -> 0 Inexact Lost_digits Rounded
|
||||
rem344 remainder 0.5 0.50000000001 -> 0 Inexact Lost_digits Rounded
|
||||
rem345 remainder 0.5 0.4999999 -> 1E-7
|
||||
rem346 remainder 0.5 0.49999999 -> 1E-8
|
||||
rem347 remainder 0.5 0.499999999 -> 1E-9
|
||||
rem348 remainder 0.5 0.4999999999 -> 0 Inexact Lost_digits Rounded
|
||||
rem349 remainder 0.5 0.49999999999 -> 0 Inexact Lost_digits Rounded
|
||||
|
||||
rem350 remainder 0.03 7 -> 0.03
|
||||
rem351 remainder 5 2 -> 1
|
||||
rem352 remainder 4.1 2 -> 0.1
|
||||
rem353 remainder 4.01 2 -> 0.01
|
||||
rem354 remainder 4.001 2 -> 0.001
|
||||
rem355 remainder 4.0001 2 -> 0.0001
|
||||
rem356 remainder 4.00001 2 -> 0.00001
|
||||
rem357 remainder 4.000001 2 -> 0.000001
|
||||
rem358 remainder 4.0000001 2 -> 1E-7
|
||||
|
||||
rem360 remainder 1.2 0.7345 -> 0.4655
|
||||
rem361 remainder 0.8 12 -> 0.8
|
||||
rem362 remainder 0.8 0.2 -> 0
|
||||
rem363 remainder 0.8 0.3 -> 0.2
|
||||
rem364 remainder 0.800 12 -> 0.800
|
||||
rem365 remainder 0.800 1.7 -> 0.800
|
||||
rem366 remainder 2.400 2 -> 0.400
|
||||
|
||||
precision: 6
|
||||
rem371 remainder 2.400 2 -> 0.400
|
||||
precision: 3
|
||||
-- lostDigits in the next one
|
||||
rem372 remainder 12345678900000 12e+12 -> 3E+11 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 5
|
||||
rem381 remainder 12345 1 -> 0
|
||||
rem382 remainder 12345 1.0001 -> 0.7657
|
||||
rem383 remainder 12345 1.001 -> 0.668
|
||||
rem384 remainder 12345 1.01 -> 0.78
|
||||
rem385 remainder 12345 1.1 -> 0.8
|
||||
rem386 remainder 12355 4 -> 3
|
||||
rem387 remainder 12345 4 -> 1
|
||||
rem388 remainder 12355 4.0001 -> 2.6912
|
||||
rem389 remainder 12345 4.0001 -> 0.6914
|
||||
rem390 remainder 12345 4.9 -> 1.9
|
||||
rem391 remainder 12345 4.99 -> 4.73
|
||||
rem392 remainder 12345 4.999 -> 2.469
|
||||
rem393 remainder 12345 4.9999 -> 0.2469
|
||||
rem394 remainder 12345 5 -> 0
|
||||
rem395 remainder 12345 5.0001 -> 4.7532
|
||||
rem396 remainder 12345 5.001 -> 2.532
|
||||
rem397 remainder 12345 5.01 -> 0.36
|
||||
rem398 remainder 12345 5.1 -> 3.0
|
||||
|
||||
precision: 9
|
||||
-- some nasty division-by-1 cases [some similar above]
|
||||
rem401 remainder 0.5 1 -> 0.5
|
||||
rem402 remainder 0.55 1 -> 0.55
|
||||
rem403 remainder 0.555 1 -> 0.555
|
||||
rem404 remainder 0.5555 1 -> 0.5555
|
||||
rem405 remainder 0.55555 1 -> 0.55555
|
||||
rem406 remainder 0.555555 1 -> 0.555555
|
||||
rem407 remainder 0.5555555 1 -> 0.5555555
|
||||
rem408 remainder 0.55555555 1 -> 0.55555555
|
||||
rem409 remainder 0.555555555 1 -> 0.555555555
|
||||
|
||||
-- overflow and underflow tests [from divide]
|
||||
precision: 9
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
rem430 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Lost_digits Rounded
|
||||
rem431 remainder 9E+999999999 +0.23456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem432 remainder +0.100 9E+999999999 -> 0.100
|
||||
rem433 remainder 9E-999999999 +9.100 -> 9E-999999999
|
||||
rem435 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Lost_digits Rounded
|
||||
rem436 remainder 9E+999999999 -0.83456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
rem437 remainder -0.100 9E+999999999 -> -0.100
|
||||
rem438 remainder 9E-999999999 -9.100 -> 9E-999999999
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
rem501 remainder 12345678000 100 -> 0 Rounded
|
||||
rem502 remainder 1 12345678000 -> 1 Rounded
|
||||
rem503 remainder 1234567800 10 -> 0 Rounded
|
||||
rem504 remainder 1 1234567800 -> 1 Rounded
|
||||
rem505 remainder 1234567890 10 -> 0 Rounded
|
||||
rem506 remainder 1 1234567890 -> 1 Rounded
|
||||
rem507 remainder 1234567891 10 -> 0 Inexact Lost_digits Rounded
|
||||
rem508 remainder 1 1234567891 -> 1 Inexact Lost_digits Rounded
|
||||
rem509 remainder 12345678901 100 -> 0 Inexact Lost_digits Rounded
|
||||
rem510 remainder 1 12345678901 -> 1 Inexact Lost_digits Rounded
|
||||
rem511 remainder 1234567896 10 -> 0 Inexact Lost_digits Rounded
|
||||
rem512 remainder 1 1234567896 -> 1 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
rem541 remainder 12345678000 100 -> 0
|
||||
rem542 remainder 1 12345678000 -> 1
|
||||
rem543 remainder 1234567800 10 -> 0
|
||||
rem544 remainder 1 1234567800 -> 1
|
||||
rem545 remainder 1234567890 10 -> 0
|
||||
rem546 remainder 1 1234567890 -> 1
|
||||
rem547 remainder 1234567891 10 -> 1
|
||||
rem548 remainder 1 1234567891 -> 1
|
||||
rem549 remainder 12345678901 100 -> 1
|
||||
rem550 remainder 1 12345678901 -> 1
|
||||
rem551 remainder 1234567896 10 -> 6
|
||||
rem552 remainder 1 1234567896 -> 1
|
||||
|
||||
-- Null tests
|
||||
rem900 remainder 10 # -> ? Invalid_operation
|
||||
rem901 remainder # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
------------------------------------------------------------------------
|
||||
-- remainderNear0.decTest -- decimal remainder-near (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
|
||||
|
||||
remn001 remaindernear 1 1 -> 0
|
||||
remn002 remaindernear 2 1 -> 0
|
||||
remn003 remaindernear 1 2 -> 1
|
||||
remn004 remaindernear 2 2 -> 0
|
||||
remn005 remaindernear 0 1 -> 0
|
||||
remn006 remaindernear 0 2 -> 0
|
||||
remn007 remaindernear 1 3 -> 1
|
||||
remn008 remaindernear 2 3 -> -1
|
||||
remn009 remaindernear 3 3 -> 0
|
||||
|
||||
remn010 remaindernear 2.4 1 -> 0.4
|
||||
remn011 remaindernear 2.4 -1 -> 0.4
|
||||
remn012 remaindernear -2.4 1 -> -0.4
|
||||
remn013 remaindernear -2.4 -1 -> -0.4
|
||||
remn014 remaindernear 2.40 1 -> 0.40
|
||||
remn015 remaindernear 2.400 1 -> 0.400
|
||||
remn016 remaindernear 2.4 2 -> 0.4
|
||||
remn017 remaindernear 2.400 2 -> 0.400
|
||||
remn018 remaindernear 2. 2 -> 0
|
||||
remn019 remaindernear 20 20 -> 0
|
||||
|
||||
remn020 remaindernear 187 187 -> 0
|
||||
remn021 remaindernear 5 2 -> 1
|
||||
remn022 remaindernear 5 2.0 -> 1.0
|
||||
remn023 remaindernear 5 2.000 -> 1.000
|
||||
remn024 remaindernear 5 0.200 -> 0
|
||||
remn025 remaindernear 5 0.200 -> 0
|
||||
|
||||
remn030 remaindernear 1 2 -> 1
|
||||
remn031 remaindernear 1 4 -> 1
|
||||
remn032 remaindernear 1 8 -> 1
|
||||
remn033 remaindernear 1 16 -> 1
|
||||
remn034 remaindernear 1 32 -> 1
|
||||
remn035 remaindernear 1 64 -> 1
|
||||
remn040 remaindernear 1 -2 -> 1
|
||||
remn041 remaindernear 1 -4 -> 1
|
||||
remn042 remaindernear 1 -8 -> 1
|
||||
remn043 remaindernear 1 -16 -> 1
|
||||
remn044 remaindernear 1 -32 -> 1
|
||||
remn045 remaindernear 1 -64 -> 1
|
||||
remn050 remaindernear -1 2 -> -1
|
||||
remn051 remaindernear -1 4 -> -1
|
||||
remn052 remaindernear -1 8 -> -1
|
||||
remn053 remaindernear -1 16 -> -1
|
||||
remn054 remaindernear -1 32 -> -1
|
||||
remn055 remaindernear -1 64 -> -1
|
||||
remn060 remaindernear -1 -2 -> -1
|
||||
remn061 remaindernear -1 -4 -> -1
|
||||
remn062 remaindernear -1 -8 -> -1
|
||||
remn063 remaindernear -1 -16 -> -1
|
||||
remn064 remaindernear -1 -32 -> -1
|
||||
remn065 remaindernear -1 -64 -> -1
|
||||
|
||||
remn070 remaindernear 999999999 1 -> 0
|
||||
remn071 remaindernear 999999999.4 1 -> 0 Inexact Lost_digits Rounded
|
||||
remn072 remaindernear 999999999.5 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn073 remaindernear 999999999.9 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn074 remaindernear 999999999.999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
precision: 6
|
||||
remn080 remaindernear 999999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn081 remaindernear 99999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn082 remaindernear 9999999 1 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn083 remaindernear 999999 1 -> 0
|
||||
remn084 remaindernear 99999 1 -> 0
|
||||
remn085 remaindernear 9999 1 -> 0
|
||||
remn086 remaindernear 999 1 -> 0
|
||||
remn087 remaindernear 99 1 -> 0
|
||||
remn088 remaindernear 9 1 -> 0
|
||||
|
||||
precision: 9
|
||||
remn090 remaindernear 0. 1 -> 0
|
||||
remn091 remaindernear .0 1 -> 0
|
||||
remn092 remaindernear 0.00 1 -> 0
|
||||
remn093 remaindernear 0.00E+9 1 -> 0
|
||||
remn094 remaindernear 0.0000E-50 1 -> 0
|
||||
|
||||
remn100 remaindernear 1 1 -> 0
|
||||
remn101 remaindernear 1 2 -> 1
|
||||
remn102 remaindernear 1 3 -> 1
|
||||
remn103 remaindernear 1 4 -> 1
|
||||
remn104 remaindernear 1 5 -> 1
|
||||
remn105 remaindernear 1 6 -> 1
|
||||
remn106 remaindernear 1 7 -> 1
|
||||
remn107 remaindernear 1 8 -> 1
|
||||
remn108 remaindernear 1 9 -> 1
|
||||
remn109 remaindernear 1 10 -> 1
|
||||
remn110 remaindernear 1 1 -> 0
|
||||
remn111 remaindernear 2 1 -> 0
|
||||
remn112 remaindernear 3 1 -> 0
|
||||
remn113 remaindernear 4 1 -> 0
|
||||
remn114 remaindernear 5 1 -> 0
|
||||
remn115 remaindernear 6 1 -> 0
|
||||
remn116 remaindernear 7 1 -> 0
|
||||
remn117 remaindernear 8 1 -> 0
|
||||
remn118 remaindernear 9 1 -> 0
|
||||
remn119 remaindernear 10 1 -> 0
|
||||
|
||||
-- Various flavours of remaindernear by 0
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
remn201 remaindernear 0 0 -> ? Division_undefined
|
||||
remn202 remaindernear 0.0E5 0 -> ? Division_undefined
|
||||
remn203 remaindernear 0.000 0 -> ? Division_undefined
|
||||
remn204 remaindernear 0.0001 0 -> ? Invalid_operation
|
||||
remn205 remaindernear 0.01 0 -> ? Invalid_operation
|
||||
remn206 remaindernear 0.1 0 -> ? Invalid_operation
|
||||
remn207 remaindernear 1 0 -> ? Invalid_operation
|
||||
remn208 remaindernear 1 0.0 -> ? Invalid_operation
|
||||
remn209 remaindernear 10 0.0 -> ? Invalid_operation
|
||||
remn210 remaindernear 1E+100 0.0 -> ? Invalid_operation
|
||||
remn211 remaindernear 1E+1000 0 -> ? Invalid_operation
|
||||
|
||||
-- tests from the extended specification
|
||||
remn221 remaindernear 2.1 3 -> -0.9
|
||||
remn222 remaindernear 10 6 -> -2
|
||||
remn223 remaindernear 10 3 -> 1
|
||||
remn224 remaindernear -10 3 -> -1
|
||||
remn225 remaindernear 10.2 1 -> 0.2
|
||||
remn226 remaindernear 10 0.3 -> 0.1
|
||||
remn227 remaindernear 3.6 1.3 -> -0.3
|
||||
|
||||
-- some differences from remainder
|
||||
remn231 remaindernear 0.4 1.020 -> 0.400
|
||||
remn232 remaindernear 0.50 1.020 -> 0.500
|
||||
remn233 remaindernear 0.51 1.020 -> 0.510
|
||||
remn234 remaindernear 0.52 1.020 -> -0.500
|
||||
remn235 remaindernear 0.6 1.020 -> -0.420
|
||||
|
||||
-- test some cases that are close to exponent overflow
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
remn270 remaindernear 1 1e999999999 -> 1
|
||||
remn271 remaindernear 1 0.9e999999999 -> 1
|
||||
remn272 remaindernear 1 0.99e999999999 -> 1
|
||||
remn273 remaindernear 1 0.999999999e999999999 -> 1
|
||||
remn274 remaindernear 9e999999999 1 -> ? Division_impossible
|
||||
remn275 remaindernear 9.9e999999999 1 -> ? Division_impossible
|
||||
remn276 remaindernear 9.99e999999999 1 -> ? Division_impossible
|
||||
remn277 remaindernear 9.99999999e999999999 1 -> ? Division_impossible
|
||||
|
||||
remn280 remaindernear 0.1 9e-999999999 -> ? Division_impossible
|
||||
remn281 remaindernear 0.1 99e-999999999 -> ? Division_impossible
|
||||
remn282 remaindernear 0.1 999e-999999999 -> ? Division_impossible
|
||||
|
||||
remn283 remaindernear 0.1 9e-999999998 -> ? Division_impossible
|
||||
remn284 remaindernear 0.1 99e-999999998 -> ? Division_impossible
|
||||
remn285 remaindernear 0.1 999e-999999998 -> ? Division_impossible
|
||||
remn286 remaindernear 0.1 999e-999999997 -> ? Division_impossible
|
||||
remn287 remaindernear 0.1 9999e-999999997 -> ? Division_impossible
|
||||
remn288 remaindernear 0.1 99999e-999999997 -> ? Division_impossible
|
||||
|
||||
-- remn3xx are from DiagBigDecimal
|
||||
remn301 remaindernear 1 3 -> 1
|
||||
remn302 remaindernear 5 5 -> 0
|
||||
remn303 remaindernear 13 10 -> 3
|
||||
remn304 remaindernear 13 50 -> 13
|
||||
remn305 remaindernear 13 100 -> 13
|
||||
remn306 remaindernear 13 1000 -> 13
|
||||
remn307 remaindernear .13 1 -> 0.13
|
||||
remn308 remaindernear 0.133 1 -> 0.133
|
||||
remn309 remaindernear 0.1033 1 -> 0.1033
|
||||
remn310 remaindernear 1.033 1 -> 0.033
|
||||
remn311 remaindernear 10.33 1 -> 0.33
|
||||
remn312 remaindernear 10.33 10 -> 0.33
|
||||
remn313 remaindernear 103.3 1 -> 0.3
|
||||
remn314 remaindernear 133 10 -> 3
|
||||
remn315 remaindernear 1033 10 -> 3
|
||||
remn316 remaindernear 1033 50 -> -17
|
||||
remn317 remaindernear 101.0 3 -> -1.0
|
||||
remn318 remaindernear 102.0 3 -> 0
|
||||
remn319 remaindernear 103.0 3 -> 1.0
|
||||
remn320 remaindernear 2.40 1 -> 0.40
|
||||
remn321 remaindernear 2.400 1 -> 0.400
|
||||
remn322 remaindernear 2.4 1 -> 0.4
|
||||
remn323 remaindernear 2.4 2 -> 0.4
|
||||
remn324 remaindernear 2.400 2 -> 0.400
|
||||
remn325 remaindernear 1 0.3 -> 0.1
|
||||
remn326 remaindernear 1 0.30 -> 0.10
|
||||
remn327 remaindernear 1 0.300 -> 0.100
|
||||
remn328 remaindernear 1 0.3000 -> 0.1000
|
||||
remn329 remaindernear 1.0 0.3 -> 0.1
|
||||
remn330 remaindernear 1.00 0.3 -> 0.10
|
||||
remn331 remaindernear 1.000 0.3 -> 0.100
|
||||
remn332 remaindernear 1.0000 0.3 -> 0.1000
|
||||
remn333 remaindernear 0.5 2 -> 0.5
|
||||
remn334 remaindernear 0.5 2.1 -> 0.5
|
||||
remn335 remaindernear 0.5 2.01 -> 0.50
|
||||
remn336 remaindernear 0.5 2.001 -> 0.500
|
||||
remn337 remaindernear 0.50 2 -> 0.50
|
||||
remn338 remaindernear 0.50 2.01 -> 0.50
|
||||
remn339 remaindernear 0.50 2.001 -> 0.500
|
||||
|
||||
remn340 remaindernear 0.5 0.5000001 -> -1E-7
|
||||
remn341 remaindernear 0.5 0.50000001 -> -1E-8
|
||||
remn342 remaindernear 0.5 0.500000001 -> -1E-9
|
||||
remn343 remaindernear 0.5 0.5000000001 -> 0 Inexact Lost_digits Rounded
|
||||
remn344 remaindernear 0.5 0.50000000001 -> 0 Inexact Lost_digits Rounded
|
||||
remn345 remaindernear 0.5 0.4999999 -> 1E-7
|
||||
remn346 remaindernear 0.5 0.49999999 -> 1E-8
|
||||
remn347 remaindernear 0.5 0.499999999 -> 1E-9
|
||||
remn348 remaindernear 0.5 0.4999999999 -> 0 Inexact Lost_digits Rounded
|
||||
remn349 remaindernear 0.5 0.49999999999 -> 0 Inexact Lost_digits Rounded
|
||||
|
||||
remn350 remaindernear 0.03 7 -> 0.03
|
||||
remn351 remaindernear 5 2 -> 1
|
||||
remn352 remaindernear 4.1 2 -> 0.1
|
||||
remn353 remaindernear 4.01 2 -> 0.01
|
||||
remn354 remaindernear 4.001 2 -> 0.001
|
||||
remn355 remaindernear 4.0001 2 -> 0.0001
|
||||
remn356 remaindernear 4.00001 2 -> 0.00001
|
||||
remn357 remaindernear 4.000001 2 -> 0.000001
|
||||
remn358 remaindernear 4.0000001 2 -> 1E-7
|
||||
|
||||
remn360 remaindernear 1.2 0.7345 -> -0.2690
|
||||
remn361 remaindernear 0.8 12 -> 0.8
|
||||
remn362 remaindernear 0.8 0.2 -> 0
|
||||
remn363 remaindernear 0.8 0.3 -> -0.1
|
||||
remn364 remaindernear 0.800 12 -> 0.800
|
||||
remn365 remaindernear 0.800 1.7 -> 0.800
|
||||
remn366 remaindernear 2.400 2 -> 0.400
|
||||
|
||||
precision: 6
|
||||
remn371 remaindernear 2.400 2 -> 0.400
|
||||
precision: 3
|
||||
-- lostDigits in the next one
|
||||
remn372 remaindernear 12345678900000 12e+12 -> 3E+11 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 5
|
||||
remn381 remaindernear 12345 1 -> 0
|
||||
remn382 remaindernear 12345 1.0001 -> -0.2344
|
||||
remn383 remaindernear 12345 1.001 -> -0.333
|
||||
remn384 remaindernear 12345 1.01 -> -0.23
|
||||
remn385 remaindernear 12345 1.1 -> -0.3
|
||||
remn386 remaindernear 12355 4 -> -1
|
||||
remn387 remaindernear 12345 4 -> 1
|
||||
remn388 remaindernear 12355 4.0001 -> -1.3089
|
||||
remn389 remaindernear 12345 4.0001 -> 0.6914
|
||||
remn390 remaindernear 12345 4.9 -> 1.9
|
||||
remn391 remaindernear 12345 4.99 -> -0.26
|
||||
remn392 remaindernear 12345 4.999 -> 2.469
|
||||
remn393 remaindernear 12345 4.9999 -> 0.2469
|
||||
remn394 remaindernear 12345 5 -> 0
|
||||
remn395 remaindernear 12345 5.0001 -> -0.2469
|
||||
remn396 remaindernear 12345 5.001 -> -2.469
|
||||
remn397 remaindernear 12345 5.01 -> 0.36
|
||||
remn398 remaindernear 12345 5.1 -> -2.1
|
||||
|
||||
precision: 9
|
||||
-- some nasty division-by-1 cases [some similar above]
|
||||
remn401 remaindernear 0.4 1 -> 0.4
|
||||
remn402 remaindernear 0.45 1 -> 0.45
|
||||
remn403 remaindernear 0.455 1 -> 0.455
|
||||
remn404 remaindernear 0.4555 1 -> 0.4555
|
||||
remn405 remaindernear 0.45555 1 -> 0.45555
|
||||
remn406 remaindernear 0.455555 1 -> 0.455555
|
||||
remn407 remaindernear 0.4555555 1 -> 0.4555555
|
||||
remn408 remaindernear 0.45555555 1 -> 0.45555555
|
||||
remn409 remaindernear 0.455555555 1 -> 0.455555555
|
||||
|
||||
-- overflow and underflow tests [from divide]
|
||||
precision: 9
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
remn430 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Lost_digits Rounded
|
||||
remn431 remaindernear 9E+999999999 +0.23456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn432 remaindernear +0.100 9E+999999999 -> 0.100
|
||||
remn433 remaindernear 9E-999999999 +9.100 -> 9E-999999999
|
||||
remn435 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Lost_digits Rounded
|
||||
remn436 remaindernear 9E+999999999 -0.83456789012345E-0 -> ? Division_impossible Inexact Lost_digits Rounded
|
||||
remn437 remaindernear -0.100 9E+999999999 -> -0.100
|
||||
remn438 remaindernear 9E-999999999 -9.100 -> 9E-999999999
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
remn501 remaindernear 12345678000 100 -> 0 Rounded
|
||||
remn502 remaindernear 1 12345678000 -> 1 Rounded
|
||||
remn503 remaindernear 1234567800 10 -> 0 Rounded
|
||||
remn504 remaindernear 1 1234567800 -> 1 Rounded
|
||||
remn505 remaindernear 1234567890 10 -> 0 Rounded
|
||||
remn506 remaindernear 1 1234567890 -> 1 Rounded
|
||||
remn507 remaindernear 1234567891 10 -> 0 Inexact Lost_digits Rounded
|
||||
remn508 remaindernear 1 1234567891 -> 1 Inexact Lost_digits Rounded
|
||||
remn509 remaindernear 12345678901 100 -> 0 Inexact Lost_digits Rounded
|
||||
remn510 remaindernear 1 12345678901 -> 1 Inexact Lost_digits Rounded
|
||||
remn511 remaindernear 1234567896 10 -> 0 Inexact Lost_digits Rounded
|
||||
remn512 remaindernear 1 1234567896 -> 1 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
remn541 remaindernear 12345678000 100 -> 0
|
||||
remn542 remaindernear 1 12345678000 -> 1
|
||||
remn543 remaindernear 1234567800 10 -> 0
|
||||
remn544 remaindernear 1 1234567800 -> 1
|
||||
remn545 remaindernear 1234567890 10 -> 0
|
||||
remn546 remaindernear 1 1234567890 -> 1
|
||||
remn547 remaindernear 1234567891 10 -> 1
|
||||
remn548 remaindernear 1 1234567891 -> 1
|
||||
remn549 remaindernear 12345678901 100 -> 1
|
||||
remn550 remaindernear 1 12345678901 -> 1
|
||||
remn551 remaindernear 1234567896 10 -> -4
|
||||
remn552 remaindernear 1 1234567896 -> 1
|
||||
|
||||
-- early tests
|
||||
remn601 remaindernear 10 6 -> -2
|
||||
remn602 remaindernear -10 6 -> 2
|
||||
remn603 remaindernear 11 3 -> -1
|
||||
remn604 remaindernear 11 5 -> 1
|
||||
remn605 remaindernear 7.7 8 -> -0.3
|
||||
remn606 remaindernear 31.5 3 -> 1.5 -- i=10
|
||||
remn607 remaindernear 34.5 3 -> -1.5 -- i=11
|
||||
|
||||
-- Null tests
|
||||
remn900 remaindernear 10 # -> ? Invalid_operation
|
||||
remn901 remaindernear # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
------------------------------------------------------------------------
|
||||
-- rescale0.decTest -- decimal rescale operation (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
|
||||
|
||||
-- [obsolete] Quantize0.decTest has the improved version
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
res001 rescale 0 0 -> 0
|
||||
res002 rescale 1 0 -> 1
|
||||
res003 rescale 0.1 +2 -> 0E+2 Inexact Rounded
|
||||
res005 rescale 0.1 +1 -> 0E+1 Inexact Rounded
|
||||
res006 rescale 0.1 0 -> 0 Inexact Rounded
|
||||
res007 rescale 0.1 -1 -> 0.1
|
||||
res008 rescale 0.1 -2 -> 0.10
|
||||
res009 rescale 0.1 -3 -> 0.100
|
||||
res010 rescale 0.9 +2 -> 0E+2 Inexact Rounded
|
||||
res011 rescale 0.9 +1 -> 0E+1 Inexact Rounded
|
||||
res012 rescale 0.9 +0 -> 1 Inexact Rounded
|
||||
res013 rescale 0.9 -1 -> 0.9
|
||||
res014 rescale 0.9 -2 -> 0.90
|
||||
res015 rescale 0.9 -3 -> 0.900
|
||||
-- negatives
|
||||
res021 rescale -0 0 -> 0
|
||||
res022 rescale -1 0 -> -1
|
||||
res023 rescale -0.1 +2 -> 0E+2 Inexact Rounded
|
||||
res025 rescale -0.1 +1 -> 0E+1 Inexact Rounded
|
||||
res026 rescale -0.1 0 -> 0 Inexact Rounded
|
||||
res027 rescale -0.1 -1 -> -0.1
|
||||
res028 rescale -0.1 -2 -> -0.10
|
||||
res029 rescale -0.1 -3 -> -0.100
|
||||
res030 rescale -0.4 +2 -> 0E+2 Inexact Rounded
|
||||
res031 rescale -0.4 +1 -> 0E+1 Inexact Rounded
|
||||
res032 rescale -0.4 +0 -> 0 Inexact Rounded
|
||||
res033 rescale -0.4 -1 -> -0.4
|
||||
res034 rescale -0.4 -2 -> -0.40
|
||||
res035 rescale -0.4 -3 -> -0.400
|
||||
res036 rescale -0.5 +2 -> 0E+2 Inexact Rounded
|
||||
res037 rescale -0.5 +1 -> 0E+1 Inexact Rounded
|
||||
res038 rescale -0.5 +0 -> -1 Inexact Rounded
|
||||
res039 rescale -0.5 -1 -> -0.5
|
||||
res040 rescale -0.5 -2 -> -0.50
|
||||
res041 rescale -0.5 -3 -> -0.500
|
||||
res042 rescale -0.9 +2 -> 0E+2 Inexact Rounded
|
||||
res043 rescale -0.9 +1 -> 0E+1 Inexact Rounded
|
||||
res044 rescale -0.9 +0 -> -1 Inexact Rounded
|
||||
res045 rescale -0.9 -1 -> -0.9
|
||||
res046 rescale -0.9 -2 -> -0.90
|
||||
res047 rescale -0.9 -3 -> -0.900
|
||||
|
||||
-- examples from Base Specification
|
||||
res080 rescale 2.17 -3 -> 2.170
|
||||
res081 rescale 2.17 -2 -> 2.17
|
||||
res082 rescale 2.17 -1 -> 2.2 Inexact Rounded
|
||||
res083 rescale 2.17 -0 -> 2 Inexact Rounded
|
||||
res084 rescale 2.17 +1 -> 0E+1 Inexact Rounded
|
||||
res085 rescale 217 -1 -> 217.0
|
||||
res086 rescale 217 0 -> 217
|
||||
res087 rescale 217 +1 -> 2.2E+2 Inexact Rounded
|
||||
res088 rescale 217 +2 -> 2E+2 Inexact Rounded
|
||||
|
||||
-- -ve exponents .. [mostly]
|
||||
res089 rescale 12 +4 -> 0E+4 Inexact Rounded
|
||||
res090 rescale 12 +3 -> 0E+3 Inexact Rounded
|
||||
res091 rescale 12 +2 -> 0E+2 Inexact Rounded
|
||||
res092 rescale 12 +1 -> 1E+1 Inexact Rounded
|
||||
res093 rescale 1.2345 -2 -> 1.23 Inexact Rounded
|
||||
res094 rescale 1.2355 -2 -> 1.24 Inexact Rounded
|
||||
res095 rescale 1.2345 -6 -> 1.234500
|
||||
res096 rescale 9.9999 -2 -> 10.00 Inexact Rounded
|
||||
res097 rescale 0.0001 -2 -> 0.00 Inexact Rounded
|
||||
res098 rescale 0.001 -2 -> 0.00 Inexact Rounded
|
||||
res099 rescale 0.009 -2 -> 0.01 Inexact Rounded
|
||||
res100 rescale 92 +2 -> 1E+2 Inexact Rounded
|
||||
res101 rescale -1 0 -> -1
|
||||
res102 rescale -1 -1 -> -1.0
|
||||
res103 rescale -1 -2 -> -1.00
|
||||
res104 rescale 0 0 -> 0
|
||||
res105 rescale 0 -1 -> 0.0
|
||||
res106 rescale 0 -2 -> 0.00
|
||||
res107 rescale 0.00 0 -> 0
|
||||
res108 rescale 0 +1 -> 0E+1
|
||||
res109 rescale 0 +2 -> 0E+2
|
||||
res110 rescale +1 0 -> 1
|
||||
res111 rescale +1 -1 -> 1.0
|
||||
res112 rescale +1 -2 -> 1.00
|
||||
|
||||
res120 rescale 1.04 -3 -> 1.040
|
||||
res121 rescale 1.04 -2 -> 1.04
|
||||
res122 rescale 1.04 -1 -> 1.0 Inexact Rounded
|
||||
res123 rescale 1.04 0 -> 1 Inexact Rounded
|
||||
res124 rescale 1.05 -3 -> 1.050
|
||||
res125 rescale 1.05 -2 -> 1.05
|
||||
res126 rescale 1.05 -1 -> 1.1 Inexact Rounded
|
||||
res127 rescale 1.05 0 -> 1 Inexact Rounded
|
||||
res128 rescale 1.05 -3 -> 1.050
|
||||
res129 rescale 1.05 -2 -> 1.05
|
||||
res130 rescale 1.05 -1 -> 1.1 Inexact Rounded
|
||||
res131 rescale 1.05 0 -> 1 Inexact Rounded
|
||||
res132 rescale 1.06 -3 -> 1.060
|
||||
res133 rescale 1.06 -2 -> 1.06
|
||||
res134 rescale 1.06 -1 -> 1.1 Inexact Rounded
|
||||
res135 rescale 1.06 0 -> 1 Inexact Rounded
|
||||
|
||||
res140 rescale -10 -2 -> -10.00
|
||||
res141 rescale +1 -2 -> 1.00
|
||||
res142 rescale +10 -2 -> 10.00
|
||||
res143 rescale 1E+10 -2 -> ? Invalid_operation
|
||||
res144 rescale 1E-10 -2 -> 0.00 Inexact Rounded
|
||||
res145 rescale 1E-2 -2 -> 0.01
|
||||
res146 rescale 0E-10 -2 -> 0.00
|
||||
|
||||
res150 rescale 1.0600 -5 -> 1.06000
|
||||
res151 rescale 1.0600 -4 -> 1.0600
|
||||
res152 rescale 1.0600 -3 -> 1.060 Rounded
|
||||
res153 rescale 1.0600 -2 -> 1.06 Rounded
|
||||
res154 rescale 1.0600 -1 -> 1.1 Inexact Rounded
|
||||
res155 rescale 1.0600 0 -> 1 Inexact Rounded
|
||||
|
||||
-- +ve exponents ..
|
||||
res201 rescale -1 +0 -> -1
|
||||
res202 rescale -1 +1 -> 0E+1 Inexact Rounded
|
||||
res203 rescale -1 +2 -> 0E+2 Inexact Rounded
|
||||
res204 rescale 0 +0 -> 0
|
||||
res205 rescale 0 +1 -> 0E+1
|
||||
res206 rescale 0 +2 -> 0E+2
|
||||
res207 rescale +1 +0 -> 1
|
||||
res208 rescale +1 +1 -> 0E+1 Inexact Rounded
|
||||
res209 rescale +1 +2 -> 0E+2 Inexact Rounded
|
||||
|
||||
res220 rescale 1.04 +3 -> 0E+3 Inexact Rounded
|
||||
res221 rescale 1.04 +2 -> 0E+2 Inexact Rounded
|
||||
res222 rescale 1.04 +1 -> 0E+1 Inexact Rounded
|
||||
res223 rescale 1.04 +0 -> 1 Inexact Rounded
|
||||
res224 rescale 1.05 +3 -> 0E+3 Inexact Rounded
|
||||
res225 rescale 1.05 +2 -> 0E+2 Inexact Rounded
|
||||
res226 rescale 1.05 +1 -> 0E+1 Inexact Rounded
|
||||
res227 rescale 1.05 +0 -> 1 Inexact Rounded
|
||||
res228 rescale 1.05 +3 -> 0E+3 Inexact Rounded
|
||||
res229 rescale 1.05 +2 -> 0E+2 Inexact Rounded
|
||||
res230 rescale 1.05 +1 -> 0E+1 Inexact Rounded
|
||||
res231 rescale 1.05 +0 -> 1 Inexact Rounded
|
||||
res232 rescale 1.06 +3 -> 0E+3 Inexact Rounded
|
||||
res233 rescale 1.06 +2 -> 0E+2 Inexact Rounded
|
||||
res234 rescale 1.06 +1 -> 0E+1 Inexact Rounded
|
||||
res235 rescale 1.06 +0 -> 1 Inexact Rounded
|
||||
|
||||
res240 rescale -10 +1 -> -1E+1 Rounded
|
||||
res241 rescale +1 +1 -> 0E+1 Inexact Rounded
|
||||
res242 rescale +10 +1 -> 1E+1 Rounded
|
||||
res243 rescale 1E+1 +1 -> 1E+1 -- underneath this is E+1
|
||||
res244 rescale 1E+2 +1 -> 1.0E+2 -- underneath this is E+1
|
||||
res245 rescale 1E+3 +1 -> 1.00E+3 -- underneath this is E+1
|
||||
res246 rescale 1E+4 +1 -> 1.000E+4 -- underneath this is E+1
|
||||
res247 rescale 1E+5 +1 -> 1.0000E+5 -- underneath this is E+1
|
||||
res248 rescale 1E+6 +1 -> 1.00000E+6 -- underneath this is E+1
|
||||
res249 rescale 1E+7 +1 -> 1.000000E+7 -- underneath this is E+1
|
||||
res250 rescale 1E+8 +1 -> 1.0000000E+8 -- underneath this is E+1
|
||||
res251 rescale 1E+9 +1 -> 1.00000000E+9 -- underneath this is E+1
|
||||
-- next one tries to add 9 zeros
|
||||
res252 rescale 1E+10 +1 -> ? Invalid_operation
|
||||
res253 rescale 1E-10 +1 -> 0E+1 Inexact Rounded
|
||||
res254 rescale 1E-2 +1 -> 0E+1 Inexact Rounded
|
||||
res255 rescale 0E-10 +1 -> 0E+1
|
||||
|
||||
res260 rescale -10 +2 -> 0E+2 Inexact Rounded
|
||||
res261 rescale +1 +2 -> 0E+2 Inexact Rounded
|
||||
res262 rescale +10 +2 -> 0E+2 Inexact Rounded
|
||||
res263 rescale 1E+1 +2 -> 0E+2 Inexact Rounded
|
||||
res264 rescale 1E+2 +2 -> 1E+2
|
||||
res265 rescale 1E+3 +2 -> 1.0E+3
|
||||
res266 rescale 1E+4 +2 -> 1.00E+4
|
||||
res267 rescale 1E+5 +2 -> 1.000E+5
|
||||
res268 rescale 1E+6 +2 -> 1.0000E+6
|
||||
res269 rescale 1E+7 +2 -> 1.00000E+7
|
||||
res270 rescale 1E+8 +2 -> 1.000000E+8
|
||||
res271 rescale 1E+9 +2 -> 1.0000000E+9
|
||||
res272 rescale 1E+10 +2 -> 1.00000000E+10
|
||||
res273 rescale 1E-10 +2 -> 0E+2 Inexact Rounded
|
||||
res274 rescale 1E-2 +2 -> 0E+2 Inexact Rounded
|
||||
res275 rescale 0E-10 +2 -> 0E+2
|
||||
|
||||
res280 rescale -10 +3 -> 0E+3 Inexact Rounded
|
||||
res281 rescale +1 +3 -> 0E+3 Inexact Rounded
|
||||
res282 rescale +10 +3 -> 0E+3 Inexact Rounded
|
||||
res283 rescale 1E+1 +3 -> 0E+3 Inexact Rounded
|
||||
res284 rescale 1E+2 +3 -> 0E+3 Inexact Rounded
|
||||
res285 rescale 1E+3 +3 -> 1E+3
|
||||
res286 rescale 1E+4 +3 -> 1.0E+4
|
||||
res287 rescale 1E+5 +3 -> 1.00E+5
|
||||
res288 rescale 1E+6 +3 -> 1.000E+6
|
||||
res289 rescale 1E+7 +3 -> 1.0000E+7
|
||||
res290 rescale 1E+8 +3 -> 1.00000E+8
|
||||
res291 rescale 1E+9 +3 -> 1.000000E+9
|
||||
res292 rescale 1E+10 +3 -> 1.0000000E+10
|
||||
res293 rescale 1E-10 +3 -> 0E+3 Inexact Rounded
|
||||
res294 rescale 1E-2 +3 -> 0E+3 Inexact Rounded
|
||||
res295 rescale 0E-10 +3 -> 0E+3
|
||||
|
||||
-- some individuals
|
||||
precision: 9
|
||||
res380 rescale 352364.506 -2 -> 352364.51 Inexact Rounded
|
||||
res381 rescale 3523645.06 -2 -> 3523645.06
|
||||
res382 rescale 35236450.6 -2 -> ? Invalid_operation
|
||||
res383 rescale 352364506 -2 -> ? Invalid_operation
|
||||
res384 rescale -352364.506 -2 -> -352364.51 Inexact Rounded
|
||||
res385 rescale -3523645.06 -2 -> -3523645.06
|
||||
res386 rescale -35236450.6 -2 -> ? Invalid_operation
|
||||
res387 rescale -352364506 -2 -> ? Invalid_operation
|
||||
|
||||
-- some baddies
|
||||
res394 rescale 222 +2.00100000000 -> ? Invalid_operation Rounded
|
||||
res395 rescale 222 +2.000001 -> ? Invalid_operation
|
||||
res396 rescale 222 +2.00000000 -> 2E+2 Inexact Rounded
|
||||
res397 rescale 222 +2.000000001 -> ? Inexact Invalid_operation Lost_digits Rounded
|
||||
res398 rescale 222 +2.0000000001 -> ? Inexact Invalid_operation Lost_digits Rounded
|
||||
res399 rescale 222 +2.00000000001 -> ? Inexact Invalid_operation Lost_digits Rounded
|
||||
|
||||
-- lostDigits checks [rhs checks removed]
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
res401 rescale 12345678000 +3 -> 1.2345678E+10 Rounded
|
||||
res403 rescale 1234567800 +1 -> 1.23456780E+9 Rounded
|
||||
res405 rescale 1234567890 +1 -> 1.23456789E+9 Rounded
|
||||
res407 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
res409 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
res411 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
res441 rescale 12345678000 +3 -> 1.2345678E+10 Rounded
|
||||
res443 rescale 1234567800 +1 -> 1.23456780E+9 Rounded
|
||||
res445 rescale 1234567890 +1 -> 1.23456789E+9 Rounded
|
||||
res447 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Rounded
|
||||
res449 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Rounded
|
||||
res451 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Rounded
|
||||
|
||||
-- Null tests
|
||||
res900 rescale 10 # -> ? Invalid_operation
|
||||
res901 rescale # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,888 @@
|
||||
------------------------------------------------------------------------
|
||||
-- rounding0.decTest -- decimal rounding modes testcases (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
|
||||
|
||||
-- These tests require that implementations take account of residues in
|
||||
-- order to get correct results for some rounding modes. Rather than
|
||||
-- single rounding tests we therefore need tests for most operators.
|
||||
-- [We do assume add/minus/plus/subtract are common paths, however, as
|
||||
-- is rounding of negatives (if the latter works for addition, assume it
|
||||
-- works for the others, too).]
|
||||
--
|
||||
-- Underflow Subnormal and overflow behaviours are tested under the individual
|
||||
-- operators.
|
||||
|
||||
extended: 0
|
||||
precision: 5 -- for easier visual inspection
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
-- Addition operators -------------------------------------------------
|
||||
rounding: down
|
||||
|
||||
rad100 add 12345 -0.1 -> 12344 Inexact Rounded
|
||||
rad101 add 12345 -0.01 -> 12344 Inexact Rounded
|
||||
rad102 add 12345 -0.001 -> 12344 Inexact Rounded
|
||||
rad103 add 12345 -0.00001 -> 12344 Inexact Rounded
|
||||
rad104 add 12345 -0.000001 -> 12344 Inexact Rounded
|
||||
rad105 add 12345 -0.0000001 -> 12344 Inexact Rounded
|
||||
rad106 add 12345 0 -> 12345
|
||||
rad107 add 12345 0.0000001 -> 12345 Inexact Rounded
|
||||
rad108 add 12345 0.000001 -> 12345 Inexact Rounded
|
||||
rad109 add 12345 0.00001 -> 12345 Inexact Rounded
|
||||
rad110 add 12345 0.0001 -> 12345 Inexact Rounded
|
||||
rad111 add 12345 0.001 -> 12345 Inexact Rounded
|
||||
rad112 add 12345 0.01 -> 12345 Inexact Rounded
|
||||
rad113 add 12345 0.1 -> 12345 Inexact Rounded
|
||||
|
||||
rad115 add 12346 0.49999 -> 12346 Inexact Rounded
|
||||
rad116 add 12346 0.5 -> 12346 Inexact Rounded
|
||||
rad117 add 12346 0.50001 -> 12346 Inexact Rounded
|
||||
|
||||
rad120 add 12345 0.4 -> 12345 Inexact Rounded
|
||||
rad121 add 12345 0.49 -> 12345 Inexact Rounded
|
||||
rad122 add 12345 0.499 -> 12345 Inexact Rounded
|
||||
rad123 add 12345 0.49999 -> 12345 Inexact Rounded
|
||||
rad124 add 12345 0.5 -> 12345 Inexact Rounded
|
||||
rad125 add 12345 0.50001 -> 12345 Inexact Rounded
|
||||
rad126 add 12345 0.5001 -> 12345 Inexact Rounded
|
||||
rad127 add 12345 0.501 -> 12345 Inexact Rounded
|
||||
rad128 add 12345 0.51 -> 12345 Inexact Rounded
|
||||
rad129 add 12345 0.6 -> 12345 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
|
||||
rad140 add 12345 -0.1 -> 12345 Inexact Rounded
|
||||
rad141 add 12345 -0.01 -> 12345 Inexact Rounded
|
||||
rad142 add 12345 -0.001 -> 12345 Inexact Rounded
|
||||
rad143 add 12345 -0.00001 -> 12345 Inexact Rounded
|
||||
rad144 add 12345 -0.000001 -> 12345 Inexact Rounded
|
||||
rad145 add 12345 -0.0000001 -> 12345 Inexact Rounded
|
||||
rad146 add 12345 0 -> 12345
|
||||
rad147 add 12345 0.0000001 -> 12345 Inexact Rounded
|
||||
rad148 add 12345 0.000001 -> 12345 Inexact Rounded
|
||||
rad149 add 12345 0.00001 -> 12345 Inexact Rounded
|
||||
rad150 add 12345 0.0001 -> 12345 Inexact Rounded
|
||||
rad151 add 12345 0.001 -> 12345 Inexact Rounded
|
||||
rad152 add 12345 0.01 -> 12345 Inexact Rounded
|
||||
rad153 add 12345 0.1 -> 12345 Inexact Rounded
|
||||
|
||||
rad155 add 12346 0.49999 -> 12346 Inexact Rounded
|
||||
rad156 add 12346 0.5 -> 12346 Inexact Rounded
|
||||
rad157 add 12346 0.50001 -> 12347 Inexact Rounded
|
||||
|
||||
rad160 add 12345 0.4 -> 12345 Inexact Rounded
|
||||
rad161 add 12345 0.49 -> 12345 Inexact Rounded
|
||||
rad162 add 12345 0.499 -> 12345 Inexact Rounded
|
||||
rad163 add 12345 0.49999 -> 12345 Inexact Rounded
|
||||
rad164 add 12345 0.5 -> 12345 Inexact Rounded
|
||||
rad165 add 12345 0.50001 -> 12346 Inexact Rounded
|
||||
rad166 add 12345 0.5001 -> 12346 Inexact Rounded
|
||||
rad167 add 12345 0.501 -> 12346 Inexact Rounded
|
||||
rad168 add 12345 0.51 -> 12346 Inexact Rounded
|
||||
rad169 add 12345 0.6 -> 12346 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
|
||||
rad170 add 12345 -0.1 -> 12345 Inexact Rounded
|
||||
rad171 add 12345 -0.01 -> 12345 Inexact Rounded
|
||||
rad172 add 12345 -0.001 -> 12345 Inexact Rounded
|
||||
rad173 add 12345 -0.00001 -> 12345 Inexact Rounded
|
||||
rad174 add 12345 -0.000001 -> 12345 Inexact Rounded
|
||||
rad175 add 12345 -0.0000001 -> 12345 Inexact Rounded
|
||||
rad176 add 12345 0 -> 12345
|
||||
rad177 add 12345 0.0000001 -> 12345 Inexact Rounded
|
||||
rad178 add 12345 0.000001 -> 12345 Inexact Rounded
|
||||
rad179 add 12345 0.00001 -> 12345 Inexact Rounded
|
||||
rad180 add 12345 0.0001 -> 12345 Inexact Rounded
|
||||
rad181 add 12345 0.001 -> 12345 Inexact Rounded
|
||||
rad182 add 12345 0.01 -> 12345 Inexact Rounded
|
||||
rad183 add 12345 0.1 -> 12345 Inexact Rounded
|
||||
|
||||
rad185 add 12346 0.49999 -> 12346 Inexact Rounded
|
||||
rad186 add 12346 0.5 -> 12346 Inexact Rounded
|
||||
rad187 add 12346 0.50001 -> 12347 Inexact Rounded
|
||||
|
||||
rad190 add 12345 0.4 -> 12345 Inexact Rounded
|
||||
rad191 add 12345 0.49 -> 12345 Inexact Rounded
|
||||
rad192 add 12345 0.499 -> 12345 Inexact Rounded
|
||||
rad193 add 12345 0.49999 -> 12345 Inexact Rounded
|
||||
rad194 add 12345 0.5 -> 12346 Inexact Rounded
|
||||
rad195 add 12345 0.50001 -> 12346 Inexact Rounded
|
||||
rad196 add 12345 0.5001 -> 12346 Inexact Rounded
|
||||
rad197 add 12345 0.501 -> 12346 Inexact Rounded
|
||||
rad198 add 12345 0.51 -> 12346 Inexact Rounded
|
||||
rad199 add 12345 0.6 -> 12346 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
|
||||
rad200 add 12345 -0.1 -> 12345 Inexact Rounded
|
||||
rad201 add 12345 -0.01 -> 12345 Inexact Rounded
|
||||
rad202 add 12345 -0.001 -> 12345 Inexact Rounded
|
||||
rad203 add 12345 -0.00001 -> 12345 Inexact Rounded
|
||||
rad204 add 12345 -0.000001 -> 12345 Inexact Rounded
|
||||
rad205 add 12345 -0.0000001 -> 12345 Inexact Rounded
|
||||
rad206 add 12345 0 -> 12345
|
||||
rad207 add 12345 0.0000001 -> 12345 Inexact Rounded
|
||||
rad208 add 12345 0.000001 -> 12345 Inexact Rounded
|
||||
rad209 add 12345 0.00001 -> 12345 Inexact Rounded
|
||||
rad210 add 12345 0.0001 -> 12345 Inexact Rounded
|
||||
rad211 add 12345 0.001 -> 12345 Inexact Rounded
|
||||
rad212 add 12345 0.01 -> 12345 Inexact Rounded
|
||||
rad213 add 12345 0.1 -> 12345 Inexact Rounded
|
||||
|
||||
rad215 add 12346 0.49999 -> 12346 Inexact Rounded
|
||||
rad216 add 12346 0.5 -> 12347 Inexact Rounded
|
||||
rad217 add 12346 0.50001 -> 12347 Inexact Rounded
|
||||
|
||||
rad220 add 12345 0.4 -> 12345 Inexact Rounded
|
||||
rad221 add 12345 0.49 -> 12345 Inexact Rounded
|
||||
rad222 add 12345 0.499 -> 12345 Inexact Rounded
|
||||
rad223 add 12345 0.49999 -> 12345 Inexact Rounded
|
||||
rad224 add 12345 0.5 -> 12346 Inexact Rounded
|
||||
rad225 add 12345 0.50001 -> 12346 Inexact Rounded
|
||||
rad226 add 12345 0.5001 -> 12346 Inexact Rounded
|
||||
rad227 add 12345 0.501 -> 12346 Inexact Rounded
|
||||
rad228 add 12345 0.51 -> 12346 Inexact Rounded
|
||||
rad229 add 12345 0.6 -> 12346 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
|
||||
rad230 add 12345 -0.1 -> 12345 Inexact Rounded
|
||||
rad231 add 12345 -0.01 -> 12345 Inexact Rounded
|
||||
rad232 add 12345 -0.001 -> 12345 Inexact Rounded
|
||||
rad233 add 12345 -0.00001 -> 12345 Inexact Rounded
|
||||
rad234 add 12345 -0.000001 -> 12345 Inexact Rounded
|
||||
rad235 add 12345 -0.0000001 -> 12345 Inexact Rounded
|
||||
rad236 add 12345 0 -> 12345
|
||||
rad237 add 12345 0.0000001 -> 12346 Inexact Rounded
|
||||
rad238 add 12345 0.000001 -> 12346 Inexact Rounded
|
||||
rad239 add 12345 0.00001 -> 12346 Inexact Rounded
|
||||
rad240 add 12345 0.0001 -> 12346 Inexact Rounded
|
||||
rad241 add 12345 0.001 -> 12346 Inexact Rounded
|
||||
rad242 add 12345 0.01 -> 12346 Inexact Rounded
|
||||
rad243 add 12345 0.1 -> 12346 Inexact Rounded
|
||||
|
||||
rad245 add 12346 0.49999 -> 12347 Inexact Rounded
|
||||
rad246 add 12346 0.5 -> 12347 Inexact Rounded
|
||||
rad247 add 12346 0.50001 -> 12347 Inexact Rounded
|
||||
|
||||
rad250 add 12345 0.4 -> 12346 Inexact Rounded
|
||||
rad251 add 12345 0.49 -> 12346 Inexact Rounded
|
||||
rad252 add 12345 0.499 -> 12346 Inexact Rounded
|
||||
rad253 add 12345 0.49999 -> 12346 Inexact Rounded
|
||||
rad254 add 12345 0.5 -> 12346 Inexact Rounded
|
||||
rad255 add 12345 0.50001 -> 12346 Inexact Rounded
|
||||
rad256 add 12345 0.5001 -> 12346 Inexact Rounded
|
||||
rad257 add 12345 0.501 -> 12346 Inexact Rounded
|
||||
rad258 add 12345 0.51 -> 12346 Inexact Rounded
|
||||
rad259 add 12345 0.6 -> 12346 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
|
||||
rad300 add 12345 -0.1 -> 12344 Inexact Rounded
|
||||
rad301 add 12345 -0.01 -> 12344 Inexact Rounded
|
||||
rad302 add 12345 -0.001 -> 12344 Inexact Rounded
|
||||
rad303 add 12345 -0.00001 -> 12344 Inexact Rounded
|
||||
rad304 add 12345 -0.000001 -> 12344 Inexact Rounded
|
||||
rad305 add 12345 -0.0000001 -> 12344 Inexact Rounded
|
||||
rad306 add 12345 0 -> 12345
|
||||
rad307 add 12345 0.0000001 -> 12345 Inexact Rounded
|
||||
rad308 add 12345 0.000001 -> 12345 Inexact Rounded
|
||||
rad309 add 12345 0.00001 -> 12345 Inexact Rounded
|
||||
rad310 add 12345 0.0001 -> 12345 Inexact Rounded
|
||||
rad311 add 12345 0.001 -> 12345 Inexact Rounded
|
||||
rad312 add 12345 0.01 -> 12345 Inexact Rounded
|
||||
rad313 add 12345 0.1 -> 12345 Inexact Rounded
|
||||
|
||||
rad315 add 12346 0.49999 -> 12346 Inexact Rounded
|
||||
rad316 add 12346 0.5 -> 12346 Inexact Rounded
|
||||
rad317 add 12346 0.50001 -> 12346 Inexact Rounded
|
||||
|
||||
rad320 add 12345 0.4 -> 12345 Inexact Rounded
|
||||
rad321 add 12345 0.49 -> 12345 Inexact Rounded
|
||||
rad322 add 12345 0.499 -> 12345 Inexact Rounded
|
||||
rad323 add 12345 0.49999 -> 12345 Inexact Rounded
|
||||
rad324 add 12345 0.5 -> 12345 Inexact Rounded
|
||||
rad325 add 12345 0.50001 -> 12345 Inexact Rounded
|
||||
rad326 add 12345 0.5001 -> 12345 Inexact Rounded
|
||||
rad327 add 12345 0.501 -> 12345 Inexact Rounded
|
||||
rad328 add 12345 0.51 -> 12345 Inexact Rounded
|
||||
rad329 add 12345 0.6 -> 12345 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
|
||||
rad330 add 12345 -0.1 -> 12345 Inexact Rounded
|
||||
rad331 add 12345 -0.01 -> 12345 Inexact Rounded
|
||||
rad332 add 12345 -0.001 -> 12345 Inexact Rounded
|
||||
rad333 add 12345 -0.00001 -> 12345 Inexact Rounded
|
||||
rad334 add 12345 -0.000001 -> 12345 Inexact Rounded
|
||||
rad335 add 12345 -0.0000001 -> 12345 Inexact Rounded
|
||||
rad336 add 12345 0 -> 12345
|
||||
rad337 add 12345 0.0000001 -> 12346 Inexact Rounded
|
||||
rad338 add 12345 0.000001 -> 12346 Inexact Rounded
|
||||
rad339 add 12345 0.00001 -> 12346 Inexact Rounded
|
||||
rad340 add 12345 0.0001 -> 12346 Inexact Rounded
|
||||
rad341 add 12345 0.001 -> 12346 Inexact Rounded
|
||||
rad342 add 12345 0.01 -> 12346 Inexact Rounded
|
||||
rad343 add 12345 0.1 -> 12346 Inexact Rounded
|
||||
|
||||
rad345 add 12346 0.49999 -> 12347 Inexact Rounded
|
||||
rad346 add 12346 0.5 -> 12347 Inexact Rounded
|
||||
rad347 add 12346 0.50001 -> 12347 Inexact Rounded
|
||||
|
||||
rad350 add 12345 0.4 -> 12346 Inexact Rounded
|
||||
rad351 add 12345 0.49 -> 12346 Inexact Rounded
|
||||
rad352 add 12345 0.499 -> 12346 Inexact Rounded
|
||||
rad353 add 12345 0.49999 -> 12346 Inexact Rounded
|
||||
rad354 add 12345 0.5 -> 12346 Inexact Rounded
|
||||
rad355 add 12345 0.50001 -> 12346 Inexact Rounded
|
||||
rad356 add 12345 0.5001 -> 12346 Inexact Rounded
|
||||
rad357 add 12345 0.501 -> 12346 Inexact Rounded
|
||||
rad358 add 12345 0.51 -> 12346 Inexact Rounded
|
||||
rad359 add 12345 0.6 -> 12346 Inexact Rounded
|
||||
|
||||
-- negatives...
|
||||
|
||||
rounding: down
|
||||
|
||||
rsu100 add -12345 -0.1 -> -12345 Inexact Rounded
|
||||
rsu101 add -12345 -0.01 -> -12345 Inexact Rounded
|
||||
rsu102 add -12345 -0.001 -> -12345 Inexact Rounded
|
||||
rsu103 add -12345 -0.00001 -> -12345 Inexact Rounded
|
||||
rsu104 add -12345 -0.000001 -> -12345 Inexact Rounded
|
||||
rsu105 add -12345 -0.0000001 -> -12345 Inexact Rounded
|
||||
rsu106 add -12345 0 -> -12345
|
||||
rsu107 add -12345 0.0000001 -> -12344 Inexact Rounded
|
||||
rsu108 add -12345 0.000001 -> -12344 Inexact Rounded
|
||||
rsu109 add -12345 0.00001 -> -12344 Inexact Rounded
|
||||
rsu110 add -12345 0.0001 -> -12344 Inexact Rounded
|
||||
rsu111 add -12345 0.001 -> -12344 Inexact Rounded
|
||||
rsu112 add -12345 0.01 -> -12344 Inexact Rounded
|
||||
rsu113 add -12345 0.1 -> -12344 Inexact Rounded
|
||||
|
||||
rsu115 add -12346 0.49999 -> -12345 Inexact Rounded
|
||||
rsu116 add -12346 0.5 -> -12345 Inexact Rounded
|
||||
rsu117 add -12346 0.50001 -> -12345 Inexact Rounded
|
||||
|
||||
rsu120 add -12345 0.4 -> -12344 Inexact Rounded
|
||||
rsu121 add -12345 0.49 -> -12344 Inexact Rounded
|
||||
rsu122 add -12345 0.499 -> -12344 Inexact Rounded
|
||||
rsu123 add -12345 0.49999 -> -12344 Inexact Rounded
|
||||
rsu124 add -12345 0.5 -> -12344 Inexact Rounded
|
||||
rsu125 add -12345 0.50001 -> -12344 Inexact Rounded
|
||||
rsu126 add -12345 0.5001 -> -12344 Inexact Rounded
|
||||
rsu127 add -12345 0.501 -> -12344 Inexact Rounded
|
||||
rsu128 add -12345 0.51 -> -12344 Inexact Rounded
|
||||
rsu129 add -12345 0.6 -> -12344 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
|
||||
rsu140 add -12345 -0.1 -> -12345 Inexact Rounded
|
||||
rsu141 add -12345 -0.01 -> -12345 Inexact Rounded
|
||||
rsu142 add -12345 -0.001 -> -12345 Inexact Rounded
|
||||
rsu143 add -12345 -0.00001 -> -12345 Inexact Rounded
|
||||
rsu144 add -12345 -0.000001 -> -12345 Inexact Rounded
|
||||
rsu145 add -12345 -0.0000001 -> -12345 Inexact Rounded
|
||||
rsu146 add -12345 0 -> -12345
|
||||
rsu147 add -12345 0.0000001 -> -12345 Inexact Rounded
|
||||
rsu148 add -12345 0.000001 -> -12345 Inexact Rounded
|
||||
rsu149 add -12345 0.00001 -> -12345 Inexact Rounded
|
||||
rsu150 add -12345 0.0001 -> -12345 Inexact Rounded
|
||||
rsu151 add -12345 0.001 -> -12345 Inexact Rounded
|
||||
rsu152 add -12345 0.01 -> -12345 Inexact Rounded
|
||||
rsu153 add -12345 0.1 -> -12345 Inexact Rounded
|
||||
|
||||
rsu155 add -12346 0.49999 -> -12346 Inexact Rounded
|
||||
rsu156 add -12346 0.5 -> -12345 Inexact Rounded
|
||||
rsu157 add -12346 0.50001 -> -12345 Inexact Rounded
|
||||
|
||||
rsu160 add -12345 0.4 -> -12345 Inexact Rounded
|
||||
rsu161 add -12345 0.49 -> -12345 Inexact Rounded
|
||||
rsu162 add -12345 0.499 -> -12345 Inexact Rounded
|
||||
rsu163 add -12345 0.49999 -> -12345 Inexact Rounded
|
||||
rsu164 add -12345 0.5 -> -12344 Inexact Rounded
|
||||
rsu165 add -12345 0.50001 -> -12344 Inexact Rounded
|
||||
rsu166 add -12345 0.5001 -> -12344 Inexact Rounded
|
||||
rsu167 add -12345 0.501 -> -12344 Inexact Rounded
|
||||
rsu168 add -12345 0.51 -> -12344 Inexact Rounded
|
||||
rsu169 add -12345 0.6 -> -12344 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
|
||||
rsu170 add -12345 -0.1 -> -12345 Inexact Rounded
|
||||
rsu171 add -12345 -0.01 -> -12345 Inexact Rounded
|
||||
rsu172 add -12345 -0.001 -> -12345 Inexact Rounded
|
||||
rsu173 add -12345 -0.00001 -> -12345 Inexact Rounded
|
||||
rsu174 add -12345 -0.000001 -> -12345 Inexact Rounded
|
||||
rsu175 add -12345 -0.0000001 -> -12345 Inexact Rounded
|
||||
rsu176 add -12345 0 -> -12345
|
||||
rsu177 add -12345 0.0000001 -> -12345 Inexact Rounded
|
||||
rsu178 add -12345 0.000001 -> -12345 Inexact Rounded
|
||||
rsu179 add -12345 0.00001 -> -12345 Inexact Rounded
|
||||
rsu180 add -12345 0.0001 -> -12345 Inexact Rounded
|
||||
rsu181 add -12345 0.001 -> -12345 Inexact Rounded
|
||||
rsu182 add -12345 0.01 -> -12345 Inexact Rounded
|
||||
rsu183 add -12345 0.1 -> -12345 Inexact Rounded
|
||||
|
||||
rsu185 add -12346 0.49999 -> -12346 Inexact Rounded
|
||||
rsu186 add -12346 0.5 -> -12346 Inexact Rounded
|
||||
rsu187 add -12346 0.50001 -> -12345 Inexact Rounded
|
||||
|
||||
rsu190 add -12345 0.4 -> -12345 Inexact Rounded
|
||||
rsu191 add -12345 0.49 -> -12345 Inexact Rounded
|
||||
rsu192 add -12345 0.499 -> -12345 Inexact Rounded
|
||||
rsu193 add -12345 0.49999 -> -12345 Inexact Rounded
|
||||
rsu194 add -12345 0.5 -> -12344 Inexact Rounded
|
||||
rsu195 add -12345 0.50001 -> -12344 Inexact Rounded
|
||||
rsu196 add -12345 0.5001 -> -12344 Inexact Rounded
|
||||
rsu197 add -12345 0.501 -> -12344 Inexact Rounded
|
||||
rsu198 add -12345 0.51 -> -12344 Inexact Rounded
|
||||
rsu199 add -12345 0.6 -> -12344 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
|
||||
rsu200 add -12345 -0.1 -> -12345 Inexact Rounded
|
||||
rsu201 add -12345 -0.01 -> -12345 Inexact Rounded
|
||||
rsu202 add -12345 -0.001 -> -12345 Inexact Rounded
|
||||
rsu203 add -12345 -0.00001 -> -12345 Inexact Rounded
|
||||
rsu204 add -12345 -0.000001 -> -12345 Inexact Rounded
|
||||
rsu205 add -12345 -0.0000001 -> -12345 Inexact Rounded
|
||||
rsu206 add -12345 0 -> -12345
|
||||
rsu207 add -12345 0.0000001 -> -12345 Inexact Rounded
|
||||
rsu208 add -12345 0.000001 -> -12345 Inexact Rounded
|
||||
rsu209 add -12345 0.00001 -> -12345 Inexact Rounded
|
||||
rsu210 add -12345 0.0001 -> -12345 Inexact Rounded
|
||||
rsu211 add -12345 0.001 -> -12345 Inexact Rounded
|
||||
rsu212 add -12345 0.01 -> -12345 Inexact Rounded
|
||||
rsu213 add -12345 0.1 -> -12345 Inexact Rounded
|
||||
|
||||
rsu215 add -12346 0.49999 -> -12346 Inexact Rounded
|
||||
rsu216 add -12346 0.5 -> -12346 Inexact Rounded
|
||||
rsu217 add -12346 0.50001 -> -12345 Inexact Rounded
|
||||
|
||||
rsu220 add -12345 0.4 -> -12345 Inexact Rounded
|
||||
rsu221 add -12345 0.49 -> -12345 Inexact Rounded
|
||||
rsu222 add -12345 0.499 -> -12345 Inexact Rounded
|
||||
rsu223 add -12345 0.49999 -> -12345 Inexact Rounded
|
||||
rsu224 add -12345 0.5 -> -12345 Inexact Rounded
|
||||
rsu225 add -12345 0.50001 -> -12344 Inexact Rounded
|
||||
rsu226 add -12345 0.5001 -> -12344 Inexact Rounded
|
||||
rsu227 add -12345 0.501 -> -12344 Inexact Rounded
|
||||
rsu228 add -12345 0.51 -> -12344 Inexact Rounded
|
||||
rsu229 add -12345 0.6 -> -12344 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
|
||||
rsu230 add -12345 -0.1 -> -12346 Inexact Rounded
|
||||
rsu231 add -12345 -0.01 -> -12346 Inexact Rounded
|
||||
rsu232 add -12345 -0.001 -> -12346 Inexact Rounded
|
||||
rsu233 add -12345 -0.00001 -> -12346 Inexact Rounded
|
||||
rsu234 add -12345 -0.000001 -> -12346 Inexact Rounded
|
||||
rsu235 add -12345 -0.0000001 -> -12346 Inexact Rounded
|
||||
rsu236 add -12345 0 -> -12345
|
||||
rsu237 add -12345 0.0000001 -> -12345 Inexact Rounded
|
||||
rsu238 add -12345 0.000001 -> -12345 Inexact Rounded
|
||||
rsu239 add -12345 0.00001 -> -12345 Inexact Rounded
|
||||
rsu240 add -12345 0.0001 -> -12345 Inexact Rounded
|
||||
rsu241 add -12345 0.001 -> -12345 Inexact Rounded
|
||||
rsu242 add -12345 0.01 -> -12345 Inexact Rounded
|
||||
rsu243 add -12345 0.1 -> -12345 Inexact Rounded
|
||||
|
||||
rsu245 add -12346 0.49999 -> -12346 Inexact Rounded
|
||||
rsu246 add -12346 0.5 -> -12346 Inexact Rounded
|
||||
rsu247 add -12346 0.50001 -> -12346 Inexact Rounded
|
||||
|
||||
rsu250 add -12345 0.4 -> -12345 Inexact Rounded
|
||||
rsu251 add -12345 0.49 -> -12345 Inexact Rounded
|
||||
rsu252 add -12345 0.499 -> -12345 Inexact Rounded
|
||||
rsu253 add -12345 0.49999 -> -12345 Inexact Rounded
|
||||
rsu254 add -12345 0.5 -> -12345 Inexact Rounded
|
||||
rsu255 add -12345 0.50001 -> -12345 Inexact Rounded
|
||||
rsu256 add -12345 0.5001 -> -12345 Inexact Rounded
|
||||
rsu257 add -12345 0.501 -> -12345 Inexact Rounded
|
||||
rsu258 add -12345 0.51 -> -12345 Inexact Rounded
|
||||
rsu259 add -12345 0.6 -> -12345 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
|
||||
rsu300 add -12345 -0.1 -> -12346 Inexact Rounded
|
||||
rsu301 add -12345 -0.01 -> -12346 Inexact Rounded
|
||||
rsu302 add -12345 -0.001 -> -12346 Inexact Rounded
|
||||
rsu303 add -12345 -0.00001 -> -12346 Inexact Rounded
|
||||
rsu304 add -12345 -0.000001 -> -12346 Inexact Rounded
|
||||
rsu305 add -12345 -0.0000001 -> -12346 Inexact Rounded
|
||||
rsu306 add -12345 0 -> -12345
|
||||
rsu307 add -12345 0.0000001 -> -12345 Inexact Rounded
|
||||
rsu308 add -12345 0.000001 -> -12345 Inexact Rounded
|
||||
rsu309 add -12345 0.00001 -> -12345 Inexact Rounded
|
||||
rsu310 add -12345 0.0001 -> -12345 Inexact Rounded
|
||||
rsu311 add -12345 0.001 -> -12345 Inexact Rounded
|
||||
rsu312 add -12345 0.01 -> -12345 Inexact Rounded
|
||||
rsu313 add -12345 0.1 -> -12345 Inexact Rounded
|
||||
|
||||
rsu315 add -12346 0.49999 -> -12346 Inexact Rounded
|
||||
rsu316 add -12346 0.5 -> -12346 Inexact Rounded
|
||||
rsu317 add -12346 0.50001 -> -12346 Inexact Rounded
|
||||
|
||||
rsu320 add -12345 0.4 -> -12345 Inexact Rounded
|
||||
rsu321 add -12345 0.49 -> -12345 Inexact Rounded
|
||||
rsu322 add -12345 0.499 -> -12345 Inexact Rounded
|
||||
rsu323 add -12345 0.49999 -> -12345 Inexact Rounded
|
||||
rsu324 add -12345 0.5 -> -12345 Inexact Rounded
|
||||
rsu325 add -12345 0.50001 -> -12345 Inexact Rounded
|
||||
rsu326 add -12345 0.5001 -> -12345 Inexact Rounded
|
||||
rsu327 add -12345 0.501 -> -12345 Inexact Rounded
|
||||
rsu328 add -12345 0.51 -> -12345 Inexact Rounded
|
||||
rsu329 add -12345 0.6 -> -12345 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
|
||||
rsu330 add -12345 -0.1 -> -12345 Inexact Rounded
|
||||
rsu331 add -12345 -0.01 -> -12345 Inexact Rounded
|
||||
rsu332 add -12345 -0.001 -> -12345 Inexact Rounded
|
||||
rsu333 add -12345 -0.00001 -> -12345 Inexact Rounded
|
||||
rsu334 add -12345 -0.000001 -> -12345 Inexact Rounded
|
||||
rsu335 add -12345 -0.0000001 -> -12345 Inexact Rounded
|
||||
rsu336 add -12345 0 -> -12345
|
||||
rsu337 add -12345 0.0000001 -> -12344 Inexact Rounded
|
||||
rsu338 add -12345 0.000001 -> -12344 Inexact Rounded
|
||||
rsu339 add -12345 0.00001 -> -12344 Inexact Rounded
|
||||
rsu340 add -12345 0.0001 -> -12344 Inexact Rounded
|
||||
rsu341 add -12345 0.001 -> -12344 Inexact Rounded
|
||||
rsu342 add -12345 0.01 -> -12344 Inexact Rounded
|
||||
rsu343 add -12345 0.1 -> -12344 Inexact Rounded
|
||||
|
||||
rsu345 add -12346 0.49999 -> -12345 Inexact Rounded
|
||||
rsu346 add -12346 0.5 -> -12345 Inexact Rounded
|
||||
rsu347 add -12346 0.50001 -> -12345 Inexact Rounded
|
||||
|
||||
rsu350 add -12345 0.4 -> -12344 Inexact Rounded
|
||||
rsu351 add -12345 0.49 -> -12344 Inexact Rounded
|
||||
rsu352 add -12345 0.499 -> -12344 Inexact Rounded
|
||||
rsu353 add -12345 0.49999 -> -12344 Inexact Rounded
|
||||
rsu354 add -12345 0.5 -> -12344 Inexact Rounded
|
||||
rsu355 add -12345 0.50001 -> -12344 Inexact Rounded
|
||||
rsu356 add -12345 0.5001 -> -12344 Inexact Rounded
|
||||
rsu357 add -12345 0.501 -> -12344 Inexact Rounded
|
||||
rsu358 add -12345 0.51 -> -12344 Inexact Rounded
|
||||
rsu359 add -12345 0.6 -> -12344 Inexact Rounded
|
||||
|
||||
-- Division operators -------------------------------------------------
|
||||
|
||||
rounding: down
|
||||
rdv101 divide 12345 1 -> 12345
|
||||
rdv102 divide 12345 1.0001 -> 12343 Inexact Rounded
|
||||
rdv103 divide 12345 1.001 -> 12332 Inexact Rounded
|
||||
rdv104 divide 12345 1.01 -> 12222 Inexact Rounded
|
||||
rdv105 divide 12345 1.1 -> 11222 Inexact Rounded
|
||||
rdv106 divide 12355 4 -> 3088.7 Inexact Rounded
|
||||
rdv107 divide 12345 4 -> 3086.2 Inexact Rounded
|
||||
rdv108 divide 12355 4.0001 -> 3088.6 Inexact Rounded
|
||||
rdv109 divide 12345 4.0001 -> 3086.1 Inexact Rounded
|
||||
rdv110 divide 12345 4.9 -> 2519.3 Inexact Rounded
|
||||
rdv111 divide 12345 4.99 -> 2473.9 Inexact Rounded
|
||||
rdv112 divide 12345 4.999 -> 2469.4 Inexact Rounded
|
||||
rdv113 divide 12345 4.9999 -> 2469 Inexact Rounded
|
||||
rdv114 divide 12345 5 -> 2469
|
||||
rdv115 divide 12345 5.0001 -> 2468.9 Inexact Rounded
|
||||
rdv116 divide 12345 5.001 -> 2468.5 Inexact Rounded
|
||||
rdv117 divide 12345 5.01 -> 2464 Inexact Rounded
|
||||
rdv118 divide 12345 5.1 -> 2420.5 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
rdv201 divide 12345 1 -> 12345
|
||||
rdv202 divide 12345 1.0001 -> 12344 Inexact Rounded
|
||||
rdv203 divide 12345 1.001 -> 12333 Inexact Rounded
|
||||
rdv204 divide 12345 1.01 -> 12223 Inexact Rounded
|
||||
rdv205 divide 12345 1.1 -> 11223 Inexact Rounded
|
||||
rdv206 divide 12355 4 -> 3088.7 Inexact Rounded
|
||||
rdv207 divide 12345 4 -> 3086.2 Inexact Rounded
|
||||
rdv208 divide 12355 4.0001 -> 3088.7 Inexact Rounded
|
||||
rdv209 divide 12345 4.0001 -> 3086.2 Inexact Rounded
|
||||
rdv210 divide 12345 4.9 -> 2519.4 Inexact Rounded
|
||||
rdv211 divide 12345 4.99 -> 2473.9 Inexact Rounded
|
||||
rdv212 divide 12345 4.999 -> 2469.5 Inexact Rounded
|
||||
rdv213 divide 12345 4.9999 -> 2469 Inexact Rounded
|
||||
rdv214 divide 12345 5 -> 2469
|
||||
rdv215 divide 12345 5.0001 -> 2469 Inexact Rounded
|
||||
rdv216 divide 12345 5.001 -> 2468.5 Inexact Rounded
|
||||
rdv217 divide 12345 5.01 -> 2464.1 Inexact Rounded
|
||||
rdv218 divide 12345 5.1 -> 2420.6 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
rdv301 divide 12345 1 -> 12345
|
||||
rdv302 divide 12345 1.0001 -> 12344 Inexact Rounded
|
||||
rdv303 divide 12345 1.001 -> 12333 Inexact Rounded
|
||||
rdv304 divide 12345 1.01 -> 12223 Inexact Rounded
|
||||
rdv305 divide 12345 1.1 -> 11223 Inexact Rounded
|
||||
rdv306 divide 12355 4 -> 3088.8 Inexact Rounded
|
||||
rdv307 divide 12345 4 -> 3086.2 Inexact Rounded
|
||||
rdv308 divide 12355 4.0001 -> 3088.7 Inexact Rounded
|
||||
rdv309 divide 12345 4.0001 -> 3086.2 Inexact Rounded
|
||||
rdv310 divide 12345 4.9 -> 2519.4 Inexact Rounded
|
||||
rdv311 divide 12345 4.99 -> 2473.9 Inexact Rounded
|
||||
rdv312 divide 12345 4.999 -> 2469.5 Inexact Rounded
|
||||
rdv313 divide 12345 4.9999 -> 2469 Inexact Rounded
|
||||
rdv314 divide 12345 5 -> 2469
|
||||
rdv315 divide 12345 5.0001 -> 2469 Inexact Rounded
|
||||
rdv316 divide 12345 5.001 -> 2468.5 Inexact Rounded
|
||||
rdv317 divide 12345 5.01 -> 2464.1 Inexact Rounded
|
||||
rdv318 divide 12345 5.1 -> 2420.6 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
rdv401 divide 12345 1 -> 12345
|
||||
rdv402 divide 12345 1.0001 -> 12344 Inexact Rounded
|
||||
rdv403 divide 12345 1.001 -> 12333 Inexact Rounded
|
||||
rdv404 divide 12345 1.01 -> 12223 Inexact Rounded
|
||||
rdv405 divide 12345 1.1 -> 11223 Inexact Rounded
|
||||
rdv406 divide 12355 4 -> 3088.8 Inexact Rounded
|
||||
rdv407 divide 12345 4 -> 3086.3 Inexact Rounded
|
||||
rdv408 divide 12355 4.0001 -> 3088.7 Inexact Rounded
|
||||
rdv409 divide 12345 4.0001 -> 3086.2 Inexact Rounded
|
||||
rdv410 divide 12345 4.9 -> 2519.4 Inexact Rounded
|
||||
rdv411 divide 12345 4.99 -> 2473.9 Inexact Rounded
|
||||
rdv412 divide 12345 4.999 -> 2469.5 Inexact Rounded
|
||||
rdv413 divide 12345 4.9999 -> 2469 Inexact Rounded
|
||||
rdv414 divide 12345 5 -> 2469
|
||||
rdv415 divide 12345 5.0001 -> 2469 Inexact Rounded
|
||||
rdv416 divide 12345 5.001 -> 2468.5 Inexact Rounded
|
||||
rdv417 divide 12345 5.01 -> 2464.1 Inexact Rounded
|
||||
rdv418 divide 12345 5.1 -> 2420.6 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
rdv501 divide 12345 1 -> 12345
|
||||
rdv502 divide 12345 1.0001 -> 12344 Inexact Rounded
|
||||
rdv503 divide 12345 1.001 -> 12333 Inexact Rounded
|
||||
rdv504 divide 12345 1.01 -> 12223 Inexact Rounded
|
||||
rdv505 divide 12345 1.1 -> 11223 Inexact Rounded
|
||||
rdv506 divide 12355 4 -> 3088.8 Inexact Rounded
|
||||
rdv507 divide 12345 4 -> 3086.3 Inexact Rounded
|
||||
rdv508 divide 12355 4.0001 -> 3088.7 Inexact Rounded
|
||||
rdv509 divide 12345 4.0001 -> 3086.2 Inexact Rounded
|
||||
rdv510 divide 12345 4.9 -> 2519.4 Inexact Rounded
|
||||
rdv511 divide 12345 4.99 -> 2474 Inexact Rounded
|
||||
rdv512 divide 12345 4.999 -> 2469.5 Inexact Rounded
|
||||
rdv513 divide 12345 4.9999 -> 2469.1 Inexact Rounded
|
||||
rdv514 divide 12345 5 -> 2469
|
||||
rdv515 divide 12345 5.0001 -> 2469 Inexact Rounded
|
||||
rdv516 divide 12345 5.001 -> 2468.6 Inexact Rounded
|
||||
rdv517 divide 12345 5.01 -> 2464.1 Inexact Rounded
|
||||
rdv518 divide 12345 5.1 -> 2420.6 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
rdv601 divide 12345 1 -> 12345
|
||||
rdv602 divide 12345 1.0001 -> 12343 Inexact Rounded
|
||||
rdv603 divide 12345 1.001 -> 12332 Inexact Rounded
|
||||
rdv604 divide 12345 1.01 -> 12222 Inexact Rounded
|
||||
rdv605 divide 12345 1.1 -> 11222 Inexact Rounded
|
||||
rdv606 divide 12355 4 -> 3088.7 Inexact Rounded
|
||||
rdv607 divide 12345 4 -> 3086.2 Inexact Rounded
|
||||
rdv608 divide 12355 4.0001 -> 3088.6 Inexact Rounded
|
||||
rdv609 divide 12345 4.0001 -> 3086.1 Inexact Rounded
|
||||
rdv610 divide 12345 4.9 -> 2519.3 Inexact Rounded
|
||||
rdv611 divide 12345 4.99 -> 2473.9 Inexact Rounded
|
||||
rdv612 divide 12345 4.999 -> 2469.4 Inexact Rounded
|
||||
rdv613 divide 12345 4.9999 -> 2469 Inexact Rounded
|
||||
rdv614 divide 12345 5 -> 2469
|
||||
rdv615 divide 12345 5.0001 -> 2468.9 Inexact Rounded
|
||||
rdv616 divide 12345 5.001 -> 2468.5 Inexact Rounded
|
||||
rdv617 divide 12345 5.01 -> 2464 Inexact Rounded
|
||||
rdv618 divide 12345 5.1 -> 2420.5 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
rdv701 divide 12345 1 -> 12345
|
||||
rdv702 divide 12345 1.0001 -> 12344 Inexact Rounded
|
||||
rdv703 divide 12345 1.001 -> 12333 Inexact Rounded
|
||||
rdv704 divide 12345 1.01 -> 12223 Inexact Rounded
|
||||
rdv705 divide 12345 1.1 -> 11223 Inexact Rounded
|
||||
rdv706 divide 12355 4 -> 3088.8 Inexact Rounded
|
||||
rdv707 divide 12345 4 -> 3086.3 Inexact Rounded
|
||||
rdv708 divide 12355 4.0001 -> 3088.7 Inexact Rounded
|
||||
rdv709 divide 12345 4.0001 -> 3086.2 Inexact Rounded
|
||||
rdv710 divide 12345 4.9 -> 2519.4 Inexact Rounded
|
||||
rdv711 divide 12345 4.99 -> 2474 Inexact Rounded
|
||||
rdv712 divide 12345 4.999 -> 2469.5 Inexact Rounded
|
||||
rdv713 divide 12345 4.9999 -> 2469.1 Inexact Rounded
|
||||
rdv714 divide 12345 5 -> 2469
|
||||
rdv715 divide 12345 5.0001 -> 2469 Inexact Rounded
|
||||
rdv716 divide 12345 5.001 -> 2468.6 Inexact Rounded
|
||||
rdv717 divide 12345 5.01 -> 2464.1 Inexact Rounded
|
||||
rdv718 divide 12345 5.1 -> 2420.6 Inexact Rounded
|
||||
|
||||
-- [divideInteger and remainder unaffected]
|
||||
|
||||
-- Multiplication operator --------------------------------------------
|
||||
|
||||
rounding: down
|
||||
rmu101 multiply 12345 1 -> 12345
|
||||
rmu102 multiply 12345 1.0001 -> 12346 Inexact Rounded
|
||||
rmu103 multiply 12345 1.001 -> 12357 Inexact Rounded
|
||||
rmu104 multiply 12345 1.01 -> 12468 Inexact Rounded
|
||||
rmu105 multiply 12345 1.1 -> 13579 Inexact Rounded
|
||||
rmu106 multiply 12345 4 -> 49380
|
||||
rmu107 multiply 12345 4.0001 -> 49381 Inexact Rounded
|
||||
rmu108 multiply 12345 4.9 -> 60490 Inexact Rounded
|
||||
rmu109 multiply 12345 4.99 -> 61601 Inexact Rounded
|
||||
rmu110 multiply 12345 4.999 -> 61712 Inexact Rounded
|
||||
rmu111 multiply 12345 4.9999 -> 61723 Inexact Rounded
|
||||
rmu112 multiply 12345 5 -> 61725
|
||||
rmu113 multiply 12345 5.0001 -> 61726 Inexact Rounded
|
||||
rmu114 multiply 12345 5.001 -> 61737 Inexact Rounded
|
||||
rmu115 multiply 12345 5.01 -> 61848 Inexact Rounded
|
||||
rmu116 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu117 multiply 12345 13 -> 1.6048E+5 Inexact Rounded
|
||||
rmu118 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu119 multiply 12355 13 -> 1.6061E+5 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
rmu201 multiply 12345 1 -> 12345
|
||||
rmu202 multiply 12345 1.0001 -> 12346 Inexact Rounded
|
||||
rmu203 multiply 12345 1.001 -> 12357 Inexact Rounded
|
||||
rmu204 multiply 12345 1.01 -> 12468 Inexact Rounded
|
||||
rmu205 multiply 12345 1.1 -> 13579 Inexact Rounded
|
||||
rmu206 multiply 12345 4 -> 49380
|
||||
rmu207 multiply 12345 4.0001 -> 49381 Inexact Rounded
|
||||
rmu208 multiply 12345 4.9 -> 60490 Inexact Rounded
|
||||
rmu209 multiply 12345 4.99 -> 61602 Inexact Rounded
|
||||
rmu210 multiply 12345 4.999 -> 61713 Inexact Rounded
|
||||
rmu211 multiply 12345 4.9999 -> 61724 Inexact Rounded
|
||||
rmu212 multiply 12345 5 -> 61725
|
||||
rmu213 multiply 12345 5.0001 -> 61726 Inexact Rounded
|
||||
rmu214 multiply 12345 5.001 -> 61737 Inexact Rounded
|
||||
rmu215 multiply 12345 5.01 -> 61848 Inexact Rounded
|
||||
rmu216 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu217 multiply 12345 13 -> 1.6048E+5 Inexact Rounded
|
||||
rmu218 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu219 multiply 12355 13 -> 1.6061E+5 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
rmu301 multiply 12345 1 -> 12345
|
||||
rmu302 multiply 12345 1.0001 -> 12346 Inexact Rounded
|
||||
rmu303 multiply 12345 1.001 -> 12357 Inexact Rounded
|
||||
rmu304 multiply 12345 1.01 -> 12468 Inexact Rounded
|
||||
rmu305 multiply 12345 1.1 -> 13580 Inexact Rounded
|
||||
rmu306 multiply 12345 4 -> 49380
|
||||
rmu307 multiply 12345 4.0001 -> 49381 Inexact Rounded
|
||||
rmu308 multiply 12345 4.9 -> 60490 Inexact Rounded
|
||||
rmu309 multiply 12345 4.99 -> 61602 Inexact Rounded
|
||||
rmu310 multiply 12345 4.999 -> 61713 Inexact Rounded
|
||||
rmu311 multiply 12345 4.9999 -> 61724 Inexact Rounded
|
||||
rmu312 multiply 12345 5 -> 61725
|
||||
rmu313 multiply 12345 5.0001 -> 61726 Inexact Rounded
|
||||
rmu314 multiply 12345 5.001 -> 61737 Inexact Rounded
|
||||
rmu315 multiply 12345 5.01 -> 61848 Inexact Rounded
|
||||
rmu316 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu317 multiply 12345 13 -> 1.6048E+5 Inexact Rounded
|
||||
rmu318 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu319 multiply 12355 13 -> 1.6062E+5 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
rmu401 multiply 12345 1 -> 12345
|
||||
rmu402 multiply 12345 1.0001 -> 12346 Inexact Rounded
|
||||
rmu403 multiply 12345 1.001 -> 12357 Inexact Rounded
|
||||
rmu404 multiply 12345 1.01 -> 12468 Inexact Rounded
|
||||
rmu405 multiply 12345 1.1 -> 13580 Inexact Rounded
|
||||
rmu406 multiply 12345 4 -> 49380
|
||||
rmu407 multiply 12345 4.0001 -> 49381 Inexact Rounded
|
||||
rmu408 multiply 12345 4.9 -> 60491 Inexact Rounded
|
||||
rmu409 multiply 12345 4.99 -> 61602 Inexact Rounded
|
||||
rmu410 multiply 12345 4.999 -> 61713 Inexact Rounded
|
||||
rmu411 multiply 12345 4.9999 -> 61724 Inexact Rounded
|
||||
rmu412 multiply 12345 5 -> 61725
|
||||
rmu413 multiply 12345 5.0001 -> 61726 Inexact Rounded
|
||||
rmu414 multiply 12345 5.001 -> 61737 Inexact Rounded
|
||||
rmu415 multiply 12345 5.01 -> 61848 Inexact Rounded
|
||||
rmu416 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu417 multiply 12345 13 -> 1.6049E+5 Inexact Rounded
|
||||
rmu418 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu419 multiply 12355 13 -> 1.6062E+5 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
rmu501 multiply 12345 1 -> 12345
|
||||
rmu502 multiply 12345 1.0001 -> 12347 Inexact Rounded
|
||||
rmu503 multiply 12345 1.001 -> 12358 Inexact Rounded
|
||||
rmu504 multiply 12345 1.01 -> 12469 Inexact Rounded
|
||||
rmu505 multiply 12345 1.1 -> 13580 Inexact Rounded
|
||||
rmu506 multiply 12345 4 -> 49380
|
||||
rmu507 multiply 12345 4.0001 -> 49382 Inexact Rounded
|
||||
rmu508 multiply 12345 4.9 -> 60491 Inexact Rounded
|
||||
rmu509 multiply 12345 4.99 -> 61602 Inexact Rounded
|
||||
rmu510 multiply 12345 4.999 -> 61713 Inexact Rounded
|
||||
rmu511 multiply 12345 4.9999 -> 61724 Inexact Rounded
|
||||
rmu512 multiply 12345 5 -> 61725
|
||||
rmu513 multiply 12345 5.0001 -> 61727 Inexact Rounded
|
||||
rmu514 multiply 12345 5.001 -> 61738 Inexact Rounded
|
||||
rmu515 multiply 12345 5.01 -> 61849 Inexact Rounded
|
||||
rmu516 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu517 multiply 12345 13 -> 1.6049E+5 Inexact Rounded
|
||||
rmu518 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu519 multiply 12355 13 -> 1.6062E+5 Inexact Rounded
|
||||
-- [rmu516 & rmu518] can surprise
|
||||
|
||||
rounding: floor
|
||||
rmu601 multiply 12345 1 -> 12345
|
||||
rmu602 multiply 12345 1.0001 -> 12346 Inexact Rounded
|
||||
rmu603 multiply 12345 1.001 -> 12357 Inexact Rounded
|
||||
rmu604 multiply 12345 1.01 -> 12468 Inexact Rounded
|
||||
rmu605 multiply 12345 1.1 -> 13579 Inexact Rounded
|
||||
rmu606 multiply 12345 4 -> 49380
|
||||
rmu607 multiply 12345 4.0001 -> 49381 Inexact Rounded
|
||||
rmu608 multiply 12345 4.9 -> 60490 Inexact Rounded
|
||||
rmu609 multiply 12345 4.99 -> 61601 Inexact Rounded
|
||||
rmu610 multiply 12345 4.999 -> 61712 Inexact Rounded
|
||||
rmu611 multiply 12345 4.9999 -> 61723 Inexact Rounded
|
||||
rmu612 multiply 12345 5 -> 61725
|
||||
rmu613 multiply 12345 5.0001 -> 61726 Inexact Rounded
|
||||
rmu614 multiply 12345 5.001 -> 61737 Inexact Rounded
|
||||
rmu615 multiply 12345 5.01 -> 61848 Inexact Rounded
|
||||
rmu616 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu617 multiply 12345 13 -> 1.6048E+5 Inexact Rounded
|
||||
rmu618 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu619 multiply 12355 13 -> 1.6061E+5 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
rmu701 multiply 12345 1 -> 12345
|
||||
rmu702 multiply 12345 1.0001 -> 12347 Inexact Rounded
|
||||
rmu703 multiply 12345 1.001 -> 12358 Inexact Rounded
|
||||
rmu704 multiply 12345 1.01 -> 12469 Inexact Rounded
|
||||
rmu705 multiply 12345 1.1 -> 13580 Inexact Rounded
|
||||
rmu706 multiply 12345 4 -> 49380
|
||||
rmu707 multiply 12345 4.0001 -> 49382 Inexact Rounded
|
||||
rmu708 multiply 12345 4.9 -> 60491 Inexact Rounded
|
||||
rmu709 multiply 12345 4.99 -> 61602 Inexact Rounded
|
||||
rmu710 multiply 12345 4.999 -> 61713 Inexact Rounded
|
||||
rmu711 multiply 12345 4.9999 -> 61724 Inexact Rounded
|
||||
rmu712 multiply 12345 5 -> 61725
|
||||
rmu713 multiply 12345 5.0001 -> 61727 Inexact Rounded
|
||||
rmu714 multiply 12345 5.001 -> 61738 Inexact Rounded
|
||||
rmu715 multiply 12345 5.01 -> 61849 Inexact Rounded
|
||||
rmu716 multiply 12345 12 -> 1.4814E+5 Rounded
|
||||
rmu717 multiply 12345 13 -> 1.6049E+5 Inexact Rounded
|
||||
rmu718 multiply 12355 12 -> 1.4826E+5 Rounded
|
||||
rmu719 multiply 12355 13 -> 1.6062E+5 Inexact Rounded
|
||||
|
||||
-- Power operator -----------------------------------------------------
|
||||
|
||||
rounding: down
|
||||
rpo101 power 12345 -5 -> 3.4877E-21 Inexact Rounded
|
||||
rpo102 power 12345 -4 -> 4.3056E-17 Inexact Rounded
|
||||
rpo103 power 12345 -3 -> 5.3152E-13 Inexact Rounded
|
||||
rpo104 power 12345 -2 -> 6.5617E-9 Inexact Rounded
|
||||
rpo105 power 12345 -1 -> 0.000081004 Inexact Rounded
|
||||
rpo106 power 12345 0 -> 1
|
||||
rpo107 power 12345 1 -> 12345
|
||||
rpo108 power 12345 2 -> 1.5239E+8 Inexact Rounded
|
||||
rpo109 power 12345 3 -> 1.8813E+12 Inexact Rounded
|
||||
rpo110 power 12345 4 -> 2.3225E+16 Inexact Rounded
|
||||
rpo111 power 12345 5 -> 2.8671E+20 Inexact Rounded
|
||||
rpo112 power 415 2 -> 1.7222E+5 Inexact Rounded
|
||||
rpo113 power 75 3 -> 4.2187E+5 Inexact Rounded
|
||||
|
||||
rounding: half_down
|
||||
rpo201 power 12345 -5 -> 3.4877E-21 Inexact Rounded
|
||||
rpo202 power 12345 -4 -> 4.3056E-17 Inexact Rounded
|
||||
rpo203 power 12345 -3 -> 5.3153E-13 Inexact Rounded
|
||||
rpo204 power 12345 -2 -> 6.5617E-9 Inexact Rounded
|
||||
rpo205 power 12345 -1 -> 0.000081004 Inexact Rounded
|
||||
rpo206 power 12345 0 -> 1
|
||||
rpo207 power 12345 1 -> 12345
|
||||
rpo208 power 12345 2 -> 1.524E+8 Inexact Rounded
|
||||
rpo209 power 12345 3 -> 1.8814E+12 Inexact Rounded
|
||||
rpo210 power 12345 4 -> 2.3225E+16 Inexact Rounded
|
||||
rpo211 power 12345 5 -> 2.8672E+20 Inexact Rounded
|
||||
rpo212 power 415 2 -> 1.7222E+5 Inexact Rounded
|
||||
rpo213 power 75 3 -> 4.2187E+5 Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
rpo301 power 12345 -5 -> 3.4877E-21 Inexact Rounded
|
||||
rpo302 power 12345 -4 -> 4.3056E-17 Inexact Rounded
|
||||
rpo303 power 12345 -3 -> 5.3153E-13 Inexact Rounded
|
||||
rpo304 power 12345 -2 -> 6.5617E-9 Inexact Rounded
|
||||
rpo305 power 12345 -1 -> 0.000081004 Inexact Rounded
|
||||
rpo306 power 12345 0 -> 1
|
||||
rpo307 power 12345 1 -> 12345
|
||||
rpo308 power 12345 2 -> 1.524E+8 Inexact Rounded
|
||||
rpo309 power 12345 3 -> 1.8814E+12 Inexact Rounded
|
||||
rpo310 power 12345 4 -> 2.3225E+16 Inexact Rounded
|
||||
rpo311 power 12345 5 -> 2.8672E+20 Inexact Rounded
|
||||
rpo312 power 415 2 -> 1.7222E+5 Inexact Rounded
|
||||
rpo313 power 75 3 -> 4.2188E+5 Inexact Rounded
|
||||
|
||||
rounding: half_up
|
||||
rpo401 power 12345 -5 -> 3.4877E-21 Inexact Rounded
|
||||
rpo402 power 12345 -4 -> 4.3056E-17 Inexact Rounded
|
||||
rpo403 power 12345 -3 -> 5.3153E-13 Inexact Rounded
|
||||
rpo404 power 12345 -2 -> 6.5617E-9 Inexact Rounded
|
||||
rpo405 power 12345 -1 -> 0.000081004 Inexact Rounded
|
||||
rpo406 power 12345 0 -> 1
|
||||
rpo407 power 12345 1 -> 12345
|
||||
rpo408 power 12345 2 -> 1.524E+8 Inexact Rounded
|
||||
rpo409 power 12345 3 -> 1.8814E+12 Inexact Rounded
|
||||
rpo410 power 12345 4 -> 2.3225E+16 Inexact Rounded
|
||||
rpo411 power 12345 5 -> 2.8672E+20 Inexact Rounded
|
||||
rpo412 power 415 2 -> 1.7223E+5 Inexact Rounded
|
||||
rpo413 power 75 3 -> 4.2188E+5 Inexact Rounded
|
||||
|
||||
rounding: up
|
||||
rpo501 power 12345 -5 -> 3.4878E-21 Inexact Rounded
|
||||
rpo502 power 12345 -4 -> 4.3057E-17 Inexact Rounded
|
||||
rpo503 power 12345 -3 -> 5.3153E-13 Inexact Rounded
|
||||
rpo504 power 12345 -2 -> 6.5618E-9 Inexact Rounded
|
||||
rpo505 power 12345 -1 -> 0.000081005 Inexact Rounded
|
||||
rpo506 power 12345 0 -> 1
|
||||
rpo507 power 12345 1 -> 12345
|
||||
rpo508 power 12345 2 -> 1.524E+8 Inexact Rounded
|
||||
rpo509 power 12345 3 -> 1.8814E+12 Inexact Rounded
|
||||
rpo510 power 12345 4 -> 2.3226E+16 Inexact Rounded
|
||||
rpo511 power 12345 5 -> 2.8672E+20 Inexact Rounded
|
||||
rpo512 power 415 2 -> 1.7223E+5 Inexact Rounded
|
||||
rpo513 power 75 3 -> 4.2188E+5 Inexact Rounded
|
||||
|
||||
rounding: floor
|
||||
rpo601 power 12345 -5 -> 3.4877E-21 Inexact Rounded
|
||||
rpo602 power 12345 -4 -> 4.3056E-17 Inexact Rounded
|
||||
rpo603 power 12345 -3 -> 5.3152E-13 Inexact Rounded
|
||||
rpo604 power 12345 -2 -> 6.5617E-9 Inexact Rounded
|
||||
rpo605 power 12345 -1 -> 0.000081004 Inexact Rounded
|
||||
rpo606 power 12345 0 -> 1
|
||||
rpo607 power 12345 1 -> 12345
|
||||
rpo608 power 12345 2 -> 1.5239E+8 Inexact Rounded
|
||||
rpo609 power 12345 3 -> 1.8813E+12 Inexact Rounded
|
||||
rpo610 power 12345 4 -> 2.3225E+16 Inexact Rounded
|
||||
rpo611 power 12345 5 -> 2.8671E+20 Inexact Rounded
|
||||
rpo612 power 415 2 -> 1.7222E+5 Inexact Rounded
|
||||
rpo613 power 75 3 -> 4.2187E+5 Inexact Rounded
|
||||
|
||||
rounding: ceiling
|
||||
rpo701 power 12345 -5 -> 3.4878E-21 Inexact Rounded
|
||||
rpo702 power 12345 -4 -> 4.3057E-17 Inexact Rounded
|
||||
rpo703 power 12345 -3 -> 5.3153E-13 Inexact Rounded
|
||||
rpo704 power 12345 -2 -> 6.5618E-9 Inexact Rounded
|
||||
rpo705 power 12345 -1 -> 0.000081005 Inexact Rounded
|
||||
rpo706 power 12345 0 -> 1
|
||||
rpo707 power 12345 1 -> 12345
|
||||
rpo708 power 12345 2 -> 1.524E+8 Inexact Rounded
|
||||
rpo709 power 12345 3 -> 1.8814E+12 Inexact Rounded
|
||||
rpo710 power 12345 4 -> 2.3226E+16 Inexact Rounded
|
||||
rpo711 power 12345 5 -> 2.8672E+20 Inexact Rounded
|
||||
rpo712 power 415 2 -> 1.7223E+5 Inexact Rounded
|
||||
rpo713 power 75 3 -> 4.2188E+5 Inexact Rounded
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
------------------------------------------------------------------------
|
||||
-- samequantum.decTest -- check quantums match --
|
||||
-- Copyright (c) IBM Corporation, 2001, 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
|
||||
|
||||
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
|
||||
|
||||
-- combinations
|
||||
|
||||
samq0413 samequantum -7E+3 -7E+3 -> 1
|
||||
samq0414 samequantum -7E+3 -7 -> 0
|
||||
samq0415 samequantum -7E+3 -7E-3 -> 0
|
||||
samq0420 samequantum -7E+3 0 -> 0
|
||||
samq0422 samequantum -7E+3 7E-3 -> 0
|
||||
samq0423 samequantum -7E+3 7 -> 0
|
||||
samq0424 samequantum -7E+3 7E+3 -> 1
|
||||
|
||||
samq0513 samequantum -7 -7E+3 -> 0
|
||||
samq0514 samequantum -7 -7 -> 1
|
||||
samq0515 samequantum -7 -7E-3 -> 0
|
||||
samq0520 samequantum -7 0 -> 1
|
||||
samq0522 samequantum -7 7E-3 -> 0
|
||||
samq0523 samequantum -7 7 -> 1
|
||||
samq0524 samequantum -7 7E+3 -> 0
|
||||
|
||||
samq0613 samequantum -7E-3 -7E+3 -> 0
|
||||
samq0614 samequantum -7E-3 -7 -> 0
|
||||
samq0615 samequantum -7E-3 -7E-3 -> 1
|
||||
samq0620 samequantum -7E-3 0 -> 0
|
||||
samq0622 samequantum -7E-3 7E-3 -> 1
|
||||
samq0623 samequantum -7E-3 7 -> 0
|
||||
samq0624 samequantum -7E-3 7E+3 -> 0
|
||||
|
||||
samq1213 samequantum 0 -7E+3 -> 0
|
||||
samq1214 samequantum 0 -7 -> 1
|
||||
samq1215 samequantum 0 -7E-3 -> 0
|
||||
samq1220 samequantum 0 0 -> 1
|
||||
samq1222 samequantum 0 7E-3 -> 0
|
||||
samq1223 samequantum 0 7 -> 1
|
||||
samq1224 samequantum 0 7E+3 -> 0
|
||||
|
||||
samq1413 samequantum 7E-3 -7E+3 -> 0
|
||||
samq1414 samequantum 7E-3 -7 -> 0
|
||||
samq1415 samequantum 7E-3 -7E-3 -> 1
|
||||
samq1420 samequantum 7E-3 0 -> 0
|
||||
samq1422 samequantum 7E-3 7E-3 -> 1
|
||||
samq1423 samequantum 7E-3 7 -> 0
|
||||
samq1424 samequantum 7E-3 7E+3 -> 0
|
||||
|
||||
samq1513 samequantum 7 -7E+3 -> 0
|
||||
samq1514 samequantum 7 -7 -> 1
|
||||
samq1515 samequantum 7 -7E-3 -> 0
|
||||
samq1520 samequantum 7 0 -> 1
|
||||
samq1522 samequantum 7 7E-3 -> 0
|
||||
samq1523 samequantum 7 7 -> 1
|
||||
samq1524 samequantum 7 7E+3 -> 0
|
||||
|
||||
samq1613 samequantum 7E+3 -7E+3 -> 1
|
||||
samq1614 samequantum 7E+3 -7 -> 0
|
||||
samq1615 samequantum 7E+3 -7E-3 -> 0
|
||||
samq1620 samequantum 7E+3 0 -> 0
|
||||
samq1622 samequantum 7E+3 7E-3 -> 0
|
||||
samq1623 samequantum 7E+3 7 -> 0
|
||||
samq1624 samequantum 7E+3 7E+3 -> 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,674 @@
|
||||
------------------------------------------------------------------------
|
||||
-- subtract0.decTest -- decimal subtraction (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
|
||||
|
||||
-- [first group are 'quick confidence check']
|
||||
sub001 subtract 0 0 -> '0'
|
||||
sub002 subtract 1 1 -> '0'
|
||||
sub003 subtract 1 2 -> '-1'
|
||||
sub004 subtract 2 1 -> '1'
|
||||
sub005 subtract 2 2 -> '0'
|
||||
sub006 subtract 3 2 -> '1'
|
||||
sub007 subtract 2 3 -> '-1'
|
||||
|
||||
sub011 subtract -0 0 -> '0'
|
||||
sub012 subtract -1 1 -> '-2'
|
||||
sub013 subtract -1 2 -> '-3'
|
||||
sub014 subtract -2 1 -> '-3'
|
||||
sub015 subtract -2 2 -> '-4'
|
||||
sub016 subtract -3 2 -> '-5'
|
||||
sub017 subtract -2 3 -> '-5'
|
||||
|
||||
sub021 subtract 0 -0 -> '0'
|
||||
sub022 subtract 1 -1 -> '2'
|
||||
sub023 subtract 1 -2 -> '3'
|
||||
sub024 subtract 2 -1 -> '3'
|
||||
sub025 subtract 2 -2 -> '4'
|
||||
sub026 subtract 3 -2 -> '5'
|
||||
sub027 subtract 2 -3 -> '5'
|
||||
|
||||
sub030 subtract 11 1 -> 10
|
||||
sub031 subtract 10 1 -> 9
|
||||
sub032 subtract 9 1 -> 8
|
||||
sub033 subtract 1 1 -> 0
|
||||
sub034 subtract 0 1 -> -1
|
||||
sub035 subtract -1 1 -> -2
|
||||
sub036 subtract -9 1 -> -10
|
||||
sub037 subtract -10 1 -> -11
|
||||
sub038 subtract -11 1 -> -12
|
||||
|
||||
sub040 subtract '5.75' '3.3' -> '2.45'
|
||||
sub041 subtract '5' '-3' -> '8'
|
||||
sub042 subtract '-5' '-3' -> '-2'
|
||||
sub043 subtract '-7' '2.5' -> '-9.5'
|
||||
sub044 subtract '0.7' '0.3' -> '0.4'
|
||||
sub045 subtract '1.3' '0.3' -> '1.0'
|
||||
sub046 subtract '1.25' '1.25' -> '0'
|
||||
|
||||
sub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
|
||||
sub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
|
||||
sub052 subtract '0.5555555559' '0.0000000001' -> '0.555555556' Inexact Lost_digits Rounded
|
||||
sub053 subtract '0.5555555559' '0.0000000005' -> '0.555555556' Inexact Lost_digits Rounded
|
||||
sub054 subtract '0.4444444444' '0.1111111111' -> '0.333333333' Inexact Lost_digits Rounded
|
||||
sub055 subtract '1.0000000000' '0.00000001' -> '0.99999999' Rounded
|
||||
sub056 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
sub057 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
|
||||
sub060 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub061 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub062 subtract '7000' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub063 subtract '70000' '10000e+9' -> '-9.9999999E+12' Inexact Rounded
|
||||
sub064 subtract '700000' '10000e+9' -> '-9.9999993E+12' Rounded
|
||||
-- symmetry:
|
||||
sub065 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
|
||||
sub066 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
|
||||
sub067 subtract '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
|
||||
sub068 subtract '10000e+9' '70000' -> '9.9999999E+12' Inexact Rounded
|
||||
sub069 subtract '10000e+9' '700000' -> '9.9999993E+12' Rounded
|
||||
|
||||
-- change precision
|
||||
sub080 subtract '10000e+9' '70000' -> '9.9999999E+12' Inexact Rounded
|
||||
precision: 6
|
||||
sub081 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
|
||||
precision: 9
|
||||
|
||||
-- some of the next group are really constructor tests
|
||||
sub090 subtract '00.0' '0.0' -> '0'
|
||||
sub091 subtract '00.0' '0.00' -> '0'
|
||||
sub092 subtract '0.00' '00.0' -> '0'
|
||||
sub093 subtract '00.0' '0.00' -> '0'
|
||||
sub094 subtract '0.00' '00.0' -> '0'
|
||||
sub095 subtract '3' '.3' -> '2.7'
|
||||
sub096 subtract '3.' '.3' -> '2.7'
|
||||
sub097 subtract '3.0' '.3' -> '2.7'
|
||||
sub098 subtract '3.00' '.3' -> '2.70'
|
||||
sub099 subtract '3' '3' -> '0'
|
||||
sub100 subtract '3' '+3' -> '0'
|
||||
sub101 subtract '3' '-3' -> '6'
|
||||
sub102 subtract '3' '0.3' -> '2.7'
|
||||
sub103 subtract '3.' '0.3' -> '2.7'
|
||||
sub104 subtract '3.0' '0.3' -> '2.7'
|
||||
sub105 subtract '3.00' '0.3' -> '2.70'
|
||||
sub106 subtract '3' '3.0' -> '0'
|
||||
sub107 subtract '3' '+3.0' -> '0'
|
||||
sub108 subtract '3' '-3.0' -> '6.0'
|
||||
|
||||
-- the above all from add; massaged and extended. Now some new ones...
|
||||
-- [particularly important for comparisons]
|
||||
-- NB: -1E-7 below were non-exponents pre-ANSI X3-274
|
||||
sub120 subtract '10.23456784' '10.23456789' -> '-1E-7' Inexact Lost_digits Rounded
|
||||
sub121 subtract '10.23456785' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub122 subtract '10.23456786' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub123 subtract '10.23456787' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub124 subtract '10.23456788' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub125 subtract '10.23456789' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub126 subtract '10.23456790' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub127 subtract '10.23456791' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub128 subtract '10.23456792' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub129 subtract '10.23456793' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub130 subtract '10.23456794' '10.23456789' -> 0 Inexact Lost_digits Rounded
|
||||
sub131 subtract '10.23456781' '10.23456786' -> '-1E-7' Inexact Lost_digits Rounded
|
||||
sub132 subtract '10.23456782' '10.23456786' -> '-1E-7' Inexact Lost_digits Rounded
|
||||
sub133 subtract '10.23456783' '10.23456786' -> '-1E-7' Inexact Lost_digits Rounded
|
||||
sub134 subtract '10.23456784' '10.23456786' -> '-1E-7' Inexact Lost_digits Rounded
|
||||
sub135 subtract '10.23456785' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub136 subtract '10.23456786' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub137 subtract '10.23456787' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub138 subtract '10.23456788' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub139 subtract '10.23456789' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub140 subtract '10.23456790' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub141 subtract '10.23456791' '10.23456786' -> 0 Inexact Lost_digits Rounded
|
||||
sub142 subtract '1' '0.999999999' -> 0 Inexact Rounded
|
||||
sub143 subtract '0.999999999' '1' -> 0 Inexact Rounded
|
||||
|
||||
|
||||
precision: 3
|
||||
sub150 subtract '12345678900000' '9999999999999' -> 2.3E+12 Inexact Lost_digits Rounded
|
||||
sub151 subtract '9999999999999' '12345678900000' -> -2.3E+12 Inexact Lost_digits Rounded
|
||||
precision: 6
|
||||
sub152 subtract '12345678900000' '9999999999999' -> 2.3457E+12 Inexact Lost_digits Rounded
|
||||
sub153 subtract '9999999999999' '12345678900000' -> -2.3457E+12 Inexact Lost_digits Rounded
|
||||
precision: 9
|
||||
sub154 subtract '12345678900000' '9999999999999' -> 2.3456789E+12 Inexact Lost_digits Rounded
|
||||
sub155 subtract '9999999999999' '12345678900000' -> -2.3456789E+12 Inexact Lost_digits Rounded
|
||||
precision: 12
|
||||
sub156 subtract '12345678900000' '9999999999999' -> 2.3456789000E+12 Inexact Lost_digits Rounded
|
||||
sub157 subtract '9999999999999' '12345678900000' -> -2.3456789000E+12 Inexact Lost_digits Rounded
|
||||
precision: 15
|
||||
sub158 subtract '12345678900000' '9999999999999' -> 2345678900001
|
||||
sub159 subtract '9999999999999' '12345678900000' -> -2345678900001
|
||||
precision: 9
|
||||
|
||||
-- additional scaled arithmetic tests [0.97 problem]
|
||||
sub160 subtract '0' '.1' -> '-0.1'
|
||||
sub161 subtract '00' '.97983' -> '-0.97983'
|
||||
sub162 subtract '0' '.9' -> '-0.9'
|
||||
sub163 subtract '0' '0.102' -> '-0.102'
|
||||
sub164 subtract '0' '.4' -> '-0.4'
|
||||
sub165 subtract '0' '.307' -> '-0.307'
|
||||
sub166 subtract '0' '.43822' -> '-0.43822'
|
||||
sub167 subtract '0' '.911' -> '-0.911'
|
||||
sub168 subtract '.0' '.02' -> '-0.02'
|
||||
sub169 subtract '00' '.392' -> '-0.392'
|
||||
sub170 subtract '0' '.26' -> '-0.26'
|
||||
sub171 subtract '0' '0.51' -> '-0.51'
|
||||
sub172 subtract '0' '.2234' -> '-0.2234'
|
||||
sub173 subtract '0' '.2' -> '-0.2'
|
||||
sub174 subtract '.0' '.0008' -> '-0.0008'
|
||||
-- 0. on left
|
||||
sub180 subtract '0.0' '-.1' -> '0.1'
|
||||
sub181 subtract '0.00' '-.97983' -> '0.97983'
|
||||
sub182 subtract '0.0' '-.9' -> '0.9'
|
||||
sub183 subtract '0.0' '-0.102' -> '0.102'
|
||||
sub184 subtract '0.0' '-.4' -> '0.4'
|
||||
sub185 subtract '0.0' '-.307' -> '0.307'
|
||||
sub186 subtract '0.0' '-.43822' -> '0.43822'
|
||||
sub187 subtract '0.0' '-.911' -> '0.911'
|
||||
sub188 subtract '0.0' '-.02' -> '0.02'
|
||||
sub189 subtract '0.00' '-.392' -> '0.392'
|
||||
sub190 subtract '0.0' '-.26' -> '0.26'
|
||||
sub191 subtract '0.0' '-0.51' -> '0.51'
|
||||
sub192 subtract '0.0' '-.2234' -> '0.2234'
|
||||
sub193 subtract '0.0' '-.2' -> '0.2'
|
||||
sub194 subtract '0.0' '-.0008' -> '0.0008'
|
||||
-- negatives of same
|
||||
sub200 subtract '0' '-.1' -> '0.1'
|
||||
sub201 subtract '00' '-.97983' -> '0.97983'
|
||||
sub202 subtract '0' '-.9' -> '0.9'
|
||||
sub203 subtract '0' '-0.102' -> '0.102'
|
||||
sub204 subtract '0' '-.4' -> '0.4'
|
||||
sub205 subtract '0' '-.307' -> '0.307'
|
||||
sub206 subtract '0' '-.43822' -> '0.43822'
|
||||
sub207 subtract '0' '-.911' -> '0.911'
|
||||
sub208 subtract '.0' '-.02' -> '0.02'
|
||||
sub209 subtract '00' '-.392' -> '0.392'
|
||||
sub210 subtract '0' '-.26' -> '0.26'
|
||||
sub211 subtract '0' '-0.51' -> '0.51'
|
||||
sub212 subtract '0' '-.2234' -> '0.2234'
|
||||
sub213 subtract '0' '-.2' -> '0.2'
|
||||
sub214 subtract '.0' '-.0008' -> '0.0008'
|
||||
|
||||
-- more fixed, LHS swaps [really the same as testcases under add]
|
||||
sub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
|
||||
sub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
|
||||
sub222 subtract '-56267E-10' 0 -> '-0.0000056267'
|
||||
sub223 subtract '-56267E-9' 0 -> '-0.000056267'
|
||||
sub224 subtract '-56267E-8' 0 -> '-0.00056267'
|
||||
sub225 subtract '-56267E-7' 0 -> '-0.0056267'
|
||||
sub226 subtract '-56267E-6' 0 -> '-0.056267'
|
||||
sub227 subtract '-56267E-5' 0 -> '-0.56267'
|
||||
sub228 subtract '-56267E-2' 0 -> '-562.67'
|
||||
sub229 subtract '-56267E-1' 0 -> '-5626.7'
|
||||
sub230 subtract '-56267E-0' 0 -> '-56267'
|
||||
-- symmetry ...
|
||||
sub240 subtract 0 '-56267E-12' -> '5.6267E-8'
|
||||
sub241 subtract 0 '-56267E-11' -> '5.6267E-7'
|
||||
sub242 subtract 0 '-56267E-10' -> '0.0000056267'
|
||||
sub243 subtract 0 '-56267E-9' -> '0.000056267'
|
||||
sub244 subtract 0 '-56267E-8' -> '0.00056267'
|
||||
sub245 subtract 0 '-56267E-7' -> '0.0056267'
|
||||
sub246 subtract 0 '-56267E-6' -> '0.056267'
|
||||
sub247 subtract 0 '-56267E-5' -> '0.56267'
|
||||
sub248 subtract 0 '-56267E-2' -> '562.67'
|
||||
sub249 subtract 0 '-56267E-1' -> '5626.7'
|
||||
sub250 subtract 0 '-56267E-0' -> '56267'
|
||||
|
||||
-- now some more from the 'new' add
|
||||
precision: 9
|
||||
sub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
|
||||
sub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
|
||||
|
||||
sub311 subtract '0.4444444444' '0.5555555555' -> '-0.111111112' Inexact Lost_digits Rounded
|
||||
sub312 subtract '0.4444444440' '0.5555555555' -> '-0.111111112' Inexact Lost_digits Rounded
|
||||
sub313 subtract '0.4444444444' '0.5555555550' -> '-0.111111111' Inexact Lost_digits Rounded
|
||||
sub314 subtract '0.44444444449' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
sub315 subtract '0.444444444499' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
sub316 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Lost_digits Rounded
|
||||
sub317 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
sub318 subtract '0.4444444445001' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
sub319 subtract '0.444444444501' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
sub320 subtract '0.44444444451' '0' -> '0.444444445' Inexact Lost_digits Rounded
|
||||
|
||||
-- some carrying effects
|
||||
sub321 subtract '0.9998' '0.0000' -> '0.9998'
|
||||
sub322 subtract '0.9998' '0.0001' -> '0.9997'
|
||||
sub323 subtract '0.9998' '0.0002' -> '0.9996'
|
||||
sub324 subtract '0.9998' '0.0003' -> '0.9995'
|
||||
sub325 subtract '0.9998' '-0.0000' -> '0.9998'
|
||||
sub326 subtract '0.9998' '-0.0001' -> '0.9999'
|
||||
sub327 subtract '0.9998' '-0.0002' -> '1.0000'
|
||||
sub328 subtract '0.9998' '-0.0003' -> '1.0001'
|
||||
|
||||
sub330 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub331 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub332 subtract '7000' '10000e+9' -> '-1.00000000E+13' Inexact Rounded
|
||||
sub333 subtract '70000' '10000e+9' -> '-9.9999999E+12' Inexact Rounded
|
||||
sub334 subtract '700000' '10000e+9' -> '-9.9999993E+12' Rounded
|
||||
sub335 subtract '7000000' '10000e+9' -> '-9.9999930E+12' Rounded
|
||||
-- symmetry:
|
||||
sub340 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
|
||||
sub341 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
|
||||
sub342 subtract '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
|
||||
sub343 subtract '10000e+9' '70000' -> '9.9999999E+12' Inexact Rounded
|
||||
sub344 subtract '10000e+9' '700000' -> '9.9999993E+12' Rounded
|
||||
sub345 subtract '10000e+9' '7000000' -> '9.9999930E+12' Rounded
|
||||
|
||||
-- same, higher precision
|
||||
precision: 15
|
||||
sub346 subtract '10000e+9' '7' -> '9999999999993'
|
||||
sub347 subtract '10000e+9' '70' -> '9999999999930'
|
||||
sub348 subtract '10000e+9' '700' -> '9999999999300'
|
||||
sub349 subtract '10000e+9' '7000' -> '9999999993000'
|
||||
sub350 subtract '10000e+9' '70000' -> '9999999930000'
|
||||
sub351 subtract '10000e+9' '700000' -> '9999999300000'
|
||||
sub352 subtract '7' '10000e+9' -> '-9999999999993'
|
||||
sub353 subtract '70' '10000e+9' -> '-9999999999930'
|
||||
sub354 subtract '700' '10000e+9' -> '-9999999999300'
|
||||
sub355 subtract '7000' '10000e+9' -> '-9999999993000'
|
||||
sub356 subtract '70000' '10000e+9' -> '-9999999930000'
|
||||
sub357 subtract '700000' '10000e+9' -> '-9999999300000'
|
||||
|
||||
-- zero preservation
|
||||
precision: 6
|
||||
sub360 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
|
||||
sub361 subtract 1 '0.0001' -> '0.9999'
|
||||
sub362 subtract 1 '0.00001' -> '0.99999'
|
||||
sub363 subtract 1 '0.000001' -> '1.00000' Inexact Rounded
|
||||
sub364 subtract 1 '0.0000001' -> '1.00000' Inexact Rounded
|
||||
sub365 subtract 1 '0.00000001' -> '1.00000' Inexact Rounded
|
||||
|
||||
-- some funny zeros [in case of bad signum]
|
||||
sub370 subtract 1 0 -> 1
|
||||
sub371 subtract 1 0. -> 1
|
||||
sub372 subtract 1 .0 -> 1
|
||||
sub373 subtract 1 0.0 -> 1
|
||||
sub374 subtract 0 1 -> -1
|
||||
sub375 subtract 0. 1 -> -1
|
||||
sub376 subtract .0 1 -> -1
|
||||
sub377 subtract 0.0 1 -> -1
|
||||
|
||||
precision: 9
|
||||
|
||||
-- leading 0 digit before round
|
||||
sub910 subtract -103519362 -51897955.3 -> -51621407 Inexact Rounded
|
||||
sub911 subtract 159579.444 89827.5229 -> 69751.921 Inexact Rounded
|
||||
|
||||
sub920 subtract 333.123456 33.1234566 -> 299.999999 Inexact Rounded
|
||||
sub921 subtract 333.123456 33.1234565 -> 300.000000 Inexact Rounded
|
||||
sub922 subtract 133.123456 33.1234565 -> 100.000000 Inexact Rounded
|
||||
sub923 subtract 133.123456 33.1234564 -> 100.000000 Inexact Rounded
|
||||
sub924 subtract 133.123456 33.1234540 -> 100.000002 Rounded
|
||||
sub925 subtract 133.123456 43.1234560 -> 90.000000 Rounded
|
||||
sub926 subtract 133.123456 43.1234561 -> 90.000000 Inexact Rounded
|
||||
sub927 subtract 133.123456 43.1234566 -> 89.999999 Inexact Rounded
|
||||
sub928 subtract 101.123456 91.1234566 -> 9.999999 Inexact Rounded
|
||||
sub929 subtract 101.123456 99.1234566 -> 1.999999 Inexact Rounded
|
||||
|
||||
-- more of the same; probe for cluster boundary problems
|
||||
precision: 1
|
||||
sub930 subtract 11 2 -> 1E+1 Inexact Lost_digits Rounded
|
||||
precision: 2
|
||||
sub932 subtract 101 2 -> 1.0E+2 Inexact Lost_digits Rounded
|
||||
precision: 3
|
||||
sub934 subtract 101 2.1 -> 99 Inexact Rounded
|
||||
sub935 subtract 101 92.01 -> 9 Inexact Lost_digits Rounded
|
||||
precision: 4
|
||||
sub936 subtract 101 2.01 -> 99.0 Inexact Rounded
|
||||
sub937 subtract 101 92.01 -> 9.0 Inexact Rounded
|
||||
precision: 5
|
||||
sub938 subtract 101 2.001 -> 99.00 Inexact Rounded
|
||||
sub939 subtract 101 92.001 -> 9.00 Inexact Rounded
|
||||
precision: 6
|
||||
sub940 subtract 101 2.0001 -> 99.000 Inexact Rounded
|
||||
sub941 subtract 101 92.0001 -> 9.000 Inexact Rounded
|
||||
precision: 7
|
||||
sub942 subtract 101 2.00001 -> 99.0000 Inexact Rounded
|
||||
sub943 subtract 101 92.00001 -> 9.0000 Inexact Rounded
|
||||
precision: 8
|
||||
sub944 subtract 101 2.000001 -> 99.00000 Inexact Rounded
|
||||
sub945 subtract 101 92.000001 -> 9.00000 Inexact Rounded
|
||||
precision: 9
|
||||
sub946 subtract 101 2.0000001 -> 99.000000 Inexact Rounded
|
||||
sub947 subtract 101 92.0000001 -> 9.000000 Inexact Rounded
|
||||
|
||||
precision: 9
|
||||
|
||||
-- more LHS swaps [were fixed]
|
||||
sub390 subtract '-56267E-10' 0 -> '-0.0000056267'
|
||||
sub391 subtract '-56267E-6' 0 -> '-0.056267'
|
||||
sub392 subtract '-56267E-5' 0 -> '-0.56267'
|
||||
sub393 subtract '-56267E-4' 0 -> '-5.6267'
|
||||
sub394 subtract '-56267E-3' 0 -> '-56.267'
|
||||
sub395 subtract '-56267E-2' 0 -> '-562.67'
|
||||
sub396 subtract '-56267E-1' 0 -> '-5626.7'
|
||||
sub397 subtract '-56267E-0' 0 -> '-56267'
|
||||
sub398 subtract '-5E-10' 0 -> '-5E-10'
|
||||
sub399 subtract '-5E-7' 0 -> '-5E-7'
|
||||
sub400 subtract '-5E-6' 0 -> '-0.000005'
|
||||
sub401 subtract '-5E-5' 0 -> '-0.00005'
|
||||
sub402 subtract '-5E-4' 0 -> '-0.0005'
|
||||
sub403 subtract '-5E-1' 0 -> '-0.5'
|
||||
sub404 subtract '-5E0' 0 -> '-5'
|
||||
sub405 subtract '-5E1' 0 -> '-50'
|
||||
sub406 subtract '-5E5' 0 -> '-500000'
|
||||
sub407 subtract '-5E8' 0 -> '-500000000'
|
||||
sub408 subtract '-5E9' 0 -> '-5E+9'
|
||||
sub409 subtract '-5E10' 0 -> '-5E+10'
|
||||
sub410 subtract '-5E11' 0 -> '-5E+11'
|
||||
sub411 subtract '-5E100' 0 -> '-5E+100'
|
||||
|
||||
-- more RHS swaps [were fixed]
|
||||
sub420 subtract 0 '-56267E-10' -> '0.0000056267'
|
||||
sub421 subtract 0 '-56267E-6' -> '0.056267'
|
||||
sub422 subtract 0 '-56267E-5' -> '0.56267'
|
||||
sub423 subtract 0 '-56267E-4' -> '5.6267'
|
||||
sub424 subtract 0 '-56267E-3' -> '56.267'
|
||||
sub425 subtract 0 '-56267E-2' -> '562.67'
|
||||
sub426 subtract 0 '-56267E-1' -> '5626.7'
|
||||
sub427 subtract 0 '-56267E-0' -> '56267'
|
||||
sub428 subtract 0 '-5E-10' -> '5E-10'
|
||||
sub429 subtract 0 '-5E-7' -> '5E-7'
|
||||
sub430 subtract 0 '-5E-6' -> '0.000005'
|
||||
sub431 subtract 0 '-5E-5' -> '0.00005'
|
||||
sub432 subtract 0 '-5E-4' -> '0.0005'
|
||||
sub433 subtract 0 '-5E-1' -> '0.5'
|
||||
sub434 subtract 0 '-5E0' -> '5'
|
||||
sub435 subtract 0 '-5E1' -> '50'
|
||||
sub436 subtract 0 '-5E5' -> '500000'
|
||||
sub437 subtract 0 '-5E8' -> '500000000'
|
||||
sub438 subtract 0 '-5E9' -> '5E+9'
|
||||
sub439 subtract 0 '-5E10' -> '5E+10'
|
||||
sub440 subtract 0 '-5E11' -> '5E+11'
|
||||
sub441 subtract 0 '-5E100' -> '5E+100'
|
||||
|
||||
|
||||
-- try borderline precision, with carries, etc.
|
||||
precision: 15
|
||||
sub461 subtract '1E+12' '1' -> '999999999999'
|
||||
sub462 subtract '1E+12' '-1.11' -> '1000000000001.11'
|
||||
sub463 subtract '1.11' '-1E+12' -> '1000000000001.11'
|
||||
sub464 subtract '-1' '-1E+12' -> '999999999999'
|
||||
sub465 subtract '7E+12' '1' -> '6999999999999'
|
||||
sub466 subtract '7E+12' '-1.11' -> '7000000000001.11'
|
||||
sub467 subtract '1.11' '-7E+12' -> '7000000000001.11'
|
||||
sub468 subtract '-1' '-7E+12' -> '6999999999999'
|
||||
|
||||
-- 123456789012345 123456789012345 1 23456789012345
|
||||
sub470 subtract '0.444444444444444' '-0.555555555555563' -> '1.00000000000001' Inexact Rounded
|
||||
sub471 subtract '0.444444444444444' '-0.555555555555562' -> '1.00000000000001' Inexact Rounded
|
||||
sub472 subtract '0.444444444444444' '-0.555555555555561' -> '1.00000000000001' Inexact Rounded
|
||||
sub473 subtract '0.444444444444444' '-0.555555555555560' -> '1.00000000000000' Inexact Rounded
|
||||
sub474 subtract '0.444444444444444' '-0.555555555555559' -> '1.00000000000000' Inexact Rounded
|
||||
sub475 subtract '0.444444444444444' '-0.555555555555558' -> '1.00000000000000' Inexact Rounded
|
||||
sub476 subtract '0.444444444444444' '-0.555555555555557' -> '1.00000000000000' Inexact Rounded
|
||||
sub477 subtract '0.444444444444444' '-0.555555555555556' -> '1.00000000000000' Rounded
|
||||
sub478 subtract '0.444444444444444' '-0.555555555555555' -> '0.999999999999999'
|
||||
sub479 subtract '0.444444444444444' '-0.555555555555554' -> '0.999999999999998'
|
||||
sub480 subtract '0.444444444444444' '-0.555555555555553' -> '0.999999999999997'
|
||||
sub481 subtract '0.444444444444444' '-0.555555555555552' -> '0.999999999999996'
|
||||
sub482 subtract '0.444444444444444' '-0.555555555555551' -> '0.999999999999995'
|
||||
sub483 subtract '0.444444444444444' '-0.555555555555550' -> '0.999999999999994'
|
||||
|
||||
-- and some more, including residue effects and different roundings
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
sub500 subtract '123456789' 0 -> '123456789'
|
||||
sub501 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded
|
||||
sub502 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded
|
||||
sub503 subtract '123456789' 0.1 -> '123456789' Inexact Rounded
|
||||
sub504 subtract '123456789' 0.4 -> '123456789' Inexact Rounded
|
||||
sub505 subtract '123456789' 0.49 -> '123456789' Inexact Rounded
|
||||
sub506 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded
|
||||
sub507 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded
|
||||
sub508 subtract '123456789' 0.5 -> '123456789' Inexact Rounded
|
||||
sub509 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded
|
||||
sub510 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded
|
||||
sub511 subtract '123456789' 0.51 -> '123456788' Inexact Rounded
|
||||
sub512 subtract '123456789' 0.6 -> '123456788' Inexact Rounded
|
||||
sub513 subtract '123456789' 0.9 -> '123456788' Inexact Rounded
|
||||
sub514 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded
|
||||
sub515 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded
|
||||
sub516 subtract '123456789' 1 -> '123456788'
|
||||
sub517 subtract '123456789' 1.000000001 -> '123456788' Inexact Lost_digits Rounded
|
||||
sub518 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded
|
||||
sub519 subtract '123456789' 1.1 -> '123456788' Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
sub520 subtract '123456789' 0 -> '123456789'
|
||||
sub521 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded
|
||||
sub522 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded
|
||||
sub523 subtract '123456789' 0.1 -> '123456789' Inexact Rounded
|
||||
sub524 subtract '123456789' 0.4 -> '123456789' Inexact Rounded
|
||||
sub525 subtract '123456789' 0.49 -> '123456789' Inexact Rounded
|
||||
sub526 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded
|
||||
sub527 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded
|
||||
sub528 subtract '123456789' 0.5 -> '123456788' Inexact Rounded
|
||||
sub529 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded
|
||||
sub530 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded
|
||||
sub531 subtract '123456789' 0.51 -> '123456788' Inexact Rounded
|
||||
sub532 subtract '123456789' 0.6 -> '123456788' Inexact Rounded
|
||||
sub533 subtract '123456789' 0.9 -> '123456788' Inexact Rounded
|
||||
sub534 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded
|
||||
sub535 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded
|
||||
sub536 subtract '123456789' 1 -> '123456788'
|
||||
sub537 subtract '123456789' 1.00000001 -> '123456788' Inexact Rounded
|
||||
sub538 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded
|
||||
sub539 subtract '123456789' 1.1 -> '123456788' Inexact Rounded
|
||||
-- critical few with even bottom digit...
|
||||
sub540 subtract '123456788' 0.499999999 -> '123456788' Inexact Rounded
|
||||
sub541 subtract '123456788' 0.5 -> '123456788' Inexact Rounded
|
||||
sub542 subtract '123456788' 0.500000001 -> '123456787' Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
sub550 subtract '123456789' 0 -> '123456789'
|
||||
sub551 subtract '123456789' 0.000000001 -> '123456788' Inexact Rounded
|
||||
sub552 subtract '123456789' 0.000001 -> '123456788' Inexact Rounded
|
||||
sub553 subtract '123456789' 0.1 -> '123456788' Inexact Rounded
|
||||
sub554 subtract '123456789' 0.4 -> '123456788' Inexact Rounded
|
||||
sub555 subtract '123456789' 0.49 -> '123456788' Inexact Rounded
|
||||
sub556 subtract '123456789' 0.499999 -> '123456788' Inexact Rounded
|
||||
sub557 subtract '123456789' 0.499999999 -> '123456788' Inexact Rounded
|
||||
sub558 subtract '123456789' 0.5 -> '123456788' Inexact Rounded
|
||||
sub559 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded
|
||||
sub560 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded
|
||||
sub561 subtract '123456789' 0.51 -> '123456788' Inexact Rounded
|
||||
sub562 subtract '123456789' 0.6 -> '123456788' Inexact Rounded
|
||||
sub563 subtract '123456789' 0.9 -> '123456788' Inexact Rounded
|
||||
sub564 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded
|
||||
sub565 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded
|
||||
sub566 subtract '123456789' 1 -> '123456788'
|
||||
sub567 subtract '123456789' 1.00000001 -> '123456787' Inexact Rounded
|
||||
sub568 subtract '123456789' 1.00001 -> '123456787' Inexact Rounded
|
||||
sub569 subtract '123456789' 1.1 -> '123456787' Inexact Rounded
|
||||
|
||||
-- symmetry...
|
||||
rounding: half_up
|
||||
sub600 subtract 0 '123456789' -> '-123456789'
|
||||
sub601 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub602 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub603 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub604 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub605 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub606 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub607 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub608 subtract 0.5 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub609 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub610 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub611 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub612 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub613 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub614 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub615 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub616 subtract 1 '123456789' -> '-123456788'
|
||||
sub617 subtract 1.000000001 '123456789' -> '-123456788' Inexact Lost_digits Rounded
|
||||
sub618 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub619 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded
|
||||
|
||||
rounding: half_even
|
||||
sub620 subtract 0 '123456789' -> '-123456789'
|
||||
sub621 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub622 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub623 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub624 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub625 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub626 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub627 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded
|
||||
sub628 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub629 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub630 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub631 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub632 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub633 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub634 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub635 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub636 subtract 1 '123456789' -> '-123456788'
|
||||
sub637 subtract 1.00000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub638 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub639 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded
|
||||
-- critical few with even bottom digit...
|
||||
sub640 subtract 0.499999999 '123456788' -> '-123456788' Inexact Rounded
|
||||
sub641 subtract 0.5 '123456788' -> '-123456788' Inexact Rounded
|
||||
sub642 subtract 0.500000001 '123456788' -> '-123456787' Inexact Rounded
|
||||
|
||||
rounding: down
|
||||
sub650 subtract 0 '123456789' -> '-123456789'
|
||||
sub651 subtract 0.000000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub652 subtract 0.000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub653 subtract 0.1 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub654 subtract 0.4 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub655 subtract 0.49 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub656 subtract 0.499999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub657 subtract 0.499999999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub658 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub659 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub660 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub661 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub662 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub663 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub664 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub665 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded
|
||||
sub666 subtract 1 '123456789' -> '-123456788'
|
||||
sub667 subtract 1.00000001 '123456789' -> '-123456787' Inexact Rounded
|
||||
sub668 subtract 1.00001 '123456789' -> '-123456787' Inexact Rounded
|
||||
sub669 subtract 1.1 '123456789' -> '-123456787' Inexact Rounded
|
||||
|
||||
-- lots of leading zeros in intermediate result, and showing effects of
|
||||
-- input rounding
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
sub670 subtract '123456789' '123456788.1' -> 1 Inexact Lost_digits Rounded
|
||||
sub671 subtract '123456789' '123456788.9' -> 0 Inexact Lost_digits Rounded
|
||||
sub672 subtract '123456789' '123456789.1' -> 0 Inexact Lost_digits Rounded
|
||||
sub673 subtract '123456789' '123456789.5' -> -1 Inexact Lost_digits Rounded
|
||||
sub674 subtract '123456789' '123456789.9' -> -1 Inexact Lost_digits Rounded
|
||||
|
||||
rounding: half_even
|
||||
sub680 subtract '123456789' '123456788.1' -> 1 Inexact Lost_digits Rounded
|
||||
sub681 subtract '123456789' '123456788.9' -> 0 Inexact Lost_digits Rounded
|
||||
sub682 subtract '123456789' '123456789.1' -> 0 Inexact Lost_digits Rounded
|
||||
sub683 subtract '123456789' '123456789.5' -> -1 Inexact Lost_digits Rounded
|
||||
sub684 subtract '123456789' '123456789.9' -> -1 Inexact Lost_digits Rounded
|
||||
|
||||
sub685 subtract '123456788' '123456787.1' -> 1 Inexact Lost_digits Rounded
|
||||
sub686 subtract '123456788' '123456787.9' -> 0 Inexact Lost_digits Rounded
|
||||
sub687 subtract '123456788' '123456788.1' -> 0 Inexact Lost_digits Rounded
|
||||
sub688 subtract '123456788' '123456788.5' -> 0 Inexact Lost_digits Rounded
|
||||
sub689 subtract '123456788' '123456788.9' -> -1 Inexact Lost_digits Rounded
|
||||
|
||||
rounding: down
|
||||
sub690 subtract '123456789' '123456788.1' -> 1 Inexact Lost_digits Rounded
|
||||
sub691 subtract '123456789' '123456788.9' -> 1 Inexact Lost_digits Rounded
|
||||
sub692 subtract '123456789' '123456789.1' -> 0 Inexact Lost_digits Rounded
|
||||
sub693 subtract '123456789' '123456789.5' -> 0 Inexact Lost_digits Rounded
|
||||
sub694 subtract '123456789' '123456789.9' -> 0 Inexact Lost_digits Rounded
|
||||
|
||||
|
||||
-- input preparation tests
|
||||
rounding: half_up
|
||||
precision: 3
|
||||
|
||||
sub700 subtract '12345678900000' -9999999999999 -> '2.23E+13' Inexact Lost_digits Rounded
|
||||
sub701 subtract '9999999999999' -12345678900000 -> '2.23E+13' Inexact Lost_digits Rounded
|
||||
sub702 subtract '12E+3' '-3456' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
-- next was 1.54E+4 under old [truncate to digits+1] rules
|
||||
sub703 subtract '12E+3' '-3446' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
sub704 subtract '12E+3' '-3454' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
sub705 subtract '12E+3' '-3444' -> '1.54E+4' Inexact Lost_digits Rounded
|
||||
|
||||
sub706 subtract '3456' '-12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
-- next was 1.54E+4 under old [truncate to digits+1] rules
|
||||
sub707 subtract '3446' '-12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
sub708 subtract '3454' '-12E+3' -> '1.55E+4' Inexact Lost_digits Rounded
|
||||
sub709 subtract '3444' '-12E+3' -> '1.54E+4' Inexact Lost_digits Rounded
|
||||
|
||||
-- overflow and underflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
sub730 subtract 1E+999999999 -9E+999999999 -> ? Overflow Inexact Rounded
|
||||
sub731 subtract 9E+999999999 -1E+999999999 -> ? Overflow Inexact Rounded
|
||||
sub732 subtract -1.1E-999999999 -1E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
sub733 subtract 1E-999999999 1.1e-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
sub734 subtract -1E+999999999 9E+999999999 -> ? Overflow Inexact Rounded
|
||||
sub735 subtract -9E+999999999 1E+999999999 -> ? Overflow Inexact Rounded
|
||||
sub736 subtract +1.1E-999999999 1E-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
sub737 subtract -1E-999999999 -1.1e-999999999 -> ? Underflow Subnormal Inexact Rounded
|
||||
|
||||
-- lostDigits checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
sub801 subtract 12345678000 0 -> 1.23456780E+10 Rounded
|
||||
sub802 subtract 0 12345678000 -> -1.23456780E+10 Rounded
|
||||
sub803 subtract 1234567800 0 -> 1.23456780E+9 Rounded
|
||||
sub804 subtract 0 1234567800 -> -1.23456780E+9 Rounded
|
||||
sub805 subtract 1234567890 0 -> 1.23456789E+9 Rounded
|
||||
sub806 subtract 0 1234567890 -> -1.23456789E+9 Rounded
|
||||
sub807 subtract 1234567891 0 -> 1.23456789E+9 Inexact Lost_digits Rounded
|
||||
sub808 subtract 0 1234567891 -> -1.23456789E+9 Inexact Lost_digits Rounded
|
||||
sub809 subtract 12345678901 0 -> 1.23456789E+10 Inexact Lost_digits Rounded
|
||||
sub810 subtract 0 12345678901 -> -1.23456789E+10 Inexact Lost_digits Rounded
|
||||
sub811 subtract 1234567896 0 -> 1.23456790E+9 Inexact Lost_digits Rounded
|
||||
sub812 subtract 0 1234567896 -> -1.23456790E+9 Inexact Lost_digits Rounded
|
||||
|
||||
precision: 15
|
||||
-- still checking for [no] lostDigits
|
||||
sub841 subtract 12345678000 0 -> 12345678000
|
||||
sub842 subtract 0 12345678000 -> -12345678000
|
||||
sub843 subtract 1234567800 0 -> 1234567800
|
||||
sub844 subtract 0 1234567800 -> -1234567800
|
||||
sub845 subtract 1234567890 0 -> 1234567890
|
||||
sub846 subtract 0 1234567890 -> -1234567890
|
||||
sub847 subtract 1234567891 0 -> 1234567891
|
||||
sub848 subtract 0 1234567891 -> -1234567891
|
||||
sub849 subtract 12345678901 0 -> 12345678901
|
||||
sub850 subtract 0 12345678901 -> -12345678901
|
||||
sub851 subtract 1234567896 0 -> 1234567896
|
||||
sub852 subtract 0 1234567896 -> -1234567896
|
||||
|
||||
-- Null tests
|
||||
sub900 subtract 10 # -> ? Invalid_operation
|
||||
sub901 subtract # 10 -> ? Invalid_operation
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
------------------------------------------------------------------------
|
||||
-- testall0.decTest -- run all subset decimal arithmetic testcases --
|
||||
-- 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
|
||||
|
||||
-- subset arithmetic tests (using Extended: 0) ---------------------
|
||||
dectest: base0
|
||||
dectest: abs0
|
||||
dectest: add0
|
||||
dectest: compare0
|
||||
dectest: comparetotal0
|
||||
dectest: divide0
|
||||
dectest: divideint0
|
||||
dectest: exp0
|
||||
dectest: fma0
|
||||
dectest: inexact0
|
||||
dectest: ln0
|
||||
dectest: log100
|
||||
dectest: max0
|
||||
dectest: min0
|
||||
dectest: minus0
|
||||
dectest: multiply0
|
||||
dectest: plus0
|
||||
dectest: power0
|
||||
dectest: quantize0
|
||||
dectest: randoms0
|
||||
dectest: reduce0
|
||||
dectest: remainder0
|
||||
dectest: remaindernear0
|
||||
dectest: rescale0 -- [obsolete]
|
||||
dectest: rounding0
|
||||
dectest: samequantum0
|
||||
dectest: squareroot0
|
||||
dectest: subtract0
|
||||
dectest: tointegral0
|
||||
dectest: trim0
|
||||
|
||||
-- General 31->33-digit boundary tests
|
||||
dectest: randombound320
|
||||
@@ -0,0 +1,110 @@
|
||||
------------------------------------------------------------------------
|
||||
-- tointegral0.decTest -- round decimal to integral value --
|
||||
-- Copyright (c) IBM Corporation, 2001, 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
|
||||
|
||||
-- This set of tests tests the extended specification 'round-to-integral
|
||||
-- value' operation (from IEEE 854, later modified in 754r).
|
||||
-- All non-zero results are defined as being those from either copy or
|
||||
-- quantize, so those are assumed to have been tested.
|
||||
-- Note that 754r requires that Inexact not be set, and we similarly
|
||||
-- assume Rounded is not set.
|
||||
|
||||
extended: 0
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
int001 tointegral 0 -> 0
|
||||
int002 tointegral 0.0 -> 0
|
||||
int003 tointegral 0.1 -> 0
|
||||
int004 tointegral 0.2 -> 0
|
||||
int005 tointegral 0.3 -> 0
|
||||
int006 tointegral 0.4 -> 0
|
||||
int007 tointegral 0.5 -> 1
|
||||
int008 tointegral 0.6 -> 1
|
||||
int009 tointegral 0.7 -> 1
|
||||
int010 tointegral 0.8 -> 1
|
||||
int011 tointegral 0.9 -> 1
|
||||
int012 tointegral 1 -> 1
|
||||
int013 tointegral 1.0 -> 1
|
||||
int014 tointegral 1.1 -> 1
|
||||
int015 tointegral 1.2 -> 1
|
||||
int016 tointegral 1.3 -> 1
|
||||
int017 tointegral 1.4 -> 1
|
||||
int018 tointegral 1.5 -> 2
|
||||
int019 tointegral 1.6 -> 2
|
||||
int020 tointegral 1.7 -> 2
|
||||
int021 tointegral 1.8 -> 2
|
||||
int022 tointegral 1.9 -> 2
|
||||
-- negatives
|
||||
int031 tointegral -0 -> 0
|
||||
int032 tointegral -0.0 -> 0
|
||||
int033 tointegral -0.1 -> 0
|
||||
int034 tointegral -0.2 -> 0
|
||||
int035 tointegral -0.3 -> 0
|
||||
int036 tointegral -0.4 -> 0
|
||||
int037 tointegral -0.5 -> -1
|
||||
int038 tointegral -0.6 -> -1
|
||||
int039 tointegral -0.7 -> -1
|
||||
int040 tointegral -0.8 -> -1
|
||||
int041 tointegral -0.9 -> -1
|
||||
int042 tointegral -1 -> -1
|
||||
int043 tointegral -1.0 -> -1
|
||||
int044 tointegral -1.1 -> -1
|
||||
int045 tointegral -1.2 -> -1
|
||||
int046 tointegral -1.3 -> -1
|
||||
int047 tointegral -1.4 -> -1
|
||||
int048 tointegral -1.5 -> -2
|
||||
int049 tointegral -1.6 -> -2
|
||||
int050 tointegral -1.7 -> -2
|
||||
int051 tointegral -1.8 -> -2
|
||||
int052 tointegral -1.9 -> -2
|
||||
|
||||
-- numbers around precision
|
||||
precision: 9
|
||||
int060 tointegral '56267E-10' -> '0'
|
||||
int061 tointegral '56267E-5' -> '1'
|
||||
int062 tointegral '56267E-2' -> '563'
|
||||
int063 tointegral '56267E-1' -> '5627'
|
||||
int065 tointegral '56267E-0' -> '56267'
|
||||
int066 tointegral '56267E+0' -> '56267'
|
||||
int067 tointegral '56267E+1' -> '5.6267E+5'
|
||||
int068 tointegral '56267E+2' -> '5.6267E+6'
|
||||
int069 tointegral '56267E+3' -> '5.6267E+7'
|
||||
int070 tointegral '56267E+4' -> '5.6267E+8'
|
||||
int071 tointegral '56267E+5' -> '5.6267E+9'
|
||||
int072 tointegral '56267E+6' -> '5.6267E+10'
|
||||
int073 tointegral '56267E+995' -> '5.6267E+999'
|
||||
|
||||
int080 tointegral '-56267E-10' -> '0'
|
||||
int081 tointegral '-56267E-5' -> '-1'
|
||||
int082 tointegral '-56267E-2' -> '-563'
|
||||
int083 tointegral '-56267E-1' -> '-5627'
|
||||
int085 tointegral '-56267E-0' -> '-56267'
|
||||
int086 tointegral '-56267E+0' -> '-56267'
|
||||
int087 tointegral '-56267E+1' -> '-5.6267E+5'
|
||||
int088 tointegral '-56267E+2' -> '-5.6267E+6'
|
||||
int089 tointegral '-56267E+3' -> '-5.6267E+7'
|
||||
int090 tointegral '-56267E+4' -> '-5.6267E+8'
|
||||
int091 tointegral '-56267E+5' -> '-5.6267E+9'
|
||||
int092 tointegral '-56267E+6' -> '-5.6267E+10'
|
||||
int093 tointegral '-56267E+995' -> '-5.6267E+999'
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
------------------------------------------------------------------------
|
||||
-- trim0.decTest -- remove insignificant trailing zeros (simplified) --
|
||||
-- Copyright (c) IBM Corporation, 2003, 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
|
||||
|
||||
trm001 trim '1' -> '1'
|
||||
trm002 trim '-1' -> '-1'
|
||||
trm003 trim '1.00' -> '1'
|
||||
trm004 trim '-1.00' -> '-1'
|
||||
trm005 trim '0' -> '0'
|
||||
trm006 trim '0.00' -> '0'
|
||||
trm007 trim '00.0' -> '0'
|
||||
trm008 trim '00.00' -> '0'
|
||||
trm009 trim '00' -> '0'
|
||||
|
||||
trm010 trim '-2' -> '-2'
|
||||
trm011 trim '2' -> '2'
|
||||
trm012 trim '-2.00' -> '-2'
|
||||
trm013 trim '2.00' -> '2'
|
||||
trm014 trim '-0' -> '0'
|
||||
trm015 trim '-0.00' -> '0'
|
||||
trm016 trim '-00.0' -> '0'
|
||||
trm017 trim '-00.00' -> '0'
|
||||
trm018 trim '-00' -> '0'
|
||||
trm019 trim '0E+5' -> '0'
|
||||
trm020 trim '-0E+1' -> '0'
|
||||
|
||||
trm030 trim '+0.1' -> '0.1'
|
||||
trm031 trim '-0.1' -> '-0.1'
|
||||
trm032 trim '+0.01' -> '0.01'
|
||||
trm033 trim '-0.01' -> '-0.01'
|
||||
trm034 trim '+0.001' -> '0.001'
|
||||
trm035 trim '-0.001' -> '-0.001'
|
||||
trm036 trim '+0.000001' -> '0.000001'
|
||||
trm037 trim '-0.000001' -> '-0.000001'
|
||||
trm038 trim '+0.000000000001' -> '1E-12'
|
||||
trm039 trim '-0.000000000001' -> '-1E-12'
|
||||
|
||||
trm041 trim 1.1 -> 1.1
|
||||
trm042 trim 1.10 -> 1.1
|
||||
trm043 trim 1.100 -> 1.1
|
||||
trm044 trim 1.110 -> 1.11
|
||||
trm045 trim -1.1 -> -1.1
|
||||
trm046 trim -1.10 -> -1.1
|
||||
trm047 trim -1.100 -> -1.1
|
||||
trm048 trim -1.110 -> -1.11
|
||||
trm049 trim 9.9 -> 9.9
|
||||
trm050 trim 9.90 -> 9.9
|
||||
trm051 trim 9.900 -> 9.9
|
||||
trm052 trim 9.990 -> 9.99
|
||||
trm053 trim -9.9 -> -9.9
|
||||
trm054 trim -9.90 -> -9.9
|
||||
trm055 trim -9.900 -> -9.9
|
||||
trm056 trim -9.990 -> -9.99
|
||||
|
||||
-- some insignificant trailing fractional zeros
|
||||
trm060 trim 10.0 -> 10
|
||||
trm061 trim 10.00 -> 10
|
||||
trm062 trim 100.0 -> 100
|
||||
trm063 trim 100.00 -> 100
|
||||
trm064 trim 1.1000E+3 -> 1100
|
||||
trm065 trim 1.10000E+3 -> 1100
|
||||
trm066 trim -10.0 -> -10
|
||||
trm067 trim -10.00 -> -10
|
||||
trm068 trim -100.0 -> -100
|
||||
trm069 trim -100.00 -> -100
|
||||
trm070 trim -1.1000E+3 -> -1100
|
||||
trm071 trim -1.10000E+3 -> -1100
|
||||
|
||||
-- some insignificant trailing zeros with positive exponent
|
||||
trm080 trim 10E+1 -> 1E+2
|
||||
trm081 trim 100E+1 -> 1E+3
|
||||
trm082 trim 1.0E+2 -> 1E+2
|
||||
trm083 trim 1.0E+3 -> 1E+3
|
||||
trm084 trim 1.1E+3 -> 1.1E+3
|
||||
trm085 trim 1.00E+3 -> 1E+3
|
||||
trm086 trim 1.10E+3 -> 1.1E+3
|
||||
trm087 trim -10E+1 -> -1E+2
|
||||
trm088 trim -100E+1 -> -1E+3
|
||||
trm089 trim -1.0E+2 -> -1E+2
|
||||
trm090 trim -1.0E+3 -> -1E+3
|
||||
trm091 trim -1.1E+3 -> -1.1E+3
|
||||
trm092 trim -1.00E+3 -> -1E+3
|
||||
trm093 trim -1.10E+3 -> -1.1E+3
|
||||
|
||||
-- some significant trailing zeros
|
||||
trm100 trim 11 -> 11
|
||||
trm101 trim 10 -> 10
|
||||
trm102 trim 10. -> 10
|
||||
trm103 trim 1.1E+1 -> 11
|
||||
trm104 trim 1.0E+1 -> 10
|
||||
trm105 trim 1.10E+2 -> 110
|
||||
trm106 trim 1.00E+2 -> 100
|
||||
trm107 trim 1.100E+3 -> 1100
|
||||
trm108 trim 1.000E+3 -> 1000
|
||||
trm109 trim 1.000000E+6 -> 1000000
|
||||
trm110 trim -11 -> -11
|
||||
trm111 trim -10 -> -10
|
||||
trm112 trim -10. -> -10
|
||||
trm113 trim -1.1E+1 -> -11
|
||||
trm114 trim -1.0E+1 -> -10
|
||||
trm115 trim -1.10E+2 -> -110
|
||||
trm116 trim -1.00E+2 -> -100
|
||||
trm117 trim -1.100E+3 -> -1100
|
||||
trm118 trim -1.000E+3 -> -1000
|
||||
trm119 trim -1.000000E+6 -> -1000000
|
||||
|
||||
-- Null test
|
||||
trm400 trim # -> ? Invalid_operation
|
||||
|
||||
Reference in New Issue
Block a user