正如Corbin所说,你可以在Java中找到你的常量java.lang.Math.E.
但是你可能想要使用这个Math.exp(Double d)方法.
你的计算是:
ePoints = Math.exp(Points);
finalScore = 1000 * (ePoints/(1 + ePoints)) - 10;
Run Code Online (Sandbox Code Playgroud)
通过使用以下方法,您可以获得更高的精度,但更高的溢出风险:
ePoints = Math.exp(Points);
finalScore = (1000 * ePoints)/(1 + ePoints) - 10;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1319 次 |
| 最近记录: |