mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-24 04:54:21 +08:00
style: enable ParameterName
in CheckStyle. (#5196)
* Enabled: ParameterName in CheckStyle. * Refactored to fix bug caused by selfAssignment of variables in VectorCrossproduct class
This commit is contained in:

committed by
GitHub

parent
2568b96784
commit
c42b1c940c
@ -27,15 +27,15 @@ public class BinaryExponentiation {
|
||||
}
|
||||
|
||||
// iterative function to calculate a to the power of b
|
||||
long power(long N, long M) {
|
||||
long power = N;
|
||||
long power(long n, long m) {
|
||||
long power = n;
|
||||
long sum = 1;
|
||||
while (M > 0) {
|
||||
if ((M & 1) == 1) {
|
||||
while (m > 0) {
|
||||
if ((m & 1) == 1) {
|
||||
sum *= power;
|
||||
}
|
||||
power = power * power;
|
||||
M = M >> 1;
|
||||
m = m >> 1;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
Reference in New Issue
Block a user