Results 1 to 6 of 6

Math Help - Equation Gives Unexpected Result

  1. #1
    Newbie
    Joined
    Jun 2008
    Posts
    11

    Question Equation Gives Unexpected Result

    Ok im not exactly sure where to post this as i am really bad with math lol

    ok to all you geniuses

    This Equation Works fine:
    0+79*0/(0+1)+293*0/(1+0-(0/62)*62)+479
    as it equals 479

    This also works fine:
    0+79*0/(61+1)+293*(61/1+0-(0/62)*62)+479
    as it equals 3352

    Unfortunately this gives unexpected results:
    479+79*479/(1+1)+293*1/(1+479-(479/62)*62)+479 = 20171.5

    20171.5 Should Be: 19884
    ----
    To people who want to know the above equations are actually from a PHP Script. I am trying to convert a JASS script to PHP and im hoping this is the last thing to solve :P.


    Thanks for all your help
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by uniflare View Post
    Ok im not exactly sure where to post this as i am really bad with math lol

    ok to all you geniuses

    This Equation Works fine:
    0+79*0/(0+1)+293*0/(1+0-(0/62)*62)+479
    as it equals 479

    This also works fine:
    0+79*0/(61+1)+293*(61/1+0-(0/62)*62)+479
    as it equals 3352

    Unfortunately this gives unexpected results:
    479+79*479/(1+1)+293*1/(1+479-(479/62)*62)+479 = 20171.5

    20171.5 Should Be: 19884
    ----
    To people who want to know the above equations are actually from a PHP Script. I am trying to convert a JASS script to PHP and im hoping this is the last thing to solve :P.


    Thanks for all your help
    Check your use of brackets and the rules of precedence for PHP. Under the usualy rules your last expression must have a .5 at the end, so your should be cannot be right if the expression is correct.

    479 - integer

    79*479/(1+1) - is a half integer

    293*1/(1+479-(479/62)*62) - integer

    479 - is an integer

    I would guess 293*1/(1+479-(479/62)*62) is not what is intended

    RonL
    Last edited by CaptainBlack; June 30th 2008 at 03:32 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2008
    Posts
    11

    Thanks

    Thank you very much for the suggestion.

    The Equation seems to be put off by the scripting language im using.

    its called JASS. JASS seems to interpret 479 / 62 * 62 = 343 ??? lol

    Strange language.

    I have posted on a JASS forum to see if there is a reason....

    Thanks again
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,857
    Thanks
    321
    Awards
    1
    Quote Originally Posted by CaptainBlack View Post
    293*1/(1+479-(479/62)*62) is a half integer
    How is this a half integer?
    293*1/(1 + 479 - (479/62)*62)

    = 293*1/(1 + 479 - 479)

    = 293*1/(1 + 0)

    = 293*1/1

    = 293

    -Dan
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by topsquark View Post
    How is this a half integer?
    293*1/(1 + 479 - (479/62)*62)

    = 293*1/(1 + 479 - 479)

    = 293*1/(1 + 0)

    = 293*1/1

    = 293

    -Dan
    Opps... sorry its the one before that:

    79*479/(1+1)

    That is the half integer!

    RonL
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Jun 2008
    Posts
    11
    Thank you for your help i have the answer.

    If your interested its here:

    JASS Math does not make sense ??? - The Helper Forums
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. influence result of an equation
    Posted in the Differential Equations Forum
    Replies: 0
    Last Post: February 10th 2010, 08:34 AM
  2. Replies: 0
    Last Post: December 3rd 2009, 05:33 PM
  3. unexpected expectation
    Posted in the Statistics Forum
    Replies: 1
    Last Post: November 7th 2009, 10:56 AM
  4. Deduce result by solving equation?
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: May 26th 2009, 04:36 AM
  5. Unexpected behavior of Maple
    Posted in the Math Software Forum
    Replies: 0
    Last Post: October 31st 2008, 03:11 AM

Search Tags


/mathhelpforum @mathhelpforum