提交 7420a2e4 authored 作者: Thomas Mueller's avatar Thomas Mueller

The double or float value -0.0 is now distinct from 0.0 (as in Java).

上级 5248b286
...@@ -77,7 +77,11 @@ public class ValueDouble extends Value { ...@@ -77,7 +77,11 @@ public class ValueDouble extends Value {
} else if (Double.isNaN(value)) { } else if (Double.isNaN(value)) {
return "SQRT(-1)"; return "SQRT(-1)";
} }
return getString(); String s = getString();
if (s.equals("-0.0")) {
return "-CAST(0 AS DOUBLE)";
}
return s;
} }
public int getType() { public int getType() {
......
...@@ -77,7 +77,11 @@ public class ValueFloat extends Value { ...@@ -77,7 +77,11 @@ public class ValueFloat extends Value {
// NaN // NaN
return "SQRT(-1)"; return "SQRT(-1)";
} }
return getString(); String s = getString();
if (s.equals("-0.0")) {
return "-CAST(0 AS REAL)";
}
return s;
} }
public int getType() { public int getType() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论