Unverified 提交 ffce5a2a authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #930 from katzyn/function

Use Math.log10() and remove Mode.getOracle()
......@@ -335,10 +335,6 @@ public class Mode {
return MODES.get(StringUtils.toUpperEnglish(name));
}
public static Mode getOracle() {
return getInstance(ModeEnum.Oracle.name());
}
public static Mode getRegular() {
return getInstance(ModeEnum.REGULAR.name());
}
......
......@@ -620,10 +620,6 @@ public class Function extends Expression implements FunctionCall {
}
}
private static strictfp double log10(double value) {
return roundMagic(StrictMath.log(value) / StrictMath.log(10));
}
@Override
public Value getValue(Session session) {
return getValueWithArgs(session, args);
......@@ -682,7 +678,7 @@ public class Function extends Expression implements FunctionCall {
}
break;
case LOG10:
result = ValueDouble.get(log10(v0.getDouble()));
result = ValueDouble.get(Math.log10(v0.getDouble()));
break;
case PI:
result = ValueDouble.get(Math.PI);
......@@ -1319,7 +1315,7 @@ public class Function extends Expression implements FunctionCall {
}
case REPLACE: {
if (v0 == ValueNull.INSTANCE || v1 == ValueNull.INSTANCE
|| v2 == ValueNull.INSTANCE && database.getMode() != Mode.getOracle()) {
|| v2 == ValueNull.INSTANCE && database.getMode().getEnum() != Mode.ModeEnum.Oracle) {
result = ValueNull.INSTANCE;
} else {
String s0 = v0.getString();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论