Jump to content

some math help please


advo

Recommended Posts

hey i have a issue with some math equasions and how to get them to work right

 

so far i did first one and made it work in php

=IF(C4>C9;0;IF(B4>B9;0;((B9)*(B9+1)/2*15000)+(B9*2100800)-((B4)*(B4+1)/2*15000)-(2100800*B4)))

this is what i got so far from this mind you its just coverting excell equasions but im not math boy and suck bad at maths

$costatkweps =(($_POST[noatkwepsto])*($_POST[noatkwepsto]+1)/2*15000)+($_POST[noatkwepsto]*2100800)-(($_POST[noatkweps])*($_POST[noatkweps]+1)/2*15000)-(2100800*$_POST[noatkweps]);
   
    if($_POST[noatkweps]>$_POST[noatkwepsto]){
    $costatkweps = 0; 
    }
    if($_POST[atklvl]>$_POST[atklvlto]){
    $costatklvl = 0; 
    }

 

ok the first bit of maths works  it the second equasion

 

=[color=red]IF(C4>C9;0;IF(B4>B9;0;[/color](10000000*((2^C9)-1))-(10000000*((2^C4)-1))))

the red bit is handled by the if statements and works well,  but how do i do the rest so php can add it up, C9 and C4 are the fields so c9=$_POST[atklvlto] and c4 = $_POST[atklvl]

 

i just dont understand how to get this one formular working because of the ^ symbold i think it means 2 to the power of or something but no clue on how to get this one fomualr to add up please help me

 

 

Link to comment
https://forums.phpfreaks.com/topic/211762-some-math-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.