Thread: Math Parser thingy.....it's kinda cool

  1. #16
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Quote Originally Posted by jverkoey
    It handles trig functions and exponents, it always has.
    Hmm... not very well then. cos(90) according to your parser is like -.447.... when the answer is actually 0. Same with sin.

  2. #17
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Radians...
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  3. #18
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Bah... how many people actually want it in radians tho?

  4. #19
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    So you can use pi, then?

    Do you just type in "pi," or what?

  5. #20
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    Um, I could define pi as a variable I suppose.

    Here, I'll put some variables in there that you guys can mess with.

  6. #21
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    I have defined a few variables for you to mess around with now: x, y, pi (const at 3.14159265), and array (a 25 value array).
    Example: sin(pi) or array[3]=x
    Variable values are kept between operations. So if you do array[3]=5 in one statement, the next time you call array[3], it will still be 5, assuming no one else changed it.
    There we go:

    x
    y
    array[25]
    pi (const)
    Last edited by jverkoey; 06-17-2005 at 01:58 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cool math homework assignment
    By BobMcGee123 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-23-2007, 08:21 PM
  2. Math parser
    By grepawksed in forum C++ Programming
    Replies: 1
    Last Post: 10-14-2005, 07:13 PM
  3. Problem with a file parser.
    By Hulag in forum C++ Programming
    Replies: 7
    Last Post: 03-17-2005, 09:54 AM
  4. I dunno, kinda cool
    By Silvercord in forum Game Programming
    Replies: 12
    Last Post: 07-03-2003, 09:45 PM