------- Comment #6 from kargl at gcc dot gnu dot org 2008-01-31 04:09 ------- (In reply to comment #5) > Subject: Re: illegal E format descriptor produces wrong > output > > | There is no restriction in F95 that d must be positive in Ew.d. > | In 10.6.5.1, it clearly states that k = 0 at the beginning of > | execution of an input/output statement. The wording you quote > | above is (almost) identical to F95 language, so one could argue > | that the -d < k <= 0 is true when d = 0 and k = 0. > > I may be missing something, but "-d < k <= 0" doesn't hold > when d = 0 and k = 0. Notice the inequality "<". So, when k = 0, > how should we read the part we quote?
Notice the "=". -d < k <= 0 goes to -(d=0) < (k=0) <= 0 --> -0 < 0 <= 0. Zero is certainly less than or equal to zero. This case is probably covered in some murky, musty corner of the standard, but I haven't found it, yet. Jerry and Thomas are the IO gurus. > > | In any event, gfortran is definitely giving a bogus answer > | of 0E+1, and your desired output of ******* is probably the > | right thing to do. > > I like that. But, for the sake of curiosity, how does the Fortran > standard describe the process that leads to *******? I mean, suppose > E8.0 is legal, but still can we emit *******? The *** are emitted when the result can't fit into the requested field. Off the top of my head, the easiest example is E8.1E1 for x = 1e25. The exponent field is too small, or I2 and i = 100. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35036