T
Tigger
I have a method that is passed two objects and it needs to return an object
that represents those two objects multiplied together.
public object Multiply(object a, object b)
{
return a * b;
}
The objects can be any type of number and I would like it to do the maths in
the most efficient and accurate way.
e.g. if both numbers are double, they are multipled as doubles and a double
is returned.
Is there any way to do this in C#?
Tigger
that represents those two objects multiplied together.
public object Multiply(object a, object b)
{
return a * b;
}
The objects can be any type of number and I would like it to do the maths in
the most efficient and accurate way.
e.g. if both numbers are double, they are multipled as doubles and a double
is returned.
Is there any way to do this in C#?
Tigger