NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

* Operator

The multiplication operator (*) computes the product of its operands. All numeric types have predefined multiplication operators.

The * operator is also used to declare pointer types and to dereference pointers.

User-defined types can overload the * operator (see operator).

Example

using System;
class Test {
   public static void Main() {
      Console.WriteLine(5 * 2);
      Console.WriteLine(-.5 * .2);
      Console.WriteLine(-.5m * .2m); // decimal type
   }
}

Output

10
-0.10000000000000001
-0.1

Note that the double type cannot represent the value -0.1 exactly, while the decimal type can.

See Also

C# Operators | CLR 7.7.1 Multiplication operator