Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Arithmetic onpoly_ints   [Contents][Index]


9.4.3 Division ofpoly_ints

Division ofpoly_ints is possible for certain inputs. The functionsfor division return true if the operation is possible and in most casesreturn the results by pointer. The routines are:

multiple_p (a,b)
multiple_p (a,b, &quotient)

Return true ifa is an exact multiple ofb, storing the resultinquotient if so. There are overloads for various combinationsof polynomial and constanta,b andquotient.

constant_multiple_p (a,b)
constant_multiple_p (a,b, &quotient)

Likemultiple_p, but also test whether the multiple is acompile-time constant.

can_div_trunc_p (a,b, &quotient)
can_div_trunc_p (a,b, &quotient, &remainder)

Return true if we can calculate ‘trunc (a /b)’ at compiletime, storing the result inquotient andremainder if so.

can_div_away_from_zero_p (a,b, &quotient)

Return true if we can calculate ‘a /b’ at compile time,rounding away from zero. Store the result inquotient if so.

Note that this is true if and only ifcan_div_trunc_p is true.The only difference is in the rounding of the result.

There is also an asserting form of division:

exact_div (a,b)

Assert thata is a multiple ofb and return‘a /b’. The result is apoly_int ifais apoly_int.


Next:Otherpoly_int arithmetic, Previous:wi arithmetic onpoly_ints, Up:Arithmetic onpoly_ints   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp