mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -3,15 +3,15 @@
|
||||
* @param n The number to check.
|
||||
*/
|
||||
export function isPowerOfTwo(n: number): boolean {
|
||||
if (isNaN(n)) {
|
||||
return false;
|
||||
}
|
||||
if (isNaN(n)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (n === 0) {
|
||||
return false;
|
||||
}
|
||||
if (n === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disabiling the bitwise rule because it's honestly the most effecient way to check for this.
|
||||
// tslint:disable-next-line:no-bitwise
|
||||
return (n & (n - 1)) === 0;
|
||||
// Disabiling the bitwise rule because it's honestly the most effecient way to check for this.
|
||||
// tslint:disable-next-line:no-bitwise
|
||||
return (n & (n - 1)) === 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user