《BS-ISO-IEC-13814-1998.pdf》由会员分享,可在线阅读,更多相关《BS-ISO-IEC-13814-1998.pdf(38页珍藏版)》请在三一文库上搜索。
1、BRITISH STANDARD BS ISO/IEC 13814:1998 Information technology Programming languages Generic package of complex elementary functions for Ada ICS 35.060 Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 This British Standar
2、d, having been prepared under the direction of the DISC Board, was published under the authority of the Standards Board and comes into effect on 15 September 1998 BSI 04-1999 ISBN 0 580 28865 X National foreword This British Standard reproduces verbatim ISO/IEC 13814:1998 and implements it as the UK
3、 national standard. The UK participation in its preparation was entrusted to Technical Committee IST/5, Programming languages, their environments and system software interface, which has the responsibility to: aid enquirers to understand the text; present to the responsible international/European co
4、mmittee any enquiries on the interpretation, or proposals for change, and keep the UK interests informed; monitor related international and European developments and promulgate them in the UK. A list of organizations represented on this committee can be obtained on request to its secretary. Cross-re
5、ferences The British Standards which implement international or European publications referred to in this document may be found in the BSI Standards Catalogue under the section entitled “International Standards Correspondence Index”, or by using the “Find” facility of the BSI Standards Electronic Ca
6、talogue. A British Standard does not purport to include all the necessary provisions of a contract. Users of British Standards are responsible for their correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations. Summary of pages This document c
7、omprises a front cover, an inside front cover, pages i and ii, the ISO/IEC title page, pages ii to iv, pages 1 to 28 and a back cover. This standard has been updated (see copyright date) and may have had amendments incorporated. This will be indicated in the amendment table on the inside front cover
8、. Amendments issued since publication Amd. No.DateComments Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 BSI 04-1999i Contents Page National forewordInside front cover Forewordiv Text of ISO/IEC 138141 Licensed Copy:
9、sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI ii blank Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled
10、 Copy, (c) BSI BS ISO/IEC 13814:1998 ii BSI 04-1999 Contents Page Forewordiv Introduction1 1Scope1 2Normative references1 3Subprograms provided1 4Instantiations2 5Implementations3 6Exceptions4 7Arguments outside the range of safe numbers5 8Method of specification of functions3 9Branch cut and domain
11、 definitions5 10Range definitions5 11Accuracy requirements6 12Overflow7 13Underflow8 14Specifications of the functions8 14.1SQRT Square root8 14.2LOG Natural logarithm9 14.3EXP Exponential function, complex argument9 14.4EXP Exponential function, imaginary argument10 14.5“*” Exponentiation operator,
12、 complex to complex power arguments10 14.6“*” Exponentiation operator, complex to real power arguments10 14.7“*” Exponentiation operator, real to complex power arguments11 14.8SIN Trigonometric sine function11 14.9COS Trigonometric cosine function12 14.10TAN Trigonometric tangent function12 14.11COT
13、 Trigonometric cotangent function13 14.12ARCSIN Inverse trigonometric sine function13 14.13ARCCOS Inverse trigonometric cosine function14 14.14ARCTAN Inverse trigonometric tangent function14 14.15ARCCOT Inverse trigonometric cotangent function15 14.16SINH Hyperbolic sine function15 14.17COSH Hyperbo
14、lic cosine function16 14.18TANH Hyperbolic tangent function16 14.19COTH Hyperbolic cotangent function17 14.20ARCSINH Inverse hyperbolic sine function17 14.21ARCCOSH Inverse hyperbolic cosine function17 14.22ARCTANH Inverse hyperbolic tangent function18 14.23ARCCOTH Inverse hyperbolic cotangent funct
15、ion18 Annex A (normative) Ada specification for GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS20 Annex B (informative) Rationale21 B.1Introduction and motivation21 B.2History21 B.3Packaging considerations22 B.4Choice of functions23 B.5Handling of exceptions23 B.6Matters of style24 B.7Method of expressing accu
16、racy requirements25 Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 BSI 04-1999iii Page Annex C (informative) Bibliography27 Figure B.1 Result rectangle for a subprogram satisfying a maximum relative component error req
17、uirement26 Figure B.2 Result rectangle for a subprogram satisfying a maximum relative box error requirement26 Figure B.3 Result circle for a subprogram satisfying a maximum relative vector error requirement27 Descriptors: Data processing, computer software, artificial languages, programming language
18、s, advanced language, Ada, implementation. Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 iv BSI 04-1999 Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Com
19、mission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. I
20、SO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, I
21、SO/IEC JTC 1. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. International Standard ISO/IEC 13814 was prepared by J
22、oint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee 22, Programming languages, their environments and system software interfaces. Annex A forms an integral part of this International Standard. Annex B and Annex C are for information only. Licensed Copy: sheffieldun sheffield
23、un, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 BSI 04-19991 Introduction The generic package described here is intended to provide the basic complex mathematical routines from which portable, reusable applications can be built. This International Standar
24、d serves a broad class of applications with reasonable ease of use, while demanding implementations that are of high quality, capable of validation, and also practical given the state of the art. The specification included in this International Standard is presented as a compilable Ada specification
25、 in Annex A, with explanatory text in numbered clauses in the main body of text. The explanatory text is normative, with the exception of the following items: notes (under the heading Notes associated with some of the functions); and notes (labeled as such) presented at the end of any numbered claus
26、e. The word “may” as used in this International Standard consistently means “is allowed to” (or “are allowed to”). It is used only to express permission, as in the commonly occurring phrase “an implementation may”; other words (such as “can,” “could” or “might”) are used to express ability, possibil
27、ity, capacity or consequentiality. 1 Scope This International Standard defines the specification of a generic package of complex elementary functions called GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS. It does not provide the body of the package. This International Standard specifies certain basic complex
28、mathematical routines from which portable, reusable applications can be built. This International Standard serves a broad class of applications with reasonable ease of use, while demanding implementations that are of high quality, capable of validation, and also practical given the state of the art.
29、 This International Standard is applicable to programming environments conforming to ISO/IEC 8652:1987 and is relevant to the revised standard ISO/IEC 8652:1995. 2 Normative references The following standards contain provisions which, through reference in this text, constitute provisions of this Int
30、ernational Standard. At the time of publication, the editions indicated were valid. All standards are subject to revision, and parties to agreements based on this International Standard are encouraged to investigate the possibility of applying the most recent editions of the standards indicated belo
31、w. Members of IEC and ISO maintain registers of currently valid International Standards. ISO/IEC 8652, Information technology Programming languages Ada. ISO/IEC 11430, Information technology Programming languages Generic package of elementary functions for Ada. ISO/IEC 11729, Information technology
32、Programming languages Generic package of primitive functions for Ada. ISO/IEC 13813, Information technology Programming languages Generic packages of real and complex type declarations and basic operations for Ada (including vector and matrix types). 3 Subprograms provided The following twenty mathe
33、matical functions are provided: SQRTLOGEXP“*” SINCOSTANCOT ARCSINARCCOSARCTANARCCOT SINHCOSHTANHCOTH ARCSINHARCCOSHARCTANHARCCOTH Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 2 BSI 04-1999 These are the square root (
34、SQRT), logarithm (LOG) and exponential (EXP) function and the exponentiation operator (*); the trigonometric functions for sine (SIN), cosine (COS), tangent (TAN) and cotangent (COT) and their inverses (ARCSIN, ARCCOS, ARCTAN and ARCCOT); and the hyperbolic functions for sine (SINH), cosine (COSH),
35、tangent (TANH), and cotangent (COTH) together with their inverses (ARCSINH, ARCCOSH, ARCTANH, and ARCCOTH). These are the same functions by the same names that are in the package GENERIC_ELEMENTARY_FUNCTIONS definied in ISO/IEC 11430. Several variations are provided for the exponentiation operator a
36、nd the exponential function. All functions have one or more formal parameters of type COMPLEX or IMAGINARY and return a value of type COMPLEX. COMPLEX and IMAGINARY are generic formal parameters of the generic package GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS. 4 Instantiations This International Standard
37、 describes a generic package, GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS, which the user must instantiate to obtain a computational capability. The generic package has three required generic formal parameters and many generic formal subprograms with defaults. At instantiation, the user must specify, as th
38、e generic actual parameters to be associated with REAL, COMPLEX and IMAGINARY respectively, a) a floating-point type, b) a private composite type containing real and imaginary components of the type specified by a), (Within this International Standard, the real and imaginary components of the compos
39、ite type are referred to simply as components.) c) a private type of the same base type as a) that is interpreted as the pure imaginary form of b). Types suitable for b) and c) are exported by the package obtained by instantiating, with the type specified by a) as its generic actual parameter, the g
40、eneric package GENERIC_COMPLEX_TYPES defined in ISO/IEC 13813. (Instantiation of the package GENERIC_COMPLEX_TYPES is not a prerequisite for using GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS; it is merely an option that the user might find convenient to pursue.) In addition the user may specify the many su
41、bprogram generic formal parameters as generic actual parameters, or for convenience, all these subprograms are exported by the instantiation of GENERIC_COMPLEX_TYPES described above. Depending on the implementation, the user may or may not be allowed to specify a generic actual type having a range c
42、onstraint for the first generic actual parameter (see clause 5). The generic actual parameters for the subprograms can be omitted if functions having names and profiles matching those of the corresponding generic formal parameters are visible at the place of the instantiation. An instantiation of GE
43、NERIC_COMPLEX_TYPES, as described above, can optionally be used to obtain subprograms that satisfy these requirements. In addition to the body of the generic package itself, implementers may provide (non-generic) library packages that can be used just like instantiations of the generic package in wh
44、ich the first generic actual parameter is a predefined floating-point type and the remainder are related to the first in appropriate ways. In particular, the name of a package serving as a replacement for an instantiation of GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS for the predefined type FLOAT shall be
45、 COMPLEX_ELEMENTARY_FUNCTIONS with REAL replaced by FLOAT in the profiles of the functions that it exports. Similarly, the names of packages serving as replacements for instantiations of GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS for the predefined types LONG_FLOAT, SHORT_FLOAT, etc., shall be LONG_COMPLE
46、X_ELEMENTARY_FUNCTIONS, SHORT_COMPLEX_ELEMENTARY_FUNCTIONS, etc., respectively and REAL shall be systematically replaced in the profiles of the functions that they export by LONG_FLOAT, SHORT_FLOAT, etc. Implementers are responsible for ensuring that a composite type called COMPLEX containing a pair
47、 of components of types FLOAT, LONG_FLOAT, SHORT_FLOAT, etc., respectively, are available. For example, each of the non-generic library packages could be prefixed by an appropriate context clause, such as: with COMPLEX_TYPES; package COMPLEX_ELEMENTARY_FUNCTIONS is . . . The packages COMPLEX_TYPES,
48、LONG_COMPLEX_TYPES, etc., described in ISO/IEC 13813, are not a prerequisite for implementation, yet are an option the implementer might find convenient to pursue. Licensed Copy: sheffieldun sheffieldun, na, Wed Nov 22 10:00:58 GMT+00:00 2006, Uncontrolled Copy, (c) BSI BS ISO/IEC 13814:1998 BSI 04-
49、19993 5 Implementations Portable implementations of GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS are strongly encouraged. However, implementations are not required to be portable. In particular, an implementation of this International Standard in Ada may use pragma INTERFACE or other pragmas, unchecked conversion, machine-code insertions or other machine-dependent techniques as desired. On the other hand, to the extent that generic packages (e.g. GENERIC_ELEMENTARY_FUNCTIONS defined in ISO/IEC 11430 an
链接地址:https://www.31doc.com/p-3747486.html