If have this code:
double sin = Math.sin(angle*rad);
double cos = Math.cos(angle*rad);
double tan = Math.tan(angle*rad);
It returns the triangle function for a specified angle. However for degrees of angle, like 90, -0.00000 is returned. So when these values are printed out, -0 just looks weird. How would -0 be tested for in an if statement?
I have tried with this code:
if (tan==0) { s.o.p(tan); }
and it doesn't run.