rational.c File Reference
#include "avassert.h"
#include <limits.h>
#include "common.h"
#include "mathematics.h"
#include "rational.h"

Go to the source code of this file.


int av_reduce (int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
 Reduce a fraction. More...
AVRational av_mul_q (AVRational b, AVRational c)
 Multiply two rationals. More...
AVRational av_div_q (AVRational b, AVRational c)
 Divide one rational by another. More...
AVRational av_add_q (AVRational b, AVRational c)
 Add two rationals. More...
AVRational av_sub_q (AVRational b, AVRational c)
 Subtract one rational from another. More...
AVRational av_d2q (double d, int max)
 Convert a double precision floating point number to a rational. More...
int av_nearer_q (AVRational q, AVRational q1, AVRational q2)
 Find which of the two rationals is closer to another rational. More...
int av_find_nearest_q_idx (AVRational q, const AVRational *q_list)
 Find the value in a list of rationals nearest a given reference rational. More...
uint32_t av_q2intfloat (AVRational q)
 Convert an AVRational to a IEEE 32-bit float expressed in fixed-point format. More...
AVRational av_gcd_q (AVRational a, AVRational b, int max_den, AVRational def)
 Return the best rational so that a and b are multiple of it. More...

Detailed Description

rational numbers

Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file rational.c.