Can something in C# change float comparison behaviour at runtime? [x64]

前端 未结 3 1696
暗喜
暗喜 2021-02-05 04:21

I am experiencing a very weird problem with our test code in a commercial product under Windows 7 64 bit with VS 2012 .net 4.5 compiled as 64 bit.

The following test cod

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-05 05:24

    When I create a test application containing your test, the exception is not thrown. This means it's not going to be straightforward. Some ideas to further investigate:

    • If you run this test at the start of your application (e.g. in the Main/entry routine) does it fail then?
    • If the above is true, start a new project using the same target framework & architecture which runs the same test. If it passes, start adding in bits of your primary application gradually and see if you can find which bit makes it fail.

提交回复
热议问题