using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication16
{
class Program
{
static void Main(string[] args)
{
ulong li = 1000000000000000;
float wei = 2.0f;
double ke;
ke = li * wei;
Console.WriteLine(ke);
}
}
}
请问这段代码ke=li*wei;是 li隐式转换为float,还是wei隐式转换为ulong?
------解决思路----------------------
li转化为float,至于依据很简单
var ke1 = li * wei;
你可以在VS里面看到ke1的类型是Single,也就是float