Next: Other poly_int
arithmetic, Previous: wi
arithmetic on poly_int
s, Up: Arithmetic on poly_int
s [Contents][Index]
poly_int
sDivision of poly_int
s is possible for certain inputs. The functions
for division return true if the operation is possible and in most cases
return the results by pointer. The routines are:
Return true if a is an exact multiple of b, storing the result in quotient if so. There are overloads for various combinations of polynomial and constant a, b and quotient.
Like multiple_p
, but also test whether the multiple is a
compile-time constant.
Return true if we can calculate ‘trunc (a / b)’ at compile time, storing the result in quotient and remainder if so.
Return true if we can calculate ‘a / b’ at compile time, rounding away from zero. Store the result in quotient if so.
Note that this is true if and only if can_div_trunc_p
is true.
The only difference is in the rounding of the result.
There is also an asserting form of division:
Assert that a is a multiple of b and return
‘a / b’. The result is a poly_int
if a
is a poly_int
.