Math.PI/180 should be Math.PI/180.0, dividing doubles by integers will cause some funny things to happen
Unexplainable behavior of a double [closed]
Question
I currently programming some calculations and found a weird issue, which I cannot explain. I'm doing a calculation which I save in a new double field. The thing is, that the finally saved value is not the same than the solution of the formula. I made a screenshot for better understanding.
When I put the whole calculation in a watch, I get the result "1.3050....." When i check the double afterwards, it has saved "2.87......." which I have no idea, where that comes from. Does anybody know, why it is behaving like this? For me thats absolutely unexplainable...
Full size: https://i.stack.imgur.com/8nJpn.png
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow