<p>Is the instance variable &#39;this.loadFactor&#39; by any chance of integer type?</p>
<p>Regards,<br>
Bernardo van der Wal</p>
<div class="gmail_quote">On Jul 26, 2011 5:01 AM, &quot;Ben Pryor&quot; &lt;<a href="mailto:salexwhisp@gmail.com">salexwhisp@gmail.com</a>&gt; wrote:<br type="attribution">&gt; I sometimes get this exception (mono 2.8) - running fully bundled (exe +<br>
&gt; deps).  It happens very rarely.  64 bit suse system.<br>&gt; <br>&gt; How is this exception possible?<br>&gt; <br>&gt; Stack Trace:<br>&gt;     at System.Collections.Hashtable..ctor (Int32 capacity, Single<br>&gt; loadFactor, IHashCodeProvider hcp, IComparer comparer) [0x00000] in<br>
&gt; &lt;filename unknown&gt;:0<br>&gt;     at System.Collections.Hashtable..ctor (Int32 capacity, Single<br>&gt; loadFactor) [0x00000] in &lt;filename unknown&gt;:0<br>&gt;     at System.Collections.Hashtable..ctor (Int32 capacity) [0x00000] in<br>
&gt; &lt;filename unknown&gt;:0<br>&gt;     at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider<br>&gt; obj, System.Type attributeType, Boolean inherit) [0x00000] in &lt;filename<br>&gt; unknown&gt;:0<br>
&gt;     at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider<br>&gt; obj, Boolean inherit) [0x00000] in &lt;filename unknown&gt;:0<br>&gt;     at System.Reflection.MonoField.GetCustomAttributes (Boolean inherit)<br>
&gt; [0x00000] in &lt;filename unknown&gt;:0<br>&gt; <br>&gt; <br>&gt; Code from hashtable:<br>&gt; <br>&gt; public Hashtable (int capacity, float loadFactor, IHashCodeProvider hcp,<br>&gt; IComparer comparer) {<br>&gt;                         if (capacity&lt;0)<br>
&gt;                                 throw new ArgumentOutOfRangeException<br>&gt; (&quot;capacity&quot;, &quot;negative capacity&quot;);<br>&gt;                         if (loadFactor &lt; 0.1f || loadFactor &gt; 1.0f ||<br>
&gt; Single.IsNaN (loadFactor))<br>&gt;                                 throw new ArgumentOutOfRangeException<br>&gt; (&quot;loadFactor&quot;, &quot;load factor&quot;);<br>&gt;                         if (capacity == 0) ++capacity;<br>
&gt;                         this.loadFactor = 0.75f*loadFactor;<br>&gt;                         double tableSize = capacity / this.loadFactor;<br>&gt;                         if (tableSize &gt; Int32.MaxValue)<br>&gt;                                 throw new ArgumentException (&quot;Size is too<br>
&gt; big&quot;);<br>&gt;                         int size = (int) tableSize;<br>&gt;                         size = ToPrime (size);<br>&gt;                         this.SetTable (new Slot [size], new int [size]);<br>&gt;                         this.hcp = hcp;<br>
&gt;                         this.comparer = comparer;<br>&gt;                         this.inUse = 0;<br>&gt;                         this.modificationCount = 0;<br>&gt;                 }<br>&gt; The only divide in there is is a float divide.  It wouldn&#39;t try to convert<br>
&gt; &#39;this.loadFactor&#39; to an int and then do int divide would it?<br>&gt; <br>&gt; Thanks<br></div>