Floating-Point Extensions for C — 10 Part 2: Decimal Floating-Point Arithmetic

Floating-Point Extensions for C — 10 Part 2: Decimal Floating-Point Arithmetic

© ISO/IEC 2012 – All rights reserved Study Group Draft – September 23, 2012 WG 14 N1632 ISO/IEC JTC 1/SC 22 0000 Date: yyyy-mm-dd 5 Reference number of document: ISO/IEC nnn-n Committee identification: ISO/IEC JTC 1/SC 22/WG 14 Secretariat: ANSI Information Technology — Programming languages, their environments, and system software interfaces — Floating-point extensions for C — 10 Part 2: Decimal floating-point arithmetic Technologies de l’information — Langages de programmation, leurs environnements et interfaces du logiciel système — Extensions à virgule flottante pour C — Partie 2: décimal arithmétique flottante Warning 15 This document is not an ISO International Standard. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an International Standard. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation. Document type: Technical Specification Document subtype: Document stage: (20) Preparation Document language: E ISO/IEC nnn-n Study Group Draft – September 23, 2012 WG 14 N1632 Copyright notice This ISO document is a working draft or committee draft and is copyright-protected by ISO. While the reproduction of working drafts or committee drafts in any form for use by participants in the ISO standards development process is permitted without prior permission from ISO, neither this document 5 nor any extract from it may be reproduced, stored or transmitted in any form for any other purpose without prior written permission from ISO. Requests for permission to reproduce this document for the purpose of selling it should be addressed as shown below or to ISO’s member body in the country of the requester: ISO copyright office 10 Case postale 56 CH-1211 Geneva 20 Tel. +41 22 749 01 11 Fax + 41 22 749 09 47 E-mail [email protected] Web www.iso.org 15 Reproduction for sales purposes may be subject to royalty payments or a licensing agreement. Violators may be prosecuted. ii © ISO/IEC 2012 – All rights reserved WG 14 N1632 Study Group Draft – September 23, 2012 ISO/IEC nnn-n Contents Page Foreword ...........................................................................................................................................................iv 0 Introduction ................................................................................................................................................iv 0.1 Background .............................................................................................................................................iv 5 0.2 Purpose.....................................................................................................................................................v 0.3 The arithmetic model ...............................................................................................................................v 0.4 The formats..............................................................................................................................................vi 1 Scope ...........................................................................................................................................................1 2 Conformance ...............................................................................................................................................1 10 3 Normative references .................................................................................................................................2 4 Terms and definitions.................................................................................................................................2 5 Predefined macros......................................................................................................................................2 6 Decimal floating types ................................................................................................................................2 7 Characteristics of decimal floating types <float.h>.............................................................................4 15 8 Operation binding .......................................................................................................................................6 9 Conversions ................................................................................................................................................7 9.1 Conversions between decimal floating and integer .............................................................................7 9.2 Conversions among decimal floating types, and between decimal floating types and generic floating types ........................................................................................................................................7 20 9.3 Conversions between decimal floating and complex...........................................................................8 9.4 Usual arithmetic conversions .................................................................................................................8 9.5 Default argument promotion...................................................................................................................8 10 Constants...................................................................................................................................................8 11 Arithmetic operations ...............................................................................................................................9 25 11.1 Operators ................................................................................................................................................9 11.2 Functions ..............................................................................................................................................10 11.3 Conversions .........................................................................................................................................11 12 Library ......................................................................................................................................................11 12.1 Standard headers.................................................................................................................................11 30 12.2 Floating-point environment <fenv.h> ..............................................................................................11 12.3 Decimal mathematics <math.h> ........................................................................................................12 12.4 New <math.h> functions ....................................................................................................................21 12.4.1 Quantum exponent functions............................................................................................................21 12.4.2 Decimal re-encoding functions .........................................................................................................22 35 12.5 Formatted input/output specifiers......................................................................................................24 12.6 strtod32, strtod64, and strtod128 functions <stdlib.h> ......................................................26 12.7 wcstod32, wcstod64, and wcstod128 functions <wchar.h> ........................................................29 12.8 Type-generic macros <tgmath.h> ....................................................................................................30 Bibliography.....................................................................................................................................................32 40 © ISO/IEC 2012 – All rights reserved iii ISO/IEC nnn-n Study Group Draft – September 23, 2012 WG 14 N1632 Foreword ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies (ISO member bodies). The work of preparing International Standards is normally carried out through ISO technical committees. Each member body interested in a subject for which a technical committee has been 5 established has the right to be represented on that committee. International organizations, governmental and non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely with the International Electrotechnical Commission (IEC) on all matters of electrotechnical standardization. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of technical committees is to prepare International Standards. Draft International Standards 10 adopted by the technical committees are circulated to the member bodies for voting. Publication as an International Standard requires approval by at least 75 % of the member bodies casting a vote. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO shall not be held responsible for identifying any or all such patent rights. ISO nnn-n was prepared by Technical Committee ISO JTC 1, Information Technology, Subcommittee SC 22, 15 Programming languages, their environments, and system software interfaces. ISO nnn consists of the following parts, under the general title Floating-point extensions for C: ⎯ Part 1: Binary floating-point arithmetic ⎯ Part 2: Decimal floating-point arithmetic

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    38 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us