-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFun43.java
More file actions
28 lines (23 loc) · 589 Bytes
/
Fun43.java
File metadata and controls
28 lines (23 loc) · 589 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package fun;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> fun
* Class Date -> 6/21/2022/ 12:27 PM
*/
public class Fun43 {
public static void main(String[] args) {
System.out.println("Ln: "+Ln(5,2));
}
public static double Ln(double x, double e ){//X-2
double sum = 0;
double surat, maxraj;
int ishora = -1;//1
for (int i = 1; i <=e; i++) {
surat = Math.pow(x,i+1);
maxraj = i+1;
sum += ishora * (surat / maxraj);
ishora *= -1;//
}
return sum;
}
}