num-bigint
num-bigint copied to clipboard
Set and multiply signs of a `BigInt`
Currently, the only way to directly change the sign of a BigInt is to use.into_parts() and then BigInt::from_biguint(). It would be more convenient if we could directly set the sign, via a .set_sign() method or similar.
Especially for equations where terms of (-1)ⁿ are present, it would also be more convenient if there was a Mul<Sign> and MulAssign<Sign> impl so that one can e.g.
let minus_1_coef: Sign = Sign::Minus;
let answer: BigInt;
// ...
loop {
minus_1_coef = -minus_1_coef;
answer *= minus_1_coef;
// ...
}
Just wanted to ask if this feature is still considered? Or is it too complicated, takes too much time, goes against design etc?