Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Dec 19, 2024
1 parent 8e085ac commit 409b821
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ public static int sizeOf(long number) {
}

public static int sizeOfSigned(long number) {
return (BitUtil.log2(number) - 1) / 7 + 1 + 1;
if (number < 0) {
// set the 1st bit to 1
return sizeOf(~(number << 1));
} else {
return sizeOf(number << 1);
}
}
}

0 comments on commit 409b821

Please sign in to comment.