Skip to content

Commit

Permalink
Loosen exp10 tests accuracy constraints
Browse files Browse the repository at this point in the history
Both some scalar version and some vector version (depending on arch) are
not totally accurate, so allow for some approximation.

Should fix #917
  • Loading branch information
serge-sans-paille committed May 9, 2024
1 parent 5ac7edf commit bcd7895
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/test_xsimd_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,9 @@ struct xsimd_api_float_types_functions
void test_exp10()
{
value_type val(2);
#ifdef EMSCRIPTEN
// exp10 doesn't always have an accurate implementation, so allow for
// approximate result
CHECK_EQ(extract(xsimd::exp10(T(val))), doctest::Approx(std::pow(value_type(10), val)));
#else
CHECK_EQ(extract(xsimd::exp10(T(val))), std::pow(value_type(10), val));
#endif
}
void test_exp2()
{
Expand Down

0 comments on commit bcd7895

Please sign in to comment.