user-0 提问: 请教 2.1*3 这里的2.1是float型还是double型？谢谢

回复:
user: user-0
content: 引用 9 楼 赵4老师 的回复: 谢谢赵老师

user: user-1
content: MSDN98_1.ISO http://pan.baidu.com/s/1dDF41ix,  MSDN98_2.ISO http://pan.baidu.com/s/1bnGo0Vl

user: user-0
content: 引用 1 楼 user-4 的回复:2.1为double 2.1f为float 引用 7 楼 均陵鼠侠 的回复:我不敢保证国内的大学教授是否见过或者看过C标准。路子不是一般的“野”。 谢谢，现在好像有C18了，哪里可以C标准的完整文档呢？ 谢谢

user: user-2
content: 我不敢保证国内的大学教授是否见过或者看过C标准。路子不是一般的“野”。

user: user-2

user: user-2

user: user-1
content: C Integer Constants An “integer constant” is a decimal (base 10), octal (base 8), or hexadecimal (base 16) number that represents an integral value. Use integer constants to represent integer values that cannot be changed.  Syntax  integer-constant :  decimal-constant integer-suffix opt octal-constant integer-suffix opt hexadecimal-constant integer-suffix opt  decimal-constant :  nonzero-digit decimal-constant digit  octal-constant :  0 octal-constant octal-digit  hexadecimal-constant :  0x hexadecimal-digit 0X hexadecimal-digit hexadecimal-constant hexadecimal-digit  nonzero-digit : one of  1 2 3 4 5 6 7 8 9  octal-digit : one of  0 1 2 3 4 5 6 7  hexadecimal-digit : one of  0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F  integer-suffix :  unsigned-suffix long-suffix opt long-suffix unsigned-suffix opt   unsigned-suffix : one of  u U  long-suffix : one of  l L  64-bit integer-suffix :  i64  Integer constants are positive unless they are preceded by a minus sign (–). The minus sign is interpreted as the unary arithmetic negation operator. (See Unary Arithmetic Operators in Chapter 4 for information about this operator.)  If an integer constant begins with the letters 0x or 0X, it is hexadecimal. If it begins with the digit 0, it is octal. Otherwise, it is assumed to be decimal.   The following lines are equivalent:  0x1C   /* = Hexadecimal representation for decimal 28 */ 034    /* = Octal representation for decimal 28 */  No white-space characters can separate the digits of an integer constant. These examples show valid decimal, octal, and hexadecimal constants.   /* Decimal Constants */ 10 132 32179  /* Octal Constants */ 012 0204 076663  /* Hexadecimal Constants */ 0xa or 0xA 0x84 0x7dB3 or 0X7DB3

user: user-1
content: 常量当然也有类型： C Floating-Point Constants A “floating-point constant” is a decimal number that represents a signed real number. The representation of a signed real number includes an integer portion, a fractional portion, and an exponent. Use floating-point constants to represent floating-point values that cannot be changed.   Syntax  floating-point-constant :  fractional-constant exponent-part opt floating-suffix opt digit-sequence exponent-part floating-suffix opt  fractional-constant :  digit-sequence opt . digit-sequence digit-sequence .  exponent-part :  e sign opt digit-sequence E sign opt digit-sequence  sign : one of  +  –  digit-sequence :  digit digit-sequence digit  floating-suffix : one of  f  l  F  L  You can omit either the digits before the decimal point (the integer portion of the value) or the digits after the decimal point (the fractional portion), but not both. You can leave out the decimal point only if you include an exponent. No white-space characters can separate the digits or characters of the constant.   The following examples illustrate some forms of floating-point constants and expressions:  15.75 1.575E1   /* = 15.75   */ 1575e-2   /* = 15.75   */ -2.5e-3   /* = -0.0025 */ 25E-4     /* =  0.0025 */  Floating-point constants are positive unless they are preceded by a minus sign (–). In this case, the minus sign is treated as a unary arithmetic negation operator. Floating-point constants have type float, double, long, or long double.  A floating-point constant without an f, F, l, or L suffix has type double. If the letter f or F is the suffix, the constant has type float. If suffixed by the letter l or L, it has type long double. For example:     100L  /* Has type long double  */ 100F  /* Has type float        */ 100D  /* Has type double       */  Note that the Microsoft C compiler maps long double to type double. See Storage of Basic Types in Chapter 3 for information about type double, float, and long.  You can omit the integer portion of the floating-point constant, as shown in the following examples. The number .75 can be expressed in many ways, including the following:  .0075e2 0.075e1 .075e1 75e-2

user: user-3
content: 2.1 ×3默认是按照double（高一级的精度）来处理的。除非指定，比如2.1f * 3这是按照float类型来计算的。

user: user-4
content: 2.1为double 2.1f为float