I am encountering a floating point precision issue, does anybody know why this happens? Why is it that the cosine function is affected, but not he sine function.
Math.sin(90 * Math.PI / 180);
// returned: 1, expected: 1
1 - Math.sin(90 * Math.PI / 180);
// returned: 0, expected: 0
Math.cos(90 * Math.PI / 180);
// returned: 6.123233995736766e-17, expected: 0
1 - Math.cos(90 * Math.PI / 180);
// returned: 0.9999999999999999, expected: 1