J3/01-153 Date: 3 March 2001 To: J3 From: John Reid Subject: Interpretation 12 (Evaluation of Intrinsic Procedures) Here is a draft answer for interp. 12. I sent earlier drafts to the WG5 list for comments and would like thank those that helped me get to this version. .............................................................. NUMBER: 000012 TITLE: Evaluation of Intrinsic Procedures KEYWORDS: Algorithm, Mathematical, Computational DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: 1. When the standard specifies an algorithm for computing a mathematical procedure, must a processor use the specified algorithm? Example: ANINT is defined as INT (A + 0.5). On some processors ANINT (16 000 001.0) evaluates to 16 000 002.0 using this algorithm. 2. May a processor return a mathematically equivalent result in the evaluation of a numeric intrinsic procedure? Example: If ANINT (16 000 001.0) can be computed as the more expected 16 000 001.0, may a processor do so? ANSWER: 1. No, a processor is not required to use the algorithm from the standard. 2. Yes, a processor may return the mathematically equivalent result in the evaluation of any numeric intrinsic procedure. DISCUSSION: The use of an algorithm in the definitions for intrinsic procedures is intended to describe the end result. It is not intended to require that a processor use a particular method of achieving that result. Thus, an algorithm specifies the mathematical results, not the computational results, of the evaluation of intrinsic procedures. This standard does not require a processor to use a particular accuracy or precision. Section 1.4, "Exclusions", states in part: "This standard does not specify: . . . (6) The physical properties of the representation of quantities and the method of rounding, approximating, or computing numeric values on a particular processor." [1:26, 1:37-38] The edits correct the definitions of the results for the intrinsic functions ANINT and NINT to be expressed in mathematical terms. EDITS: On page 231, subclause 13.14.10, Result Value paragraph [231:16-17]. Replace by The result is the integer nearest A, or if there are two integers equally near A, the result is whichever such integer has the greater magnitude. On page 259, subclause 13.14.77, Result Value paragraph [259:9-10]. Replace by The result is the integer nearest A, or if there are two integers equally near A, the result is whichever such integer has the greater magnitude. SUBMITTED BY: Keith H. Bierman HISTORY: 95-247r1 m134 Submitted as F90 interp 000202 with proposed response, approved 9-4, subsumes F90 interp 000200. 95-256 m134 Ballot failed, 10-6 95-260 m135 Proposed response, no action 96-023 m136 Proposed response, no action 96-054 m137 Proposed response, no action 96-117 m138 Proposed response, no action 97-259r1 m143 Re-submitted as F95 interp 000012 with proposed response 00-214 m153 Passed unanimously 00-254 m154 Passed J3 letter ballot 00-268 m154 Failed WG5 ballot (N1403)