Skip to content

Commit

Permalink
Decimal: Compare different numbers of digits
Browse files Browse the repository at this point in the history
source:
#1572
  • Loading branch information
senekor committed Sep 13, 2023
1 parent 4696194 commit d53464b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exercises/practice/decimal/tests/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ fn gt_negative_and_zero() {
assert!(decimal("0.0") > decimal("-1.0"));
}

#[test]
#[ignore]
fn unequal_number_of_decimal_places() {
assert!(decimal("3.14") > decimal("3.13"));
assert!(decimal("3.14") > decimal("3.131"));
assert!(decimal("3.14") > decimal("3.1"));
assert!(decimal("3.13") < decimal("3.14"));
assert!(decimal("3.131") < decimal("3.14"));
assert!(decimal("3.1") < decimal("3.14"));
}

// tests of arbitrary precision behavior
#[test]
#[ignore]
Expand Down

0 comments on commit d53464b

Please sign in to comment.