ocaml-containers/src/core/CCInt64.ml
Simon Cruanes 96ed8a37ab feat: introduce shim modules for 4.08 compat
- also make `unlabel` an explicit operation
- use `Stdlib` instead of `Pervasives`
- remove some warnings in Format
2019-06-14 18:26:14 -05:00

58 lines
927 B
OCaml

(* This file is free software, part of containers. See file "license" for more details. *)
open CCShims_
include Int64
let equal (x:t) y = Stdlib.(=) x y
module Infix = struct
let (+) = add
let (-) = sub
let (~-) = neg
let ( * ) = mul
let (/) = div
let (mod) = rem
let (land) = logand
let (lor) = logor
let (lxor) = logxor
let lnot = lognot
let (lsl) = shift_left
let (lsr) = shift_right_logical
let (asr) = shift_right
let (=) = equal
let (<>) = Stdlib.(<>)
let (<) = Stdlib.(<)
let (<=) = Stdlib.(<=)
let (>) = Stdlib.(>)
let (>=) = Stdlib.(>=)
end
include Infix
let hash x = Stdlib.abs (to_int x)
(** {2 Conversion} *)
let of_int_exn = of_int
let of_nativeint_exn = of_nativeint
let of_int32_exn = of_int32
let of_float_exn = of_float
let of_string_exn = of_string
let of_string x = try Some (of_string_exn x) with Failure _ -> None
let of_string_opt = of_string