title: C A negative sign to a variable without assigning it
body: <p>I am looking at some C code, and the following example is confusing me.</p>
  
  <pre><code>theta = PI*0.5;
  if(xn&lt; 0.0 ) -theta;   // ???
  </code></pre>
  
  <p>When I compile, the compiler says the expression result is unused, and that's what I think is happening: <code>theta</code> with the negative sign is not assigned to anything.</p>
  
  <p>There are a couple parts in the source code like this, and I'm wondering if I'm missing anything since I'm not very well-versed in C. </p>
  
  <p>On the other hand, the code is provided by the government, and there is a part that checks if <code>someVariable &lt; 0.0</code> when <code>someVariable</code> is a constant that is a positive float. So I'm also thinking it's just the lazy programmer being lazy. Is this what's going on?</p>