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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

本文(BS ISO IEC 10967-1-2012 Information technology Language independent arithmetic Integer and floating point arithmetic《信息技术 语言独立计算 整数和浮点算法》.pdf)为本站会员(roleaisle130)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

BS ISO IEC 10967-1-2012 Information technology Language independent arithmetic Integer and floating point arithmetic《信息技术 语言独立计算 整数和浮点算法》.pdf

1、raising standards worldwide NO COPYING WITHOUT BSI PERMISSION EXCEPT AS PERMITTED BY COPYRIGHT LAW BSI Standards Publication BS ISO/IEC 10967-1:2012 Information technology Language independent arithmetic Part 1: Integer and floating point arithmeticBS ISO/IEC 10967-1:2012 BRITISH STANDARD National f

2、oreword This British Standard is the UK implementation of ISO/IEC 10967-1:2012. It supersedes BS ISO/IEC 10967-1:1994 which is withdrawn. The UK participation in its preparation was entrusted to Technical Committee IST/5, Programming languages, their environments and system software interfaces. A li

3、st of organizations represented on this committee can be obtained on request to its secretary. This publication does not purport to include all the necessary provisions of a contract. Users are responsible for its correct application. The British Standards Institution 2012. Published by BSI Standard

4、s Limited 2012 ISBN 978 0 580 63696 7 ICS 35.060 Compliance with a British Standard cannot confer immunity from legal obligations. This British Standard was published under the authority of the Standards Policy and Strategy Committee on 31 July 2012. Amendments issued since publication Date Text aff

5、ectedBS ISO/IEC 10967-1:2012Reference number ISO/IEC 10967-1:2012(E) ISO/IEC 2012INTERNATIONAL STANDARD ISO/IEC 10967-1 Second edition 2012-07-15 Information technology Language independent arithmetic Part 1: Integer and floating point arithmetic Technologies de linformation Arithmtique indpendante

6、de langage Partie 1: Arithmtique de nombres entiers et en virgule flottante BS ISO/IEC 10967-1:2012 ISO/IEC 10967-1:2012(E) COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2012 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means

7、, 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 copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrig

8、htiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2012 All rights reservedBS ISO/IEC 10967-1:2012 Contents Foreword vii Introduction viii 1 Scope 1 1.1 Inclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Exclusions . . . . . . . . . . . . .

9、. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Conformity 3 3 Normative references 4 4 Symbols and denitions 4 4.1 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1.1 Operators and relations . . . . . . . . . . . . . . . . . . . . . . . .

10、. . . . . 4 4.1.2 Sets and intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4.1.3 Exceptional values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4.1.4 Special values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.1.5 The B

11、oolean datatype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.1.6 Operation specication framework . . . . . . . . . . . . . . . . . . . . . . . 6 4.2 Denitions of terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5 Specications for integer and oating p

12、oint datatypes and operations 12 5.1 Integer datatypes and operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.1.1 Integer result function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1.2 Integer operations . . . . . . . . . . . . . . . . . . . . . . . . . . .

13、 . . . . . 14 5.1.2.1 Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1.2.2 Basic arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.2 Floating point datatypes and operations . . . . . . . . . . . . . . . . . . . . . . . . 17 5.2.1 Conformity to IEC

14、60559 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2.2 Range and granularity constants . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2.3 Approximate operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2.4 Rounding and rounding constants . . . . . . . . .

15、. . . . . . . . . . . . . . 20 5.2.5 Floating point result function . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2.6 Floating point operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2.6.1 Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2

16、.6.2 Basic arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.2.6.3 Value dissection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.2.6.4 Value splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.3 Operations for conversion between numeric data

17、types . . . . . . . . . . . . . . . . 29 5.3.1 Integer to integer conversions . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.3.2 Floating point to integer conversions . . . . . . . . . . . . . . . . . . . . . . 31 5.3.3 Integer to oating point conversions . . . . . . . . . . . . . . . . .

18、. . . . . 31 5.3.4 Floating point to oating point conversions . . . . . . . . . . . . . . . . . . 32 5.3.5 Floating point to xed point conversions . . . . . . . . . . . . . . . . . . . . 32 5.3.6 Fixed point to oating point conversions . . . . . . . . . . . . . . . . . . . . 34 5.4 Numerals as opera

19、tions in a programming language . . . . . . . . . . . . . . . . . . 34 iii ISO/IEC 10967-1:2012(E) ISO/IEC 2012 All rights reservedBS ISO/IEC 10967-1:2012 5.4.1 Numerals for integer datatypes . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.4.2 Numerals for oating point datatypes . . . . . . .

20、 . . . . . . . . . . . . . . 35 6 Notication 35 6.1 Model for handling of notications . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.2 Notication alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.2.1 Notication by recording in indicators . . . . . . . .

21、. . . . . . . . . . . . . 36 6.2.2 Notication by alteration of control ow . . . . . . . . . . . . . . . . . . . . 38 6.2.3 Notication by termination with message . . . . . . . . . . . . . . . . . . . 38 6.3 Delays in notication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

22、 6.4 User selection of alternative for notication . . . . . . . . . . . . . . . . . . . . . . 39 7 Relationship with language standards 39 8 Documentation requirements 41 Annex A (informative) Partial conformity 43 A.1 Integer overow notication relaxation . . . . . . . . . . . . . . . . . . . . . .

23、. . . 44 A.2 Innitary notication relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 A.3 Inexact notication relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 A.4 Underow notication relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 A.5 Sub

24、normal values relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 A.6 Accuracy relaxation for add, subtract, multiply, and divide . . . . . . . . . . . . . 45 A.7 Accuracy relaxation for oating point conversion . . . . . . . . . . . . . . . . . . . 47 Annex B (informative) IE

25、C 60559 bindings 51 B.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 B.2 Notication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Annex C (informative) Rationale 57 C.1 Scope . . . . . . . . . . . . . . . . . . . .

26、. . . . . . . . . . . . . . . . . . . . . . . 57 C.1.1 Inclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 C.1.2 Exclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 C.1.3 Companion parts to this part . . . . . . . . . . . . . .

27、. . . . . . . . . . . . 58 C.2 Conformity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 C.2.1 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 C.3 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28、. . . . . . . 59 C.4 Symbols and denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 C.4.1 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 C.4.2 Denitions of terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 C.5 S

29、pecications for integer and oating point datatypes and operations . . . . . . . . 61 C.5.1 Integer datatypes and operations . . . . . . . . . . . . . . . . . . . . . . . . 62 C.5.1.0.1 Unbounded integers . . . . . . . . . . . . . . . . . . . . . 62 C.5.1.0.2 Bounded non-modulo integers . . . . . . .

30、 . . . . . . . . 63 C.5.1.0.3 Modulo integers . . . . . . . . . . . . . . . . . . . . . . . 64 C.5.1.1 Integer result function . . . . . . . . . . . . . . . . . . . . . . . . . 64 C.5.1.2 Integer operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 C.5.1.2.1 Comparisons . . . . . . .

31、. . . . . . . . . . . . . . . . . . 64 C.5.1.2.2 Basic arithmetic . . . . . . . . . . . . . . . . . . . . . . . 65 iv ISO/IEC 10967-1:2012(E) ISO/IEC 2012 All rights reservedBS ISO/IEC 10967-1:2012 C.5.2 Floating point datatypes and operations . . . . . . . . . . . . . . . . . . . . 65 C.5.2.0.1 Con

32、straints on the oating point parameters . . . . . . . 66 C.5.2.0.2 Radix complement oating point . . . . . . . . . . . . . . 68 C.5.2.1 Conformity to IEC 60559 . . . . . . . . . . . . . . . . . . . . . . . 68 C.5.2.1.1 Subnormal numbers . . . . . . . . . . . . . . . . . . . . . 69 C.5.2.1.2 Signed z

33、ero . . . . . . . . . . . . . . . . . . . . . . . . . . 69 C.5.2.1.3 Innities and NaNs . . . . . . . . . . . . . . . . . . . . . 69 C.5.2.2 Range and granularity constants . . . . . . . . . . . . . . . . . . . 70 C.5.2.2.1 Relations among oating point datatypes . . . . . . . . . 70 C.5.2.3 Approxima

34、te operations . . . . . . . . . . . . . . . . . . . . . . . . 71 C.5.2.4 Rounding and rounding constants . . . . . . . . . . . . . . . . . . 71 C.5.2.5 Floating point result function . . . . . . . . . . . . . . . . . . . . . 73 C.5.2.6 Floating point operations . . . . . . . . . . . . . . . . . . .

35、. . . . 73 C.5.2.6.1 Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . 73 C.5.2.6.2 Basic arithmetic . . . . . . . . . . . . . . . . . . . . . . . 73 C.5.2.6.3 Value dissection . . . . . . . . . . . . . . . . . . . . . . . 74 C.5.2.6.4 Value splitting . . . . . . . . . . . . . . . . . .

36、. . . . . . 74 C.5.2.7 Levels of predictability . . . . . . . . . . . . . . . . . . . . . . . . 75 C.5.2.8 Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 C.5.2.9 Precision, accuracy, and error . . . . . . . . . . . . . . . . . . . . . 78 C.5.2.9.1 LIA-1 and error . . .

37、 . . . . . . . . . . . . . . . . . . . . 79 C.5.2.9.2 Empirical and modelling errors . . . . . . . . . . . . . . . 80 C.5.2.9.3 Propagation of errors . . . . . . . . . . . . . . . . . . . . 80 C.5.2.10 Extra precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 C.5.3 Operations for

38、conversion between numeric datatypes . . . . . . . . . . . . 82 C.5.4 Numerals as operations in a programming language . . . . . . . . . . . . . 83 C.5.4.1 Numerals for integer datatypes . . . . . . . . . . . . . . . . . . . . 83 C.5.4.2 Numerals for oating point datatypes . . . . . . . . . . . . .

39、. . . 83 C.6 Notication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 C.6.1 Model handling of notications . . . . . . . . . . . . . . . . . . . . . . . . . 84 C.6.2 Notication alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 C.6.2.1 Notic

40、ation by recording in indicators . . . . . . . . . . . . . . . . 84 C.6.2.2 Notication by alteration of control ow . . . . . . . . . . . . . . . 85 C.6.2.3 Notication by termination with message . . . . . . . . . . . . . . 86 C.6.3 Delays in notication . . . . . . . . . . . . . . . . . . . . . . . .

41、 . . . . . . . 86 C.6.4 User selection of alternative for notication . . . . . . . . . . . . . . . . . . 86 C.7 Relationship with language standards . . . . . . . . . . . . . . . . . . . . . . . . . 87 C.8 Documentation requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Anne

42、x D (informative) Example bindings for specic languages 89 D.1 Ada . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 D.2 C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 D.3 C+ . . . . . . . . . . . . . . . . .

43、. . . . . . . . . . . . . . . . . . . . . . . . . . . 104 D.4 Fortran . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 D.5 Common Lisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Annex E (informative) Example of a conformit

44、y statement 121 E.1 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 v ISO/IEC 10967-1:2012(E) ISO/IEC 10967-1:2012(E) ISO/IEC 2012 All rights reservedBS ISO/IEC 10967-1:2012 E.2 Integer parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . .

45、 . . . . . . . . 121 E.3 Floating point parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 E.4 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 E.5 Notication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46、. . . . . . . 122 Annex F (informative) Example programs 125 F.1 Verifying platform acceptability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 F.2 Selecting alternate code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 F.3 Terminating a loop . . . . . . . . .

47、. . . . . . . . . . . . . . . . . . . . . . . . . . . 126 F.4 Estimating error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 F.5 Saving exception state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 F.6 Fast versus accurate . . . . . . . . . .

48、 . . . . . . . . . . . . . . . . . . . . . . . . . 127 F.7 High-precision multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Bibliography 129 vi ISO/IEC 10967-1:2012(E) ISO/IEC 2012 All rights reservedBS ISO/IEC 10967-1:2012 vii Foreword ISO (the International Organizatio

49、n for Standardization) and IEC (the International Electrotechnical Commission) 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. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-govern

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