title: Why use a hex literal for an int?
body: <p>Whilst reading over some existing code I came across:</p>
  
  <pre><code>public static readonly int MaxSize = 0x1000;
  </code></pre>
  
  <p>Which made me wonder why use a hex literal. In this context MaxSize is used for pagination.</p>
  
  <p>The closest I came to was: </p>
  
  <blockquote>
    <p>Hex numbers are a convenient way of expressing integral values,
    denoting exactly the bits stored in memory for that integer.</p>
  </blockquote>
  
  <p><a href="https://csharp.2000things.com/2010/08/28/72-hexadecimal-numbers/" rel="nofollow">https://csharp.2000things.com/2010/08/28/72-hexadecimal-numbers/</a></p>
  
  <p>Which makes sense to a degree, I'd be interested in hearing a more detailed explanation for this use case in particular "denoting exactly the bits stored in memory".</p>