dqRemainder.decTest 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. ------------------------------------------------------------------------
  2. -- dqRemainder.decTest -- decQuad 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. clamp: 1
  23. precision: 34
  24. maxExponent: 6144
  25. minExponent: -6143
  26. rounding: half_even
  27. -- sanity checks (as base, above)
  28. dqrem001 remainder 1 1 -> 0
  29. dqrem002 remainder 2 1 -> 0
  30. dqrem003 remainder 1 2 -> 1
  31. dqrem004 remainder 2 2 -> 0
  32. dqrem005 remainder 0 1 -> 0
  33. dqrem006 remainder 0 2 -> 0
  34. dqrem007 remainder 1 3 -> 1
  35. dqrem008 remainder 2 3 -> 2
  36. dqrem009 remainder 3 3 -> 0
  37. dqrem010 remainder 2.4 1 -> 0.4
  38. dqrem011 remainder 2.4 -1 -> 0.4
  39. dqrem012 remainder -2.4 1 -> -0.4
  40. dqrem013 remainder -2.4 -1 -> -0.4
  41. dqrem014 remainder 2.40 1 -> 0.40
  42. dqrem015 remainder 2.400 1 -> 0.400
  43. dqrem016 remainder 2.4 2 -> 0.4
  44. dqrem017 remainder 2.400 2 -> 0.400
  45. dqrem018 remainder 2. 2 -> 0
  46. dqrem019 remainder 20 20 -> 0
  47. dqrem020 remainder 187 187 -> 0
  48. dqrem021 remainder 5 2 -> 1
  49. dqrem022 remainder 5 2.0 -> 1.0
  50. dqrem023 remainder 5 2.000 -> 1.000
  51. dqrem024 remainder 5 0.200 -> 0.000
  52. dqrem025 remainder 5 0.200 -> 0.000
  53. dqrem030 remainder 1 2 -> 1
  54. dqrem031 remainder 1 4 -> 1
  55. dqrem032 remainder 1 8 -> 1
  56. dqrem033 remainder 1 16 -> 1
  57. dqrem034 remainder 1 32 -> 1
  58. dqrem035 remainder 1 64 -> 1
  59. dqrem040 remainder 1 -2 -> 1
  60. dqrem041 remainder 1 -4 -> 1
  61. dqrem042 remainder 1 -8 -> 1
  62. dqrem043 remainder 1 -16 -> 1
  63. dqrem044 remainder 1 -32 -> 1
  64. dqrem045 remainder 1 -64 -> 1
  65. dqrem050 remainder -1 2 -> -1
  66. dqrem051 remainder -1 4 -> -1
  67. dqrem052 remainder -1 8 -> -1
  68. dqrem053 remainder -1 16 -> -1
  69. dqrem054 remainder -1 32 -> -1
  70. dqrem055 remainder -1 64 -> -1
  71. dqrem060 remainder -1 -2 -> -1
  72. dqrem061 remainder -1 -4 -> -1
  73. dqrem062 remainder -1 -8 -> -1
  74. dqrem063 remainder -1 -16 -> -1
  75. dqrem064 remainder -1 -32 -> -1
  76. dqrem065 remainder -1 -64 -> -1
  77. dqrem066 remainder 999999999 1 -> 0
  78. dqrem067 remainder 999999999.4 1 -> 0.4
  79. dqrem068 remainder 999999999.5 1 -> 0.5
  80. dqrem069 remainder 999999999.9 1 -> 0.9
  81. dqrem070 remainder 999999999.999 1 -> 0.999
  82. dqrem071 remainder 999999.999999 1 -> 0.999999
  83. dqrem072 remainder 9 1 -> 0
  84. dqrem080 remainder 0. 1 -> 0
  85. dqrem081 remainder .0 1 -> 0.0
  86. dqrem082 remainder 0.00 1 -> 0.00
  87. dqrem083 remainder 0.00E+9 1 -> 0
  88. dqrem084 remainder 0.00E+3 1 -> 0
  89. dqrem085 remainder 0.00E+2 1 -> 0
  90. dqrem086 remainder 0.00E+1 1 -> 0.0
  91. dqrem087 remainder 0.00E+0 1 -> 0.00
  92. dqrem088 remainder 0.00E-0 1 -> 0.00
  93. dqrem089 remainder 0.00E-1 1 -> 0.000
  94. dqrem090 remainder 0.00E-2 1 -> 0.0000
  95. dqrem091 remainder 0.00E-3 1 -> 0.00000
  96. dqrem092 remainder 0.00E-4 1 -> 0.000000
  97. dqrem093 remainder 0.00E-5 1 -> 0E-7
  98. dqrem094 remainder 0.00E-6 1 -> 0E-8
  99. dqrem095 remainder 0.0000E-50 1 -> 0E-54
  100. -- Various flavours of remainder by 0
  101. dqrem101 remainder 0 0 -> NaN Division_undefined
  102. dqrem102 remainder 0 -0 -> NaN Division_undefined
  103. dqrem103 remainder -0 0 -> NaN Division_undefined
  104. dqrem104 remainder -0 -0 -> NaN Division_undefined
  105. dqrem105 remainder 0.0E5 0 -> NaN Division_undefined
  106. dqrem106 remainder 0.000 0 -> NaN Division_undefined
  107. -- [Some think this next group should be Division_by_zero exception, but
  108. -- IEEE 854 is explicit that it is Invalid operation .. for
  109. -- remainder-near, anyway]
  110. dqrem107 remainder 0.0001 0 -> NaN Invalid_operation
  111. dqrem108 remainder 0.01 0 -> NaN Invalid_operation
  112. dqrem109 remainder 0.1 0 -> NaN Invalid_operation
  113. dqrem110 remainder 1 0 -> NaN Invalid_operation
  114. dqrem111 remainder 1 0.0 -> NaN Invalid_operation
  115. dqrem112 remainder 10 0.0 -> NaN Invalid_operation
  116. dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
  117. dqrem114 remainder 1E+380 0 -> NaN Invalid_operation
  118. dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation
  119. dqrem116 remainder 0.01 -0 -> NaN Invalid_operation
  120. dqrem119 remainder 0.1 -0 -> NaN Invalid_operation
  121. dqrem120 remainder 1 -0 -> NaN Invalid_operation
  122. dqrem121 remainder 1 -0.0 -> NaN Invalid_operation
  123. dqrem122 remainder 10 -0.0 -> NaN Invalid_operation
  124. dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
  125. dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation
  126. -- and zeros on left
  127. dqrem130 remainder 0 1 -> 0
  128. dqrem131 remainder 0 -1 -> 0
  129. dqrem132 remainder 0.0 1 -> 0.0
  130. dqrem133 remainder 0.0 -1 -> 0.0
  131. dqrem134 remainder -0 1 -> -0
  132. dqrem135 remainder -0 -1 -> -0
  133. dqrem136 remainder -0.0 1 -> -0.0
  134. dqrem137 remainder -0.0 -1 -> -0.0
  135. -- 0.5ers
  136. dqrem143 remainder 0.5 2 -> 0.5
  137. dqrem144 remainder 0.5 2.1 -> 0.5
  138. dqrem145 remainder 0.5 2.01 -> 0.50
  139. dqrem146 remainder 0.5 2.001 -> 0.500
  140. dqrem147 remainder 0.50 2 -> 0.50
  141. dqrem148 remainder 0.50 2.01 -> 0.50
  142. dqrem149 remainder 0.50 2.001 -> 0.500
  143. -- steadies
  144. dqrem150 remainder 1 1 -> 0
  145. dqrem151 remainder 1 2 -> 1
  146. dqrem152 remainder 1 3 -> 1
  147. dqrem153 remainder 1 4 -> 1
  148. dqrem154 remainder 1 5 -> 1
  149. dqrem155 remainder 1 6 -> 1
  150. dqrem156 remainder 1 7 -> 1
  151. dqrem157 remainder 1 8 -> 1
  152. dqrem158 remainder 1 9 -> 1
  153. dqrem159 remainder 1 10 -> 1
  154. dqrem160 remainder 1 1 -> 0
  155. dqrem161 remainder 2 1 -> 0
  156. dqrem162 remainder 3 1 -> 0
  157. dqrem163 remainder 4 1 -> 0
  158. dqrem164 remainder 5 1 -> 0
  159. dqrem165 remainder 6 1 -> 0
  160. dqrem166 remainder 7 1 -> 0
  161. dqrem167 remainder 8 1 -> 0
  162. dqrem168 remainder 9 1 -> 0
  163. dqrem169 remainder 10 1 -> 0
  164. -- some differences from remainderNear
  165. dqrem171 remainder 0.4 1.020 -> 0.400
  166. dqrem172 remainder 0.50 1.020 -> 0.500
  167. dqrem173 remainder 0.51 1.020 -> 0.510
  168. dqrem174 remainder 0.52 1.020 -> 0.520
  169. dqrem175 remainder 0.6 1.020 -> 0.600
  170. -- More flavours of remainder by 0
  171. dqrem201 remainder 0 0 -> NaN Division_undefined
  172. dqrem202 remainder 0.0E5 0 -> NaN Division_undefined
  173. dqrem203 remainder 0.000 0 -> NaN Division_undefined
  174. dqrem204 remainder 0.0001 0 -> NaN Invalid_operation
  175. dqrem205 remainder 0.01 0 -> NaN Invalid_operation
  176. dqrem206 remainder 0.1 0 -> NaN Invalid_operation
  177. dqrem207 remainder 1 0 -> NaN Invalid_operation
  178. dqrem208 remainder 1 0.0 -> NaN Invalid_operation
  179. dqrem209 remainder 10 0.0 -> NaN Invalid_operation
  180. dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
  181. dqrem211 remainder 1E+380 0 -> NaN Invalid_operation
  182. -- some differences from remainderNear
  183. dqrem231 remainder -0.4 1.020 -> -0.400
  184. dqrem232 remainder -0.50 1.020 -> -0.500
  185. dqrem233 remainder -0.51 1.020 -> -0.510
  186. dqrem234 remainder -0.52 1.020 -> -0.520
  187. dqrem235 remainder -0.6 1.020 -> -0.600
  188. -- high Xs
  189. dqrem240 remainder 1E+2 1.00 -> 0.00
  190. -- dqrem3xx are from DiagBigDecimal
  191. dqrem301 remainder 1 3 -> 1
  192. dqrem302 remainder 5 5 -> 0
  193. dqrem303 remainder 13 10 -> 3
  194. dqrem304 remainder 13 50 -> 13
  195. dqrem305 remainder 13 100 -> 13
  196. dqrem306 remainder 13 1000 -> 13
  197. dqrem307 remainder .13 1 -> 0.13
  198. dqrem308 remainder 0.133 1 -> 0.133
  199. dqrem309 remainder 0.1033 1 -> 0.1033
  200. dqrem310 remainder 1.033 1 -> 0.033
  201. dqrem311 remainder 10.33 1 -> 0.33
  202. dqrem312 remainder 10.33 10 -> 0.33
  203. dqrem313 remainder 103.3 1 -> 0.3
  204. dqrem314 remainder 133 10 -> 3
  205. dqrem315 remainder 1033 10 -> 3
  206. dqrem316 remainder 1033 50 -> 33
  207. dqrem317 remainder 101.0 3 -> 2.0
  208. dqrem318 remainder 102.0 3 -> 0.0
  209. dqrem319 remainder 103.0 3 -> 1.0
  210. dqrem320 remainder 2.40 1 -> 0.40
  211. dqrem321 remainder 2.400 1 -> 0.400
  212. dqrem322 remainder 2.4 1 -> 0.4
  213. dqrem323 remainder 2.4 2 -> 0.4
  214. dqrem324 remainder 2.400 2 -> 0.400
  215. dqrem325 remainder 1 0.3 -> 0.1
  216. dqrem326 remainder 1 0.30 -> 0.10
  217. dqrem327 remainder 1 0.300 -> 0.100
  218. dqrem328 remainder 1 0.3000 -> 0.1000
  219. dqrem329 remainder 1.0 0.3 -> 0.1
  220. dqrem330 remainder 1.00 0.3 -> 0.10
  221. dqrem331 remainder 1.000 0.3 -> 0.100
  222. dqrem332 remainder 1.0000 0.3 -> 0.1000
  223. dqrem333 remainder 0.5 2 -> 0.5
  224. dqrem334 remainder 0.5 2.1 -> 0.5
  225. dqrem335 remainder 0.5 2.01 -> 0.50
  226. dqrem336 remainder 0.5 2.001 -> 0.500
  227. dqrem337 remainder 0.50 2 -> 0.50
  228. dqrem338 remainder 0.50 2.01 -> 0.50
  229. dqrem339 remainder 0.50 2.001 -> 0.500
  230. dqrem340 remainder 0.5 0.5000001 -> 0.5000000
  231. dqrem341 remainder 0.5 0.50000001 -> 0.50000000
  232. dqrem342 remainder 0.5 0.500000001 -> 0.500000000
  233. dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000
  234. dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000
  235. dqrem345 remainder 0.5 0.4999999 -> 1E-7
  236. dqrem346 remainder 0.5 0.49999999 -> 1E-8
  237. dqrem347 remainder 0.5 0.499999999 -> 1E-9
  238. dqrem348 remainder 0.5 0.4999999999 -> 1E-10
  239. dqrem349 remainder 0.5 0.49999999999 -> 1E-11
  240. dqrem350 remainder 0.5 0.499999999999 -> 1E-12
  241. dqrem351 remainder 0.03 7 -> 0.03
  242. dqrem352 remainder 5 2 -> 1
  243. dqrem353 remainder 4.1 2 -> 0.1
  244. dqrem354 remainder 4.01 2 -> 0.01
  245. dqrem355 remainder 4.001 2 -> 0.001
  246. dqrem356 remainder 4.0001 2 -> 0.0001
  247. dqrem357 remainder 4.00001 2 -> 0.00001
  248. dqrem358 remainder 4.000001 2 -> 0.000001
  249. dqrem359 remainder 4.0000001 2 -> 1E-7
  250. dqrem360 remainder 1.2 0.7345 -> 0.4655
  251. dqrem361 remainder 0.8 12 -> 0.8
  252. dqrem362 remainder 0.8 0.2 -> 0.0
  253. dqrem363 remainder 0.8 0.3 -> 0.2
  254. dqrem364 remainder 0.800 12 -> 0.800
  255. dqrem365 remainder 0.800 1.7 -> 0.800
  256. dqrem366 remainder 2.400 2 -> 0.400
  257. dqrem371 remainder 2.400 2 -> 0.400
  258. dqrem381 remainder 12345 1 -> 0
  259. dqrem382 remainder 12345 1.0001 -> 0.7657
  260. dqrem383 remainder 12345 1.001 -> 0.668
  261. dqrem384 remainder 12345 1.01 -> 0.78
  262. dqrem385 remainder 12345 1.1 -> 0.8
  263. dqrem386 remainder 12355 4 -> 3
  264. dqrem387 remainder 12345 4 -> 1
  265. dqrem388 remainder 12355 4.0001 -> 2.6912
  266. dqrem389 remainder 12345 4.0001 -> 0.6914
  267. dqrem390 remainder 12345 4.9 -> 1.9
  268. dqrem391 remainder 12345 4.99 -> 4.73
  269. dqrem392 remainder 12345 4.999 -> 2.469
  270. dqrem393 remainder 12345 4.9999 -> 0.2469
  271. dqrem394 remainder 12345 5 -> 0
  272. dqrem395 remainder 12345 5.0001 -> 4.7532
  273. dqrem396 remainder 12345 5.001 -> 2.532
  274. dqrem397 remainder 12345 5.01 -> 0.36
  275. dqrem398 remainder 12345 5.1 -> 3.0
  276. -- the nasty division-by-1 cases
  277. dqrem401 remainder 0.5 1 -> 0.5
  278. dqrem402 remainder 0.55 1 -> 0.55
  279. dqrem403 remainder 0.555 1 -> 0.555
  280. dqrem404 remainder 0.5555 1 -> 0.5555
  281. dqrem405 remainder 0.55555 1 -> 0.55555
  282. dqrem406 remainder 0.555555 1 -> 0.555555
  283. dqrem407 remainder 0.5555555 1 -> 0.5555555
  284. dqrem408 remainder 0.55555555 1 -> 0.55555555
  285. dqrem409 remainder 0.555555555 1 -> 0.555555555
  286. -- folddowns
  287. dqrem421 remainder 1E+6144 1 -> NaN Division_impossible
  288. dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped
  289. dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped
  290. dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
  291. dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
  292. dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped
  293. dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped
  294. dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
  295. dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
  296. dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
  297. -- tinies
  298. dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176
  299. dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176
  300. dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal
  301. dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal
  302. dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176
  303. dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal
  304. dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal
  305. dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal
  306. dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal
  307. dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176
  308. dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal
  309. dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal
  310. dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176
  311. dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal
  312. dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
  313. -- zero signs
  314. dqrem650 remainder 1 1 -> 0
  315. dqrem651 remainder -1 1 -> -0
  316. dqrem652 remainder 1 -1 -> 0
  317. dqrem653 remainder -1 -1 -> -0
  318. dqrem654 remainder 0 1 -> 0
  319. dqrem655 remainder -0 1 -> -0
  320. dqrem656 remainder 0 -1 -> 0
  321. dqrem657 remainder -0 -1 -> -0
  322. dqrem658 remainder 0.00 1 -> 0.00
  323. dqrem659 remainder -0.00 1 -> -0.00
  324. -- Specials
  325. dqrem680 remainder Inf -Inf -> NaN Invalid_operation
  326. dqrem681 remainder Inf -1000 -> NaN Invalid_operation
  327. dqrem682 remainder Inf -1 -> NaN Invalid_operation
  328. dqrem683 remainder Inf 0 -> NaN Invalid_operation
  329. dqrem684 remainder Inf -0 -> NaN Invalid_operation
  330. dqrem685 remainder Inf 1 -> NaN Invalid_operation
  331. dqrem686 remainder Inf 1000 -> NaN Invalid_operation
  332. dqrem687 remainder Inf Inf -> NaN Invalid_operation
  333. dqrem688 remainder -1000 Inf -> -1000
  334. dqrem689 remainder -Inf Inf -> NaN Invalid_operation
  335. dqrem691 remainder -1 Inf -> -1
  336. dqrem692 remainder 0 Inf -> 0
  337. dqrem693 remainder -0 Inf -> -0
  338. dqrem694 remainder 1 Inf -> 1
  339. dqrem695 remainder 1000 Inf -> 1000
  340. dqrem696 remainder Inf Inf -> NaN Invalid_operation
  341. dqrem700 remainder -Inf -Inf -> NaN Invalid_operation
  342. dqrem701 remainder -Inf -1000 -> NaN Invalid_operation
  343. dqrem702 remainder -Inf -1 -> NaN Invalid_operation
  344. dqrem703 remainder -Inf -0 -> NaN Invalid_operation
  345. dqrem704 remainder -Inf 0 -> NaN Invalid_operation
  346. dqrem705 remainder -Inf 1 -> NaN Invalid_operation
  347. dqrem706 remainder -Inf 1000 -> NaN Invalid_operation
  348. dqrem707 remainder -Inf Inf -> NaN Invalid_operation
  349. dqrem708 remainder -Inf -Inf -> NaN Invalid_operation
  350. dqrem709 remainder -1000 Inf -> -1000
  351. dqrem710 remainder -1 -Inf -> -1
  352. dqrem711 remainder -0 -Inf -> -0
  353. dqrem712 remainder 0 -Inf -> 0
  354. dqrem713 remainder 1 -Inf -> 1
  355. dqrem714 remainder 1000 -Inf -> 1000
  356. dqrem715 remainder Inf -Inf -> NaN Invalid_operation
  357. dqrem721 remainder NaN -Inf -> NaN
  358. dqrem722 remainder NaN -1000 -> NaN
  359. dqrem723 remainder NaN -1 -> NaN
  360. dqrem724 remainder NaN -0 -> NaN
  361. dqrem725 remainder -NaN 0 -> -NaN
  362. dqrem726 remainder NaN 1 -> NaN
  363. dqrem727 remainder NaN 1000 -> NaN
  364. dqrem728 remainder NaN Inf -> NaN
  365. dqrem729 remainder NaN -NaN -> NaN
  366. dqrem730 remainder -Inf NaN -> NaN
  367. dqrem731 remainder -1000 NaN -> NaN
  368. dqrem732 remainder -1 NaN -> NaN
  369. dqrem733 remainder -0 -NaN -> -NaN
  370. dqrem734 remainder 0 NaN -> NaN
  371. dqrem735 remainder 1 -NaN -> -NaN
  372. dqrem736 remainder 1000 NaN -> NaN
  373. dqrem737 remainder Inf NaN -> NaN
  374. dqrem741 remainder sNaN -Inf -> NaN Invalid_operation
  375. dqrem742 remainder sNaN -1000 -> NaN Invalid_operation
  376. dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation
  377. dqrem744 remainder sNaN -0 -> NaN Invalid_operation
  378. dqrem745 remainder sNaN 0 -> NaN Invalid_operation
  379. dqrem746 remainder sNaN 1 -> NaN Invalid_operation
  380. dqrem747 remainder sNaN 1000 -> NaN Invalid_operation
  381. dqrem749 remainder sNaN NaN -> NaN Invalid_operation
  382. dqrem750 remainder sNaN sNaN -> NaN Invalid_operation
  383. dqrem751 remainder NaN sNaN -> NaN Invalid_operation
  384. dqrem752 remainder -Inf sNaN -> NaN Invalid_operation
  385. dqrem753 remainder -1000 sNaN -> NaN Invalid_operation
  386. dqrem754 remainder -1 sNaN -> NaN Invalid_operation
  387. dqrem755 remainder -0 sNaN -> NaN Invalid_operation
  388. dqrem756 remainder 0 sNaN -> NaN Invalid_operation
  389. dqrem757 remainder 1 sNaN -> NaN Invalid_operation
  390. dqrem758 remainder 1000 sNaN -> NaN Invalid_operation
  391. dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation
  392. -- propaging NaNs
  393. dqrem760 remainder NaN1 NaN7 -> NaN1
  394. dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
  395. dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
  396. dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
  397. dqrem764 remainder 15 NaN11 -> NaN11
  398. dqrem765 remainder NaN6 NaN12 -> NaN6
  399. dqrem766 remainder Inf NaN13 -> NaN13
  400. dqrem767 remainder NaN14 -Inf -> NaN14
  401. dqrem768 remainder 0 NaN15 -> NaN15
  402. dqrem769 remainder NaN16 -0 -> NaN16
  403. -- edge cases of impossible
  404. dqrem770 remainder 1234568888888887777777777890123456 10 -> 6
  405. dqrem771 remainder 1234568888888887777777777890123456 1 -> 0
  406. dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible
  407. dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible
  408. -- long operand checks
  409. dqrem801 remainder 12345678000 100 -> 0
  410. dqrem802 remainder 1 12345678000 -> 1
  411. dqrem803 remainder 1234567800 10 -> 0
  412. dqrem804 remainder 1 1234567800 -> 1
  413. dqrem805 remainder 1234567890 10 -> 0
  414. dqrem806 remainder 1 1234567890 -> 1
  415. dqrem807 remainder 1234567891 10 -> 1
  416. dqrem808 remainder 1 1234567891 -> 1
  417. dqrem809 remainder 12345678901 100 -> 1
  418. dqrem810 remainder 1 12345678901 -> 1
  419. dqrem811 remainder 1234567896 10 -> 6
  420. dqrem812 remainder 1 1234567896 -> 1
  421. dqrem821 remainder 12345678000 100 -> 0
  422. dqrem822 remainder 1 12345678000 -> 1
  423. dqrem823 remainder 1234567800 10 -> 0
  424. dqrem824 remainder 1 1234567800 -> 1
  425. dqrem825 remainder 1234567890 10 -> 0
  426. dqrem826 remainder 1 1234567890 -> 1
  427. dqrem827 remainder 1234567891 10 -> 1
  428. dqrem828 remainder 1 1234567891 -> 1
  429. dqrem829 remainder 12345678901 100 -> 1
  430. dqrem830 remainder 1 12345678901 -> 1
  431. dqrem831 remainder 1234567896 10 -> 6
  432. dqrem832 remainder 1 1234567896 -> 1
  433. -- from divideint
  434. dqrem840 remainder 100000000.0 1 -> 0.0
  435. dqrem841 remainder 100000000.4 1 -> 0.4
  436. dqrem842 remainder 100000000.5 1 -> 0.5
  437. dqrem843 remainder 100000000.9 1 -> 0.9
  438. dqrem844 remainder 100000000.999 1 -> 0.999
  439. dqrem850 remainder 100000003 5 -> 3
  440. dqrem851 remainder 10000003 5 -> 3
  441. dqrem852 remainder 1000003 5 -> 3
  442. dqrem853 remainder 100003 5 -> 3
  443. dqrem854 remainder 10003 5 -> 3
  444. dqrem855 remainder 1003 5 -> 3
  445. dqrem856 remainder 103 5 -> 3
  446. dqrem857 remainder 13 5 -> 3
  447. dqrem858 remainder 1 5 -> 1
  448. -- Vladimir's cases 1234567890123456
  449. dqrem860 remainder 123.0e1 1000000000000000 -> 1230
  450. dqrem861 remainder 1230 1000000000000000 -> 1230
  451. dqrem862 remainder 12.3e2 1000000000000000 -> 1230
  452. dqrem863 remainder 1.23e3 1000000000000000 -> 1230
  453. dqrem864 remainder 123e1 1000000000000000 -> 1230
  454. dqrem870 remainder 123e1 1000000000000000 -> 1230
  455. dqrem871 remainder 123e1 100000000000000 -> 1230
  456. dqrem872 remainder 123e1 10000000000000 -> 1230
  457. dqrem873 remainder 123e1 1000000000000 -> 1230
  458. dqrem874 remainder 123e1 100000000000 -> 1230
  459. dqrem875 remainder 123e1 10000000000 -> 1230
  460. dqrem876 remainder 123e1 1000000000 -> 1230
  461. dqrem877 remainder 123e1 100000000 -> 1230
  462. dqrem878 remainder 1230 100000000 -> 1230
  463. dqrem879 remainder 123e1 10000000 -> 1230
  464. dqrem880 remainder 123e1 1000000 -> 1230
  465. dqrem881 remainder 123e1 100000 -> 1230
  466. dqrem882 remainder 123e1 10000 -> 1230
  467. dqrem883 remainder 123e1 1000 -> 230
  468. dqrem884 remainder 123e1 100 -> 30
  469. dqrem885 remainder 123e1 10 -> 0
  470. dqrem886 remainder 123e1 1 -> 0
  471. dqrem890 remainder 123e1 2000000000000000 -> 1230
  472. dqrem891 remainder 123e1 200000000000000 -> 1230
  473. dqrem892 remainder 123e1 20000000000000 -> 1230
  474. dqrem893 remainder 123e1 2000000000000 -> 1230
  475. dqrem894 remainder 123e1 200000000000 -> 1230
  476. dqrem895 remainder 123e1 20000000000 -> 1230
  477. dqrem896 remainder 123e1 2000000000 -> 1230
  478. dqrem897 remainder 123e1 200000000 -> 1230
  479. dqrem899 remainder 123e1 20000000 -> 1230
  480. dqrem900 remainder 123e1 2000000 -> 1230
  481. dqrem901 remainder 123e1 200000 -> 1230
  482. dqrem902 remainder 123e1 20000 -> 1230
  483. dqrem903 remainder 123e1 2000 -> 1230
  484. dqrem904 remainder 123e1 200 -> 30
  485. dqrem905 remainder 123e1 20 -> 10
  486. dqrem906 remainder 123e1 2 -> 0
  487. dqrem910 remainder 123e1 5000000000000000 -> 1230
  488. dqrem911 remainder 123e1 500000000000000 -> 1230
  489. dqrem912 remainder 123e1 50000000000000 -> 1230
  490. dqrem913 remainder 123e1 5000000000000 -> 1230
  491. dqrem914 remainder 123e1 500000000000 -> 1230
  492. dqrem915 remainder 123e1 50000000000 -> 1230
  493. dqrem916 remainder 123e1 5000000000 -> 1230
  494. dqrem917 remainder 123e1 500000000 -> 1230
  495. dqrem919 remainder 123e1 50000000 -> 1230
  496. dqrem920 remainder 123e1 5000000 -> 1230
  497. dqrem921 remainder 123e1 500000 -> 1230
  498. dqrem922 remainder 123e1 50000 -> 1230
  499. dqrem923 remainder 123e1 5000 -> 1230
  500. dqrem924 remainder 123e1 500 -> 230
  501. dqrem925 remainder 123e1 50 -> 30
  502. dqrem926 remainder 123e1 5 -> 0
  503. dqrem930 remainder 123e1 9000000000000000 -> 1230
  504. dqrem931 remainder 123e1 900000000000000 -> 1230
  505. dqrem932 remainder 123e1 90000000000000 -> 1230
  506. dqrem933 remainder 123e1 9000000000000 -> 1230
  507. dqrem934 remainder 123e1 900000000000 -> 1230
  508. dqrem935 remainder 123e1 90000000000 -> 1230
  509. dqrem936 remainder 123e1 9000000000 -> 1230
  510. dqrem937 remainder 123e1 900000000 -> 1230
  511. dqrem939 remainder 123e1 90000000 -> 1230
  512. dqrem940 remainder 123e1 9000000 -> 1230
  513. dqrem941 remainder 123e1 900000 -> 1230
  514. dqrem942 remainder 123e1 90000 -> 1230
  515. dqrem943 remainder 123e1 9000 -> 1230
  516. dqrem944 remainder 123e1 900 -> 330
  517. dqrem945 remainder 123e1 90 -> 60
  518. dqrem946 remainder 123e1 9 -> 6
  519. dqrem950 remainder 123e1 1000000000000000 -> 1230
  520. dqrem961 remainder 123e1 2999999999999999 -> 1230
  521. dqrem962 remainder 123e1 3999999999999999 -> 1230
  522. dqrem963 remainder 123e1 4999999999999999 -> 1230
  523. dqrem964 remainder 123e1 5999999999999999 -> 1230
  524. dqrem965 remainder 123e1 6999999999999999 -> 1230
  525. dqrem966 remainder 123e1 7999999999999999 -> 1230
  526. dqrem967 remainder 123e1 8999999999999999 -> 1230
  527. dqrem968 remainder 123e1 9999999999999999 -> 1230
  528. dqrem969 remainder 123e1 9876543210987654 -> 1230
  529. dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
  530. -- overflow and underflow tests [from divide]
  531. dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
  532. dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
  533. dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
  534. dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
  535. dqrem1055 remainder 1e-277 1e+311 -> 1E-277
  536. dqrem1056 remainder 1e-277 -1e+311 -> 1E-277
  537. dqrem1057 remainder -1e-277 1e+311 -> -1E-277
  538. dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
  539. -- Gyuris example
  540. dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
  541. -- destructive subtract
  542. dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768
  543. dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779
  544. dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890
  545. dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687
  546. dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
  547. dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251
  548. dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
  549. dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246
  550. dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759
  551. -- Null tests
  552. dqrem1000 remainder 10 # -> NaN Invalid_operation
  553. dqrem1001 remainder # 10 -> NaN Invalid_operation