because ptrSize will be 8 for double, which means that ptr will not be an integer but a real number with a decimal value of 0.5. But at the same time the issue might come from elsewhere, as the test also fails with floats (but differently ...)
Anyway, do you have an idea on how I could fix this ?
Hi there !
I have another problem with emscripten compilation, which I extracted in a separated repository: https://github.com/Luthaf/nbind-vector-double.
The issue occurs when trying to pass
std::vector<double>
orstd::vector<float>
from C++ to JS. (The same happens withstd::array<{float}, N>
)The code looks like this:
And on the JS side:
This prints
before failing the assertions.
I think the problem might be related to the code around here:
https://github.com/charto/nbind/blob/901a7d5129f9146b3a376d5feded5bb7ccbf0133/src/em/BindingStd.ts#L37-L40
because
ptrSize
will be 8 for double, which means thatptr
will not be an integer but a real number with a decimal value of0.5
. But at the same time the issue might come from elsewhere, as the test also fails with floats (but differently ...)Anyway, do you have an idea on how I could fix this ?