Movatterモバイル変換


[0]ホーム

URL:


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


9.4.4 Otherpoly_int arithmetic

There are tentative routines for other operations besides division:

can_ior_p (a,b, &result)

Return true if we can calculate ‘a |b’ at compile time,storing the result inresult if so.

Also, ANDs with a value ‘(1 <<y) - 1’ or its inverse can betreated as alignment operations. SeeAlignment ofpoly_ints.

In addition, the following miscellaneous routines are available:

coeff_gcd (a)

Return the greatest common divisor of all nonzero coefficients ina, or zero ifa is known to be zero.

common_multiple (a,b)

Return a value that is a multiple of botha andb, whereone value is apoly_int and the other is a scalar. The resultwill be the least common multiple for some indeterminate values butnot necessarily for all.

force_common_multiple (a,b)

Return a value that is a multiple of bothpoly_inta andpoly_intb, asserting that such a value exists. Theresult will be the least common multiple for some indeterminate valuesbut not necessarily for all.

When using this routine, please add a comment explaining why theassertion is known to hold.

Please add any other operations that you find to be useful.


[8]ページ先頭

©2009-2026 Movatter.jp