Thursday, February 16, 2012

Lecture 2/16/2012 and Pre-Challenge 4.2.2

Current functionality of the current re-write ( ...3? ...4? treeAlg_v7) allows for tokenizing the equations.


Infinity and Div by 0

    C++ gives inf :

#include<iostream>
int main (int argc, char** argv)
{
  float answer = 1/0.f;
  std::cout << "1/0f gives " << answer << std::endl;
}

 
OUTPUT : 
1/0f gives inf

Regular Expressions
    \d+ <--find one or more digit 0-9 and any following digits
   \d* <-- permits 0 or more
   ( ) <-- catch, save for later not just match

....useful for tokenizing the string.... hrrrmmmm I've been doing this manually -_-

No comments:

Post a Comment