1010
1111using namespace com ::saxbophone;
1212
13- TEST_CASE (" Any arby::Nat raised to the power of zero returns 1" , " [math-support][pow ]" ) {
13+ TEST_CASE (" Any arby::Nat raised to the power of zero returns 1" , " [math-support][ipow ]" ) {
1414 auto value = GENERATE (take (1000 , random ((uintmax_t )0 , std::numeric_limits<uintmax_t >::max ())));
1515
16- CHECK (arby::pow (arby::Nat (value), arby::Nat ( 0 ) ) == 1 );
16+ CHECK (arby::ipow (arby::Nat (value), 0 ) == 1 );
1717}
1818
19- TEST_CASE (" Zero raised to the power of any non-zero arby::Nat returns 0" , " [math-support][pow ]" ) {
19+ TEST_CASE (" Zero raised to the power of any non-zero arby::Nat returns 0" , " [math-support][ipow ]" ) {
2020 auto value = GENERATE (take (1000 , random ((uintmax_t )1 , std::numeric_limits<uintmax_t >::max ())));
2121
22- CHECK (arby::pow (arby::Nat (0 ), arby::Nat ( value) ) == 0 );
22+ CHECK (arby::ipow (arby::Nat (0 ), value) == 0 );
2323}
2424
2525// std::pow() is not accurate for large powers and we need exactness
@@ -36,7 +36,7 @@ static uintmax_t integer_pow(uintmax_t base, uintmax_t exponent) {
3636 return power;
3737}
3838
39- TEST_CASE (" Non-zero arby::Nat raised to the power of non-zero arby::Nat" , " [math-support][pow ]" ) {
39+ TEST_CASE (" Non-zero arby::Nat raised to the power of non-zero arby::Nat" , " [math-support][ipow ]" ) {
4040 // base needs to be severely constrained if we are to have any reasonable prospect of getting some large exponents
4141 auto base = GENERATE (take (10000 , random ((uintmax_t )1 , (uintmax_t )256 )));
4242 // use log-n to find out the maximmum number exponent we can raise base to to fit in uintmax_t range
@@ -46,5 +46,5 @@ TEST_CASE("Non-zero arby::Nat raised to the power of non-zero arby::Nat", "[math
4646
4747 CAPTURE (base, exponent);
4848
49- CHECK ((uintmax_t )arby::pow (arby::Nat (base), arby::Nat ( exponent) ) == integer_pow (base, exponent));
49+ CHECK ((uintmax_t )arby::ipow (arby::Nat (base), exponent) == integer_pow (base, exponent));
5050}
0 commit comments