未检查的uint的C#溢出行为
我已经在https://dotnetfiddle.net/测试此代码: using System; public class Program { const float scale = 64 * 1024; public static void Main() { Console.WriteLine(unchecked((uint)(ulong)(1.2 * scale * scale + 1.5 * scale))); Console.WriteLine(unchecked((uint)(ulong)(scale* scale + 7))); } } 如果我使用.NET 4.7.2进行编译,则会得到 859091763 7 但是如果我使用Roslyn或.NET Core,我会得到 859091763 0 为什么会这样?