bigint-arithmetic.js (28526B)
1 // Copyright (C) 2017 Robin Templeton. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-multiplicative-operators-runtime-semantics-evaluation 5 description: BigInt remainder arithmetic 6 features: [BigInt] 7 ---*/ 8 assert.sameValue( 9 0xFEDCBA9876543210n % 0xFEDCBA9876543210n, 10 0x0n, 11 'The result of (0xFEDCBA9876543210n % 0xFEDCBA9876543210n) is 0x0n' 12 ); 13 14 assert.sameValue( 15 0xFEDCBA9876543210n % 0xFEDCBA987654320Fn, 16 0x1n, 17 'The result of (0xFEDCBA9876543210n % 0xFEDCBA987654320Fn) is 0x1n' 18 ); 19 20 assert.sameValue( 21 0xFEDCBA9876543210n % 0xFEDCBA98n, 22 0x76543210n, 23 'The result of (0xFEDCBA9876543210n % 0xFEDCBA98n) is 0x76543210n' 24 ); 25 26 assert.sameValue( 27 0xFEDCBA9876543210n % 0xFEDCBA97n, 28 0x77777779n, 29 'The result of (0xFEDCBA9876543210n % 0xFEDCBA97n) is 0x77777779n' 30 ); 31 32 assert.sameValue( 33 0xFEDCBA9876543210n % 0x1234n, 34 0x960n, 35 'The result of (0xFEDCBA9876543210n % 0x1234n) is 0x960n' 36 ); 37 38 assert.sameValue( 39 0xFEDCBA9876543210n % 0x3n, 40 0x0n, 41 'The result of (0xFEDCBA9876543210n % 0x3n) is 0x0n' 42 ); 43 44 assert.sameValue( 45 0xFEDCBA9876543210n % 0x2n, 46 0x0n, 47 'The result of (0xFEDCBA9876543210n % 0x2n) is 0x0n' 48 ); 49 50 assert.sameValue( 51 0xFEDCBA9876543210n % 0x1n, 52 0x0n, 53 'The result of (0xFEDCBA9876543210n % 0x1n) is 0x0n' 54 ); 55 56 assert.sameValue( 57 0xFEDCBA9876543210n % -0x1n, 58 0x0n, 59 'The result of (0xFEDCBA9876543210n % -0x1n) is 0x0n' 60 ); 61 62 assert.sameValue( 63 0xFEDCBA9876543210n % -0x2n, 64 0x0n, 65 'The result of (0xFEDCBA9876543210n % -0x2n) is 0x0n' 66 ); 67 68 assert.sameValue( 69 0xFEDCBA9876543210n % -0x3n, 70 0x0n, 71 'The result of (0xFEDCBA9876543210n % -0x3n) is 0x0n' 72 ); 73 74 assert.sameValue( 75 0xFEDCBA9876543210n % -0x1234n, 76 0x960n, 77 'The result of (0xFEDCBA9876543210n % -0x1234n) is 0x960n' 78 ); 79 80 assert.sameValue( 81 0xFEDCBA9876543210n % -0xFEDCBA97n, 82 0x77777779n, 83 'The result of (0xFEDCBA9876543210n % -0xFEDCBA97n) is 0x77777779n' 84 ); 85 86 assert.sameValue( 87 0xFEDCBA9876543210n % -0xFEDCBA98n, 88 0x76543210n, 89 'The result of (0xFEDCBA9876543210n % -0xFEDCBA98n) is 0x76543210n' 90 ); 91 92 assert.sameValue( 93 0xFEDCBA9876543210n % -0xFEDCBA987654320Fn, 94 0x1n, 95 'The result of (0xFEDCBA9876543210n % -0xFEDCBA987654320Fn) is 0x1n' 96 ); 97 98 assert.sameValue( 99 0xFEDCBA9876543210n % -0xFEDCBA9876543210n, 100 0x0n, 101 'The result of (0xFEDCBA9876543210n % -0xFEDCBA9876543210n) is 0x0n' 102 ); 103 104 assert.sameValue( 105 0xFEDCBA987654320Fn % 0xFEDCBA9876543210n, 106 0xFEDCBA987654320Fn, 107 'The result of (0xFEDCBA987654320Fn % 0xFEDCBA9876543210n) is 0xFEDCBA987654320Fn' 108 ); 109 110 assert.sameValue( 111 0xFEDCBA987654320Fn % 0xFEDCBA987654320Fn, 112 0x0n, 113 'The result of (0xFEDCBA987654320Fn % 0xFEDCBA987654320Fn) is 0x0n' 114 ); 115 116 assert.sameValue( 117 0xFEDCBA987654320Fn % 0xFEDCBA98n, 118 0x7654320Fn, 119 'The result of (0xFEDCBA987654320Fn % 0xFEDCBA98n) is 0x7654320Fn' 120 ); 121 122 assert.sameValue( 123 0xFEDCBA987654320Fn % 0xFEDCBA97n, 124 0x77777778n, 125 'The result of (0xFEDCBA987654320Fn % 0xFEDCBA97n) is 0x77777778n' 126 ); 127 128 assert.sameValue( 129 0xFEDCBA987654320Fn % 0x1234n, 130 0x95Fn, 131 'The result of (0xFEDCBA987654320Fn % 0x1234n) is 0x95Fn' 132 ); 133 134 assert.sameValue( 135 0xFEDCBA987654320Fn % 0x3n, 136 0x2n, 137 'The result of (0xFEDCBA987654320Fn % 0x3n) is 0x2n' 138 ); 139 140 assert.sameValue( 141 0xFEDCBA987654320Fn % 0x2n, 142 0x1n, 143 'The result of (0xFEDCBA987654320Fn % 0x2n) is 0x1n' 144 ); 145 146 assert.sameValue( 147 0xFEDCBA987654320Fn % 0x1n, 148 0x0n, 149 'The result of (0xFEDCBA987654320Fn % 0x1n) is 0x0n' 150 ); 151 152 assert.sameValue( 153 0xFEDCBA987654320Fn % -0x1n, 154 0x0n, 155 'The result of (0xFEDCBA987654320Fn % -0x1n) is 0x0n' 156 ); 157 158 assert.sameValue( 159 0xFEDCBA987654320Fn % -0x2n, 160 0x1n, 161 'The result of (0xFEDCBA987654320Fn % -0x2n) is 0x1n' 162 ); 163 164 assert.sameValue( 165 0xFEDCBA987654320Fn % -0x3n, 166 0x2n, 167 'The result of (0xFEDCBA987654320Fn % -0x3n) is 0x2n' 168 ); 169 170 assert.sameValue( 171 0xFEDCBA987654320Fn % -0x1234n, 172 0x95Fn, 173 'The result of (0xFEDCBA987654320Fn % -0x1234n) is 0x95Fn' 174 ); 175 176 assert.sameValue( 177 0xFEDCBA987654320Fn % -0xFEDCBA97n, 178 0x77777778n, 179 'The result of (0xFEDCBA987654320Fn % -0xFEDCBA97n) is 0x77777778n' 180 ); 181 182 assert.sameValue( 183 0xFEDCBA987654320Fn % -0xFEDCBA98n, 184 0x7654320Fn, 185 'The result of (0xFEDCBA987654320Fn % -0xFEDCBA98n) is 0x7654320Fn' 186 ); 187 188 assert.sameValue( 189 0xFEDCBA987654320Fn % -0xFEDCBA987654320Fn, 190 0x0n, 191 'The result of (0xFEDCBA987654320Fn % -0xFEDCBA987654320Fn) is 0x0n' 192 ); 193 194 assert.sameValue( 195 0xFEDCBA987654320Fn % -0xFEDCBA9876543210n, 196 0xFEDCBA987654320Fn, 197 'The result of (0xFEDCBA987654320Fn % -0xFEDCBA9876543210n) is 0xFEDCBA987654320Fn' 198 ); 199 200 assert.sameValue( 201 0xFEDCBA98n % 0xFEDCBA9876543210n, 202 0xFEDCBA98n, 203 'The result of (0xFEDCBA98n % 0xFEDCBA9876543210n) is 0xFEDCBA98n' 204 ); 205 206 assert.sameValue( 207 0xFEDCBA98n % 0xFEDCBA987654320Fn, 208 0xFEDCBA98n, 209 'The result of (0xFEDCBA98n % 0xFEDCBA987654320Fn) is 0xFEDCBA98n' 210 ); 211 212 assert.sameValue( 213 0xFEDCBA98n % 0xFEDCBA98n, 214 0x0n, 215 'The result of (0xFEDCBA98n % 0xFEDCBA98n) is 0x0n' 216 ); 217 218 assert.sameValue( 219 0xFEDCBA98n % 0xFEDCBA97n, 220 0x1n, 221 'The result of (0xFEDCBA98n % 0xFEDCBA97n) is 0x1n' 222 ); 223 224 assert.sameValue(0xFEDCBA98n % 0x1234n, 0x930n, 'The result of (0xFEDCBA98n % 0x1234n) is 0x930n'); 225 assert.sameValue(0xFEDCBA98n % 0x3n, 0x2n, 'The result of (0xFEDCBA98n % 0x3n) is 0x2n'); 226 assert.sameValue(0xFEDCBA98n % 0x2n, 0x0n, 'The result of (0xFEDCBA98n % 0x2n) is 0x0n'); 227 assert.sameValue(0xFEDCBA98n % 0x1n, 0x0n, 'The result of (0xFEDCBA98n % 0x1n) is 0x0n'); 228 assert.sameValue(0xFEDCBA98n % -0x1n, 0x0n, 'The result of (0xFEDCBA98n % -0x1n) is 0x0n'); 229 assert.sameValue(0xFEDCBA98n % -0x2n, 0x0n, 'The result of (0xFEDCBA98n % -0x2n) is 0x0n'); 230 assert.sameValue(0xFEDCBA98n % -0x3n, 0x2n, 'The result of (0xFEDCBA98n % -0x3n) is 0x2n'); 231 232 assert.sameValue( 233 0xFEDCBA98n % -0x1234n, 234 0x930n, 235 'The result of (0xFEDCBA98n % -0x1234n) is 0x930n' 236 ); 237 238 assert.sameValue( 239 0xFEDCBA98n % -0xFEDCBA97n, 240 0x1n, 241 'The result of (0xFEDCBA98n % -0xFEDCBA97n) is 0x1n' 242 ); 243 244 assert.sameValue( 245 0xFEDCBA98n % -0xFEDCBA98n, 246 0x0n, 247 'The result of (0xFEDCBA98n % -0xFEDCBA98n) is 0x0n' 248 ); 249 250 assert.sameValue( 251 0xFEDCBA98n % -0xFEDCBA987654320Fn, 252 0xFEDCBA98n, 253 'The result of (0xFEDCBA98n % -0xFEDCBA987654320Fn) is 0xFEDCBA98n' 254 ); 255 256 assert.sameValue( 257 0xFEDCBA98n % -0xFEDCBA9876543210n, 258 0xFEDCBA98n, 259 'The result of (0xFEDCBA98n % -0xFEDCBA9876543210n) is 0xFEDCBA98n' 260 ); 261 262 assert.sameValue( 263 0xFEDCBA97n % 0xFEDCBA9876543210n, 264 0xFEDCBA97n, 265 'The result of (0xFEDCBA97n % 0xFEDCBA9876543210n) is 0xFEDCBA97n' 266 ); 267 268 assert.sameValue( 269 0xFEDCBA97n % 0xFEDCBA987654320Fn, 270 0xFEDCBA97n, 271 'The result of (0xFEDCBA97n % 0xFEDCBA987654320Fn) is 0xFEDCBA97n' 272 ); 273 274 assert.sameValue( 275 0xFEDCBA97n % 0xFEDCBA98n, 276 0xFEDCBA97n, 277 'The result of (0xFEDCBA97n % 0xFEDCBA98n) is 0xFEDCBA97n' 278 ); 279 280 assert.sameValue( 281 0xFEDCBA97n % 0xFEDCBA97n, 282 0x0n, 283 'The result of (0xFEDCBA97n % 0xFEDCBA97n) is 0x0n' 284 ); 285 286 assert.sameValue(0xFEDCBA97n % 0x1234n, 0x92Fn, 'The result of (0xFEDCBA97n % 0x1234n) is 0x92Fn'); 287 assert.sameValue(0xFEDCBA97n % 0x3n, 0x1n, 'The result of (0xFEDCBA97n % 0x3n) is 0x1n'); 288 assert.sameValue(0xFEDCBA97n % 0x2n, 0x1n, 'The result of (0xFEDCBA97n % 0x2n) is 0x1n'); 289 assert.sameValue(0xFEDCBA97n % 0x1n, 0x0n, 'The result of (0xFEDCBA97n % 0x1n) is 0x0n'); 290 assert.sameValue(0xFEDCBA97n % -0x1n, 0x0n, 'The result of (0xFEDCBA97n % -0x1n) is 0x0n'); 291 assert.sameValue(0xFEDCBA97n % -0x2n, 0x1n, 'The result of (0xFEDCBA97n % -0x2n) is 0x1n'); 292 assert.sameValue(0xFEDCBA97n % -0x3n, 0x1n, 'The result of (0xFEDCBA97n % -0x3n) is 0x1n'); 293 294 assert.sameValue( 295 0xFEDCBA97n % -0x1234n, 296 0x92Fn, 297 'The result of (0xFEDCBA97n % -0x1234n) is 0x92Fn' 298 ); 299 300 assert.sameValue( 301 0xFEDCBA97n % -0xFEDCBA97n, 302 0x0n, 303 'The result of (0xFEDCBA97n % -0xFEDCBA97n) is 0x0n' 304 ); 305 306 assert.sameValue( 307 0xFEDCBA97n % -0xFEDCBA98n, 308 0xFEDCBA97n, 309 'The result of (0xFEDCBA97n % -0xFEDCBA98n) is 0xFEDCBA97n' 310 ); 311 312 assert.sameValue( 313 0xFEDCBA97n % -0xFEDCBA987654320Fn, 314 0xFEDCBA97n, 315 'The result of (0xFEDCBA97n % -0xFEDCBA987654320Fn) is 0xFEDCBA97n' 316 ); 317 318 assert.sameValue( 319 0xFEDCBA97n % -0xFEDCBA9876543210n, 320 0xFEDCBA97n, 321 'The result of (0xFEDCBA97n % -0xFEDCBA9876543210n) is 0xFEDCBA97n' 322 ); 323 324 assert.sameValue( 325 0x1234n % 0xFEDCBA9876543210n, 326 0x1234n, 327 'The result of (0x1234n % 0xFEDCBA9876543210n) is 0x1234n' 328 ); 329 330 assert.sameValue( 331 0x1234n % 0xFEDCBA987654320Fn, 332 0x1234n, 333 'The result of (0x1234n % 0xFEDCBA987654320Fn) is 0x1234n' 334 ); 335 336 assert.sameValue( 337 0x1234n % 0xFEDCBA98n, 338 0x1234n, 339 'The result of (0x1234n % 0xFEDCBA98n) is 0x1234n' 340 ); 341 342 assert.sameValue( 343 0x1234n % 0xFEDCBA97n, 344 0x1234n, 345 'The result of (0x1234n % 0xFEDCBA97n) is 0x1234n' 346 ); 347 348 assert.sameValue(0x1234n % 0x1234n, 0x0n, 'The result of (0x1234n % 0x1234n) is 0x0n'); 349 assert.sameValue(0x1234n % 0x3n, 0x1n, 'The result of (0x1234n % 0x3n) is 0x1n'); 350 assert.sameValue(0x1234n % 0x2n, 0x0n, 'The result of (0x1234n % 0x2n) is 0x0n'); 351 assert.sameValue(0x1234n % 0x1n, 0x0n, 'The result of (0x1234n % 0x1n) is 0x0n'); 352 assert.sameValue(0x1234n % -0x1n, 0x0n, 'The result of (0x1234n % -0x1n) is 0x0n'); 353 assert.sameValue(0x1234n % -0x2n, 0x0n, 'The result of (0x1234n % -0x2n) is 0x0n'); 354 assert.sameValue(0x1234n % -0x3n, 0x1n, 'The result of (0x1234n % -0x3n) is 0x1n'); 355 assert.sameValue(0x1234n % -0x1234n, 0x0n, 'The result of (0x1234n % -0x1234n) is 0x0n'); 356 357 assert.sameValue( 358 0x1234n % -0xFEDCBA97n, 359 0x1234n, 360 'The result of (0x1234n % -0xFEDCBA97n) is 0x1234n' 361 ); 362 363 assert.sameValue( 364 0x1234n % -0xFEDCBA98n, 365 0x1234n, 366 'The result of (0x1234n % -0xFEDCBA98n) is 0x1234n' 367 ); 368 369 assert.sameValue( 370 0x1234n % -0xFEDCBA987654320Fn, 371 0x1234n, 372 'The result of (0x1234n % -0xFEDCBA987654320Fn) is 0x1234n' 373 ); 374 375 assert.sameValue( 376 0x1234n % -0xFEDCBA9876543210n, 377 0x1234n, 378 'The result of (0x1234n % -0xFEDCBA9876543210n) is 0x1234n' 379 ); 380 381 assert.sameValue( 382 0x3n % 0xFEDCBA9876543210n, 383 0x3n, 384 'The result of (0x3n % 0xFEDCBA9876543210n) is 0x3n' 385 ); 386 387 assert.sameValue( 388 0x3n % 0xFEDCBA987654320Fn, 389 0x3n, 390 'The result of (0x3n % 0xFEDCBA987654320Fn) is 0x3n' 391 ); 392 393 assert.sameValue(0x3n % 0xFEDCBA98n, 0x3n, 'The result of (0x3n % 0xFEDCBA98n) is 0x3n'); 394 assert.sameValue(0x3n % 0xFEDCBA97n, 0x3n, 'The result of (0x3n % 0xFEDCBA97n) is 0x3n'); 395 assert.sameValue(0x3n % 0x1234n, 0x3n, 'The result of (0x3n % 0x1234n) is 0x3n'); 396 assert.sameValue(0x3n % 0x3n, 0x0n, 'The result of (0x3n % 0x3n) is 0x0n'); 397 assert.sameValue(0x3n % 0x2n, 0x1n, 'The result of (0x3n % 0x2n) is 0x1n'); 398 assert.sameValue(0x3n % 0x1n, 0x0n, 'The result of (0x3n % 0x1n) is 0x0n'); 399 assert.sameValue(0x3n % -0x1n, 0x0n, 'The result of (0x3n % -0x1n) is 0x0n'); 400 assert.sameValue(0x3n % -0x2n, 0x1n, 'The result of (0x3n % -0x2n) is 0x1n'); 401 assert.sameValue(0x3n % -0x3n, 0x0n, 'The result of (0x3n % -0x3n) is 0x0n'); 402 assert.sameValue(0x3n % -0x1234n, 0x3n, 'The result of (0x3n % -0x1234n) is 0x3n'); 403 assert.sameValue(0x3n % -0xFEDCBA97n, 0x3n, 'The result of (0x3n % -0xFEDCBA97n) is 0x3n'); 404 assert.sameValue(0x3n % -0xFEDCBA98n, 0x3n, 'The result of (0x3n % -0xFEDCBA98n) is 0x3n'); 405 406 assert.sameValue( 407 0x3n % -0xFEDCBA987654320Fn, 408 0x3n, 409 'The result of (0x3n % -0xFEDCBA987654320Fn) is 0x3n' 410 ); 411 412 assert.sameValue( 413 0x3n % -0xFEDCBA9876543210n, 414 0x3n, 415 'The result of (0x3n % -0xFEDCBA9876543210n) is 0x3n' 416 ); 417 418 assert.sameValue( 419 0x2n % 0xFEDCBA9876543210n, 420 0x2n, 421 'The result of (0x2n % 0xFEDCBA9876543210n) is 0x2n' 422 ); 423 424 assert.sameValue( 425 0x2n % 0xFEDCBA987654320Fn, 426 0x2n, 427 'The result of (0x2n % 0xFEDCBA987654320Fn) is 0x2n' 428 ); 429 430 assert.sameValue(0x2n % 0xFEDCBA98n, 0x2n, 'The result of (0x2n % 0xFEDCBA98n) is 0x2n'); 431 assert.sameValue(0x2n % 0xFEDCBA97n, 0x2n, 'The result of (0x2n % 0xFEDCBA97n) is 0x2n'); 432 assert.sameValue(0x2n % 0x1234n, 0x2n, 'The result of (0x2n % 0x1234n) is 0x2n'); 433 assert.sameValue(0x2n % 0x3n, 0x2n, 'The result of (0x2n % 0x3n) is 0x2n'); 434 assert.sameValue(0x2n % 0x2n, 0x0n, 'The result of (0x2n % 0x2n) is 0x0n'); 435 assert.sameValue(0x2n % 0x1n, 0x0n, 'The result of (0x2n % 0x1n) is 0x0n'); 436 assert.sameValue(0x2n % -0x1n, 0x0n, 'The result of (0x2n % -0x1n) is 0x0n'); 437 assert.sameValue(0x2n % -0x2n, 0x0n, 'The result of (0x2n % -0x2n) is 0x0n'); 438 assert.sameValue(0x2n % -0x3n, 0x2n, 'The result of (0x2n % -0x3n) is 0x2n'); 439 assert.sameValue(0x2n % -0x1234n, 0x2n, 'The result of (0x2n % -0x1234n) is 0x2n'); 440 assert.sameValue(0x2n % -0xFEDCBA97n, 0x2n, 'The result of (0x2n % -0xFEDCBA97n) is 0x2n'); 441 assert.sameValue(0x2n % -0xFEDCBA98n, 0x2n, 'The result of (0x2n % -0xFEDCBA98n) is 0x2n'); 442 443 assert.sameValue( 444 0x2n % -0xFEDCBA987654320Fn, 445 0x2n, 446 'The result of (0x2n % -0xFEDCBA987654320Fn) is 0x2n' 447 ); 448 449 assert.sameValue( 450 0x2n % -0xFEDCBA9876543210n, 451 0x2n, 452 'The result of (0x2n % -0xFEDCBA9876543210n) is 0x2n' 453 ); 454 455 assert.sameValue( 456 0x1n % 0xFEDCBA9876543210n, 457 0x1n, 458 'The result of (0x1n % 0xFEDCBA9876543210n) is 0x1n' 459 ); 460 461 assert.sameValue( 462 0x1n % 0xFEDCBA987654320Fn, 463 0x1n, 464 'The result of (0x1n % 0xFEDCBA987654320Fn) is 0x1n' 465 ); 466 467 assert.sameValue(0x1n % 0xFEDCBA98n, 0x1n, 'The result of (0x1n % 0xFEDCBA98n) is 0x1n'); 468 assert.sameValue(0x1n % 0xFEDCBA97n, 0x1n, 'The result of (0x1n % 0xFEDCBA97n) is 0x1n'); 469 assert.sameValue(0x1n % 0x1234n, 0x1n, 'The result of (0x1n % 0x1234n) is 0x1n'); 470 assert.sameValue(0x1n % 0x3n, 0x1n, 'The result of (0x1n % 0x3n) is 0x1n'); 471 assert.sameValue(0x1n % 0x2n, 0x1n, 'The result of (0x1n % 0x2n) is 0x1n'); 472 assert.sameValue(0x1n % 0x1n, 0x0n, 'The result of (0x1n % 0x1n) is 0x0n'); 473 assert.sameValue(0x1n % -0x1n, 0x0n, 'The result of (0x1n % -0x1n) is 0x0n'); 474 assert.sameValue(0x1n % -0x2n, 0x1n, 'The result of (0x1n % -0x2n) is 0x1n'); 475 assert.sameValue(0x1n % -0x3n, 0x1n, 'The result of (0x1n % -0x3n) is 0x1n'); 476 assert.sameValue(0x1n % -0x1234n, 0x1n, 'The result of (0x1n % -0x1234n) is 0x1n'); 477 assert.sameValue(0x1n % -0xFEDCBA97n, 0x1n, 'The result of (0x1n % -0xFEDCBA97n) is 0x1n'); 478 assert.sameValue(0x1n % -0xFEDCBA98n, 0x1n, 'The result of (0x1n % -0xFEDCBA98n) is 0x1n'); 479 480 assert.sameValue( 481 0x1n % -0xFEDCBA987654320Fn, 482 0x1n, 483 'The result of (0x1n % -0xFEDCBA987654320Fn) is 0x1n' 484 ); 485 486 assert.sameValue( 487 0x1n % -0xFEDCBA9876543210n, 488 0x1n, 489 'The result of (0x1n % -0xFEDCBA9876543210n) is 0x1n' 490 ); 491 492 assert.sameValue( 493 -0x1n % 0xFEDCBA9876543210n, 494 -0x1n, 495 'The result of (-0x1n % 0xFEDCBA9876543210n) is -0x1n' 496 ); 497 498 assert.sameValue( 499 -0x1n % 0xFEDCBA987654320Fn, 500 -0x1n, 501 'The result of (-0x1n % 0xFEDCBA987654320Fn) is -0x1n' 502 ); 503 504 assert.sameValue(-0x1n % 0xFEDCBA98n, -0x1n, 'The result of (-0x1n % 0xFEDCBA98n) is -0x1n'); 505 assert.sameValue(-0x1n % 0xFEDCBA97n, -0x1n, 'The result of (-0x1n % 0xFEDCBA97n) is -0x1n'); 506 assert.sameValue(-0x1n % 0x1234n, -0x1n, 'The result of (-0x1n % 0x1234n) is -0x1n'); 507 assert.sameValue(-0x1n % 0x3n, -0x1n, 'The result of (-0x1n % 0x3n) is -0x1n'); 508 assert.sameValue(-0x1n % 0x2n, -0x1n, 'The result of (-0x1n % 0x2n) is -0x1n'); 509 assert.sameValue(-0x1n % 0x1n, 0x0n, 'The result of (-0x1n % 0x1n) is 0x0n'); 510 assert.sameValue(-0x1n % -0x1n, 0x0n, 'The result of (-0x1n % -0x1n) is 0x0n'); 511 assert.sameValue(-0x1n % -0x2n, -0x1n, 'The result of (-0x1n % -0x2n) is -0x1n'); 512 assert.sameValue(-0x1n % -0x3n, -0x1n, 'The result of (-0x1n % -0x3n) is -0x1n'); 513 assert.sameValue(-0x1n % -0x1234n, -0x1n, 'The result of (-0x1n % -0x1234n) is -0x1n'); 514 assert.sameValue(-0x1n % -0xFEDCBA97n, -0x1n, 'The result of (-0x1n % -0xFEDCBA97n) is -0x1n'); 515 assert.sameValue(-0x1n % -0xFEDCBA98n, -0x1n, 'The result of (-0x1n % -0xFEDCBA98n) is -0x1n'); 516 517 assert.sameValue( 518 -0x1n % -0xFEDCBA987654320Fn, 519 -0x1n, 520 'The result of (-0x1n % -0xFEDCBA987654320Fn) is -0x1n' 521 ); 522 523 assert.sameValue( 524 -0x1n % -0xFEDCBA9876543210n, 525 -0x1n, 526 'The result of (-0x1n % -0xFEDCBA9876543210n) is -0x1n' 527 ); 528 529 assert.sameValue( 530 -0x2n % 0xFEDCBA9876543210n, 531 -0x2n, 532 'The result of (-0x2n % 0xFEDCBA9876543210n) is -0x2n' 533 ); 534 535 assert.sameValue( 536 -0x2n % 0xFEDCBA987654320Fn, 537 -0x2n, 538 'The result of (-0x2n % 0xFEDCBA987654320Fn) is -0x2n' 539 ); 540 541 assert.sameValue(-0x2n % 0xFEDCBA98n, -0x2n, 'The result of (-0x2n % 0xFEDCBA98n) is -0x2n'); 542 assert.sameValue(-0x2n % 0xFEDCBA97n, -0x2n, 'The result of (-0x2n % 0xFEDCBA97n) is -0x2n'); 543 assert.sameValue(-0x2n % 0x1234n, -0x2n, 'The result of (-0x2n % 0x1234n) is -0x2n'); 544 assert.sameValue(-0x2n % 0x3n, -0x2n, 'The result of (-0x2n % 0x3n) is -0x2n'); 545 assert.sameValue(-0x2n % 0x2n, 0x0n, 'The result of (-0x2n % 0x2n) is 0x0n'); 546 assert.sameValue(-0x2n % 0x1n, 0x0n, 'The result of (-0x2n % 0x1n) is 0x0n'); 547 assert.sameValue(-0x2n % -0x1n, 0x0n, 'The result of (-0x2n % -0x1n) is 0x0n'); 548 assert.sameValue(-0x2n % -0x2n, 0x0n, 'The result of (-0x2n % -0x2n) is 0x0n'); 549 assert.sameValue(-0x2n % -0x3n, -0x2n, 'The result of (-0x2n % -0x3n) is -0x2n'); 550 assert.sameValue(-0x2n % -0x1234n, -0x2n, 'The result of (-0x2n % -0x1234n) is -0x2n'); 551 assert.sameValue(-0x2n % -0xFEDCBA97n, -0x2n, 'The result of (-0x2n % -0xFEDCBA97n) is -0x2n'); 552 assert.sameValue(-0x2n % -0xFEDCBA98n, -0x2n, 'The result of (-0x2n % -0xFEDCBA98n) is -0x2n'); 553 554 assert.sameValue( 555 -0x2n % -0xFEDCBA987654320Fn, 556 -0x2n, 557 'The result of (-0x2n % -0xFEDCBA987654320Fn) is -0x2n' 558 ); 559 560 assert.sameValue( 561 -0x2n % -0xFEDCBA9876543210n, 562 -0x2n, 563 'The result of (-0x2n % -0xFEDCBA9876543210n) is -0x2n' 564 ); 565 566 assert.sameValue( 567 -0x3n % 0xFEDCBA9876543210n, 568 -0x3n, 569 'The result of (-0x3n % 0xFEDCBA9876543210n) is -0x3n' 570 ); 571 572 assert.sameValue( 573 -0x3n % 0xFEDCBA987654320Fn, 574 -0x3n, 575 'The result of (-0x3n % 0xFEDCBA987654320Fn) is -0x3n' 576 ); 577 578 assert.sameValue(-0x3n % 0xFEDCBA98n, -0x3n, 'The result of (-0x3n % 0xFEDCBA98n) is -0x3n'); 579 assert.sameValue(-0x3n % 0xFEDCBA97n, -0x3n, 'The result of (-0x3n % 0xFEDCBA97n) is -0x3n'); 580 assert.sameValue(-0x3n % 0x1234n, -0x3n, 'The result of (-0x3n % 0x1234n) is -0x3n'); 581 assert.sameValue(-0x3n % 0x3n, 0x0n, 'The result of (-0x3n % 0x3n) is 0x0n'); 582 assert.sameValue(-0x3n % 0x2n, -0x1n, 'The result of (-0x3n % 0x2n) is -0x1n'); 583 assert.sameValue(-0x3n % 0x1n, 0x0n, 'The result of (-0x3n % 0x1n) is 0x0n'); 584 assert.sameValue(-0x3n % -0x1n, 0x0n, 'The result of (-0x3n % -0x1n) is 0x0n'); 585 assert.sameValue(-0x3n % -0x2n, -0x1n, 'The result of (-0x3n % -0x2n) is -0x1n'); 586 assert.sameValue(-0x3n % -0x3n, 0x0n, 'The result of (-0x3n % -0x3n) is 0x0n'); 587 assert.sameValue(-0x3n % -0x1234n, -0x3n, 'The result of (-0x3n % -0x1234n) is -0x3n'); 588 assert.sameValue(-0x3n % -0xFEDCBA97n, -0x3n, 'The result of (-0x3n % -0xFEDCBA97n) is -0x3n'); 589 assert.sameValue(-0x3n % -0xFEDCBA98n, -0x3n, 'The result of (-0x3n % -0xFEDCBA98n) is -0x3n'); 590 591 assert.sameValue( 592 -0x3n % -0xFEDCBA987654320Fn, 593 -0x3n, 594 'The result of (-0x3n % -0xFEDCBA987654320Fn) is -0x3n' 595 ); 596 597 assert.sameValue( 598 -0x3n % -0xFEDCBA9876543210n, 599 -0x3n, 600 'The result of (-0x3n % -0xFEDCBA9876543210n) is -0x3n' 601 ); 602 603 assert.sameValue( 604 -0x1234n % 0xFEDCBA9876543210n, 605 -0x1234n, 606 'The result of (-0x1234n % 0xFEDCBA9876543210n) is -0x1234n' 607 ); 608 609 assert.sameValue( 610 -0x1234n % 0xFEDCBA987654320Fn, 611 -0x1234n, 612 'The result of (-0x1234n % 0xFEDCBA987654320Fn) is -0x1234n' 613 ); 614 615 assert.sameValue( 616 -0x1234n % 0xFEDCBA98n, 617 -0x1234n, 618 'The result of (-0x1234n % 0xFEDCBA98n) is -0x1234n' 619 ); 620 621 assert.sameValue( 622 -0x1234n % 0xFEDCBA97n, 623 -0x1234n, 624 'The result of (-0x1234n % 0xFEDCBA97n) is -0x1234n' 625 ); 626 627 assert.sameValue(-0x1234n % 0x1234n, 0x0n, 'The result of (-0x1234n % 0x1234n) is 0x0n'); 628 assert.sameValue(-0x1234n % 0x3n, -0x1n, 'The result of (-0x1234n % 0x3n) is -0x1n'); 629 assert.sameValue(-0x1234n % 0x2n, 0x0n, 'The result of (-0x1234n % 0x2n) is 0x0n'); 630 assert.sameValue(-0x1234n % 0x1n, 0x0n, 'The result of (-0x1234n % 0x1n) is 0x0n'); 631 assert.sameValue(-0x1234n % -0x1n, 0x0n, 'The result of (-0x1234n % -0x1n) is 0x0n'); 632 assert.sameValue(-0x1234n % -0x2n, 0x0n, 'The result of (-0x1234n % -0x2n) is 0x0n'); 633 assert.sameValue(-0x1234n % -0x3n, -0x1n, 'The result of (-0x1234n % -0x3n) is -0x1n'); 634 assert.sameValue(-0x1234n % -0x1234n, 0x0n, 'The result of (-0x1234n % -0x1234n) is 0x0n'); 635 636 assert.sameValue( 637 -0x1234n % -0xFEDCBA97n, 638 -0x1234n, 639 'The result of (-0x1234n % -0xFEDCBA97n) is -0x1234n' 640 ); 641 642 assert.sameValue( 643 -0x1234n % -0xFEDCBA98n, 644 -0x1234n, 645 'The result of (-0x1234n % -0xFEDCBA98n) is -0x1234n' 646 ); 647 648 assert.sameValue( 649 -0x1234n % -0xFEDCBA987654320Fn, 650 -0x1234n, 651 'The result of (-0x1234n % -0xFEDCBA987654320Fn) is -0x1234n' 652 ); 653 654 assert.sameValue( 655 -0x1234n % -0xFEDCBA9876543210n, 656 -0x1234n, 657 'The result of (-0x1234n % -0xFEDCBA9876543210n) is -0x1234n' 658 ); 659 660 assert.sameValue( 661 -0xFEDCBA97n % 0xFEDCBA9876543210n, 662 -0xFEDCBA97n, 663 'The result of (-0xFEDCBA97n % 0xFEDCBA9876543210n) is -0xFEDCBA97n' 664 ); 665 666 assert.sameValue( 667 -0xFEDCBA97n % 0xFEDCBA987654320Fn, 668 -0xFEDCBA97n, 669 'The result of (-0xFEDCBA97n % 0xFEDCBA987654320Fn) is -0xFEDCBA97n' 670 ); 671 672 assert.sameValue( 673 -0xFEDCBA97n % 0xFEDCBA98n, 674 -0xFEDCBA97n, 675 'The result of (-0xFEDCBA97n % 0xFEDCBA98n) is -0xFEDCBA97n' 676 ); 677 678 assert.sameValue( 679 -0xFEDCBA97n % 0xFEDCBA97n, 680 0x0n, 681 'The result of (-0xFEDCBA97n % 0xFEDCBA97n) is 0x0n' 682 ); 683 684 assert.sameValue( 685 -0xFEDCBA97n % 0x1234n, 686 -0x92Fn, 687 'The result of (-0xFEDCBA97n % 0x1234n) is -0x92Fn' 688 ); 689 690 assert.sameValue(-0xFEDCBA97n % 0x3n, -0x1n, 'The result of (-0xFEDCBA97n % 0x3n) is -0x1n'); 691 assert.sameValue(-0xFEDCBA97n % 0x2n, -0x1n, 'The result of (-0xFEDCBA97n % 0x2n) is -0x1n'); 692 assert.sameValue(-0xFEDCBA97n % 0x1n, 0x0n, 'The result of (-0xFEDCBA97n % 0x1n) is 0x0n'); 693 assert.sameValue(-0xFEDCBA97n % -0x1n, 0x0n, 'The result of (-0xFEDCBA97n % -0x1n) is 0x0n'); 694 assert.sameValue(-0xFEDCBA97n % -0x2n, -0x1n, 'The result of (-0xFEDCBA97n % -0x2n) is -0x1n'); 695 assert.sameValue(-0xFEDCBA97n % -0x3n, -0x1n, 'The result of (-0xFEDCBA97n % -0x3n) is -0x1n'); 696 697 assert.sameValue( 698 -0xFEDCBA97n % -0x1234n, 699 -0x92Fn, 700 'The result of (-0xFEDCBA97n % -0x1234n) is -0x92Fn' 701 ); 702 703 assert.sameValue( 704 -0xFEDCBA97n % -0xFEDCBA97n, 705 0x0n, 706 'The result of (-0xFEDCBA97n % -0xFEDCBA97n) is 0x0n' 707 ); 708 709 assert.sameValue( 710 -0xFEDCBA97n % -0xFEDCBA98n, 711 -0xFEDCBA97n, 712 'The result of (-0xFEDCBA97n % -0xFEDCBA98n) is -0xFEDCBA97n' 713 ); 714 715 assert.sameValue( 716 -0xFEDCBA97n % -0xFEDCBA987654320Fn, 717 -0xFEDCBA97n, 718 'The result of (-0xFEDCBA97n % -0xFEDCBA987654320Fn) is -0xFEDCBA97n' 719 ); 720 721 assert.sameValue( 722 -0xFEDCBA97n % -0xFEDCBA9876543210n, 723 -0xFEDCBA97n, 724 'The result of (-0xFEDCBA97n % -0xFEDCBA9876543210n) is -0xFEDCBA97n' 725 ); 726 727 assert.sameValue( 728 -0xFEDCBA98n % 0xFEDCBA9876543210n, 729 -0xFEDCBA98n, 730 'The result of (-0xFEDCBA98n % 0xFEDCBA9876543210n) is -0xFEDCBA98n' 731 ); 732 733 assert.sameValue( 734 -0xFEDCBA98n % 0xFEDCBA987654320Fn, 735 -0xFEDCBA98n, 736 'The result of (-0xFEDCBA98n % 0xFEDCBA987654320Fn) is -0xFEDCBA98n' 737 ); 738 739 assert.sameValue( 740 -0xFEDCBA98n % 0xFEDCBA98n, 741 0x0n, 742 'The result of (-0xFEDCBA98n % 0xFEDCBA98n) is 0x0n' 743 ); 744 745 assert.sameValue( 746 -0xFEDCBA98n % 0xFEDCBA97n, 747 -0x1n, 748 'The result of (-0xFEDCBA98n % 0xFEDCBA97n) is -0x1n' 749 ); 750 751 assert.sameValue( 752 -0xFEDCBA98n % 0x1234n, 753 -0x930n, 754 'The result of (-0xFEDCBA98n % 0x1234n) is -0x930n' 755 ); 756 757 assert.sameValue(-0xFEDCBA98n % 0x3n, -0x2n, 'The result of (-0xFEDCBA98n % 0x3n) is -0x2n'); 758 assert.sameValue(-0xFEDCBA98n % 0x2n, 0x0n, 'The result of (-0xFEDCBA98n % 0x2n) is 0x0n'); 759 assert.sameValue(-0xFEDCBA98n % 0x1n, 0x0n, 'The result of (-0xFEDCBA98n % 0x1n) is 0x0n'); 760 assert.sameValue(-0xFEDCBA98n % -0x1n, 0x0n, 'The result of (-0xFEDCBA98n % -0x1n) is 0x0n'); 761 assert.sameValue(-0xFEDCBA98n % -0x2n, 0x0n, 'The result of (-0xFEDCBA98n % -0x2n) is 0x0n'); 762 assert.sameValue(-0xFEDCBA98n % -0x3n, -0x2n, 'The result of (-0xFEDCBA98n % -0x3n) is -0x2n'); 763 764 assert.sameValue( 765 -0xFEDCBA98n % -0x1234n, 766 -0x930n, 767 'The result of (-0xFEDCBA98n % -0x1234n) is -0x930n' 768 ); 769 770 assert.sameValue( 771 -0xFEDCBA98n % -0xFEDCBA97n, 772 -0x1n, 773 'The result of (-0xFEDCBA98n % -0xFEDCBA97n) is -0x1n' 774 ); 775 776 assert.sameValue( 777 -0xFEDCBA98n % -0xFEDCBA98n, 778 0x0n, 779 'The result of (-0xFEDCBA98n % -0xFEDCBA98n) is 0x0n' 780 ); 781 782 assert.sameValue( 783 -0xFEDCBA98n % -0xFEDCBA987654320Fn, 784 -0xFEDCBA98n, 785 'The result of (-0xFEDCBA98n % -0xFEDCBA987654320Fn) is -0xFEDCBA98n' 786 ); 787 788 assert.sameValue( 789 -0xFEDCBA98n % -0xFEDCBA9876543210n, 790 -0xFEDCBA98n, 791 'The result of (-0xFEDCBA98n % -0xFEDCBA9876543210n) is -0xFEDCBA98n' 792 ); 793 794 assert.sameValue( 795 -0xFEDCBA987654320Fn % 0xFEDCBA9876543210n, 796 -0xFEDCBA987654320Fn, 797 'The result of (-0xFEDCBA987654320Fn % 0xFEDCBA9876543210n) is -0xFEDCBA987654320Fn' 798 ); 799 800 assert.sameValue( 801 -0xFEDCBA987654320Fn % 0xFEDCBA987654320Fn, 802 0x0n, 803 'The result of (-0xFEDCBA987654320Fn % 0xFEDCBA987654320Fn) is 0x0n' 804 ); 805 806 assert.sameValue( 807 -0xFEDCBA987654320Fn % 0xFEDCBA98n, 808 -0x7654320Fn, 809 'The result of (-0xFEDCBA987654320Fn % 0xFEDCBA98n) is -0x7654320Fn' 810 ); 811 812 assert.sameValue( 813 -0xFEDCBA987654320Fn % 0xFEDCBA97n, 814 -0x77777778n, 815 'The result of (-0xFEDCBA987654320Fn % 0xFEDCBA97n) is -0x77777778n' 816 ); 817 818 assert.sameValue( 819 -0xFEDCBA987654320Fn % 0x1234n, 820 -0x95Fn, 821 'The result of (-0xFEDCBA987654320Fn % 0x1234n) is -0x95Fn' 822 ); 823 824 assert.sameValue( 825 -0xFEDCBA987654320Fn % 0x3n, 826 -0x2n, 827 'The result of (-0xFEDCBA987654320Fn % 0x3n) is -0x2n' 828 ); 829 830 assert.sameValue( 831 -0xFEDCBA987654320Fn % 0x2n, 832 -0x1n, 833 'The result of (-0xFEDCBA987654320Fn % 0x2n) is -0x1n' 834 ); 835 836 assert.sameValue( 837 -0xFEDCBA987654320Fn % 0x1n, 838 0x0n, 839 'The result of (-0xFEDCBA987654320Fn % 0x1n) is 0x0n' 840 ); 841 842 assert.sameValue( 843 -0xFEDCBA987654320Fn % -0x1n, 844 0x0n, 845 'The result of (-0xFEDCBA987654320Fn % -0x1n) is 0x0n' 846 ); 847 848 assert.sameValue( 849 -0xFEDCBA987654320Fn % -0x2n, 850 -0x1n, 851 'The result of (-0xFEDCBA987654320Fn % -0x2n) is -0x1n' 852 ); 853 854 assert.sameValue( 855 -0xFEDCBA987654320Fn % -0x3n, 856 -0x2n, 857 'The result of (-0xFEDCBA987654320Fn % -0x3n) is -0x2n' 858 ); 859 860 assert.sameValue( 861 -0xFEDCBA987654320Fn % -0x1234n, 862 -0x95Fn, 863 'The result of (-0xFEDCBA987654320Fn % -0x1234n) is -0x95Fn' 864 ); 865 866 assert.sameValue( 867 -0xFEDCBA987654320Fn % -0xFEDCBA97n, 868 -0x77777778n, 869 'The result of (-0xFEDCBA987654320Fn % -0xFEDCBA97n) is -0x77777778n' 870 ); 871 872 assert.sameValue( 873 -0xFEDCBA987654320Fn % -0xFEDCBA98n, 874 -0x7654320Fn, 875 'The result of (-0xFEDCBA987654320Fn % -0xFEDCBA98n) is -0x7654320Fn' 876 ); 877 878 assert.sameValue( 879 -0xFEDCBA987654320Fn % -0xFEDCBA987654320Fn, 880 0x0n, 881 'The result of (-0xFEDCBA987654320Fn % -0xFEDCBA987654320Fn) is 0x0n' 882 ); 883 884 assert.sameValue( 885 -0xFEDCBA987654320Fn % -0xFEDCBA9876543210n, 886 -0xFEDCBA987654320Fn, 887 'The result of (-0xFEDCBA987654320Fn % -0xFEDCBA9876543210n) is -0xFEDCBA987654320Fn' 888 ); 889 890 assert.sameValue( 891 -0xFEDCBA9876543210n % 0xFEDCBA9876543210n, 892 0x0n, 893 'The result of (-0xFEDCBA9876543210n % 0xFEDCBA9876543210n) is 0x0n' 894 ); 895 896 assert.sameValue( 897 -0xFEDCBA9876543210n % 0xFEDCBA987654320Fn, 898 -0x1n, 899 'The result of (-0xFEDCBA9876543210n % 0xFEDCBA987654320Fn) is -0x1n' 900 ); 901 902 assert.sameValue( 903 -0xFEDCBA9876543210n % 0xFEDCBA98n, 904 -0x76543210n, 905 'The result of (-0xFEDCBA9876543210n % 0xFEDCBA98n) is -0x76543210n' 906 ); 907 908 assert.sameValue( 909 -0xFEDCBA9876543210n % 0xFEDCBA97n, 910 -0x77777779n, 911 'The result of (-0xFEDCBA9876543210n % 0xFEDCBA97n) is -0x77777779n' 912 ); 913 914 assert.sameValue( 915 -0xFEDCBA9876543210n % 0x1234n, 916 -0x960n, 917 'The result of (-0xFEDCBA9876543210n % 0x1234n) is -0x960n' 918 ); 919 920 assert.sameValue( 921 -0xFEDCBA9876543210n % 0x3n, 922 0x0n, 923 'The result of (-0xFEDCBA9876543210n % 0x3n) is 0x0n' 924 ); 925 926 assert.sameValue( 927 -0xFEDCBA9876543210n % 0x2n, 928 0x0n, 929 'The result of (-0xFEDCBA9876543210n % 0x2n) is 0x0n' 930 ); 931 932 assert.sameValue( 933 -0xFEDCBA9876543210n % 0x1n, 934 0x0n, 935 'The result of (-0xFEDCBA9876543210n % 0x1n) is 0x0n' 936 ); 937 938 assert.sameValue( 939 -0xFEDCBA9876543210n % -0x1n, 940 0x0n, 941 'The result of (-0xFEDCBA9876543210n % -0x1n) is 0x0n' 942 ); 943 944 assert.sameValue( 945 -0xFEDCBA9876543210n % -0x2n, 946 0x0n, 947 'The result of (-0xFEDCBA9876543210n % -0x2n) is 0x0n' 948 ); 949 950 assert.sameValue( 951 -0xFEDCBA9876543210n % -0x3n, 952 0x0n, 953 'The result of (-0xFEDCBA9876543210n % -0x3n) is 0x0n' 954 ); 955 956 assert.sameValue( 957 -0xFEDCBA9876543210n % -0x1234n, 958 -0x960n, 959 'The result of (-0xFEDCBA9876543210n % -0x1234n) is -0x960n' 960 ); 961 962 assert.sameValue( 963 -0xFEDCBA9876543210n % -0xFEDCBA97n, 964 -0x77777779n, 965 'The result of (-0xFEDCBA9876543210n % -0xFEDCBA97n) is -0x77777779n' 966 ); 967 968 assert.sameValue( 969 -0xFEDCBA9876543210n % -0xFEDCBA98n, 970 -0x76543210n, 971 'The result of (-0xFEDCBA9876543210n % -0xFEDCBA98n) is -0x76543210n' 972 ); 973 974 assert.sameValue( 975 -0xFEDCBA9876543210n % -0xFEDCBA987654320Fn, 976 -0x1n, 977 'The result of (-0xFEDCBA9876543210n % -0xFEDCBA987654320Fn) is -0x1n' 978 ); 979 980 assert.sameValue( 981 -0xFEDCBA9876543210n % -0xFEDCBA9876543210n, 982 0x0n, 983 'The result of (-0xFEDCBA9876543210n % -0xFEDCBA9876543210n) is 0x0n' 984 ); 985 986 reportCompare(0, 0);