This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Generating Modulo and Remainder Operations
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: Rohit Arul Raj <rohitarulraj at gmail dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 20 Oct 2009 06:39:13 -0700
- Subject: RE: Generating Modulo and Remainder Operations
- References: <c356fd4e0910200532g41ea06a7r93109c0bc4bc9626@mail.gmail.com>,<c356fd4e0910200542g61259a7apa5fad3719215e8a3@mail.gmail.com>
Hi Rohit,
> is there an "C" statement to generate Remainder operation.
Yes, you can use the Standard C Library routine modf (and it's companions modfl and modff).
Alternatively, for integers you can use the % operator with unsigned numbers. (If you need to work with signed numbers, convert the signed numbers to unsigned numbers and adjust the result's sign accordingly.)
Sincerely,
--Eljay