Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class maincl {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- double fVal;
- double aN;
- double cntN;
- double qN;
- for (double x=0;x<=2;x+=0.2)
- {
- aN=x;
- cntN=0;
- fVal=0;
- while(Math.abs(aN)>0.000001)
- {
- fVal+=aN;
- qN=-x*x*(2*cntN+1)/(cntN+1)*(2*cntN+3);
- aN=qN*aN;
- cntN+=1;
- }
- System.out.println("x="+x+" f="+fVal+" cntN="+cntN+" aN="+aN);
- }
- System.out.print("Whasaaap?");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement