我怎么可以把两个整数取得双? [英] How can I divide two integers to get a double?

查看:117
本文介绍了我怎么可以把两个整数取得双?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何划分两个整数取得双?

How do I divide two integers to get a double?

推荐答案

您想投的数字:

double num3 = (double)num1/(double)num2;

请注意:如果任何在C#中的参数是一个双击,一个双击鸿沟正在使用导致一个双击。因此,下面将工作太:

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:

点网皮尔斯

这篇关于我怎么可以把两个整数取得双?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆