test/test_is_prime.cpp
// I used this speed test to do a quick and dirty initial performance tuning
// of the default value for the macro HURCHALLA_ISPRIME_TRIALDIV_SIZE, used
// in impl_is_prime.h.  This test is not needed normally.
I used this speed test to do a quick and dirty initial performance tuning
of the default value for the macro HURCHALLA_ISPRIME_TRIALDIV_SIZE, used
in impl_is_prime.h.  This test is not needed normally.
I used this speed test to do a quick and dirty initial performance tuning of the default value for the macro HURCHALLA_ISPRIME_TRIALDIV_SIZE used in impl_is_prime . h . This test is not needed normally .
TEST(HurchallaFactoringIsPrime, speed_test32) {
        using T = std::uint32_t;
    #if 1
        T max = ut_numeric_limits<T>::max();
    #else
        T max = 20065537;
    #endif
        T dummy = 0;
        for (T x = max; x >= max - 20000000; x = x-2) {
            bool b = is_prime(x);
            dummy += b;
        }
        EXPECT_TRUE(dummy > 0);
    }
TEST ( HurchallaFactoringIsPrime , speed_test32 ) { using T = std :: uint32_t ; #if 1 T max = ut_numeric_limits < T > :: max ( ) ; #else T max = 20065537 ; #endif T dummy = 0 ; for ( T x = max ; x >= max - 20000000 ; x = x - 2 ) { bool b = is_prime ( x ) ; dummy += b ; } EXPECT_TRUE ( dummy > 0 ) ; }
I used this speed test to do a quick and dirty initial performance tuning
of the default value for the macro HURCHALLA_ISPRIME_TRIALDIV_SIZE, used
in impl_is_prime.h.
I used this speed test to do a quick and dirty initial performance tuning of the default value for the macro HURCHALLA_ISPRIME_TRIALDIV_SIZE used in impl_is_prime . h .
// We need to prevent the compiler from completely removing // the is_prime calls due to b never being used. // So we'll add b to dummy just so it's used.