Skip to content

Commit 057f399

Browse files
committed
variadic MathLib.lcm
1 parent 870991a commit 057f399

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Math/MathLib.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ public static long gcd(long... a){
3030
}
3131
return r;
3232
}
33-
public static long lcm(long a, long b){
34-
a = java.lang.Math.abs(a);
35-
b = java.lang.Math.abs(b);
36-
return a / gcd(a,b) * b;
37-
}
33+
3834
public static long lcm(long... a){
3935
if(a.length == 0) return 0;
4036
long r = java.lang.Math.abs(a[0]);

0 commit comments

Comments
 (0)