home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / math / 17811 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.4 KB

  1. Xref: sparky sci.math:17811 sci.math.num-analysis:3748
  2. Newsgroups: sci.math,sci.math.num-analysis
  3. Path: sparky!uunet!mercury.hsi.com!code3!rogerh
  4. From: rogerh@code3 (Roger Harrison)
  5. Subject: Approximating decimal fractions with proper fractions
  6. Message-ID: <C0ICCG.1BJ@hsi.com>
  7. Keywords: fraction, approximation, number theory
  8. Sender: news@hsi.com (USENET news)
  9. Nntp-Posting-Host: code3.code3.com
  10. Organization: 3M Health Information Systems
  11. Distribution: na
  12. Date: Thu, 7 Jan 1993 23:38:39 GMT
  13. Lines: 24
  14.  
  15. I am looking for an algorithm (preferably a computationally cheap one)
  16. to approximate a decimal fraction with a proper fraction for display 
  17. purposes.  The ideal algorithm would take a decimal fraction and the 
  18. maximum number of digits in the result's denominator to determine the 
  19. proper fraction (in numerator/denominator form) which best approximates 
  20. the original decimal fraction.
  21.  
  22. Stated more precisely:
  23.  
  24. Given the decimal fraction F, ( F = x/y where x < y, y = 10^n, n >= 1 ),
  25. what is the proper fraction, a/b, that best approximates F if b < 10^m, 
  26. m >= 1, m <= n.
  27.  
  28. I have spent a fair amount of time perusing books on number theory, but 
  29. these seem to deal with calculating decimal equivalents of fractions 
  30. rather than finding best-fit fractions for decimal equivalents.  I 
  31. would greatly appreciate any help either with an algorithm itself or 
  32. pointers toward published sources on the subject.
  33.  
  34. --
  35. Roger G. Harrison
  36. 3M Health Information Systems
  37. rogerh@code3.com
  38.  
  39.