My instructor says that $\sin(\pi \cdot n)$ is always equal to $0$.
However, when playing with jsconsole.com, I find that this is not the case.
Math.sin(10000000000000000000 * Math.PI)
=> 0.7463367130158111
We get some random values, the more numbers we play with
Math.sin(100000000000000000000000 * Math.PI)
=> -0.7965162588457233
It doesn't look like there is any rule we can plug in for multiplying an integer by $\pi$.
I'm working with JavaScript, where the number $\pi$ is defined as
3.141592653589793
Does this have to do with their value of $\pi$ being inaccurate, as it only has around 15 digits. Is this not the true value of $\pi$?
In the above examples, I gave, would those evaluate to 0?
I'm skeptical of the $\sin(\pi \cdot n) = 0$ theory.
The compiler of
jsconsole.comhandles these huge values using floating point numbers, and floating point loses precision when the exponent is large.You can check that $\sin n\pi$ is near $0$(again not equal to $0$ due to floating point precision) for "small" values of $n$. This fact continues to hold for larger $n$ since $\sin$ is periodic. That is, $\sin x = \sin (x + 2\pi)$ for all $x \in \mathbb{R}$.
The value of $\pi$ is hard coded into Javascript as a double floating point number. There is no way to store the "true" value of $\pi$.
Here is a site to check when you want to challenge the compiler using huge numbers.