title: convert float to short with minimal loss of precision
body: <p>I have this sine wave which generates floating point values (e.g. 0.37885) but I want them as shorts. Direct casting with short gives me a value of 0. so what is the solution?</p>
  
  <p>Can anyone tell me how to do it - ideally without loss of precision - or minimal loss of precision if this is all that is possible?</p>