Egyptian fraction by rst76

m@main=do s<-getLine;putStrLn$s++" ="++drop 2(do(a,_:b)<-reads s;a&read b);m
a&b=do c<-[-div(-b)a|a>0];" + 1/"++show c++(a*c-b)&(b*c)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page