Say i have
Log.e("deg: "+dd, "X:"+ Math.sin( Math.toRadians(dd) ) +"| Y:"+Math.cos( Math.toRadians(dd) ) );
if dd = 180, then sin should be 0 and cos -1 , right? but it outpusts
deg: 180 X:1.2246467991473532E-16| Y:-1.0
any ideas? Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The value
1.2246467991473532E-16is effectively zero, to 16 decimal places; it’s0.00000000000000012246.You just need to format the number for display, if that’s the problem.