I have this java code to calculate the sin(360):
if(re.equals(" sin "))
{
try{
String next=data.get(i+1);
v1 = Double.parseDouble(next);
double degreess = v1;
double radianss = Math.toRadians(degreess);
BigDecimal bDecimal1 = new BigDecimal(
Math.sin(radianss), MathContext.DECIMAL32);
re=""+bDecimal1;
//re=""+Math.sin(Math.toRadians(Double.valueOf(next)));
i++;
}
catch (Exception e) {
e.printStackTrace();
}
}
I expect sin(360)
should be exactly 0.
But my result is non zero: -0.0000000000000002449294
. Why is this not zero?