#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    What features should I program into my C/C++ program "Equation_Solver"


    As a computer science student in a college of Engineering, I am working on a command line based computer program called "Equation_Solver" in which you type in a mathematical expression or equation and get the solution or at least the simplest form of the equation.

    Given the project I'm doing, what features, syntax, and instructions would you like from a relatively crude, high performance equation solving and expression simplifying program?

    For example, should I make the program show out all the steps? would you like to have GPU accelerated matrix computation for ATI and Nvidia graphics cards? Or should I only support Nvidia gpu's and use CUDA? Should it have the ability to store functions and expressions in plain text files? Arbitrary/infinite precision (but slow) decimal computation? Calculus functions? Statistical functions? Would you rather have a numerical range for integers of +- 2 billion with fast integers or a range of +-8 pentilion, but with a 60% performance hit? Doubles or long doubles? mixed numbers?

    Oh, one other thing. Personally I don't like order of operations much and tend to use a lot of extra parenthesis, so I thought it would be okay to just forget order of operations and make users put parenthesis around each binary operator. So for example: (5 + (6 mod 2)) /7 would be 5/7, but "5 + 6 mod 2 / 7" would be the same as "11 mod 2 /7" or "1/7". Would that be too counterintuitive?
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Originally Posted by JohnReedlol
    Oh, one other thing. Personally I don't like order of operations much and tend to use a lot of extra parenthesis, so I thought it would be okay to just forget order of operations and make users put parenthesis around each binary operator. So for example: (5 + (6 mod 2)) /7 would be 5/7, but "5 + 6 mod 2 / 7" would be the same as "11 mod 2 /7" or "1/7". Would that be too counterintuitive?
    I once wrote a little language that worked like this, but that was only because I was too lazy to implement a proper parser (and also, I wasn't up to my compiler theory then). Since I documented that my language did that, it became a *feature*. However, I'm not too sure that people would like that in an equation solving package, especially since people were taught from grade school on, to do multiplications and divisions before additions and subtractions.

    I implemented my entire language interpreter in 718 lines of C++ code (including comments), but I had hand-coded the parser. Looking back at it some years later, I could have saved some effort if I'd used flex and bison to generate some of that code instead. Perhaps you should read up on those as well.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Oh my


    I never took a class on compilers, parsing, langiage theory, etc. Just intro level undergrad courses. Would parsing be hard? I want to write something good, but I want to understand how to do it all and not get stuck on somethingt that I don't know.

    ?? Like what would I have to do to get a functional parser? My origional plan was to just use getline, string copy, and substring concat.
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Originally Posted by JohnReedlol
    I never took a class on compilers, parsing, langiage theory, etc. Just intro level undergrad courses. Would parsing be hard? I want to write something good, but I want to understand how to do it all and not get stuck on somethingt that I don't know.
    I only took a couple of CS courses in my entire education history. Most of what I know, I learned from experimentation and general interest in the subject,

    Originally Posted by JohnReedlol
    ?? Like what would I have to do to get a functional parser? My origional plan was to just use getline, string copy, and substring concat.
    A little while ago, I outlined some strategies for getting an interpreter to work. See http://forums.devshed.com/other-prog...rk-312483.html for some details. Happy reading.

    Oh and I looked at an earlier post I'd made about it and that time, the interpreter was about 550 lines of C++ code including some comments.
    Last edited by Scorpions4ever; October 12th, 2013 at 03:18 AM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo