09-221 To: J3 Members From: Stan Whitlock Subject: J3 Fortran interp F03/0034 Date: 2009 February 23 Section 1. Instructions ---------- Section 2 is the answer to the F2003 interp F03/0034. Section 3 is the proposed edit to fix the problem raised in F03/0034 in F2008. Section 2. F2003 interp ---------------------------------------------------------------------- NUMBER: F03/0034 TITLE: IEEE_LOGB() KEYWORDS: IEEE-754, logb() DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: What is logb(denormal)? Is it of the hardware representation, or is it as if the hardware had an unbounded exponent range? What is logb(NaN)? logb(-INF)? logb(+INF)? logb() should be defined as if the hardware representation had an unbounded exponent range. logb(NaN) should be the same NaN; shall be a NaN. logb(-INF) shall be +INF logb(+INF) shall be +INF ANSWER: Case (i) of 14.10.12 correctly specifies that if the value of X is denormal, its unbiased exponent is returned, that IEEE_LOGB(X) is equal to EXPONENT(x)-1). That this conclusion is true is the subject of F2003 interp F03/0054, answered in Corrigendum 1. For consistency with the IEEE International Standard, edits are also supplied for the case where X is infinite and X is NaN. EDITS: Page and line numbers refer to 04-007. Subclause 14.10.12 "IEEE LOGB (X)" Result value [376:17+] add: "Case (iii) If IEEE_SUPPORT_INF(X) is true and X is infinite, the result is +infinity. Case (iv) If IEEE_SUPPORT_NAN(X) is true and X is a NaN, the result is a NaN." SUBMITTED BY: Fred Tydeman HISTORY: 05-113 m171 F03/0034 submitted 05-113r1 m171 Passed by J3 meeting 05-170 m172 Passed J3 letter ballot #11 N1622 m172 Failed WG5 ballot N1629 09-221 m188 Revised answer ---------------------------------------------------------------------- Section 3. F2008 fix --------- Fix the problem reported in F2003 interp F03/0034 in F2008 as follows: In 09-007, subclause 14.10.12 "IEEE LOGB (X)", paragraph 6 "Result value" [419:16+] add: "Case (iii) If IEEE_SUPPORT_INF(X) is true and X is infinite, the result is +infinity. Case (iv) If IEEE_SUPPORT_NAN(X) is true and X is a NaN, the result is a NaN."