Mail Archives: djgpp/2001/05/08/09:01:39
Hello,
In a first time, I prefer to think that it's a bug in
my install, instead
in gcc, but it's quite strange.
I've wrote a {\tinytiny} program which run correctly
when it's compiled with
gcc -o test.exe test.c -lm
but doesn't with
gcc -o test.exe test.c -lm -ansi
Here's the source :
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main (void)
{
float next = 0.0;
float prev = 0.0;
printf("%e \n", next);
while (prev < 1e-40)
{
next = nextafterf(prev, 1.0); /* the
func I test */
printf("%e \n", next);
prev = next;
}
return EXIT_SUCCESS;
}
and here's the output when I compile with the '-ansi'
flag :
c:\djgpp\home\misc\libm\>test.exe
0.000000e+00
1.638400e+04
When I don't specify the '-ansi' flag, the program run
as we're waiting for
(not very interesting :p); dus I suppose that the libm
is ok.
I use djgpp with gcc 2.95.3.
--drkm
___________________________________________________________
Do You Yahoo!? -- Pour faire vos courses sur le Net,
Yahoo! Shopping : http://fr.shopping.yahoo.com
- Raw text -