diff options
Diffstat (limited to 'include/linux/rational.h')
| -rw-r--r-- | include/linux/rational.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/rational.h b/include/linux/rational.h new file mode 100644 index 000000000000..4f532fcd9eea --- /dev/null +++ b/include/linux/rational.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * rational fractions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 emlix GmbH, Oskar Schirmer <os@emlix.com> | ||
| 5 | * | ||
| 6 | * helper functions when coping with rational numbers, | ||
| 7 | * e.g. when calculating optimum numerator/denominator pairs for | ||
| 8 | * pll configuration taking into account restricted register size | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _LINUX_RATIONAL_H | ||
| 12 | #define _LINUX_RATIONAL_H | ||
| 13 | |||
| 14 | void rational_best_approximation( | ||
| 15 | unsigned long given_numerator, unsigned long given_denominator, | ||
| 16 | unsigned long max_numerator, unsigned long max_denominator, | ||
| 17 | unsigned long *best_numerator, unsigned long *best_denominator); | ||
| 18 | |||
| 19 | #endif /* _LINUX_RATIONAL_H */ | ||
