dra2421's blog

By dra2421, history, 4 years ago, In English

why long long k =d ,cc=0 ; while(n >=k) cc += (n/k) ,k *=d; is wrong

while this is correct long long k =d ,cc=0 ; while(n) cc +=n/k , n /=k ;

  • Vote: I like it
  • -21
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

k in case 1 overflows sometimes

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

what is kk here?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by dra2421 (previous revision, new revision, compare).