Fixed error: comparing floating point with == or != is unsafe

master
Groove ago%!(EXTRA string=7 years)
parent 5ecc27ff93
commit a7e0e8387b
  1. 12
      test/ext/ext_vec1.cpp
  2. 2
      test/gtc/gtc_type_ptr.cpp

@ -10,8 +10,8 @@ static int test_vec1_operators()
{ {
int Error(0); int Error(0);
glm::vec1 A(1.0f); glm::ivec1 A(1.0f);
glm::vec1 B(1.0f); glm::ivec1 B(1.0f);
{ {
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;
@ -20,10 +20,10 @@ static int test_vec1_operators()
} }
{ {
A *= 1.0f; A *= 1;
B *= 1.0; B *= 1;
A += 1.0f; A += 1;
B += 1.0; B += 1;
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;

@ -1,5 +1,7 @@
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/vec1.hpp> #include <glm/gtc/vec1.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/ext/vector_relational.hpp>
int test_value_ptr_vec() int test_value_ptr_vec()
{ {

Loading…
Cancel
Save