mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[poincare] No clone on Integer: copy assignment and copy constructor
automatically clone
This commit is contained in:
@@ -7,7 +7,7 @@ Integer Arithmetic::LCM(const Integer & a, const Integer & b) {
|
||||
if (a.isZero() || b.isZero()) {
|
||||
return Integer(0);
|
||||
}
|
||||
Integer signResult = Integer::Division(Integer::Multiplication(static_cast<Integer>(a.clone()), static_cast<Integer>(b.clone())), GCD(a, b)).quotient;
|
||||
Integer signResult = Integer::Division(Integer::Multiplication(static_cast<Integer>(a), static_cast<Integer>(b)), GCD(a, b)).quotient;
|
||||
//TODO Check if clone required or not
|
||||
signResult.setNegative(false);
|
||||
return signResult;
|
||||
@@ -15,11 +15,11 @@ Integer Arithmetic::LCM(const Integer & a, const Integer & b) {
|
||||
|
||||
Integer Arithmetic::GCD(const Integer & a, const Integer & b) {
|
||||
if (a.isInfinity() || b.isInfinity()) {
|
||||
return Integer::Overflow();
|
||||
return Integer::Overflow(false);
|
||||
}
|
||||
|
||||
Integer i = static_cast<Integer>(a.clone());
|
||||
Integer j = static_cast<Integer>(b.clone());
|
||||
Integer i = a;
|
||||
Integer j = b;
|
||||
i.setNegative(false);
|
||||
j.setNegative(false);
|
||||
do {
|
||||
@@ -45,7 +45,7 @@ void Arithmetic::PrimeFactorization(const Integer & n, Integer outputFactors[],
|
||||
assert(!n.isInfinity());
|
||||
|
||||
// Compute the absolute value of n
|
||||
Integer m = static_cast<Integer>(n.clone());
|
||||
Integer m = n;
|
||||
m.setNegative(false);
|
||||
|
||||
/* First we look for prime divisors in the table primeFactors (to speed up
|
||||
|
||||
@@ -90,8 +90,8 @@ Expression BinomialCoefficient::shallowReduce(Context & context, Preferences::An
|
||||
Rational r0 = static_cast<Rational>(c0);
|
||||
Rational r1 = static_cast<Rational>(c1);
|
||||
|
||||
Integer n = static_cast<Integer>(r0.signedIntegerNumerator().clone());
|
||||
Integer k = static_cast<Integer>(r1.signedIntegerNumerator().clone());
|
||||
Integer n = r0.signedIntegerNumerator();
|
||||
Integer k = r1.signedIntegerNumerator();
|
||||
if (n.isLowerThan(k)) {
|
||||
Expression result = Undefined();
|
||||
replaceWithInPlace(result);
|
||||
|
||||
Reference in New Issue
Block a user