发布网友 发布时间:2024-09-26 18:02
共3个回答
热心网友 时间:2024-10-06 20:04
是不是powl,记不清了
热心网友 时间:2024-10-06 20:04
当底数为负数时,pow只能计算 整数次幂,不能计算非整数次的幂
pow(x,y)
If x is finite negative and y is finite but not an integer value, it causes a domain error.If both x and y are zero, it may also cause a domain error.If x is zero and y is negative, it may cause a domain error or a pole error (or none, depending on the library implementation).The function may also cause a range error if the result is too great or too small to be represented by a value of the return type.
热心网友 时间:2024-10-06 20:12
如果根据数学中的定义,根号下的值必须大于等于0.也就是说根号下不能是负数。不管你是开平方根还是立方根都不允许出现有负数出现的。印象中记得高中一年级数学必修一的集合这章就有专门的题型讲解过此类的问题。
我一般是这样做的:pow((double)n,1.0/3.0),它等价于以n为底的三分之一指数幂。
热心网友 时间:2024-10-06 20:10
当底数为负数时,pow只能计算 整数次幂,不能计算非整数次的幂
pow(x,y)
If x is finite negative and y is finite but not an integer value, it causes a domain error.If both x and y are zero, it may also cause a domain error.If x is zero and y is negative, it may cause a domain error or a pole error (or none, depending on the library implementation).The function may also cause a range error if the result is too great or too small to be represented by a value of the return type.
热心网友 时间:2024-10-06 20:04
如果根据数学中的定义,根号下的值必须大于等于0.也就是说根号下不能是负数。不管你是开平方根还是立方根都不允许出现有负数出现的。印象中记得高中一年级数学必修一的集合这章就有专门的题型讲解过此类的问题。
我一般是这样做的:pow((double)n,1.0/3.0),它等价于以n为底的三分之一指数幂。
热心网友 时间:2024-10-06 20:05
是不是powl,记不清了