City University of Hong Kong CS 3391 big number: multplicaton //multiplication: c[] = a[] * b[] void multiply(int a[],int b[],int c[]){ //[1] multiply digits: c = a * b FOR(i, 1, a[0]) FOR(j, 1, b[0]) c[i+j-1] += a[i] * b[j]; c[0] = a[0] + b[0] - 1; //[2] handle carry bit, same with addtion //[3] handle carry flag while(flag){ c[++c[0]] = flag%10; fl ...[Show More]
| Category: | CASE STUDY |
| Number of pages: | 7 |
| Language: | English |
| Last updated: | 8 months ago |
| Downloads: | 1 |
| Views: | 7 |
Get help from verified experts or start a custom project.