title: How to get represent undefined value C++?
body: <p>I have code that calculates two slopes and compares them, and if they are the same I get their values. </p>
  
  <p>However if one slope is undefined the program crashes. I need to know if they are the same even if they are undefined. I can't use any other negative or positive integers as that would mess up my code big time.</p>
  
  <p>I would prefer a word value, like 5/0 = undefined, but not sure how I could do that.</p>
  
  <p>For example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int r = 5/0;
  
  int main()
  {
      // Instead of crashing, this should tell me this value is undefined somehow.
      cout &lt;&lt; r &lt;&lt; endl;
      return 0;
  } 
  </code></pre>
  
  <p>How can I handle the case were the slope is exactly vertical?</p>