the % operator with the RossiBigInt class gives a strange error message
I am trying to take % for a large number it fails, when I use small numbers every thing goes ok
Isn't this supposed to be a large integer library
I use Linux Slamd64, it is clear that my arch is x86_64
I use Intel core 2 due processor, actually I am not thinking that this may cause the problem
because the source code is supposed to be portable
any way i am attaching the program the causes the error
RossiBigInt gcd(RossiBigInt a , RossiBigInt b)
while ( b != RossiBigInt("0",DEC_DIGIT) )
RossiBigInt temp = a;
a = b;
b = temp % b;
I use this line to compile
g++ test.cpp bigint.o -o test
This is the error message that comeout
test: bigint.cpp:1563: RossiBigInt RossiBigInt::Divide(const RossiBigInt&, const RossiBigInt&, RossiBigInt*) const: Assertion `(quotient * divisor_i + remainder) == dividend_i' failed.
can any one help me
It seems that I have solved the problem.
as I think the problem comes because the code is not fully portable for 64bit architectures
I have just recompiled the package for compatibility with 32bit
I have added -m32 to the compilation flags
and -m32 to the ldflag and every thing goes ok
I think the writer of the code has to do some job to take in mind other architecture to produce protable code!!
C++ BigInt Class: Release 3.0 is availble now at http://sourceforge.net/projects/cpp-bigint/