diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index e216a95..eb767b6 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -2229,16 +2229,19 @@ public: void FromInt(Int value) { info = 0; + bool is_sign = false; if( value.IsSign() ) { value.ChangeSign(); - SetSign(); + is_sign = true; } - + sint compensation = (sint)value.CompensationToLeft(); + FromUIntOrInt(value, compensation); - return FromUIntOrInt(value, compensation); + if( is_sign ) + SetSign(); }