Internet Engineering Task Force (IETF)                        R. Presuhn
Request for Comments: 6340                                   Independent
Category: Standards Track                                    August 2011
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                        R. Presuhn
Request for Comments: 6340                                   Independent
Category: Standards Track                                    August 2011
ISSN: 2070-1721
        

Textual Conventions for the Representation of Floating-Point Numbers

浮点数表示的文本约定

Abstract

摘要

This memo defines a Management Information Base (MIB) module containing textual conventions (TCs) to represent floating-point numbers.

此备忘录定义了一个管理信息库(MIB)模块,其中包含表示浮点数的文本约定(TC)。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6340.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6340.

Copyright Notice

版权公告

Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2011 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1. Introduction ....................................................2
   2. The Internet-Standard Management Framework ......................3
   3. Applicability ...................................................3
   4. Structure of the MIB Module .....................................4
      4.1. MIB Modules Required for IMPORTS ...........................4
      4.2. Documents Required for REFERENCE Clauses ...................4
   5. Definitions .....................................................4
   6. Security Considerations .........................................6
   7. IANA Considerations .............................................6
   8. Contributors ....................................................6
   9. References ......................................................7
      9.1. Normative References .......................................7
      9.2. Informative References .....................................7
        
   1. Introduction ....................................................2
   2. The Internet-Standard Management Framework ......................3
   3. Applicability ...................................................3
   4. Structure of the MIB Module .....................................4
      4.1. MIB Modules Required for IMPORTS ...........................4
      4.2. Documents Required for REFERENCE Clauses ...................4
   5. Definitions .....................................................4
   6. Security Considerations .........................................6
   7. IANA Considerations .............................................6
   8. Contributors ....................................................6
   9. References ......................................................7
      9.1. Normative References .......................................7
      9.2. Informative References .....................................7
        
1. Introduction
1. 介绍

This memo defines textual conventions for the representation of floating-point numbers. All of these definitions are in terms of the IEEE "Standard for Floating-Point Arithmetic", IEEE 754-2008 [IEEE.754.2008].

本备忘录定义了浮点数表示的文本约定。所有这些定义均符合IEEE“浮点运算标准”,IEEE 754-2008[IEEE.754.2008]。

The IEEE "Standard for Floating-Point Arithmetic", IEEE 754-2008 [IEEE.754.2008], provides for a variety of interchange formats for floating-point numbers. The need for three of these, namely

IEEE“浮点运算标准”,IEEE 754-2008[IEEE.754.2008],为浮点数字提供了多种交换格式。需要其中三个,即

o 32-bit,

o 32位,

o 64-bit,

o 64位,

o 128-bit,

o 128位,

has been recognized in network management. For example, Section 4.2.3 of the SMIng Objectives [RFC3216] elaborates the need for these three floating-point data types in network management protocols.

已在网络管理领域得到认可。例如,SMIng目标[RFC3216]第4.2.3节阐述了网络管理协议中对这三种浮点数据类型的需求。

The selection of a floating-point format involves many considerations and trade-offs. For an introduction to the fundamentals of floating-point representations see Chapter 4 of [KNUTH]; for a discussion of these issues specifically with respect to the IEEE formats, see [GOLDBERG].

浮点格式的选择涉及许多考虑因素和权衡。有关浮点表示法基本原理的介绍,请参见[KNUTH]的第4章;有关这些问题的讨论,请参见[GOLDBERG]。

All of these textual conventions employ the binary interchange format defined in [IEEE.754.2008]. Specifically, this means that for all of them, the highest-order bit of the first byte is the sign bit, with the remaining bits of the octet string corresponding to the exponent and fraction parts, in network byte order.

所有这些文本约定均采用[IEEE.754.2008]中定义的二进制交换格式。具体地说,这意味着对于所有这些字节,第一个字节的最高阶位是符号位,八位字节字符串的其余位以网络字节顺序对应于指数和分数部分。

2. The Internet-Standard Management Framework
2. 因特网标准管理框架

For a detailed overview of the documents that describe the current Internet-Standard Management Framework, please refer to section 7 of RFC 3410 [RFC3410].

有关描述当前互联网标准管理框架的文件的详细概述,请参阅RFC 3410[RFC3410]第7节。

Managed objects are accessed via a virtual information store, termed the Management Information Base or MIB. MIB objects are generally accessed through the Simple Network Management Protocol (SNMP). Objects in the MIB are defined using the mechanisms defined in the Structure of Management Information (SMI). This memo specifies a MIB module that is compliant to the SMIv2, which is described in STD 58, RFC 2578 [RFC2578], STD 58, RFC 2579 [RFC2579] and STD 58, RFC 2580 [RFC2580].

托管对象通过虚拟信息存储(称为管理信息库或MIB)进行访问。MIB对象通常通过简单网络管理协议(SNMP)进行访问。MIB中的对象是使用管理信息结构(SMI)中定义的机制定义的。本备忘录规定了符合SMIv2的MIB模块,如STD 58、RFC 2578[RFC2578]、STD 58、RFC 2579[RFC2579]和STD 58、RFC 2580[RFC2580]所述。

3. Applicability
3. 适用性

The following list highlights some of the issues MIB designers need to consider when deciding whether to employ these textual conventions:

下面的列表突出了MIB设计者在决定是否使用这些文本约定时需要考虑的一些问题:

o Floating-point numbers are useful if the number space needs to cover a large dynamic range. For number spaces with a limited range, fixed-point numbers can be more efficient and more precise.

o 如果数字空间需要覆盖较大的动态范围,则浮点数字非常有用。对于范围有限的数字空间,定点数字可以更有效、更精确。

o Floating-point numbers are typically the wrong answer for data that is truly decimal or can be handled adequately by re-thinking the units and representing the scaled numbers as integers.

o 对于真正的十进制数据,浮点数通常是错误的答案,或者可以通过重新思考单位并将缩放的数字表示为整数来充分处理。

o The SNMP "lexicographical" ordering for INDEX objects using these floating-point textual conventions will simply be that of the octet strings corresponding to the floating-point representations, which will not always reflect the numerical ordering of the corresponding floating-point values. Even if MIB designers take this into account, users might still find the results of a MIB "walk" surprising. Consequently, it is suggested that whenever one of these textual conventions is used for an INDEX object, that the DESCRIPTION clause should provide some warning.

o 使用这些浮点文本约定的索引对象的SNMP“词典”顺序将只是对应于浮点表示的八位字符串的顺序,这并不总是反映对应浮点值的数字顺序。即使MIB设计者考虑到这一点,用户仍然可能会发现MIB“行走”的结果令人惊讶。因此,建议在索引对象使用这些文本约定时,DESCRIPTION子句应该提供一些警告。

o Embedded systems sometimes lack floating-point support, which can complicate the implementation of MIB objects using floating-point numbers.

o 嵌入式系统有时缺乏浮点支持,这会使使用浮点数实现MIB对象变得复杂。

o In choosing from among the types defined in this memo, MIB designers need to consider both the range and the precision needed, as well as recognize that it could be inefficient to use, for example, Float128TC when Float64TC would do.

o 在从备忘录中定义的类型中进行选择时,MIB设计者需要考虑所需的范围和精度,以及认识到,当FLUAT64 TC将执行时,例如使用FLUAT128TC可能是低效的。

o Since these textual conventions are defined in terms of the OCTET STRING type, the SMI's mechanisms for formally setting range constraints are not available. MIB designers using these textual conventions will need to use DESCRIPTION clauses to spell out any applicable range constraints beyond those implied by the underlying IEEE types.

o 由于这些文本约定是根据八位字节字符串类型定义的,因此SMI用于正式设置范围约束的机制不可用。使用这些文本约定的MIB设计者将需要使用描述子句来阐明任何适用的范围约束,这些约束超出了基础IEEE类型所暗示的范围约束。

o Whenever these textual conventions are used in a MIB module, the associated DESCRIPTION clause will need to clearly specify whether denormalized numbers, NaNs ("not a number") or infinities are permitted, along with any special semantics associated with these cases. This is especially important for writeable objects.

o 每当在MIB模块中使用这些文本约定时,关联的DESCRIPTION子句将需要清楚地指定是否允许非规范化数字、NaNs(“非数字”)或无穷大,以及与这些情况相关的任何特殊语义。这对于可写对象尤其重要。

4. Structure of the MIB Module
4. MIB模块的结构

This MIB module defines three textual conventions. It defines no MIB objects.

此MIB模块定义了三种文本约定。它不定义MIB对象。

4.1. MIB Modules Required for IMPORTS
4.1. 导入所需的MIB模块

This MIB module employs definitions from [RFC2578] and [RFC2579].

此MIB模块采用[RFC2578]和[RFC2579]中的定义。

4.2. Documents Required for REFERENCE Clauses
4.2. 参考条款所需的文件

This MIB module contains REFERENCE clauses making reference to IEEE 754-2008 [IEEE.754.2008].

本MIB模块包含参考IEEE 754-2008[IEEE.754.2008]的参考条款。

5. Definitions
5. 定义
  FLOAT-TC-MIB DEFINITIONS ::= BEGIN
        
  FLOAT-TC-MIB DEFINITIONS ::= BEGIN
        

IMPORTS MODULE-IDENTITY, mib-2 FROM SNMPv2-SMI -- RFC 2578 TEXTUAL-CONVENTION FROM SNMPv2-TC; -- RFC 2579

从SNMPv2 SMI导入模块标识mib-2——从SNMPv2 TC导入RFC 2578文本约定;——RFC2579

floatTcMIB MODULE-IDENTITY LAST-UPDATED "201107270000Z" -- July 27, 2011 ORGANIZATION "IETF OPSAWG Working Group" CONTACT-INFO "WG Email: opsawg@ietf.org

floatTcMIB模块标识最后一次更新“201107270000Z”--2011年7月27日组织“IETF OPSAWG工作组”联系信息工作组电子邮件:opsawg@ietf.org

Editor: Randy Presuhn randy_presuhn@mindspring.com"

编辑:兰迪·普雷森·兰迪_presuhn@mindspring.com"

DESCRIPTION "Textual conventions for the representation of floating-point numbers.

DESCRIPTION“浮点数表示的文本约定。

Copyright (c) 2011 IETF Trust and the persons identified as authors of the code. All rights reserved.

版权所有(c)2011 IETF信托基金和被确定为代码作者的人员。版权所有。

Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info).

根据IETF信托有关IETF文件的法律规定第4.c节规定的简化BSD许可证中包含的许可条款,允许以源代码和二进制格式重新分发和使用,无论是否修改(http://trustee.ietf.org/license-info).

This version of this MIB module is part of RFC 6340; see the RFC itself for full legal notices."

此版本的MIB模块是RFC 6340的一部分;有关完整的法律通知,请参见RFC本身。”

      REVISION     "201107270000Z"          -- July 27, 2011
      DESCRIPTION  "Initial version, published as RFC 6340."
       ::= { mib-2 201 }
        
      REVISION     "201107270000Z"          -- July 27, 2011
      DESCRIPTION  "Initial version, published as RFC 6340."
       ::= { mib-2 201 }
        
  Float32TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 32-bit (4-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(4))
        
  Float32TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 32-bit (4-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(4))
        
  Float64TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 64-bit (8-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(8))
        
  Float64TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 64-bit (8-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(8))
        
  Float128TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 128-bit (16-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(16))
        
  Float128TC ::= TEXTUAL-CONVENTION
      STATUS       current
      DESCRIPTION  "This type represents a 128-bit (16-octet) IEEE
                    floating-point number in binary interchange format."
      REFERENCE    "IEEE Standard for Floating-Point Arithmetic,
                    Standard 754-2008"
      SYNTAX       OCTET STRING (SIZE(16))
        

END

终止

6. Security Considerations
6. 安全考虑

This module does not define any management objects. Instead, it defines a set of textual conventions that can be used by other MIB modules to define management objects.

此模块不定义任何管理对象。相反,它定义了一组文本约定,其他MIB模块可以使用这些文本约定来定义管理对象。

Meaningful security considerations can only be written in the MIB modules that define management objects. Therefore, this memo has no impact on the security of the Internet.

有意义的安全注意事项只能写入定义管理对象的MIB模块中。因此,本备忘录对互联网安全没有影响。

7. IANA Considerations
7. IANA考虑

The MIB module in this document uses the following IANA-assigned OBJECT IDENTIFIER value recorded in the SMI Numbers registry:

本文档中的MIB模块使用SMI编号注册表中记录的以下IANA分配对象标识符值:

      Descriptor        OBJECT IDENTIFIER value
      ----------        -----------------------
      floatTcMIB        { mib-2 201 }
        
      Descriptor        OBJECT IDENTIFIER value
      ----------        -----------------------
      floatTcMIB        { mib-2 201 }
        
8. Contributors
8. 贡献者

The following people provided helpful comments during the development of this document:

以下人员在本文件编制过程中提供了有益的意见:

o Andy Bierman

o 安迪比尔曼

o Martin Duerst

o 马丁·杜尔斯特

o Alfred Hoenes

o 阿尔弗雷德·霍恩斯

o Juergen Quittek

o 尤尔根·奎特克

o Juergen Schoenwaeder

o 尤尔根·舍恩瓦德

o Dave Shield

o 戴夫盾

o Robert Story

o 罗伯特的故事

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[IEEE.754.2008] Institute of Electrical and Electronics Engineers, "Standard for Floating-Point Arithmetic", IEEE Standard 754, August 2008.

[IEEE.754.2008]电气和电子工程师协会,“浮点运算标准”,IEEE标准754,2008年8月。

[RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J. Schoenwaelder, Ed., "Structure of Management Information Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.

[RFC2578]McCloghrie,K.,Ed.,Perkins,D.,Ed.,和J.Schoenwaeld,Ed.“管理信息的结构版本2(SMIv2)”,STD 58,RFC 2578,1999年4月。

[RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. Schoenwaelder, Ed., "Textual Conventions for SMIv2", STD 58, RFC 2579, April 1999.

[RFC2579]McCloghrie,K.,Ed.,Perkins,D.,Ed.,和J.Schoenwaeld,Ed.“SMIv2的文本约定”,STD 58,RFC 2579,1999年4月。

[RFC2580] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Conformance Statements for SMIv2", STD 58, RFC 2580, April 1999.

[RFC2580]McCloghrie,K.,Perkins,D.,和J.Schoenwaeld,“SMIv2的一致性声明”,STD 58,RFC 25801999年4月。

9.2. Informative References
9.2. 资料性引用

[GOLDBERG] Goldberg, D., "What Every Computer Scientist Should Know About Floating-Point Arithmetic", ACM Computing Surveys Volume 23, Issue 1, March 1991.

[GOLDBERG]GOLDBERG,D.,“每一位计算机科学家都应该知道的浮点运算”,ACM计算调查卷23,第1期,1991年3月。

[KNUTH] Knuth, D., "Seminumerical Algorithms", The Art of Computer Programming (Second Edition) Vol. 2, 1981.

[KNUTH]KNUTH,D.,“半数值算法”,《计算机编程艺术》(第二版)第2卷,1981年。

[RFC3216] Elliott, C., Harrington, D., Jason, J., Schoenwaelder, J., Strauss, F., and W. Weiss, "SMIng Objectives", RFC 3216, December 2001.

[RFC3216]Elliott,C.,Harrington,D.,Jason,J.,Schoenwaeld,J.,Strauss,F.,和W.Weiss,“SMIng目标”,RFC 32162001年12月。

[RFC3410] Case, J., Mundy, R., Partain, D., and B. Stewart, "Introduction and Applicability Statements for Internet-Standard Management Framework", RFC 3410, December 2002.

[RFC3410]Case,J.,Mundy,R.,Partain,D.,和B.Stewart,“互联网标准管理框架的介绍和适用性声明”,RFC 34102002年12月。

Author's Address

作者地址

Randy Presuhn San Jose, CA 95120 USA

美国加利福尼亚州圣何塞市兰迪·普雷森95120

   EMail: randy_presuhn@mindspring.com
        
   EMail: randy_presuhn@mindspring.com