x的x次方等于10

其中要用到牛顿迭代法

import java.math.*;
public class Ti3 
{
	public static void main(String [] args)
	{
		double e;
		double guess=2.0;
		do
		{
			guess=10*Math.pow(guess, 1-guess);
			e=Math.pow(guess,guess)-10;
		}while(Math.abs(e)>10e-6);
		System.out.println(guess);
		System.out.println(Math.pow(guess, guess));
	}
}


猜你喜欢

转载自blog.csdn.net/ganghaod/article/details/50761856
x