用程序求倒數


double reciprocal(double c)
{
	static int n = 10;
	if (--n)
	{
		double temp = reciprocal(c);
		return temp * (2 - temp * c);
	}
	return c / 2;
}



這個程序只能求大於0小於2的倒數,因爲0<cy0<1,而程序選取y0=1/2,所以0<c<2.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章