Commits

Lionel Flandrin committed 44fef5d

Fix compilation error on 32bit architectures

Comments (0)

Files changed (3)

 
   prefix = std::strlen(prefixes);
 
-  mul.pow(Integer(prefix + 1));
+  mul.pow(Integer(static_cast<unsigned long>(prefix + 1)));
 
   while (prefix--) {
     mul /= f;
   *this -= Integer(1);
 }
 
-unsigned long Integer::width() const {
+unsigned long Integer::width() const
+{
   unsigned long (*scan_f)(const mpz_t, unsigned long);
   unsigned long w, n;
 
   } while (n != static_cast<unsigned long>(-1));
 
   // If the number is negative we add 1 bit for the sign
-  return (*this < 0 ? w + 1 : w);
+  return (*this < 0) ? w + 1 : w;
 }
 
 

tests/expected-output.txt

 1*k + 1
 -3*GB - 253*MB - 262*kB - 913*B
 -3*G - 486*M - 784*k - 401
-21*GB + 866*MB + 680*kB + 441*B +0.0367928634484249785161
--23*G - 457*M - 341*k - 881 -0.0367928634484249785161
+21*GB + 866*MB + 680*kB + 441*B +0.0367928634484249784974
+-23*G - 457*M - 341*k - 881 -0.0367928634484249784974
 0*B
 0*B +0.01
 0 +0.00000050603