title: Read binary file containing 32 Bit floating points in JavaScript
body: <p>Currently, when the binary file contains 64 Bit floating points, I do:</p>
  
  <pre><code>fs.open('doubles.bin', 'r', (err, fd) =&gt; {
    if (err) reject(err);
    const buf = new Buffer(size);
    fs.read(fd, buf, 0, size, start, (err2) =&gt; {
      if (err2) reject(err2);
      const f32 = new Float32Array(buf.buffer);
      const data = Array.prototype.slice.call(f32);
      resolve({ id, data });
    });
  });
  </code></pre>
  
  <p>(the binary is a simple list of numbers. They are not separated by anything)</p>
  
  <p>I think this works because the Float32Array view expects to read the standard JavaScript <code>Number</code>s, which are 64 Bit in size.</p>
  
  <p>As soon as the binary contains 32 Bit Numbers, i only get garbage out of it (<code>NaN</code>s and wrong Numbers).</p>
  
  <p>How can I read a binary file, containing 32 Bit floating point numbers, with JavaScript and convert it to an Array?</p>