decimal result = 100 * 200;
vs
decimal result = Decimal.Multiply(100, 200);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using the
Decimal.Multiplywill force the multiply to take inputs of typedecimalinstead of whatever the type that is being used and converted todecimal.Decimal.Multiply(decimal d1, decimal d2)and will enforce and output of typedecimal. Where as the*you could do:This allows you to mix and match types in some cases and it will handle it all for you but the type is not guaranteed to be decimal depending on how the right side is defined.