This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Modulus calculation large numbers

Having trouble calculating modulus keep end up in DAbt_Handler. Is there issue with large numbers here?

U32 result calc_mod (U32 *a, U32 *b){

   return *a % *b;
}

typical values for a=0x496f6e77 and b = 0x3c

Using RTX maybe significant.

Any ideas or pointers thanks?

best regards
Darren

Parents
  • Hi Thanks for the feedback

    It was a bad pointer causing the fault, i did post reply seems to have gone missing :-)

    Yes "a" points to an integer of such a value, seems to be ok now with these large numbers provided you ensure you are actually pointing at them :-{ my mistake.

    ok about the pointer and int being the same size, new to ARM, been using 8 bit previously need to reset my mindset.

    Thanks for the reply and hints though.
    Darren

Reply
  • Hi Thanks for the feedback

    It was a bad pointer causing the fault, i did post reply seems to have gone missing :-)

    Yes "a" points to an integer of such a value, seems to be ok now with these large numbers provided you ensure you are actually pointing at them :-{ my mistake.

    ok about the pointer and int being the same size, new to ARM, been using 8 bit previously need to reset my mindset.

    Thanks for the reply and hints though.
    Darren

Children
No data