VB中的一系列问题 [英] a series problem in vb

查看:113
本文介绍了VB中的一系列问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ,,
在控制台应用程序的Visual Studio 2008中工作
并在解决此问题时遇到了麻烦:

e = x + x ^ 2/2!+ x ^ 3/3!+ ...

请提供任何帮助,我将不胜感激

,
am working on visual studio 2008 on console application
and am having a trouble solving this problem:

e=x+x^2/2!+x^3/3!+...

plzz any help i''d appreciate it

推荐答案

您在担心什么?
您知道,Visual Basic提供了迭代.
What is you trouble about?
You know, Visual Basic provide iterations.




首先,公式是错误的,右边是产生exp(x)或e ^ x而不是e的无穷多项式.

现在你有什么问题?右边是项的总和,只要知道前一项的值,就可以轻松计算出每个项.两个建议:
-使用双打
-确保将序列继续足够长的时间,即直到最新项仅是到目前为止部分和的一小部分(例如1/10 ^ 15).

只需一个简单的循环即可!

:)
Hi,

first of all your formula is wrong, the right hand side is the infinite polynomial that yields exp(x) or e^x, not e.

now what is your problem? the right hand side is the sum of terms, each term can easily be calculated once the value of the previous one is known. Two suggestions:
- use doubles
- make sure to continue the series long enough, i.e. till the newest term is only a fraction (say 1/10^15) of the partial sum so far.

A simple loop is all it takes!

:)


一个词:递归.

其余的可以在教科书中找到.
One word: Recursion.

The rest can be found in your text book.


这篇关于VB中的一系列问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆