decimal-to-fraction ruby script taken from http://codegolf.stackexchange.com/a/17340/8946