Mail Archives: djgpp-workers/2008/04/23/12:04:37
Curious, I checked under Solaris and Darwin:
% cat foo.c
#include <stdio.h>
int main(void) {
printf("%f\n", -0.0);
printf("%+f\n", -0.0);
return 0;
}
% gcc foo.c -o foo
% uname -a
SunOS quantum 5.10 Generic_118833-24 sun4u sparc SUNW,Ultra-60 Solaris
% ./foo
-0.000000
-0.000000
% uname -a
Darwin quantum.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:23:43 PST 2008; root:xnu-1228.4.31~1/RELEASE_PPC Power Macintosh
% ./foo
-0.000000
-0.000000
--
j
On Wed|2008.04.23, Juan Manuel Guerrero wrote:
>The following line:
> printf("%f", -0.0);
>produces on linux the following output:
> -0.000000
>but with djgpp this one:
> 0.000000
>To get the same output, the djgpp line must look like this:
> printf("%+f", -0.0);
>Is this intentional?
>
>Regards,
>Juan M. Guerrero
- Raw text -