[Bug libfortran/20124] gfortran prints -.01 incorrectly

coudert at clipper dot ens dot fr gcc-bugzilla@gcc.gnu.org
Thu Feb 24 20:40:00 GMT 2005

------- Additional Comments From coudert at clipper dot ens dot fr  2005-02-24 16:24 -------
$ cat pr20124.f 
      x = -.01
      y = .01
      write(*,'(2f10.2)') x, y
      print *, x, y
$ ./bin/gfortran -static pr20124.f && ./a.out
      0.00      0.00
 -9.9999998E-03  9.9999998E-03

It looks like we're not handling the rounding correctly in this case (if you try
with x=-0.05, which can be represented in a real exactly, it doesn't happen).



More information about the Gcc-bugs mailing list