When trying to get the cos of 90 using this code
System.out.println(Math.cos(Math.toRadians(90)));
This prints 6.123233995736766E-17 Why does this happen and what have i done wrong
Edit i solved this using a custom function(Where the amounts of zeros is how rounded the number becomes):
double round(double value){
return((double)Math.round(value * 100000d) / 100000d);
}
Thanks too https://stackoverflow.com/users/20459/asterite for the function