Hacker News new | ask | show | jobs
by roelschroeven 2423 days ago
Unless I'm missing something the right half of that picture is simply wrong, not just another quadrant.

tan(-1/3 pi) = -sqrt(3), so arctan(sqrt(3)/-1) = arctan(-sqrt(3)) = -1/3 pi != 1/3 pi

Why do they use sqrt(3)/-1 instead of simply -sqrt(3)? I have the impression something else is going on. Are we seeing the last line of a multi-line expression? Why do we see the bottom curls of the parentheses but not the top curls?

2 comments

Despite convention, it is reasonable to consider sqrt(3) to have ambiguous sign since inverse(square) is a multi-valued function (as is arctan). So you can have arctan(-sqrt(3)) = arctan(sqrt(3)) = pi/3 (allowing for arbitrary selection from multi-valued functions)

This is a problem in general with the design of calculators and single-result algorithms in general.

The -1 might be needed to trigger the bug.

The Citizen calculator has a reputation for bad math:

https://forum.kerbalspaceprogram.com/index.php?/topic/119681...

Yeah, I meant that by some thought one should have realized the answer was unexpected/off, but as the article states one does not really think about that when using a calculator.

The parantheses are just how it looks on that model, I tried inputing the exact same sequence on multiple calculators.