Generating Modulo and Remainder Operations

Rohit Arul Raj rohitarulraj@gmail.com
Tue Oct 20 16:45:00 GMT 2009


Hello All,

I have seen some notes that the results of  Modulo and Remainder for
integer operations are not the same. From the GCC code, i have seen
that modulo and remainder give same results for unsigned data types
and they are different only for signed data types.

My question is how to write "C" statements to generate Modulo &
Remainder operations.

a = -2 % 5 (gives the modulus i suppose), similarly is there an "C"
statement to generate Remainder operation.

Regards,
Rohit



More information about the Gcc-help mailing list