diff --git a/test/test_normal.cpp b/test/test_normal.cpp index c03090439..a4012e071 100644 --- a/test/test_normal.cpp +++ b/test/test_normal.cpp @@ -81,7 +81,7 @@ template void test_spots(RealType) { // Basic sanity checks - RealType tolerance = static_cast(std::pow(10., -(4-2))); // 1e-4 (as %) + RealType tolerance = 1e-2f; // 1e-4 (as %) // Some tests only pass at 1e-4 because values generated by // http://faculty.vassar.edu/lowry/VassarStats.html // give only 5 or 6 *fixed* places, so small values have fewer digits. diff --git a/test/test_poisson.cpp b/test/test_poisson.cpp index 7773d4a19..361637cd7 100644 --- a/test/test_poisson.cpp +++ b/test/test_poisson.cpp @@ -63,7 +63,7 @@ void test_spots(RealType) } decdigits -= 1; // Perhaps allow some decimal digit(s) margin of numerical error. - RealType tolerance = static_cast(std::pow(10., -(decdigits-2))); // 1e-6 (-2 so as %) + RealType tolerance = static_cast(std::pow(10., static_cast(2-decdigits))); // 1e-6 (-2 so as %) tolerance *= 2; // Allow some bit(s) small margin (2 means + or - 1 bit) of numerical error. // Typically 2e-13% = 2e-15 as fraction for double. diff --git a/test/test_students_t.cpp b/test/test_students_t.cpp index 9d2af265e..153f360c7 100644 --- a/test/test_students_t.cpp +++ b/test/test_students_t.cpp @@ -54,7 +54,7 @@ template void test_spots(RealType) { // Basic sanity checks - RealType tolerance = static_cast(std::pow(10., -(6-2))); // 1e-6 (as %) + RealType tolerance = 1e-4; // 1e-6 (as %) // Some tests only pass at 1e-5 because probability value is less accurate, // a digit in 6th decimal place, although calculated using // a t-distribution generator (claimed 6 decimal digits) at