fixed: Int::ToUInt(unsigned int & result)
wrong carry was returned git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@318 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
362207e2f1
commit
648de47400
|
@ -1256,14 +1256,12 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToUInt(unsigned int & result) const
|
uint ToUInt(unsigned int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
|
|
||||||
uint c = UInt<value_size>::ToUInt(result);
|
uint c = UInt<value_size>::ToUInt(result);
|
||||||
|
|
||||||
if( c )
|
if( c || IsSign() )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return (int(result) < 0) ? 1 : 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1274,7 +1272,6 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToInt(unsigned int & result) const
|
uint ToInt(unsigned int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
return ToUInt(result);
|
return ToUInt(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1286,8 +1283,6 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToInt(int & result) const
|
uint ToInt(int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
|
|
||||||
uint first = UInt<value_size>::table[0];
|
uint first = UInt<value_size>::table[0];
|
||||||
|
|
||||||
result = int(first);
|
result = int(first);
|
||||||
|
|
|
@ -3151,8 +3151,6 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToUInt(unsigned int & result) const
|
uint ToUInt(unsigned int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
|
|
||||||
result = (unsigned int)table[0];
|
result = (unsigned int)table[0];
|
||||||
|
|
||||||
if( (table[0] >> 32) != 0 )
|
if( (table[0] >> 32) != 0 )
|
||||||
|
@ -3173,8 +3171,6 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToInt(unsigned int & result) const
|
uint ToInt(unsigned int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
|
|
||||||
return ToUInt(result);
|
return ToUInt(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3186,8 +3182,6 @@ public:
|
||||||
*/
|
*/
|
||||||
uint ToInt(int & result) const
|
uint ToInt(int & result) const
|
||||||
{
|
{
|
||||||
// !! need testing
|
|
||||||
|
|
||||||
unsigned int temp;
|
unsigned int temp;
|
||||||
|
|
||||||
uint c = ToUInt(temp);
|
uint c = ToUInt(temp);
|
||||||
|
|
Loading…
Reference in New Issue