Live data from Hacker News

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

github.com

71–80 of 142 posts

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

#71
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.)

“Oh, I can see the test is failing. Let me fix this by adjusting the test to expect the currently returned value.” This is unfortunately an actual quote I got from Claude Code after having it write a unit test for me. It ended up mocking the entire method it was supposed to test, resulting in the unit test essentially only testing itself.

Sounds very human. I experienced some junior devs who grew up with TDD and would often just tweak their code to pass their tests without stopping to understand their code at a fundamental level - essentially development through trial and error. Since they were also the ones writing the tests the core assumptions went into both and because they did so without thinking they were more likely to have errors. The test being wrong was more than likely and in those cases it would make sense to fix the test output.

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

#72
post #2

I've heard people moan that software is getting exponentially worse. Maybe they're right after all /joke

You're joking but we went from the Ada "contracts and pre/post conditions" to the ReactJS monstrosities instead on improving the whole thing and being more strict.

I think it has more to do with the people than the tools.

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

#73
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'…

If your software has a bug, it’s your bug. If the root cause of the bug in your software comes from a direct call into some dependency, that’s immaterial to the users of your software. Your software is incorrect, so your software has a bug.

How you choose to resolve it is up to you. You might implement a fix in your code to handle the bug case until the dependency is fixed.

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

#74
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.

I agree that's the ideal solution in a vacuum, but I don't know this person's responsibilities regarding the projects in question, so I don't want to make assumptions about what they can or should do.

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

#75
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'…

It's going to be interpreted, and is probably meant, as saying that the person who filed the bug should close this report and open a new one in the right place.

Since the comment you responded to already complained about use of passive voice...

It's going to be interpreted BY WHOM to say that? Other .NET developers? Yeah, maybe, at least some of them. By the submitter of the original bug? No idea, I can't read their mind.

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

#76

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.

It’s not sub-field. It’s a technique. You relax or change axioms defining your thing and see what happens.

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

#77
post #49
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'…

Unless the documentation says that Math.Pow just returns the result of calling some other code (it doesn't do that), the bug is both in the Math.Pow and underlying library. It should be reported and tracked in both.

But should it be the responsibility of the person reporting the bug in Math.Pow, or the devs maintaining Math.Pow sees it is part of the underlying library and makes the report?

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

#78
post #18
post #11

Earlier quoted context omitted.

Microsoft is a many headed beast. Finding the right contact even for employees inside the beast is challenging and a skill all its own.

I'm more used to hear this kind of 'it's not our fault' crap from state bureaucracies not companies that want me to pay them...

Large companies are the same for the same reasons, the relationship between you paying them and their personal benefit is so incredibly remote that it might as well not exist.

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

#79
post #73
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'…

If your software has a bug, it’s your bug. If the root cause of the bug in your software comes from a direct call into some dependency, that’s immaterial to the users of your software. Your software is incorrect, so your software has a bug. How you choose to resolve it is up to you. You might implement a fix in your code to handle the bug case until the dependency is fixed.

Of course. They chose to resolve it by saying the underlying software should be fixed. That seems perfectly fine to me.

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

#80
post #74

Earlier quoted context omitted.

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.

I agree that's the ideal solution in a vacuum, but I don't know this person's responsibilities regarding the projects in question, so I don't want to make assumptions about what they can or should do.

If their job isn't to handle bug reports against .NET, what are they doing writing confidently about what should happen as a response to a bug report against .NET?
Post reply on HN