title: Java Math.sin() doesn't work as expected
body: <p>Okay, my assignment is to produce an array values a sine wave with a custom frequency.
  This is my sine function:</p>
  
  <pre><code>Math.sin(frequency*(j/samplesPerSecond)*Math.PI*2)
  </code></pre>
  
  <p><code>j</code> is the array index and <code>samplesPerSecond</code> equals 44100.</p>
  
  <p>Now for an array of 100,000 values it returns 0.0 for the first 33,000, 1.571509...E-14 for the next 33,000 and 3.143018...E-14 for the rest.</p>
  
  <p>I've tried <code>System.out.println(Math.sin(Math.PI));</code> and it doesn't return 0 but it returns 1.224646...E-16</p>
  
  <p>This is my first java assignment so I might be overlooking something really obvious here, but I'm really confused.</p>