【发布时间】:2015-07-16 04:39:45
【问题描述】:
在java中写方法的时候,我注意到这两个函数返回的值是一样的。
// Riemann-Siegel theta function using the approximation by the Stirling series
public static double theta (double t) {
return (t/2.0 * StrictMath.log(t/2.0/StrictMath.PI) - t/2.0
- StrictMath.PI/8.0 + 1.0/48.0/t + 7.0/5760.0/t/t/t);
}
// Riemann-Siegel theta function using the approximation by the Stirling series
public static double theta2 (double t) {
return (t/2.0 * Math.log(t/(2.0*Math.PI)) - t/2.0
- Math.PI/8.0 + 1.0/(48.0*Math.pow(t, 1)) + 7.0/(5760*Math.pow(t, 3)));
}
什么是
7.0/5760.0/t/t/t
在做什么?为什么和7.0/(5760*t^3)一样?
【问题讨论】:
-
如果我有
8/2/2/2,就像4/2/2,也就是2/2,也就是1。如果我有8/2^3,就像8/8,也就是1(思考笔记^不是用于幂的 Java 运算符)。这是一道数学题。
标签: java variables methods notation