IntDiv
IntDiv
Description
Generic division convenience macro.
Parameters
| Name | Direction | Description |
|---|---|---|
result |
out | Destination for the quotient |
dividend |
in | Dividend |
divisor |
in | Divisor selected through generic dispatch |
Usage example (from documentation)
IntDiv("ient, &value, 10u);Usage example (Cross-references)
Usage examples (Cross-references)
- In
Float.c:650:
scale = float_pow10(precision);
IntMul(&scaled, &a->significand, &scale);
IntDiv(&temp.significand, &scaled, &b->significand);
temp.negative = FloatIsNegative(a) != FloatIsNegative(b);- In
Int.c:984:
}
void(IntDiv)(Int *result, Int *dividend, Int *divisor) {
Int quotient = IntInit();
Int remainder = IntInit();- In
Int.c:1020:
Int divisor_value = MISRA_PRIV_IntFromU64(divisor);
IntDiv(result, dividend, &divisor_value);
IntDeinit(&divisor_value);
}- In
Int.c:1027:
Int divisor_value = MISRA_PRIV_IntFromI64(divisor);
IntDiv(result, dividend, &divisor_value);
IntDeinit(&divisor_value);
}- In
Int.c:1155:
IntGCD(&gcd, a, b);
IntDiv("ient, a, &gcd);
IntMul(&lcm, "ient, b);- In
Int.Math.c:321:
bool test_int_div(void) {
WriteFmt("Testing IntDiv generic dispatch\n");
Int dividend = IntFrom(126);- In
Int.Math.c:326:
Int result_value = IntInit();
IntDiv(&result_value, ÷nd, 10u);
bool result = IntToU64(&result_value) == 12;- In
Int.Math.c:863:
bool test_int_div_scalar_zero_divisor(void) {
WriteFmt("Testing IntDiv scalar zero-divisor handling\n");
Int dividend = IntFrom(10);- In
Int.Math.c:868:
Int quotient = IntInit();
IntDiv("ient, ÷nd, 0u);
return false;
}- In
Math.h:120:
/// TAGS: Int, Math, Divide, Quotient
///
void (IntDiv)(Int *result, Int *dividend, Int *divisor);
///
/// Divide one integer by another only when the division is exact.
- In
Math.h:507:
(divisor), \
Int: MISRA_PRIV_IntDivValue, \
Int *: IntDiv, \
const Int *: MISRA_PRIV_IntDivConst, \
unsigned char: MISRA_PRIV_IntDivU64, \
Last updated on