Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link
  1. Pretty cool exercise in math theory.

  2. Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.

  3. % is the C remainder function. Stating that mod() is trying to mimic that and not the classical modulus function would aid in clarity.

  4. Recommend CHAR_BIT rather than 8. @Deduplicator @Deduplicator

  5. Overflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.

  6. Helper functions like multiply_recursive() could be static.

  1. Pretty cool exercise in math theory.

  2. Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.

  3. % is the C remainder function. Stating that mod() is trying to mimic that and not the classical modulus function would aid in clarity.

  4. Recommend CHAR_BIT rather than 8. @Deduplicator

  5. Overflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.

  6. Helper functions like multiply_recursive() could be static.

  1. Pretty cool exercise in math theory.

  2. Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.

  3. % is the C remainder function. Stating that mod() is trying to mimic that and not the classical modulus function would aid in clarity.

  4. Recommend CHAR_BIT rather than 8. @Deduplicator

  5. Overflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.

  6. Helper functions like multiply_recursive() could be static.

Source Link
chux
  • 36.4k
  • 2
  • 43
  • 96
  1. Pretty cool exercise in math theory.

  2. Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.

  3. % is the C remainder function. Stating that mod() is trying to mimic that and not the classical modulus function would aid in clarity.

  4. Recommend CHAR_BIT rather than 8. @Deduplicator

  5. Overflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.

  6. Helper functions like multiply_recursive() could be static.

lang-c

AltStyle によって変換されたページ (->オリジナル) /