c++ - get number of the binary % operator iterations -


i trying find out how many times % has substracted number another.

for example if 256 % 50 = 6, iterations have been 5? 256 - 50 - 50 - 50 - 50 - 50.

if 145 % 40 = 25, iterations have been 3. 145 - 40 - 40 - 40.

i looking solution problem without usiong kind of loop, recursion or goto.

what you're looking / operator.

try division operator instead of modulus operator. works every time. it's fundamental math.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -