5
= ('a, 'b) Stdcompat__init.result
6
= Ok of 'a | Error of 'b
10
external raise_notrace : exn -> 'a = "%raise"
14
let bool_of_string_opt s =
15
Stdcompat__tools.option_invalid bool_of_string s
17
let int_of_string_opt s =
18
Stdcompat__tools.option_fail int_of_string s
20
let float_of_string_opt s =
21
Stdcompat__tools.option_fail float_of_string s
24
Stdcompat__tools.option_fail read_int ()
26
let read_float_opt () =
27
Stdcompat__tools.option_fail read_float ()
31
let print_bytes = print_string
33
let prerr_bytes = prerr_string
35
let output_bytes = output_string
37
let output_substring = output
39
let really_input_string channel len =
40
let s = String.create len in
41
really_input channel s 0 len;
44
type ('a, 'b, 'c, 'd, 'e, 'f) format6 =
45
('a, 'b, 'c, 'd, 'e, 'f) Stdcompat__init.format6
48
type ('a, 'b, 'c, 'd) format4 =
49
('a, 'b, 'c, 'c, 'c, 'd) format6
56
let __POS__ = ("", 0, 0, 0)
58
let __LOC_OF__ x = (__LOC__, x)
64
let __LINE_OF__ x = (0, x)
66
let __POS_OF__ x = (__POS__, x)
77
sqrt (x *. x +. y *. y)
80
if (x >= 0.) = (y >= 0.) then
87
external (~+) : int -> int = "%identity"
89
external (~+.) : float -> float = "%identity"
91
(* These emulations of expm1() and log1p() are due to William Kahan.
92
See http://www.plunk.org/~hatch/rightway.php *)
98
else if u -. 1. = -1. then
101
(u -. 1.) *. x /. log u
108
log u *. x /. (u -. 1.)