changed: removing some MS VC warnings when compiling x86_64 target
git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@191 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
e13e5eb329
commit
b3d27979d0
|
@ -985,7 +985,7 @@ public:
|
||||||
// man_result = mantissa * ss2.mantissa
|
// man_result = mantissa * ss2.mantissa
|
||||||
mantissa.MulInt(ss2, man_result);
|
mantissa.MulInt(ss2, man_result);
|
||||||
|
|
||||||
int bit = UInt<man>::FindLeadingBitInWord(man_result.table[man]); // man - last word
|
sint bit = UInt<man>::FindLeadingBitInWord(man_result.table[man]); // man - last word
|
||||||
|
|
||||||
if( bit!=-1 && uint(bit) > (TTMATH_BITS_PER_UINT/2) )
|
if( bit!=-1 && uint(bit) > (TTMATH_BITS_PER_UINT/2) )
|
||||||
{
|
{
|
||||||
|
@ -4039,11 +4039,11 @@ public:
|
||||||
(signs are not checked, we don't check the NaN flag too)
|
(signs are not checked, we don't check the NaN flag too)
|
||||||
|
|
||||||
sample:
|
sample:
|
||||||
Big<1,1> a, b;
|
Big<1,1> a, b;
|
||||||
a = " 1234.5678";
|
a = " 1234.5678";
|
||||||
b = "-1234.5677999";
|
b = "-1234.5677999";
|
||||||
// binary a: 10011010010.100100010101101101010
|
// binary a: 10011010010.100100010101101101010
|
||||||
// binary b: -10011010010.100100010101101101000
|
// binary b: -10011010010.100100010101101101000
|
||||||
// two last bits are different
|
// two last bits are different
|
||||||
if( a.AboutEqualWithoutSign(b, 2) ) // the result is true
|
if( a.AboutEqualWithoutSign(b, 2) ) // the result is true
|
||||||
std::cout << "true" << std::endl;
|
std::cout << "true" << std::endl;
|
||||||
|
@ -4093,11 +4093,11 @@ public:
|
||||||
|
|
||||||
this method is similar to AboutEqualWithoutSign but the signs are checked now
|
this method is similar to AboutEqualWithoutSign but the signs are checked now
|
||||||
sample:
|
sample:
|
||||||
Big<1,1> a, b;
|
Big<1,1> a, b;
|
||||||
a = "456.6789";
|
a = "456.6789";
|
||||||
b = "456.678901";
|
b = "456.678901";
|
||||||
// binary a: 111001000.10101101110011000101111
|
// binary a: 111001000.10101101110011000101111
|
||||||
// binary b: 111001000.10101101110011000110111
|
// binary b: 111001000.10101101110011000110111
|
||||||
// five last bits are different
|
// five last bits are different
|
||||||
if( a.AboutEqual(b, 5) ) // the result is true
|
if( a.AboutEqual(b, 5) ) // the result is true
|
||||||
std::cout << "true" << std::endl;
|
std::cout << "true" << std::endl;
|
||||||
|
|
|
@ -1356,6 +1356,8 @@ void Avg(int sindex, int amount_of_args, ValueType & result)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
we use such a method because 'wvsprintf' is not everywhere defined
|
we use such a method because 'wvsprintf' is not everywhere defined
|
||||||
*/
|
*/
|
||||||
|
@ -1364,14 +1366,25 @@ void Sprintf(tt_char * buffer, int par)
|
||||||
char buf[30]; // char, not tt_char
|
char buf[30]; // char, not tt_char
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable: 4996 )
|
||||||
|
//warning C4996: 'sprintf': This function or variable may be unsafe.
|
||||||
|
#endif
|
||||||
|
|
||||||
sprintf(buf, "%d", par);
|
sprintf(buf, "%d", par);
|
||||||
for(i=0 ; buf[i] != 0 ; ++i)
|
for(i=0 ; buf[i] != 0 ; ++i)
|
||||||
buffer[i] = buf[i];
|
buffer[i] = buf[i];
|
||||||
|
|
||||||
buffer[i] = 0;
|
buffer[i] = 0;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( default: 4996 )
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
this method returns the value from a user-defined function
|
this method returns the value from a user-defined function
|
||||||
|
|
||||||
|
@ -1678,7 +1691,7 @@ void ReadValue(Item & result, int reading_base)
|
||||||
const tt_char * new_stack_pointer;
|
const tt_char * new_stack_pointer;
|
||||||
bool value_read;
|
bool value_read;
|
||||||
|
|
||||||
int carry = result.value.FromString(pstring, reading_base, &new_stack_pointer, &value_read);
|
uint carry = result.value.FromString(pstring, reading_base, &new_stack_pointer, &value_read);
|
||||||
pstring = new_stack_pointer;
|
pstring = new_stack_pointer;
|
||||||
|
|
||||||
if( carry )
|
if( carry )
|
||||||
|
@ -1979,7 +1992,7 @@ return 0;
|
||||||
void MakeStandardMathematicOperation(ValueType & value1, typename MatOperator::Type mat_operator,
|
void MakeStandardMathematicOperation(ValueType & value1, typename MatOperator::Type mat_operator,
|
||||||
const ValueType & value2)
|
const ValueType & value2)
|
||||||
{
|
{
|
||||||
int res;
|
uint res;
|
||||||
|
|
||||||
switch( mat_operator )
|
switch( mat_operator )
|
||||||
{
|
{
|
||||||
|
|
|
@ -741,11 +741,11 @@ namespace ttmath
|
||||||
temp1.u_.high = a_.u_.low;
|
temp1.u_.high = a_.u_.low;
|
||||||
temp1.u_.low = b_.u_.high;
|
temp1.u_.low = b_.u_.high;
|
||||||
|
|
||||||
res_.u_.high = temp1.u / c;
|
res_.u_.high = (unsigned int)(temp1.u / c);
|
||||||
temp2.u_.high = temp1.u % c;
|
temp2.u_.high = (unsigned int)(temp1.u % c);
|
||||||
temp2.u_.low = b_.u_.low;
|
temp2.u_.low = b_.u_.low;
|
||||||
|
|
||||||
res_.u_.low = temp2.u / c;
|
res_.u_.low = (unsigned int)(temp2.u / c);
|
||||||
*rest = temp2.u % c;
|
*rest = temp2.u % c;
|
||||||
|
|
||||||
*r = res_.u;
|
*r = res_.u;
|
||||||
|
|
Loading…
Reference in New Issue