double start = 2000.0000;
double end = 15000.0000;
double key;
key=Math.Pow(end/start, 1d / 1300d);
double end1 =Math.Pow(key, 1300d) * 2000d;
//测试最终end1约等于15000,应该是这样吧
double start = 2000; double end = 15000; double key; double dd = 1300;
key = Math.Pow(end / start, 1 / dd) - 1;
Console.WriteLine(key);
double result = start;
for (var i = 0; i < 1300; i++)
{
result *= (1 + key);
}
Console.WriteLine(result);
Console.ReadKey();
static void Main(string[] args)
{
double from = 2000d;
double to = 15000d;
int count = 1300;
double key = Cal(from, to, count);
Console.WriteLine(key);
Console.ReadLine();
}
static double Cal(double from, double to, int count)
{
double key = Math.Pow(to / from, 1d / (count - 1)) - 1;
return key;
}
startNum * (1+key)^1300-1 = endNum
1+key = (1300-1)√endNum/startNum
key = (1300-1)√endNum/startNum - 1
等比数列
key 是整数吗?
– Shendu.CC 5年前