rational.h 600 B

12345678910111213141516171819
  1. /*
  2. * rational fractions
  3. *
  4. * Copyright (C) 2009 emlix GmbH, Oskar Schirmer <oskar@scara.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. #ifndef _LINUX_RATIONAL_H
  11. #define _LINUX_RATIONAL_H
  12. void rational_best_approximation(
  13. unsigned long given_numerator, unsigned long given_denominator,
  14. unsigned long max_numerator, unsigned long max_denominator,
  15. unsigned long *best_numerator, unsigned long *best_denominator);
  16. #endif /* _LINUX_RATIONAL_H */