IntPow
IntPow
Description
Generic exponentiation convenience macro.
Parameters
| Name | Direction | Description |
|---|---|---|
result |
out | Destination for the result |
base |
in | Base value |
exponent |
in | Exponent selected through generic dispatch |
Usage example (from documentation)
IntPow(&power, &base, 20u);Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:875:
}
void(IntPow)(Int *result, Int *base, Int *exponent) {
ValidateInt(result);
ValidateInt(base);- In
Int.Math.c:276:
bool test_int_pow_generic(void) {
WriteFmt("Testing IntPow generic dispatch\n");
Int base = IntFrom(7);- In
Int.Math.c:283:
Str text = StrInit();
IntPow(&result_value, &base, 20u);
text = IntToStr(&result_value);
bool result = strcmp(text.data, "79792266297612001") == 0;- In
Int.Math.c:288:
StrDeinit(&text);
IntPow(&result_value, &base, exponent);
text = IntToStr(&result_value);
result = result && (strcmp(text.data, "79792266297612001") == 0);- In
Math.h:105:
/// TAGS: Int, Math, Power, Exponentiation
///
void (IntPow)(Int *result, Int *base, Int *exponent);
///
/// Divide one integer by another using floor division.
- In
Math.h:489:
(exponent), \
Int: MISRA_PRIV_IntPowValue, \
Int *: IntPow, \
const Int *: MISRA_PRIV_IntPowConst, \
unsigned char: MISRA_PRIV_IntPowU64, \
Last updated on