title: Convert Uint8Array to Float64Array in JavaScript
body: <p>Let's say I have an Uint8Array of 4096 items where each of them is the value 0xff or 255. I want to convert this array into a Float64Array where 8 values of the previous array correspond to a one 64-bit float.
  I have tried this code:</p>
  
  <pre><code> // Every item is 1 byte in pixels array, I want 8 of them to represent
   // a 64-bit float in the float64Array
   let pixels = new Uint8Array([255, 255, 255 ... , 255]); // 4096 values
   let floatArr = new Float64Array(pixels.buffer); // Should be 512 values
   console.log(floatArr); // This shows NaNs all over.
  </code></pre>
  
  <p>I have seen couple more questions that seem to be close what I am asking, but I could not get the idea from the answers provided to them.
  After inspecting Mozilla documentation, this seemed to me the correct way of using, however, I am not getting the expected result. How can I make this happen? Also, I am limited to the browser, you can assume the latest versions.</p>
  
  <p>Edit: The expected result for a sample run is:</p>
  
  <pre><code>// pixels array is the input
  let pixels = new Uint8Array([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); // 16x 0xff, 16 bytes
  let floatArr = new Float64Array(pixels.buffer) // I expect this to be
  // [0xffffffffffffffff, 0xffffffffffffffff] which is 8bytes x 2,
  // Float64Array [ 18446744073709552000, 18446744073709552000 ]
  </code></pre>