diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-29 16:03:54 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-29 16:03:54 +0000 |
commit | dd3b517670170d694bb35ef1a5fb843e4361fa93 (patch) | |
tree | 3f6beed37971b8317622cdb7ed034bf08f26b0fa /libgfortran | |
parent | b17619a04d7d76efbe373f20ce6c598143482a22 (diff) | |
download | gcc-dd3b517670170d694bb35ef1a5fb843e4361fa93.tar.gz |
PR 48488 Fix comments
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/io/write.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 40f4112438f..bfc24633e7a 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1457,14 +1457,17 @@ set_fnode_default (st_parameter_dt *dtp, fnode *f, int length) } } -/* Output a real number with default format. This is 1PG16.9E2 for - REAL(4), 1PG25.17E3 for REAL(8), 1PG30.21E4 for REAL(10) and - 1PG45.36E4 for REAL(16). The exception is that the Fortran standard - requires outputting an extra digit when the scale factor is 1 and - when the magnitude of the value is such that E editing is - used. However, gfortran compensates for this, and thus for list - formatted the same number of significant digits is generated both - when using F and E editing. */ +/* Output a real number with default format. To guarantee that a + binary -> decimal -> binary rountrip conversion recovers the + original value, IEEE 754-2008 requires 9, 17, 21 and 36 significant + digits for REAL kinds 4, 8, 10, and 16, respectively. Thus, we use + 1PG16.9E2 for REAL(4), 1PG25.17E3 for REAL(8), 1PG30.21E4 for + REAL(10) and 1PG45.36E4 for REAL(16). The exception is that the + Fortran standard requires outputting an extra digit when the scale + factor is 1 and when the magnitude of the value is such that E + editing is used. However, gfortran compensates for this, and thus + for list formatted the same number of significant digits is + generated both when using F and E editing. */ void write_real (st_parameter_dt *dtp, const char *source, int length) |