~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavutil/mathematics.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        c-= mod;
151
151
    return c;
152
152
}
153
 
 
154
 
#ifdef TEST
155
 
#include "integer.h"
156
 
#undef printf
157
 
int main(void){
158
 
    int64_t a,b,c,d,e;
159
 
 
160
 
    for(a=7; a<(1LL<<62); a+=a/3+1){
161
 
        for(b=3; b<(1LL<<62); b+=b/4+1){
162
 
            for(c=9; c<(1LL<<62); c+=(c*2)/5+3){
163
 
                int64_t r= c/2;
164
 
                AVInteger ai;
165
 
                ai= av_mul_i(av_int2i(a), av_int2i(b));
166
 
                ai= av_add_i(ai, av_int2i(r));
167
 
 
168
 
                d= av_i2int(av_div_i(ai, av_int2i(c)));
169
 
 
170
 
                e= av_rescale(a,b,c);
171
 
 
172
 
                if((double)a * (double)b / (double)c > (1LL<<63))
173
 
                    continue;
174
 
 
175
 
                if(d!=e) printf("%"PRId64"*%"PRId64"/%"PRId64"= %"PRId64"=%"PRId64"\n", a, b, c, d, e);
176
 
            }
177
 
        }
178
 
    }
179
 
    return 0;
180
 
}
181
 
#endif