vbs算开方
vbs吧
全部回复
仅看楼主
level 6
曾经想过用2分法,但具体算法应该怎么写?比如"求91的7次方根"类
2010年02月09日 05点02分 1
level 6
不可以msgbox 91^(1/7),原题要求必须要用2分法
2010年02月09日 06点02分 2
level 11
MsgBox 91^(1/7)
2010年02月09日 06点02分 3
level 11
好吧。。我错了。。。
2010年02月09日 06点02分 4
level 5
a = InputBox("输入被开方数:","开方程序")
d = InputBox("输入指数:","开方程序")
a = CDbl(a):d = CDbl(d)
MsgBox a ^ (1 / d)
c = a
b = 1.0
while a <> b
     a = b
     b = (c / b + b) / d
wend
MsgBox b

2010年02月09日 07点02分 5
这个怎么修改可以多算几位
2014年09月05日 13点09分
回复 王延忻12138 :多久的坟你也挖?
2014年09月05日 16点09分
回复 andylaw5 :.......我不是故意的
2014年09月05日 16点09分
level 6
楼上的算法,貌似在计算高次方时会死.比如说32的5次方...
2010年02月09日 12点02分 6
level 7
高精度的计算还是不要用VBS吧
2010年02月09日 13点02分 7
level 6
不要看不起小学生的题目...
2010年02月12日 12点02分 8
level 5
小学没学开方
2010年02月12日 13点02分 9
level 6
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2010年02月13日 07点02分 10
level 9
怎样算log呢
2010年02月16日 09点02分 11
level 6
再顶
2010年02月20日 07点02分 12
level 11
其实。。这个很麻烦。。懒的写。。。。
2010年02月20日 12点02分 13
level 6
'二分法
r=91
x=7
d=0.00001
a=1
b=2
While b-a>d
c=(a+b)/2
If Sgn(c^x-r)= Sgn(a^7-r) Then
a=c
Else
b=c
End If
Wend
MsgBox c
MsgBox c^7
2010年04月16日 00点04分 14
1