ImageVerifierCode 换一换
格式:PDF , 页数:66 ,大小:1,022KB ,
资源ID:1257418      下载积分:10000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-1257418.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(ISO IEC TR 24733-2011 Information technology - Programming languages their environments and system software interfaces - Extensions for the programming language.pdf)为本站会员(花仙子)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

ISO IEC TR 24733-2011 Information technology - Programming languages their environments and system software interfaces - Extensions for the programming language.pdf

1、 Reference number ISO/IEC TR 24733:2011(E) ISO/IEC 2011TECHNICAL REPORT ISO/IEC TR 24733 First edition 2011-11-01 Information technology Programming languages, their environments and system software interfaces Extensions for the programming language C+ to support decimal floating-point arithmetic Te

2、chnologies de linformation Langages de programmation, leurs environnements et interfaces de logiciel systme Extensions pour le langage de programmation C+ pour supporter larithmtique flottante dcimale ISO/IEC TR 24733:2011(E) COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2011 All rights reserved. Unless othe

3、rwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or ISOs member body in the country of the requester. ISO copyrigh

4、t office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2011 All rights reservedISO/IEC TR 24733:2011(E) Contents Page Foreword vi Introduction vii 0.1 General vii 0.2 Arithmetic model vii 0.3

5、 The Formats . viii 1 Scope . 1 2 Normative references . 1 3 Conventions . 2 3.1 General 2 3.2 Relation to C+ Standard Library Introduction 2 3.3 Relation to “Technical Report on C+ Library Extensions“ 3 3.4 Categories of extensions . 3 3.5 Namespaces and headers . 4 4 Decimal floating-point types .

6、 5 4.1 Characteristics of decimal floating-point types 5 4.2 Decimal Types 6 4.2.1 Header synopsis . 6 4.2.2 Class decimal32 . 10 4.2.2.1 Class summary 10 4.2.2.2 Construct/copy/destroy . 11 4.2.2.3 Conversion from floating-point type 11 4.2.2.4 Conversion from integral type 11 4.2.2.5 Conversion to

7、 integral type . 12 4.2.2.6 Increment and decrement operators 12 4.2.2.7 Compound assignment 12 4.2.3 Class decimal64 14 4.2.3.1 Class summary 14 4.2.3.2 Construct/copy/destroy . 14 4.2.3.3 Conversion from floating-point type 14 4.2.3.4 Conversion from integral type 15 4.2.3.5 Conversion to integral

8、 type . 15 4.2.3.6 Increment and decrement operators 15 4.2.3.7 Compound assignment 16 4.2.4 Class decimal128 17 4.2.4.1 Class summary 17 4.2.4.2 Construct/copy/destroy . 17 4.2.4.3 Conversion from floating-point type 17 4.2.4.4 Conversion from integral type 18 4.2.4.5 Conversion to integral type .

9、18 4.2.4.6 Increment and decrement operators 18 4.2.4.7 Compound assignment 19 4.2.5 Initialization from coefficient and exponent 20 ISO/IEC 2011 All rights reserved iiiISO/IEC TR 24733:2011(E) 4.2.6 Conversion to generic floating-point type . 20 4.2.7 Unary arithmetic operators 21 4.2.8 Binary arit

10、hmetic operators 21 4.2.9 Comparison operators 22 4.2.10 Formatted input 25 4.2.11 Formatted output 26 4.3 Additions to header 27 4.4 Headers and 30 4.4.1 General . 30 4.4.2 Additions to header synopsis . 30 4.4.3 Additions to header synopsis . 31 4.4.4 Maximum finite value 31 4.4.5 Epsilon . 31 4.4

11、6 Minimum positive normal value 32 4.4.7 Minimum positive subnormal value 32 4.4.8 Evaluation format . 32 4.5 Additions to and 33 4.5.1 General . 33 4.5.2 Additions to synopsis . 33 4.5.3 Rounding modes 34 4.5.4 The fe_dec_getround function 34 4.5.5 The fe_dec_setround function 35 4.5.6 Changes to

12、 35 4.6 Additions to and 35 4.6.1 General . 35 4.6.2 Additions to header synopsis . 36 4.6.3 macros 41 4.6.4 Evaluation formats . 41 4.6.5 samequantum functions . 42 4.6.6 quantexp functions 42 4.6.7 quantize functions 43 4.6.8 Elementary functions . 43 4.6.9 abs function overloads . 45 4.6.10 Chan

13、ges to . 45 4.6.10.1 General 45 4.6.10.2 Additions to header synopsis 45 4.7 Additions to and . 45 4.8 Additions to and 45 4.8.1 Additions to header synopsis . 45 4.8.2 strtod functions . 45 4.8.3 Changes to 45 4.9 Additions to and . 46 4.9.1 Additions to synopsis . 46 4.9.2 wcstod functions . 46 4.

14、9.3 Changes to . 46 4.10 Facets 46 4.10.1 General . 46 iv ISO/IEC 2011 All rights reservedISO/IEC TR 24733:2011(E) ISO/IEC 2011 All rights reserved v4.10.2 Additions to header synopsis . 47 4.10.3 Class template extended_num_get . 47 4.10.3.1 extended_num_get members 49 4.10.3.2 extended_num_get vir

15、tual functions . 50 4.10.4 Class template extended_num_put . 51 4.10.4.1 extended_num_put members 52 4.10.4.2 extended_num_put virtual functions . 53 4.11 Type traits . 53 4.11.1 Addition to header synopsis . 53 4.11.2 is_decimal_floating_point type_trait . 54 4.12 Hash functions 54 4.12.1 Additions

16、 to header synopsis . 54 4.12.2 Hash function specializations 54 5 Notes on C compatibility 55 5.1 General 55 5.2 Literals 55 5.3 Conversions . 55 ISO/IEC TR 24733:2011(E) Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form t

17、he 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. ISO and IEC tech

18、nical 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, ISO/IEC JTC 1. I

19、nternational Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for

20、voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. In exceptional circumstances, when the joint technical committee has collected data of a different kind from that which is normally published as an International Standard (“stat

21、e of the art”, for example), it may decide to publish a Technical Report. A Technical Report is entirely informative in nature and shall be subject to review every five years in the same manner as an International Standard. Attention is drawn to the possibility that some of the elements of this docu

22、ment may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC TR 24733 was prepared jointly by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 22, Programming languages, their environments a

23、nd system software interfaces. vi ISO/IEC 2011 All rights reservedISO/IEC TR 24733:2011(E) Introduction 0.1 General Most of todays general purpose computing architectures provide binary floating-point arithmetic in hardware. Binary float-point is an efficient representation that minimizes memory use

24、 and is simpler to implement than floating-point arithmetic using other bases. It has therefore become the norm for scientific computations, with almost all implementations following the IEEE-754 standard for binary floating-point arithmetic. However, human computation and communication of numeric

25、values almost always uses decimal arithmetic, and decimal notations. Laboratory notes, scientific papers, legal documents, business reports and financial statements all record numeric values in decimal form. When numeric data are given to a program or are displayed to a user, binary to- and-from dec

26、imal conversion is required. There are inherent rounding errors involved in such conversions; decimal fractions cannot, in general, be represented exactly by floating-point values. These errors often cause usability and efficiency problems, depending on the application. These problems are minor when

27、 the application domain accepts, or requires results to have, associated error estimates (as is the case with scientific applications). However, in business and financial applications, computations are required either to be exact (with no rounding errors) unless explicitly rounded, or to be supporte

28、d by detailed analyses that are auditable to be correct. Such applications therefore have to take special care in handling any rounding errors introduced by the computations. The most efficient way to avoid conversion error is to use decimal arithmetic. Recognizing this, the IEEE 754-2008 Standard f

29、or Floating-Point Arithmetic specifies decimal floating-point encodings and arithmetic. This technical report specifies extensions to the International Standard for the C+ programming language to permit the use of decimal arithmetic in a manner consistent with the IEEE 754-2008 standard. 0.2 Arithme

30、tic model This Technical Report is based on a model of decimal arithmetic which is a formalization of the decimal system of numeration (algorism) as further defined and constrained by the relevant standards, IEEE 854, ANSI X3-274, and IEEE 754-2008. There are three components to the model: data- num

31、bers and NaNs, which can be manipulated by, or be the results of, the core operations defined in the model operations- (such as addition, multiplication, etc.) which can be carried out on data context - the status of operations (namely, exceptions flags), and controls to govern the results of operat

32、ions (for example, rounding modes). The model defines these components in the abstract. It defines neither the way in which operations are expressed (which might vary depending on the computer language or other interface being used), nor the concrete representation (specific layout in storage, or in

33、 a processors register, for example) of data or context. ISO/IEC 2011 All rights reserved viiISO/IEC TR 24733:2011(E) viii ISO/IEC 2011 All rights reservedFrom the perspective of the C+ language, data are represented by data types, operations are defined within expressions, and context is the floati

34、ng environment specified in and . This Technical Report specifies how the C+ language implements these components. 0.3 The formats In the C+ International Standard, the representation of a floating-point number is specified in an abstract form where the constituent components of the representation a

35、re defined (sign, exponent, significand) but the internals of these components are not. In particular, the exponent range, significand size and the base (or radix), are implementation defined. This allows flexibility for an implementation to take advantage of its underlying hardware architecture. Fu

36、rthermore, certain behaviors of operations are also implementation defined, for example in the area of handling of special numbers and in exceptions. This approach was inherited from the C programming language. At the time that C was first standardized, there were already various hardware implementa

37、tions of floating-point arithmetic in common use. Specifying the exact details of a representation would make most of the existing C implementations at the time not conforming. This Technical Report specifies decimal floating-point arithmetic according to the IEEE 754-2008 standard, with the constit

38、uent components of the representation defined. This is more stringent than the approach taken for the floating-point types in the C+ standard. Since it is expected that all decimal floating-point hardware implementations will conform to the IEEE 754-2008 standard, binding to this standard directly b

39、enefits both implementers and programmers. TECHNICAL REPORT ISO/IEC TR 24733:2011(E) ISO/IEC 2011 All rights reserved 1Information technology Programming languages, their environments and system software interfaces Extensions for the programming language C+ to support decimal floating-point arithmet

40、ic 1 Scope This Technical Report specifies an extension to the programming language C+, specified by ISO/IEC 14882:2003. The extension provides support for decimal floating- point arithmetic that is consistent with the specification in IEEE 754-2008. Any conflict between the requirements described h

41、ere and that specification is unintentional. The binary floating-point arithmetic specified in IEEE 754-2008 is not considered in this Technical Report. 2 Normative references The following referenced documents are indispensable for the application of this document. For dated references, only the ed

42、ition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 14882:2003, Programming languages C+ ISO/IEC TR 19768:2007, Information technology Programming languages Technical Report on C+ Library Extensions ISO/IEC TR 24732:2

43、009, Information technology Programming languages, their environments and system software interfaces Extension for the programming language C to support decimal floating-point arithmetic IEEE 754-2008, IEEE Standard for Floating-Point Arithmetic ISO/IEC TR 24733:2011(E) 3 Conventions 3.1 General Thi

44、s Technical Report is non-normative; the extensions that it describes may be considered for inclusion in a future revision of the International Standard for C+, but they are not currently required for conformance to that standard. Furthermore, it is conceivable that a future revision of the Internat

45、ional Standard will include facilities that are similar and not identical to the extensions described in this report, Although this report describes extensions to the C+ standard library, vendors may choose to implement these extensions in the C+ language translator itself. This practice is permitte

46、d so long as all well-formed programs are accepted by the implementation, and the semantics of those programs which do not have undefined or implementation-defined behavior are as if the extensions had taken the form of a library. Note: This allows, for instance, an implementation to produce a diffe

47、rent result when the extension is implemented in the C+ language translator, for programs that are ill-formed when the extension is implemented as a library. The result of deriving a user-defined type from std:decimal:decimal32, std:decimal:decimal64, or std:decimal:decimal128 is undefined. 3.2 Rela

48、tion to C+ Standard Library Introduction Unless otherwise specified, the whole of the ISO C+ Standard Library introduction lib.library as specified in ISO/IEC 14882 is included into this Technical Report by reference. This Technical Report introduces the following elements to supplement those descri

49、bed in lib.structure.specifications as specified in ISO/IEC 14882: Expansion: the semantics of a macros expansion text Library Overload Set: an overload set for a given function name or overloaded operator. Each library overload set specifies the parameter types for the required overloads, and can be implemented as a suitably constrained function template, a set of overloaded non-template functions, or a combination of both. Example: Consider a library overload set with the

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1