This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Generating Modulo and Remainder Operations


Rohit Arul Raj skrev:
> 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.
>   
You could just use Ada, which has both mod and rem operators. If you
need to use that code from an existing C program, it should work too.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]