This is the mail archive of the
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: <email@example.com>,<firstname.lastname@example.org>
> 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.)