Fixed warnings
This commit is contained in:
parent
d712ac930f
commit
f5dde80e2e
@ -9,6 +9,7 @@
|
|||||||
/// is preserved.
|
/// is preserved.
|
||||||
|
|
||||||
#include "../detail/type_int.hpp"
|
#include "../detail/type_int.hpp"
|
||||||
|
#include "epsilon.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -304,7 +305,7 @@ namespace glm
|
|||||||
if(x < y)
|
if(x < y)
|
||||||
{
|
{
|
||||||
T temp = x;
|
T temp = x;
|
||||||
while(temp != y)// && ulp < std::numeric_limits<std::size_t>::max())
|
while(glm::epsilonNotEqual(temp, y, glm::epsilon<T>()))// && ulp < std::numeric_limits<std::size_t>::max())
|
||||||
{
|
{
|
||||||
++ulp;
|
++ulp;
|
||||||
temp = next_float(temp);
|
temp = next_float(temp);
|
||||||
@ -313,7 +314,7 @@ namespace glm
|
|||||||
else if(y < x)
|
else if(y < x)
|
||||||
{
|
{
|
||||||
T temp = y;
|
T temp = y;
|
||||||
while(temp != x)// && ulp < std::numeric_limits<std::size_t>::max())
|
while(glm::epsilonNotEqual(temp, x, glm::epsilon<T>()))// && ulp < std::numeric_limits<std::size_t>::max())
|
||||||
{
|
{
|
||||||
++ulp;
|
++ulp;
|
||||||
temp = next_float(temp);
|
temp = next_float(temp);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <glm/gtc/ulp.hpp>
|
#include <glm/gtc/ulp.hpp>
|
||||||
|
#include <glm/gtc/epsilon.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
int test_ulp_float_dist()
|
int test_ulp_float_dist()
|
||||||
@ -8,7 +9,7 @@ int test_ulp_float_dist()
|
|||||||
float A = 1.0f;
|
float A = 1.0f;
|
||||||
|
|
||||||
float B = glm::next_float(A);
|
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);
|
float C = glm::prev_float(B);
|
||||||
Error += glm::epsilonEqual(A, C, glm::epsilon<float>()) ? 0 : 1;
|
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)
|
for(int i = 10; i < 1000; i *= 10)
|
||||||
{
|
{
|
||||||
float B = glm::next_float(A, i);
|
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);
|
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);
|
int D = glm::float_distance(A, B);
|
||||||
Error += D == i ? 0 : 1;
|
Error += D == i ? 0 : 1;
|
||||||
@ -49,9 +50,9 @@ int test_ulp_double_dist()
|
|||||||
double A = 1.0;
|
double A = 1.0;
|
||||||
|
|
||||||
double B = glm::next_float(A);
|
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);
|
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);
|
int D = glm::float_distance(A, B);
|
||||||
Error += D == 1 ? 0 : 1;
|
Error += D == 1 ? 0 : 1;
|
||||||
@ -70,9 +71,9 @@ int test_ulp_double_step()
|
|||||||
for(int i = 10; i < 1000; i *= 10)
|
for(int i = 10; i < 1000; i *= 10)
|
||||||
{
|
{
|
||||||
double B = glm::next_float(A, i);
|
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);
|
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);
|
int D = glm::float_distance(A, B);
|
||||||
Error += D == i ? 0 : 1;
|
Error += D == i ? 0 : 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user