This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Generating Modulo and Remainder Operations
Hi David,
> So, you're saying modf() will work for signed and unsigned, floating and integer types?
The modf() Standard C Library routine works with double types. Assuming your platform's double is a 64-bit float (of the ISO 60559 sort, which was derived from IEEE 754), that will handle integer types up to 53-bits of precision, of either positive or negative sign.
If you are working with 64-bit integers, then modf() will not be suitable.
If you are working with 32-bit integers, then modf() will be suitable.
Sincerely,
--Eljay