求救:java中求一个数的开方用那个函数?

xingzhe2001 2003-10-03 01:24:40
求救:java中求一个数的开方用那个函数?
...全文
3587 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
grgh2000 2003-10-06
  • 打赏
  • 举报
回复
没有,搜索你也得知道方法名的前几个字母啊^-^
xingzhe2001 2003-10-05
  • 打赏
  • 举报
回复
在哪个文档下面啊?java.math下的Bigdecimal怎么没有?
希偌 2003-10-05
  • 打赏
  • 举报
回复
sorry
Math.sqrt(a)
相当于
Math.pow(a,2)
希偌 2003-10-05
  • 打赏
  • 举报
回复
Math.pow(double,double);
第一个参数是被开方的数
第二个参数是开方的幂

Math.sqrt(a)
相当于
Math.sqrt(a,2)
xingzhe2001 2003-10-05
  • 打赏
  • 举报
回复
没办法,俺是菜鸟嘛,终于找到了,在java.lang.math下,谢各位,有什么办法能在不熟悉api的情况下迅速的查到我需要的函数呢?比如搜索什么的
6302573 2003-10-05
  • 打赏
  • 举报
回复
java.lang下面
不是java.math
lcy2001 2003-10-05
  • 打赏
  • 举报
回复 1
xingzhe2001 问的是开方,不是平方,应该是Math.sqrt(a,0.5)!
viove 2003-10-05
  • 打赏
  • 举报
回复
真是懒得不行 这也问?api里不是有吗
happyegg 2003-10-04
  • 打赏
  • 举报
回复
完完全全的从jdk-doc上copy下来的,怎么会没有?要学会看文档

static double sqrt(double a)
Returns the correctly rounded positive square root of a double value.


sqrt
public static double sqrt(double a)Returns the correctly rounded positive square root of a double value. Special cases:
If the argument is NaN or less than zero, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is positive zero or negative zero, then the result is the same as the argument.
Otherwise, the result is the double value closest to the true mathetmatical square root of the argument value.
Parameters:
a - a double value.
Returns:
the positive square root of a. If the argument is NaN or less than zero, the result is NaN.
xingzhe2001 2003-10-04
  • 打赏
  • 举报
回复
为什么它给的文档里没有啊?
fxxxgxxx 2003-10-03
  • 打赏
  • 举报
回复
祝好运。
CgPanda_ 2003-10-03
  • 打赏
  • 举报
回复
楼上说得对
zhshjin 2003-10-03
  • 打赏
  • 举报
回复
就是这样
binny 2003-10-03
  • 打赏
  • 举报
回复
来晚了
blacksun8334 2003-10-03
  • 打赏
  • 举报
回复
up
caoxmby 2003-10-03
  • 打赏
  • 举报
回复
都对
6302573 2003-10-03
  • 打赏
  • 举报
回复
Math.sqrt(double a)
XKP 2003-10-03
  • 打赏
  • 举报
回复
Math.sqrt

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧