英文:
Why doesn't Math.pow return me the correct value?
问题
我正在尝试获取正确的值:
double poweredValue = Math.pow((1.1), (1 / 365));
使用我的科学计算器,我得到了 1.0002611578760678121616866817054。但是 Math.pow 返回了 1。
如何获得完整的返回值?
英文:
I am trying to get the correct value for:
double poweredValue = Math.pow((1.1),(1 / 365));
Using my scientific calculator I get 1.0002611578760678121616866817054. But Math.pow returns a 1.
How do I get the full value returned?
答案1
得分: 1
double poweredValue = Math.pow((1.1), (1 / 365.0));
System.out.println(poweredValue);
输出结果 -
1.0002611578760678
英文:
double poweredValue = Math.pow((1.1),(1 / 365.0));
System.out.println(poweredValue);
Output -
1.0002611578760678
专注分享java语言的经验与见解,让所有开发者获益!
评论