Repository URL to install this package:
------------------------------------------------------------------------ -- remainderNear.decTest -- decimal remainder-near (IEEE remainder) -- -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. -- ------------------------------------------------------------------------ -- Please see the document "General Decimal Arithmetic Testcases" -- -- at http://www2.hursley.ibm.com/decimal for the description of -- -- these testcases. -- -- -- -- These testcases are experimental ('beta' versions), and they -- -- may contain errors. They are offered on an as-is basis. In -- -- particular, achieving the same results as the tests here is not -- -- a guarantee that an implementation complies with any Standard -- -- or specification. The tests are not exhaustive. -- -- -- -- Please send comments, suggestions, and corrections to the author: -- -- Mike Cowlishaw, IBM Fellow -- -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ version: 2.59 extended: 1 precision: 9 rounding: half_up maxExponent: 384 minexponent: -383 rmnx001 remaindernear 1 1 -> 0 rmnx002 remaindernear 2 1 -> 0 rmnx003 remaindernear 1 2 -> 1 rmnx004 remaindernear 2 2 -> 0 rmnx005 remaindernear 0 1 -> 0 rmnx006 remaindernear 0 2 -> 0 rmnx007 remaindernear 1 3 -> 1 rmnx008 remaindernear 2 3 -> -1 rmnx009 remaindernear 3 3 -> 0 rmnx010 remaindernear 2.4 1 -> 0.4 rmnx011 remaindernear 2.4 -1 -> 0.4 rmnx012 remaindernear -2.4 1 -> -0.4 rmnx013 remaindernear -2.4 -1 -> -0.4 rmnx014 remaindernear 2.40 1 -> 0.40 rmnx015 remaindernear 2.400 1 -> 0.400 rmnx016 remaindernear 2.4 2 -> 0.4 rmnx017 remaindernear 2.400 2 -> 0.400 rmnx018 remaindernear 2. 2 -> 0 rmnx019 remaindernear 20 20 -> 0 rmnx020 remaindernear 187 187 -> 0 rmnx021 remaindernear 5 2 -> 1 rmnx022 remaindernear 5 2.0 -> 1.0 rmnx023 remaindernear 5 2.000 -> 1.000 rmnx024 remaindernear 5 0.200 -> 0.000 rmnx025 remaindernear 5 0.200 -> 0.000 rmnx030 remaindernear 1 2 -> 1 rmnx031 remaindernear 1 4 -> 1 rmnx032 remaindernear 1 8 -> 1 rmnx033 remaindernear 1 16 -> 1 rmnx034 remaindernear 1 32 -> 1 rmnx035 remaindernear 1 64 -> 1 rmnx040 remaindernear 1 -2 -> 1 rmnx041 remaindernear 1 -4 -> 1 rmnx042 remaindernear 1 -8 -> 1 rmnx043 remaindernear 1 -16 -> 1 rmnx044 remaindernear 1 -32 -> 1 rmnx045 remaindernear 1 -64 -> 1 rmnx050 remaindernear -1 2 -> -1 rmnx051 remaindernear -1 4 -> -1 rmnx052 remaindernear -1 8 -> -1 rmnx053 remaindernear -1 16 -> -1 rmnx054 remaindernear -1 32 -> -1 rmnx055 remaindernear -1 64 -> -1 rmnx060 remaindernear -1 -2 -> -1 rmnx061 remaindernear -1 -4 -> -1 rmnx062 remaindernear -1 -8 -> -1 rmnx063 remaindernear -1 -16 -> -1 rmnx064 remaindernear -1 -32 -> -1 rmnx065 remaindernear -1 -64 -> -1 rmnx066 remaindernear 999999997 1 -> 0 rmnx067 remaindernear 999999997.4 1 -> 0.4 rmnx068 remaindernear 999999997.5 1 -> -0.5 rmnx069 remaindernear 999999997.9 1 -> -0.1 rmnx070 remaindernear 999999997.999 1 -> -0.001 rmnx071 remaindernear 999999998 1 -> 0 rmnx072 remaindernear 999999998.4 1 -> 0.4 rmnx073 remaindernear 999999998.5 1 -> 0.5 rmnx074 remaindernear 999999998.9 1 -> -0.1 rmnx075 remaindernear 999999998.999 1 -> -0.001 rmnx076 remaindernear 999999999 1 -> 0 rmnx077 remaindernear 999999999.4 1 -> 0.4 rmnx078 remaindernear 999999999.5 1 -> NaN Division_impossible rmnx079 remaindernear 999999999.9 1 -> NaN Division_impossible rmnx080 remaindernear 999999999.999 1 -> NaN Division_impossible precision: 6 rmnx081 remaindernear 999999999 1 -> NaN Division_impossible rmnx082 remaindernear 99999999 1 -> NaN Division_impossible rmnx083 remaindernear 9999999 1 -> NaN Division_impossible rmnx084 remaindernear 999999 1 -> 0 rmnx085 remaindernear 99999 1 -> 0 rmnx086 remaindernear 9999 1 -> 0 rmnx087 remaindernear 999 1 -> 0 rmnx088 remaindernear 99 1 -> 0 rmnx089 remaindernear 9 1 -> 0 precision: 9 rmnx090 remaindernear 0. 1 -> 0 rmnx091 remaindernear .0 1 -> 0.0 rmnx092 remaindernear 0.00 1 -> 0.00 rmnx093 remaindernear 0.00E+9 1 -> 0 rmnx094 remaindernear 0.0000E-50 1 -> 0E-54 -- Various flavours of remaindernear by 0 precision: 9 maxexponent: 999999999 minexponent: -999999999 rmnx101 remaindernear 0 0 -> NaN Division_undefined rmnx102 remaindernear 0 -0 -> NaN Division_undefined rmnx103 remaindernear -0 0 -> NaN Division_undefined rmnx104 remaindernear -0 -0 -> NaN Division_undefined rmnx105 remaindernear 0.0E5 0 -> NaN Division_undefined rmnx106 remaindernear 0.000 0 -> NaN Division_undefined -- [Some think this next group should be Division_by_zero exception, -- but IEEE 854 is explicit that it is Invalid operation .. for -- remaindernear-near, anyway] rmnx107 remaindernear 0.0001 0 -> NaN Invalid_operation rmnx108 remaindernear 0.01 0 -> NaN Invalid_operation rmnx109 remaindernear 0.1 0 -> NaN Invalid_operation rmnx110 remaindernear 1 0 -> NaN Invalid_operation rmnx111 remaindernear 1 0.0 -> NaN Invalid_operation rmnx112 remaindernear 10 0.0 -> NaN Invalid_operation rmnx113 remaindernear 1E+100 0.0 -> NaN Invalid_operation rmnx114 remaindernear 1E+1000 0 -> NaN Invalid_operation rmnx115 remaindernear 0.0001 -0 -> NaN Invalid_operation rmnx116 remaindernear 0.01 -0 -> NaN Invalid_operation rmnx119 remaindernear 0.1 -0 -> NaN Invalid_operation rmnx120 remaindernear 1 -0 -> NaN Invalid_operation rmnx121 remaindernear 1 -0.0 -> NaN Invalid_operation rmnx122 remaindernear 10 -0.0 -> NaN Invalid_operation rmnx123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation rmnx124 remaindernear 1E+1000 -0 -> NaN Invalid_operation -- and zeros on left rmnx130 remaindernear 0 1 -> 0 rmnx131 remaindernear 0 -1 -> 0 rmnx132 remaindernear 0.0 1 -> 0.0 rmnx133 remaindernear 0.0 -1 -> 0.0 rmnx134 remaindernear -0 1 -> -0 rmnx135 remaindernear -0 -1 -> -0 rmnx136 remaindernear -0.0 1 -> -0.0 rmnx137 remaindernear -0.0 -1 -> -0.0 -- 0.5ers rmmx143 remaindernear 0.5 2 -> 0.5 rmmx144 remaindernear 0.5 2.1 -> 0.5 rmmx145 remaindernear 0.5 2.01 -> 0.50 rmmx146 remaindernear 0.5 2.001 -> 0.500 rmmx147 remaindernear 0.50 2 -> 0.50 rmmx148 remaindernear 0.50 2.01 -> 0.50 rmmx149 remaindernear 0.50 2.001 -> 0.500 -- some differences from remainder rmnx150 remaindernear 0.4 1.020 -> 0.400 rmnx151 remaindernear 0.50 1.020 -> 0.500 rmnx152 remaindernear 0.51 1.020 -> 0.510 rmnx153 remaindernear 0.52 1.020 -> -0.500 rmnx154 remaindernear 0.6 1.020 -> -0.420 rmnx155 remaindernear 0.49 1 -> 0.49 rmnx156 remaindernear 0.50 1 -> 0.50 rmnx157 remaindernear 1.50 1 -> -0.50 rmnx158 remaindernear 2.50 1 -> 0.50 rmnx159 remaindernear 9.50 1 -> -0.50 rmnx160 remaindernear 0.51 1 -> -0.49 -- the nasty division-by-1 cases rmnx161 remaindernear 0.4 1 -> 0.4 rmnx162 remaindernear 0.45 1 -> 0.45 rmnx163 remaindernear 0.455 1 -> 0.455 rmnx164 remaindernear 0.4555 1 -> 0.4555 rmnx165 remaindernear 0.45555 1 -> 0.45555 rmnx166 remaindernear 0.455555 1 -> 0.455555 rmnx167 remaindernear 0.4555555 1 -> 0.4555555 rmnx168 remaindernear 0.45555555 1 -> 0.45555555 rmnx169 remaindernear 0.455555555 1 -> 0.455555555 -- with spill... rmnx171 remaindernear 0.5 1 -> 0.5 rmnx172 remaindernear 0.55 1 -> -0.45 rmnx173 remaindernear 0.555 1 -> -0.445 rmnx174 remaindernear 0.5555 1 -> -0.4445 rmnx175 remaindernear 0.55555 1 -> -0.44445 rmnx176 remaindernear 0.555555 1 -> -0.444445 rmnx177 remaindernear 0.5555555 1 -> -0.4444445 rmnx178 remaindernear 0.55555555 1 -> -0.44444445 rmnx179 remaindernear 0.555555555 1 -> -0.444444445 -- progression rmnx180 remaindernear 1 1 -> 0 rmnx181 remaindernear 1 2 -> 1 rmnx182 remaindernear 1 3 -> 1 rmnx183 remaindernear 1 4 -> 1 rmnx184 remaindernear 1 5 -> 1 rmnx185 remaindernear 1 6 -> 1 rmnx186 remaindernear 1 7 -> 1 rmnx187 remaindernear 1 8 -> 1 rmnx188 remaindernear 1 9 -> 1 rmnx189 remaindernear 1 10 -> 1 rmnx190 remaindernear 1 1 -> 0 rmnx191 remaindernear 2 1 -> 0 rmnx192 remaindernear 3 1 -> 0 rmnx193 remaindernear 4 1 -> 0 rmnx194 remaindernear 5 1 -> 0 rmnx195 remaindernear 6 1 -> 0 rmnx196 remaindernear 7 1 -> 0 rmnx197 remaindernear 8 1 -> 0 rmnx198 remaindernear 9 1 -> 0 rmnx199 remaindernear 10 1 -> 0 -- Various flavours of remaindernear by 0 maxexponent: 999999999 minexponent: -999999999 rmnx201 remaindernear 0 0 -> NaN Division_undefined rmnx202 remaindernear 0.0E5 0 -> NaN Division_undefined rmnx203 remaindernear 0.000 0 -> NaN Division_undefined rmnx204 remaindernear 0.0001 0 -> NaN Invalid_operation rmnx205 remaindernear 0.01 0 -> NaN Invalid_operation rmnx206 remaindernear 0.1 0 -> NaN Invalid_operation rmnx207 remaindernear 1 0 -> NaN Invalid_operation rmnx208 remaindernear 1 0.0 -> NaN Invalid_operation rmnx209 remaindernear 10 0.0 -> NaN Invalid_operation rmnx210 remaindernear 1E+100 0.0 -> NaN Invalid_operation rmnx211 remaindernear 1E+1000 0 -> NaN Invalid_operation -- tests from the extended specification rmnx221 remaindernear 2.1 3 -> -0.9 rmnx222 remaindernear 10 6 -> -2 rmnx223 remaindernear 10 3 -> 1 rmnx224 remaindernear -10 3 -> -1 rmnx225 remaindernear 10.2 1 -> 0.2 rmnx226 remaindernear 10 0.3 -> 0.1 rmnx227 remaindernear 3.6 1.3 -> -0.3 -- some differences from remainder rmnx231 remaindernear 0.4 1.020 -> 0.400 rmnx232 remaindernear 0.50 1.020 -> 0.500 rmnx233 remaindernear 0.51 1.020 -> 0.510 rmnx234 remaindernear 0.52 1.020 -> -0.500 rmnx235 remaindernear 0.6 1.020 -> -0.420 -- test some cases that are close to exponent overflow maxexponent: 999999999 minexponent: -999999999 rmnx270 remaindernear 1 1e999999999 -> 1 rmnx271 remaindernear 1 0.9e999999999 -> 1 rmnx272 remaindernear 1 0.99e999999999 -> 1 rmnx273 remaindernear 1 0.999999999e999999999 -> 1 rmnx274 remaindernear 9e999999999 1 -> NaN Division_impossible rmnx275 remaindernear 9.9e999999999 1 -> NaN Division_impossible rmnx276 remaindernear 9.99e999999999 1 -> NaN Division_impossible rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible rmnx280 remaindernear 0.1 9e-999999999 -> NaN Division_impossible rmnx281 remaindernear 0.1 99e-999999999 -> NaN Division_impossible rmnx282 remaindernear 0.1 999e-999999999 -> NaN Division_impossible rmnx283 remaindernear 0.1 9e-999999998 -> NaN Division_impossible rmnx284 remaindernear 0.1 99e-999999998 -> NaN Division_impossible rmnx285 remaindernear 0.1 999e-999999998 -> NaN Division_impossible rmnx286 remaindernear 0.1 999e-999999997 -> NaN Division_impossible rmnx287 remaindernear 0.1 9999e-999999997 -> NaN Division_impossible rmnx288 remaindernear 0.1 99999e-999999997 -> NaN Division_impossible -- rmnx3xx are from DiagBigDecimal rmnx301 remaindernear 1 3 -> 1 rmnx302 remaindernear 5 5 -> 0 rmnx303 remaindernear 13 10 -> 3 rmnx304 remaindernear 13 50 -> 13 rmnx305 remaindernear 13 100 -> 13 rmnx306 remaindernear 13 1000 -> 13 rmnx307 remaindernear .13 1 -> 0.13 rmnx308 remaindernear 0.133 1 -> 0.133 rmnx309 remaindernear 0.1033 1 -> 0.1033 rmnx310 remaindernear 1.033 1 -> 0.033 rmnx311 remaindernear 10.33 1 -> 0.33 rmnx312 remaindernear 10.33 10 -> 0.33 rmnx313 remaindernear 103.3 1 -> 0.3 rmnx314 remaindernear 133 10 -> 3 rmnx315 remaindernear 1033 10 -> 3 rmnx316 remaindernear 1033 50 -> -17 rmnx317 remaindernear 101.0 3 -> -1.0 rmnx318 remaindernear 102.0 3 -> 0.0 rmnx319 remaindernear 103.0 3 -> 1.0 rmnx320 remaindernear 2.40 1 -> 0.40 rmnx321 remaindernear 2.400 1 -> 0.400 rmnx322 remaindernear 2.4 1 -> 0.4 rmnx323 remaindernear 2.4 2 -> 0.4 rmnx324 remaindernear 2.400 2 -> 0.400 rmnx325 remaindernear 1 0.3 -> 0.1 rmnx326 remaindernear 1 0.30 -> 0.10 rmnx327 remaindernear 1 0.300 -> 0.100 rmnx328 remaindernear 1 0.3000 -> 0.1000 rmnx329 remaindernear 1.0 0.3 -> 0.1 rmnx330 remaindernear 1.00 0.3 -> 0.10 rmnx331 remaindernear 1.000 0.3 -> 0.100 rmnx332 remaindernear 1.0000 0.3 -> 0.1000 rmnx333 remaindernear 0.5 2 -> 0.5 rmnx334 remaindernear 0.5 2.1 -> 0.5 rmnx335 remaindernear 0.5 2.01 -> 0.50 rmnx336 remaindernear 0.5 2.001 -> 0.500 rmnx337 remaindernear 0.50 2 -> 0.50 rmnx338 remaindernear 0.50 2.01 -> 0.50 rmnx339 remaindernear 0.50 2.001 -> 0.500 rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 rmnx341 remaindernear 0.5 0.50000001 -> -1E-8 rmnx342 remaindernear 0.5 0.500000001 -> -1E-9 rmnx343 remaindernear 0.5 0.5000000001 -> -1E-10 rmnx344 remaindernear 0.5 0.50000000001 -> -1E-11 rmnx345 remaindernear 0.5 0.4999999 -> 1E-7 rmnx346 remaindernear 0.5 0.49999999 -> 1E-8 rmnx347 remaindernear 0.5 0.499999999 -> 1E-9 rmnx348 remaindernear 0.5 0.4999999999 -> 1E-10 rmnx349 remaindernear 0.5 0.49999999999 -> 1E-11 rmnx350 remaindernear 0.03 7 -> 0.03 rmnx351 remaindernear 5 2 -> 1 rmnx352 remaindernear 4.1 2 -> 0.1 rmnx353 remaindernear 4.01 2 -> 0.01 rmnx354 remaindernear 4.001 2 -> 0.001 rmnx355 remaindernear 4.0001 2 -> 0.0001 rmnx356 remaindernear 4.00001 2 -> 0.00001 rmnx357 remaindernear 4.000001 2 -> 0.000001 rmnx358 remaindernear 4.0000001 2 -> 1E-7 rmnx360 remaindernear 1.2 0.7345 -> -0.2690 rmnx361 remaindernear 0.8 12 -> 0.8 rmnx362 remaindernear 0.8 0.2 -> 0.0 rmnx363 remaindernear 0.8 0.3 -> -0.1 rmnx364 remaindernear 0.800 12 -> 0.800 rmnx365 remaindernear 0.800 1.7 -> 0.800 rmnx366 remaindernear 2.400 2 -> 0.400Loading ...