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:
parent
d1f5f2d37d
commit
af2ae0eac4
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue