We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0688213 commit 70f92c0Copy full SHA for 70f92c0
include/taco/util/strings.h
@@ -7,6 +7,7 @@
7
#include <map>
8
#include <iomanip>
9
#include <limits>
10
+#include <cmath>
11
12
// To get the value of a compiler macro variable
13
#define STRINGIFY(x) #x
@@ -30,6 +31,9 @@ toString(const T &val) {
30
31
template <class T>
32
typename std::enable_if<std::is_floating_point<T>::value, std::string>::type
33
toString(const T &val) {
34
+ if (isinf(val)) {
35
+ return (val < 0) ? "-INFINITY" : "INFINITY";
36
+ }
37
std::stringstream sstream;
38
sstream << std::setprecision(std::numeric_limits<T>::max_digits10) << std::showpoint << val;
39
return sstream.str();
0 commit comments