DEV Community

Discussion on: Multiplication Without Multiplication Operators

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Or you could use logarithms and exponents! 😜

const multiply = (x, y) => 2 ** (Math.log2(x) + Math.log2(y))
Enter fullscreen mode Exit fullscreen mode

No multiplication or division operators here 👍

Collapse
 
jonrandy profile image
Jon Randy 🎖️

You might need a Math.round since precision will likely be an issue