math.pow()这个函数是干吗的

qiuzilingxixi 2001-12-21 03:15:04
能帮我一下吗?
我对java不太懂,但是需要知道math.pow()这个函数是干吗的,怎么用?
谢谢!
...全文
42939 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
就是求平方根啊,上面的 说得太专业啦
zych72 2001-12-22
  • 打赏
  • 举报
回复
Math.pow(a,b) means a**b
CanFly 2001-12-22
  • 打赏
  • 举报
回复
更正:上面最后的返回值是a的b次方,不是ab;
CanFly 2001-12-22
  • 打赏
  • 举报
回复
public static double pow(double a,
double b)Returns of value of the first argument raised to the power of the second argument. Special cases:
If the second argument is positive or negative zero, then the result is 1.0.
If the second argument is 1.0, then the result is the same as the first argument.
If the second argument is NaN, then the result is NaN.
If the first argument is NaN and the second argument is nonzero, then the result is NaN.
If the absolute value of the first argument is greater than 1 and the second argument is positive infinity, or the absolute value of the first argument is less than 1 and the second argument is negative infinity, then the result is positive infinity.
If the absolute value of the first argument is greater than 1 and the second argument is negative infinity, or the absolute value of the first argument is less than 1 and the second argument is positive infinity, then the result is positive zero.
If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN.
If the first argument is positive zero and the second argument is greater than zero, or the first argument is positive infinity and the second argument is less than zero, then the result is positive zero.
If the first argument is positive zero and the second argument is less than zero, or the first argument is positive infinity and the second argument is greater than zero, then the result is positive infinity.
If the first argument is negative zero and the second argument is greater than zero but not a finite odd integer, or the first argument is negative infinity and the second argument is less than zero but not a finite odd integer, then the result is positive zero.
If the first argument is negative zero and the second argument is a positive finite odd integer, or the first argument is negative infinity and the second argument is a negative finite odd integer, then the result is negative zero.
If the first argument is negative zero and the second argument is less than zero but not a finite odd integer, or the first argument is negative infinity and the second argument is greater than zero but not a finite odd integer, then the result is positive infinity.
If the first argument is negative zero and the second argument is a negative finite odd integer, or the first argument is negative infinity and the second argument is a positive finite odd integer, then the result is negative infinity.
If the first argument is less than zero and the second argument is a finite even integer, then the result is equal to the result of raising the absolute value of the first argument to the power of the second argument.
If the first argument is less than zero and the second argument is a finite odd integer, then the result is equal to the negative of the result of raising the absolute value of the first argument to the power of the second argument.
If the first argument is finite and less than zero and the second argument is finite and not an integer, then the result is NaN.
If both arguments are integers, then the result is exactly equal to the mathematical result of raising the first argument to the power of the second argument if that result can in fact be represented exactly as a double value.
(In the foregoing descriptions, a floating-point value is considered to be an integer if and only if it is a fixed point of the method ceil or, which is the same thing, a fixed point of the method floor. A value is a fixed point of a one-argument method if and only if the result of applying the method to the value is equal to the value.)

A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.

Parameters:
a - a double value.
b - a double value.
Returns:
the value ab.
chengqiwu 2001-12-22
  • 打赏
  • 举报
回复
返回值double型,求方的一个数学函数。
hahaha88 2001-12-22
  • 打赏
  • 举报
回复
pow是power的意思,是求”方“的
vdragon 2001-12-21
  • 打赏
  • 举报
回复
Math.pow(double a, double b)
是求a的b次方的

62,616

社区成员

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

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