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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.