reverting r9177: pow() is a basic math function and should be used instead of a hack
This commit is contained in:
parent
d1f5f2d37d
commit
af2ae0eac4
|
@ -1342,9 +1342,8 @@ tr_parseNumberRange( const char * str_in, int len, int * setmeCount )
|
||||||
double
|
double
|
||||||
tr_truncd( double x, int decimal_places )
|
tr_truncd( double x, int decimal_places )
|
||||||
{
|
{
|
||||||
static const int multiplier[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 };
|
const int i = (int) pow( 10, decimal_places );
|
||||||
const int64_t i = multiplier[decimal_places];
|
double x2 = (int)(x*i);
|
||||||
double x2 = (int64_t)(x*i);
|
|
||||||
return x2 / i;
|
return x2 / i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue