<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+==
+  * Bug Fixes
+    * Fix bignum encoding
+
 == 1.1.0 / 2009-10-08
   * Minor Improvements
     * Implement Bignum encoding</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -101,10 +101,10 @@ module Erlectricity
     def write_bignum_guts(num)
       write_1 (num &gt;= 0 ? 0 : 1)
       num = num.abs
-      i = 0
-      while (rem = (num &gt;&gt; i * 8) % (256)) != 0
+      while num != 0
+        rem = num % 256
         write_1 rem
-        i += 1
+        num = num &gt;&gt; 8
       end
     end
 </diff>
      <filename>lib/erlectricity/encoder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,7 @@ context &quot;When packing to a binary stream&quot; do
     write_any(-(1 &lt;&lt; 27)).should == get_erl_with_magic(&quot;#{-(1 &lt;&lt; 27)}&quot;)
 
     # #SMALL_BIGNUMS
+    get{@encoder.write_fixnum(10_000_000_000_000_000_000)}.should == get_erl(&quot;10000000000000000000&quot;)
     get{@encoder.write_fixnum(1254976067)}.should == get_erl(&quot;1254976067&quot;)
     get{@encoder.write_fixnum(-1254976067)}.should == get_erl(&quot;-1254976067&quot;)
     # get{@encoder.write_fixnum((1 &lt;&lt; word_length))}.should == get_erl(&quot;#{(1 &lt;&lt; word_length)}&quot;)</diff>
      <filename>test/encode_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2c5c4c472aebefdebdfacc225e9e4dfb9c10fb5f</id>
    </parent>
  </parents>
  <author>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </author>
  <url>http://github.com/mojombo/erlectricity/commit/9257ecc222ba5e489ced8d40c6190a4d1aea2826</url>
  <id>9257ecc222ba5e489ced8d40c6190a4d1aea2826</id>
  <committed-date>2009-10-28T12:19:56-07:00</committed-date>
  <authored-date>2009-10-28T12:19:56-07:00</authored-date>
  <message>fix bignum encoding</message>
  <tree>05c9188cc2cde6d957375f3305eab2e0c135d737</tree>
  <committer>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </committer>
</commit>
