Revision 0912bf57

View differences:

libavutil/rational.c
102 102
 */
103 103
AVRational av_d2q(double d, int max){
104 104
    AVRational a;
105
    int exponent= FFMAX( (int)(log(ABS(d) + 1e-20)/log(2)), 0);
105
    int exponent= FFMAX( (int)(log(fabs(d) + 1e-20)/log(2)), 0);
106 106
    int64_t den= 1LL << (61 - exponent);
107 107
    av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
108 108

  

Also available in: Unified diff