Performing Math operations on decimal datatype in C#?

前端 未结 5 1117
情深已故
情深已故 2020-11-30 07:27

I was wondering if the above was at all possible. For example:

Math.Sqrt(myVariableHere);

When looking at the overload, it requires a doub

5条回答
  •  余生分开走
    2020-11-30 08:20

    Math.Sqrt((double)myVariableHere);
    

    Will give you back a double that's the square root of your decimal myVariableHere.

提交回复
热议问题