文档详情

2_2 第1章 基本使用方法.ppt

发布:2015-09-06约6千字共34页下载文档
文本预览下载声明
浮点数(IEEE 754标准) 科学计数法 表示计算机中的二进制浮点数 The Sign Bit:a sign bit of 0 represents a positive number and a sign bit of 1 represents a negative number. The Fraction Field:To simplify operations on these numbers, they are normalized in the IEEE format. A normalized binary number has a fraction of the form 1.f where f has a fixed size for a given data type. Since the leftmost fraction bit is always a 1, it is unnecessary to store this bit and is therefore implicit (or hidden). Thus, an n-bit fraction stores an n+1-bit number. The IEEE format also supports denormalized numbers, which have a fraction of the form 0.f. The Exponent Field: In the IEEE format, exponent representations are biased. This means a fixed value (the bias) is subtracted from the field to get the true exponent value. For example, if the exponent field is 8 bits, then the numbers 0 through 255 are represented, and there is a bias (bias = 2^(e-1) - 1) of 127. Single-Precision Format The IEEE single-precision floating-point format is a 32-bit word divided into a 1-bit sign indicator s, an 8-bit biased exponent e, and a 23-bit fraction f. A representation of this format is given below. Double-Precision Format The IEEE double-precision floating-point format is a 64-bit word divided into a 1-bit sign indicator s, an 11-bit biased exponent e, and a 52-bit fraction f. A representation of this format is shown in the following figure. Precision Because of a finite word size, a floating-point number is only an approximation of the true value. Therefore, it is important to have an understanding of the precision (or accuracy) of a floating-point result. In general, a value v with an accuracy q is specified by v?±?q. For IEEE floating-point numbers, M文件的简单创建及运行 尾数 fraction 基,必须为正 Base / radix 基的指数 数据的显示格式由format命令控制。 format只是影响结果的显示,不影响其计算与存储;MATLAB总是以双字长浮点数(双精度)来执行所有的运算。 如果结果为整数,则显示没有小数;如果结果不是整数,则输出形式有: format (short):短格式(5位定点数) 99.1253 format long:长格式(15位定点数
显示全部
相似文档