user33435: I'm guessing that the answer to this is "no," but I'm curious if there is any way to save writing some code by specifying a function to do the opposite of whatever another function does. For example the inverse of:
int FW (int in)
{
  int out=2+in;
  Return out
}

would be
int RV (int in)
{
  int out=in-2;
  Return out
}

However, would there be any way to call the inverse of FW() if it was a more complicated function that still had one and only one input for each output?  

user4143: No. A function does what it does and that is all. No other function can know what some other function does.
You could write a function that does different things depending on what parameters you pass to it, but that's the closest you can get, and is pretty pointless when you can just write different functions anyway.

33435: <p>I'm guessing that the answer to this is "no," but I'm curious if there is any way to save writing some code by specifying a function to do the opposite of whatever another function does. For example the inverse of:</p>

<pre><code>int FW (int in)
{
  int out=2+in;
  Return out
}
</code></pre>

<p>would be</p>

<pre><code>int RV (int in)
{
  int out=in-2;
  Return out
}
</code></pre>

<p>However, would there be any way to call the inverse of <code>FW()</code> if it was a more complicated function that still had one and only one input for each output?  </p>
 4143: <p>No. A function does what it does and that is all. No other function can know what some other function does.</p>

<p>You could write a function that does different things depending on what parameters you pass to it, but that's the closest you can get, and is pretty pointless when you can just write different functions anyway.</p>
