To: J3 J3/23-114 From: Malcolm Cohen Subject: Interp F23/004 on OUT_OF_RANGE Date: 2023-February-07 ---------------------------------------------------------------------- NUMBER: F23/004 TITLE: OUT_OF_RANGE and ROUND argument KEYWORDS: OUT_OF_RANGE DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: In the description of the intrinsic function OUT_OF_RANGE (X, MOLD [, ROUND]) it states "ROUND shall be present only if X is of type real and MOLD is of type integer." Consider Program test Call s(1.5,2.5) Contains Subroutine s(x,y,r) Logical,Optional :: r Print *,out_of_range(x,y,r) ! Valid? End Subroutine End Program As R is an optional dummy argument, it is present only if the actual argument is present. In this example, R is not present, and so the requirement in 16.9.157 is satisfied. Was it intended that this program be valid? (Of the two compilers that implement OUT_OF_RANGE that I tested, both of them rejected the program.) ANSWER: No, it was not intended that the example be valid; the requirement should have stated that the argument shall not appear. An edit is provided. EDIT to N2209. [422] 16.9.157 OUT_OF_RANGE, Arguments paragraph, ROUND argument, change "shall be present only" to "shall appear only". SUBMITTED BY: Malcolm Cohen HISTORY: 23-nnn m229 Submitted ----------------------------------------------------------------------