Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hikjik committed Sep 6, 2023
1 parent 85aa36c commit 80ce2ec
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions solutions/pow-x-n/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ TEST_CASE("Simple") {
{
double x = 2.00000;
int n = 10;
double expected = 1024.00000;
REQUIRE(expected == Solution::myPow(x, n));
REQUIRE(1024.00000 == Approx(Solution::myPow(x, n)));
}
{
double x = 2.10000;
int n = 3;
double expected = 9.26100;
REQUIRE(expected == Solution::myPow(x, n));
REQUIRE(9.26100 == Approx(Solution::myPow(x, n)));
}
{
double x = 2.00000;
int n = -2;
double expected = 0.25000;
REQUIRE(expected == Solution::myPow(x, n));
REQUIRE(0.25000 == Approx(Solution::myPow(x, n)));
}
}

0 comments on commit 80ce2ec

Please sign in to comment.