1.29.7.6 DIVAS_DivmodSigned Function
C
uint64_t DIVAS_DivmodSigned(int32_t numerator, int32_t denominator)
Summary
This function uses the DIVAS peripheral to performs a signed 32-bit division, and returns both the quotient and remainder as 64-bit number.
Description
This function uses the DIVAS peripheral to perform a signed 32-bit division. The function takes a signed divisor and dividend as input, and returns quotient and remainder as 64-bit number
Precondition
The peripheral should have been initialized by calling the DIVAS_Initialize() function once.
Parameters
Param | Description |
---|---|
numerator | This should contain the signed dividend. |
denominator | This should contain the signed divisor |
Returns
Returns quotient and remainder as 64-bit number (32-bit LSB is quotient and 32-bit MSB is remainder).
Example
int32_t dividend; int32_t divisor; uint64_t divmod; dividend = 10000; divisor = -2000; divmod = DIVAS_DivmodSigned(dividend, divisor)
Remarks
None.