In regards to htonl and ntohl. When would either of these two lines of code evaluate to false.
htonl(x) == ntohl(x);
htonl(ntohl(x)) == htonl(htonl(x));
In other words, when are these two operations not equivalent on the same machine? The only scenario I can think of is a machine that does not work on 2's complement for representing integers.
Is the reason largely historical, for coding clarity, or for something else?
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?