title: Integer overflow in library xlsLib in c++
body: <p>I wrote the following program with xlsLib in order to create an Excel xls file with a worksheet with 100 000 rows:</p>
  
  <pre><code>#include &lt;xlslib.h&gt;
  #include &lt;xlslib/number.h&gt;
  #include &lt;xlslib/common/xlstypes.h&gt;
  
  using namespace xlslib_core;
  using namespace xlslib_strings;
  
  int main()
  {
      workbook wb;
      worksheet *sh = wb.sheet( "DATA" );
  
      unsigned32_t numberRows    = 100000;
      unsigned32_t numberColumns = 10;
  
      for(unsigned32_t r=0;r&lt;numberRows;r++)
      {
          for(unsigned32_t c=0;c&lt;numberColumns;c++)
          {
              double number = r + c;
              sh-&gt;number( r, c, number );
          }
      }
      wb.Dump("/tmp/test.xls");
  
      return 0;
  }
  </code></pre>
  
  <p>When I open the file "test.xls" it appears that an integer overflow has ocurred: rows start to overlap since the value 65 535 that is the maximum value of a 16 unsigned integer. 
  I don't know if I have made some mistake or the xlsLib has some bug. I really appreciate some help.</p>
  
  <p>Thanks in advance.</p>