Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ileWyrazow = 16;
- double wartoscX = 1.3;
- double wartoscLogarytmu = 0;
- double wartoscJednegoElementu = 0;
- for (int i = 1; i < ileWyrazow; i++) {
- if(i%2==1){
- wartoscJednegoElementu = Math.pow((wartoscX - 1), i); // Math.pow(2,5)
- wartoscJednegoElementu = wartoscJednegoElementu / i;
- wartoscLogarytmu = wartoscLogarytmu + wartoscJednegoElementu;
- }
- if (i%2==0){
- wartoscJednegoElementu = Math.pow((wartoscX - 1), i);
- wartoscJednegoElementu = wartoscJednegoElementu / i;
- wartoscLogarytmu = wartoscLogarytmu - wartoscJednegoElementu;
- }
- }
- System.out.println("WARTOSC LOGARYTMU NATURALNEGO Z :" + wartoscX + " WYNOSI : " + wartoscLogarytmu);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement