J3/09-248r1 To: J3 From: Van Snyder/Stan Whitlock Subject: Some IEEE elemental procedures should be impure elemental Date: 2009 August 10 References: 09-007r2 1. Introduction The flags IEEE_DIVIDE_BY_ZERO, IEEE_INEXACT, IEEE_INVALID, IEEE_OVERFLOW, and IEEE_UNDERFLOW, and the IEEE HALTING mode, can be regarded as either global variables or save variables. As such, the two subroutines to set them ought not to be pure. NB: the two elemental functions that get these flags are still pure. This potentially has an impact on existing software, as pure procedures can presently invoke these procedures. 2. Edits w.r.t. 09-007r2 Replace "Pure subroutine" by "Subroutine" at the following two places: [416:40 14.11.19p2] [417:12 14.11.20p2] [24:11 1.6.2p1]--------------------------------------------------------- Editor: Replace "This part" by "Except as identified in this subclause, this part" [24:13 1.6.2p1]-------------------------------------------------------- Editor: At the end of the paragraph, insert "The following Fortran 2003 features may have different interpretations in this part of ISO/IEC 1539. o The subroutines IEEE_SET_FLAG and IEEE_SET_HALTING_MODE in the intrinsic module IEEE_EXCEPTIONS were pure subroutines in Fortran 2003. They are not pure in Fortran 2008. These two procedures cannot be invoked from pure procedures in a program that conforms to this part of ISO/IEC 1539."