Skip to content
Merged
Changes from all 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
3 changes: 2 additions & 1 deletion Conversions/AnyBaseToAnyBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public static String base2base(String n, int b1, int b2) {
// the remainder until the quotient is zero. The number in the
// new base is the remainders, with the last remainder
// being the left-most digit.

if (0 == decimalValue)
return "0";
// While the quotient is NOT zero:
while (decimalValue != 0) {
// If the remainder is a digit < 10, simply add it to
Expand Down