Dart double operator-multiplication
Syntax & Examples


double.operator-multiplication operator

The multiplication operator multiplies the given numeric value by another numeric value and returns a double result.


Syntax of double.operator-multiplication

The syntax of double.operator-multiplication operator is:

operator *(num other) → double

This operator-multiplication operator of double multiplication operator.

Parameters

ParameterOptional/RequiredDescription
otherrequiredthe numeric value to multiply with


✐ Examples

1 Example with integer values

In this example,

  1. We create two integer values numValue1 and numValue2 with values 10 and 5 respectively.
  2. We then use the multiplication operator * to multiply numValue1 and numValue2.
  3. We print the multiplication result to standard output.

Dart Program

void main() {
  num numValue1 = 10;
  num numValue2 = 5;
  double result = numValue1 * numValue2;
  print('Multiplication result: $result');
}

Output

Multiplication result: 50.0

2 Example with floating-point values

In this example,

  1. We create two floating-point values numValue1 and numValue2 with values 3.5 and 2 respectively.
  2. We then use the multiplication operator * to multiply numValue1 and numValue2.
  3. We print the multiplication result to standard output.

Dart Program

void main() {
  num numValue1 = 3.5;
  num numValue2 = 2;
  double result = numValue1 * numValue2;
  print('Multiplication result: $result');
}

Output

Multiplication result: 7.0

3 Example with negative values

In this example,

  1. We create two numeric values numValue1 and numValue2 with values -8 and 4 respectively.
  2. We then use the multiplication operator * to multiply numValue1 and numValue2.
  3. We print the multiplication result to standard output.

Dart Program

void main() {
  num numValue1 = -8;
  num numValue2 = 4;
  double result = numValue1 * numValue2;
  print('Multiplication result: $result');
}

Output

Multiplication result: -32.0

Summary

In this Dart tutorial, we learned about operator-multiplication operator of double: the syntax and few working examples with output and detailed explanation for each example.