A little haskell command-line script to calculate good, small rational approximations of real numbers. Eg: approximating 0.13 yields 1/7 ≈ 0.1429, 1/8 = .125, 3/23 ≈ 0.1304, 13/100 = 0.13 in that order. Useful more often than I expected. Uses continued fractions (default) or Farey sequences (generates more approximations / converges more slowly).
https://gist.github.com/rntz/6713db2a10ae51bdb6c0d232640eb5e4

