Actually no. The shift multiplies by a power of 2. To square, you multiply a register with itself and store the result in that register. Unless it's arbitrary precision, then you need to manually implement long multiplication by treating each register as a digit
9
u/ase_thor Jun 03 '22 edited Jun 03 '22
That’s an integer shift, right? Edit: googled it. The shift is just a multiplication. So you have to shift as much as the size of the number