Generating Modulo and Remainder Operations

John (Eljay) Love-Jensen eljay@adobe.com
Wed Oct 21 19:05:00 GMT 2009


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



More information about the Gcc-help mailing list