J3/05-154 Date: 4 Feb 2005 To: J3 From: John Reid Subject: Interpretation request re SPACING NUMBER: F03/00xx TITLE: Inconsistency with Fortran 95 re SPACING KEYWORDS: IEEE_SCALB, IEEE_SUPPORT_HALTING DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: The result of SPACING in Fortran 2003 is different from that in Fortran 95 (and Fortran 90). In the lines 1-2 of Result Value, "b^{e-p}, ... , provided this result is within range. " has been replaced by "b^{max(e-p,e_MIN-1)}, ... .". Was this intended? This affects values that are slightly larger than TINY(X). If denorms are available, they may be used to accurately return the spacing of numbers in the Brown model (13.4). For example, in Fortran 95, this program program test real x x = TINY(1.0)*4 do i= 1,6 write(*,*) x, spacing(x) x= x/2 end do end program on a machine that fully supports the IEEE standard returns 4.7019774E-38 5.6051939E-45 2.3509887E-38 2.8025969E-45 1.1754944E-38 1.4012985E-45 5.8774718E-39 1.1754944E-38 2.9387359E-39 1.1754944E-38 1.4693679E-39 1.1754944E-38 It is correctly returning the spacing of values within the Brown model, which is what the Description promises. On a machine with no denorms it returns 4.7019774E-38 1.1754944E-38 2.3509887E-38 1.1754944E-38 1.1754944E-38 1.1754944E-38 0.0000000E+00 1.1754944E-38 0.0000000E+00 1.1754944E-38 0.0000000E+00 1.1754944E-38 so it does not return the spacing of values within the Brown model (it cannot). It seems undesirable to require the incorrect behaviour on machines that fully support the IEEE standard. ANSWER: No. It was intended that this definition be consistent with that in Fortran 95. An edit is supplied. EDITS: Page and line numbers refer to J3/04-007. [353:8-9] Subclause 13.7.113, Result Value, lines 1-2. Replace "b^{max(e-p,e_MIN-1)}" by "b^{e-p}" and add ", provided this result is representable" at the end of the sentence. SUBMITTED BY: John Reid HISTORY: J3/05-154 at J3 meeting 171