Exemplo n.º 1
0
    public static int Main()
    {
        var a = new StructWithFloats {
            FloatOne = 1, FloatThree = 2
        };

        return(Problem(&a) ? 101 : 100);
    }
Exemplo n.º 2
0
    private static bool Problem(int i)
    {
        StructWithFloats s = default;

        s.FloatOne = BitConverter.Int32BitsToSingle(i);

        return(s.FloatOne != *(float *)&i);
    }