Start |
|||
Long型変数Lの 宣言と 0 で初期化 |
|||
Double型変数aの 宣言と初期化(B2セル) |
|||
Double型変数xHiの 宣言と初期化(B3セル) |
|||
Double型変数xLoの 宣言と初期化(B4セル) |
|||
Double型変数epsの 宣言 |
L = L + 1 |
||
Double型変数x宣言と \( \Large \frac{xHi + xLo}{2} \)で初期化 |
f(x,a) > 0 |
xHi = x |
|
While eps > \( 10^{-5}\) And L < 1000 |
xLo = x |
||
xの表示(B5セル) |
\( x = \Large \frac{xHi + xLo }{2}\) |
||
Lの表示(B6セル) |
\( eps = | f(x,a) | \) |
||
End |
関数の定義
Function f(ByVal x As Double, ByVal a As Double) As Double
f = x ^ 2 - a
End Function