本文介绍了求幂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在函数中编写指数的正确方法有点含糊不清
所以我会做个小测验
我要计算这个:
There is a little ambiguity on the proper way to write the exponents in a function
So, I will make a little quiz
I want to compute this:
sin(3pi/4) = -0.70710678118654746
哪个答案是正确的?
sin(3pi/4) = -0.70710678118654746
Which answer is right ?
Dim Teta As Double = 3 * Math.PI / 4
Dim n As Double = 4
Dim X As Double
X = Math.Cos(Teta) ^ (2 / n) ' Returns: NaN
X = (Math.Cos(Teta) ^ 2) ^ (1 / n) ' Returns: 0.840896415253715
X = -0.70710678118654746 ^ (2 / n) ' Returns: -0.840896415253715
推荐答案
这篇关于求幂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!