2009-06-11 20:51:15 +07:00
|
|
|
/*
|
|
|
|
* rational fractions
|
|
|
|
*
|
2012-05-16 16:41:19 +07:00
|
|
|
* Copyright (C) 2009 emlix GmbH, Oskar Schirmer <oskar@scara.com>
|
2009-06-11 20:51:15 +07:00
|
|
|
*
|
|
|
|
* helper functions when coping with rational numbers,
|
|
|
|
* e.g. when calculating optimum numerator/denominator pairs for
|
|
|
|
* pll configuration taking into account restricted register size
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_RATIONAL_H
|
|
|
|
#define _LINUX_RATIONAL_H
|
|
|
|
|
|
|
|
void rational_best_approximation(
|
|
|
|
unsigned long given_numerator, unsigned long given_denominator,
|
|
|
|
unsigned long max_numerator, unsigned long max_denominator,
|
|
|
|
unsigned long *best_numerator, unsigned long *best_denominator);
|
|
|
|
|
|
|
|
#endif /* _LINUX_RATIONAL_H */
|