This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

possible bug(non-compliance)


Hello -
        This code segment generates an error.  modf only works if doubles 
are passed.  Even though the C++ standard says that modf should work with 
either doubles or floats.

I was running a linux intel box, gcc version 2.91.66 (provided by red hat)


#include <stdio.h>
#include <cmath>

void main (void)
{
        float  fred = 0.0;
        float  herman = 0.0;
        float georges = 0.0;

        fred = 1.5; 

        georges = modf (fred, & herman);

        printf ("%g %g %g\n", georges,herman, fred);
}


-ramzi



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]