Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you entered a number wrong, since your calculator otherwise got the right answer. None of these functions are going into particularly dangerous areas for precision. When I round every step to 6 figures on my calculator, I still get 24.9999

Heck, rounding every step to 2 figures still gets me .41 radians which is 23.5 degrees.



I think he means rounding to 6 decimal places. If I do that I get 9.326312.


I...how? That's the same on most of the numbers, but even more precision on one of them.

Here's my calculator, with exactly three decimal places:

25->rad: .436

sin(.436): .422

cos(.422): .912

tan(.912): 1.292

atan(1.292): .912

acos(.912): .422

asin(.422): .435

.435->deg: 24.924

Where does your calculator start to diverge, that you end up with an answer like 9?

And I got the same result as Aardwolf that the Sinclair emulator returns .434, only a tenth of a degree off.

Edit: Oh wait, you're using a calculator set to degrees. That's a totally different problem, because it makes the 0-1 output from sin and cos become an extremely small fraction of a circle. It works as a type of precision test, but it's not at all the same thing you'd try on the Sinclair that only does radians. It still doesn't explain your original memory.

Side note: Even in degrees mode, the answer for 6 digits is kind of an outlier. If you use 5 or fewer digits the calculation crashes. 7 digits gets you 24.9. It boils down to just acos(cos( [about half a degree] )), and the other operations don't really matter.


...but it's not at all the same thing you'd try on the Sinclair that only does radians.

Right. Apparently I wasn’t aware of that at the time. Nice to find out here on HN some fourty years later :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: