12345678910111213141516171819202122232425262728293031323334353637383940moduleJs=Js_of_ocaml.Jstypet=Js.number_tletof_floatt=matchFloat.is_integertwith|true->Some(Js.floatt)|false->None;;letof_float_exnt=matchFloat.is_integertwith|true->Js.floatt|false->failwith("float specified is not an integer: "^Float.to_stringt);;letto_floatt=Js.to_floatt(** [Number] is an ECMAScript API so it should be available on every javascript
environment. We pull it at startup in an attempt to avoid shadowing/reassignment *)letnumber_class:Browser_js_types.js_number_classJs.t=Js.Unsafe.js_expr{|globalThis.Number|};;letis_int64(x:'aJs.t):bool=number_class##isIntegerx|>Js.to_boolletof_js_numbert=matchis_int64twith|true->Somet|false->None;;letof_js_number_exnt=matchis_int64twith|true->t|false->failwith("float specified is not an integer: "^Float.to_string(Js.to_floatt));;letto_js_numbert=t