View Full Version : Squaring with PHP
12-10-2003, 09:55 PM
How can I square using PHP? i.e. 2^2 = 4 and 4^2 = 16.
I've looked but can't find it in the manual anywhere.
12-10-2003, 10:09 PM
12-10-2003, 10:37 PM
I don't want the square root. I want to square the number.
12-10-2003, 11:33 PM
Exponentiation doesn't use ^ or ** as you might be used to with other languages. To calculate "z equals y to the x" use:
$z = pow(y,x)
12-11-2003, 02:17 AM
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.