1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

reverting r9177: pow() is a basic math function and should be used instead of a hack

This commit is contained in:
Mitchell Livingston 2010-05-31 13:43:33 +00:00
parent d1f5f2d37d
commit af2ae0eac4

View file

@ -1342,9 +1342,8 @@ tr_parseNumberRange( const char * str_in, int len, int * setmeCount )
double
tr_truncd( double x, int decimal_places )
{
static const int multiplier[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 };
const int64_t i = multiplier[decimal_places];
double x2 = (int64_t)(x*i);
const int i = (int) pow( 10, decimal_places );
double x2 = (int)(x*i);
return x2 / i;
}