Skip to content

Commit

Permalink
document the safe_div_round_up_TYPE functions
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#17884)
  • Loading branch information
paulidale committed Mar 29, 2022
1 parent 330ff7e commit 87639c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/internal/man3/OSSL_SAFE_MATH_SIGNED.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

OSSL_SAFE_MATH_SIGNED, OSSL_SAFE_MATH_UNSIGNED,
safe_add_TYPE, safe_sub_TYPE, safe_mul_TYPE, safe_div_TYPE, safe_mod_TYPE,
safe_neg_TYPE
safe_div_round_up_TYPE, safe_neg_TYPE
- create helper functions to safely perform non-overflowing integer operations

=head1 SYNOPSIS
Expand All @@ -21,6 +21,7 @@ safe_neg_TYPE
TYPE safe_mul_TYPE(TYPE a, TYPE b, int *err);
TYPE safe_div_TYPE(TYPE a, TYPE b, int *err);
TYPE safe_mod_TYPE(TYPE a, TYPE b, int *err);
TYPE safe_div_round_up_TYPE(TYPE a, TYPE b, int *err);
TYPE safe_muldiv_TYPE(TYPE a, TYPE b, TYPE c, int *err);
TYPE safe_neg_TYPE(TYPE a, int *err);
TYPE safe_abs_TYPE(TYPE a, int *err);
Expand Down Expand Up @@ -49,6 +50,10 @@ safe_div_TYPE() divides I<a> by I<b>.

safe_mod_TYPE() calculates the remainder when I<a> is divided by I<b>.

safe_div_round_up_TYPE() calculates I<a> / I<b> + (I<a> % I<b> != 0).
I.e. it computes the quotient of I<a> and I<b> rounding any remainder towards
positive infinity.

safe_muldiv_TYPE() multiplies I<a> and I<b> together and divides the
result by I<c>.

Expand Down

0 comments on commit 87639c6

Please sign in to comment.