------- Comment #22 from burnus at gcc dot gnu dot org  2010-07-12 08:07 -------
Implemented: Rounding on output.

TODO: Rounding on input. Current result for the program below is:

    0.10000000149011611938E+00
    0.10000000149011611938E+00
    0.10000000000000000555E+00
    0.10000000000000000555E+00

Expected:
    0.10000000149011611938E+00
    0.99999882280826568604E-01
    0.10000000000000000555E+00
    0.99999999999999783507E-01

(i.e. '"round up" == "round down" + epsilon(r)')

(Side remark: None of my tested compiles handles this; not gfortran, not ifort
nor crayftn.)

Test program:

character(len=5) :: str
real(4) :: r4_1, r4_2
real(8) :: r8_1, r8_2

str = "0.1"
read(str,'(ru,g3.1)') r4_1
read(str,'(rd,g3.1)') r4_2
read(str,'(ru,g3.1)') r8_1
read(str,'(rd,g3.1)') r8_2
print '(e30.20)', r4_1
print '(e30.20)', r4_2
print '(e30.20)', r8_1
print '(e30.20)', r8_2
end


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35862

Reply via email to