aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/Utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/framework/Utils.h')
-rw-r--r--tests/framework/Utils.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/framework/Utils.h b/tests/framework/Utils.h
index a9fe0dcaa3..4f4b6fce56 100644
--- a/tests/framework/Utils.h
+++ b/tests/framework/Utils.h
@@ -152,6 +152,22 @@ inline std::string tolower(std::string string)
});
return string;
}
+
+/** Create a string with the arithmetic value in full precision.
+ *
+ * @param val Arithmetic value
+ *
+ * @return String with the arithmetic value.
+ */
+template <typename T, typename std::enable_if<std::is_arithmetic<T>::value, int>::type = 0>
+inline std::string arithmetic_to_string(T val)
+{
+ std::stringstream ss;
+ ss.precision(std::numeric_limits<T>::digits10 + 1);
+ ss << val;
+ return ss.str();
+}
+
} // namespace framework
} // namespace test
} // namespace arm_compute