Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bit-Manipulation/SetBit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR
*/

/**
/*
Comment thread
raklaptudirm marked this conversation as resolved.
Outdated
* @param {number} number
* @param {number} bitPosition - zero based.
* @return {number}
Expand Down
12 changes: 6 additions & 6 deletions Maths/FindLcm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const findLcm = (num1, num2) => {
let maxNum
let lcm
// Check to see whether num1 or num2 is larger.
if (num1 > num2) {
maxNum = num1
} else {
maxNum = num2
}
maxNum = Math.max(num1, num2)
Comment thread
raklaptudirm marked this conversation as resolved.
Outdated
lcm = maxNum

while (true) {
if (lcm % num1 === 0 && lcm % num2 === 0) break
lcm += maxNum
if (num1 > num2) {
Comment thread
raklaptudirm marked this conversation as resolved.
Outdated
maxNum = num1
} else {
maxNum = num2
}
}
return lcm
}
Expand Down
2 changes: 1 addition & 1 deletion Maths/LeapYear.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* The logic behind the leap year is-
* 1. If the year is divisible by 400 then it is a leap year.
* 2. If it is not divisible by 400 but divisible by 100 then it is not a leap year.
* 3. If the year is not divisible by 400 but not divisible by 100 and divisible by 4 then a leap year.
* 3. If the year is not divisible by both 400 and 100 but divisible by 4 then a leap year.
* 4. Other cases except the describing ones are not a leap year.
*
* @param {number} year
Expand Down