define FLT_EPSILON; be descriptive about upper_right_triangle() method

This commit is contained in:
TSC21 authored and Nuno Marques committed 2019-02-24 17:14:05 +00:00
1 parent 7355a29a2a
commit ec436d5aee
11 files changed
+43 -40

No files matched your search

+11 -11
View File
@@ -10,29 +10,29 @@ int main()
{
Vector2f a(1, 0);
Vector2f b(0, 1);
TEST(fabs(a % b - 1.0f) < __FLT_EPSILON__);
TEST(fabs(a % b - 1.0f) < FLT_EPSILON);
Vector2f c;
TEST(fabs(c(0) - 0) < __FLT_EPSILON__);
TEST(fabs(c(1) - 0) < __FLT_EPSILON__);
TEST(fabs(c(0) - 0) < FLT_EPSILON);
TEST(fabs(c(1) - 0) < FLT_EPSILON);
Matrix<float, 2, 1> d(a);
TEST(fabs(d(0,0) - 1) < __FLT_EPSILON__);
TEST(fabs(d(1,0) - 0) < __FLT_EPSILON__);
TEST(fabs(d(0,0) - 1) < FLT_EPSILON);
TEST(fabs(d(1,0) - 0) < FLT_EPSILON);
Vector2f e(d);
TEST(fabs(e(0) - 1) < __FLT_EPSILON__);
TEST(fabs(e(1) - 0) < __FLT_EPSILON__);
TEST(fabs(e(0) - 1) < FLT_EPSILON);
TEST(fabs(e(1) - 0) < FLT_EPSILON);
float data[] = {4,5};
Vector2f f(data);
TEST(fabs(f(0) - 4) < __FLT_EPSILON__);
TEST(fabs(f(1) - 5) < __FLT_EPSILON__);
TEST(fabs(f(0) - 4) < FLT_EPSILON);
TEST(fabs(f(1) - 5) < FLT_EPSILON);
Vector3f g(1.23f, 423.4f, 3221.f);
Vector2f h(g);
TEST(fabs(h(0) - 1.23f) < __FLT_EPSILON__);
TEST(fabs(h(1) - 423.4f) < __FLT_EPSILON__);
TEST(fabs(h(0) - 1.23f) < FLT_EPSILON);
TEST(fabs(h(1) - 423.4f) < FLT_EPSILON);
return 0;
}