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

C51 specification

Hi Guys,

I want to test an unsigned long with the mod operator (%), if the result is positive then the result is used, if not then the long value is used.

I can't find the spec for C51 which describes what happens if the result of the mod is negative. Does it return '0' or a negative value.

This is definitely the tidiest way to do the job. I can do it differently and will do so for now, and will also set up some testing to check behaviour of the mod operator.

It would be very useful and might save me some valuable time if I could check behaviour with the C51 spec but can't find it anywhere. K & C ANSI doesn't help much, just says that the result is compiler dependant.

Thanks

0