From 5002f435ae360f74fbd1183ac8f392b49c804b54 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 9 Nov 2007 13:28:36 +0000 Subject: [PATCH] fixed: there was an error in Big::FromInt(Int value) SetSign() was used before the object was initialized git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@58 e52654a7-88a9-db11-a3e9-0013d4bc506e --- ttmath/ttmathbig.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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(); }