Thread: order of operations...

  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    University of Waterloo

    order of operations...

    (), []
    ++, - -
    - (unary), + (unary), !, ~, ++, - -, (type)
    *, /, %
    +, -
    <<, >>, >>>
    <, >, <=, >=, instanceof
    ==, !=
    =, *=, /=, %=, -=, <<=, >>=, >>>=, &=, ^=, |=

    that is the correct order of operations, right? I want to make sure it's in the right order and that I'm not going crazy

    I pulled this from a Java site, because it's the first one that came up when i searched google, so there's some odd operators in there

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Ontario, Canada
    Here's a C version for ya.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    University of Waterloo
    awesome, thanks.

    I've almost got my new stack-based parser finished for OST2 Release #10! It's going to make the language run so much faster. Just have to implement && and || and then I have to get variables and functions working in the parser and I'll have a new, incredibly fast math parser!

    As opposed to the string-based parser I use right now which basically runs through the string (IE: "3+3*(522/42)-var1") over and over every time, the new parser will precompile the statement in to an operator stack that can be processed insanely fast.

    (PS: Look for Release #10 of OST2 coming in the next month or so!)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Order of operations question
    By GuitarNinja in forum C++ Programming
    Replies: 4
    Last Post: 04-11-2009, 06:14 AM
  2. Order of Operations Question
    By chix/w/guns in forum C++ Programming
    Replies: 35
    Last Post: 07-17-2004, 03:38 AM
  3. order of operations when programming in API
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 12-07-2002, 05:34 PM
  4. Order of Operations
    By C-Duddley in forum C Programming
    Replies: 3
    Last Post: 12-06-2002, 08:10 PM
  5. order of operations
    By DavidP in forum A Brief History of
    Replies: 18
    Last Post: 10-31-2002, 08:51 PM