Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

binary multiplication

int binMultiply(long long a,long long b,long long m){
    int ans=0;
    while(b){
        if(b&1){
            ans=(ans+a)%m;
        }
        a=(a+a)%m;
        b=b>>1;
    }
    return ans;
}
 
PREVIOUS NEXT
Tagged: #binary #multiplication
ADD COMMENT
Topic
Name
9+3 =