嗨,先生,我正在创建一个CAGR计算器。但我不知道这个? [英] Hi sir, I am creating a CAGR calculator.but I dont have idea about this?

查看:75
本文介绍了嗨,先生,我正在创建一个CAGR计算器。但我不知道这个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://i.investopedia.com/cagrformula1.gif





以上是CAGR公式链接。我不是了解如何启动CAGR计算器项目的想法。



sir..plz帮助我解决这个问题。



我尝试过:



起始值为一个int a,最终值为int b。

作为int c的年数。但后来我无法继续...

https://i.investopedia.com/cagrformula1.gif


above is the CAGR formula link.i am not getting the idea how to start the project for CAGR calculator.

sir..plz help me in solving this.

What I have tried:

start value as one int a and end value as int b.
number of years as int c.but later i am unable to proceed...

推荐答案

查看提供的示例 [ ^ ]了解如何执行实际计算。然后在这里询问具体的(编程)问题,如果你坚持实现。
See the provided example[^] to understand how the actual computation is performed. Then ask here specific (programming) questions if you're stuck in the implementation.


公式绝对清楚:

将结束值除以起始值。 (a / b但我建议使用双倍而不是整数)。

将该值置于年数倒数的幂上:即如果年数为2,则它是(a / b)的平方根,如果年份为2,则它是立方根,依此类推。

从结果中减去一个。



这是C#中的一行简单代码!
The formula is absolutely clear:
Divide the ending value by the beginning value. (a / b but I'd suggest using a double rather than integers).
Put that value to the power of the reciprocal of the number of years: i.e. if the number of years is 2, then it's the square root of (a/b), if years is two, it's the cube root, and so on.
Subtract one from the result.

That's one simple line of code in C#!


这篇关于嗨,先生,我正在创建一个CAGR计算器。但我不知道这个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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