Issue
How do I divide two integers to get a double?
Solution
You want to cast the numbers:
double num3 = (double)num1/(double)num2;
Note: If any of the arguments in C# is a double
, a double
divide is used which results in a double
. So, the following would work too:
double num3 = (double)num1/num2;
For more information see:
Answered By - NoahD Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.