mozilla

jvilk

Member since
jvilk

Recent Docs Activity

View all activity
Page Date Comment

Math.imul()


Sorry about my previous revision; this one is correct. The >>>0 coerces the upper bits into an unsigned quantity which is added to the lower bits, and the |0 brings the total back into signed territory.

Math.imul()


The given imul polyfill can produce values > 32 bits, since the high part can overflow. For example, try running it with 0xffffffff and 5. The high part needs to be truncated to 32-bits; hence the |0.