title: When is htonl(x) != ntohl(x) ? (Or when is converting to and from Network Byte Order not equivalent on the same machine?)
body: <p>In regards to <a href="http://linux.die.net/man/3/htonl" rel="noreferrer">htonl</a> and <a href="http://linux.die.net/man/3/htonl" rel="noreferrer">ntohl</a>.  When would either of these two lines of code evaluate to false.</p>
  
  <pre><code> htonl(x) == ntohl(x);
  
   htonl(ntohl(x)) == htonl(htonl(x));
  </code></pre>
  
  <p>In other words, when are these two operations not equivalent <strong>on the same machine</strong>? The only scenario I can think of is a machine that does not work on 2's complement for representing integers.</p>
  
  <p>Is the reason largely historical, for coding clarity, or for something else?</p>
  
  <p>Do any modern architectures or environments exists today where these converting to and from network byte order on the same machine is not the same code in either direction?</p>