Passing double arrays between functions in asm.js
I have a C function compiled into asm.js with the following parameters: void myfunc(double v1[], double v2[], int v_size, double c) It takes in an array ( v1 ), applies a transformation, then fills another array of the same size ( v2 ) with the output. I compile it, and then run the following JS code: v1 = new Array(1.0, 1.5, 2.0); v2 = Module._malloc(8 * v1.length); Module.ccall("myfunc", null, ["array", "number", "number", "number"], [v1, v2, v1.length, 2]); However when I run getValue(v2, "double") I get 1.297703e-318 (which is wrong), and when I run getValue(v2 + 8, "double") or getValue