如题
解决方案 »
- 很急啊。。。。帮忙啊!!!!!!!!!
- API下怎么调用打开打开对话框??
- CEvent ev;后会出错,WHY???
- 请问ADO连接数据库问题?
- 请教:假设我写的一个dll放在别人的某个执行程序的同一目录下,当运行这个执行程序时,这个dll能做一些事情。(请继续看完)
- 程序编完了,怎样知道,程序中用到了那些dll,ocx之类的文件???!!!!!up有分!!
- 初学数据库开发ODBC、DAO、ADO应该学哪个?有没有必要都学?谢了!谢了!谢了!
- 关于dwRetVal=GetInterfaceInfo(NULL,&ulOutBufLen)的理解
- 派生出一个类,但查找说未定义怎么回事
- 当RICKEDIT里面的内容改变时,怎么才能把垂直滚动条自动下滑到最底
- 如何获得三个线程的各自运行时间及总时间呢?
- VC++简单问题?望各位大侠帮小弟一下!!
http://developer.intel.com/design/processor/index.htm?iid=devnav_btn1+hw_proc&
能不能贴出来给我看看啊,要不给个网址to sans(sans)
网址不完整啊
S × × × × × × × × × × × × × × ×
------------------------- -------------------
eb BY0
× × × × × × × × × × × × × × × ×
---------------------- ----------------------
BY1 BY2 其中:×表示一位二进制数0或1;eb 为指数的偏差;S为浮点数的符号位,S=0为正数,S=1为负数;小数点“·”在eb的右边;BY0 BY1 BY2为尾数的小数部分。浮点数隐含其整数部分为1。
* then displays y and n.
*/#include <math.h>
#include <stdio.h>void main( void )
{
double x, y;
int n; x = 16.4;
y = frexp( x, &n );
printf( "frexp( %f, &n ) = %f, n = %d\n", x, y, n );
}
Outputfrexp( 16.400000, &n ) = 0.512500, n = 5
Type float
Floating-point numbers use the IEEE (Institute of Electrical and Electronics Engineers) format. Single-precision values with float type have 4 bytes, consisting of a sign bit, an 8-bit excess-127 binary exponent, and a 23-bit mantissa. The mantissa represents a number between 1.0 and 2.0. Since the high-order bit of the mantissa is always 1, it is not stored in the number. This representation gives a range of approximately 3.4E–38 to 3.4E+38 for type float. You can declare variables as float or double, depending on the needs of your application. The principal differences between the two types are the significance they can represent, the storage they require, and their range. Table 3.3 shows the relationship between significance and storage requirements.Table 3.3 Floating-Point TypesType Significant digits Number of bytes
float 6 – 7 4
double 15 – 16 8
Floating-point variables are represented by a mantissa, which contains the value of the number, and an exponent, which contains the order of magnitude of the number.Table 3.4 shows the number of bits allocated to the mantissa and the exponent for each floating-point type. The most significant bit of any float or double is always the sign bit. If it is 1, the number is considered negative; otherwise, it is considered a positive number.Table 3.4 Lengths of Exponents and MantissasType Exponent length Mantissa length
float 8 bits 23 bits
double 11 bits 52 bits
Because exponents are stored in an unsigned form, the exponent is biased by half its possible value. For type float, the bias is 127; for type double, it is 1023. You can compute the actual exponent value by subtracting the bias value from the exponent value.The mantissa is stored as a binary fraction greater than or equal to 1 and less than 2. For types float and double, there is an implied leading 1 in the mantissa in the most-significant bit position, so the mantissas are actually 24 and 53 bits long, respectively, even though the most-significant bit is never stored in memory.Instead of the storage method just described, the floating-point package can store binary floating-point numbers as denormalized numbers. “Denormalized numbers” are nonzero floating-point numbers with reserved exponent values in which the most-significant bit of the mantissa is 0. By using the denormalized format, the range of a floating-point number can be extended at the cost of precision. You cannot control whether a floating-point number is represented in normalized or denormalized form; the floating-point package determines the representation. The floating-point package never uses a denormalized form unless the exponent becomes less than the minimum that can be represented in a normalized form.Table 3.5 shows the minimum and maximum values you can store in variables of each floating-point type. The values listed in this table apply only to normalized floating-point numbers; denormalized floating-point numbers have a smaller minimum value. Note that numbers retained in 80x87 registers are always represented in 80-bit normalized form; numbers can only be represented in denormalized form when stored in 32-bit or 64-bit floating-point variables (variables of type float and type long).Table 3.5 Range of Floating-Point TypesType Minimum value Maximum value
float 1.175494351 E – 38 3.402823466 E + 38
double 2.2250738585072014 E – 308 1.7976931348623158 E + 308
If precision is less of a concern than storage, consider using type float for floating-point variables. Conversely, if precision is the most important criterion, use type double.Floating-point variables can be promoted to a type of greater significance (from type float to type double). Promotion often occurs when you perform arithmetic on floating-point variables. This arithmetic is always done in as high a degree of precision as the variable with the highest degree of precision. For example, consider the following type declarations:float f_short;
double f_long;
long double f_longer;f_short = f_short * f_long;In the preceding example, the variable f_short is promoted to type double and multiplied by f_long; then the result is rounded to type float before being assigned to f_short.In the following example (which uses the declarations from the preceding example), the arithmetic is done in float (32-bit) precision on the variables; the result is then promoted to type double:f_longer = f_short * f_short;