Completed EXT_*_integer extensions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <glm/ext/scalar_relational.hpp>
|
||||
#include <glm/gtc/ulp.hpp>
|
||||
#include <glm/ext/scalar_integer.hpp>
|
||||
#include <glm/ext/scalar_ulp.hpp>
|
||||
#include <cmath>
|
||||
|
||||
static int test_equal_epsilon()
|
||||
@@ -36,16 +37,16 @@ static int test_equal_ulps()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
float const ULP1Plus = glm::next_float(1.0f);
|
||||
float const ULP1Plus = glm::nextFloat(1.0f);
|
||||
Error += glm::equal(1.0f, ULP1Plus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP2Plus = glm::next_float(ULP1Plus);
|
||||
float const ULP2Plus = glm::nextFloat(ULP1Plus);
|
||||
Error += !glm::equal(1.0f, ULP2Plus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP1Minus = glm::prev_float(1.0f);
|
||||
float const ULP1Minus = glm::prevFloat(1.0f);
|
||||
Error += glm::equal(1.0f, ULP1Minus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP2Minus = glm::prev_float(ULP1Minus);
|
||||
float const ULP2Minus = glm::prevFloat(ULP1Minus);
|
||||
Error += !glm::equal(1.0f, ULP2Minus, 1) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
@@ -55,16 +56,16 @@ static int test_notEqual_ulps()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
float const ULP1Plus = glm::next_float(1.0f);
|
||||
float const ULP1Plus = glm::nextFloat(1.0f);
|
||||
Error += !glm::notEqual(1.0f, ULP1Plus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP2Plus = glm::next_float(ULP1Plus);
|
||||
float const ULP2Plus = glm::nextFloat(ULP1Plus);
|
||||
Error += glm::notEqual(1.0f, ULP2Plus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP1Minus = glm::prev_float(1.0f);
|
||||
float const ULP1Minus = glm::prevFloat(1.0f);
|
||||
Error += !glm::notEqual(1.0f, ULP1Minus, 1) ? 0 : 1;
|
||||
|
||||
float const ULP2Minus = glm::prev_float(ULP1Minus);
|
||||
float const ULP2Minus = glm::prevFloat(ULP1Minus);
|
||||
Error += glm::notEqual(1.0f, ULP2Minus, 1) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
|
||||
Reference in New Issue
Block a user