J3/14-100r1
To: J3
From: Dick Hendrickson & Stan Whitlock
Subject: Interp on IEEE Inquiry Functions
Date: 2014 February 13
----------------------------------------------------------------------
NUMBER: F08/0104
TITLE: IEEE Inquiry Functions
DEFECT TYPE: Erratum
STATUS: J3 consideration in progress
All references are to Fortran 2008 10-007r1.
On comp.lang.fortran Francis Coudert asked
The Fortran 2008 standard defines an inquiry function
as an "intrinsic function, or function in an intrinsic
module, whose result depends on the properties of one
or more of its arguments instead of their values".
10-007r1 section 1.3.89 [11:27-30]
I wonder: by that definition, how can the
IEEE_SUPPORT_HALTING(FLAG) function from the
IEEE_EXCEPTIONS intrinsic module be an inquiry function?
Its result depends on the value of FLAG, not its
properties.
QUESTIONS:
Question 1.
Are the functions
IEEE_support_flag
IEEE_support_halting
IEEE_support_rounding
c_associated
c_funloc
c_loc
intended to be inquiry functions?
Question 2.
Are they consistent with the definition of inquiry
functions?
Question 3.
Are they allowed in Specification expressions?
Question 4.
Are they allowed in Constant expressions?
ANSWERS:
Answer 1.
No. These intrinsic module functions
IEEE_support_flag
IEEE_support_halting
IEEE_support_rounding
c_associated
c_funloc
c_loc
are not inquiry functions because their results depend on their
arguments. Edits are provided to correctly identify these functions
as transformational:
[18:35-37] section 1.3.146
transformational function
intrinsic function, or function in an intrinsic module, that
is neither elemental nor an inquiry function
Answer 2.
No. Their current classification is inconsistent with the definition
of inquiry functions.
Answer 3.
They should be allowed in specification expressions. Edits are
provided to correct this.
Answer 4.
They should be allowed in constant expressions. Edits are
provided to correct this.
EDITS to 10-007r1:
[150:28+] section 7.1.11 Specification expression, paragraph 2,
after bullet (10), insert a new bullet:
"(nn) a reference to a transformational function from the
intrinsic module IEEE_ARITHMETIC or IEEE_EXCEPTIONS (14) or
the intrinsic module ISO_C_BINDING (10), where each argument
is a restricted expression,"
[152:7-8] section 7.1.12 Constant expression, paragraph 1, replace
bullet (8):
"(8) a reference to the transformational function
IEEE_SELECTED_REAL_KIND from the intrinsic module
IEEE ARITHMETIC (14), where each argument is a constant
expression,"
with:
"(8) a reference to a transformational function from the
intrinsic module IEEE_ARITHMETIC or IEEE_EXCEPTIONS (14) or
the intrinsic module ISO_C_BINDING (10), where each argument
is a constant expression,"
[407-408:24+] section 14.10 Summary of the procedures, paragraph 3,
in Table 14.1, for procedure IEEE_SUPPORT_ROUNDING: change the
"Class" column entry from "I" to "T".
[408:1-] section 14.10 Summary of the procedures, paragraph 3,
in Table 14.2, for procedures IEEE_SUPPORT_FLAG and
IEEE_SUPPORT_HALTING: change the "Class" column entries from
"I" to "T".
[418:16] section 14.11.27 IEEE_SUPPORT_FLAG (FLAG) or
IEEE_SUPPORT_FLAG (FLAG, X), paragraph 2:
"Inquiry function." -> "Transformational function."
[418:32] section 14.11.28 IEEE SUPPORT HALTING (FLAG),
paragraph 2:
"Inquiry function." -> "Transformational function."
[420:4] section 14.11.32 IEEE_SUPPORT_ROUNDING (ROUND_ VALUE) or
IEEE_SUPPORT_ROUNDING (ROUND_VALUE, X), paragraph 2:
"Inquiry function." -> "Transformational function."
[426:19] section 15.2.3.2 C_ASSOCIATED (C_PTR_1 [, C_PTR_2]),
paragraph 2:
"Inquiry function." -> "Transformational function."
[428:9] section 15.2.3.5 C_FUNLOC (X), paragraph 2:
"Inquiry function." -> "Transformational function."
[428:21] section 15.2.3.6 C_LOC (X), paragraph 2:
"Inquiry function." -> "Transformational function."
SUBMITTED BY: Dick Hendrickson
HISTORY: m203 14-100 F08/0104 submitted
m203 14-100r1 Answer proposed
----------------------------------------------------------------------