calculation of decimal by m.ukai

open String
open Num#load"nums.cma"let(!)=length;;while 1=1do
Scanf.scanf"%s@.%s + %s@.%s "(fun a b c d->let n,e,f,t=num_of_string,!b,!d,Int 10in
let h=approx_num_fix(max e f)(n a+/n c+/n b//(t**/Int e)+/n d//(t**/Int f))in
print_endline(sub h 1(!h-1)))done

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

download

return to the top page