4 ms·
I'm not a javascript guru, but I see two ways how it may work. 1. The right part of equation converted into integer because the left part is integer. Conversio
by ordu 4y ago
I'm not a javascript guru, but I see two ways how it may work.
1. The right part of equation converted into integer because the left part is integer. Conversion is done by rounding to nearest integer, and it will work this way.
2. The other way it may work is to convert 0 into floating point. Math.floor would make some canonical floating point representation of 0 from numbers in a range [0..1), and so do conversion of (int)0 into float.
One needs to really know his language of choice to master such subtleties.