domcu Posted March 29, 2007 Share Posted March 29, 2007 hi, I am trying to write formula in php but two days work and nothing please someone help. Here is formula how look mathematic: here is how look in dynamic: A=((N*(100-d)/100)*r*(1+r/1200)^(12*y))/(1200*((1+r/1200)^(12*y)-1)) here is how I write in php: (($_POST['N']*(100 - $_POST['d'])/100)*$_POST['r']*(1+($_POST['r']/1200)pow(12*$_POST['y'])/(1200*((1+$_POST['r']/1200)*(12*$_POST['y'])-1)); but script don't work... Please help me, Thank you very much and sorry for my english. Link to comment https://forums.phpfreaks.com/topic/44780-cant-make-formula-in-php/ Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 You are using the pow function incorrectly.... http://www.php.net/pow $N = $_POST['N']; $d = $_POST['d']; $r = $_POST['r']; $y = $_POST['y']; $A = (N * ((100 - $d) / 100) * $r * pow((1 + ($r / 1200)), (12 * $y))) / (1200 * ( pow((1 + ($r / 1200)), (12 * $y)) - 1 )); Link to comment https://forums.phpfreaks.com/topic/44780-cant-make-formula-in-php/#findComment-217433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.