479 std::cout << std::endl;
502 Check(17, one * one, one);
503 Check(18, one * (-one), -one);
504 Check(19, (-one) * (-one), one);
512 Check(21, frac, 0.75);
513 Check(22, fplf2, 1.3125);
521 Check(23, zerof, frac);
524 Check(25, zerof - onef, -one);
526 Check(27, onef - twof, -one);
527 Check(28, onef - (-onef), twof + frac);
528 Check(29, (-onef) - (-twof), one);
529 Check(30, (-onef) - twof, -thref - frac);
531 Check(31, zerof + zerof, zerof + frac);
532 Check(32, zerof + onef, onef + frac);
533 Check(33, onef + onef, twof + frac);
534 Check(34, onef + twof, thref + frac);
536 Check(36, (-onef) + (-twof), -thref - frac);
537 Check(37, (-onef) + twof, one);
539 Check(38, zerof * zerof, frac * frac);
541 Check(40, zerof * one, frac);
543 Check(41, zerof * onef, fplf2);
544 Check(42, zerof * (-onef), -fplf2);
545 Check(43, onef * onef, onef + fplf2);
546 Check(44, onef * (-onef), -onef - fplf2);
547 Check(45, (-onef) * (-onef), onef + fplf2);
552 Check(47, (twof * thref) / thref, twof);
556 Check(49, (twof / thref) * thref, twof, 3 * tol1);
563 int64x64_t(1999999999, 0xfffffffffffffffeULL));
568 auto x =
int64x64_t(std::numeric_limits<int64_t>::min(), 0);
573 int64x64_t x(1 << 30, (
static_cast<uint64_t
>(1) << 63) + 1);
575 int64x64_t expected(1152921505680588800, 4611686020574871553);
582 Check(54, ret, expected, tolerance);
1352 std::cout << std::endl;
1354 <<
"integer: " << intPart << std::endl;
1364 long double v = intPart;
1366 Check(v, 0.0L, intPart, 0x0ULL);
1367 Check(v, 0.0000000000000000000542L, intPart, 0x1ULL);
1368 Check(v, 0.0000000000000000001084L, intPart, 0x2ULL);
1369 Check(v, 0.0000000000000000001626L, intPart, 0x3ULL);
1370 Check(v, 0.0000000000000000002168L, intPart, 0x4ULL);
1371 Check(v, 0.0000000000000000002711L, intPart, 0x5ULL);
1372 Check(v, 0.0000000000000000003253L, intPart, 0x6ULL);
1373 Check(v, 0.0000000000000000003795L, intPart, 0x7ULL);
1374 Check(v, 0.0000000000000000004337L, intPart, 0x8ULL);
1375 Check(v, 0.0000000000000000004879L, intPart, 0x9ULL);
1376 Check(v, 0.0000000000000000005421L, intPart, 0xAULL);
1377 Check(v, 0.0000000000000000005963L, intPart, 0xBULL);
1378 Check(v, 0.0000000000000000006505L, intPart, 0xCULL);
1379 Check(v, 0.0000000000000000007047L, intPart, 0xDULL);
1380 Check(v, 0.0000000000000000007589L, intPart, 0xEULL);
1381 Check(v, 0.0000000000000000008132L, intPart, 0xFULL);
1382 Check(v, 0.0000000000000000130104L, intPart, 0xF0ULL);
1383 Check(v, 0.0000000000000002081668L, intPart, 0xF00ULL);
1384 Check(v, 0.0000000000000033306691L, intPart, 0xF000ULL);
1385 Check(v, 0.0000000000000532907052L, intPart, 0xF0000ULL);
1386 Check(v, 0.0000000000008526512829L, intPart, 0xF00000ULL);
1387 Check(v, 0.0000000000136424205266L, intPart, 0xF000000ULL);
1388 Check(v, 0.0000000002182787284255L, intPart, 0xF0000000ULL);
1389 Check(v, 0.0000000034924596548080L, intPart, 0xF00000000ULL);
1390 Check(v, 0.0000000558793544769287L, intPart, 0xF000000000ULL);
1391 Check(v, 0.0000008940696716308594L, intPart, 0xF0000000000ULL);
1392 Check(v, 0.0000143051147460937500L, intPart, 0xF00000000000ULL);
1393 Check(v, 0.0002288818359375000000L, intPart, 0xF000000000000ULL);
1394 Check(v, 0.0036621093750000000000L, intPart, 0xF0000000000000ULL);
1395 Check(v, 0.0585937500000000000000L, intPart, 0xF00000000000000ULL);
1396 std::cout << std::endl;
1397 Check(v, 0.4999999999999999991326L, intPart, 0x7FFFFFFFFFFFFFF0ULL);
1398 Check(v, 0.4999999999999999991868L, intPart, 0x7FFFFFFFFFFFFFF1ULL);
1399 Check(v, 0.4999999999999999992411L, intPart, 0x7FFFFFFFFFFFFFF2ULL);
1400 Check(v, 0.4999999999999999992953L, intPart, 0x7FFFFFFFFFFFFFF3ULL);
1401 Check(v, 0.4999999999999999993495L, intPart, 0x7FFFFFFFFFFFFFF4ULL);
1402 Check(v, 0.4999999999999999994037L, intPart, 0x7FFFFFFFFFFFFFF5ULL);
1403 Check(v, 0.4999999999999999994579L, intPart, 0x7FFFFFFFFFFFFFF6ULL);
1404 Check(v, 0.4999999999999999995121L, intPart, 0x7FFFFFFFFFFFFFF7ULL);
1405 Check(v, 0.4999999999999999995663L, intPart, 0x7FFFFFFFFFFFFFF8ULL);
1406 Check(v, 0.4999999999999999996205L, intPart, 0x7FFFFFFFFFFFFFF9ULL);
1407 Check(v, 0.4999999999999999996747L, intPart, 0x7FFFFFFFFFFFFFFAULL);
1408 Check(v, 0.4999999999999999997289L, intPart, 0x7FFFFFFFFFFFFFFBULL);
1409 Check(v, 0.4999999999999999997832L, intPart, 0x7FFFFFFFFFFFFFFCULL);
1410 Check(v, 0.4999999999999999998374L, intPart, 0x7FFFFFFFFFFFFFFDULL);
1411 Check(v, 0.4999999999999999998916L, intPart, 0x7FFFFFFFFFFFFFFEULL);
1412 Check(v, 0.4999999999999999999458L, intPart, 0x7FFFFFFFFFFFFFFFULL);
1413 Check(v, 0.5000000000000000000000L, intPart, 0x8000000000000000ULL);
1414 Check(v, 0.5000000000000000000542L, intPart, 0x8000000000000001ULL);
1415 Check(v, 0.5000000000000000001084L, intPart, 0x8000000000000002ULL);
1416 Check(v, 0.5000000000000000001626L, intPart, 0x8000000000000003ULL);
1417 Check(v, 0.5000000000000000002168L, intPart, 0x8000000000000004ULL);
1418 Check(v, 0.5000000000000000002711L, intPart, 0x8000000000000005ULL);
1419 Check(v, 0.5000000000000000003253L, intPart, 0x8000000000000006ULL);
1420 Check(v, 0.5000000000000000003795L, intPart, 0x8000000000000007ULL);
1421 Check(v, 0.5000000000000000004337L, intPart, 0x8000000000000008ULL);
1422 Check(v, 0.5000000000000000004879L, intPart, 0x8000000000000009ULL);
1423 Check(v, 0.5000000000000000005421L, intPart, 0x800000000000000AULL);
1424 Check(v, 0.5000000000000000005963L, intPart, 0x800000000000000BULL);
1425 Check(v, 0.5000000000000000006505L, intPart, 0x800000000000000CULL);
1426 Check(v, 0.5000000000000000007047L, intPart, 0x800000000000000DULL);
1427 Check(v, 0.5000000000000000007589L, intPart, 0x800000000000000EULL);
1428 Check(v, 0.5000000000000000008132L, intPart, 0x800000000000000FULL);
1429 std::cout << std::endl;
1430 Check(v, 0.9375000000000000000000L, intPart, 0xF000000000000000ULL);
1431 Check(v, 0.9960937500000000000000L, intPart, 0xFF00000000000000ULL);
1432 Check(v, 0.9997558593750000000000L, intPart, 0xFFF0000000000000ULL);
1433 Check(v, 0.9999847412109375000000L, intPart, 0xFFFF000000000000ULL);
1434 Check(v, 0.9999990463256835937500L, intPart, 0xFFFFF00000000000ULL);
1435 Check(v, 0.9999999403953552246094L, intPart, 0xFFFFFF0000000000ULL);
1436 Check(v, 0.9999999962747097015381L, intPart, 0xFFFFFFF000000000ULL);
1437 Check(v, 0.9999999997671693563461L, intPart, 0xFFFFFFFF00000000ULL);
1438 Check(v, 0.9999999999854480847716L, intPart, 0xFFFFFFFFF0000000ULL);
1439 Check(v, 0.9999999999990905052982L, intPart, 0xFFFFFFFFFF000000ULL);
1440 Check(v, 0.9999999999999431565811L, intPart, 0xFFFFFFFFFFF00000ULL);
1441 Check(v, 0.9999999999999964472863L, intPart, 0xFFFFFFFFFFFF0000ULL);
1442 Check(v, 0.9999999999999997779554L, intPart, 0xFFFFFFFFFFFFF000ULL);
1443 Check(v, 0.9999999999999999861222L, intPart, 0xFFFFFFFFFFFFFF00ULL);
1444 Check(v, 0.9999999999999999991326L, intPart, 0xFFFFFFFFFFFFFFF0ULL);
1445 Check(v, 0.9999999999999999991868L, intPart, 0xFFFFFFFFFFFFFFF1ULL);
1446 Check(v, 0.9999999999999999992411L, intPart, 0xFFFFFFFFFFFFFFF2ULL);
1447 Check(v, 0.9999999999999999992943L, intPart, 0xFFFFFFFFFFFFFFF3ULL);
1448 Check(v, 0.9999999999999999993495L, intPart, 0xFFFFFFFFFFFFFFF4ULL);
1449 Check(v, 0.9999999999999999994037L, intPart, 0xFFFFFFFFFFFFFFF5ULL);
1450 Check(v, 0.9999999999999999994579L, intPart, 0xFFFFFFFFFFFFFFF6ULL);
1451 Check(v, 0.9999999999999999995121L, intPart, 0xFFFFFFFFFFFFFFF7ULL);
1452 Check(v, 0.9999999999999999995663L, intPart, 0xFFFFFFFFFFFFFFF8ULL);
1453 Check(v, 0.9999999999999999996205L, intPart, 0xFFFFFFFFFFFFFFF9ULL);
1454 Check(v, 0.9999999999999999996747L, intPart, 0xFFFFFFFFFFFFFFFAULL);
1455 Check(v, 0.9999999999999999997289L, intPart, 0xFFFFFFFFFFFFFFFBULL);
1456 Check(v, 0.9999999999999999997832L, intPart, 0xFFFFFFFFFFFFFFFCULL);
1457 Check(v, 0.9999999999999999998374L, intPart, 0xFFFFFFFFFFFFFFFDULL);
1458 Check(v, 0.9999999999999999998916L, intPart, 0xFFFFFFFFFFFFFFFEULL);
1459 Check(v, 0.9999999999999999999458L, intPart, 0xFFFFFFFFFFFFFFFFULL);
1462 <<
"integer:" << std::setw(4) << intPart <<
": deltas:" << std::setw(4)