Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. private static BigInteger recSum(BigInteger val, BigInteger moddiv, BigInteger result){
  2. if(moddiv.compareTo(val) == 1){
  3. return result;
  4. }else{
  5. val = val.mod(moddiv);
  6. moddiv = moddiv.multiply(BigInteger.valueOf(10));
  7. result = result.add(recSum(val, moddiv, result));
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement