1、IEEE Std 754-2008(Revision of IEEE Std 754-1985)IEEE Standard for Floating-Point ArithmeticIEEE3 Park Avenue New York, NY 10016-5997, USA29 August 2008IEEE Computer SocietySponsored by theMicroprocessor Standards Committee754TMAuthorized licensed use limited to: TIANJIN UNIVERSITY. Downloaded on Jul
2、y 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.Authorized licensed use limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.IEEE Std 754-2008(Revision ofIEEE Std 754-1985)IEEE Standard for Floating-PointArithmeticSponsorMicroprocessor St
3、andards Committeeof theIEEE Computer SocietyApproved 12 June 2008IEEE-SA Standards BoardAuthorized licensed use limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.Abstract: This standard specifies interchange and arithmetic formats and methods f
4、or binary anddecimal floating-point arithmetic in computer programming environments. This standard specifiesexception conditions and their default handling. An implementation of a floating-point systemconforming to this standard may be realized entirely in software, entirely in hardware, or in anyco
5、mbination of software and hardware. For operations specified in the normative part of thisstandard, numerical results and exceptions are uniquely determined by the values of the inputdata, sequence of operations, and destination formats, all under user control.Keywords: arithmetic, binary, computer,
6、 decimal, exponent, floating-point, format, interchange,NaN, number, rounding, significand, subnormalThe Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue, New York, NY 10016-5997, USA Copyright 2008 by the Institute of Electrical and Electronics Engineers, Inc. All rights reserv
7、ed. Published 29 August 2008. Printed in the United States of America.IEEE is a registered trademark in the U.S. Patent +1 978 750 8400. Permission to photocopy portions of any individual standard foreducational classroom use can also be obtained through the Copyright Clearance Center.Authorized lic
8、ensed use limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.IntroductionThis introduction is not part of IEEE Std 754-2008, IEEE Standard for Floating-Point Arithmetic.This standard is a product of the Floating-Point Working Group of, and spons
9、ored by, the MicroprocessorStandards Committee of the IEEE Computer Society. This standard provides a discipline for performing floating-point computation that yields resultsindependent of whether the processing is done in hardware, software, or a combination of the two. Foroperations specified in t
10、he normative part of this standard, numerical results and exceptions are uniquelydetermined by the values of the input data, the operation, and the destination, all under user control.This standard defines a family of commercially feasible ways for systems to perform binary and decimalfloating-point
11、 arithmetic. Among the desiderata that guided the formulation of this standard were:a) Facilitate movement of existing programs from diverse computers to those that adhere to thisstandard as well as among those that adhere to this standard.b) Enhance the capabilities and safety available to users an
12、d programmers who, although not expertin numerical methods, might well be attempting to produce numerically sophisticated programs. c) Encourage experts to develop and distribute robust and efficient numerical programs that areportable, by way of minor editing and recompilation, onto any computer th
13、at conforms to thisstandard and possesses adequate capacity. Together with language controls it should be possible towrite programs that produce identical results on all conforming systems.d) Provide direct support for execution-time diagnosis of anomalies smoother handling of exceptions interval ar
14、ithmetic at a reasonable cost.e) Provide for development of standard elementary functions such as exp and cos high precision (multiword) arithmetic coupled numerical and symbolic algebraic computation.f) Enable rather than preclude further refinements and extensions.In programming environments, this
15、 standard is also intended to form the basis for a dialog between thenumerical community and programming language designers. It is hoped that language-defined methods forthe control of expression evaluation and exceptions might be defined in coming years, so that it will bepossible to write programs
16、 that produce identical results on all conforming systems. However, it isrecognized that utility and safety in languages are sometimes antagonists, as are efficiency and portability.Therefore, it is hoped that language designers will look on the full set of operation, precision, and exceptioncontrol
17、s described here as a guide to providing the programmer with the ability to portably controlexpressions and exceptions. It is also hoped that designers will be guided by this standard to provideextensions in a completely portable way.ivCopyright 2008 IEEE. All rights reserved. Authorized licensed us
18、e limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.Notice to usersLaws and regulationsUsers of these documents should consult all applicable laws and regulations. Compliance with theprovisions of this standard does not imply compliance to any
19、applicable regulatory requirements.Implementers of the standard are responsible for observing or referring to the applicable regulatoryrequirements. IEEE does not, by the publication of its standards, intend to urge action that is not incompliance with applicable laws, and these documents may not be
20、 construed as doing so. CopyrightsThis document is copyrighted by the IEEE. It is made available for a wide variety of both public and privateuses. These include both use, by reference, in laws and regulations, and use in private self-regulation,standardization, and the promotion of engineering prac
21、tices and methods. By making this documentavailable for use and adoption by public authorities and private users, the IEEE does not waive any rights incopyright to this document.Updating of IEEE documentsUsers of IEEE standards should be aware that these documents may be superseded at any time by th
22、eissuance of new editions or may be amended from time to time through the issuance of amendments,corrigenda, or errata. An official IEEE document at any point in time consists of the current edition of thedocument together with any amendments, corrigenda, or errata then in effect. In order to determ
23、ine whethera given document is the current edition and whether it has been amended through the issuance ofamendments, corrigenda, or errata, please visit the IEEE Standards Association Web site athttp:/ieeexplore.ieee.org/xpl/standards.jsp, or contact the IEEE at the address listed previously.For mo
24、re information about the IEEE Standards Association or the IEEE standards development process,visit the IEEE-SA Web site at http:/standards.ieee.org.ErrataErrata, if any, for this and all other standards can be accessed at the following URL: http:/standards.ieee.org/reading/ieee/updates/errata/index
25、.html. Users are encouraged to check that URL for errata periodically.InterpretationsCurrent interpretations can be accessed at the following URL: http:/standards.ieee.org/reading/ieee/interp/index.html.vCopyright 2008 IEEE. All rights reserved. Authorized licensed use limited to: TIANJIN UNIVERSITY
26、. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.Patents Attention is called to the possibility that implementation of this standard may require use of subject mattercovered by patent rights. By publication of this standard, no position is taken with respect to the existen
27、ceor validity of any patent rights in connection therewith. A patent holder or patent applicant has filed astatement of assurance that it will grant licenses under these rights without compensation or underreasonable rates, with reasonable terms and conditions that are demonstrably free of any unfai
28、rdiscrimination to applicants desiring to obtain such licenses. Other Essential Patent Claims may exist forwhich a statement of assurance has not been received. The IEEE is not responsible for identifying EssentialPatent Claims for which a license may be required, for conducting inquiries into the l
29、egal validity or scopeof Patents Claims, or for determining whether any licensing terms or conditions provided in connection withsubmission of a Letter of Assurance, if any, or in any licensing agreements are reasonable or non-discriminatory. Users of this standard are expressly advised that determi
30、nation of the validity of any patentrights, and the risk of infringement of such rights, is entirely their own responsibility. Further informationmay be obtained from the IEEE Standards Association.ParticipantsThe following participants in the Floating-Point Working Group contributed to the developm
31、ent of thisstandard:Dan Zuras, Chair Mike Cowlishaw, Editor Alex AikenMatthew ApplegateDavid BaileySteve BassDileep BhandarkarMahesh BhatDavid BindelSylvie BoldoStephen CanonSteven R. CarloughMarius CorneaMike Cowlishaw John H. CrawfordJoseph D. DarcyDebjit Das SarmaMarc DaumasBob Davis Mark DavisDi
32、ck DelpJim DemmelMark A. ErleHossam A. H. FahmyJ.P. FasanoRichard FatemanEric FengWarren E. FergusonAlex Fit-FloreaLaurent FournierChip FreitagIvan GodardRoger A. Golliver David GustafsonMichel HackJohn R. HarrisonJohn HauserYozo HidaChris N. HindsGraydon HoareDavid G. Hough Jerry HuckJim HullMichae
33、l IngrassiaDavid V. JamesRick JamesWilliam Kahan John KapernickRichard KarpinskiJeff Kidder Plamen KoevRen-Cang LiZhishun Alex LiuRaymond MakPeter Markstein David MatulaGuillaume MelquiondNobuyoshi MoriRicardo MorinNed NedialkovCraig NelsonStuart ObermanJon OkadaIan OllmannMichael ParksTom PittmanEr
34、ic PostpischilJason RiedyEric M. SchwarzDavid ScottDon SenzigIlya SharapovJim ShearerMichael SiuRon SmithChuck StevensPeter TangPamela J. TaylorJames W. ThomasBrandon ThompsonWendy ThrashNeil TodaSon Dao TrongLeonard Tsai Charles TsenFred TydemanLiang Kai WangScott WestbrookSteve WinklerAnthony Wood
35、Umit YalcinalpFred ZemkePaul ZimmermannDan Zuras identifies those who also participated in the Ballot Review Committee.viCopyright 2008 IEEE. All rights reserved. Authorized licensed use limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.The fol
36、lowing individual members of the balloting committee voted on this standard. Balloters might havevoted for approval, disapproval, or abstention.Ali Al AwaziTomo BogatajMark BrownSteven R. CarloughJuan C. CarreonDanila ChenetsovSrinivas ChennupatyDanila ChernetsovNaveen CherukuriKeith ChowGlenn Colon
37、-BonetTommy P. CooperRobert CorbettMarius CorneaMike CowlishawJohn H. CrawfordBob DavisFlorent de DinechinKenneth DockserUlrich DrepperSourav K. DuttaCarol T. EidtBo EinarssonMark A. ErleHossam A. H. FahmyJohn W. FendrichWarren E. FergusonAndrew FieldsendRabiz N. FodaRoger A. GolliverSergiu R. GomaR
38、andall C. GrovesScott A. GudgelMichel HackJohn R. HarrisonPeter L. HarrodBarry E. HedquistRutger HeunksChris N. HindsWerner HoelzlDennis HorwitzDavid G. HoughJerome HuckDavid V. JamesMuzaffer KalPiotr KarockiMark J. KnightTheodore E. KubaskaSusan LandChristoph LauterShawn M. LeardDavid J. LecistonSo
39、lomon LeeVincent LefevreVincent J. LipsioZhishun A. LiuWilliam LumpkinsPeter MarksteinEdward M. MccallGeorge J. MiaoGary L. MichelJames MooreJean-Michel MullerBruce MuschlitzMichael S. NewmanCharles K. NgetheGregory D. PetersonUrichl PohlSubburajan PonnuswamyJose PuthenkulamMarko RadmilacGary S. Rob
40、insonRobert A. RobinsonMichael D. RushM. S. SachdevSridhar SamudralaRandy SaundersBartien SayogoThomas SchossigMichael J. SchulteStephen C. SchwarmEric M. SchwarzMathew L. SmithMitchell W. SmithThomas E. StaraiWalter StrupplerPing T. TangPamela J. TaylorJames W. ThomasWendy ThrashLeonard TsaiCharles
41、 TsenS. TulasidasSrinivasa R. VemuruSteven WallachPaul R. WorkForrest D. WrightOren YuenJanusz ZalewskiAlexandru ZamfirescuDan ZurasviiCopyright 2008 IEEE. All rights reserved. Authorized licensed use limited to: TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions
42、 apply.When the IEEE-SA Standards Board approved this standard on 12 June 2008, it had the followingmembership:Robert M. Grow, Chair Thomas Prevost, Vice Chair Steve M. Mills, Past Chair Judith Gorman, Secretary Victor BermanRichard DeBlasioAndy DrozdMark EpsteinAlexander GelmanWilliam GoldbachArnie
43、 GreenspanKen HanusJim HughesRichard HulettYoung Kyun KimJoseph L. Koepfinger *John KulickDavid J. LawGlenn ParsonsRon PetersenChuck PowersNarayanan RamachandranJon Walter RosdahlAnne-Marie SahazizianMalcolm ThadenHoward WolfmanDon Wright* Member EmeritusAlso included are the following non-voting IE
44、EE-SA Standards Board liaisons:Satish K. Aggarwal, NRC RepresentativeMichael H. Kelley, NIST RepresentativeLisa PerryIEEE Standards Project EditorMalia ZamanIEEE Standards Program Manager, Technical Program DevelopmentviiiCopyright 2008 IEEE. All rights reserved. Authorized licensed use limited to:
45、TIANJIN UNIVERSITY. Downloaded on July 13, 2009 at 05:08 from IEEE Xplore. Restrictions apply.Contents1. Overview 11.1 Scope 11.2 Purpose .11.3 Inclusions 11.4 Exclusions .21.5 Programming environment considerations .21.6 Word usage .22. Definitions, abbreviations, and acronyms 32.1 Definitions 32.2
46、 Abbreviations and acronyms 53. Floating-point formats .63.1 Overview 63.2 Specification levels .73.3 Sets of floating-point data .73.4 Binary interchange format encodings .93.5 Decimal interchange format encodings 103.6 Interchange format parameters .133.7 Extended and extendable precisions .144. A
47、ttributes and rounding .154.1 Attribute specification 154.2 Dynamic modes for attributes .154.3 Rounding-direction attributes .165. Operations 175.1 Overview 175.2 Decimal exponent calculation .185.3 Homogeneous general-computational operations .195.4 formatOf general-computational operations .215.5
48、 Quiet-computational operations .235.6 Signaling-computational operations .245.7 Non-computational operations .245.8 Details of conversions from floating-point to integer formats 265.9 Details of operations to round a floating-point datum to integral value .275.10 Details of totalOrder predicate .28
49、5.11 Details of comparison predicates 295.12 Details of conversion between floating-point data and external character sequences 306. Infinity, NaNs, and sign bit 346.1 Infinity arithmetic .346.2 Operations with NaNs 346.3 The sign bit .357. Default exception handling 367.1 Overview: exceptions and flags 367.2 Invalid operation .377.3 Division by zero .377.4 Overflow .377.5 Underflow .387.6 Inexact 388. Alternate exception handling attributes .398.1 Overview 398.2 Resuming alternate exception handling attributes 398.3 Immediate and delayed alternate