a possible bug in compiler version PVF 15.7

I just installed PVF version 15.7 and notice a small but non-negligible difference between V 15.7 and earlier versions. Here’s the test program:

program prog
real8 X
character
5 str

X=-0.001042D0
write(str,’(F5.2)’) X

end program prog

the result I got is str=-0.00 (with minus sign)
in previous compiler versions I did not see the minus sign

I expect to see str=0.00 (without minus sign)
Thanks
Giang Nong

I added a line to your test
PGI$ more test.f90
program prog
real8 X
character
6 str

X=-0.001042D0
write(str,’(F5.2)’) X
print *,“str is”,str

end program prog

PGI$ pgf90 -o test test.f90
PGI$ ./test
str is-0.00

I also moved the example to Linux and compiled with the Intel compiler
and gfortran.

all three give the same sign to the result.

If things have changed, it looks like things got more correct.

dave

I agree that the new compiler (15.7) seems to give more correct results. What worries me is that: this is a difference from previous compilers and this difference is NOT documented anywhere (or I did not find it). Please document this difference somewhere like Release Notes so that I am confident this is not unintended change.
Thanks

I found the following in Release Notes:

21522 15.7 Fortran Add an option to prevent Fortran formatted output from producing -0.0
Allow the environment variable, FORTRANOPT, to have the value “no_minus_zero” to inhibit emitting the ‘-’ for IEEE -0.0

=============================================

can somebody confirm that problem 21522 is related to this issue?

Thanks

Giang