To: J3 11-258 Subject: Interpretation request F08/0008 revisited From: Van Snyder Date: 2011 October 12 References: WG5/N1875, WG5/N1876, WG5/N1878 Discussion ---------- Interpretation F08/0008 failed WG5 ballot N1876. Ballot comments --------------- F08/0008 Cohen NO vote The quoted text in 13.7.1 is just wrong and needs to be fixed. Corbett NO vote If the statement in the standard that "the flag IEEE_INVALID shall signal" is, as is stated in the interpretation, is incorrect, the text of the standard should be altered to reflect that. Snyder NO vote See answer to F03/0030. There are no edits here, but arguing that the requirement in 13.7.1p2 does not apply admits a contradiction. My answer would be yes if there were an edit causing the penultimate sentence of 13.7.1p2 to begin "If support is provided and an infinite result...." Revised interpretation ---------------------- NUMBER: F08/0008 TITLE: IEEE exceptions for intrinsic functions KEYWORDS: IEEE_INVALID, SQRT DEFECT TYPE: Interpretation STATUS: J3 consideration in progress QUESTIONS: Section 13.7.1, page 325, lines 10-12 states If an infinite result is returned, the flag IEEE_OVERFLOW or IEEE_DIVIDE_BY_ZERO shall signal; if a NaN result is returned, the flag IEEE_INVALID shall signal. Question (1): The Fortran 2008 standard does not require a standard-conforming processor to support IEEE_INVALID [14.3p8, 404:15]. If a processor does not support IEEE_INVALID, is it required to signal IEEE_INVALID when a NaN result is returned? Question (2): IEC 60559 requires the result of SQRT(+inf) to be +inf without overflow being signaled. IEC 60559 requires SQRT(qNaN), where qNaN is a quiet NaN, not to signal an invalid operand exception. Does Fortran 2008 require SQRT(QNaN) to signal IEEE_INVALID? ANSWERS: Question (1): No. If the processor does not support IEEE_INVALID, it cannot signal IEEE_INVALID. Question (2): No. The Fortran 2008 standard does not directly specify the behavior of SQRT on qNaN. If IEEE_SUPPORT_SQRT is true for the kind of the argument, the behavior of SQRT is governed by ISO/IEC 60559:1989, which does not allow INVALID to be signaled. EDITS to 10-007r1: Replace the penultimate sentence of 13.7.1, viz. "If an infinite result is returned, the flag IEEE_OVERFLOW or IEEE_DIVIDE_BY_ZERO shall signal; if a NaN result is returned the flag IEEE_INVALID shall signal" with the following: "If all real arguments are finite and IEEE_SUPPORT_DATATYPE is true for those arguments, then o if the result is infinite, and IEEE_SUPPORT_FLAG(IEEE_OVERFLOW) is true or IEEE_SUPPORT_FLAG(IEEE_DIVIDE_BY_ZERO) is true, the flag IEEE_OVERFLOW or IEEE_DIVIDE_BY_ZERO shall signal, or o if the result is NaN and IEEE_SUPPORT_FLAG(IEEE_INVALID) is true, the flag IEEE_INVALID shall signal." SUBMITTED BY: Robert Corbett HISTORY: 10-155 m192 F08/0008 submitted 10-155r1 m192 Fix title 10-155r2 m192 Draft answer 10-155r3 m192 Revised answer - Passed by J3 meeting 10-202 m192 Passed by J3 letter ballot #21 10-199 N1878 m196 Failed WG5 ballot N1876 11-xxx m196 Revised answer