Pretty cool exercise in math theory.
Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.
%
is the C remainder function. Stating thatmod()
is trying to mimic that and not the classical modulus function would aid in clarity.Recommend
CHAR_BIT
rather than 8. @Deduplicator @DeduplicatorOverflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.
Helper functions like
multiply_recursive()
could bestatic
.
Pretty cool exercise in math theory.
Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.
%
is the C remainder function. Stating thatmod()
is trying to mimic that and not the classical modulus function would aid in clarity.Recommend
CHAR_BIT
rather than 8. @DeduplicatorOverflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.
Helper functions like
multiply_recursive()
could bestatic
.
Pretty cool exercise in math theory.
Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.
%
is the C remainder function. Stating thatmod()
is trying to mimic that and not the classical modulus function would aid in clarity.Recommend
CHAR_BIT
rather than 8. @DeduplicatorOverflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.
Helper functions like
multiply_recursive()
could bestatic
.
Pretty cool exercise in math theory.
Code relies on two's complement integers. Certainly they are common. Still, stating that dependency is good.
%
is the C remainder function. Stating thatmod()
is trying to mimic that and not the classical modulus function would aid in clarity.Recommend
CHAR_BIT
rather than 8. @DeduplicatorOverflow can occur with all 5 functions. Suggest documenting these functions behavior in those cases.
Helper functions like
multiply_recursive()
could bestatic
.