touchgfx::muldiv() is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

touchgfx::muldiv() function

@fn static int32_t muldiv(int32_t factor1, int32_t factor2, int32_t divisor, int32_t& remainder) Multiply and divide. Multiply and divide without causing overflow. Multiplying two large values and subsequently dividing the result with another large value might cause an overflow in the intermediate result. The function muldiv() will multiply the two first values and divide the result by the third value without causing overflow (unless the final result would overflow). The remainder from the calculation is also returned.

Syntax

int32_t muldiv(int32_t factor1,     int32_t factor2,     int32_t divisor,     int32_t& remainder);

Arguments

factor1

The first factor.

factor2

The second factor.

divisor

The divisor.

remainder

Return value

An int32_t.

References

LocationReferrerScopeText
Utils.hpp:200
int32_t muldiv(int32_t factor1, int32_t factor2, int32_t divisor, int32_t& remainder);
CWRUtil.hpp:194touchgfx::CWRUtil::Q5::operator*() consttouchgfx::CWRUtil::Q5
return Q5(muldiv(v, int(q15), Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE * Rasterizer::POLY_BASE_SIZE, remainder));
CWRUtil.hpp:619touchgfx::CWRUtil::sine()touchgfx::CWRUtil
return Q15(muldiv(int(sineHigh - sineLow), fraction, Rasterizer::POLY_BASE_SIZE, remainder)) + sineLow;
CWRUtil.hpp:822touchgfx::CWRUtil::muldivQ5()touchgfx::CWRUtil
return Q5(muldiv(int(factor1), int(factor2), int(divisor), remainder));
CWRUtil.hpp:859touchgfx::CWRUtil::_angle()touchgfx::CWRUtil
Q10 dy = Q10(muldiv(int(y), int(_1 * _1), int(d), remainder));

Call Tree

Type of touchgfx::muldiv()
touchgfx::muldiv()
int32_t
all items filtered out