Add two rationals. @param b first rational @param c second rational @return b+c
Convert a double precision floating point number to a rational. inf is expressed as {1,0} or {-1,0} depending on the sign.
Divide one rational by another. @param b first rational @param c second rational @return b/c
Find the nearest value in q_list to q. @param q_list an array of rationals terminated by {0, 0} @return the index of the nearest value found in the array
Multiply two rationals. @param b first rational @param c second rational @return b*c
@return 1 if q1 is nearer to q than q2, -1 if q2 is nearer than q1, 0 if they have the same distance.
Reduce a fraction. This is useful for framerate calculations. @param dst_num destination numerator @param dst_den destination denominator @param num source numerator @param den source denominator @param max the maximum allowed for dst_num & dst_den @return 1 if exact, 0 otherwise
Subtract one rational from another. @param b first rational @param c second rational @return b-c
Compare two rationals. @param a first rational @param b second rational @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the values is of the form 0/0
Convert rational to double. @param a rational to convert @return (double) a
rational number numerator/denominator