10 let eq_float x y = abs_float (x -. y) < 1e-13
13 let top = GWindow.window () in
14 top#connect#destroy ~callback:Main.quit;
15 let vbox = GPack.vbox ~packing: top#add () in
16 let entry = GEdit.entry ~max_length: 20 ~packing: vbox#add () in
17 let tips = GData.tooltips () in
18 tips#set_tip entry#coerce ~text:"Initial value for fix-point";
20 GEdit.entry ~max_length: 20 ~editable: false ~packing: vbox#add () in
22 entry#connect#activate ~callback:
24 let x = try float_of_string entry#text with _ -> 0.0 in
25 entry#set_text (string_of_float (cos x));
26 let res = fix ~f:cos ~eq:eq_float x in
27 result#set_text (string_of_float res)