strtoul of negative number
<p>The following C++ program calls <code>strtoul</code> of negative 1.  Since no negative numbers are representable in any unsigned type, I had expected this to fail and return 0</p>

<blockquote>
  <p><a href="http://www.cplusplus.com/reference/cstdlib/strtoul/" rel="nofollow noreferrer">If no valid conversion could be performed, a zero value is returned.</a></p>
</blockquote>

<p>but instead a large positive number is returned</p>

<blockquote>
  <p><a href="http://www.cplusplus.com/reference/cstdlib/strtoul/" rel="nofollow noreferrer">If the value read is out of the range of representable values by an unsigned long int, the function returns <code>ULONG_MAX</code> (defined in <code>&lt;climits&gt;</code>), and <code>errno</code> is set to <code>ERANGE</code>.</a></p>
</blockquote>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

int main () {
  {char s[] = "-1";
    for (int b=0; b&lt;17; ++b)
      std::cout &lt;&lt; "strtoul (unsigned) of " &lt;&lt; s
                &lt;&lt; " with base arg " &lt;&lt; b
                &lt;&lt; ": " &lt;&lt; strtoul(s,0,b) &lt;&lt; std::endl;}
}
</code></pre>

<p>Why does strtoul not fail and return 0 for negative numbers?</p>