This content has been marked as final. Show 2 replies
Is the best way to square a variable to just multiply it by itself?Yes.
I was hoping there was something like Math.square(number1) or be able to use number1^2 or some handy trick like that.Sadly no language I know since Cobol has had an exponentiation operator. You wouldn't want to call a method just for squaring when you can do it with one operator.