I know that similar questions has been asked in the past, but I have implemented after a long process the algorithm to find the quotient correctly using the division by repeated subtraction method. But I am not able to find out the remainder from this approach. Is there any quick and easy way for finding out remainder in 64bit/64bit division on 32bit processor. To be more precise I am trying to implement
ulldiv_t __aeabi_uldivmod(
unsigned long long n, unsigned long long d)
Referenced in this document http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf
a % b = a - (a/b)*b
. The implementation will be similar to doing 128/128 bit division on 64-bit processor that you can find somewhere over here https://mcmap.net/q/590996/-unsigned-128-bit-division-on-64-bit-machine/995714 https://mcmap.net/q/833185/-fastest-way-to-calculate-a-128-bit-integer-modulo-a-64-bit-integer – Boffin