This is the mail archive of the
mailing list for the GCC project.
Re: Generating Modulo and Remainder Operations
- From: Erik <esigra at gmail dot com>
- To: Rohit Arul Raj <rohitarulraj at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 27 Oct 2009 00:32:49 +0100
- Subject: Re: Generating Modulo and Remainder Operations
- References: <email@example.com> <firstname.lastname@example.org>
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.