I wrote the cube and square functions and they don't work with negative numbers except when it does.

So deal with it. Not sure what to do about it. Amended: It does work, somehow, what?