* Operator (Visual Basic)

Multiplies two numbers.

Syntax

number1 * number2

Parts

Term Definition
number1 Required. Any numeric expression.
number2 Required. Any numeric expression.

Result

The result is the product of number1 and number2.

Supported Types

All numeric types, including the unsigned and floating-point types and Decimal.

Remarks

The data type of the result depends on the types of the operands. The following table shows how the data type of the result is determined.

Operand data types Result data type
Both expressions are integral data types (SByte, Byte, Short, UShort, Integer, UInteger, Long, ULong) A numeric data type appropriate for the data types of number1 and number2. See the "Integer Arithmetic" tables in Data Types of Operator Results.
Both expressions are Decimal Decimal
Both expressions are Single Single
Either expression is a floating-point data type (Single or Double) but not both Single (note Decimal is not a floating-point data type) Double

If an expression evaluates to Nothing, it is treated as zero.

The * operator can be overloaded, which means that a class or structure can redefine its behavior when an operand has the type of that class or structure. If your code uses this operator on such a class or structure, be sure you understand its redefined behavior. For more information, see Operator Procedures.

Example

This example uses the * operator to multiply two numbers. The result is the product of the two operands.

Dim testValue As Double
testValue = 2 * 2
' The preceding statement sets testValue to 4.
testValue = 459.35 * 334.9
' The preceding statement sets testValue to 153836.315.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7611437,"math_prob":0.9798818,"size":1673,"snap":"2022-05-2022-21","text_gpt3_token_len":382,"char_repetition_ratio":0.14080288,"word_repetition_ratio":0.05925926,"special_character_ratio":0.22414824,"punctuation_ratio":0.11409396,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98385435,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-26T12:54:12Z\",\"WARC-Record-ID\":\"<urn:uuid:5cd41f3a-0f74-4d8f-9720-3387e68b6892>\",\"Content-Length\":\"43944\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:aa79214f-67c0-4fc2-93ee-8f32f602968b>\",\"WARC-Concurrent-To\":\"<urn:uuid:717199e9-475d-4faf-8d0e-6352e6497e30>\",\"WARC-IP-Address\":\"23.39.179.42\",\"WARC-Target-URI\":\"https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/multiplication-operator\",\"WARC-Payload-Digest\":\"sha1:BFTXHCQZKFFQITP7WB556MFAB76FSJ43\",\"WARC-Block-Digest\":\"sha1:EL7REDN5BBLFCPGW2FFXDW4N6E52BAVI\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320304947.93_warc_CC-MAIN-20220126101419-20220126131419-00211.warc.gz\"}"}