Thursday Code Puzzler: Compute Squares
Write a function that computes the square of a number without using *, ^, or +.
by rulokc
HTML
<a href="http://java.dzone.com/articles/thursday-code-puzzler-compute">Thursday Code Puzzler: Compute Squares</a>
<h1>Compute Squares</h1>
<p>
Write a function that computes the square of a number without using *, ^, or +.
</p>
<h2>Ref</h2>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">Bitwise Operators</a></li>
</ul>
JavaScript
function square(x) {
}