[C++] Nested Radical Constant
生活随笔
收集整理的這篇文章主要介紹了
[C++] Nested Radical Constant
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
做高數(shù)助教被天煞的大一學(xué)生坑了,發(fā)現(xiàn)是個(gè)未解問(wèn)題,沒(méi)有解析解。。
用C搞了下,就是這樣。。。
?
No closed-form expression is known for this constant (Finch 2003, p.?8; S.?Plouffe, pers. comm., Aug.?29, 2008).
?
/***************************************** *@: Nested Radical Constant 嵌套根式常數(shù) *@: http://mathworld.wolfram.com/NestedRadicalConstant.html *****************************************/ #include "stdafx.h" #include <stdio.h> #include <math.h> void main(void){int N = 10;int idx = 0;double an = 0;double temp = 0;an = sqrt(double(N));for(idx =(N-1);idx >= 1; idx--){temp = idx + an;an = sqrt(temp); }printf("N=%d,an=%f \n",N,an);getchar(); }
轉(zhuǎn)載于:https://www.cnblogs.com/alimy/p/4074344.html
總結(jié)
以上是生活随笔為你收集整理的[C++] Nested Radical Constant的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 3. Dataset、transform
- 下一篇: Effective C++ .07 vi