x的x次方等于10

来源:互联网 发布:st 8位单片机 编辑:程序博客网 时间:2024/04/28 11:53

其中要用到牛顿迭代法

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));}}


0 0