Skip to content

Commit 683466f

Browse files
authored
java's method Double.toString is able to convert not-a-number values to "NaN" string (#611)
Signed-off-by: Andrey Turbanov <[email protected]>
1 parent 6ed8bee commit 683466f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

simpleclient/src/main/java/io/prometheus/client/Collector.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Sample(String name, List<String> labelNames, List<String> labelValues, do
8888
}
8989

9090
public Sample(String name, List<String> labelNames, List<String> labelValues, double value) {
91-
this(name, labelNames, labelValues, value, null);
91+
this(name, labelNames, labelValues, value, null);
9292
}
9393

9494
@Override
@@ -217,9 +217,6 @@ public static String doubleToGoString(double d) {
217217
if (d == Double.NEGATIVE_INFINITY) {
218218
return "-Inf";
219219
}
220-
if (Double.isNaN(d)) {
221-
return "NaN";
222-
}
223220
return Double.toString(d);
224221
}
225222
}

0 commit comments

Comments
 (0)