Note, that we don't ceil the square root, since perfect squares need to skip to the next square as well. So flooring and adding one is the solution. Removing the floor syntactically is mathematically not neat but it is based on the JavaScript feature that using a binary operator with a double implicitly casts to integer (which is equal to floor, since we have positive roots only). Using not (\(\sim)\) and flipping the sign again adds one, due to the two's complement representation of numbers. Since we square the number, the negative sign is redundant anyway. Implemented in JavaScript, the whole thing looks like: