Old snapshot `bigint-2006.05.01'; see the ChangeLog file.
authorMatt McCutchen <hashproduct@gmail.com>
Sat, 27 Jan 2007 21:06:19 +0000 (16:06 -0500)
committerMatt McCutchen <hashproduct@gmail.com>
Sat, 27 Jan 2007 21:06:19 +0000 (16:06 -0500)
16 files changed:
.cdtproject [new file with mode: 0644]
.project [new file with mode: 0644]
BigInteger.cc
BigInteger.hh
BigIntegerLibrary.hh
BigIntegerUtils.cc
BigIntegerUtils.hh
BigUnsigned.cc
BigUnsigned.hh
BigUnsignedInABase.cc
BigUnsignedInABase.hh
ChangeLog
Makefile
NumberlikeArray.hh
README
sample.cc

diff --git a/.cdtproject b/.cdtproject
new file mode 100644 (file)
index 0000000..998bcd2
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.nullindexer" point="org.eclipse.cdt.core.CIndexer"/>
+<data>
+<item id="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+</item>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+</data>
+</cdtproject>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..d6e8622
--- /dev/null
+++ b/.project
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>bigint</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.make.core.makeBuilder</name>
+                       <arguments>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.arguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.core.errorOutputParser</key>
+                                       <value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.environment</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.inc</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.location</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.clean</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.command</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.full</key>
+                                       <value>clean all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.auto</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>false</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.make.core.makeNature</nature>
+               <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+       </natures>
+</projectDescription>
index 0ad7fc1..f70b021 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #include "BigInteger.hh"
index 5a091ad..c6bd908 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #ifndef BIGINTEGER
index 7f93b7d..2f01a3b 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 // This header file includes all the other header files.
index 636a4d7..ea00ed2 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #include "BigIntegerUtils.hh"
index 0587c96..118179b 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #ifndef BIGINTEGERUTILS
index 10c47db..33fe0af 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #include "BigUnsigned.hh"
@@ -428,7 +427,7 @@ void BigUnsigned::multiply(const BigUnsigned &a, const BigUnsigned &b) {
        for (i = 0; i < a.len; i++) {
                // For each 1-bit of that block...
                for (i2 = 0; i2 < N; i2++) {
-                       if ((a.blk[i] & (1 << i2)) == 0)
+                       if ((a.blk[i] & (Blk(1) << i2)) == 0)
                                continue;
                        /*
                        * Add b to this, shifted left i blocks and i2 bits.
@@ -623,7 +622,7 @@ void BigUnsigned::divideWithRemainder(const BigUnsigned &b, BigUnsigned &q) {
                        * the region of work2 we copy is just [i, k).
                        */
                        if (!borrowIn) {
-                               q.blk[i] |= (1 << i2);
+                               q.blk[i] |= (Blk(1) << i2);
                                while (k > i) {
                                        k--;
                                        blk[k] = work2[k];
index a62b7db..3e7aa10 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #ifndef BIGUNSIGNED
index 762f14e..f2a6f79 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 /*
index a2e4068..4096907 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 #ifndef BIGUNSIGNEDINABASE
index 25bc9fc..7aaced1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,14 @@
 +===================================================================+
 Matt McCutchen's Big Integer Library
-http://hashproduct.metaesthetics.net/bigint/
 
 Change Log
 ==========
 These entries tell you what was added, fixed, or improved in each version as compared to the previous one.  In case you haven't noticed, a version number roughly corresponds to the release date of that version in `YYYY.MM.DD[.N]' format, where `.N' goes `.2', `.3', etc. if there are multiple versions on the same day.
 
+2006.05.01
+----------
+I fixed incorrect results reported by Mohand Mezmaz and related memory corruption on platforms where Blk is bigger than int.  I replaced (1 << x) with (Blk(1) << x) in two places in BigUnsigned.cc.
+
 2006.04.24
 ----------
 Two bug fixes: BigUnsigned "++x" no longer segfaults when x grows in length, and BigUnsigned == and != are now redeclared so as to be usable.  I redid the Makefile: I removed the *.tag mechanism and hard-coded the library's header dependencies, I added comments, and I made the Makefile more useful for building one's own programs instead of just the sample.
index c99cf54..ab917ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,5 @@
 #
 # Matt McCutchen's Big Integer Library
-# http://hashproduct.metaesthetics.net/bigint/
 #
 
 # Mention default target.
index 552ecfb..ab0aae0 100644 (file)
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 /*
diff --git a/README b/README
index 6fb020e..f45ea24 100644 (file)
--- a/README
+++ b/README
@@ -1,11 +1,12 @@
 +===================================================================+
 | Big Integer Library                                               |
 | A C++ library that does arithmetic on integers of unlimited size. |
-| Version 2006.02.26                                                |
+| Version 2006.05.01                                                |
 +-------------------------------------------------------------------+
 | By Matt McCutchen                                                 |
-| E-mail: hashproduct@verizon.net                                   |
-| Project Web site: http://hashproduct.metaesthetics.net/bigint/    |
+| E-mail: hashproduct@gmail.com                                     |
+| My Web site gateway: http://mysite.verizon.net/hashproduct/       |
+| Project Web site: http://www.kepreon.com/~matt/bigint/            |
 +===================================================================+
 
 What the Big Integer Library provides
@@ -30,6 +31,6 @@ The library has been tested by myself and others but is by no means bug-free.  T
 
 Keep in touch
 =============
-Feel free to e-mail me at `hashproduct@verizon.net' to report bugs or request features.  When I fix the bug or add the feature, you will generally be credited by name in the source code and/or the Change Log unless you request otherwise.  I am also curious as to what uses you find for the library.  If you would like an e-mail whenever a new version of the library is released, e-mail me to join my informal mailing list.  New versions of the library will be available at the project Web site at `http://hashproduct.metaesthetics.net/bigint/'.
+Feel free to e-mail me at `hashproduct@gmail.com' to report bugs or request features.  When I fix the bug or add the feature, you will generally be credited by name in the source code and/or the Change Log unless you request otherwise.  I am also curious as to what uses you find for the library.  New versions of the library will be available at the project Web site.
 
 =====================================================================
\ No newline at end of file
index 5eab984..5344781 100644 (file)
--- a/sample.cc
+++ b/sample.cc
@@ -1,6 +1,5 @@
 /*
 * Matt McCutchen's Big Integer Library
-* http://hashproduct.metaesthetics.net/bigint/
 */
 
 /*