Table of contents
TOC
折叠目录
展开目录

* 运算符* Operator

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

用于将两个数字相乘。Used to multiply two numbers.语法结果=数字 1 * 数字 2\运算符语法包含以下成分:Syntax* result=number1 * number2 The \* operator syntax has these parts:

部件Part说明Description
resultresult所需;任何数值变量Required; any numeric variable.
数字 1number1所需;任何数值表达式Required; any numeric expression.
数字 2number2必需;任何数值表达式。Required; any numeric expression.

备注数据类型_通常是表达式的结果的最精确表达式相同。Remarks The data type of _result is usually the same as that of the most preciseexpression.订单的精度,从最低到最精密的是字节整型货币十进制The order of precision, from least to most precise, is Byte, Integer, Long, Single, Currency, Double, and Decimal.此顺序的例外情况如下:The following are exceptions to this order:

如果If那么_结果_就是Then result is
乘法涉及一个单一Multiplication involves a Single and a Long,转换为双精度converted to a Double.
数据类型__是结果的,或日期型变量溢出其合法范围,The data type of result is a Long, Single, or Date variant that overflows its legal range,转换为一个variant 类型的值包含双精度converted to a Variant containing a Double.
数据类型__是结果的字节变量溢出其合法范围,The data type of result is a Byte variant that overflows its legal range,转换为整数变量,该变量。converted to an Integer variant.
数据类型__是结果的其合法的范围内,溢出整数变量the data type of result is an Integer variant that overflows its legal range,转换为Long变量。converted to a Long variant.

如果一个或两个表达式均为Null表达式,则_结果_为空值If one or both expressions are Null expressions, result is Null.如果表达式为,则将它视为 0。If an expression isEmpty, it is treated as 0.

请注意 精度由乘法的顺序不是精度由加法和减法运算的顺序相同。Note The order of precision used by multiplication is not the same as the order of precision used by addition and subtraction.

示例Example

此示例使用\*运算符将两个数相乘。This example uses the \* operator to multiply two numbers.

Dim MyValue
MyValue = 2 * 2    ' Returns 4.
MyValue = 459.35 * 334.90     ' Returns 153836.315.

© 2018 Microsoft