Live data from Hacker News

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

github.com

51–60 of 142 posts

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

#51

The good thing is, if (-1)^2=-1, we can prove anything! NP=P, every program halts, axiom of choice - math just becomes so much easier.

Joke aside, is there a field (or sub-fields) of mathematics that just... studies what breaking some axioms would do and where would it lead? This seems both completely stupid but also potentially fascinating at the same time.

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

#52
post #30

Earlier quoted context omitted.

What do you disagree with, exactly? The bug is in an underlying library, so it should be reported to that library. That all seems correct to me, I don't see what there is to disagree with there. The problem with the comment is it does not make ownership of the next steps clear. The maintainer should've either taken the ball ("I will report this to...") or made it clear that the reporter should hold the ball ("We can'…

Bro is a Microsoft employee. He should say "thank you for the bug report", and open a bug in the underlying library if that is the correct place. Bug reporter might not care that much and not bother opening another bug report, and this looks like a pretty bad bug.

This. And that's how it should work whether or not it's a Microsoft application.

Users report bugs to the team working on the user application. If the bug is actually in a component that application uses, then it's that team's responsibility to report it upstream, not the user's.

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

#54
post #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 mak…

>It’s not the job of a bug reporter to figure that out The comment isn't blaming the reporter for not doing that.

It reads the opposite to me. I absolutely read it as "you reported this to the wrong people".

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

#55
post #3

I really want to know how this could have passed CI testing. (Comments blame it on UCRT, not .NET but… that doesn’t matter much to me.)

Maybe its a bug in their telemetry? They have to pass the parameters to azure to data-mine customer activity and azure accidentally returned the incorrect result.

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

#56

The good thing is, if (-1)^2=-1, we can prove anything! NP=P, every program halts, axiom of choice - math just becomes so much easier.

Joke aside, is there a field (or sub-fields) of mathematics that just... studies what breaking some axioms would do and where would it lead? This seems both completely stupid but also potentially fascinating at the same time.

The mathematics equivalent of the any% speedrun community?

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

#57

No idea why this happened. Perhaps Math.Pow(x,y) was implemented as 2**(y*log2(x)) without writing special code to deal with the case where x is negative real and y is integer?

In fairness, the general power function might well be complicated. Dealing with fractional base and exponent, signs (-1^2 makes sense but -1^0.5 doesn't in real numbers). I don't know how that works in code but I can see how this gremlin sneaks in.

I don't see how it gets past the test suite though.

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

#58

The good thing is, if (-1)^2=-1, we can prove anything! NP=P, every program halts, axiom of choice - math just becomes so much easier.

Joke aside, is there a field (or sub-fields) of mathematics that just... studies what breaking some axioms would do and where would it lead? This seems both completely stupid but also potentially fascinating at the same time.

Yes. Prominent example is the axiom of choice. There was a LOT of discussion about it by mathematicians. https://plato.stanford.edu/entries/axiom-choice/

For instance, with it, you can double the volume of a body by looking at it from a weird angle.

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

#60
post #30
post #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 mak…

What do you disagree with, exactly? The bug is in an underlying library, so it should be reported to that library. That all seems correct to me, I don't see what there is to disagree with there. The problem with the comment is it does not make ownership of the next steps clear. The maintainer should've either taken the ball ("I will report this to...") or made it clear that the reporter should hold the ball ("We can'…

> What do you disagree with, exactly?

OP said it quite clearly and so did you: that it's the reporter's job. It's the maintainer's job to put in the bug report now.

Post reply on HN