mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
Introduced a second, less precise comparison epsilon for the tests for now.
This commit is contained in:
parent
18d9b97aa4
commit
d71dba9603
@ -17,6 +17,13 @@ GLM_INLINE GLM_CONSTEXPR float myEpsilon<float>() { return 0.00001f; }
|
||||
template<>
|
||||
GLM_INLINE GLM_CONSTEXPR double myEpsilon<double>() { return 0.000001; }
|
||||
|
||||
template<typename T>
|
||||
T myEpsilon2();
|
||||
template<>
|
||||
GLM_INLINE GLM_CONSTEXPR float myEpsilon2<float>() { return 0.01f; }
|
||||
template<>
|
||||
GLM_INLINE GLM_CONSTEXPR double myEpsilon2<double>() { return 0.000001; }
|
||||
|
||||
|
||||
template<glm::length_t D, typename T, glm::qualifier Q>
|
||||
bool vectorEpsilonEqual(glm::vec<D, T, Q> const& a, glm::vec<D, T, Q> const& b)
|
||||
@ -329,7 +336,7 @@ namespace _1aga
|
||||
|
||||
for (int i = 0; i < D; ++i)
|
||||
for (int d = 0; d < D; ++d)
|
||||
if (!glm::equal(evecs[i][d], expectedEvecs[i * D + d], myEpsilon<T>()))
|
||||
if (!glm::equal(evecs[i][d], expectedEvecs[i * D + d], myEpsilon2<T>()))
|
||||
{
|
||||
fprintf(stderr, "E: %.15lf != %.15lf ; diff: %.20lf\n",
|
||||
static_cast<double>(evecs[i][d]),
|
||||
|
Loading…
Reference in New Issue
Block a user