Skip to content

Commit 80c2b22

Browse files
bors[bot]hkBst
andauthored
Merge #54
54: Update lib.rs r=cuviper a=hkBst First test that qr/dm is correct, then that both methods' results are equal to the correct answer. This saves one redundant check. Co-authored-by: Marijn Schouten <hkBst@users.noreply.github.com>
2 parents f9ef6c0 + 5fedf06 commit 80c2b22

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,10 @@ macro_rules! impl_integer_for_isize {
604604
let separate_div_rem = (n / d, n % d);
605605
let combined_div_rem = n.div_rem(&d);
606606

607+
test_division_rule(nd, qr);
608+
607609
assert_eq!(separate_div_rem, qr);
608610
assert_eq!(combined_div_rem, qr);
609-
610-
test_division_rule(nd, separate_div_rem);
611-
test_division_rule(nd, combined_div_rem);
612611
}
613612

614613
test_nd_dr((8, 3), (2, 2));
@@ -630,11 +629,10 @@ macro_rules! impl_integer_for_isize {
630629
(Integer::div_floor(&n, &d), Integer::mod_floor(&n, &d));
631630
let combined_div_mod_floor = Integer::div_mod_floor(&n, &d);
632631

632+
test_division_rule(nd, dm);
633+
633634
assert_eq!(separate_div_mod_floor, dm);
634635
assert_eq!(combined_div_mod_floor, dm);
635-
636-
test_division_rule(nd, separate_div_mod_floor);
637-
test_division_rule(nd, combined_div_mod_floor);
638636
}
639637

640638
test_nd_dm((8, 3), (2, 2));

0 commit comments

Comments
 (0)