remainder.decTest 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. ------------------------------------------------------------------------
  2. -- remainder.decTest -- decimal remainder --
  3. -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
  4. ------------------------------------------------------------------------
  5. -- Please see the document "General Decimal Arithmetic Testcases" --
  6. -- at http://www2.hursley.ibm.com/decimal for the description of --
  7. -- these testcases. --
  8. -- --
  9. -- These testcases are experimental ('beta' versions), and they --
  10. -- may contain errors. They are offered on an as-is basis. In --
  11. -- particular, achieving the same results as the tests here is not --
  12. -- a guarantee that an implementation complies with any Standard --
  13. -- or specification. The tests are not exhaustive. --
  14. -- --
  15. -- Please send comments, suggestions, and corrections to the author: --
  16. -- Mike Cowlishaw, IBM Fellow --
  17. -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
  18. -- mfc@uk.ibm.com --
  19. ------------------------------------------------------------------------
  20. version: 2.59
  21. extended: 1
  22. precision: 9
  23. rounding: half_up
  24. maxExponent: 384
  25. minexponent: -383
  26. -- sanity checks (as base, above)
  27. remx001 remainder 1 1 -> 0
  28. remx002 remainder 2 1 -> 0
  29. remx003 remainder 1 2 -> 1
  30. remx004 remainder 2 2 -> 0
  31. remx005 remainder 0 1 -> 0
  32. remx006 remainder 0 2 -> 0
  33. remx007 remainder 1 3 -> 1
  34. remx008 remainder 2 3 -> 2
  35. remx009 remainder 3 3 -> 0
  36. remx010 remainder 2.4 1 -> 0.4
  37. remx011 remainder 2.4 -1 -> 0.4
  38. remx012 remainder -2.4 1 -> -0.4
  39. remx013 remainder -2.4 -1 -> -0.4
  40. remx014 remainder 2.40 1 -> 0.40
  41. remx015 remainder 2.400 1 -> 0.400
  42. remx016 remainder 2.4 2 -> 0.4
  43. remx017 remainder 2.400 2 -> 0.400
  44. remx018 remainder 2. 2 -> 0
  45. remx019 remainder 20 20 -> 0
  46. remx020 remainder 187 187 -> 0
  47. remx021 remainder 5 2 -> 1
  48. remx022 remainder 5 2.0 -> 1.0
  49. remx023 remainder 5 2.000 -> 1.000
  50. remx024 remainder 5 0.200 -> 0.000
  51. remx025 remainder 5 0.200 -> 0.000
  52. remx030 remainder 1 2 -> 1
  53. remx031 remainder 1 4 -> 1
  54. remx032 remainder 1 8 -> 1
  55. remx033 remainder 1 16 -> 1
  56. remx034 remainder 1 32 -> 1
  57. remx035 remainder 1 64 -> 1
  58. remx040 remainder 1 -2 -> 1
  59. remx041 remainder 1 -4 -> 1
  60. remx042 remainder 1 -8 -> 1
  61. remx043 remainder 1 -16 -> 1
  62. remx044 remainder 1 -32 -> 1
  63. remx045 remainder 1 -64 -> 1
  64. remx050 remainder -1 2 -> -1
  65. remx051 remainder -1 4 -> -1
  66. remx052 remainder -1 8 -> -1
  67. remx053 remainder -1 16 -> -1
  68. remx054 remainder -1 32 -> -1
  69. remx055 remainder -1 64 -> -1
  70. remx060 remainder -1 -2 -> -1
  71. remx061 remainder -1 -4 -> -1
  72. remx062 remainder -1 -8 -> -1
  73. remx063 remainder -1 -16 -> -1
  74. remx064 remainder -1 -32 -> -1
  75. remx065 remainder -1 -64 -> -1
  76. remx066 remainder 999999999 1 -> 0
  77. remx067 remainder 999999999.4 1 -> 0.4
  78. remx068 remainder 999999999.5 1 -> 0.5
  79. remx069 remainder 999999999.9 1 -> 0.9
  80. remx070 remainder 999999999.999 1 -> 0.999
  81. precision: 6
  82. remx071 remainder 999999999 1 -> NaN Division_impossible
  83. remx072 remainder 99999999 1 -> NaN Division_impossible
  84. remx073 remainder 9999999 1 -> NaN Division_impossible
  85. remx074 remainder 999999 1 -> 0
  86. remx075 remainder 99999 1 -> 0
  87. remx076 remainder 9999 1 -> 0
  88. remx077 remainder 999 1 -> 0
  89. remx078 remainder 99 1 -> 0
  90. remx079 remainder 9 1 -> 0
  91. precision: 9
  92. remx080 remainder 0. 1 -> 0
  93. remx081 remainder .0 1 -> 0.0
  94. remx082 remainder 0.00 1 -> 0.00
  95. remx083 remainder 0.00E+9 1 -> 0
  96. remx084 remainder 0.00E+3 1 -> 0
  97. remx085 remainder 0.00E+2 1 -> 0
  98. remx086 remainder 0.00E+1 1 -> 0.0
  99. remx087 remainder 0.00E+0 1 -> 0.00
  100. remx088 remainder 0.00E-0 1 -> 0.00
  101. remx089 remainder 0.00E-1 1 -> 0.000
  102. remx090 remainder 0.00E-2 1 -> 0.0000
  103. remx091 remainder 0.00E-3 1 -> 0.00000
  104. remx092 remainder 0.00E-4 1 -> 0.000000
  105. remx093 remainder 0.00E-5 1 -> 0E-7
  106. remx094 remainder 0.00E-6 1 -> 0E-8
  107. remx095 remainder 0.0000E-50 1 -> 0E-54
  108. -- Various flavours of remainder by 0
  109. precision: 9
  110. maxexponent: 999999999
  111. minexponent: -999999999
  112. remx101 remainder 0 0 -> NaN Division_undefined
  113. remx102 remainder 0 -0 -> NaN Division_undefined
  114. remx103 remainder -0 0 -> NaN Division_undefined
  115. remx104 remainder -0 -0 -> NaN Division_undefined
  116. remx105 remainder 0.0E5 0 -> NaN Division_undefined
  117. remx106 remainder 0.000 0 -> NaN Division_undefined
  118. -- [Some think this next group should be Division_by_zero exception, but
  119. -- IEEE 854 is explicit that it is Invalid operation .. for
  120. -- remainder-near, anyway]
  121. remx107 remainder 0.0001 0 -> NaN Invalid_operation
  122. remx108 remainder 0.01 0 -> NaN Invalid_operation
  123. remx109 remainder 0.1 0 -> NaN Invalid_operation
  124. remx110 remainder 1 0 -> NaN Invalid_operation
  125. remx111 remainder 1 0.0 -> NaN Invalid_operation
  126. remx112 remainder 10 0.0 -> NaN Invalid_operation
  127. remx113 remainder 1E+100 0.0 -> NaN Invalid_operation
  128. remx114 remainder 1E+1000 0 -> NaN Invalid_operation
  129. remx115 remainder 0.0001 -0 -> NaN Invalid_operation
  130. remx116 remainder 0.01 -0 -> NaN Invalid_operation
  131. remx119 remainder 0.1 -0 -> NaN Invalid_operation
  132. remx120 remainder 1 -0 -> NaN Invalid_operation
  133. remx121 remainder 1 -0.0 -> NaN Invalid_operation
  134. remx122 remainder 10 -0.0 -> NaN Invalid_operation
  135. remx123 remainder 1E+100 -0.0 -> NaN Invalid_operation
  136. remx124 remainder 1E+1000 -0 -> NaN Invalid_operation
  137. -- and zeros on left
  138. remx130 remainder 0 1 -> 0
  139. remx131 remainder 0 -1 -> 0
  140. remx132 remainder 0.0 1 -> 0.0
  141. remx133 remainder 0.0 -1 -> 0.0
  142. remx134 remainder -0 1 -> -0
  143. remx135 remainder -0 -1 -> -0
  144. remx136 remainder -0.0 1 -> -0.0
  145. remx137 remainder -0.0 -1 -> -0.0
  146. -- 0.5ers
  147. remx143 remainder 0.5 2 -> 0.5
  148. remx144 remainder 0.5 2.1 -> 0.5
  149. remx145 remainder 0.5 2.01 -> 0.50
  150. remx146 remainder 0.5 2.001 -> 0.500
  151. remx147 remainder 0.50 2 -> 0.50
  152. remx148 remainder 0.50 2.01 -> 0.50
  153. remx149 remainder 0.50 2.001 -> 0.500
  154. -- steadies
  155. remx150 remainder 1 1 -> 0
  156. remx151 remainder 1 2 -> 1
  157. remx152 remainder 1 3 -> 1
  158. remx153 remainder 1 4 -> 1
  159. remx154 remainder 1 5 -> 1
  160. remx155 remainder 1 6 -> 1
  161. remx156 remainder 1 7 -> 1
  162. remx157 remainder 1 8 -> 1
  163. remx158 remainder 1 9 -> 1
  164. remx159 remainder 1 10 -> 1
  165. remx160 remainder 1 1 -> 0
  166. remx161 remainder 2 1 -> 0
  167. remx162 remainder 3 1 -> 0
  168. remx163 remainder 4 1 -> 0
  169. remx164 remainder 5 1 -> 0
  170. remx165 remainder 6 1 -> 0
  171. remx166 remainder 7 1 -> 0
  172. remx167 remainder 8 1 -> 0
  173. remx168 remainder 9 1 -> 0
  174. remx169 remainder 10 1 -> 0
  175. -- some differences from remainderNear
  176. remx171 remainder 0.4 1.020 -> 0.400
  177. remx172 remainder 0.50 1.020 -> 0.500
  178. remx173 remainder 0.51 1.020 -> 0.510
  179. remx174 remainder 0.52 1.020 -> 0.520
  180. remx175 remainder 0.6 1.020 -> 0.600
  181. -- More flavours of remainder by 0
  182. maxexponent: 999999999
  183. minexponent: -999999999
  184. remx201 remainder 0 0 -> NaN Division_undefined
  185. remx202 remainder 0.0E5 0 -> NaN Division_undefined
  186. remx203 remainder 0.000 0 -> NaN Division_undefined
  187. remx204 remainder 0.0001 0 -> NaN Invalid_operation
  188. remx205 remainder 0.01 0 -> NaN Invalid_operation
  189. remx206 remainder 0.1 0 -> NaN Invalid_operation
  190. remx207 remainder 1 0 -> NaN Invalid_operation
  191. remx208 remainder 1 0.0 -> NaN Invalid_operation
  192. remx209 remainder 10 0.0 -> NaN Invalid_operation
  193. remx210 remainder 1E+100 0.0 -> NaN Invalid_operation
  194. remx211 remainder 1E+1000 0 -> NaN Invalid_operation
  195. -- some differences from remainderNear
  196. remx231 remainder -0.4 1.020 -> -0.400
  197. remx232 remainder -0.50 1.020 -> -0.500
  198. remx233 remainder -0.51 1.020 -> -0.510
  199. remx234 remainder -0.52 1.020 -> -0.520
  200. remx235 remainder -0.6 1.020 -> -0.600
  201. -- high Xs
  202. remx240 remainder 1E+2 1.00 -> 0.00
  203. -- test some cases that are close to exponent overflow
  204. maxexponent: 999999999
  205. minexponent: -999999999
  206. remx270 remainder 1 1e999999999 -> 1
  207. remx271 remainder 1 0.9e999999999 -> 1
  208. remx272 remainder 1 0.99e999999999 -> 1
  209. remx273 remainder 1 0.999999999e999999999 -> 1
  210. remx274 remainder 9e999999999 1 -> NaN Division_impossible
  211. remx275 remainder 9.9e999999999 1 -> NaN Division_impossible
  212. remx276 remainder 9.99e999999999 1 -> NaN Division_impossible
  213. remx277 remainder 9.99999999e999999999 1 -> NaN Division_impossible
  214. remx280 remainder 0.1 9e-999999999 -> NaN Division_impossible
  215. remx281 remainder 0.1 99e-999999999 -> NaN Division_impossible
  216. remx282 remainder 0.1 999e-999999999 -> NaN Division_impossible
  217. remx283 remainder 0.1 9e-999999998 -> NaN Division_impossible
  218. remx284 remainder 0.1 99e-999999998 -> NaN Division_impossible
  219. remx285 remainder 0.1 999e-999999998 -> NaN Division_impossible
  220. remx286 remainder 0.1 999e-999999997 -> NaN Division_impossible
  221. remx287 remainder 0.1 9999e-999999997 -> NaN Division_impossible
  222. remx288 remainder 0.1 99999e-999999997 -> NaN Division_impossible
  223. -- remx3xx are from DiagBigDecimal
  224. remx301 remainder 1 3 -> 1
  225. remx302 remainder 5 5 -> 0
  226. remx303 remainder 13 10 -> 3
  227. remx304 remainder 13 50 -> 13
  228. remx305 remainder 13 100 -> 13
  229. remx306 remainder 13 1000 -> 13
  230. remx307 remainder .13 1 -> 0.13
  231. remx308 remainder 0.133 1 -> 0.133
  232. remx309 remainder 0.1033 1 -> 0.1033
  233. remx310 remainder 1.033 1 -> 0.033
  234. remx311 remainder 10.33 1 -> 0.33
  235. remx312 remainder 10.33 10 -> 0.33
  236. remx313 remainder 103.3 1 -> 0.3
  237. remx314 remainder 133 10 -> 3
  238. remx315 remainder 1033 10 -> 3
  239. remx316 remainder 1033 50 -> 33
  240. remx317 remainder 101.0 3 -> 2.0
  241. remx318 remainder 102.0 3 -> 0.0
  242. remx319 remainder 103.0 3 -> 1.0
  243. remx320 remainder 2.40 1 -> 0.40
  244. remx321 remainder 2.400 1 -> 0.400
  245. remx322 remainder 2.4 1 -> 0.4
  246. remx323 remainder 2.4 2 -> 0.4
  247. remx324 remainder 2.400 2 -> 0.400
  248. remx325 remainder 1 0.3 -> 0.1
  249. remx326 remainder 1 0.30 -> 0.10
  250. remx327 remainder 1 0.300 -> 0.100
  251. remx328 remainder 1 0.3000 -> 0.1000
  252. remx329 remainder 1.0 0.3 -> 0.1
  253. remx330 remainder 1.00 0.3 -> 0.10
  254. remx331 remainder 1.000 0.3 -> 0.100
  255. remx332 remainder 1.0000 0.3 -> 0.1000
  256. remx333 remainder 0.5 2 -> 0.5
  257. remx334 remainder 0.5 2.1 -> 0.5
  258. remx335 remainder 0.5 2.01 -> 0.50
  259. remx336 remainder 0.5 2.001 -> 0.500
  260. remx337 remainder 0.50 2 -> 0.50
  261. remx338 remainder 0.50 2.01 -> 0.50
  262. remx339 remainder 0.50 2.001 -> 0.500
  263. remx340 remainder 0.5 0.5000001 -> 0.5000000
  264. remx341 remainder 0.5 0.50000001 -> 0.50000000
  265. remx342 remainder 0.5 0.500000001 -> 0.500000000
  266. remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded
  267. remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded
  268. remx345 remainder 0.5 0.4999999 -> 1E-7
  269. remx346 remainder 0.5 0.49999999 -> 1E-8
  270. remx347 remainder 0.5 0.499999999 -> 1E-9
  271. remx348 remainder 0.5 0.4999999999 -> 1E-10
  272. remx349 remainder 0.5 0.49999999999 -> 1E-11
  273. remx350 remainder 0.5 0.499999999999 -> 1E-12
  274. remx351 remainder 0.03 7 -> 0.03
  275. remx352 remainder 5 2 -> 1
  276. remx353 remainder 4.1 2 -> 0.1
  277. remx354 remainder 4.01 2 -> 0.01
  278. remx355 remainder 4.001 2 -> 0.001
  279. remx356 remainder 4.0001 2 -> 0.0001
  280. remx357 remainder 4.00001 2 -> 0.00001
  281. remx358 remainder 4.000001 2 -> 0.000001
  282. remx359 remainder 4.0000001 2 -> 1E-7
  283. remx360 remainder 1.2 0.7345 -> 0.4655
  284. remx361 remainder 0.8 12 -> 0.8
  285. remx362 remainder 0.8 0.2 -> 0.0
  286. remx363 remainder 0.8 0.3 -> 0.2
  287. remx364 remainder 0.800 12 -> 0.800
  288. remx365 remainder 0.800 1.7 -> 0.800
  289. remx366 remainder 2.400 2 -> 0.400
  290. precision: 6
  291. remx371 remainder 2.400 2 -> 0.400
  292. precision: 3
  293. -- long operand, rounded, case
  294. remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded
  295. -- 12000000000000
  296. precision: 5
  297. remx381 remainder 12345 1 -> 0
  298. remx382 remainder 12345 1.0001 -> 0.7657
  299. remx383 remainder 12345 1.001 -> 0.668
  300. remx384 remainder 12345 1.01 -> 0.78
  301. remx385 remainder 12345 1.1 -> 0.8
  302. remx386 remainder 12355 4 -> 3
  303. remx387 remainder 12345 4 -> 1
  304. remx388 remainder 12355 4.0001 -> 2.6912
  305. remx389 remainder 12345 4.0001 -> 0.6914
  306. remx390 remainder 12345 4.9 -> 1.9
  307. remx391 remainder 12345 4.99 -> 4.73
  308. remx392 remainder 12345 4.999 -> 2.469
  309. remx393 remainder 12345 4.9999 -> 0.2469
  310. remx394 remainder 12345 5 -> 0
  311. remx395 remainder 12345 5.0001 -> 4.7532
  312. remx396 remainder 12345 5.001 -> 2.532
  313. remx397 remainder 12345 5.01 -> 0.36
  314. remx398 remainder 12345 5.1 -> 3.0
  315. precision: 9
  316. -- the nasty division-by-1 cases
  317. remx401 remainder 0.5 1 -> 0.5
  318. remx402 remainder 0.55 1 -> 0.55
  319. remx403 remainder 0.555 1 -> 0.555
  320. remx404 remainder 0.5555 1 -> 0.5555
  321. remx405 remainder 0.55555 1 -> 0.55555
  322. remx406 remainder 0.555555 1 -> 0.555555
  323. remx407 remainder 0.5555555 1 -> 0.5555555
  324. remx408 remainder 0.55555555 1 -> 0.55555555
  325. remx409 remainder 0.555555555 1 -> 0.555555555
  326. -- zero signs
  327. remx650 remainder 1 1 -> 0
  328. remx651 remainder -1 1 -> -0
  329. remx652 remainder 1 -1 -> 0
  330. remx653 remainder -1 -1 -> -0
  331. remx654 remainder 0 1 -> 0
  332. remx655 remainder -0 1 -> -0
  333. remx656 remainder 0 -1 -> 0
  334. remx657 remainder -0 -1 -> -0
  335. remx658 remainder 0.00 1 -> 0.00
  336. remx659 remainder -0.00 1 -> -0.00
  337. -- Specials
  338. remx680 remainder Inf -Inf -> NaN Invalid_operation
  339. remx681 remainder Inf -1000 -> NaN Invalid_operation
  340. remx682 remainder Inf -1 -> NaN Invalid_operation
  341. remx683 remainder Inf 0 -> NaN Invalid_operation
  342. remx684 remainder Inf -0 -> NaN Invalid_operation
  343. remx685 remainder Inf 1 -> NaN Invalid_operation
  344. remx686 remainder Inf 1000 -> NaN Invalid_operation
  345. remx687 remainder Inf Inf -> NaN Invalid_operation
  346. remx688 remainder -1000 Inf -> -1000
  347. remx689 remainder -Inf Inf -> NaN Invalid_operation
  348. remx691 remainder -1 Inf -> -1
  349. remx692 remainder 0 Inf -> 0
  350. remx693 remainder -0 Inf -> -0
  351. remx694 remainder 1 Inf -> 1
  352. remx695 remainder 1000 Inf -> 1000
  353. remx696 remainder Inf Inf -> NaN Invalid_operation
  354. remx700 remainder -Inf -Inf -> NaN Invalid_operation
  355. remx701 remainder -Inf -1000 -> NaN Invalid_operation
  356. remx702 remainder -Inf -1 -> NaN Invalid_operation
  357. remx703 remainder -Inf -0 -> NaN Invalid_operation
  358. remx704 remainder -Inf 0 -> NaN Invalid_operation
  359. remx705 remainder -Inf 1 -> NaN Invalid_operation
  360. remx706 remainder -Inf 1000 -> NaN Invalid_operation
  361. remx707 remainder -Inf Inf -> NaN Invalid_operation
  362. remx708 remainder -Inf -Inf -> NaN Invalid_operation
  363. remx709 remainder -1000 Inf -> -1000
  364. remx710 remainder -1 -Inf -> -1
  365. remx711 remainder -0 -Inf -> -0
  366. remx712 remainder 0 -Inf -> 0
  367. remx713 remainder 1 -Inf -> 1
  368. remx714 remainder 1000 -Inf -> 1000
  369. remx715 remainder Inf -Inf -> NaN Invalid_operation
  370. remx721 remainder NaN -Inf -> NaN
  371. remx722 remainder NaN -1000 -> NaN
  372. remx723 remainder NaN -1 -> NaN
  373. remx724 remainder NaN -0 -> NaN
  374. remx725 remainder -NaN 0 -> -NaN
  375. remx726 remainder NaN 1 -> NaN
  376. remx727 remainder NaN 1000 -> NaN
  377. remx728 remainder NaN Inf -> NaN
  378. remx729 remainder NaN -NaN -> NaN
  379. remx730 remainder -Inf NaN -> NaN
  380. remx731 remainder -1000 NaN -> NaN
  381. remx732 remainder -1 NaN -> NaN
  382. remx733 remainder -0 -NaN -> -NaN
  383. remx734 remainder 0 NaN -> NaN
  384. remx735 remainder 1 -NaN -> -NaN
  385. remx736 remainder 1000 NaN -> NaN
  386. remx737 remainder Inf NaN -> NaN
  387. remx741 remainder sNaN -Inf -> NaN Invalid_operation
  388. remx742 remainder sNaN -1000 -> NaN Invalid_operation
  389. remx743 remainder -sNaN -1 -> -NaN Invalid_operation
  390. remx744 remainder sNaN -0 -> NaN Invalid_operation
  391. remx745 remainder sNaN 0 -> NaN Invalid_operation
  392. remx746 remainder sNaN 1 -> NaN Invalid_operation
  393. remx747 remainder sNaN 1000 -> NaN Invalid_operation
  394. remx749 remainder sNaN NaN -> NaN Invalid_operation
  395. remx750 remainder sNaN sNaN -> NaN Invalid_operation
  396. remx751 remainder NaN sNaN -> NaN Invalid_operation
  397. remx752 remainder -Inf sNaN -> NaN Invalid_operation
  398. remx753 remainder -1000 sNaN -> NaN Invalid_operation
  399. remx754 remainder -1 sNaN -> NaN Invalid_operation
  400. remx755 remainder -0 sNaN -> NaN Invalid_operation
  401. remx756 remainder 0 sNaN -> NaN Invalid_operation
  402. remx757 remainder 1 sNaN -> NaN Invalid_operation
  403. remx758 remainder 1000 sNaN -> NaN Invalid_operation
  404. remx759 remainder Inf -sNaN -> -NaN Invalid_operation
  405. -- propaging NaNs
  406. remx760 remainder NaN1 NaN7 -> NaN1
  407. remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
  408. remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
  409. remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
  410. remx764 remainder 15 NaN11 -> NaN11
  411. remx765 remainder NaN6 NaN12 -> NaN6
  412. remx766 remainder Inf NaN13 -> NaN13
  413. remx767 remainder NaN14 -Inf -> NaN14
  414. remx768 remainder 0 NaN15 -> NaN15
  415. remx769 remainder NaN16 -0 -> NaN16
  416. -- test some cases that are close to exponent overflow
  417. maxexponent: 999999999
  418. minexponent: -999999999
  419. remx770 remainder 1 1e999999999 -> 1
  420. remx771 remainder 1 0.9e999999999 -> 1
  421. remx772 remainder 1 0.99e999999999 -> 1
  422. remx773 remainder 1 0.999999999e999999999 -> 1
  423. remx774 remainder 9e999999999 1 -> NaN Division_impossible
  424. remx775 remainder 9.9e999999999 1 -> NaN Division_impossible
  425. remx776 remainder 9.99e999999999 1 -> NaN Division_impossible
  426. remx777 remainder 9.99999999e999999999 1 -> NaN Division_impossible
  427. -- long operand checks
  428. maxexponent: 999
  429. minexponent: -999
  430. precision: 9
  431. remx801 remainder 12345678000 100 -> 0
  432. remx802 remainder 1 12345678000 -> 1
  433. remx803 remainder 1234567800 10 -> 0
  434. remx804 remainder 1 1234567800 -> 1
  435. remx805 remainder 1234567890 10 -> 0
  436. remx806 remainder 1 1234567890 -> 1
  437. remx807 remainder 1234567891 10 -> 1
  438. remx808 remainder 1 1234567891 -> 1
  439. remx809 remainder 12345678901 100 -> 1
  440. remx810 remainder 1 12345678901 -> 1
  441. remx811 remainder 1234567896 10 -> 6
  442. remx812 remainder 1 1234567896 -> 1
  443. precision: 15
  444. remx821 remainder 12345678000 100 -> 0
  445. remx822 remainder 1 12345678000 -> 1
  446. remx823 remainder 1234567800 10 -> 0
  447. remx824 remainder 1 1234567800 -> 1
  448. remx825 remainder 1234567890 10 -> 0
  449. remx826 remainder 1 1234567890 -> 1
  450. remx827 remainder 1234567891 10 -> 1
  451. remx828 remainder 1 1234567891 -> 1
  452. remx829 remainder 12345678901 100 -> 1
  453. remx830 remainder 1 12345678901 -> 1
  454. remx831 remainder 1234567896 10 -> 6
  455. remx832 remainder 1 1234567896 -> 1
  456. -- worries from divideint
  457. precision: 8
  458. remx840 remainder 100000000.0 1 -> NaN Division_impossible
  459. remx841 remainder 100000000.4 1 -> NaN Division_impossible
  460. remx842 remainder 100000000.5 1 -> NaN Division_impossible
  461. remx843 remainder 100000000.9 1 -> NaN Division_impossible
  462. remx844 remainder 100000000.999 1 -> NaN Division_impossible
  463. precision: 6
  464. remx850 remainder 100000003 5 -> NaN Division_impossible
  465. remx851 remainder 10000003 5 -> NaN Division_impossible
  466. remx852 remainder 1000003 5 -> 3
  467. remx853 remainder 100003 5 -> 3
  468. remx854 remainder 10003 5 -> 3
  469. remx855 remainder 1003 5 -> 3
  470. remx856 remainder 103 5 -> 3
  471. remx857 remainder 13 5 -> 3
  472. remx858 remainder 1 5 -> 1
  473. -- Vladimir's cases
  474. remx860 remainder 123.0e1 10000000000000000 -> 1230
  475. remx861 remainder 1230 10000000000000000 -> 1230
  476. remx862 remainder 12.3e2 10000000000000000 -> 1230
  477. remx863 remainder 1.23e3 10000000000000000 -> 1230
  478. remx864 remainder 123e1 10000000000000000 -> 1230
  479. remx870 remainder 123e1 1000000000000000 -> 1230
  480. remx871 remainder 123e1 100000000000000 -> 1230
  481. remx872 remainder 123e1 10000000000000 -> 1230
  482. remx873 remainder 123e1 1000000000000 -> 1230
  483. remx874 remainder 123e1 100000000000 -> 1230
  484. remx875 remainder 123e1 10000000000 -> 1230
  485. remx876 remainder 123e1 1000000000 -> 1230
  486. remx877 remainder 123e1 100000000 -> 1230
  487. remx878 remainder 1230 100000000 -> 1230
  488. remx879 remainder 123e1 10000000 -> 1230
  489. remx880 remainder 123e1 1000000 -> 1230
  490. remx881 remainder 123e1 100000 -> 1230
  491. remx882 remainder 123e1 10000 -> 1230
  492. remx883 remainder 123e1 1000 -> 230
  493. remx884 remainder 123e1 100 -> 30
  494. remx885 remainder 123e1 10 -> 0
  495. remx886 remainder 123e1 1 -> 0
  496. remx889 remainder 123e1 20000000000000000 -> 1230
  497. remx890 remainder 123e1 2000000000000000 -> 1230
  498. remx891 remainder 123e1 200000000000000 -> 1230
  499. remx892 remainder 123e1 20000000000000 -> 1230
  500. remx893 remainder 123e1 2000000000000 -> 1230
  501. remx894 remainder 123e1 200000000000 -> 1230
  502. remx895 remainder 123e1 20000000000 -> 1230
  503. remx896 remainder 123e1 2000000000 -> 1230
  504. remx897 remainder 123e1 200000000 -> 1230
  505. remx899 remainder 123e1 20000000 -> 1230
  506. remx900 remainder 123e1 2000000 -> 1230
  507. remx901 remainder 123e1 200000 -> 1230
  508. remx902 remainder 123e1 20000 -> 1230
  509. remx903 remainder 123e1 2000 -> 1230
  510. remx904 remainder 123e1 200 -> 30
  511. remx905 remainder 123e1 20 -> 10
  512. remx906 remainder 123e1 2 -> 0
  513. remx909 remainder 123e1 50000000000000000 -> 1230
  514. remx910 remainder 123e1 5000000000000000 -> 1230
  515. remx911 remainder 123e1 500000000000000 -> 1230
  516. remx912 remainder 123e1 50000000000000 -> 1230
  517. remx913 remainder 123e1 5000000000000 -> 1230
  518. remx914 remainder 123e1 500000000000 -> 1230
  519. remx915 remainder 123e1 50000000000 -> 1230
  520. remx916 remainder 123e1 5000000000 -> 1230
  521. remx917 remainder 123e1 500000000 -> 1230
  522. remx919 remainder 123e1 50000000 -> 1230
  523. remx920 remainder 123e1 5000000 -> 1230
  524. remx921 remainder 123e1 500000 -> 1230
  525. remx922 remainder 123e1 50000 -> 1230
  526. remx923 remainder 123e1 5000 -> 1230
  527. remx924 remainder 123e1 500 -> 230
  528. remx925 remainder 123e1 50 -> 30
  529. remx926 remainder 123e1 5 -> 0
  530. remx929 remainder 123e1 90000000000000000 -> 1230
  531. remx930 remainder 123e1 9000000000000000 -> 1230
  532. remx931 remainder 123e1 900000000000000 -> 1230
  533. remx932 remainder 123e1 90000000000000 -> 1230
  534. remx933 remainder 123e1 9000000000000 -> 1230
  535. remx934 remainder 123e1 900000000000 -> 1230
  536. remx935 remainder 123e1 90000000000 -> 1230
  537. remx936 remainder 123e1 9000000000 -> 1230
  538. remx937 remainder 123e1 900000000 -> 1230
  539. remx939 remainder 123e1 90000000 -> 1230
  540. remx940 remainder 123e1 9000000 -> 1230
  541. remx941 remainder 123e1 900000 -> 1230
  542. remx942 remainder 123e1 90000 -> 1230
  543. remx943 remainder 123e1 9000 -> 1230
  544. remx944 remainder 123e1 900 -> 330
  545. remx945 remainder 123e1 90 -> 60
  546. remx946 remainder 123e1 9 -> 6
  547. remx950 remainder 123e1 10000000000000000 -> 1230
  548. remx951 remainder 123e1 100000000000000000 -> 1230
  549. remx952 remainder 123e1 1000000000000000000 -> 1230
  550. remx953 remainder 123e1 10000000000000000000 -> 1230
  551. remx954 remainder 123e1 100000000000000000000 -> 1230
  552. remx955 remainder 123e1 1000000000000000000000 -> 1230
  553. remx956 remainder 123e1 10000000000000000000000 -> 1230
  554. remx957 remainder 123e1 100000000000000000000000 -> 1230
  555. remx958 remainder 123e1 1000000000000000000000000 -> 1230
  556. remx959 remainder 123e1 10000000000000000000000000 -> 1230
  557. remx960 remainder 123e1 19999999999999999 -> 1230
  558. remx961 remainder 123e1 199999999999999990 -> 1230
  559. remx962 remainder 123e1 1999999999999999999 -> 1230
  560. remx963 remainder 123e1 19999999999999999990 -> 1230
  561. remx964 remainder 123e1 199999999999999999999 -> 1230
  562. remx965 remainder 123e1 1999999999999999999990 -> 1230
  563. remx966 remainder 123e1 19999999999999999999999 -> 1230
  564. remx967 remainder 123e1 199999999999999999999990 -> 1230
  565. remx968 remainder 123e1 1999999999999999999999999 -> 1230
  566. remx969 remainder 123e1 19999999999999999999999990 -> 1230
  567. remx970 remainder 1e1 10000000000000000 -> 10
  568. remx971 remainder 1e1 100000000000000000 -> 10
  569. remx972 remainder 1e1 1000000000000000000 -> 10
  570. remx973 remainder 1e1 10000000000000000000 -> 10
  571. remx974 remainder 1e1 100000000000000000000 -> 10
  572. remx975 remainder 1e1 1000000000000000000000 -> 10
  573. remx976 remainder 1e1 10000000000000000000000 -> 10
  574. remx977 remainder 1e1 100000000000000000000000 -> 10
  575. remx978 remainder 1e1 1000000000000000000000000 -> 10
  576. remx979 remainder 1e1 10000000000000000000000000 -> 10
  577. remx980 remainder 123e1 1000E999999 -> 1.23E+3 -- 123E+1 internally
  578. -- overflow and underflow tests [from divide]
  579. precision: 9
  580. maxexponent: 999999999
  581. minexponent: -999999999
  582. remx990 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded
  583. remx991 remainder 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible
  584. remx992 remainder +0.100 9E+999999999 -> 0.100
  585. remx993 remainder 9E-999999999 +9.100 -> 9E-999999999
  586. remx995 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded
  587. remx996 remainder 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible
  588. remx997 remainder -0.100 9E+999999999 -> -0.100
  589. remx998 remainder 9E-999999999 -9.100 -> 9E-999999999
  590. -- Null tests
  591. remx1000 remainder 10 # -> NaN Invalid_operation
  592. remx1001 remainder # 10 -> NaN Invalid_operation