Browse Source

multiplication by even

remotes/origin/multiplication
fdai7930 11 months ago
parent
commit
1f58e49e55
  1. 4
      src/multiplication.c
  2. 1
      src/multiplication.h

4
src/multiplication.c

@ -60,5 +60,9 @@ int multiply_using_two_complements(int num1, int num2) {
return result;
}
int multiply_by_even(int num, int factor) {
return (num >> 1) << (factor + 1);
}

1
src/multiplication.h

@ -11,6 +11,7 @@ int multiply_by_random(int num);
int multiply_string(const char* str, int factor);
int multiply_by_sum(int num1, int num2);
int multiply_using_two_complements(int num1, int num2);
int multiply_by_even(int num, int factor);
#endif // MULTIPLICATION_H

Loading…
Cancel
Save