Advertisement
SmellyBadger

Untitled

Nov 5th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. int remainder = 0;
  2. decimalToBase(opResult, base, resultWithNoTrailingZero, numTrailingZeros)
  3. while (opResult > 0)
  4. {
  5. remainder = opResult - base;
  6. resultWithNoTrailingZero += resultWithNoTrailingZero * 10 + remainder;
  7. if (resultWithNoTrailingZero == 0)
  8. numTrailingZeros++;
  9. opResult = opResult / base;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement