@@ -568,16 +568,24 @@ using Decimals: @with_context
568
568
@with_context (Emax = 384 , Emin = - 383 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1.0" + dec " -0.0" == dec " -1.0" )
569
569
@with_context (Emax = 384 , Emin = - 383 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 1.0" + dec " 0.0" == dec " 1.0" )
570
570
@with_context (Emax = 384 , Emin = - 383 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 1.0" + dec " -0.0" == dec " 1.0" )
571
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 1e+999999999" + dec " 9e+999999999" )
572
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9e+999999999" + dec " 1e+999999999" )
571
573
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1.1e-999999999" + dec " 1e-999999999" == dec " -1e-1000000000" )
572
574
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 1e-999999999" + dec " -1.1e-999999999" == dec " -1e-1000000000" )
573
575
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1.0001e-999999999" + dec " 1e-999999999" == dec " -1e-1000000003" )
574
576
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 1e-999999999" + dec " -1.0001e-999999999" == dec " -1e-1000000003" )
577
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -1e+999999999" + dec " -9e+999999999" )
578
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9e+999999999" + dec " -1e+999999999" )
575
579
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " +1.1e-999999999" + dec " -1e-999999999" == dec " 1e-1000000000" )
576
580
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1e-999999999" + dec " +1.1e-999999999" == dec " 1e-1000000000" )
577
581
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " +1.0001e-999999999" + dec " -1e-999999999" == dec " 1e-1000000003" )
578
582
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1e-999999999" + dec " +1.0001e-999999999" == dec " 1e-1000000003" )
579
583
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -1e+999999999" + dec " +9e+999999999" == dec " 8e+999999999" )
580
584
@with_context (Emax = 999999999 , Emin = - 999999999 , precision = 9 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9e+999999999" + dec " +1e+999999999" == dec " -8e+999999999" )
585
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 0" + dec " -9.999e+999999999" )
586
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9.999e+999999999" + dec " 0" )
587
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 0" + dec " 9.999e+999999999" )
588
+ @with_context (Emax = 999999999 , Emin = - 999999999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9.999e+999999999" + dec " 0" )
581
589
@with_context (Emax = 999 , Emin = - 999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 1.00e-999" + dec " 0" == dec " 1.00e-999" )
582
590
@with_context (Emax = 999 , Emin = - 999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 0.1e-999" + dec " 0" == dec " 1e-1000" )
583
591
@with_context (Emax = 999 , Emin = - 999 , precision = 3 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 0.10e-999" + dec " 0" == dec " 1.0e-1000" )
@@ -638,13 +646,25 @@ using Decimals: @with_context
638
646
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9.999999e+96" == dec " 9.999999e+96" )
639
647
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9.999999e+96" + dec " 1" == dec " 9.999999e+96" )
640
648
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9999999e+90" + dec " 1" == dec " 9.999999e+96" )
649
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 1e+90" )
650
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 9e+89" )
651
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 8e+89" )
652
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 7e+89" )
653
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 6e+89" )
654
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " 9999999e+90" + dec " 5e+89" )
641
655
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9999999e+90" + dec " 4e+89" == dec " 9.999999e+96" )
642
656
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9999999e+90" + dec " 3e+89" == dec " 9.999999e+96" )
643
657
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9999999e+90" + dec " 2e+89" == dec " 9.999999e+96" )
644
658
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " 9999999e+90" + dec " 1e+89" == dec " 9.999999e+96" )
645
659
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9.999999e+96" == dec " -9.999999e+96" )
646
660
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9.999999e+96" + dec " -1" == dec " -9.999999e+96" )
647
661
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9999999e+90" + dec " -1" == dec " -9.999999e+96" )
662
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -1e+90" )
663
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -9e+89" )
664
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -8e+89" )
665
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -7e+89" )
666
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -6e+89" )
667
+ @with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test_throws (OverflowError, dec " -9999999e+90" + dec " -5e+89" )
648
668
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9999999e+90" + dec " -4e+89" == dec " -9.999999e+96" )
649
669
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9999999e+90" + dec " -3e+89" == dec " -9.999999e+96" )
650
670
@with_context (Emax = 96 , Emin = - 95 , precision = 7 , rounding = RoundingMode {:NearestTiesAway} ()) @test (dec " -9999999e+90" + dec " -2e+89" == dec " -9.999999e+96" )
@@ -1486,13 +1506,25 @@ using Decimals: @with_context
1486
1506
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9.999999999999999e+384" == dec " 9.999999999999999e+384" )
1487
1507
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9.999999999999999e+384" + dec " 1" == dec " 9.999999999999999e+384" )
1488
1508
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9999999999999999e+369" + dec " 1" == dec " 9.999999999999999e+384" )
1509
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 1e+369" )
1510
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 9e+368" )
1511
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 8e+368" )
1512
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 7e+368" )
1513
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 6e+368" )
1514
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " 9999999999999999e+369" + dec " 5e+368" )
1489
1515
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9999999999999999e+369" + dec " 4e+368" == dec " 9.999999999999999e+384" )
1490
1516
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9999999999999999e+369" + dec " 3e+368" == dec " 9.999999999999999e+384" )
1491
1517
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9999999999999999e+369" + dec " 2e+368" == dec " 9.999999999999999e+384" )
1492
1518
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " 9999999999999999e+369" + dec " 1e+368" == dec " 9.999999999999999e+384" )
1493
1519
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9.999999999999999e+384" == dec " -9.999999999999999e+384" )
1494
1520
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9.999999999999999e+384" + dec " -1" == dec " -9.999999999999999e+384" )
1495
1521
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9999999999999999e+369" + dec " -1" == dec " -9.999999999999999e+384" )
1522
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -1e+369" )
1523
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -9e+368" )
1524
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -8e+368" )
1525
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -7e+368" )
1526
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -6e+368" )
1527
+ @with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test_throws (OverflowError, dec " -9999999999999999e+369" + dec " -5e+368" )
1496
1528
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9999999999999999e+369" + dec " -4e+368" == dec " -9.999999999999999e+384" )
1497
1529
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9999999999999999e+369" + dec " -3e+368" == dec " -9.999999999999999e+384" )
1498
1530
@with_context (Emax = 384 , Emin = - 383 , precision = 16 , rounding = RoundingMode {:Nearest} ()) @test (dec " -9999999999999999e+369" + dec " -2e+368" == dec " -9.999999999999999e+384" )
0 commit comments