相关疑难解决方法(0)

任何人都可以用C#中的签名浮点数解释这种奇怪的行为吗?

以下是带注释的示例:

class Program
{
    // first version of structure
    public struct D1
    {
        public double d;
        public int f;
    }

    // during some changes in code then we got D2 from D1
    // Field f type became double while it was int before
    public struct D2 
    {
        public double d;
        public double f;
    }

    static void Main(string[] args)
    {
        // Scenario with the first version
        D1 a = new D1();
        D1 b = new D1();
        a.f = b.f = 1; …
Run Code Online (Sandbox Code Playgroud)

.net c# floating-point

247
推荐指数
8
解决办法
2万
查看次数

标签 统计

.net ×1

c# ×1

floating-point ×1