How can I effectively check the asm.js code, is the floating point value NaN?
A principle that works in principle is to import a global JavaScript function isNaNas an external function into the asm.js. module Since calling a foreign function is expensive, however, this will not give an optimal code.
Comparing with a NaN value (which is part of the standard library) is not an option, because comparing NaN with another NaN always gives a false value in JavaScript semantics.
Studying bits on the heap is also not an option, because endianess is not specified.
Why is isNaNnot included in the standard library in asm.js?
source
share