Fixed warnings

This commit is contained in:
Christophe Riccio
2017-08-08 22:31:37 +02:00
parent d712ac930f
commit f5dde80e2e
2 changed files with 11 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
#include <glm/gtc/ulp.hpp>
#include <glm/gtc/epsilon.hpp>
#include <limits>
int test_ulp_float_dist()
@@ -8,7 +9,7 @@ int test_ulp_float_dist()
float A = 1.0f;
float B = glm::next_float(A);
Error += glm::epsilonNotEqual(A, B, glm::epsilon<float>()) ? 0 : 1;
Error += !glm::epsilonEqual(A, B, glm::epsilon<float>()) ? 0 : 1;
float C = glm::prev_float(B);
Error += glm::epsilonEqual(A, C, glm::epsilon<float>()) ? 0 : 1;
@@ -29,9 +30,9 @@ int test_ulp_float_step()
for(int i = 10; i < 1000; i *= 10)
{
float B = glm::next_float(A, i);
Error += A != B ? 0 : 1;
Error += !glm::epsilonEqual(A, B, glm::epsilon<float>()) ? 0 : 1;
float C = glm::prev_float(B, i);
Error += A == C ? 0 : 1;
Error += glm::epsilonEqual(A, C, glm::epsilon<float>()) ? 0 : 1;
int D = glm::float_distance(A, B);
Error += D == i ? 0 : 1;
@@ -49,9 +50,9 @@ int test_ulp_double_dist()
double A = 1.0;
double B = glm::next_float(A);
Error += A != B ? 0 : 1;
Error += !glm::epsilonEqual(A, B, glm::epsilon<double>()) ? 0 : 1;
double C = glm::prev_float(B);
Error += A == C ? 0 : 1;
Error += glm::epsilonEqual(A, C, glm::epsilon<double>()) ? 0 : 1;
int D = glm::float_distance(A, B);
Error += D == 1 ? 0 : 1;
@@ -70,9 +71,9 @@ int test_ulp_double_step()
for(int i = 10; i < 1000; i *= 10)
{
double B = glm::next_float(A, i);
Error += A != B ? 0 : 1;
Error += !glm::epsilonEqual(A, B, glm::epsilon<double>()) ? 0 : 1;
double C = glm::prev_float(B, i);
Error += A == C ? 0 : 1;
Error += glm::epsilonEqual(A, C, glm::epsilon<double>()) ? 0 : 1;
int D = glm::float_distance(A, B);
Error += D == i ? 0 : 1;