Ignore:
Timestamp:
May 31, 2010, 1:43:33 PM (12 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r10390 r10710  
    13431343tr_truncd( double x, int decimal_places )
    13441344{
    1345     static const int multiplier[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 };
    1346     const int64_t i = multiplier[decimal_places];
    1347     double x2 = (int64_t)(x*i);
     1345    const int i = (int) pow( 10, decimal_places ); 
     1346    double x2 = (int)(x*i);
    13481347    return x2 / i;
    13491348}
Note: See TracChangeset for help on using the changeset viewer.