TI-84:使用程序与主屏幕时相同的公式、相同的输入、不同的答案
我想在 TI-Basic 中编写一个简单的公式来计算 TI-84 计算器的复利。复利的公式为A = P(1+(r/n))^(n)(t)
,其中p
是本金,r
是利率(以小数表示),n
是本金复利的次数,t
是时间量,>a
是您添加利息后的最终金额。
当我设置变量(见下文)并在计算器主屏幕上准确输入公式时,我得到$7332.86,这是正确的答案。
但是,当我设置变量并以程序形式输入公式时(见下文),我得到 $42684.69,这是不正确的。
我已经在 2 个不同的 TI-84 计算器上尝试过这个程序,并且得到了相同的结果,所以这不是我的计算器的问题。
老实说,我很困惑。我不知道为什么会发生这种情况,所以如果你擅长数学,知道如何编写 ti 系列计算器,或者只是看到我遗漏的错误,请告诉我,因为这件事一直让我发疯!
具有相同输入和公式的程序,但给出的答案与在主屏幕上使用时不同:
: 2000 -> P
: 0.065 -> R
: 54 -> N
: 20 -> T
: P(1+(R/N))^(N)(T) -> A
: Disp A
I wanted to write a simple formula in TI-Basic to calculate compound interest for my TI-84 calculator. The formula for compound interest is A = P(1+(r/n))^(n)(t)
where p
is the principal amount, r
is the interest rate (expressed as a decimal), n
is the number of times the principal is compounded, t
is the amount of time, and a
is your final amount with interest added.
When I set variables (see below) and and type the formula in exactly how it is above on my calculators home screen, I get $7332.86, which is the correct answer.
However, when I set the variables and type the formula in as a program (see below), I get $42684.69, which is not correct.
I have tried this program on 2 different TI-84 calculators and I have gotten the same results, so it is not something with my calculator.
I am honestly stumped. I have no idea why this is happening, so if you are good at math, know how to program a ti series calculator, or just see a mistake that I am missing, please tell me because this thing has been driving me crazy!
Program with same inputs and formula but gives different answer than when used on the home screen:
: 2000 -> P
: 0.065 -> R
: 54 -> N
: 20 -> T
: P(1+(R/N))^(N)(T) -> A
: Disp A
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不完全知道您面临的问题是什么,但我认为您的程序应该如下所示:
编辑
我认为您需要一组额外的括号。
^(N)(T)
仅求N
次方,然后乘以T
。尝试^((N)(T))
或简单地^(NT)
。I don't exactly know what the problem you are facing is, but I think your program should look like this:
EDIT
I think you need an extra set of parentheses.
^(N)(T)
only raises to the power ofN
, and then multiplies byT
. Try^((N)(T))
or simply^(NT)
.你的公式相当于
T*P*((1+(R/N))^(N))
,这显然是错误的。这样做的原因是因为操作顺序。尝试P*(1+(R/N))^(T*N)
You're formula is equivalent to
T*P*((1+(R/N))^(N))
, which is obviously wrong. The reason it's doing this is because of the order of operations. TryP*(1+(R/N))^(T*N)
代码的较短版本(如果您想节省内存空间):
:promptP,R,N,T
:Disp P(1+(R/N))^(NT)
快乐编码!
A shorter version of the code (if you want to conserve memory space):
:promptP,R,N,T
:Disp P(1+(R/N))^(NT)
Happy coding!