From 7981da51debc66aa78cda72a4b0be3fc3a74d634 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 6 Feb 2020 18:16:36 -0500 Subject: Float matrix intrinsic test/fixes (#1203) * Fix CPP construct when matrix type. * Test intrinsics on float matrices. * Fix typo in _areNearlyEqual test. Increased default sensitivity. Added matrix-float test. --- tools/slang-test/slang-test-main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index e703ed26c..165f7a322 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -2026,7 +2026,7 @@ static bool _areNearlyEqual(double a, double b, double epsilon) // https://en.wikipedia.org/wiki/Double_precision_floating-point_format // - const double minNormal = 2.2250738585072014e10-308; + const double minNormal = 2.2250738585072014e-308; // Either a or b are very close to being zero, so doing relative comparison isn't really appropriate if (a == 0.0 || b == 0.0 || (absA + absB < minNormal)) @@ -2058,7 +2058,7 @@ static void _calcLines(const UnownedStringSlice& slice, List } } -static SlangResult _compareWithType(const UnownedStringSlice& actual, const UnownedStringSlice& ref, double differenceThreshold = 0.001) +static SlangResult _compareWithType(const UnownedStringSlice& actual, const UnownedStringSlice& ref, double differenceThreshold = 0.0001) { typedef slang::TypeReflection::ScalarType ScalarType; -- cgit v1.2.3