2 ms·
> The problem is JS's double->int conversion was effectively defined as "what wintel does by default", No, JavaScript "double to int conversion" (which only ha
by titzer 6y ago
> The problem is JS's double->int conversion was effectively defined as "what wintel does by default",
No, JavaScript "double to int conversion" (which only happens implicitly in bitwise operations such as |, &, etc) is not like any hardware instruction at all. It is defined to be the selection of the low-order 32-bits of a floating point number as-if it were expanded to its full-width integer representation, dropping any fractional part.