Live data from Hacker News

Math.Pow(-1, 2) == -1 in Windows 11 Insider build

github.com

1–10 of 142 posts

Re: Math.Pow(-1, 2) == -1 in Windows 11 Insider build

#5
This happens in both C# and C++ according to the report, but what's the link between OS and compiler here?

As far as I remember from days when I used Windows, the version of your visual studio (which has the compiler and standard libraries) was not related to the build of your operating system

Re: Math.Pow(-1, 2) == -1 in Windows 11 Insider build

#6
Side note.

One of the advantages of using proprietary packaged software is supposed to be a unified support and product.

In this case the maintainer redirects the issue to some other team and passes the ball as if it were an open source project with 50 dependencies with thin responsibilities "no, if there's an issue with a button, you should report it to GUI-button, we do GUI-form and we just pass the button generation to their library"

Re: Math.Pow(-1, 2) == -1 in Windows 11 Insider build

#7
I disagree with the comment

“Both Math.Pow and std::pow invokes the pow function in UCRT, which is shipped with Windows. The issue should be reported to MSVC instead”

It’s not the job of a bug reporter to figure that out and to verify that nothing goes wrong in setting up stuff for invoking that function or in getting its output back into the C# world.

That’s even more true because the dynamic nature of .NET code makes it far from easy to verify by inspection that that function is just calling the pow function in UCRT. The C# compiler might do constant folding wrong and there might be several ways in which the runtime compiles the CLR code (fast compilation to start running it quickly, slower compilation that produces faster code later if it turns out to be called a lot, etc)

Re: Math.Pow(-1, 2) == -1 in Windows 11 Insider build

#10
post #5

This happens in both C# and C++ according to the report, but what's the link between OS and compiler here? As far as I remember from days when I used Windows, the version of your visual studio (which has the compiler and standard libraries) was not related to the build of your operating system

Microsoft moved to a Universal CRT (UCRT) around Windows 10, both C# and C++ are calling into the OS UCRT there.
Post reply on HN