I hear you. I am terribly annoyed by the inaccuracy of division. The other day I did:
Console.WriteLine(1.0 / 3.0);
and I got 0.33333333333333333, instead of the correct answer, which is 0, 333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ...
Perhaps now you see what the problem is. Math.Pi is not equal to pi not more than 1.0 / 3.0, equal to one third. Both of them differ from the true value by several hundred quadrillion, and therefore any calculations that you perform with Math.Pi or 1.0 / 3.0 will also be disabled by several hundred quadrillion, including the reception of the sine.
If you do not like that approximate arithmetic is approximate, then do not use approximate arithmetic. Use exact arithmetic. I used to use Waterloo Maple when I needed exact arithmetic; perhaps you should buy a copy of this.
Eric Lippert Jul 14 2018-10-14T00: 00Z
source share